@memorysmithapp/markdown-renderer 0.7.0 → 0.8.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 +1 -1
- package/dist/Markdown.d.ts +12 -1
- package/dist/Markdown.js +41 -33
- package/dist/diagnose.js +15 -1
- package/dist/edit/ContextMenu.d.ts +1 -1
- package/dist/edit/ContextMenu.js +1 -1
- package/dist/edit/NoteEditor.js +42 -21
- package/dist/edit/blocks.d.ts +21 -5
- package/dist/edit/blocks.js +328 -56
- package/dist/edit/click-source.d.ts +16 -0
- package/dist/edit/click-source.js +74 -0
- package/dist/edit/heights.js +2 -0
- package/dist/edit/image-size.d.ts +26 -10
- package/dist/edit/image-size.js +52 -17
- package/dist/edit/live.js +25 -11
- package/dist/host.d.ts +15 -1
- package/dist/image-dimensions.d.ts +30 -5
- package/dist/image-dimensions.js +39 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/kept-image.d.ts +20 -0
- package/dist/kept-image.js +47 -0
- package/dist/markdown.js +2 -4
- package/dist/mode-icons.d.ts +3 -0
- package/dist/mode-icons.js +7 -2
- package/dist/strings.d.ts +18 -1
- package/dist/strings.js +10 -1
- package/dist/theme.d.ts +8 -1
- package/package.json +2 -2
- package/structure.css +46 -8
- package/theme-default.css +48 -7
package/structure.css
CHANGED
|
@@ -459,8 +459,10 @@
|
|
|
459
459
|
max-width: 100%;
|
|
460
460
|
vertical-align: middle;
|
|
461
461
|
}
|
|
462
|
-
/* An image in edit mode carries its
|
|
463
|
-
handle at its bottom right corner
|
|
462
|
+
/* An image in edit mode carries its controls under it, never over the picture,
|
|
463
|
+
whose top left is often its subject, and a handle at its bottom right corner
|
|
464
|
+
that drags it (#98, #106). The controls hang from the image's bottom edge with
|
|
465
|
+
no gap, so the pointer travels from the picture to them without leaving it. */
|
|
464
466
|
.markdown .edit-image {
|
|
465
467
|
position: relative;
|
|
466
468
|
display: inline-block;
|
|
@@ -468,19 +470,55 @@
|
|
|
468
470
|
vertical-align: middle;
|
|
469
471
|
}
|
|
470
472
|
.markdown .edit-image-controls {
|
|
473
|
+
position: absolute;
|
|
474
|
+
top: var(--edit-image-bottom, 100%);
|
|
475
|
+
left: 0;
|
|
476
|
+
z-index: 2;
|
|
477
|
+
display: flex;
|
|
478
|
+
flex-wrap: wrap;
|
|
479
|
+
align-items: center;
|
|
480
|
+
gap: 0.25rem;
|
|
481
|
+
width: max-content;
|
|
482
|
+
min-width: 100%;
|
|
483
|
+
max-width: min(26rem, calc(100vw - 2rem));
|
|
484
|
+
box-sizing: border-box;
|
|
485
|
+
}
|
|
486
|
+
.markdown .edit-image-size {
|
|
487
|
+
display: inline-flex;
|
|
471
488
|
align-items: center;
|
|
489
|
+
gap: 0.15rem;
|
|
472
490
|
white-space: nowrap;
|
|
473
491
|
}
|
|
474
|
-
.markdown .edit-image-width
|
|
475
|
-
|
|
492
|
+
.markdown .edit-image-width,
|
|
493
|
+
.markdown .edit-image-height {
|
|
494
|
+
width: 4.2em;
|
|
476
495
|
}
|
|
496
|
+
.markdown .edit-image-description {
|
|
497
|
+
flex: 1 1 10rem;
|
|
498
|
+
min-width: 0;
|
|
499
|
+
}
|
|
500
|
+
.markdown .edit-image-refused {
|
|
501
|
+
flex-basis: 100%;
|
|
502
|
+
}
|
|
503
|
+
/* The handle is a touch target of at least 24px at the picture's corner, whose arrows say it resizes. */
|
|
477
504
|
.markdown .edit-image-handle {
|
|
478
505
|
position: absolute;
|
|
479
|
-
|
|
480
|
-
|
|
506
|
+
top: calc(var(--edit-image-bottom, 100%) - 24px);
|
|
507
|
+
left: calc(var(--edit-image-right, 100%) - 24px);
|
|
481
508
|
z-index: 1;
|
|
482
|
-
|
|
483
|
-
|
|
509
|
+
display: inline-flex;
|
|
510
|
+
align-items: center;
|
|
511
|
+
justify-content: center;
|
|
512
|
+
width: 24px;
|
|
513
|
+
height: 24px;
|
|
484
514
|
cursor: nwse-resize;
|
|
485
515
|
touch-action: none;
|
|
486
516
|
}
|
|
517
|
+
/* Where nothing hovers, the controls stand in the flow under the image, so
|
|
518
|
+
they never lie over the text that follows it. */
|
|
519
|
+
@media (hover: none) {
|
|
520
|
+
.markdown .edit-image-controls {
|
|
521
|
+
position: static;
|
|
522
|
+
min-width: 0;
|
|
523
|
+
}
|
|
524
|
+
}
|
package/theme-default.css
CHANGED
|
@@ -1950,38 +1950,79 @@
|
|
|
1950
1950
|
opacity: 1;
|
|
1951
1951
|
}
|
|
1952
1952
|
.markdown .edit-image-controls {
|
|
1953
|
+
opacity: 0;
|
|
1954
|
+
padding: 0.2rem;
|
|
1955
|
+
border: 1px solid var(--ms-border);
|
|
1956
|
+
border-radius: var(--ms-radius);
|
|
1957
|
+
background: var(--ms-surface);
|
|
1953
1958
|
font-size: 0.8rem;
|
|
1954
1959
|
line-height: 1.2;
|
|
1960
|
+
transition: opacity 0.12s;
|
|
1961
|
+
pointer-events: none;
|
|
1955
1962
|
}
|
|
1956
|
-
.markdown .edit-image
|
|
1963
|
+
.markdown .edit-image:hover .edit-image-controls,
|
|
1964
|
+
.markdown .edit-image:focus-within .edit-image-controls,
|
|
1965
|
+
.markdown .edit-image[data-ms-busy] .edit-image-controls,
|
|
1966
|
+
.markdown .edit-image[data-resizing] .edit-image-controls {
|
|
1967
|
+
opacity: 1;
|
|
1968
|
+
pointer-events: auto;
|
|
1969
|
+
}
|
|
1970
|
+
.markdown .edit-image-controls .edit-field {
|
|
1957
1971
|
height: 1.9rem;
|
|
1958
1972
|
border-color: var(--ms-border);
|
|
1959
1973
|
background: var(--ms-surface);
|
|
1960
1974
|
color: var(--ms-text);
|
|
1961
1975
|
font-size: 0.8rem;
|
|
1962
1976
|
}
|
|
1977
|
+
.markdown .edit-image-controls .edit-image-width,
|
|
1978
|
+
.markdown .edit-image-controls .edit-image-height {
|
|
1979
|
+
flex: none;
|
|
1980
|
+
width: 4.2em;
|
|
1981
|
+
}
|
|
1982
|
+
.markdown .edit-image-controls .edit-field[aria-invalid='true'] {
|
|
1983
|
+
border-color: rgb(var(--ms-callout-stop));
|
|
1984
|
+
outline: 1px solid rgb(var(--ms-callout-stop));
|
|
1985
|
+
}
|
|
1986
|
+
.markdown .edit-image-controls .edit-field:disabled {
|
|
1987
|
+
opacity: 0.5;
|
|
1988
|
+
}
|
|
1963
1989
|
.markdown .edit-image-unit {
|
|
1964
|
-
|
|
1990
|
+
height: 1.9rem;
|
|
1991
|
+
border: 1px solid var(--ms-border);
|
|
1992
|
+
border-radius: var(--ms-radius);
|
|
1993
|
+
background: var(--ms-surface);
|
|
1994
|
+
color: var(--ms-text-soft);
|
|
1995
|
+
font-size: 0.8rem;
|
|
1996
|
+
}
|
|
1997
|
+
.markdown .edit-image-unit-label {
|
|
1998
|
+
padding-inline: 0.1rem 0.2rem;
|
|
1965
1999
|
color: var(--ms-text-soft);
|
|
1966
2000
|
font-size: 0.8rem;
|
|
1967
2001
|
}
|
|
1968
|
-
|
|
2002
|
+
.markdown .edit-image-refused {
|
|
2003
|
+
color: rgb(var(--ms-callout-stop));
|
|
2004
|
+
font-size: 0.75rem;
|
|
2005
|
+
}
|
|
2006
|
+
/* The handle is the accent's diagonal arrows on the surface, shown with the controls. */
|
|
1969
2007
|
.markdown .edit-image-handle {
|
|
1970
2008
|
opacity: 0;
|
|
1971
|
-
border-
|
|
1972
|
-
|
|
1973
|
-
|
|
2009
|
+
border-top-left-radius: var(--ms-radius);
|
|
2010
|
+
background: var(--ms-surface);
|
|
2011
|
+
color: var(--ms-accent);
|
|
2012
|
+
font-size: 16px;
|
|
1974
2013
|
transition: opacity 0.12s;
|
|
1975
2014
|
}
|
|
1976
2015
|
.markdown .edit-image:hover .edit-image-handle,
|
|
2016
|
+
.markdown .edit-image[data-ms-busy] .edit-image-handle,
|
|
1977
2017
|
.markdown .edit-image[data-resizing] .edit-image-handle {
|
|
1978
2018
|
opacity: 1;
|
|
1979
2019
|
}
|
|
1980
2020
|
/* Where nothing hovers, as on a phone, an image's size is always at hand. */
|
|
1981
2021
|
@media (hover: none) {
|
|
1982
|
-
.markdown .edit-image .edit-
|
|
2022
|
+
.markdown .edit-image .edit-image-controls,
|
|
1983
2023
|
.markdown .edit-image .edit-image-handle {
|
|
1984
2024
|
opacity: 1;
|
|
2025
|
+
pointer-events: auto;
|
|
1985
2026
|
}
|
|
1986
2027
|
}
|
|
1987
2028
|
.markdown .edit-image[data-resizing] .cm-ms-image,
|