@ignite-ember/ui-react 0.0.0-stage → 0.2.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 +202 -0
- package/NOTICE +5 -0
- package/README.md +217 -2
- package/dist/CopySource.d.ts +4 -0
- package/dist/CopySource.d.ts.map +1 -0
- package/dist/CopySource.js +36 -0
- package/dist/CopySource.js.map +1 -0
- package/dist/DataTable.d.ts +61 -0
- package/dist/DataTable.d.ts.map +1 -0
- package/dist/DataTable.js +29 -0
- package/dist/DataTable.js.map +1 -0
- package/dist/ErrorBoundary.d.ts +68 -0
- package/dist/ErrorBoundary.d.ts.map +1 -0
- package/dist/ErrorBoundary.js +63 -0
- package/dist/ErrorBoundary.js.map +1 -0
- package/dist/LiveRegion.d.ts +35 -0
- package/dist/LiveRegion.d.ts.map +1 -0
- package/dist/LiveRegion.js +70 -0
- package/dist/LiveRegion.js.map +1 -0
- package/dist/Markdown.d.ts +18 -0
- package/dist/Markdown.d.ts.map +1 -0
- package/dist/Markdown.js +52 -0
- package/dist/Markdown.js.map +1 -0
- package/dist/MarkdownInline.d.ts +44 -0
- package/dist/MarkdownInline.d.ts.map +1 -0
- package/dist/MarkdownInline.js +144 -0
- package/dist/MarkdownInline.js.map +1 -0
- package/dist/MenuIcon.d.ts +54 -0
- package/dist/MenuIcon.d.ts.map +1 -0
- package/dist/MenuIcon.js +96 -0
- package/dist/MenuIcon.js.map +1 -0
- package/dist/Mermaid.d.ts +38 -0
- package/dist/Mermaid.d.ts.map +1 -0
- package/dist/Mermaid.js +119 -0
- package/dist/Mermaid.js.map +1 -0
- package/dist/Monogram.d.ts +42 -0
- package/dist/Monogram.d.ts.map +1 -0
- package/dist/Monogram.js +88 -0
- package/dist/Monogram.js.map +1 -0
- package/dist/OverflowMenu.d.ts +55 -0
- package/dist/OverflowMenu.d.ts.map +1 -0
- package/dist/OverflowMenu.js +141 -0
- package/dist/OverflowMenu.js.map +1 -0
- package/dist/Shell.d.ts +54 -0
- package/dist/Shell.d.ts.map +1 -0
- package/dist/Shell.js +31 -0
- package/dist/Shell.js.map +1 -0
- package/dist/Skeleton.d.ts +32 -0
- package/dist/Skeleton.d.ts.map +1 -0
- package/dist/Skeleton.js +26 -0
- package/dist/Skeleton.js.map +1 -0
- package/dist/Split.d.ts +66 -0
- package/dist/Split.d.ts.map +1 -0
- package/dist/Split.js +133 -0
- package/dist/Split.js.map +1 -0
- package/dist/Toast.d.ts +87 -0
- package/dist/Toast.d.ts.map +1 -0
- package/dist/Toast.js +118 -0
- package/dist/Toast.js.map +1 -0
- package/dist/Tooltip.d.ts +15 -0
- package/dist/Tooltip.d.ts.map +1 -0
- package/dist/Tooltip.js +144 -0
- package/dist/Tooltip.js.map +1 -0
- package/dist/cx.d.ts +3 -0
- package/dist/cx.d.ts.map +1 -0
- package/dist/cx.js +5 -0
- package/dist/cx.js.map +1 -0
- package/dist/fenceInfo.d.ts +23 -0
- package/dist/fenceInfo.d.ts.map +1 -0
- package/dist/fenceInfo.js +19 -0
- package/dist/fenceInfo.js.map +1 -0
- package/dist/index.d.ts +82 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +82 -0
- package/dist/index.js.map +1 -0
- package/dist/primitives.d.ts +383 -0
- package/dist/primitives.d.ts.map +1 -0
- package/dist/primitives.js +340 -0
- package/dist/primitives.js.map +1 -0
- package/package.json +56 -4
- package/src/CopySource.tsx +52 -0
- package/src/DataTable.tsx +104 -0
- package/src/ErrorBoundary.tsx +102 -0
- package/src/LiveRegion.tsx +121 -0
- package/src/Markdown.tsx +71 -0
- package/src/MarkdownInline.tsx +164 -0
- package/src/MenuIcon.tsx +203 -0
- package/src/Mermaid.tsx +142 -0
- package/src/Monogram.tsx +103 -0
- package/src/OverflowMenu.tsx +352 -0
- package/src/Shell.tsx +86 -0
- package/src/Skeleton.tsx +68 -0
- package/src/Split.tsx +242 -0
- package/src/Toast.tsx +258 -0
- package/src/Tooltip.tsx +188 -0
- package/src/cx.ts +4 -0
- package/src/fenceInfo.ts +33 -0
- package/src/index.ts +153 -0
- package/src/primitives.tsx +887 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* What is shown where a subtree threw.
|
|
4
|
+
*
|
|
5
|
+
* EXTENSIBILITY §7 promises "UI throws → its own error boundary" and
|
|
6
|
+
* nothing provided one. The iframe does protect the *host*: igni's
|
|
7
|
+
* shell survives whatever an extension does. It does not protect the
|
|
8
|
+
* extension from itself. A React tree that throws unmounts, so what
|
|
9
|
+
* an author actually shipped was a blank frame inside a working app —
|
|
10
|
+
* the worst-looking failure available, and the one a partner demo
|
|
11
|
+
* finds.
|
|
12
|
+
*
|
|
13
|
+
* A class, because `componentDidCatch` and
|
|
14
|
+
* `getDerivedStateFromError` have no hook equivalent. This is the
|
|
15
|
+
* only class component under the floor and it is not a style
|
|
16
|
+
* preference.
|
|
17
|
+
*
|
|
18
|
+
* **It catches less than people expect**, and saying so is part of
|
|
19
|
+
* the contract: render, lifecycle and constructor throws, in the
|
|
20
|
+
* subtree below it. Not event handlers, not `setTimeout`, not
|
|
21
|
+
* promise rejections, not anything during SSR. An extension still
|
|
22
|
+
* needs to handle its own async failures — the reference extension's
|
|
23
|
+
* `ScannerClient` is what that looks like.
|
|
24
|
+
*/
|
|
25
|
+
import { Component } from "react";
|
|
26
|
+
function changed(a, b) {
|
|
27
|
+
return a.length !== b.length || a.some((value, i) => !Object.is(value, b[i]));
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* What is shown where a subtree threw.
|
|
31
|
+
*
|
|
32
|
+
* See the note at the top of this file: it catches less than people
|
|
33
|
+
* expect, and the default fallback shows the message on purpose.
|
|
34
|
+
*/
|
|
35
|
+
export class ErrorBoundary extends Component {
|
|
36
|
+
state = { error: null };
|
|
37
|
+
static getDerivedStateFromError(error) {
|
|
38
|
+
return { error };
|
|
39
|
+
}
|
|
40
|
+
componentDidCatch(error, info) {
|
|
41
|
+
this.props.onError?.(error, info);
|
|
42
|
+
}
|
|
43
|
+
componentDidUpdate(previous) {
|
|
44
|
+
if (this.state.error === null)
|
|
45
|
+
return;
|
|
46
|
+
const before = previous.resetKeys ?? [];
|
|
47
|
+
const now = this.props.resetKeys ?? [];
|
|
48
|
+
if (changed(before, now))
|
|
49
|
+
this.reset();
|
|
50
|
+
}
|
|
51
|
+
reset = () => {
|
|
52
|
+
this.setState({ error: null });
|
|
53
|
+
};
|
|
54
|
+
render() {
|
|
55
|
+
const { error } = this.state;
|
|
56
|
+
if (error === null)
|
|
57
|
+
return this.props.children;
|
|
58
|
+
if (this.props.fallback)
|
|
59
|
+
return this.props.fallback(error, this.reset);
|
|
60
|
+
return (_jsxs("div", { className: "ui-crash", role: "alert", children: [_jsx("p", { className: "ui-text", children: "Something in this view stopped working." }), _jsx("pre", { className: "ui-crash-detail", children: error.message }), _jsx("button", { type: "button", className: "btn", onClick: this.reset, children: "Try again" })] }));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=ErrorBoundary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorBoundary.js","sourceRoot":"","sources":["../src/ErrorBoundary.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EAAE,SAAS,EAAkC,MAAM,OAAO,CAAC;AAgClE,SAAS,OAAO,CAAC,CAAqB,EAAE,CAAqB;IAC3D,OAAO,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAChF,CAAC;AAED;;;;;GAKG;AACH,MAAM,OAAO,aAAc,SAAQ,SAAoC;IACrE,KAA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AAE,IAAI,CAAC,KAAK,0BAEhD,IACL,CACP,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/** Which way to say it. */
|
|
2
|
+
export type Urgency = "polite" | "assertive";
|
|
3
|
+
/** A live region and the function that speaks into it. */
|
|
4
|
+
export interface Announcer {
|
|
5
|
+
/** Say something. Re-saying the same thing still announces. */
|
|
6
|
+
announce: (message: string, urgency?: Urgency) => void;
|
|
7
|
+
/** Render this. It must be in the tree before anything is said. */
|
|
8
|
+
region: React.ReactElement;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* A live region and the function that speaks into it.
|
|
12
|
+
*
|
|
13
|
+
* Two regions are rendered, not one. A single region whose
|
|
14
|
+
* `aria-live` value changes is unreliable: the attribute is read
|
|
15
|
+
* when the region is observed, so flipping it at the same moment the
|
|
16
|
+
* text changes races, and the announcement comes out at whichever
|
|
17
|
+
* urgency the implementation noticed first.
|
|
18
|
+
*/
|
|
19
|
+
export declare function useAnnounce(): Announcer;
|
|
20
|
+
/** What a {@link LiveRegion} takes. */
|
|
21
|
+
export interface LiveRegionProps {
|
|
22
|
+
/** What to say. Changing it announces; clearing it says nothing. */
|
|
23
|
+
children?: string;
|
|
24
|
+
/** How insistently it is announced: politely, or assertively. */
|
|
25
|
+
urgency?: Urgency;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The declarative form, for a value that already lives in state.
|
|
29
|
+
*
|
|
30
|
+
* `<LiveRegion>{`${n} results`}</LiveRegion>` is the whole usage.
|
|
31
|
+
* Mounted empty on the first render so the region exists before it
|
|
32
|
+
* has anything to say — see note 1 above.
|
|
33
|
+
*/
|
|
34
|
+
export declare function LiveRegion({ children, urgency }: LiveRegionProps): import("react").JSX.Element;
|
|
35
|
+
//# sourceMappingURL=LiveRegion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LiveRegion.d.ts","sourceRoot":"","sources":["../src/LiveRegion.tsx"],"names":[],"mappings":"AA2BA,2BAA2B;AAC3B,MAAM,MAAM,OAAO,GAAG,QAAQ,GAAG,WAAW,CAAC;AAE7C,0DAA0D;AAC1D,MAAM,WAAW,SAAS;IACxB,+DAA+D;IAC/D,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACvD,mEAAmE;IACnE,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC;CAC5B;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,IAAI,SAAS,CAyCvC;AAED,uCAAuC;AACvC,MAAM,WAAW,eAAe;IAC9B,oEAAoE;IACpE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iEAAiE;IACjE,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,EAAE,QAAa,EAAE,OAAkB,EAAE,EAAE,eAAe,+BAehF"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Saying what changed, to somebody who cannot see it change.
|
|
4
|
+
*
|
|
5
|
+
* A filtered count, a finished scan, a saved draft: all of them move
|
|
6
|
+
* nothing and focus nothing, so a screen reader is told none of it.
|
|
7
|
+
* The reference extension hand-rolled an `aria-live` paragraph with
|
|
8
|
+
* `ui-visually-hidden`, which is the right shape and the wrong place
|
|
9
|
+
* — every extension would write it, and most would get one of the
|
|
10
|
+
* three details wrong.
|
|
11
|
+
*
|
|
12
|
+
* The three details:
|
|
13
|
+
*
|
|
14
|
+
* 1. **The region must exist before the text does.** A live region
|
|
15
|
+
* added to the DOM with its message already in it is frequently
|
|
16
|
+
* not announced at all — the assistive technology has nothing to
|
|
17
|
+
* observe a change against. So this renders an empty element and
|
|
18
|
+
* fills it afterwards.
|
|
19
|
+
* 2. **The same message twice is not a change.** Scanning 40 files
|
|
20
|
+
* and then scanning 40 files again is silence, because the text
|
|
21
|
+
* never differed. A zero-width space is toggled on repeats.
|
|
22
|
+
* 3. **Polite waits, assertive interrupts.** Almost everything is
|
|
23
|
+
* polite. Assertive is for something the user must act on, and
|
|
24
|
+
* using it for a count makes the product unusable by the people
|
|
25
|
+
* it is meant to help.
|
|
26
|
+
*/
|
|
27
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
28
|
+
/**
|
|
29
|
+
* A live region and the function that speaks into it.
|
|
30
|
+
*
|
|
31
|
+
* Two regions are rendered, not one. A single region whose
|
|
32
|
+
* `aria-live` value changes is unreliable: the attribute is read
|
|
33
|
+
* when the region is observed, so flipping it at the same moment the
|
|
34
|
+
* text changes races, and the announcement comes out at whichever
|
|
35
|
+
* urgency the implementation noticed first.
|
|
36
|
+
*/
|
|
37
|
+
export function useAnnounce() {
|
|
38
|
+
const [polite, setPolite] = useState("");
|
|
39
|
+
const [assertive, setAssertive] = useState("");
|
|
40
|
+
const last = useRef({ polite: "", assertive: "" });
|
|
41
|
+
const announce = useCallback((message, urgency = "polite") => {
|
|
42
|
+
// Identical consecutive text is not a mutation, so nothing is
|
|
43
|
+
// announced. A zero-width space makes it one, and is not read
|
|
44
|
+
// aloud.
|
|
45
|
+
const previous = last.current[urgency];
|
|
46
|
+
const text = message === previous ? `${message}` : message;
|
|
47
|
+
last.current[urgency] = text;
|
|
48
|
+
if (urgency === "assertive")
|
|
49
|
+
setAssertive(text);
|
|
50
|
+
else
|
|
51
|
+
setPolite(text);
|
|
52
|
+
}, []);
|
|
53
|
+
const region = (_jsxs(_Fragment, { children: [_jsx("div", { className: "ui-visually-hidden", role: "status", "aria-live": "polite", "aria-atomic": "true", children: polite }), _jsx("div", { className: "ui-visually-hidden", role: "alert", "aria-live": "assertive", "aria-atomic": "true", children: assertive })] }));
|
|
54
|
+
return { announce, region };
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* The declarative form, for a value that already lives in state.
|
|
58
|
+
*
|
|
59
|
+
* `<LiveRegion>{`${n} results`}</LiveRegion>` is the whole usage.
|
|
60
|
+
* Mounted empty on the first render so the region exists before it
|
|
61
|
+
* has anything to say — see note 1 above.
|
|
62
|
+
*/
|
|
63
|
+
export function LiveRegion({ children = "", urgency = "polite" }) {
|
|
64
|
+
const [text, setText] = useState("");
|
|
65
|
+
useEffect(() => {
|
|
66
|
+
setText(children);
|
|
67
|
+
}, [children]);
|
|
68
|
+
return (_jsx("div", { className: "ui-visually-hidden", role: urgency === "assertive" ? "alert" : "status", "aria-live": urgency, "aria-atomic": "true", children: text }));
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=LiveRegion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LiveRegion.js","sourceRoot":"","sources":["../src/LiveRegion.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAajE;;;;;;;;GAQG;AACH,MAAM,UAAU,WAAW;IACzB,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IACzC,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC/C,MAAM,IAAI,GAAG,MAAM,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,CAAC;IAEnD,MAAM,QAAQ,GAAG,WAAW,CAC1B,CAAC,OAAe,EAAE,UAAmB,QAAQ,EAAE,EAAE;QAC/C,8DAA8D;QAC9D,8DAA8D;QAC9D,SAAS;QACT,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACvC,MAAM,IAAI,GAAG,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,OAAO,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC;QAC5D,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;QAC7B,IAAI,OAAO,KAAK,WAAW;YAAE,YAAY,CAAC,IAAI,CAAC,CAAC;;YAC3C,SAAS,CAAC,IAAI,CAAC,CAAC;IACvB,CAAC,EACD,EAAE,CACH,CAAC;IAEF,MAAM,MAAM,GAAG,CACb,8BACE,cACE,SAAS,EAAC,oBAAoB,EAC9B,IAAI,EAAC,QAAQ,eACH,QAAQ,iBACN,MAAM,YAEjB,MAAM,GACH,EACN,cACE,SAAS,EAAC,oBAAoB,EAC9B,IAAI,EAAC,OAAO,eACF,WAAW,iBACT,MAAM,YAEjB,SAAS,GACN,IACL,CACJ,CAAC;IAEF,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;AAC9B,CAAC;AAUD;;;;;;GAMG;AACH,MAAM,UAAU,UAAU,CAAC,EAAE,QAAQ,GAAG,EAAE,EAAE,OAAO,GAAG,QAAQ,EAAmB;IAC/E,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IACrC,SAAS,CAAC,GAAG,EAAE;QACb,OAAO,CAAC,QAAQ,CAAC,CAAC;IACpB,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IACf,OAAO,CACL,cACE,SAAS,EAAC,oBAAoB,EAC9B,IAAI,EAAE,OAAO,KAAK,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,eACvC,OAAO,iBACN,MAAM,YAEjB,IAAI,GACD,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** What a {@link Markdown} takes. */
|
|
2
|
+
export interface MarkdownProps {
|
|
3
|
+
/** The source. Rendered as a document, not flattened. */
|
|
4
|
+
children: string;
|
|
5
|
+
/** Added to the element's classes, beside the one the theme gives it. */
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Render markdown as prose.
|
|
10
|
+
*
|
|
11
|
+
* GitHub-flavoured, because that is what people write: tables,
|
|
12
|
+
* strikethrough, task lists and autolinks. Raw HTML is **not**
|
|
13
|
+
* enabled and will not be — `rehype-raw` in a surface that renders
|
|
14
|
+
* text somebody else wrote is a script tag waiting to happen, and an
|
|
15
|
+
* extension's frame has a CSP precisely so that it cannot.
|
|
16
|
+
*/
|
|
17
|
+
export declare function Markdown({ children, className }: MarkdownProps): import("react").JSX.Element;
|
|
18
|
+
//# sourceMappingURL=Markdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Markdown.d.ts","sourceRoot":"","sources":["../src/Markdown.tsx"],"names":[],"mappings":"AA6CA,qCAAqC;AACrC,MAAM,WAAW,aAAa;IAC5B,yDAAyD;IACzD,QAAQ,EAAE,MAAM,CAAC;IACjB,yEAAyE;IACzE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,aAAa,+BAQ9D"}
|
package/dist/Markdown.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Markdown with its block structure intact.
|
|
4
|
+
*
|
|
5
|
+
* The floor published exactly one markdown component and it was
|
|
6
|
+
* `MarkdownInline`, which is *designed* to destroy block structure:
|
|
7
|
+
* headings lose their size, lists become middots, images return
|
|
8
|
+
* null. That is right for a two-line preview and exactly wrong for a
|
|
9
|
+
* document, so an extension with prose in it bundled its own
|
|
10
|
+
* renderer — and then had nothing to style it against, because
|
|
11
|
+
* igni's prose rules live in `theme.css` and were not published
|
|
12
|
+
* either.
|
|
13
|
+
*
|
|
14
|
+
* `examples/release-notes` hand-rolls a deliberately small subset
|
|
15
|
+
* and says so. This is what that was missing.
|
|
16
|
+
*
|
|
17
|
+
* **Not a configurable pipeline.** No plugin prop, no component
|
|
18
|
+
* overrides. The value here is that prose in an extension looks like
|
|
19
|
+
* prose in igni, and every escape hatch is a way for that to stop
|
|
20
|
+
* being true. An extension that needs a different pipeline should
|
|
21
|
+
* bundle react-markdown directly — it is a peer dependency it
|
|
22
|
+
* already has — and wrap the result in `.ui-prose`.
|
|
23
|
+
*/
|
|
24
|
+
import ReactMarkdown from "react-markdown";
|
|
25
|
+
import remarkGfm from "remark-gfm";
|
|
26
|
+
function cx(...parts) {
|
|
27
|
+
return parts.filter(Boolean).join(" ");
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Links open where they point, safely.
|
|
31
|
+
*
|
|
32
|
+
* A document can arrive from a colleague, so the href is somebody
|
|
33
|
+
* else's. `noopener` is the one that matters: without it the opened
|
|
34
|
+
* page gets a handle on this frame through `window.opener` and can
|
|
35
|
+
* navigate it somewhere else.
|
|
36
|
+
*/
|
|
37
|
+
const COMPONENTS = {
|
|
38
|
+
a: ({ href, children, ...rest }) => (_jsx("a", { ...rest, href: href, target: "_blank", rel: "noopener noreferrer", children: children })),
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Render markdown as prose.
|
|
42
|
+
*
|
|
43
|
+
* GitHub-flavoured, because that is what people write: tables,
|
|
44
|
+
* strikethrough, task lists and autolinks. Raw HTML is **not**
|
|
45
|
+
* enabled and will not be — `rehype-raw` in a surface that renders
|
|
46
|
+
* text somebody else wrote is a script tag waiting to happen, and an
|
|
47
|
+
* extension's frame has a CSP precisely so that it cannot.
|
|
48
|
+
*/
|
|
49
|
+
export function Markdown({ children, className }) {
|
|
50
|
+
return (_jsx("div", { className: cx("ui-prose", className), children: _jsx(ReactMarkdown, { remarkPlugins: [remarkGfm], components: COMPONENTS, children: children }) }));
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=Markdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Markdown.js","sourceRoot":"","sources":["../src/Markdown.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,aAAkC,MAAM,gBAAgB,CAAC;AAChE,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,SAAS,EAAE,CAAC,GAAG,KAA4C;IACzD,OAAO,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACzC,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,GAAe;IAC7B,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE,CAAC,CAClC,eAAO,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAC,QAAQ,EAAC,GAAG,EAAC,qBAAqB,YAC/D,QAAQ,GACP,CACL;CACF,CAAC;AAUF;;;;;;;;GAQG;AACH,MAAM,UAAU,QAAQ,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAiB;IAC7D,OAAO,CACL,cAAK,SAAS,EAAE,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC,YACvC,KAAC,aAAa,IAAC,aAAa,EAAE,CAAC,SAAS,CAAC,EAAE,UAAU,EAAE,UAAU,YAC9D,QAAQ,GACK,GACZ,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Repair markdown cut mid-syntax.
|
|
3
|
+
*
|
|
4
|
+
* Previews arrive pre-truncated, and the cut lands wherever it lands
|
|
5
|
+
* — often inside `**bold` or an unclosed backtick. Rendered as-is the
|
|
6
|
+
* marker shows up literally, which is the thing this component
|
|
7
|
+
* exists to stop. Closing what was left open is cheaper than asking
|
|
8
|
+
* every producer of a preview to cut carefully.
|
|
9
|
+
*/
|
|
10
|
+
export declare function closeOpenMarks(text: string): string;
|
|
11
|
+
/**
|
|
12
|
+
* Drop a leading line that only repeats the document's name.
|
|
13
|
+
*
|
|
14
|
+
* Most documents open with their own title. In a list the name is
|
|
15
|
+
* already the row's first line, so rendering it again spends the
|
|
16
|
+
* preview — the two lines somebody reads to tell this document from
|
|
17
|
+
* the next one — saying what they just read.
|
|
18
|
+
*
|
|
19
|
+
* Heading or plain line: the duplication is the same either way, and
|
|
20
|
+
* whether the author marked it up is not the reader's problem. The
|
|
21
|
+
* line has to *be* the name, though, not merely open with it —
|
|
22
|
+
* "Session handling is a signed JWT flow" is the first sentence of
|
|
23
|
+
* the document and belongs in the preview.
|
|
24
|
+
*/
|
|
25
|
+
export declare function dropEchoedTitle(text: string, name: string): string;
|
|
26
|
+
/**
|
|
27
|
+
* Markdown rendered as one flowing line of text.
|
|
28
|
+
*
|
|
29
|
+
* See the note at the top of this file for what it does to blocks and
|
|
30
|
+
* why. `limit` bounds the work, not the appearance: the clamp is
|
|
31
|
+
* visual, and a document longer than `limit` is cut at a word
|
|
32
|
+
* boundary with an ellipsis.
|
|
33
|
+
*/
|
|
34
|
+
export declare function MarkdownInline({ text,
|
|
35
|
+
/** The document's name, so a title echo can be dropped. */
|
|
36
|
+
name,
|
|
37
|
+
/** Characters to keep. The clamp is visual; this bounds the work. */
|
|
38
|
+
limit, className, }: {
|
|
39
|
+
text: string;
|
|
40
|
+
name?: string;
|
|
41
|
+
limit?: number;
|
|
42
|
+
className?: string;
|
|
43
|
+
}): import("react").JSX.Element | null;
|
|
44
|
+
//# sourceMappingURL=MarkdownInline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MarkdownInline.d.ts","sourceRoot":"","sources":["../src/MarkdownInline.tsx"],"names":[],"mappings":"AAqEA;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAWnD;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAelE;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,EAC7B,IAAI;AACJ,2DAA2D;AAC3D,IAAS;AACT,qEAAqE;AACrE,KAAW,EACX,SAAc,GACf,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,sCAqBA"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import ReactMarkdown from "react-markdown";
|
|
4
|
+
import remarkGfm from "remark-gfm";
|
|
5
|
+
/**
|
|
6
|
+
* Markdown rendered as one flowing line of text.
|
|
7
|
+
*
|
|
8
|
+
* For previews: a list row, a snippet, anywhere a document has to be
|
|
9
|
+
* recognisable in two lines. Showing the raw source there leaks `##`
|
|
10
|
+
* and `**` into prose; rendering it normally is worse, because a
|
|
11
|
+
* heading at heading size in a 11.5px row is a heading, and a bullet
|
|
12
|
+
* list becomes four lines where there was room for two.
|
|
13
|
+
*
|
|
14
|
+
* So every block becomes inline. Headings keep their emphasis but not
|
|
15
|
+
* their size, list items are separated by middots rather than laid
|
|
16
|
+
* out, and code keeps its face. The result reads as the sentence the
|
|
17
|
+
* author wrote, which is what a preview is for.
|
|
18
|
+
*
|
|
19
|
+
* Two constraints are load-bearing, both from where this gets used:
|
|
20
|
+
*
|
|
21
|
+
* - **Nothing interactive.** These previews sit inside a `<button>`
|
|
22
|
+
* that opens the document. A link inside a button is invalid, and
|
|
23
|
+
* worse, it is a second click target inside the first.
|
|
24
|
+
* - **Nothing that loads.** An image in a preview is a network
|
|
25
|
+
* request to render two lines of text, and a broken one is an icon
|
|
26
|
+
* where a sentence should be.
|
|
27
|
+
*/
|
|
28
|
+
/** Blocks flow inline, so a preview is one sentence rather than a page. */
|
|
29
|
+
const INLINE_COMPONENTS = {
|
|
30
|
+
// Emphasis without the size. A document whose first line is a
|
|
31
|
+
// heading should read as its first line, not as a title.
|
|
32
|
+
h1: ({ children }) => _jsx("strong", { className: "mdi-heading", children: children }),
|
|
33
|
+
h2: ({ children }) => _jsx("strong", { className: "mdi-heading", children: children }),
|
|
34
|
+
h3: ({ children }) => _jsx("strong", { className: "mdi-heading", children: children }),
|
|
35
|
+
h4: ({ children }) => _jsx("strong", { className: "mdi-heading", children: children }),
|
|
36
|
+
h5: ({ children }) => _jsx("strong", { className: "mdi-heading", children: children }),
|
|
37
|
+
h6: ({ children }) => _jsx("strong", { className: "mdi-heading", children: children }),
|
|
38
|
+
p: ({ children }) => _jsx("span", { className: "mdi-block", children: children }),
|
|
39
|
+
blockquote: ({ children }) => _jsx("span", { className: "mdi-block", children: children }),
|
|
40
|
+
ul: ({ children }) => _jsx("span", { className: "mdi-block", children: children }),
|
|
41
|
+
ol: ({ children }) => _jsx("span", { className: "mdi-block", children: children }),
|
|
42
|
+
li: ({ children }) => _jsx("span", { className: "mdi-item", children: children }),
|
|
43
|
+
// A fenced block and an inline span both become inline code: the
|
|
44
|
+
// point of showing code in a preview is that it is code.
|
|
45
|
+
pre: ({ children }) => _jsx("span", { className: "mdi-block", children: children }),
|
|
46
|
+
code: ({ children }) => _jsx("code", { className: "mdi-code", children: children }),
|
|
47
|
+
// Text only. The row itself is the link.
|
|
48
|
+
a: ({ children }) => _jsx("span", { children: children }),
|
|
49
|
+
img: () => null,
|
|
50
|
+
hr: () => null,
|
|
51
|
+
br: () => _jsx("span", { children: " " }),
|
|
52
|
+
// Tables flatten to their cells. A preview of a table is not a
|
|
53
|
+
// table, and rendering one inside two clamped lines produces a
|
|
54
|
+
// column of single characters.
|
|
55
|
+
table: ({ children }) => _jsx("span", { className: "mdi-block", children: children }),
|
|
56
|
+
thead: () => null,
|
|
57
|
+
tbody: ({ children }) => _jsx("span", { children: children }),
|
|
58
|
+
tr: ({ children }) => _jsx("span", { className: "mdi-item", children: children }),
|
|
59
|
+
td: ({ children }) => _jsx("span", { className: "mdi-cell", children: children }),
|
|
60
|
+
th: ({ children }) => _jsx("span", { className: "mdi-cell", children: children }),
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Repair markdown cut mid-syntax.
|
|
64
|
+
*
|
|
65
|
+
* Previews arrive pre-truncated, and the cut lands wherever it lands
|
|
66
|
+
* — often inside `**bold` or an unclosed backtick. Rendered as-is the
|
|
67
|
+
* marker shows up literally, which is the thing this component
|
|
68
|
+
* exists to stop. Closing what was left open is cheaper than asking
|
|
69
|
+
* every producer of a preview to cut carefully.
|
|
70
|
+
*/
|
|
71
|
+
export function closeOpenMarks(text) {
|
|
72
|
+
let out = text;
|
|
73
|
+
// Fences first: an unclosed one swallows everything after it.
|
|
74
|
+
if ((out.match(/^```/gm) ?? []).length % 2 === 1)
|
|
75
|
+
out += "\n```";
|
|
76
|
+
// Then inline runs, longest marker first so `**` is not read as two
|
|
77
|
+
// single `*`.
|
|
78
|
+
for (const mark of ["**", "`", "*", "_"]) {
|
|
79
|
+
const count = out.split(mark).length - 1;
|
|
80
|
+
if (count % 2 === 1)
|
|
81
|
+
out += mark;
|
|
82
|
+
}
|
|
83
|
+
return out;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Drop a leading line that only repeats the document's name.
|
|
87
|
+
*
|
|
88
|
+
* Most documents open with their own title. In a list the name is
|
|
89
|
+
* already the row's first line, so rendering it again spends the
|
|
90
|
+
* preview — the two lines somebody reads to tell this document from
|
|
91
|
+
* the next one — saying what they just read.
|
|
92
|
+
*
|
|
93
|
+
* Heading or plain line: the duplication is the same either way, and
|
|
94
|
+
* whether the author marked it up is not the reader's problem. The
|
|
95
|
+
* line has to *be* the name, though, not merely open with it —
|
|
96
|
+
* "Session handling is a signed JWT flow" is the first sentence of
|
|
97
|
+
* the document and belongs in the preview.
|
|
98
|
+
*/
|
|
99
|
+
export function dropEchoedTitle(text, name) {
|
|
100
|
+
const title = name.trim().toLowerCase();
|
|
101
|
+
if (!title)
|
|
102
|
+
return text;
|
|
103
|
+
const lines = text.split("\n");
|
|
104
|
+
let i = 0;
|
|
105
|
+
while (i < lines.length && !lines[i].trim())
|
|
106
|
+
i++;
|
|
107
|
+
const first = lines[i]?.trim() ?? "";
|
|
108
|
+
const heading = first.replace(/^#{1,6}\s+/, "").trim();
|
|
109
|
+
// Only when it *is* the title, not when it merely starts with it —
|
|
110
|
+
// "Session handling in detail" is a different heading.
|
|
111
|
+
if (heading.toLowerCase() !== title)
|
|
112
|
+
return text;
|
|
113
|
+
return lines
|
|
114
|
+
.slice(i + 1)
|
|
115
|
+
.join("\n")
|
|
116
|
+
.trimStart();
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Markdown rendered as one flowing line of text.
|
|
120
|
+
*
|
|
121
|
+
* See the note at the top of this file for what it does to blocks and
|
|
122
|
+
* why. `limit` bounds the work, not the appearance: the clamp is
|
|
123
|
+
* visual, and a document longer than `limit` is cut at a word
|
|
124
|
+
* boundary with an ellipsis.
|
|
125
|
+
*/
|
|
126
|
+
export function MarkdownInline({ text,
|
|
127
|
+
/** The document's name, so a title echo can be dropped. */
|
|
128
|
+
name = "",
|
|
129
|
+
/** Characters to keep. The clamp is visual; this bounds the work. */
|
|
130
|
+
limit = 320, className = "", }) {
|
|
131
|
+
const source = useMemo(() => {
|
|
132
|
+
const body = dropEchoedTitle(String(text || ""), name);
|
|
133
|
+
if (body.length <= limit)
|
|
134
|
+
return closeOpenMarks(body);
|
|
135
|
+
// Cut back to a space so the preview does not end mid-word.
|
|
136
|
+
const cut = body.slice(0, limit);
|
|
137
|
+
const space = cut.lastIndexOf(" ");
|
|
138
|
+
return (closeOpenMarks(space > limit * 0.6 ? cut.slice(0, space) : cut) + "…");
|
|
139
|
+
}, [text, name, limit]);
|
|
140
|
+
if (!source.trim())
|
|
141
|
+
return null;
|
|
142
|
+
return (_jsx("span", { className: className ? `mdi ${className}` : "mdi", children: _jsx(ReactMarkdown, { remarkPlugins: [remarkGfm], components: INLINE_COMPONENTS, children: source }) }));
|
|
143
|
+
}
|
|
144
|
+
//# sourceMappingURL=MarkdownInline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MarkdownInline.js","sourceRoot":"","sources":["../src/MarkdownInline.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,aAAkC,MAAM,gBAAgB,CAAC;AAChE,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,2EAA2E;AAC3E,MAAM,iBAAiB,GAAe;IACpC,8DAA8D;IAC9D,yDAAyD;IACzD,EAAE,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,iBAAQ,SAAS,EAAC,aAAa,YAAE,QAAQ,GAAU;IACzE,EAAE,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,iBAAQ,SAAS,EAAC,aAAa,YAAE,QAAQ,GAAU;IACzE,EAAE,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,iBAAQ,SAAS,EAAC,aAAa,YAAE,QAAQ,GAAU;IACzE,EAAE,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,iBAAQ,SAAS,EAAC,aAAa,YAAE,QAAQ,GAAU;IACzE,EAAE,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,iBAAQ,SAAS,EAAC,aAAa,YAAE,QAAQ,GAAU;IACzE,EAAE,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,iBAAQ,SAAS,EAAC,aAAa,YAAE,QAAQ,GAAU;IAEzE,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,eAAM,SAAS,EAAC,WAAW,YAAE,QAAQ,GAAQ;IAClE,UAAU,EAAE,CAAC,EAAE,QAAQ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AI,EAAE;QAAE,OAAO,IAAI,CAAC;IAEhC,OAAO,CACL,eAAM,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,OAAO,SAAS,EAAE,CAAC,CAAC,CAAC,KAAK,YACrD,KAAC,aAAa,IAAC,aAAa,EAAE,CAAC,SAAS,CAAC,EAAE,UAAU,EAAE,iBAAiB,YACrE,MAAM,GACO,GACX,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The small glyphs beside a menu item.
|
|
3
|
+
*
|
|
4
|
+
* A menu of five verbs reads as five equal options, and picking the
|
|
5
|
+
* wrong one of Archive and Remove costs quite differently. An icon is
|
|
6
|
+
* what makes a list scannable: the shape is recognised before the
|
|
7
|
+
* word is read, so the item somebody wants is found by looking rather
|
|
8
|
+
* than by reading the list from the top each time.
|
|
9
|
+
*
|
|
10
|
+
* **One set, one grammar.** All of them are 16×16, drawn in strokes
|
|
11
|
+
* of the same weight on the same grid, and coloured ``currentColor``
|
|
12
|
+
* so a disabled item's icon dims with its label and a destructive
|
|
13
|
+
* one turns red with it. Mixing a filled glyph into a stroked set is
|
|
14
|
+
* the single most obvious way to make a menu look assembled from
|
|
15
|
+
* parts.
|
|
16
|
+
*
|
|
17
|
+
* Inline rather than a sprite or a font: these are a dozen paths used
|
|
18
|
+
* in three menus, and a build step, a network request or a font with
|
|
19
|
+
* a flash of missing glyphs are all more machinery than the problem
|
|
20
|
+
* has.
|
|
21
|
+
*/
|
|
22
|
+
export type MenuIconName = "open" | "rename" | "export" | "share" | "archive" | "restore" | "remove" | "document" | "document-add" | "folder" | "folder-add" | "outdent" | "compare" | "lineage" | "code" | "list-bullet" | "list-ordered" | "list-task" | "quote" | "code-block" | "table" | "divider" | "link" | "image" | "undo" | "redo" | "resolve" | "reopen" | "lock" | "unlock" | "bell" | "copy" | "check";
|
|
23
|
+
/** What a {@link MenuIcon} takes. */
|
|
24
|
+
export interface MenuIconProps {
|
|
25
|
+
/** One of igni's own icons. */
|
|
26
|
+
name?: MenuIconName;
|
|
27
|
+
/**
|
|
28
|
+
* An SVG path, for an icon igni does not have.
|
|
29
|
+
*
|
|
30
|
+
* Here because the alternative is a closed union, and an extension
|
|
31
|
+
* cannot add a member to one. `PageKind` had the same problem and
|
|
32
|
+
* was opened for the same reason: what exists is decided at install
|
|
33
|
+
* time by what an administrator put on the machine, not at compile
|
|
34
|
+
* time by us.
|
|
35
|
+
*
|
|
36
|
+
* Drawn on a 16×16 grid, stroked rather than filled, to match. A
|
|
37
|
+
* path that assumes a different viewBox will look like it belongs
|
|
38
|
+
* to a different application, which is the one thing this whole
|
|
39
|
+
* package exists to prevent.
|
|
40
|
+
*/
|
|
41
|
+
path?: string;
|
|
42
|
+
/** Added to the element's classes, beside the one the theme gives it. */
|
|
43
|
+
className?: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* One of igni's own icons, drawn on a 16×16 grid.
|
|
47
|
+
*
|
|
48
|
+
* See the note at the top of this file for why there is one set and
|
|
49
|
+
* one grammar. A name that is not in the set draws nothing, rather
|
|
50
|
+
* than a broken box: the label says what the item does, and the icon
|
|
51
|
+
* is only how it is found.
|
|
52
|
+
*/
|
|
53
|
+
export declare function MenuIcon({ name, path, className }: MenuIconProps): import("react").JSX.Element | null;
|
|
54
|
+
//# sourceMappingURL=MenuIcon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MenuIcon.d.ts","sourceRoot":"","sources":["../src/MenuIcon.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,MAAM,MAAM,YAAY,GACpB,MAAM,GACN,QAAQ,GACR,QAAQ,GACR,OAAO,GACP,SAAS,GACT,SAAS,GACT,QAAQ,GACR,UAAU,GACV,cAAc,GACd,QAAQ,GACR,YAAY,GACZ,SAAS,GACT,SAAS,GACT,SAAS,GAGT,MAAM,GACN,aAAa,GACb,cAAc,GACd,WAAW,GACX,OAAO,GACP,YAAY,GACZ,OAAO,GACP,SAAS,GACT,MAAM,GACN,OAAO,GACP,MAAM,GACN,MAAM,GACN,SAAS,GACT,QAAQ,GACR,MAAM,GACN,QAAQ,GACR,MAAM,GAEN,MAAM,GACN,OAAO,CAAC;AAiGZ,qCAAqC;AACrC,MAAM,WAAW,aAAa;IAC5B,+BAA+B;IAC/B,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB;;;;;;;;;;;;;OAaG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,yEAAyE;IACzE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,aAAa,sCAgBhE"}
|
package/dist/MenuIcon.js
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/** The drawing for each name, on a 16×16 grid. */
|
|
3
|
+
const PATHS = {
|
|
4
|
+
// A page with a corner turned.
|
|
5
|
+
open: "M9 1.5H4.5A1.5 1.5 0 0 0 3 3v10a1.5 1.5 0 0 0 1.5 1.5h7A1.5 1.5 0 0 0 13 13V5.5zM9 1.5V5.5h4",
|
|
6
|
+
// A pencil across a line.
|
|
7
|
+
rename: "M11.2 2.3 13.7 4.8 6.2 12.3 3 13l.7-3.2zM2.5 14.5h11",
|
|
8
|
+
// Out of a tray, downwards — the file leaves.
|
|
9
|
+
export: "M8 2v7m0 0 2.8-2.8M8 9 5.2 6.2M2.8 10.5v2.2a1 1 0 0 0 1 1h8.4a1 1 0 0 0 1-1v-2.2",
|
|
10
|
+
// Two nodes joined to a third: one thing, several people.
|
|
11
|
+
share: "M5.6 9.3 10.4 12M10.4 4 5.6 6.7M12 2.2a1.8 1.8 0 1 1 0 3.6 1.8 1.8 0 0 1 0-3.6zM4 6.2a1.8 1.8 0 1 1 0 3.6 1.8 1.8 0 0 1 0-3.6zM12 10.2a1.8 1.8 0 1 1 0 3.6 1.8 1.8 0 0 1 0-3.6z",
|
|
12
|
+
// A box with a lid, and a handle on the drawer.
|
|
13
|
+
archive: "M2 3.2h12v2.6H2zM3 5.8v7a.8.8 0 0 0 .8.8h8.4a.8.8 0 0 0 .8-.8v-7M6.4 8.4h3.2",
|
|
14
|
+
// The same box, with the arrow coming back up out of it.
|
|
15
|
+
restore: "M2 3.2h12v2.6H2zM3 5.8v7a.8.8 0 0 0 .8.8h8.4a.8.8 0 0 0 .8-.8v-7M8 11.6V7.4m0 0L6.2 9.2M8 7.4l1.8 1.8",
|
|
16
|
+
// A bin. Deliberately the least like the archive of any of these.
|
|
17
|
+
remove: "M2.8 4.3h10.4M6.4 4.3V2.9a.7.7 0 0 1 .7-.7h1.8a.7.7 0 0 1 .7.7v1.4M4.2 4.3l.6 8.5a.9.9 0 0 0 .9.8h4.6a.9.9 0 0 0 .9-.8l.6-8.5M6.7 6.8v4.2M9.3 6.8v4.2",
|
|
18
|
+
// A page. The same shape as ``open`` without the action.
|
|
19
|
+
document: "M9 1.5H4.5A1.5 1.5 0 0 0 3 3v10a1.5 1.5 0 0 0 1.5 1.5h7A1.5 1.5 0 0 0 13 13V5.5zM9 1.5V5.5h4M5.5 8.5h5M5.5 11h3",
|
|
20
|
+
// The same page and folder, with the plus that makes one. Drawn
|
|
21
|
+
// from the same outlines rather than new shapes: "new document"
|
|
22
|
+
// and "document" should be recognisably the same noun.
|
|
23
|
+
"document-add": "M8.4 1.5H4.5A1.5 1.5 0 0 0 3 3v10a1.5 1.5 0 0 0 1.5 1.5h3.2M8.4 1.5V5.5h3.6M11.8 8.8v4.6M9.5 11.1h4.6",
|
|
24
|
+
folder: "M1.8 4.2a1 1 0 0 1 1-1h3.1l1.4 1.6h5.9a1 1 0 0 1 1 1v6.4a1 1 0 0 1-1 1H2.8a1 1 0 0 1-1-1z",
|
|
25
|
+
"folder-add": "M1.8 4.2a1 1 0 0 1 1-1h3.1l1.4 1.6h5.9a1 1 0 0 1 1 1v1.5M1.8 4.2v8.4a1 1 0 0 0 1 1h4.9M11.4 8.8v4.6M9.1 11.1h4.6",
|
|
26
|
+
// Up and to the left: out of where it is, to the level above.
|
|
27
|
+
outdent: "M13 4H6M13 8H8.5M13 12H6M4.5 5.5 2 8l2.5 2.5",
|
|
28
|
+
// Two columns, side by side.
|
|
29
|
+
compare: "M6.4 2.5v11M9.6 2.5v11M2 2.5h12v11H2zM2 2.5",
|
|
30
|
+
// Chevrons, the way code is written about.
|
|
31
|
+
code: "M5.8 4.6 1.8 8l4 3.4M10.2 4.6 14.2 8l-4 3.4",
|
|
32
|
+
// Three dots with three lines. The dots are round rather than
|
|
33
|
+
// square so a bullet list and a checklist are not the same
|
|
34
|
+
// silhouette at a glance.
|
|
35
|
+
"list-bullet": "M6.2 4.2h7.6M6.2 8h7.6M6.2 11.8h7.6M2.6 3.6a.6.6 0 1 1 0 1.2.6.6 0 0 1 0-1.2zM2.6 7.4a.6.6 0 1 1 0 1.2.6.6 0 0 1 0-1.2zM2.6 11.2a.6.6 0 1 1 0 1.2.6.6 0 0 1 0-1.2z",
|
|
36
|
+
"list-ordered": "M6.4 4.2h7.4M6.4 8h7.4M6.4 11.8h7.4M2 3.2h1v2.4M1.7 5.6h1.8M1.7 9.6h2l-2 2.6h2.2",
|
|
37
|
+
// A tick in a box, against the bullet list's round dots.
|
|
38
|
+
"list-task": "M6.6 4.2h7.2M6.6 11.8h7.2M1.4 2.7h3.4v3.4H1.4zM1.4 10.3h3.4v3.4H1.4zM2.1 11.9l.9.9 1.4-1.6",
|
|
39
|
+
// The bar a quote is set behind, with the lines it holds.
|
|
40
|
+
quote: "M2.6 3.4v9.2M5.8 5h8M5.8 8h8M5.8 11h5.4",
|
|
41
|
+
// A fence: the chevrons again, boxed.
|
|
42
|
+
"code-block": "M1.8 3.2h12.4v9.6H1.8zM6.2 6.4 4.4 8l1.8 1.6M9.8 6.4 11.6 8l-1.8 1.6",
|
|
43
|
+
// A grid with its header row set apart, which is what makes a
|
|
44
|
+
// table a table rather than a box with lines in it.
|
|
45
|
+
table: "M1.8 3.2h12.4v9.6H1.8zM1.8 6.4h12.4M6.4 6.4v6.4M10.2 6.4v6.4",
|
|
46
|
+
divider: "M2 8h12",
|
|
47
|
+
// A chain of two links, at an angle.
|
|
48
|
+
link: "M6.6 9.4 9.4 6.6M6.9 4.6 8.4 3.1a2.6 2.6 0 0 1 3.7 3.7l-1.5 1.5M9.1 11.4l-1.5 1.5a2.6 2.6 0 0 1-3.7-3.7l1.5-1.5",
|
|
49
|
+
// A frame with a horizon and a sun: recognisable at this size in
|
|
50
|
+
// a way a literal photograph is not.
|
|
51
|
+
image: "M1.8 3.2h12.4v9.6H1.8zM1.8 10.4l3.4-3.2 3 2.8 2.2-2 3.8 3.4M10.6 5.6a.9.9 0 1 1 0 1.8.9.9 0 0 1 0-1.8z",
|
|
52
|
+
// A tick in a circle: settled, and closed. The checklist glyph
|
|
53
|
+
// was standing in for this and said the wrong thing — a checklist
|
|
54
|
+
// is a kind of list, not a ruling on a conversation.
|
|
55
|
+
resolve: "M8 1.6a6.4 6.4 0 1 1 0 12.8A6.4 6.4 0 0 1 8 1.6zM5.2 8.2l1.9 1.9 3.7-4",
|
|
56
|
+
// The same circle, opened again: an arrow coming back round.
|
|
57
|
+
reopen: "M13.4 8a5.4 5.4 0 1 1-1.9-4.1M13.6 2.4v3.4h-3.4",
|
|
58
|
+
// A padlock, shackle closed. Shown beside a colleague who cannot
|
|
59
|
+
// open the document — a state, not an action, which is why it is
|
|
60
|
+
// the only icon here that is never on a button of its own.
|
|
61
|
+
lock: "M4.2 7.2h7.6a.8.8 0 0 1 .8.8v5a.8.8 0 0 1-.8.8H4.2a.8.8 0 0 1-.8-.8V8a.8.8 0 0 1 .8-.8zM5.6 7.2V4.9a2.4 2.4 0 0 1 4.8 0v2.3",
|
|
62
|
+
// The same padlock with the shackle swung open. Drawn from the
|
|
63
|
+
// same body so the two read as one object in two states rather
|
|
64
|
+
// than as two icons — the whole point is noticing that it changed.
|
|
65
|
+
unlock: "M4.2 7.2h7.6a.8.8 0 0 1 .8.8v5a.8.8 0 0 1-.8.8H4.2a.8.8 0 0 1-.8-.8V8a.8.8 0 0 1 .8-.8zM5.6 7.2V4.9a2.4 2.4 0 0 1 4.8 0",
|
|
66
|
+
undo: "M4.2 6.6H10a3.4 3.4 0 0 1 0 6.8H6.6M4.2 6.6l2.6-2.6M4.2 6.6l2.6 2.6",
|
|
67
|
+
redo: "M11.8 6.6H6a3.4 3.4 0 0 0 0 6.8h3.4M11.8 6.6 9.2 4M11.8 6.6 9.2 9.2",
|
|
68
|
+
// A node with two feeding into it: what this was built on.
|
|
69
|
+
// A bell, drawn at the same weight as the rest: the clapper is a
|
|
70
|
+
// separate stroke so it reads at 14px, where a single outline
|
|
71
|
+
// closes up into a blob.
|
|
72
|
+
bell: "M8 2.2a3.8 3.8 0 0 0-3.8 3.8c0 3-1.1 4-1.1 4h9.8s-1.1-1-1.1-4A3.8 3.8 0 0 0 8 2.2zM9.3 12.2a1.5 1.5 0 0 1-2.6 0",
|
|
73
|
+
// Two pages, one over the other: the source, duplicated.
|
|
74
|
+
copy: "M5.6 5.6h7a.8.8 0 0 1 .8.8v7a.8.8 0 0 1-.8.8h-7a.8.8 0 0 1-.8-.8v-7a.8.8 0 0 1 .8-.8zM3.2 10.4h-.4a.8.8 0 0 1-.8-.8v-7a.8.8 0 0 1 .8-.8h7a.8.8 0 0 1 .8.8v.4",
|
|
75
|
+
// The tick on its own, without the circle ``resolve`` draws it in.
|
|
76
|
+
check: "M3 8.4l3.2 3.2L13 4.8",
|
|
77
|
+
lineage: "M3.6 4.2h3.1a2 2 0 0 1 2 2v3.6a2 2 0 0 0 2 2h1.7M3.6 11.8h3.1M1.4 2.8a1.4 1.4 0 1 1 0 2.8 1.4 1.4 0 0 1 0-2.8zM1.4 10.4a1.4 1.4 0 1 1 0 2.8 1.4 1.4 0 0 1 0-2.8zM13.2 10.4a1.4 1.4 0 1 1 0 2.8 1.4 1.4 0 0 1 0-2.8z",
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* One of igni's own icons, drawn on a 16×16 grid.
|
|
81
|
+
*
|
|
82
|
+
* See the note at the top of this file for why there is one set and
|
|
83
|
+
* one grammar. A name that is not in the set draws nothing, rather
|
|
84
|
+
* than a broken box: the label says what the item does, and the icon
|
|
85
|
+
* is only how it is found.
|
|
86
|
+
*/
|
|
87
|
+
export function MenuIcon({ name, path, className }) {
|
|
88
|
+
const d = path ?? (name ? PATHS[name] : undefined);
|
|
89
|
+
// An unknown name draws nothing rather than a broken box. The
|
|
90
|
+
// label is the thing that says what the item does; the icon is how
|
|
91
|
+
// it is found again.
|
|
92
|
+
if (!d)
|
|
93
|
+
return null;
|
|
94
|
+
return (_jsx("svg", { className: className ? `menu-icon ${className}` : "menu-icon", viewBox: "0 0 16 16", "aria-hidden": "true", focusable: "false", children: _jsx("path", { d: d }) }));
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=MenuIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MenuIcon.js","sourceRoot":"","sources":["../src/MenuIcon.tsx"],"names":[],"mappings":";AA4DA,kDAAkD;AAClD,MAAM,KAAK,GAAiC;IAC1C,+BAA+B;IAC/B,IAAI,EAAE,8FAA8F;IACpG,0BAA0B;IAC1B,MAAM,EAAE,sDAAsD;IAC9D,8CAA8C;IAC9C,MAAM,EACJ,kFAAkF;IACpF,0DAA0D;IAC1D,KAAK,EACH,iLAAiL;IACnL,gDAAgD;IAChD,OAAO,EACL,8EAA8E;IAChF,yDAAyD;IACzD,OAAO,EACL,uGAAuG;IACzG,kEAAkE;IAClE,MAAM,EACJ,uJAAuJ;IACzJ,yDAAyD;IACzD,QAAQ,EACN,iHAAiH;IACnH,gEAAgE;IAChE,gEAAgE;IAChE,uDAAuD;IACvD,cAAc,EACZ,uGAAuG;IACzG,MAAM,EACJ,2FAA2F;IAC7F,YAAY,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