@meowdown/core 0.83.2 → 0.84.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
@@ -200,6 +200,20 @@
200
200
  }
201
201
  }
202
202
 
203
+ @keyframes meowdown-embed-fade {
204
+ from, to {
205
+ mask-image: linear-gradient(#000 calc(100% - 3rem), #0000);
206
+ mask-size: 100% calc(var(--_body-limit) - var(--_show-more-height) - 2 * var(--_clip-gutter));
207
+ mask-repeat: no-repeat;
208
+ }
209
+ }
210
+
211
+ @keyframes meowdown-embed-show {
212
+ from, to {
213
+ visibility: visible;
214
+ }
215
+ }
216
+
203
217
  [data-meowdown-embed="x"] [data-root], [data-meowdown-embed="x"] [data-root] *, [data-meowdown-embed="x"] [data-root] :before, [data-meowdown-embed="x"] [data-root] :after {
204
218
  all: revert;
205
219
  box-sizing: border-box;
@@ -391,6 +405,7 @@
391
405
  max-height: calc(var(--_body-limit) - var(--_overflowing) * var(--_show-more-height));
392
406
  padding: var(--_clip-gutter);
393
407
  margin: calc(-1 * var(--_clip-gutter));
408
+ scroll-timeline: --meowdown-embed-clip block;
394
409
  margin-block-end: calc(var(--_overflowing) * var(--_show-more-height) - var(--_clip-gutter));
395
410
  animation: linear both meowdown-embed-overflowing scroll(self);
396
411
  overflow: hidden;
@@ -402,23 +417,21 @@
402
417
  overflow: visible;
403
418
  }
404
419
 
405
- @container style(--_overflowing: 1) {
406
- & > article > [data-content] {
407
- mask-image: linear-gradient(#000 calc(100% - 3rem), #0000);
408
- mask-size: 100%
409
- calc(var(--_body-limit) - var(--_show-more-height) - 2 * var(--_clip-gutter));
410
- mask-repeat: no-repeat;
411
- }
420
+ & > article > [data-content] {
421
+ animation: linear both meowdown-embed-fade --meowdown-embed-clip;
422
+ }
412
423
 
413
- & > article > [data-show-more] {
414
- inset-inline-start: var(--meowdown-embed-padding, 1rem);
415
- bottom: var(--meowdown-embed-padding, 1rem);
416
- display: block;
417
- position: absolute;
418
- }
424
+ & > article > [data-show-more] {
425
+ inset-inline-start: var(--meowdown-embed-padding, 1rem);
426
+ bottom: var(--meowdown-embed-padding, 1rem);
427
+ visibility: hidden;
428
+ animation: linear both meowdown-embed-show --meowdown-embed-clip;
429
+ display: block;
430
+ position: absolute;
419
431
  }
420
432
 
421
433
  & > article > [data-show-more][open] {
434
+ visibility: visible;
422
435
  z-index: 1;
423
436
  width: fit-content;
424
437
  margin: .5rem auto 0;
@@ -716,7 +729,7 @@
716
729
  --_hairline: var(--meowdown-embed-border-color, color-mix(in srgb, currentColor 15%, transparent));
717
730
  --_muted: var(--meowdown-embed-muted-color, color-mix(in srgb, currentColor 58%, transparent));
718
731
  --_link: var(--meowdown-embed-link-color, #1d9bf0);
719
- --_radius: var(--meowdown-embed-radius, 1rem);
732
+ --_radius: var(--meowdown-embed-radius, .75rem);
720
733
  --_page: var(--meowdown-embed-background, Canvas);
721
734
  --_play: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 68 48'%3E%3Cpath d='M66.52 7.74c-.78-2.93-2.49-5.41-5.42-6.19C55.79.13 34 0 34 0S12.21.13 6.9 1.55C3.97 2.33 2.27 4.81 1.48 7.74.06 13.05 0 24 0 24s.06 10.95 1.48 16.26c.78 2.93 2.49 5.41 5.42 6.19C12.21 47.87 34 48 34 48s21.79-.13 27.1-1.55c2.93-.78 4.64-3.26 5.42-6.19C67.94 34.95 68 24 68 24S67.94 13.05 66.52 7.74z' fill='%23f00'/%3E%3Cpath d='M45 24 27 14v20z' fill='%23fff'/%3E%3C/svg%3E");
722
735
  font: inherit;
@@ -959,6 +972,160 @@
959
972
  }
960
973
  }
961
974
 
975
+ .meowdown-icon {
976
+ width: 1em;
977
+ height: 1em;
978
+ -webkit-mask: var(--_svg) no-repeat center / 100% 100%;
979
+ mask: var(--_svg) no-repeat center / 100% 100%;
980
+ background-color: currentColor;
981
+ flex-shrink: 0;
982
+ display: block;
983
+ }
984
+
985
+ .meowdown-icon-braces {
986
+ --_svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2a2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1m8 0h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1'/%3E%3C/svg%3E");
987
+ }
988
+
989
+ .meowdown-icon-check {
990
+ --_svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
991
+ }
992
+
993
+ .meowdown-icon-chevrons-up-down {
994
+ --_svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m7 15l5 5l5-5M7 9l5-5l5 5'/%3E%3C/svg%3E");
995
+ }
996
+
997
+ .meowdown-icon-copy {
998
+ --_svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cg fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'%3E%3Crect width='14' height='14' x='8' y='8' rx='2' ry='2'/%3E%3Cpath d='M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2'/%3E%3C/g%3E%3C/svg%3E");
999
+ }
1000
+
1001
+ .meowdown-icon-earth {
1002
+ --_svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cg fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'%3E%3Cpath d='M21.54 15H17a2 2 0 0 0-2 2v4.54M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05'/%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3C/g%3E%3C/svg%3E");
1003
+ }
1004
+
1005
+ .meowdown-icon-ellipsis {
1006
+ --_svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cg fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='1'/%3E%3Ccircle cx='19' cy='12' r='1'/%3E%3Ccircle cx='5' cy='12' r='1'/%3E%3C/g%3E%3C/svg%3E");
1007
+ }
1008
+
1009
+ .meowdown-icon-grip-horizontal {
1010
+ --_svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cg fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'%3E%3Ccircle cx='12' cy='9' r='1'/%3E%3Ccircle cx='19' cy='9' r='1'/%3E%3Ccircle cx='5' cy='9' r='1'/%3E%3Ccircle cx='12' cy='15' r='1'/%3E%3Ccircle cx='19' cy='15' r='1'/%3E%3Ccircle cx='5' cy='15' r='1'/%3E%3C/g%3E%3C/svg%3E");
1011
+ }
1012
+
1013
+ .meowdown-icon-grip-vertical {
1014
+ --_svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cg fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'%3E%3Ccircle cx='9' cy='12' r='1'/%3E%3Ccircle cx='9' cy='5' r='1'/%3E%3Ccircle cx='9' cy='19' r='1'/%3E%3Ccircle cx='15' cy='12' r='1'/%3E%3Ccircle cx='15' cy='5' r='1'/%3E%3Ccircle cx='15' cy='19' r='1'/%3E%3C/g%3E%3C/svg%3E");
1015
+ }
1016
+
1017
+ .meowdown-icon-link-2 {
1018
+ --_svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M9 17H7A5 5 0 0 1 7 7h2m6 0h2a5 5 0 1 1 0 10h-2m-7-5h8'/%3E%3C/svg%3E");
1019
+ }
1020
+
1021
+ .meowdown-icon-pencil {
1022
+ --_svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497zM15 5l4 4'/%3E%3C/svg%3E");
1023
+ }
1024
+
1025
+ .meowdown-icon-sparkles {
1026
+ --_svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cg fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'%3E%3Cpath d='M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594zM20 2v4m2-2h-4'/%3E%3Ccircle cx='4' cy='20' r='2'/%3E%3C/g%3E%3C/svg%3E");
1027
+ }
1028
+
1029
+ .meowdown-icon-trash-2 {
1030
+ --_svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M10 11v6m4-6v6m5-11v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2'/%3E%3C/svg%3E");
1031
+ }
1032
+
1033
+ .meowdown-icon-unlink {
1034
+ --_svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m18.84 12.25l1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07a5.006 5.006 0 0 0-6.95 0l-1.72 1.71m-6.58 6.57l-1.71 1.71a5.004 5.004 0 0 0 .12 7.07a5.006 5.006 0 0 0 6.95 0l1.71-1.71M8 2v3M2 8h3m11 11v3m3-6h3'/%3E%3C/svg%3E");
1035
+ }
1036
+
1037
+ .meowdown-icon-button {
1038
+ box-sizing: border-box;
1039
+ border: 1px solid var(--meowdown-border);
1040
+ background: var(--meowdown-popover-bg);
1041
+ width: 1.6rem;
1042
+ height: 1.6rem;
1043
+ color: var(--meowdown-muted);
1044
+ cursor: pointer;
1045
+ border-radius: .35rem;
1046
+ justify-content: center;
1047
+ align-items: center;
1048
+ margin: 0;
1049
+ padding: 0;
1050
+ display: flex;
1051
+
1052
+ &:hover, &[data-popup-open], &[aria-expanded="true"] {
1053
+ color: var(--meowdown-heading);
1054
+ }
1055
+
1056
+ &[data-copied] {
1057
+ color: var(--meowdown-accent);
1058
+ }
1059
+
1060
+ & .meowdown-icon {
1061
+ width: .875rem;
1062
+ height: .875rem;
1063
+ }
1064
+ }
1065
+
1066
+ .meowdown-menu-positioner {
1067
+ z-index: 50;
1068
+ outline: none;
1069
+ }
1070
+
1071
+ .meowdown-menu-popup {
1072
+ box-sizing: border-box;
1073
+ border: 1px solid var(--meowdown-border);
1074
+ background: var(--meowdown-popover-bg);
1075
+ min-width: 10rem;
1076
+ color: var(--meowdown-text);
1077
+ transform-origin: var(--transform-origin);
1078
+ border-radius: .5rem;
1079
+ outline: none;
1080
+ flex-direction: column;
1081
+ padding: .25rem;
1082
+ font-family: ui-sans-serif, system-ui, sans-serif;
1083
+ font-size: .8rem;
1084
+ transition: opacity .1s, scale .1s;
1085
+ display: flex;
1086
+ box-shadow: 0 4px 6px -1px #0000001a, 0 2px 4px -2px #0000001a;
1087
+
1088
+ @media (prefers-reduced-motion: reduce) {
1089
+ transition: none;
1090
+ }
1091
+
1092
+ &[data-starting-style], &[data-ending-style] {
1093
+ opacity: 0;
1094
+ scale: .95;
1095
+ }
1096
+ }
1097
+
1098
+ .meowdown-menu-item {
1099
+ box-sizing: border-box;
1100
+ cursor: pointer;
1101
+ border-radius: .35rem;
1102
+ outline: none;
1103
+ align-items: center;
1104
+ gap: .5rem;
1105
+ padding: .3rem .5rem;
1106
+ display: flex;
1107
+
1108
+ &[data-highlighted] {
1109
+ background: color-mix(in oklab, var(--meowdown-accent) 14%, transparent);
1110
+ color: var(--meowdown-heading);
1111
+ }
1112
+
1113
+ & .meowdown-icon {
1114
+ width: .875rem;
1115
+ height: .875rem;
1116
+ color: var(--meowdown-muted);
1117
+ }
1118
+ }
1119
+
1120
+ .meowdown-menu-item-indicator {
1121
+ color: var(--meowdown-accent);
1122
+ display: flex;
1123
+
1124
+ & .meowdown-icon {
1125
+ color: inherit;
1126
+ }
1127
+ }
1128
+
962
1129
  .md-virtual-caret-layer {
963
1130
  z-index: 1;
964
1131
  pointer-events: none;
@@ -1655,12 +1822,32 @@
1655
1822
  overflow: visible;
1656
1823
  }
1657
1824
 
1825
+ & .md-image-view-preview {
1826
+ position: relative;
1827
+ }
1828
+
1829
+ & .md-embed-menu-button {
1830
+ z-index: 1;
1831
+ opacity: 0;
1832
+ pointer-events: none;
1833
+ transition: opacity .1s ease-out;
1834
+ display: flex;
1835
+ position: absolute;
1836
+ top: .5rem;
1837
+ right: .5rem;
1838
+ }
1839
+
1840
+ & .md-image-view-preview:hover .md-embed-menu-button, & .md-atom-view:has(.md-atom-selected) .md-embed-menu-button, & .md-embed-menu-button[aria-expanded="true"] {
1841
+ opacity: 1;
1842
+ pointer-events: auto;
1843
+ }
1844
+
1658
1845
  & .md-image-resizable {
1659
1846
  vertical-align: bottom;
1660
1847
  isolation: isolate;
1661
- min-width: 2.5rem;
1848
+ min-width: 2.6rem;
1662
1849
  max-width: 100%;
1663
- min-height: 2.5rem;
1850
+ min-height: 2.6rem;
1664
1851
  display: inline-block;
1665
1852
  position: relative;
1666
1853
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@meowdown/core",
3
3
  "type": "module",
4
- "version": "0.83.2",
4
+ "version": "0.84.0",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
@@ -13,6 +13,7 @@
13
13
  ],
14
14
  "exports": {
15
15
  ".": "./dist/index.js",
16
+ "./internal/class-names": "./dist/class-names.js",
16
17
  "./style.css": "./dist/style.css"
17
18
  },
18
19
  "files": [
@@ -25,7 +26,7 @@
25
26
  "@codemirror/language-data": "^6.5.2",
26
27
  "@floating-ui/dom": "^1.8.0",
27
28
  "@lezer/highlight": "^1.2.5",
28
- "@meowdown/embed": "0.3.1",
29
+ "@meowdown/embed": "0.3.3",
29
30
  "@meowdown/markdown": "0.78.0",
30
31
  "@ocavue/utils": "^1.11.0",
31
32
  "@post-embed/exporter": "^0.5.0",