@meowdown/react 0.60.0 → 0.61.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 +16 -5
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -2163,7 +2163,8 @@ function WikilinkChip(props) {
|
|
|
2163
2163
|
})]
|
|
2164
2164
|
});
|
|
2165
2165
|
}
|
|
2166
|
-
function EmbedFrame(
|
|
2166
|
+
function EmbedFrame(props) {
|
|
2167
|
+
const { embed, width, height } = props;
|
|
2167
2168
|
const iframeRef = useRef(null);
|
|
2168
2169
|
useEffect(() => {
|
|
2169
2170
|
if (embed.kind !== "tweet") return;
|
|
@@ -2171,6 +2172,8 @@ function EmbedFrame({ embed }) {
|
|
|
2171
2172
|
if (!iframe) return;
|
|
2172
2173
|
return listenForTweetHeight(iframe);
|
|
2173
2174
|
}, [embed.kind, embed.key]);
|
|
2175
|
+
const youtubeWidth = embed.kind === "youtube" ? width : null;
|
|
2176
|
+
const tweetHeight = embed.kind === "tweet" ? height : null;
|
|
2174
2177
|
return /* @__PURE__ */ jsx("span", {
|
|
2175
2178
|
className: "md-image-view-preview md-atom-view-preview",
|
|
2176
2179
|
contentEditable: false,
|
|
@@ -2184,14 +2187,20 @@ function EmbedFrame({ embed }) {
|
|
|
2184
2187
|
referrerPolicy: "strict-origin-when-cross-origin",
|
|
2185
2188
|
frameBorder: "0",
|
|
2186
2189
|
allow: embed.allow,
|
|
2187
|
-
allowFullScreen: embed.allowFullscreen
|
|
2190
|
+
allowFullScreen: embed.allowFullscreen,
|
|
2191
|
+
style: youtubeWidth != null ? { width: youtubeWidth } : tweetHeight != null ? { height: tweetHeight } : void 0,
|
|
2192
|
+
"data-sized": tweetHeight == null ? void 0 : ""
|
|
2188
2193
|
}, embed.key)
|
|
2189
2194
|
});
|
|
2190
2195
|
}
|
|
2191
2196
|
function ImagePreview(props) {
|
|
2192
|
-
const { src, alt, width, resolveImageUrl, onImageClick, interactive } = props;
|
|
2197
|
+
const { src, alt, width, height, resolveImageUrl, onImageClick, interactive } = props;
|
|
2193
2198
|
const embed = matchEmbed(src);
|
|
2194
|
-
if (embed) return interactive ? /* @__PURE__ */ jsx(EmbedFrame, {
|
|
2199
|
+
if (embed) return interactive ? /* @__PURE__ */ jsx(EmbedFrame, {
|
|
2200
|
+
embed,
|
|
2201
|
+
width,
|
|
2202
|
+
height
|
|
2203
|
+
}) : null;
|
|
2195
2204
|
const url = (resolveImageUrl ?? defaultResolveImageUrl)(src);
|
|
2196
2205
|
if (!url) return null;
|
|
2197
2206
|
return /* @__PURE__ */ jsx("span", {
|
|
@@ -2212,13 +2221,14 @@ function ImagePreview(props) {
|
|
|
2212
2221
|
});
|
|
2213
2222
|
}
|
|
2214
2223
|
function ImageView(props) {
|
|
2215
|
-
const { src, alt, width, context, children } = props;
|
|
2224
|
+
const { src, alt, width, height, context, children } = props;
|
|
2216
2225
|
return /* @__PURE__ */ jsxs("span", {
|
|
2217
2226
|
className: "md-image-view md-atom-view",
|
|
2218
2227
|
children: [/* @__PURE__ */ jsx(ImagePreview, {
|
|
2219
2228
|
src,
|
|
2220
2229
|
alt,
|
|
2221
2230
|
width,
|
|
2231
|
+
height,
|
|
2222
2232
|
resolveImageUrl: context.resolveImageUrl,
|
|
2223
2233
|
onImageClick: context.onImageClick,
|
|
2224
2234
|
interactive: context.interactive
|
|
@@ -2408,6 +2418,7 @@ function wrapMark(mark, children, context) {
|
|
|
2408
2418
|
src: attrs.src,
|
|
2409
2419
|
alt: attrs.alt,
|
|
2410
2420
|
width: attrs.width,
|
|
2421
|
+
height: attrs.height,
|
|
2411
2422
|
context,
|
|
2412
2423
|
children
|
|
2413
2424
|
});
|
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.61.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"github-slugger": "^2.0.0",
|
|
32
32
|
"lucide-react": "^1.27.0",
|
|
33
33
|
"react-property": "^2.0.2",
|
|
34
|
-
"@meowdown/core": "0.
|
|
34
|
+
"@meowdown/core": "0.61.0"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"react": "^19.0.0",
|