nuxt-og-image 1.0.0-beta.7 → 1.0.0-beta.8

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/module.json CHANGED
@@ -5,5 +5,5 @@
5
5
  "bridge": false
6
6
  },
7
7
  "configKey": "ogImage",
8
- "version": "1.0.0-beta.7"
8
+ "version": "1.0.0-beta.8"
9
9
  }
@@ -5,6 +5,7 @@ import { Resvg } from "@resvg/resvg-js";
5
5
  import { parseFont, walkSatoriTree } from "./utils.mjs";
6
6
  import imageSrc from "./plugins/imageSrc.mjs";
7
7
  import twClasses from "./plugins/twClasses.mjs";
8
+ import flex from "./plugins/flex.mjs";
8
9
  import { satoriFonts, satoriOptions } from "#nuxt-og-image/config";
9
10
  export default {
10
11
  name: "satori",
@@ -24,7 +25,8 @@ export default {
24
25
  const satoriTree = convertHtmlToSatori(body);
25
26
  await walkSatoriTree(url, satoriTree, [
26
27
  twClasses(url),
27
- imageSrc(url)
28
+ imageSrc(url),
29
+ flex(url)
28
30
  ]);
29
31
  return satoriTree;
30
32
  },
@@ -0,0 +1,2 @@
1
+ declare const _default: (url: import("ufo").ParsedURL) => import("../../../../../types").SatoriTransformer;
2
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import { defineSatoriTransformer } from "../utils.mjs";
2
+ export default defineSatoriTransformer(() => {
3
+ return {
4
+ filter: (node) => node.type === "div" && (Array.isArray(node.props.children) && node.props.children.length >= 1) && !node.props.style?.display,
5
+ transform: async (node) => {
6
+ node.props.style = node.props.style || {};
7
+ node.props.style.display = "flex";
8
+ node.props.style.flexDirection = "column";
9
+ }
10
+ };
11
+ });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nuxt-og-image",
3
3
  "type": "module",
4
- "version": "1.0.0-beta.7",
4
+ "version": "1.0.0-beta.8",
5
5
  "packageManager": "pnpm@7.8.0",
6
6
  "license": "MIT",
7
7
  "funding": "https://github.com/sponsors/harlan-zw",