@mikedown/core 0.1.0 → 0.2.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 +12 -0
- package/README.md +63 -2
- package/dist/index.d.ts +67 -2
- package/dist/index.js +410 -39
- package/dist/index.js.map +1 -1
- package/dist/styles.css +96 -5
- package/package.json +7 -2
package/dist/styles.css
CHANGED
|
@@ -378,6 +378,19 @@
|
|
|
378
378
|
overflow: visible;
|
|
379
379
|
}
|
|
380
380
|
|
|
381
|
+
/* Buttons that don't fit move into the More (⋯) menu, from the right
|
|
382
|
+
(layoutToolbarOverflow in toolbar-overflow.ts), so the toolbar stays one
|
|
383
|
+
row at phone widths. More sits at the right edge while it is shown. */
|
|
384
|
+
:is(.mikedown-root, .mikedown-portal) .mikedown-toolbar .toolbar-overflowed {
|
|
385
|
+
display: none !important;
|
|
386
|
+
}
|
|
387
|
+
:is(.mikedown-root, .mikedown-portal) .mikedown-toolbar button.toolbar-more {
|
|
388
|
+
margin-left: auto;
|
|
389
|
+
}
|
|
390
|
+
:is(.mikedown-root, .mikedown-portal) .mikedown-toolbar button.toolbar-more[hidden] {
|
|
391
|
+
display: none;
|
|
392
|
+
}
|
|
393
|
+
|
|
381
394
|
:is(.mikedown-root, .mikedown-portal) .condensed-dropdown-trigger {
|
|
382
395
|
display: inline-flex !important;
|
|
383
396
|
align-items: center;
|
|
@@ -708,6 +721,12 @@
|
|
|
708
721
|
padding-left: 1.5em;
|
|
709
722
|
margin: 0.5em 0;
|
|
710
723
|
}
|
|
724
|
+
/* Markers are set explicitly so a page reset (Tailwind preflight's
|
|
725
|
+
`ul, ol { list-style: none }`) cannot strip them. Task lists override this. */
|
|
726
|
+
:is(.mikedown-root, .mikedown-portal) .ProseMirror ul { list-style-type: disc; }
|
|
727
|
+
:is(.mikedown-root, .mikedown-portal) .ProseMirror ul ul { list-style-type: circle; }
|
|
728
|
+
:is(.mikedown-root, .mikedown-portal) .ProseMirror ul ul ul { list-style-type: square; }
|
|
729
|
+
:is(.mikedown-root, .mikedown-portal) .ProseMirror ol { list-style-type: decimal; }
|
|
711
730
|
:is(.mikedown-root, .mikedown-portal) .ProseMirror li {
|
|
712
731
|
margin: 0.15em 0;
|
|
713
732
|
}
|
|
@@ -918,19 +937,83 @@
|
|
|
918
937
|
margin-top: 0.2em;
|
|
919
938
|
}
|
|
920
939
|
|
|
940
|
+
/* The checkbox is drawn by hand so its click target can be 24 by 24px (WCAG
|
|
941
|
+
2.5.8) while the box still looks 14px: the input is 24px square, a -5px
|
|
942
|
+
margin keeps the old 14px footprint in the line, and ::before draws the box
|
|
943
|
+
inside it (::after the tick). */
|
|
921
944
|
:is(.mikedown-root, .mikedown-portal) .ProseMirror ul[data-type="taskList"] li > label input[type="checkbox"] {
|
|
945
|
+
appearance: none;
|
|
946
|
+
-webkit-appearance: none;
|
|
947
|
+
position: relative;
|
|
948
|
+
display: block;
|
|
949
|
+
width: 24px;
|
|
950
|
+
height: 24px;
|
|
951
|
+
margin: -5px;
|
|
952
|
+
border: 0;
|
|
953
|
+
background: transparent;
|
|
922
954
|
cursor: pointer;
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
:is(.mikedown-root, .mikedown-portal) .ProseMirror ul[data-type="taskList"] li > label input[type="checkbox"]::before {
|
|
958
|
+
content: '';
|
|
959
|
+
position: absolute;
|
|
960
|
+
inset: 5px;
|
|
961
|
+
border: 1.5px solid var(--mikedown-text-muted, #6f6f74);
|
|
962
|
+
border-radius: 3px;
|
|
963
|
+
background: var(--mikedown-input-bg, transparent);
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
:is(.mikedown-root, .mikedown-portal) .ProseMirror ul[data-type="taskList"] li > label input[type="checkbox"]:checked::before {
|
|
967
|
+
border-color: var(--mikedown-link, #3794ff);
|
|
968
|
+
background: var(--mikedown-link, #3794ff);
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
:is(.mikedown-root, .mikedown-portal) .ProseMirror ul[data-type="taskList"] li > label input[type="checkbox"]:checked::after {
|
|
972
|
+
content: '';
|
|
973
|
+
position: absolute;
|
|
974
|
+
left: 10px;
|
|
975
|
+
top: 7px;
|
|
976
|
+
width: 4px;
|
|
977
|
+
height: 8px;
|
|
978
|
+
border: solid var(--mikedown-surface, #ffffff);
|
|
979
|
+
border-width: 0 2px 2px 0;
|
|
980
|
+
transform: rotate(45deg);
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
:is(.mikedown-root, .mikedown-portal) .ProseMirror ul[data-type="taskList"] li > label input[type="checkbox"]:focus-visible {
|
|
984
|
+
outline: none;
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
:is(.mikedown-root, .mikedown-portal) .ProseMirror ul[data-type="taskList"] li > label input[type="checkbox"]:focus-visible::before {
|
|
988
|
+
outline: 2px solid var(--mikedown-focus-ring, #3794ff);
|
|
989
|
+
outline-offset: 1px;
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
/* Forced colors repaint the hand-drawn box, which would hide the checked
|
|
993
|
+
state; use the native control there. */
|
|
994
|
+
@media (forced-colors: active) {
|
|
995
|
+
:is(.mikedown-root, .mikedown-portal) .ProseMirror ul[data-type="taskList"] li > label input[type="checkbox"] {
|
|
996
|
+
appearance: auto;
|
|
997
|
+
-webkit-appearance: checkbox;
|
|
998
|
+
width: 14px;
|
|
999
|
+
height: 14px;
|
|
1000
|
+
margin: 0;
|
|
1001
|
+
}
|
|
1002
|
+
:is(.mikedown-root, .mikedown-portal) .ProseMirror ul[data-type="taskList"] li > label input[type="checkbox"]::before,
|
|
1003
|
+
:is(.mikedown-root, .mikedown-portal) .ProseMirror ul[data-type="taskList"] li > label input[type="checkbox"]::after {
|
|
1004
|
+
content: none;
|
|
1005
|
+
}
|
|
926
1006
|
}
|
|
927
1007
|
|
|
928
1008
|
:is(.mikedown-root, .mikedown-portal) .ProseMirror ul[data-type="taskList"] li > div {
|
|
929
1009
|
flex: 1;
|
|
930
1010
|
}
|
|
931
1011
|
|
|
1012
|
+
/* Done items: muted text plus a strikethrough. A muted color rather than
|
|
1013
|
+
opacity, so the text keeps at least 4.5:1 contrast (opacity 0.6 left it at
|
|
1014
|
+
about 3.9:1 on white). */
|
|
932
1015
|
:is(.mikedown-root, .mikedown-portal) .ProseMirror ul[data-type="taskList"] li[data-checked="true"] > div {
|
|
933
|
-
|
|
1016
|
+
color: var(--mikedown-text-muted, #6f6f74);
|
|
934
1017
|
text-decoration: line-through;
|
|
935
1018
|
}
|
|
936
1019
|
|
|
@@ -2168,7 +2251,9 @@
|
|
|
2168
2251
|
z-index: 999;
|
|
2169
2252
|
display: inline-flex;
|
|
2170
2253
|
flex-direction: row;
|
|
2171
|
-
|
|
2254
|
+
/* Wraps to a second row on a phone instead of running off the screen. */
|
|
2255
|
+
flex-wrap: wrap;
|
|
2256
|
+
max-width: calc(100vw - 8px);
|
|
2172
2257
|
align-items: center;
|
|
2173
2258
|
gap: 2px;
|
|
2174
2259
|
background: var(--mikedown-surface-raised, var(--mikedown-surface));
|
|
@@ -2600,6 +2685,12 @@ body.td-dragging :is(.mikedown-root, .mikedown-portal) * {
|
|
|
2600
2685
|
outline-offset: -2px;
|
|
2601
2686
|
}
|
|
2602
2687
|
|
|
2688
|
+
/* Disabled item (e.g. an overflowed Zoom In at the maximum size). */
|
|
2689
|
+
:is(.mikedown-root, .mikedown-portal) .tdd-item.tdd-disabled {
|
|
2690
|
+
opacity: 0.4;
|
|
2691
|
+
cursor: default;
|
|
2692
|
+
}
|
|
2693
|
+
|
|
2603
2694
|
:is(.mikedown-root, .mikedown-portal) .tdd-item-icon {
|
|
2604
2695
|
display: inline-flex;
|
|
2605
2696
|
align-items: center;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikedown/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "MikeDown WYSIWYG markdown editor core (TipTap + CodeMirror), framework-agnostic.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -19,6 +19,11 @@
|
|
|
19
19
|
"import": "./dist/index.js",
|
|
20
20
|
"default": "./dist/index.js"
|
|
21
21
|
},
|
|
22
|
+
"./binding": {
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"import": "./dist/index.js",
|
|
25
|
+
"default": "./dist/index.js"
|
|
26
|
+
},
|
|
22
27
|
"./styles.css": "./dist/styles.css",
|
|
23
28
|
"./tokens.css": "./dist/tokens.css",
|
|
24
29
|
"./shared/*": {
|
|
@@ -111,7 +116,7 @@
|
|
|
111
116
|
},
|
|
112
117
|
"repository": {
|
|
113
118
|
"type": "git",
|
|
114
|
-
"url": "https://github.com/mikejoseph23/mikedown.git",
|
|
119
|
+
"url": "git+https://github.com/mikejoseph23/mikedown.git",
|
|
115
120
|
"directory": "packages/core"
|
|
116
121
|
}
|
|
117
122
|
}
|