@meowdown/core 0.82.0 → 0.83.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/dist/style.css CHANGED
@@ -856,6 +856,14 @@
856
856
  }
857
857
  }
858
858
  }
859
+
860
+ :where(.ProseMirror) {
861
+ tab-size: 4;
862
+ }
863
+
864
+ :where(.ProseMirror) :where(p, h1, h2, h3, h4, h5, h6, blockquote, pre, ul, ol, figure, hr) {
865
+ margin: 0;
866
+ }
859
867
  }
860
868
 
861
869
  @layer meowdown.theme {
@@ -917,6 +925,18 @@
917
925
  --meowdown-bullet-halo-radius: 5.5px;
918
926
  --meowdown-bullet-collapsed: var(--meowdown-accent);
919
927
  --meowdown-gutter: 3.5rem;
928
+ --meowdown-block-padding: .3em;
929
+ --meowdown-h1-size: 1.75rem;
930
+ --meowdown-h2-size: 1.4rem;
931
+ --meowdown-h3-size: 1.2rem;
932
+ --meowdown-h4-size: 1.1rem;
933
+ --meowdown-h5-size: 1rem;
934
+ --meowdown-h6-size: .95rem;
935
+ --meowdown-heading-line-height: 1.25;
936
+ --meowdown-code-block-font-size: .9rem;
937
+ --meowdown-code-block-line-height: 1.5;
938
+ --meowdown-code-block-padding-block: .9rem;
939
+ --meowdown-code-block-margin-block: .3rem;
920
940
  }
921
941
  }
922
942
 
@@ -1024,44 +1044,47 @@
1024
1044
  padding-left: var(--meowdown-gutter);
1025
1045
  }
1026
1046
 
1027
- .ProseMirror > * + * {
1028
- margin-top: .85em;
1029
- }
1030
-
1031
1047
  .ProseMirror p {
1048
+ padding-block: var(--meowdown-block-padding);
1032
1049
  white-space: pre-wrap;
1033
1050
  }
1034
1051
 
1035
1052
  .ProseMirror h1, .ProseMirror h2, .ProseMirror h3, .ProseMirror h4, .ProseMirror h5, .ProseMirror h6 {
1053
+ font-weight: 600;
1054
+ line-height: var(--meowdown-heading-line-height);
1036
1055
  letter-spacing: -.01em;
1037
1056
  color: var(--meowdown-heading);
1038
1057
  white-space: pre-wrap;
1039
- font-weight: 600;
1040
- line-height: 1.25;
1058
+ padding-top: .8em;
1059
+ padding-bottom: .2em;
1060
+
1061
+ &:first-child {
1062
+ padding-top: 0;
1063
+ }
1041
1064
  }
1042
1065
 
1043
1066
  .ProseMirror h1 {
1044
- font-size: 1.75rem;
1067
+ font-size: var(--meowdown-h1-size);
1045
1068
  }
1046
1069
 
1047
1070
  .ProseMirror h2 {
1048
- font-size: 1.4rem;
1071
+ font-size: var(--meowdown-h2-size);
1049
1072
  }
1050
1073
 
1051
1074
  .ProseMirror h3 {
1052
- font-size: 1.2rem;
1075
+ font-size: var(--meowdown-h3-size);
1053
1076
  }
1054
1077
 
1055
1078
  .ProseMirror h4 {
1056
- font-size: 1.1rem;
1079
+ font-size: var(--meowdown-h4-size);
1057
1080
  }
1058
1081
 
1059
1082
  .ProseMirror h5 {
1060
- font-size: 1rem;
1083
+ font-size: var(--meowdown-h5-size);
1061
1084
  }
1062
1085
 
1063
1086
  .ProseMirror h6 {
1064
- font-size: .95rem;
1087
+ font-size: var(--meowdown-h6-size);
1065
1088
  }
1066
1089
 
1067
1090
  .ProseMirror .md-link {
@@ -1119,11 +1142,60 @@
1119
1142
  margin-top: .25em;
1120
1143
  }
1121
1144
 
1145
+ .ProseMirror .prosemirror-flat-list {
1146
+ flex-direction: column;
1147
+ display: flex;
1148
+ }
1149
+
1122
1150
  .ProseMirror .prosemirror-flat-list > .list-marker {
1123
1151
  -webkit-user-select: none;
1124
1152
  user-select: none;
1125
1153
  }
1126
1154
 
1155
+ .ProseMirror .prosemirror-flat-list {
1156
+ --meowdown-list-first-line-top: var(--meowdown-block-padding);
1157
+ --meowdown-list-first-line-height: 1lh;
1158
+
1159
+ &:has( > .list-content > [data-code-block]:first-child) {
1160
+ --meowdown-list-first-line-top: calc(var(--meowdown-code-block-margin-block) + var(--meowdown-code-block-padding-block));
1161
+ --meowdown-list-first-line-height: calc(var(--meowdown-code-block-line-height) * var(--meowdown-code-block-font-size));
1162
+ }
1163
+
1164
+ &:has( > .list-content > h1:first-child) {
1165
+ --meowdown-list-first-line-top: 0px;
1166
+ --meowdown-list-first-line-height: calc(var(--meowdown-heading-line-height) * var(--meowdown-h1-size));
1167
+ }
1168
+
1169
+ &:has( > .list-content > h2:first-child) {
1170
+ --meowdown-list-first-line-top: 0px;
1171
+ --meowdown-list-first-line-height: calc(var(--meowdown-heading-line-height) * var(--meowdown-h2-size));
1172
+ }
1173
+
1174
+ &:has( > .list-content > h3:first-child) {
1175
+ --meowdown-list-first-line-top: 0px;
1176
+ --meowdown-list-first-line-height: calc(var(--meowdown-heading-line-height) * var(--meowdown-h3-size));
1177
+ }
1178
+
1179
+ &:has( > .list-content > h4:first-child) {
1180
+ --meowdown-list-first-line-top: 0px;
1181
+ --meowdown-list-first-line-height: calc(var(--meowdown-heading-line-height) * var(--meowdown-h4-size));
1182
+ }
1183
+
1184
+ &:has( > .list-content > h5:first-child) {
1185
+ --meowdown-list-first-line-top: 0px;
1186
+ --meowdown-list-first-line-height: calc(var(--meowdown-heading-line-height) * var(--meowdown-h5-size));
1187
+ }
1188
+
1189
+ &:has( > .list-content > h6:first-child) {
1190
+ --meowdown-list-first-line-top: 0px;
1191
+ --meowdown-list-first-line-height: calc(var(--meowdown-heading-line-height) * var(--meowdown-h6-size));
1192
+ }
1193
+
1194
+ & > .list-marker, &:before {
1195
+ top: calc(var(--meowdown-list-first-line-top) + (var(--meowdown-list-first-line-height) - 1lh) / 2);
1196
+ }
1197
+ }
1198
+
1127
1199
  .ProseMirror .prosemirror-flat-list[data-list-kind="bullet"] > .list-marker {
1128
1200
  background: radial-gradient(circle at center,
1129
1201
  var(--meowdown-bullet) 0 var(--meowdown-bullet-radius),
@@ -1203,17 +1275,19 @@
1203
1275
  }
1204
1276
 
1205
1277
  .ProseMirror pre {
1278
+ margin-block: var(--meowdown-code-block-margin-block);
1279
+ padding: var(--meowdown-code-block-padding-block) 1rem;
1206
1280
  background: var(--meowdown-code-bg);
1207
1281
  font-family: var(--meowdown-font-mono);
1282
+ font-size: var(--meowdown-code-block-font-size);
1283
+ line-height: var(--meowdown-code-block-line-height);
1208
1284
  border-radius: .6rem;
1209
- padding: .9rem 1rem;
1210
- font-size: .9em;
1211
- line-height: 1.5;
1212
1285
  overflow-x: auto;
1213
1286
  }
1214
1287
 
1215
1288
  .ProseMirror pre code {
1216
1289
  color: inherit;
1290
+ font-size: inherit;
1217
1291
  background: none;
1218
1292
  padding: 0;
1219
1293
  }
@@ -1280,6 +1354,7 @@
1280
1354
  }
1281
1355
 
1282
1356
  .ProseMirror table {
1357
+ margin-block: var(--meowdown-block-padding);
1283
1358
  border-collapse: collapse;
1284
1359
  width: 100%;
1285
1360
  overflow: hidden;
@@ -1311,22 +1386,45 @@
1311
1386
  text-align: right;
1312
1387
  }
1313
1388
 
1314
- .ProseMirror table.ProseMirror-selectednode td, .ProseMirror table.ProseMirror-selectednode th {
1315
- border-color: var(--meowdown-node-outline);
1389
+ .ProseMirror table.ProseMirror-selectednode {
1390
+ outline-offset: -1px;
1391
+ background: none;
1392
+ }
1393
+
1394
+ .ProseMirror table.ProseMirror-selectednode :is(td, th), .ProseMirror .selectedCell {
1395
+ background-image: linear-gradient(var(--meowdown-node-selection),
1396
+ var(--meowdown-node-selection));
1316
1397
  }
1317
1398
 
1318
1399
  .ProseMirror .selectedCell {
1319
- border: 1px double var(--meowdown-node-outline);
1320
- background: var(--meowdown-node-selection);
1321
1400
  caret-color: #0000;
1322
1401
  }
1323
1402
 
1403
+ .ProseMirror tr > .selectedCell:first-child, .ProseMirror :not(.selectedCell) + .selectedCell {
1404
+ border-inline-start: 1px double var(--meowdown-node-outline);
1405
+ }
1406
+
1407
+ .ProseMirror tr > .selectedCell:last-child, .ProseMirror .selectedCell:has( + :not(.selectedCell)) {
1408
+ border-inline-end: 1px double var(--meowdown-node-outline);
1409
+ }
1410
+
1411
+ .ProseMirror :is(tr:first-child, tr:not(:has(.selectedCell)) + tr) > .selectedCell {
1412
+ border-top: 1px double var(--meowdown-node-outline);
1413
+ }
1414
+
1415
+ .ProseMirror tr:not(:has( + tr > .selectedCell)) > .selectedCell {
1416
+ border-bottom: 1px double var(--meowdown-node-outline);
1417
+ }
1418
+
1324
1419
  .ProseMirror ::selection, .ProseMirror .prosekit-virtual-selection {
1325
1420
  background: var(--meowdown-selection);
1326
1421
  }
1327
1422
 
1328
- .ProseMirror.ProseMirror-hideselection ::selection {
1423
+ .ProseMirror.ProseMirror-hideselection {
1329
1424
  caret-color: #0000;
1425
+ }
1426
+
1427
+ .ProseMirror.ProseMirror-hideselection ::selection {
1330
1428
  background: none;
1331
1429
  }
1332
1430
 
@@ -1340,10 +1438,14 @@
1340
1438
  border-radius: .6rem;
1341
1439
  }
1342
1440
 
1343
- .ProseMirror.prosekit-dragging .ProseMirror-selectednode, .ProseMirror.prosekit-dragging .selectedCell {
1441
+ .ProseMirror.prosekit-dragging .ProseMirror-selectednode {
1344
1442
  background: none;
1345
1443
  }
1346
1444
 
1445
+ .ProseMirror.prosekit-dragging :is(table.ProseMirror-selectednode :is(td, th), .selectedCell) {
1446
+ background-image: none;
1447
+ }
1448
+
1347
1449
  .ProseMirror .md-tag {
1348
1450
  background: color-mix(in oklab, var(--meowdown-accent) 10%, transparent);
1349
1451
  color: color-mix(in oklab, var(--meowdown-accent) 80%, var(--meowdown-heading));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@meowdown/core",
3
3
  "type": "module",
4
- "version": "0.82.0",
4
+ "version": "0.83.0",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
@@ -26,20 +26,20 @@
26
26
  "@floating-ui/dom": "^1.8.0",
27
27
  "@lezer/highlight": "^1.2.5",
28
28
  "@meowdown/embed": "0.3.1",
29
- "@meowdown/markdown": "0.77.0",
29
+ "@meowdown/markdown": "0.78.0",
30
30
  "@ocavue/utils": "^1.9.0",
31
31
  "@post-embed/exporter": "^0.5.0",
32
32
  "@post-embed/schema": "^0.5.2",
33
33
  "@post-embed/types": "^0.5.0",
34
- "@prosekit/core": "^0.13.3",
35
- "@prosekit/extensions": "^0.18.4",
36
- "@prosekit/pm": "^0.1.20",
37
- "@prosekit/web": "^0.9.4",
34
+ "@prosekit/core": "^0.13.4",
35
+ "@prosekit/extensions": "^0.18.5",
36
+ "@prosekit/pm": "^0.1.21",
37
+ "@prosekit/web": "^0.10.0",
38
38
  "hast-util-from-dom": "^5.0.1",
39
39
  "hast-util-to-mdast": "^10.1.2",
40
- "katex": "^0.19.0",
40
+ "katex": "^0.19.1",
41
41
  "lru.min": "^1.1.5",
42
- "mdast-util-to-markdown": "^2.2.0",
42
+ "mdast-util-to-markdown": "^2.2.1",
43
43
  "micromark-util-decode-string": "^2.0.1",
44
44
  "micromark-util-normalize-identifier": "^2.0.1",
45
45
  "prosemirror-enter-rules": "^0.1.6",
@@ -55,13 +55,13 @@
55
55
  "devDependencies": {
56
56
  "@meowdown/vitest": "0.0.0",
57
57
  "@ocavue/tsconfig": "^0.7.1",
58
- "@tsdown/css": "^0.23.1",
58
+ "@tsdown/css": "^0.23.3",
59
59
  "@types/hast": "^3.0.5",
60
60
  "@types/mdast": "^4.0.4",
61
61
  "@vitest/browser-playwright": "^5.0.5",
62
62
  "dedent": "^1.7.2",
63
- "diffable-html-snapshot": "^0.3.0",
64
- "tsdown": "^0.23.1",
63
+ "diffable-html-snapshot": "^0.4.0",
64
+ "tsdown": "^0.23.3",
65
65
  "vitest": "^5.0.5"
66
66
  },
67
67
  "publishConfig": {