@meowdown/react 0.27.1 → 0.28.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/index.js +6 -3
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1374,7 +1374,7 @@ function EmbedFrame({ embed }) {
|
|
|
1374
1374
|
});
|
|
1375
1375
|
}
|
|
1376
1376
|
function ImagePreview(props) {
|
|
1377
|
-
const { src, alt, resolveImageUrl, onImageClick } = props;
|
|
1377
|
+
const { src, alt, width, resolveImageUrl, onImageClick } = props;
|
|
1378
1378
|
const embed = matchEmbed(src);
|
|
1379
1379
|
if (embed) return /* @__PURE__ */ jsx(EmbedFrame, { embed });
|
|
1380
1380
|
const url = (resolveImageUrl ?? defaultResolveImageUrl)(src);
|
|
@@ -1391,17 +1391,19 @@ function ImagePreview(props) {
|
|
|
1391
1391
|
src,
|
|
1392
1392
|
alt,
|
|
1393
1393
|
event: event.nativeEvent
|
|
1394
|
-
}) : void 0
|
|
1394
|
+
}) : void 0,
|
|
1395
|
+
style: width == null ? void 0 : { width: `${width}px` }
|
|
1395
1396
|
})
|
|
1396
1397
|
});
|
|
1397
1398
|
}
|
|
1398
1399
|
function ImageView(props) {
|
|
1399
|
-
const { src, alt, context, children } = props;
|
|
1400
|
+
const { src, alt, width, context, children } = props;
|
|
1400
1401
|
return /* @__PURE__ */ jsxs("span", {
|
|
1401
1402
|
className: "md-image-view md-atom-view",
|
|
1402
1403
|
children: [/* @__PURE__ */ jsx(ImagePreview, {
|
|
1403
1404
|
src,
|
|
1404
1405
|
alt,
|
|
1406
|
+
width,
|
|
1405
1407
|
resolveImageUrl: context.resolveImageUrl,
|
|
1406
1408
|
onImageClick: context.onImageClick
|
|
1407
1409
|
}), /* @__PURE__ */ jsx("span", {
|
|
@@ -1470,6 +1472,7 @@ function wrapMark(mark, children, context) {
|
|
|
1470
1472
|
return /* @__PURE__ */ jsx(ImageView, {
|
|
1471
1473
|
src: attrs.src,
|
|
1472
1474
|
alt: attrs.alt,
|
|
1475
|
+
width: attrs.width,
|
|
1473
1476
|
context,
|
|
1474
1477
|
children
|
|
1475
1478
|
});
|
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.28.0",
|
|
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.28.0"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"react": "^19.0.0",
|