@memorysmithapp/markdown-renderer 0.3.2 → 0.4.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/README.md +32 -4
- package/dist/Markdown.d.ts +6 -2
- package/dist/Markdown.js +126 -17
- package/dist/NoteActions.d.ts +9 -0
- package/dist/NoteActions.js +68 -0
- package/dist/NoteBody.d.ts +23 -2
- package/dist/NoteBody.js +73 -7
- package/dist/edit/AttachDialog.d.ts +21 -0
- package/dist/edit/AttachDialog.js +126 -0
- package/dist/edit/ContextMenu.d.ts +29 -0
- package/dist/edit/ContextMenu.js +95 -0
- package/dist/edit/LanguageControl.d.ts +19 -0
- package/dist/edit/LanguageControl.js +124 -0
- package/dist/edit/NoteEditor.d.ts +43 -0
- package/dist/edit/NoteEditor.js +461 -0
- package/dist/edit/analyze.d.ts +150 -0
- package/dist/edit/analyze.js +268 -0
- package/dist/edit/blocks.d.ts +96 -0
- package/dist/edit/blocks.js +480 -0
- package/dist/edit/commands.d.ts +78 -0
- package/dist/edit/commands.js +257 -0
- package/dist/edit/frontmatter.d.ts +45 -0
- package/dist/edit/frontmatter.js +142 -0
- package/dist/edit/index.d.ts +4 -0
- package/dist/edit/index.js +6 -0
- package/dist/edit/live.d.ts +28 -0
- package/dist/edit/live.js +675 -0
- package/dist/edit/saves.d.ts +18 -0
- package/dist/edit/saves.js +52 -0
- package/dist/edit/table.d.ts +58 -0
- package/dist/edit/table.js +185 -0
- package/dist/file-types.d.ts +30 -0
- package/dist/file-types.js +70 -0
- package/dist/highlight.d.ts +21 -7
- package/dist/highlight.js +56 -7
- package/dist/host.d.ts +60 -3
- package/dist/host.js +8 -0
- package/dist/index.d.ts +4 -4
- package/dist/mode-icons.d.ts +6 -0
- package/dist/mode-icons.js +11 -0
- package/dist/prism-grammars.d.ts +18 -0
- package/dist/prism-grammars.js +305 -0
- package/dist/remark-callouts.d.ts +6 -0
- package/dist/remark-callouts.js +2 -2
- package/dist/remark-ring.d.ts +5 -0
- package/dist/remark-ring.js +25 -15
- package/dist/slots.js +17 -1
- package/dist/strings.d.ts +127 -1
- package/dist/strings.js +126 -1
- package/dist/task-saves.d.ts +35 -0
- package/dist/task-saves.js +86 -0
- package/dist/theme.d.ts +47 -0
- package/dist/theme.js +2 -2
- package/package.json +14 -2
- package/structure.css +331 -0
- package/theme-default.css +1072 -0
package/structure.css
CHANGED
|
@@ -62,3 +62,334 @@
|
|
|
62
62
|
width: 100%;
|
|
63
63
|
height: 100%;
|
|
64
64
|
}
|
|
65
|
+
|
|
66
|
+
/* A task item whose tick the host is saving is covered by a lock, which takes
|
|
67
|
+
every click on the item until the save settles; a failed save leaves a
|
|
68
|
+
notice in the same corner. Where they are drawn is the theme's. */
|
|
69
|
+
.markdown li.task-item[data-save] {
|
|
70
|
+
position: relative;
|
|
71
|
+
}
|
|
72
|
+
.markdown .task-lock {
|
|
73
|
+
position: absolute;
|
|
74
|
+
inset: 0;
|
|
75
|
+
z-index: 1;
|
|
76
|
+
display: flex;
|
|
77
|
+
align-items: flex-start;
|
|
78
|
+
justify-content: flex-end;
|
|
79
|
+
cursor: progress;
|
|
80
|
+
}
|
|
81
|
+
.markdown .task-notice {
|
|
82
|
+
position: absolute;
|
|
83
|
+
top: 0;
|
|
84
|
+
right: 0;
|
|
85
|
+
z-index: 1;
|
|
86
|
+
pointer-events: none;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/* The switch between reading and editing sits at the top right of the note,
|
|
90
|
+
and the text of a title flows around it. In edit mode it stays there, at
|
|
91
|
+
the end of a bar that holds the toolbar to its left and the save's status
|
|
92
|
+
under it, and the bar stays at the top of the note while it scrolls. */
|
|
93
|
+
/* The group at the top right: Show Markdown, Copy Markdown and the switch (#76). */
|
|
94
|
+
.markdown .note-corner {
|
|
95
|
+
float: right;
|
|
96
|
+
position: relative;
|
|
97
|
+
z-index: 2;
|
|
98
|
+
display: inline-flex;
|
|
99
|
+
align-items: stretch;
|
|
100
|
+
gap: 0.25rem;
|
|
101
|
+
}
|
|
102
|
+
.markdown .mode-switch,
|
|
103
|
+
.markdown .note-action {
|
|
104
|
+
display: inline-flex;
|
|
105
|
+
align-items: center;
|
|
106
|
+
justify-content: center;
|
|
107
|
+
gap: 0.35em;
|
|
108
|
+
}
|
|
109
|
+
.markdown .mode-switch-glyph {
|
|
110
|
+
flex: none;
|
|
111
|
+
}
|
|
112
|
+
.markdown .edit-bar {
|
|
113
|
+
position: sticky;
|
|
114
|
+
top: 0;
|
|
115
|
+
z-index: 3;
|
|
116
|
+
}
|
|
117
|
+
/* The toolbar's box: its tools, which wrap, and at its top right the corner
|
|
118
|
+
that holds the save's status and the switch, which it grows out of. */
|
|
119
|
+
.markdown .edit-toolbar {
|
|
120
|
+
display: flex;
|
|
121
|
+
align-items: flex-start;
|
|
122
|
+
gap: 0.25rem;
|
|
123
|
+
}
|
|
124
|
+
.markdown .edit-toolbar-tools {
|
|
125
|
+
flex: 1 1 auto;
|
|
126
|
+
min-width: 0;
|
|
127
|
+
display: flex;
|
|
128
|
+
flex-wrap: wrap;
|
|
129
|
+
align-items: center;
|
|
130
|
+
gap: 0.25rem;
|
|
131
|
+
}
|
|
132
|
+
.markdown .edit-corner {
|
|
133
|
+
flex: none;
|
|
134
|
+
display: flex;
|
|
135
|
+
flex-wrap: wrap;
|
|
136
|
+
justify-content: flex-end;
|
|
137
|
+
align-items: center;
|
|
138
|
+
gap: 0.25rem;
|
|
139
|
+
}
|
|
140
|
+
.markdown .edit-corner .note-corner {
|
|
141
|
+
float: none;
|
|
142
|
+
}
|
|
143
|
+
/* On a phone the corner keeps the top right, and the tools take the whole
|
|
144
|
+
width under it rather than a narrow column beside it. */
|
|
145
|
+
@media (max-width: 560px) {
|
|
146
|
+
.markdown .edit-toolbar {
|
|
147
|
+
flex-wrap: wrap;
|
|
148
|
+
}
|
|
149
|
+
.markdown .edit-corner {
|
|
150
|
+
order: -1;
|
|
151
|
+
flex-basis: 100%;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
.markdown .edit-save {
|
|
155
|
+
display: inline-flex;
|
|
156
|
+
flex-wrap: wrap;
|
|
157
|
+
justify-content: flex-end;
|
|
158
|
+
align-items: center;
|
|
159
|
+
column-gap: 0.3em;
|
|
160
|
+
}
|
|
161
|
+
.markdown .edit-bar[data-leaving] .edit-save {
|
|
162
|
+
display: none;
|
|
163
|
+
}
|
|
164
|
+
.markdown .edit-save-icon {
|
|
165
|
+
display: inline-flex;
|
|
166
|
+
flex: none;
|
|
167
|
+
align-items: center;
|
|
168
|
+
justify-content: center;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/* A code block's language, at the top right of its first line (#84), and
|
|
172
|
+
the list it is chosen from, over the lines below. */
|
|
173
|
+
.markdown .markdown-editor .cm-line.cm-ms-code-first {
|
|
174
|
+
position: relative;
|
|
175
|
+
}
|
|
176
|
+
.markdown .edit-language {
|
|
177
|
+
position: absolute;
|
|
178
|
+
top: 0.15rem;
|
|
179
|
+
right: 0.4rem;
|
|
180
|
+
z-index: 4;
|
|
181
|
+
white-space: normal;
|
|
182
|
+
}
|
|
183
|
+
.markdown .edit-language-button {
|
|
184
|
+
display: inline-flex;
|
|
185
|
+
align-items: center;
|
|
186
|
+
gap: 0.25rem;
|
|
187
|
+
}
|
|
188
|
+
.markdown .edit-language-popover {
|
|
189
|
+
position: absolute;
|
|
190
|
+
top: calc(100% + 0.25rem);
|
|
191
|
+
right: 0;
|
|
192
|
+
display: flex;
|
|
193
|
+
flex-direction: column;
|
|
194
|
+
width: 16rem;
|
|
195
|
+
max-height: 18rem;
|
|
196
|
+
}
|
|
197
|
+
.markdown .edit-language-list {
|
|
198
|
+
display: flex;
|
|
199
|
+
flex-direction: column;
|
|
200
|
+
overflow-y: auto;
|
|
201
|
+
min-height: 0;
|
|
202
|
+
}
|
|
203
|
+
.markdown .edit-language-option {
|
|
204
|
+
display: flex;
|
|
205
|
+
justify-content: space-between;
|
|
206
|
+
gap: 0.5rem;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/* The editing menu of a right-click (#81): over everything, where it was
|
|
210
|
+
opened, its entries a column of rows that scrolls when the window is short. */
|
|
211
|
+
.markdown .edit-menu {
|
|
212
|
+
position: fixed;
|
|
213
|
+
z-index: 50;
|
|
214
|
+
display: flex;
|
|
215
|
+
flex-direction: column;
|
|
216
|
+
max-height: calc(100vh - 1rem);
|
|
217
|
+
overflow-y: auto;
|
|
218
|
+
}
|
|
219
|
+
.markdown .edit-menu-group {
|
|
220
|
+
display: flex;
|
|
221
|
+
flex-direction: column;
|
|
222
|
+
}
|
|
223
|
+
.markdown .edit-menu-item {
|
|
224
|
+
display: flex;
|
|
225
|
+
align-items: center;
|
|
226
|
+
width: 100%;
|
|
227
|
+
text-align: start;
|
|
228
|
+
}
|
|
229
|
+
.markdown .edit-menu-label {
|
|
230
|
+
flex: 1 1 auto;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/* The attach dialog (#78): its ways in as tabs, a panel that alone scrolls,
|
|
234
|
+
and the files of the notebook as a list of buttons. */
|
|
235
|
+
/* One height for every way in, so the dialog does not jump between them. */
|
|
236
|
+
.markdown .edit-attach .edit-source-frame {
|
|
237
|
+
height: min(34rem, calc(100vh - 4rem));
|
|
238
|
+
}
|
|
239
|
+
.markdown .edit-attach-ways {
|
|
240
|
+
display: flex;
|
|
241
|
+
flex: none;
|
|
242
|
+
}
|
|
243
|
+
.markdown .edit-attach-panel {
|
|
244
|
+
flex: 1 1 auto;
|
|
245
|
+
min-height: 0;
|
|
246
|
+
overflow: auto;
|
|
247
|
+
}
|
|
248
|
+
.markdown .edit-attach-form,
|
|
249
|
+
.markdown .edit-attach-files {
|
|
250
|
+
display: flex;
|
|
251
|
+
flex-direction: column;
|
|
252
|
+
}
|
|
253
|
+
.markdown .edit-attach-form label {
|
|
254
|
+
display: flex;
|
|
255
|
+
flex-direction: column;
|
|
256
|
+
}
|
|
257
|
+
.markdown .edit-attach-file {
|
|
258
|
+
display: grid;
|
|
259
|
+
grid-template-columns: 1fr 1fr auto;
|
|
260
|
+
align-items: end;
|
|
261
|
+
}
|
|
262
|
+
.markdown .edit-attach-list {
|
|
263
|
+
margin: 0;
|
|
264
|
+
padding: 0;
|
|
265
|
+
list-style: none;
|
|
266
|
+
}
|
|
267
|
+
.markdown .edit-attach-item {
|
|
268
|
+
display: flex;
|
|
269
|
+
align-items: center;
|
|
270
|
+
width: 100%;
|
|
271
|
+
text-align: start;
|
|
272
|
+
}
|
|
273
|
+
.markdown .edit-attach-item-body {
|
|
274
|
+
display: flex;
|
|
275
|
+
flex-direction: column;
|
|
276
|
+
min-width: 0;
|
|
277
|
+
}
|
|
278
|
+
.markdown .edit-attach-preview {
|
|
279
|
+
display: inline-flex;
|
|
280
|
+
flex: none;
|
|
281
|
+
align-items: center;
|
|
282
|
+
justify-content: center;
|
|
283
|
+
overflow: hidden;
|
|
284
|
+
}
|
|
285
|
+
.markdown .edit-attach-preview img {
|
|
286
|
+
width: 100%;
|
|
287
|
+
height: 100%;
|
|
288
|
+
object-fit: cover;
|
|
289
|
+
}
|
|
290
|
+
.markdown .edit-attach-actions {
|
|
291
|
+
display: flex;
|
|
292
|
+
justify-content: flex-end;
|
|
293
|
+
}
|
|
294
|
+
@media (max-width: 560px) {
|
|
295
|
+
.markdown .edit-attach-file {
|
|
296
|
+
grid-template-columns: 1fr auto;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
/* The note's Markdown, in a dialog over the page: the dialog has no padding,
|
|
301
|
+
so a click on it and not on its frame is a click outside. */
|
|
302
|
+
.markdown .edit-source {
|
|
303
|
+
padding: 0;
|
|
304
|
+
max-width: min(56rem, calc(100vw - 2rem));
|
|
305
|
+
width: 100%;
|
|
306
|
+
max-height: calc(100vh - 4rem);
|
|
307
|
+
overflow: hidden;
|
|
308
|
+
}
|
|
309
|
+
/* Only the text scrolls: the frame is as tall as the dialog lets it be. */
|
|
310
|
+
.markdown .edit-source[open] {
|
|
311
|
+
display: flex;
|
|
312
|
+
flex-direction: column;
|
|
313
|
+
}
|
|
314
|
+
.markdown .edit-source-frame {
|
|
315
|
+
display: flex;
|
|
316
|
+
flex-direction: column;
|
|
317
|
+
flex: 1 1 auto;
|
|
318
|
+
min-height: 0;
|
|
319
|
+
}
|
|
320
|
+
.markdown .edit-source-header {
|
|
321
|
+
flex: none;
|
|
322
|
+
}
|
|
323
|
+
.markdown .edit-source-text {
|
|
324
|
+
flex: 1 1 auto;
|
|
325
|
+
min-height: 0;
|
|
326
|
+
}
|
|
327
|
+
.markdown .edit-source-header {
|
|
328
|
+
display: flex;
|
|
329
|
+
align-items: center;
|
|
330
|
+
gap: 0.5rem;
|
|
331
|
+
}
|
|
332
|
+
.markdown .edit-source-title {
|
|
333
|
+
margin: 0;
|
|
334
|
+
flex: 1 1 auto;
|
|
335
|
+
}
|
|
336
|
+
.markdown .edit-source-text {
|
|
337
|
+
margin: 0;
|
|
338
|
+
overflow: auto;
|
|
339
|
+
white-space: pre-wrap;
|
|
340
|
+
overflow-wrap: anywhere;
|
|
341
|
+
}
|
|
342
|
+
.markdown .edit-toolbar-group {
|
|
343
|
+
display: inline-flex;
|
|
344
|
+
align-items: center;
|
|
345
|
+
gap: 0.1rem;
|
|
346
|
+
}
|
|
347
|
+
.markdown .edit-control,
|
|
348
|
+
.markdown .edit-toolbar select {
|
|
349
|
+
display: inline-flex;
|
|
350
|
+
align-items: center;
|
|
351
|
+
justify-content: center;
|
|
352
|
+
}
|
|
353
|
+
.markdown .markdown-editor .cm-editor {
|
|
354
|
+
outline: none;
|
|
355
|
+
}
|
|
356
|
+
.markdown .markdown-editor .cm-scroller {
|
|
357
|
+
overflow: visible;
|
|
358
|
+
}
|
|
359
|
+
.markdown .cm-ms-block,
|
|
360
|
+
.markdown .edit-block {
|
|
361
|
+
position: relative;
|
|
362
|
+
}
|
|
363
|
+
/* A drawn block is laid out as the page lays it out, not as the editor's text,
|
|
364
|
+
and holds the margins of what it draws: a margin that collapsed through it
|
|
365
|
+
would be space the editor does not count, and every click below it would
|
|
366
|
+
land a line off. */
|
|
367
|
+
.markdown .cm-ms-block,
|
|
368
|
+
.markdown .cm-ms-inline-block {
|
|
369
|
+
white-space: normal;
|
|
370
|
+
}
|
|
371
|
+
.markdown .cm-ms-block,
|
|
372
|
+
.markdown .cm-ms-rule,
|
|
373
|
+
.markdown .cm-ms-math-block {
|
|
374
|
+
display: flow-root;
|
|
375
|
+
}
|
|
376
|
+
/* A table's cell is where a click edits it: it fills its column and keeps a
|
|
377
|
+
size of its own when it is empty, as every cell of a new table is, or it
|
|
378
|
+
would be nothing wide and nothing could be clicked (#68). */
|
|
379
|
+
.markdown .edit-cell {
|
|
380
|
+
display: block;
|
|
381
|
+
min-width: 3em;
|
|
382
|
+
min-height: 1.5em;
|
|
383
|
+
}
|
|
384
|
+
.markdown .edit-block-controls {
|
|
385
|
+
position: absolute;
|
|
386
|
+
top: 0.25rem;
|
|
387
|
+
right: 0.25rem;
|
|
388
|
+
z-index: 1;
|
|
389
|
+
display: flex;
|
|
390
|
+
gap: 0.15rem;
|
|
391
|
+
}
|
|
392
|
+
.markdown .cm-ms-image {
|
|
393
|
+
max-width: 100%;
|
|
394
|
+
vertical-align: middle;
|
|
395
|
+
}
|