@sovereignfs/ui 0.107.4 → 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 +49 -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 +107 -3
- package/dist/index.js +2108 -6355
- 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
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,55 @@ versions follow [semver](https://semver.org/). A version's section is written in
|
|
|
5
5
|
and becomes the release notes when the version is published. This file starts at 0.96.0; earlier versions are in the repository's
|
|
6
6
|
history and tags.
|
|
7
7
|
|
|
8
|
+
## [0.110.0] - 2026-11-30
|
|
9
|
+
|
|
10
|
+
This version carries 0.108.0 to 0.109.1, which were set on `develop` and never published.
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- `MarkdownEditor`, from the entry `@sovereignfs/ui/markdown-editor`: a rich view and a Markdown view of one text, switched at
|
|
15
|
+
any time, with a toolbar, keys, Markdown typed as formatting, lists with boxes to tick, tables, links and images. The text is
|
|
16
|
+
written only when a person changes it, and what they did not change keeps its bytes. A text the rich view would change is
|
|
17
|
+
shown there read only, with the reason. Nothing of a text runs or is fetched: raw HTML is shown as text, a link is not
|
|
18
|
+
followed, and an image shows only the address the app's `imageSrc` gives for it. It adds no `<style>` element.
|
|
19
|
+
- Icons `strikethrough`, `text-quote`, `image`, `undo-2` and `redo-2`.
|
|
20
|
+
- `@sovereignfs/ui/markdown`, an entry with no React and no `'use client'`: `checkMarkdownRoundTrip(text)` says whether the
|
|
21
|
+
rich Markdown editor can hold a text without changing a byte of it, and if not, why, naming lines (raw HTML, footnotes,
|
|
22
|
+
reference-style links, mixed line breaks, formatting that would be rewritten). `describeMarkdownIssue` puts a reason in words.
|
|
23
|
+
- Its optional peers, needed only by it and the editor: `mdast-util-from-markdown`, `mdast-util-gfm`,
|
|
24
|
+
`mdast-util-to-markdown`, `micromark-extension-gfm` and ProseMirror's libraries (see the guide).
|
|
25
|
+
|
|
26
|
+
## [0.109.1] - 2026-11-29
|
|
27
|
+
|
|
28
|
+
This version carries 0.108.0 and 0.109.0, which were set on `develop` and never published.
|
|
29
|
+
|
|
30
|
+
### Fixed
|
|
31
|
+
|
|
32
|
+
- `SourceEditor`, in a text taller than its box: the keys that move the caret by a page (Page Up and Page Down on Windows and
|
|
33
|
+
Linux; with Option or Shift on a Mac) move it by what the box shows, where it had stayed put or the browser would have taken it
|
|
34
|
+
to the end; and the box follows the caret after many lines are put in at once.
|
|
35
|
+
|
|
36
|
+
## [0.109.0] - 2026-11-29
|
|
37
|
+
|
|
38
|
+
### Added
|
|
39
|
+
|
|
40
|
+
- `CompareView`: two texts side by side with the changed lines and words marked, one under the other on a phone, unchanged
|
|
41
|
+
stretches folded away until asked for.
|
|
42
|
+
- `MergeView`: a three-way merge of text for a person to resolve. Changes one side made are applied and marked; each conflict
|
|
43
|
+
waits for a choice (one side, both, or a text written), and the app is given the merged text once none is open.
|
|
44
|
+
- `@sovereignfs/ui/text`, an entry with no React and no `'use client'`: `diffLines`, `diffWords`, `splitLines`, `joinLines`,
|
|
45
|
+
`mergeText` and `resolveMerge`, for a server or a job as well as a page. Lines keep their line breaks, byte for byte.
|
|
46
|
+
|
|
47
|
+
## [0.108.0] - 2026-11-29
|
|
48
|
+
|
|
49
|
+
### Added
|
|
50
|
+
|
|
51
|
+
- `SourceEditor`: plain text with Markdown or MDX colours, a `textarea` over a coloured copy, so that editing is the
|
|
52
|
+
browser's own. Every line keeps its own line break, and a byte order mark and a missing final line break stay. Tab leaves
|
|
53
|
+
the field; Ctrl or Cmd with `]` and `[` indents and outdents; Enter goes on with a list or a quote. It writes no style
|
|
54
|
+
element or attribute.
|
|
55
|
+
- The tokens `--sv-color-syntax-marker`, `-heading`, `-link`, `-code` and `-keyword`, for its colours.
|
|
56
|
+
|
|
8
57
|
## [0.107.4] - 2026-11-26
|
|
9
58
|
|
|
10
59
|
### Security
|
package/README.md
CHANGED
|
@@ -21,7 +21,11 @@ npm install @sovereignfs/ui
|
|
|
21
21
|
import { Button, Input, Card, Dialog, Drawer } from '@sovereignfs/ui';
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
Available components and hooks: `Avatar`, `Badge`, `Button`, `Calendar`, `Card`, `CheckableListRow`, `Checkbox`, `CodeTextarea`, `ConfirmDialog`, `DatePicker`, `DateRangePicker`, `Dialog`, `DragHandleRow`, `Drawer`, `EmptyState`, `FormField`, `Icon`, `IconPicker`, `Input`, `Menu`, `NavTabs`, `OverlayHeader`, `PageHeader`, `Popover`, `QuantityStepper`, `SegmentedControl`, `Select`, `Sheet`, `Spinner`, `SplitPane`, `StatusBadge`, `SuggestionInput`, `SystemBanner`, `Tabs`, `TagInput`, `Textarea`, `Toast` / `useToast`, `Toggle`, `Tooltip`, `useDoubleTapHandler`, `useIsMobile`, `useLongPress`, and `useSingleOrDoubleTap`.
|
|
24
|
+
Available components and hooks: `Avatar`, `Badge`, `Button`, `Calendar`, `Card`, `CheckableListRow`, `Checkbox`, `CodeTextarea`, `CompareView`, `ConfirmDialog`, `DatePicker`, `DateRangePicker`, `Dialog`, `DragHandleRow`, `Drawer`, `EmptyState`, `FormField`, `Icon`, `IconPicker`, `Input`, `Menu`, `MergeView`, `NavTabs`, `OverlayHeader`, `PageHeader`, `Popover`, `QuantityStepper`, `SegmentedControl`, `Select`, `Sheet`, `SourceEditor`, `Spinner`, `SplitPane`, `StatusBadge`, `SuggestionInput`, `SystemBanner`, `Tabs`, `TagInput`, `Textarea`, `Toast` / `useToast`, `Toggle`, `Tooltip`, `useDoubleTapHandler`, `useIsMobile`, `useLongPress`, and `useSingleOrDoubleTap`.
|
|
25
|
+
|
|
26
|
+
`@sovereignfs/ui/text` compares and merges text (`diffLines`, `mergeText`, `resolveMerge`) with no React, for a server too.
|
|
27
|
+
`@sovereignfs/ui/markdown` says whether the rich Markdown editor can hold a text unchanged (`checkMarkdownRoundTrip`).
|
|
28
|
+
`@sovereignfs/ui/markdown-editor` is that editor, `MarkdownEditor`: a rich and a Markdown view of one text.
|
|
25
29
|
|
|
26
30
|
### Tokens
|
|
27
31
|
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
.root {
|
|
2
|
+
min-width: 0;
|
|
3
|
+
border: var(--sv-border-width-hairline) solid var(--sv-color-border);
|
|
4
|
+
border-radius: var(--sv-radius-md);
|
|
5
|
+
background: var(--sv-color-surface);
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.same {
|
|
10
|
+
margin: 0;
|
|
11
|
+
padding: var(--sv-space-2) var(--sv-space-3);
|
|
12
|
+
font-size: var(--sv-font-size-sm);
|
|
13
|
+
color: var(--sv-color-text-muted);
|
|
14
|
+
border-bottom: var(--sv-border-width-hairline) solid var(--sv-color-border);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.table {
|
|
18
|
+
font-family: var(--sv-font-family-mono);
|
|
19
|
+
font-size: var(--sv-font-size-caption);
|
|
20
|
+
line-height: 1.6;
|
|
21
|
+
color: var(--sv-color-text-primary);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.head,
|
|
25
|
+
.row,
|
|
26
|
+
.fold {
|
|
27
|
+
display: grid;
|
|
28
|
+
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.head {
|
|
32
|
+
font-family: var(--sv-font-family);
|
|
33
|
+
font-size: var(--sv-font-size-xs);
|
|
34
|
+
font-weight: var(--sv-font-weight-semibold);
|
|
35
|
+
color: var(--sv-color-text-muted);
|
|
36
|
+
background: var(--sv-color-surface-sunken);
|
|
37
|
+
border-bottom: var(--sv-border-width-hairline) solid var(--sv-color-border);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.head > div {
|
|
41
|
+
padding: var(--sv-space-2) var(--sv-space-3);
|
|
42
|
+
overflow-wrap: anywhere;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.head .sign {
|
|
46
|
+
display: none;
|
|
47
|
+
margin-right: var(--sv-space-2);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.cell,
|
|
51
|
+
.blank {
|
|
52
|
+
min-width: 0;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.cell {
|
|
56
|
+
display: grid;
|
|
57
|
+
grid-template-columns: 5ch 2ch minmax(0, 1fr);
|
|
58
|
+
padding-right: var(--sv-space-2);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.cell[data-side='after'],
|
|
62
|
+
.blank[data-side='after'],
|
|
63
|
+
.head > [data-side='after'] {
|
|
64
|
+
border-left: var(--sv-border-width-hairline) solid var(--sv-color-border);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.blank {
|
|
68
|
+
background: var(--sv-color-surface-sunken);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.cell[data-change='removed'] {
|
|
72
|
+
background: var(--sv-color-error-surface);
|
|
73
|
+
color: var(--sv-color-error-text);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.cell[data-change='added'] {
|
|
77
|
+
background: var(--sv-color-success-surface);
|
|
78
|
+
color: var(--sv-color-success-text);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.number {
|
|
82
|
+
padding-right: var(--sv-space-2);
|
|
83
|
+
text-align: right;
|
|
84
|
+
color: var(--sv-color-text-muted);
|
|
85
|
+
user-select: none;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.cell[data-change] .number {
|
|
89
|
+
color: inherit;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.sign {
|
|
93
|
+
user-select: none;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.text {
|
|
97
|
+
white-space: pre-wrap;
|
|
98
|
+
overflow-wrap: anywhere;
|
|
99
|
+
tab-size: 2;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/* A word that differs: set apart by a line under it too, not by colour alone. */
|
|
103
|
+
.word {
|
|
104
|
+
color: inherit;
|
|
105
|
+
text-decoration-line: underline;
|
|
106
|
+
text-decoration-thickness: 2px;
|
|
107
|
+
text-underline-offset: 2px;
|
|
108
|
+
font-weight: var(--sv-font-weight-bold);
|
|
109
|
+
background: transparent;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.ending {
|
|
113
|
+
margin-left: var(--sv-space-2);
|
|
114
|
+
padding: 0 var(--sv-space-1);
|
|
115
|
+
font-family: var(--sv-font-family);
|
|
116
|
+
font-size: var(--sv-font-size-label);
|
|
117
|
+
border: var(--sv-border-width-hairline) solid currentcolor;
|
|
118
|
+
border-radius: var(--sv-radius-sm);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.fold {
|
|
122
|
+
grid-template-columns: minmax(0, 1fr);
|
|
123
|
+
background: var(--sv-color-surface-sunken);
|
|
124
|
+
border-block: var(--sv-border-width-hairline) solid var(--sv-color-border);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.unfold {
|
|
128
|
+
width: 100%;
|
|
129
|
+
min-height: 28px;
|
|
130
|
+
padding: var(--sv-space-1) var(--sv-space-3);
|
|
131
|
+
font-family: var(--sv-font-family);
|
|
132
|
+
font-size: var(--sv-font-size-xs);
|
|
133
|
+
color: var(--sv-color-text-muted);
|
|
134
|
+
background: none;
|
|
135
|
+
border: 0;
|
|
136
|
+
cursor: pointer;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.unfold:focus-visible {
|
|
140
|
+
outline: 2px solid var(--sv-color-focus-ring);
|
|
141
|
+
outline-offset: -2px;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
@media (hover: hover) {
|
|
145
|
+
.unfold:hover {
|
|
146
|
+
color: var(--sv-color-text-primary);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/* Read by a screen reader only. */
|
|
151
|
+
.hidden {
|
|
152
|
+
position: absolute;
|
|
153
|
+
width: 1px;
|
|
154
|
+
height: 1px;
|
|
155
|
+
overflow: hidden;
|
|
156
|
+
clip-path: inset(50%);
|
|
157
|
+
white-space: nowrap;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/* One under the other: a changed line, then what it became; an unchanged line once. */
|
|
161
|
+
.stacked .head,
|
|
162
|
+
.stacked .row {
|
|
163
|
+
grid-template-columns: minmax(0, 1fr);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.stacked .blank,
|
|
167
|
+
.stacked .row[data-equal] > [data-side='before'] {
|
|
168
|
+
display: none;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.stacked .row > [data-side],
|
|
172
|
+
.stacked .head > [data-side] {
|
|
173
|
+
border-left: 0;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.stacked .head .sign {
|
|
177
|
+
display: inline;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
@media (max-width: 768px) {
|
|
181
|
+
.head,
|
|
182
|
+
.row {
|
|
183
|
+
grid-template-columns: minmax(0, 1fr);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.blank,
|
|
187
|
+
.row[data-equal] > [data-side='before'] {
|
|
188
|
+
display: none;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.row > [data-side],
|
|
192
|
+
.head > [data-side] {
|
|
193
|
+
border-left: 0;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.head .sign {
|
|
197
|
+
display: inline;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.unfold {
|
|
201
|
+
min-height: var(--sv-touch-target-min);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
@@ -0,0 +1,422 @@
|
|
|
1
|
+
.root {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: var(--sv-space-2);
|
|
5
|
+
min-width: 0;
|
|
6
|
+
color: var(--sv-color-text-primary);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.bar {
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-wrap: wrap;
|
|
12
|
+
align-items: center;
|
|
13
|
+
gap: var(--sv-space-2) var(--sv-space-3);
|
|
14
|
+
min-width: 0;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.toolbar {
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-wrap: wrap;
|
|
20
|
+
align-items: center;
|
|
21
|
+
gap: var(--sv-space-1) var(--sv-space-3);
|
|
22
|
+
min-width: 0;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.group {
|
|
26
|
+
display: flex;
|
|
27
|
+
align-items: center;
|
|
28
|
+
gap: var(--sv-space-1);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.tool,
|
|
32
|
+
.style {
|
|
33
|
+
display: inline-flex;
|
|
34
|
+
flex: none;
|
|
35
|
+
align-items: center;
|
|
36
|
+
justify-content: center;
|
|
37
|
+
gap: var(--sv-space-1);
|
|
38
|
+
min-width: 32px;
|
|
39
|
+
height: 32px;
|
|
40
|
+
padding: 0 var(--sv-space-2);
|
|
41
|
+
font-family: var(--sv-font-family);
|
|
42
|
+
font-size: var(--sv-font-size-sm);
|
|
43
|
+
color: var(--sv-color-text-primary);
|
|
44
|
+
background: transparent;
|
|
45
|
+
border: var(--sv-border-width-hairline) solid transparent;
|
|
46
|
+
border-radius: var(--sv-radius-sm);
|
|
47
|
+
cursor: pointer;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.style {
|
|
51
|
+
justify-content: space-between;
|
|
52
|
+
min-width: 132px;
|
|
53
|
+
border-color: var(--sv-color-border);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.tool[aria-pressed='true'],
|
|
57
|
+
.tool[aria-expanded='true'] {
|
|
58
|
+
background: var(--sv-color-accent-subtle);
|
|
59
|
+
border-color: var(--sv-color-border-strong);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.tool[aria-disabled='true'] {
|
|
63
|
+
opacity: 0.4;
|
|
64
|
+
cursor: default;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.tool:focus-visible,
|
|
68
|
+
.style:focus-visible {
|
|
69
|
+
outline: 2px solid var(--sv-color-focus-ring);
|
|
70
|
+
outline-offset: 1px;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
@media (hover: hover) {
|
|
74
|
+
.tool:hover:not([aria-disabled='true']),
|
|
75
|
+
.style:hover {
|
|
76
|
+
background: var(--sv-color-surface-sunken);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.refused {
|
|
81
|
+
display: flex;
|
|
82
|
+
flex-direction: column;
|
|
83
|
+
align-items: flex-start;
|
|
84
|
+
gap: var(--sv-space-2);
|
|
85
|
+
padding: var(--sv-space-3) var(--sv-space-4);
|
|
86
|
+
font-size: var(--sv-font-size-sm);
|
|
87
|
+
color: var(--sv-color-warning-text);
|
|
88
|
+
background: var(--sv-color-warning-surface);
|
|
89
|
+
border: var(--sv-border-width-hairline) solid var(--sv-color-warning-border);
|
|
90
|
+
border-radius: var(--sv-radius-md);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.refused p,
|
|
94
|
+
.refused ul {
|
|
95
|
+
margin: 0;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.refused ul {
|
|
99
|
+
padding-left: var(--sv-space-5);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/* Zero specificity, so that a caller's class on the editor can set the height. */
|
|
103
|
+
:where(.surface),
|
|
104
|
+
:where(.source) {
|
|
105
|
+
max-height: min(70vh, 720px);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.surface {
|
|
109
|
+
display: flex;
|
|
110
|
+
flex-direction: column;
|
|
111
|
+
min-width: 0;
|
|
112
|
+
overflow: auto;
|
|
113
|
+
background: var(--sv-color-surface);
|
|
114
|
+
border: var(--sv-border-width-hairline) solid var(--sv-color-border-strong);
|
|
115
|
+
border-radius: var(--sv-radius-md);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.surface:focus-within {
|
|
119
|
+
border-color: var(--sv-color-accent);
|
|
120
|
+
box-shadow: 0 0 0 2px var(--sv-color-focus-ring);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/* The document. */
|
|
124
|
+
.content {
|
|
125
|
+
flex: 1 0 auto;
|
|
126
|
+
position: relative;
|
|
127
|
+
min-height: 16em;
|
|
128
|
+
padding: var(--sv-space-3) var(--sv-space-4);
|
|
129
|
+
font-family: var(--sv-font-family);
|
|
130
|
+
font-size: var(--sv-font-size-md);
|
|
131
|
+
line-height: 1.6;
|
|
132
|
+
white-space: pre-wrap;
|
|
133
|
+
white-space: break-spaces;
|
|
134
|
+
overflow-wrap: break-word;
|
|
135
|
+
font-variant-ligatures: none;
|
|
136
|
+
outline: none;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.content:focus-visible {
|
|
140
|
+
outline: none;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.content[aria-readonly='true'] {
|
|
144
|
+
color: var(--sv-color-text-muted);
|
|
145
|
+
background: var(--sv-color-surface-sunken);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.content > * {
|
|
149
|
+
margin: 0 0 var(--sv-space-3);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.content > *:last-child {
|
|
153
|
+
margin-bottom: 0;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.content p {
|
|
157
|
+
margin: 0 0 var(--sv-space-2);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.content h1,
|
|
161
|
+
.content h2,
|
|
162
|
+
.content h3,
|
|
163
|
+
.content h4,
|
|
164
|
+
.content h5,
|
|
165
|
+
.content h6 {
|
|
166
|
+
margin: var(--sv-space-4) 0 var(--sv-space-2);
|
|
167
|
+
font-weight: var(--sv-font-weight-semibold);
|
|
168
|
+
line-height: 1.3;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.content > h1:first-child,
|
|
172
|
+
.content > h2:first-child,
|
|
173
|
+
.content > h3:first-child {
|
|
174
|
+
margin-top: 0;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.content h1 {
|
|
178
|
+
font-size: var(--sv-font-size-2xl);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.content h2 {
|
|
182
|
+
font-size: var(--sv-font-size-xl);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.content h3 {
|
|
186
|
+
font-size: var(--sv-font-size-lg);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.content h4,
|
|
190
|
+
.content h5,
|
|
191
|
+
.content h6 {
|
|
192
|
+
font-size: var(--sv-font-size-md);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.content h5,
|
|
196
|
+
.content h6 {
|
|
197
|
+
color: var(--sv-color-text-muted);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.content ul,
|
|
201
|
+
.content ol {
|
|
202
|
+
padding-left: var(--sv-space-6);
|
|
203
|
+
margin: 0 0 var(--sv-space-2);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.content li {
|
|
207
|
+
position: relative;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.content li > p {
|
|
211
|
+
margin-bottom: var(--sv-space-1);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.content a {
|
|
215
|
+
color: var(--sv-color-syntax-link);
|
|
216
|
+
text-decoration: underline;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.content code {
|
|
220
|
+
padding: 0 var(--sv-space-1);
|
|
221
|
+
font-family: var(--sv-font-family-mono);
|
|
222
|
+
font-size: var(--sv-font-size-sm);
|
|
223
|
+
background: var(--sv-color-surface-sunken);
|
|
224
|
+
border-radius: var(--sv-radius-sm);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.content pre {
|
|
228
|
+
margin: 0 0 var(--sv-space-3);
|
|
229
|
+
padding: var(--sv-space-3);
|
|
230
|
+
font-family: var(--sv-font-family-mono);
|
|
231
|
+
font-size: var(--sv-font-size-sm);
|
|
232
|
+
white-space: pre-wrap;
|
|
233
|
+
background: var(--sv-color-surface-sunken);
|
|
234
|
+
border: var(--sv-border-width-hairline) solid var(--sv-color-border);
|
|
235
|
+
border-radius: var(--sv-radius-md);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.content pre code {
|
|
239
|
+
padding: 0;
|
|
240
|
+
background: none;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/* Raw HTML, footnotes and references: shown as written. */
|
|
244
|
+
.content pre[data-raw],
|
|
245
|
+
.content code[data-raw] {
|
|
246
|
+
font-family: var(--sv-font-family-mono);
|
|
247
|
+
color: var(--sv-color-text-muted);
|
|
248
|
+
border: var(--sv-border-width-hairline) dashed var(--sv-color-border-strong);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.content blockquote {
|
|
252
|
+
margin: 0 0 var(--sv-space-3);
|
|
253
|
+
padding-left: var(--sv-space-4);
|
|
254
|
+
color: var(--sv-color-text-muted);
|
|
255
|
+
border-left: 3px solid var(--sv-color-border-strong);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.content hr {
|
|
259
|
+
height: 0;
|
|
260
|
+
margin: var(--sv-space-4) 0;
|
|
261
|
+
border: 0;
|
|
262
|
+
border-top: var(--sv-border-width-hairline) solid var(--sv-color-border-strong);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.content table {
|
|
266
|
+
width: 100%;
|
|
267
|
+
margin: 0 0 var(--sv-space-3);
|
|
268
|
+
table-layout: fixed;
|
|
269
|
+
border-collapse: collapse;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.content th,
|
|
273
|
+
.content td {
|
|
274
|
+
position: relative;
|
|
275
|
+
min-width: 3em;
|
|
276
|
+
padding: var(--sv-space-1) var(--sv-space-2);
|
|
277
|
+
text-align: left;
|
|
278
|
+
vertical-align: top;
|
|
279
|
+
border: var(--sv-border-width-hairline) solid var(--sv-color-border-strong);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
.content th {
|
|
283
|
+
font-weight: var(--sv-font-weight-semibold);
|
|
284
|
+
background: var(--sv-color-surface-sunken);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.content [data-align='center'] {
|
|
288
|
+
text-align: center;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.content [data-align='right'] {
|
|
292
|
+
text-align: right;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.task {
|
|
296
|
+
display: flex;
|
|
297
|
+
align-items: flex-start;
|
|
298
|
+
gap: var(--sv-space-2);
|
|
299
|
+
list-style: none;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.box {
|
|
303
|
+
flex: none;
|
|
304
|
+
width: 16px;
|
|
305
|
+
height: 16px;
|
|
306
|
+
margin: 0.3em 0 0;
|
|
307
|
+
accent-color: var(--sv-color-accent);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
.box:focus-visible {
|
|
311
|
+
outline: 2px solid var(--sv-color-focus-ring);
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.taskText {
|
|
315
|
+
flex: 1;
|
|
316
|
+
min-width: 0;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
.image img {
|
|
320
|
+
max-width: 100%;
|
|
321
|
+
vertical-align: bottom;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
.missing {
|
|
325
|
+
display: inline-block;
|
|
326
|
+
padding: 0 var(--sv-space-2);
|
|
327
|
+
font-size: var(--sv-font-size-sm);
|
|
328
|
+
color: var(--sv-color-text-muted);
|
|
329
|
+
border: var(--sv-border-width-hairline) dashed var(--sv-color-border-strong);
|
|
330
|
+
border-radius: var(--sv-radius-sm);
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
/* What ProseMirror needs of a page's styles, on the design system's tokens. */
|
|
334
|
+
.content :global(.ProseMirror-hideselection *::selection) {
|
|
335
|
+
background: transparent;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
.content :global(.ProseMirror-selectednode) {
|
|
339
|
+
outline: 2px solid var(--sv-color-focus-ring);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
.content li:global(.ProseMirror-selectednode) {
|
|
343
|
+
outline: none;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
.content :global(img.ProseMirror-separator) {
|
|
347
|
+
display: inline;
|
|
348
|
+
width: 0;
|
|
349
|
+
height: 0;
|
|
350
|
+
margin: 0;
|
|
351
|
+
border: 0;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/* A caret between blocks that hold none of their own. */
|
|
355
|
+
.content :global(.ProseMirror-gapcursor) {
|
|
356
|
+
display: none;
|
|
357
|
+
position: absolute;
|
|
358
|
+
pointer-events: none;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
.content :global(.ProseMirror-gapcursor)::after {
|
|
362
|
+
content: '';
|
|
363
|
+
display: block;
|
|
364
|
+
position: absolute;
|
|
365
|
+
top: -2px;
|
|
366
|
+
width: 24px;
|
|
367
|
+
border-top: 2px solid var(--sv-color-text-primary);
|
|
368
|
+
animation: blink 1.1s steps(2, start) infinite;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
.content:global(.ProseMirror-focused) :global(.ProseMirror-gapcursor) {
|
|
372
|
+
display: block;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
@keyframes blink {
|
|
376
|
+
to {
|
|
377
|
+
visibility: hidden;
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
.content :global(.selectedCell)::after {
|
|
382
|
+
content: '';
|
|
383
|
+
position: absolute;
|
|
384
|
+
inset: 0;
|
|
385
|
+
background: var(--sv-color-accent-subtle);
|
|
386
|
+
pointer-events: none;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
.form {
|
|
390
|
+
display: flex;
|
|
391
|
+
flex-direction: column;
|
|
392
|
+
gap: var(--sv-space-3);
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
.actions {
|
|
396
|
+
display: flex;
|
|
397
|
+
flex-wrap: wrap;
|
|
398
|
+
justify-content: flex-end;
|
|
399
|
+
gap: var(--sv-space-2);
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
/* On a phone the toolbar is one row that scrolls sideways; its menus are drawers there, which nothing clips. */
|
|
403
|
+
@media (max-width: 768px) {
|
|
404
|
+
.toolbar {
|
|
405
|
+
flex-wrap: nowrap;
|
|
406
|
+
width: 100%;
|
|
407
|
+
overflow-x: auto;
|
|
408
|
+
scrollbar-width: thin;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
.tool,
|
|
412
|
+
.style {
|
|
413
|
+
min-width: var(--sv-touch-target-min);
|
|
414
|
+
height: var(--sv-touch-target-min);
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
@media (prefers-reduced-motion: reduce) {
|
|
419
|
+
.content :global(.ProseMirror-gapcursor)::after {
|
|
420
|
+
animation: none;
|
|
421
|
+
}
|
|
422
|
+
}
|