@sovereignfs/ui 0.107.3 → 0.110.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/CHANGELOG.md +73 -0
- package/README.md +5 -1
- package/dist/CompareView.module.css +203 -0
- package/dist/MarkdownEditor.module.css +422 -0
- package/dist/MergeView.module.css +178 -0
- package/dist/SourceEditor.module.css +206 -0
- package/dist/chunk-JWLJDBL4.js +5841 -0
- package/dist/index.d.ts +134 -9
- package/dist/index.js +2151 -6409
- package/dist/markdown-editor.d.ts +83 -0
- package/dist/markdown-editor.js +2838 -0
- package/dist/markdown.d.ts +44 -0
- package/dist/markdown.js +1877 -0
- package/dist/text.d.ts +68 -0
- package/dist/text.js +268 -0
- package/dist/tokens/semantic.css +14 -0
- package/package.json +84 -1
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A Markdown text read into the editor's document, keeping how each thing was written: markers, fences, padding, the lines between
|
|
3
|
+
* blocks and characters spelled another way. What the editor does not model is kept as written and reported.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
type UnsupportedReason = 'html' | 'footnote' | 'reference' | 'unsupported';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Whether the rich editor can hold a text without changing it: the text is read into the editor's document and written back, and
|
|
10
|
+
* only a text that comes back byte for byte may be edited there. Pure: no React, no browser, so a server can ask too.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* - `html`, `footnote`, `reference`: raw HTML, a footnote, or a reference-style link or definition, which the rich view does not
|
|
15
|
+
* edit;
|
|
16
|
+
* - `line-endings`: line breaks of more than one kind;
|
|
17
|
+
* - `formatting`: something written in a way the rich view would rewrite;
|
|
18
|
+
* - `unsupported`: anything else it cannot hold, such as a table whose rows differ in length.
|
|
19
|
+
*/
|
|
20
|
+
type MarkdownIssueReason = UnsupportedReason | 'line-endings' | 'formatting';
|
|
21
|
+
interface MarkdownIssue {
|
|
22
|
+
readonly reason: MarkdownIssueReason;
|
|
23
|
+
/** The line of the text it is on, from 1. */
|
|
24
|
+
readonly line: number;
|
|
25
|
+
/** For `formatting`: what the text has there, and what would be written instead. */
|
|
26
|
+
readonly found?: string;
|
|
27
|
+
readonly written?: string;
|
|
28
|
+
}
|
|
29
|
+
interface MarkdownRoundTrip {
|
|
30
|
+
/** The rich view may edit the text: it is written back exactly as it is. */
|
|
31
|
+
readonly editable: boolean;
|
|
32
|
+
/** Why not, in the order of the text. Empty when it may. */
|
|
33
|
+
readonly issues: readonly MarkdownIssue[];
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Whether the rich editor can hold `text` without changing a byte of it, and if not, why: the check `MarkdownEditor` makes
|
|
37
|
+
* before it lets a text be edited in its rich view.
|
|
38
|
+
*/
|
|
39
|
+
declare function checkMarkdownRoundTrip(text: string): MarkdownRoundTrip;
|
|
40
|
+
/** An issue in words, such as `Line 4: Raw HTML.` */
|
|
41
|
+
declare function describeMarkdownIssue(issue: MarkdownIssue): string;
|
|
42
|
+
|
|
43
|
+
export { checkMarkdownRoundTrip, describeMarkdownIssue };
|
|
44
|
+
export type { MarkdownIssue, MarkdownIssueReason, MarkdownRoundTrip };
|