@meowdown/react 0.26.0 → 0.27.1
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/index.js +17 -13
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1328,18 +1328,22 @@ function outputSpecToReact(spec, content, key = 0) {
|
|
|
1328
1328
|
function WikilinkChip(props) {
|
|
1329
1329
|
const { target, display, onWikilinkClick, children } = props;
|
|
1330
1330
|
return /* @__PURE__ */ jsxs("span", {
|
|
1331
|
-
className: "md-wikilink-view",
|
|
1331
|
+
className: "md-wikilink-view md-atom-view",
|
|
1332
1332
|
children: [/* @__PURE__ */ jsx("span", {
|
|
1333
|
-
className: "md-wikilink-
|
|
1333
|
+
className: "md-wikilink-view-preview md-atom-view-preview",
|
|
1334
1334
|
"data-testid": "wikilink",
|
|
1335
1335
|
contentEditable: false,
|
|
1336
1336
|
onClick: onWikilinkClick ? (event) => onWikilinkClick({
|
|
1337
1337
|
target,
|
|
1338
1338
|
event: event.nativeEvent
|
|
1339
1339
|
}) : void 0,
|
|
1340
|
-
children:
|
|
1340
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
1341
|
+
className: "md-wikilink-view-label",
|
|
1342
|
+
contentEditable: false,
|
|
1343
|
+
children: display || target
|
|
1344
|
+
})
|
|
1341
1345
|
}), /* @__PURE__ */ jsx("span", {
|
|
1342
|
-
className: "md-wikilink-view-content",
|
|
1346
|
+
className: "md-wikilink-view-content md-atom-view-content",
|
|
1343
1347
|
children
|
|
1344
1348
|
})]
|
|
1345
1349
|
});
|
|
@@ -1353,7 +1357,7 @@ function EmbedFrame({ embed }) {
|
|
|
1353
1357
|
return listenForTweetHeight(iframe);
|
|
1354
1358
|
}, [embed.kind, embed.key]);
|
|
1355
1359
|
return /* @__PURE__ */ jsx("span", {
|
|
1356
|
-
className: "md-image-preview md-
|
|
1360
|
+
className: "md-image-view-preview md-atom-view-preview",
|
|
1357
1361
|
contentEditable: false,
|
|
1358
1362
|
children: /* @__PURE__ */ jsx("iframe", {
|
|
1359
1363
|
ref: iframeRef,
|
|
@@ -1376,7 +1380,7 @@ function ImagePreview(props) {
|
|
|
1376
1380
|
const url = (resolveImageUrl ?? defaultResolveImageUrl)(src);
|
|
1377
1381
|
if (!url) return null;
|
|
1378
1382
|
return /* @__PURE__ */ jsx("span", {
|
|
1379
|
-
className: "md-image-preview md-
|
|
1383
|
+
className: "md-image-view-preview md-atom-view-preview",
|
|
1380
1384
|
"data-testid": "image-preview",
|
|
1381
1385
|
contentEditable: false,
|
|
1382
1386
|
children: /* @__PURE__ */ jsx("img", {
|
|
@@ -1394,15 +1398,15 @@ function ImagePreview(props) {
|
|
|
1394
1398
|
function ImageView(props) {
|
|
1395
1399
|
const { src, alt, context, children } = props;
|
|
1396
1400
|
return /* @__PURE__ */ jsxs("span", {
|
|
1397
|
-
className: "md-image-view",
|
|
1398
|
-
children: [/* @__PURE__ */ jsx(
|
|
1399
|
-
className: "md-image-view-content",
|
|
1400
|
-
children
|
|
1401
|
-
}), /* @__PURE__ */ jsx(ImagePreview, {
|
|
1401
|
+
className: "md-image-view md-atom-view",
|
|
1402
|
+
children: [/* @__PURE__ */ jsx(ImagePreview, {
|
|
1402
1403
|
src,
|
|
1403
1404
|
alt,
|
|
1404
1405
|
resolveImageUrl: context.resolveImageUrl,
|
|
1405
1406
|
onImageClick: context.onImageClick
|
|
1407
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
1408
|
+
className: "md-image-view-content md-atom-view-content",
|
|
1409
|
+
children
|
|
1406
1410
|
})]
|
|
1407
1411
|
});
|
|
1408
1412
|
}
|
|
@@ -1452,7 +1456,7 @@ function CodeBlock({ code, language }) {
|
|
|
1452
1456
|
/** Wrap inline `children` in one mark, special-casing the view/link marks. */
|
|
1453
1457
|
function wrapMark(mark, children, context) {
|
|
1454
1458
|
switch (mark.type.name) {
|
|
1455
|
-
case "
|
|
1459
|
+
case "mdWikilink": {
|
|
1456
1460
|
const attrs = mark.attrs;
|
|
1457
1461
|
return /* @__PURE__ */ jsx(WikilinkChip, {
|
|
1458
1462
|
target: attrs.target,
|
|
@@ -1461,7 +1465,7 @@ function wrapMark(mark, children, context) {
|
|
|
1461
1465
|
children
|
|
1462
1466
|
});
|
|
1463
1467
|
}
|
|
1464
|
-
case "
|
|
1468
|
+
case "mdImage": {
|
|
1465
1469
|
const attrs = mark.attrs;
|
|
1466
1470
|
return /* @__PURE__ */ jsx(ImageView, {
|
|
1467
1471
|
src: attrs.src,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meowdown/react",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.27.1",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"@prosekit/react": "^0.8.0-beta.11",
|
|
31
31
|
"clsx": "^2.1.1",
|
|
32
32
|
"lucide-react": "^1.21.0",
|
|
33
|
-
"@meowdown/core": "0.
|
|
33
|
+
"@meowdown/core": "0.27.1"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"react": "^19.0.0",
|