@memorysmithapp/markdown-renderer 0.3.2 → 0.5.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.
Files changed (59) hide show
  1. package/README.md +50 -4
  2. package/dist/Markdown.d.ts +6 -2
  3. package/dist/Markdown.js +126 -17
  4. package/dist/NoteActions.d.ts +9 -0
  5. package/dist/NoteActions.js +68 -0
  6. package/dist/NoteBody.d.ts +32 -2
  7. package/dist/NoteBody.js +74 -7
  8. package/dist/edit/AttachDialog.d.ts +23 -0
  9. package/dist/edit/AttachDialog.js +126 -0
  10. package/dist/edit/ContextMenu.d.ts +29 -0
  11. package/dist/edit/ContextMenu.js +95 -0
  12. package/dist/edit/LanguageControl.d.ts +19 -0
  13. package/dist/edit/LanguageControl.js +124 -0
  14. package/dist/edit/NoteEditor.d.ts +44 -0
  15. package/dist/edit/NoteEditor.js +520 -0
  16. package/dist/edit/SaveNoticeDialog.d.ts +15 -0
  17. package/dist/edit/SaveNoticeDialog.js +41 -0
  18. package/dist/edit/analyze.d.ts +150 -0
  19. package/dist/edit/analyze.js +268 -0
  20. package/dist/edit/blocks.d.ts +97 -0
  21. package/dist/edit/blocks.js +481 -0
  22. package/dist/edit/commands.d.ts +78 -0
  23. package/dist/edit/commands.js +257 -0
  24. package/dist/edit/frontmatter.d.ts +45 -0
  25. package/dist/edit/frontmatter.js +142 -0
  26. package/dist/edit/index.d.ts +5 -0
  27. package/dist/edit/index.js +7 -0
  28. package/dist/edit/live.d.ts +28 -0
  29. package/dist/edit/live.js +675 -0
  30. package/dist/edit/saves.d.ts +48 -0
  31. package/dist/edit/saves.js +73 -0
  32. package/dist/edit/table.d.ts +58 -0
  33. package/dist/edit/table.js +185 -0
  34. package/dist/file-types.d.ts +30 -0
  35. package/dist/file-types.js +70 -0
  36. package/dist/highlight.d.ts +21 -7
  37. package/dist/highlight.js +56 -7
  38. package/dist/host.d.ts +82 -3
  39. package/dist/host.js +16 -0
  40. package/dist/index.d.ts +6 -4
  41. package/dist/index.js +1 -0
  42. package/dist/mode-icons.d.ts +6 -0
  43. package/dist/mode-icons.js +11 -0
  44. package/dist/prism-grammars.d.ts +18 -0
  45. package/dist/prism-grammars.js +305 -0
  46. package/dist/remark-callouts.d.ts +6 -0
  47. package/dist/remark-callouts.js +2 -2
  48. package/dist/remark-ring.d.ts +5 -0
  49. package/dist/remark-ring.js +25 -15
  50. package/dist/slots.js +17 -1
  51. package/dist/strings.d.ts +129 -1
  52. package/dist/strings.js +127 -1
  53. package/dist/task-saves.d.ts +35 -0
  54. package/dist/task-saves.js +86 -0
  55. package/dist/theme.d.ts +47 -0
  56. package/dist/theme.js +2 -2
  57. package/package.json +14 -2
  58. package/structure.css +355 -0
  59. package/theme-default.css +1099 -0
package/structure.css CHANGED
@@ -62,3 +62,358 @@
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
+ /* The paperclip and, under it, the bar of the host's fraction (#88). */
237
+ .markdown .edit-attach-control {
238
+ position: relative;
239
+ display: inline-flex;
240
+ }
241
+ .markdown .edit-attach-progress {
242
+ position: absolute;
243
+ inset-inline: 0.2rem;
244
+ bottom: 0;
245
+ pointer-events: none;
246
+ }
247
+ .markdown .edit-attach .edit-source-frame {
248
+ height: min(34rem, calc(100vh - 4rem));
249
+ }
250
+ .markdown .edit-attach-ways {
251
+ display: flex;
252
+ flex: none;
253
+ }
254
+ .markdown .edit-attach-panel {
255
+ flex: 1 1 auto;
256
+ min-height: 0;
257
+ overflow: auto;
258
+ }
259
+ .markdown .edit-attach-form,
260
+ .markdown .edit-attach-files {
261
+ display: flex;
262
+ flex-direction: column;
263
+ }
264
+ .markdown .edit-attach-form label {
265
+ display: flex;
266
+ flex-direction: column;
267
+ }
268
+ .markdown .edit-attach-file {
269
+ display: grid;
270
+ grid-template-columns: 1fr 1fr auto;
271
+ align-items: end;
272
+ }
273
+ .markdown .edit-attach-list {
274
+ margin: 0;
275
+ padding: 0;
276
+ list-style: none;
277
+ }
278
+ .markdown .edit-attach-item {
279
+ display: flex;
280
+ align-items: center;
281
+ width: 100%;
282
+ text-align: start;
283
+ }
284
+ .markdown .edit-attach-item-body {
285
+ display: flex;
286
+ flex-direction: column;
287
+ min-width: 0;
288
+ }
289
+ .markdown .edit-attach-preview {
290
+ display: inline-flex;
291
+ flex: none;
292
+ align-items: center;
293
+ justify-content: center;
294
+ overflow: hidden;
295
+ }
296
+ .markdown .edit-attach-preview img {
297
+ width: 100%;
298
+ height: 100%;
299
+ object-fit: cover;
300
+ }
301
+ .markdown .edit-attach-actions {
302
+ display: flex;
303
+ justify-content: flex-end;
304
+ }
305
+ /* What the host said of a save (#86): its title, its explanation, and its
306
+ choices in a row that wraps, as narrow as its words. */
307
+ .markdown .edit-notice {
308
+ max-width: min(32rem, calc(100vw - 2rem));
309
+ }
310
+ .markdown .edit-notice-message {
311
+ margin: 0;
312
+ }
313
+ .markdown .edit-notice-actions {
314
+ display: flex;
315
+ flex-wrap: wrap;
316
+ justify-content: flex-end;
317
+ }
318
+ @media (max-width: 560px) {
319
+ .markdown .edit-attach-file {
320
+ grid-template-columns: 1fr auto;
321
+ }
322
+ }
323
+
324
+ /* The note's Markdown, in a dialog over the page: the dialog has no padding,
325
+ so a click on it and not on its frame is a click outside. */
326
+ .markdown .edit-source {
327
+ padding: 0;
328
+ max-width: min(56rem, calc(100vw - 2rem));
329
+ width: 100%;
330
+ max-height: calc(100vh - 4rem);
331
+ overflow: hidden;
332
+ }
333
+ /* Only the text scrolls: the frame is as tall as the dialog lets it be. */
334
+ .markdown .edit-source[open] {
335
+ display: flex;
336
+ flex-direction: column;
337
+ }
338
+ .markdown .edit-source-frame {
339
+ display: flex;
340
+ flex-direction: column;
341
+ flex: 1 1 auto;
342
+ min-height: 0;
343
+ }
344
+ .markdown .edit-source-header {
345
+ flex: none;
346
+ }
347
+ .markdown .edit-source-text {
348
+ flex: 1 1 auto;
349
+ min-height: 0;
350
+ }
351
+ .markdown .edit-source-header {
352
+ display: flex;
353
+ align-items: center;
354
+ gap: 0.5rem;
355
+ }
356
+ .markdown .edit-source-title {
357
+ margin: 0;
358
+ flex: 1 1 auto;
359
+ }
360
+ .markdown .edit-source-text {
361
+ margin: 0;
362
+ overflow: auto;
363
+ white-space: pre-wrap;
364
+ overflow-wrap: anywhere;
365
+ }
366
+ .markdown .edit-toolbar-group {
367
+ display: inline-flex;
368
+ align-items: center;
369
+ gap: 0.1rem;
370
+ }
371
+ .markdown .edit-control,
372
+ .markdown .edit-toolbar select {
373
+ display: inline-flex;
374
+ align-items: center;
375
+ justify-content: center;
376
+ }
377
+ .markdown .markdown-editor .cm-editor {
378
+ outline: none;
379
+ }
380
+ .markdown .markdown-editor .cm-scroller {
381
+ overflow: visible;
382
+ }
383
+ .markdown .cm-ms-block,
384
+ .markdown .edit-block {
385
+ position: relative;
386
+ }
387
+ /* A drawn block is laid out as the page lays it out, not as the editor's text,
388
+ and holds the margins of what it draws: a margin that collapsed through it
389
+ would be space the editor does not count, and every click below it would
390
+ land a line off. */
391
+ .markdown .cm-ms-block,
392
+ .markdown .cm-ms-inline-block {
393
+ white-space: normal;
394
+ }
395
+ .markdown .cm-ms-block,
396
+ .markdown .cm-ms-rule,
397
+ .markdown .cm-ms-math-block {
398
+ display: flow-root;
399
+ }
400
+ /* A table's cell is where a click edits it: it fills its column and keeps a
401
+ size of its own when it is empty, as every cell of a new table is, or it
402
+ would be nothing wide and nothing could be clicked (#68). */
403
+ .markdown .edit-cell {
404
+ display: block;
405
+ min-width: 3em;
406
+ min-height: 1.5em;
407
+ }
408
+ .markdown .edit-block-controls {
409
+ position: absolute;
410
+ top: 0.25rem;
411
+ right: 0.25rem;
412
+ z-index: 1;
413
+ display: flex;
414
+ gap: 0.15rem;
415
+ }
416
+ .markdown .cm-ms-image {
417
+ max-width: 100%;
418
+ vertical-align: middle;
419
+ }