@ethercorps/sveltekit-og 4.3.0-next.10 → 4.3.0-next.11

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.
@@ -4,12 +4,13 @@ import { useTakumiRenderer, registerTakumiFonts } from "./renderer.js";
4
4
  import { resolveTakumiFonts } from "./fonts.js";
5
5
  import { createLogger } from "../helpers/logger.js";
6
6
  import { handleAsync, handleSync, ErrorCodes } from "../helpers/error-handler.js";
7
+ import { html } from "satori-html";
7
8
  function elementToHtml(element, props) {
8
9
  if (typeof element === "string")
9
- return element.replaceAll("\n", "").trim();
10
+ return html(element.replaceAll("\n", "").trim());
10
11
  // head carries css injected via <svelte:options css="injected" />, so it goes first
11
12
  const { head, body } = renderComponentToHtml(element, props);
12
- return head + body;
13
+ return html(head + body);
13
14
  }
14
15
  /** Render an HTML string or Svelte component to image bytes (or an svg string). */
15
16
  export async function createTakumiImage(element, options, props) {
package/package.json CHANGED
@@ -1,131 +1,130 @@
1
1
  {
2
- "name": "@ethercorps/sveltekit-og",
3
- "version": "4.3.0-next.10",
4
- "license": "MIT",
5
- "homepage": "https://sveltekit-og.dev",
6
- "repository": "github:ethercorps/sveltekit-og",
7
- "funding": "https://github.com/sponsors/ethercorps",
8
- "author": "Shivam Meena <https://github.com/theetherGit>",
9
- "description": "Dynamically generate Open Graph images from an HTML, CSS template or Svelte component using fast and efficient conversion from HTML > SVG > PNG",
10
- "contributors": [
11
- {
12
- "name": "Shivam Meena",
13
- "github": "https://github.com/theetherGit"
14
- },
15
- {
16
- "name": "Jason",
17
- "github": "https://github.com/jasongitmail"
18
- },
19
- {
20
- "name": "Mihkel Martin Kasterpalu",
21
- "github": "https://github.com/MihkelMK"
22
- },
23
- {
24
- "name": "Luke Parke",
25
- "github": "https://github.com/LukasParke"
26
- },
27
- {
28
- "name": "Willow (GHOST)",
29
- "github": "https://github.com/ghostdevv"
30
- },
31
- {
32
- "name": "Minseo Lee",
33
- "github": "https://github.com/quiple"
34
- }
35
- ],
36
- "scripts": {
37
- "dev": "vite dev",
38
- "build": "vite build && npm run package",
39
- "build:examples": "pnpm -F \"./examples/**\" --parallel --color build",
40
- "check:examples": "pnpm install -r",
41
- "preview": "vite preview",
42
- "package": "svelte-kit sync && svelte-package && publint",
43
- "prepublishOnly": "pnpm run package",
44
- "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
45
- "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
46
- "test": "vitest",
47
- "bench": "vitest bench --run",
48
- "bench:save": "vitest bench --run --outputJson benchmarks/baseline.json",
49
- "bench:compare": "vitest bench --run --compare benchmarks/baseline.json",
50
- "bench:snapshot": "node scripts/bench-snapshot.mjs",
51
- "lint": "oxlint . && eslint .",
52
- "format": "prettier --plugin-search-dir . --write .",
53
- "publishBeta": "npm publish --tag beta"
54
- },
55
- "exports": {
56
- ".": {
57
- "types": "./dist/index.d.ts",
58
- "svelte": "./dist/index.js",
59
- "import": "./dist/index.js"
60
- },
61
- "./fonts": {
62
- "types": "./dist/fonts.d.ts",
63
- "import": "./dist/fonts.js"
64
- },
65
- "./takumi": {
66
- "types": "./dist/takumi/index.d.ts",
67
- "svelte": "./dist/takumi/index.js",
68
- "import": "./dist/takumi/index.js"
69
- },
70
- "./plugin": {
71
- "types": "./dist/plugin.d.ts",
72
- "import": "./dist/plugin.js"
73
- }
74
- },
75
- "files": [
76
- "dist",
77
- "!dist/**/*.test.*",
78
- "!dist/**/*.spec.*"
79
- ],
80
- "devDependencies": {
81
- "@eslint/compat": "^2.0.3",
82
- "@eslint/js": "^9.39.3",
83
- "@sveltejs/adapter-vercel": "^5.10.3",
84
- "@sveltejs/kit": "^2.53.4",
85
- "@sveltejs/package": "^2.5.7",
86
- "@sveltejs/vite-plugin-svelte": "^4.0.4",
87
- "@types/node": "^24.11.0",
88
- "@typescript-eslint/eslint-plugin": "^5.62.0",
89
- "@typescript-eslint/parser": "^5.62.0",
90
- "css-tree": "^2.3.1",
91
- "eslint": "^8.57.1",
92
- "eslint-config-prettier": "^8.10.2",
93
- "eslint-plugin-oxlint": "^1.55.0",
94
- "eslint-plugin-svelte": "^2.46.1",
95
- "globals": "^16.5.0",
96
- "oxlint": "^1.55.0",
97
- "prettier": "^3.8.1",
98
- "prettier-plugin-svelte": "^3.5.1",
99
- "prettier-plugin-tailwindcss": "^0.6.14",
100
- "publint": "^0.1.16",
101
- "rollup-plugin-visualizer": "^5.14.0",
102
- "svelte": "^5.53.10",
103
- "svelte-check": "^4.4.5",
104
- "tslib": "^2.8.1",
105
- "typescript": "^5.9.3",
106
- "typescript-eslint": "^8.57.0",
107
- "vite": "^5.4.21",
108
- "takumi-js": "2.0.0-beta.14",
109
- "vitest": "^1.6.1"
110
- },
111
- "main": "./dist/index.js",
112
- "svelte": "./dist/index.js",
113
- "types": "./dist/index.d.ts",
114
- "type": "module",
115
- "dependencies": {
116
- "@resvg/resvg-wasm": "^2.6.2",
117
- "satori": "^0.25.0",
118
- "satori-html": "0.3.2",
119
- "std-env": "^4.1.0",
120
- "unwasm": "^0.5.3"
121
- },
122
- "peerDependencies": {
123
- "@sveltejs/kit": ">=2.0.0",
124
- "takumi-js": "^2.0.0-beta.14"
125
- },
126
- "peerDependenciesMeta": {
127
- "takumi-js": {
128
- "optional": true
129
- }
130
- }
131
- }
2
+ "name": "@ethercorps/sveltekit-og",
3
+ "version": "4.3.0-next.11",
4
+ "license": "MIT",
5
+ "homepage": "https://sveltekit-og.dev",
6
+ "repository": "github:ethercorps/sveltekit-og",
7
+ "funding": "https://github.com/sponsors/ethercorps",
8
+ "author": "Shivam Meena <https://github.com/theetherGit>",
9
+ "description": "Dynamically generate Open Graph images from an HTML, CSS template or Svelte component using fast and efficient conversion from HTML > SVG > PNG",
10
+ "contributors": [
11
+ {
12
+ "name": "Shivam Meena",
13
+ "github": "https://github.com/theetherGit"
14
+ },
15
+ {
16
+ "name": "Jason",
17
+ "github": "https://github.com/jasongitmail"
18
+ },
19
+ {
20
+ "name": "Mihkel Martin Kasterpalu",
21
+ "github": "https://github.com/MihkelMK"
22
+ },
23
+ {
24
+ "name": "Luke Parke",
25
+ "github": "https://github.com/LukasParke"
26
+ },
27
+ {
28
+ "name": "Willow (GHOST)",
29
+ "github": "https://github.com/ghostdevv"
30
+ },
31
+ {
32
+ "name": "Minseo Lee",
33
+ "github": "https://github.com/quiple"
34
+ }
35
+ ],
36
+ "exports": {
37
+ ".": {
38
+ "types": "./dist/index.d.ts",
39
+ "svelte": "./dist/index.js",
40
+ "import": "./dist/index.js"
41
+ },
42
+ "./fonts": {
43
+ "types": "./dist/fonts.d.ts",
44
+ "import": "./dist/fonts.js"
45
+ },
46
+ "./takumi": {
47
+ "types": "./dist/takumi/index.d.ts",
48
+ "svelte": "./dist/takumi/index.js",
49
+ "import": "./dist/takumi/index.js"
50
+ },
51
+ "./plugin": {
52
+ "types": "./dist/plugin.d.ts",
53
+ "import": "./dist/plugin.js"
54
+ }
55
+ },
56
+ "files": [
57
+ "dist",
58
+ "!dist/**/*.test.*",
59
+ "!dist/**/*.spec.*"
60
+ ],
61
+ "devDependencies": {
62
+ "@eslint/compat": "^2.0.3",
63
+ "@eslint/js": "^9.39.3",
64
+ "@sveltejs/adapter-vercel": "^5.10.3",
65
+ "@sveltejs/kit": "^2.53.4",
66
+ "@sveltejs/package": "^2.5.7",
67
+ "@sveltejs/vite-plugin-svelte": "^4.0.4",
68
+ "@types/node": "^24.11.0",
69
+ "@typescript-eslint/eslint-plugin": "^5.62.0",
70
+ "@typescript-eslint/parser": "^5.62.0",
71
+ "css-tree": "^2.3.1",
72
+ "eslint": "^8.57.1",
73
+ "eslint-config-prettier": "^8.10.2",
74
+ "eslint-plugin-oxlint": "^1.55.0",
75
+ "eslint-plugin-svelte": "^2.46.1",
76
+ "globals": "^16.5.0",
77
+ "oxlint": "^1.55.0",
78
+ "prettier": "^3.8.1",
79
+ "prettier-plugin-svelte": "^3.5.1",
80
+ "prettier-plugin-tailwindcss": "^0.6.14",
81
+ "publint": "^0.1.16",
82
+ "rollup-plugin-visualizer": "^5.14.0",
83
+ "svelte": "^5.53.10",
84
+ "svelte-check": "^4.4.5",
85
+ "tslib": "^2.8.1",
86
+ "typescript": "^5.9.3",
87
+ "typescript-eslint": "^8.57.0",
88
+ "vite": "^5.4.21",
89
+ "takumi-js": "2.0.0-beta.14",
90
+ "vitest": "^1.6.1"
91
+ },
92
+ "main": "./dist/index.js",
93
+ "svelte": "./dist/index.js",
94
+ "types": "./dist/index.d.ts",
95
+ "type": "module",
96
+ "dependencies": {
97
+ "@resvg/resvg-wasm": "^2.6.2",
98
+ "satori": "^0.25.0",
99
+ "satori-html": "0.3.2",
100
+ "std-env": "^4.1.0",
101
+ "unwasm": "^0.5.3"
102
+ },
103
+ "peerDependencies": {
104
+ "@sveltejs/kit": ">=2.0.0",
105
+ "takumi-js": "^2.0.0-beta.14"
106
+ },
107
+ "peerDependenciesMeta": {
108
+ "takumi-js": {
109
+ "optional": true
110
+ }
111
+ },
112
+ "scripts": {
113
+ "dev": "vite dev",
114
+ "build": "vite build && npm run package",
115
+ "build:examples": "pnpm -F \"./examples/**\" --parallel --color build",
116
+ "check:examples": "pnpm install -r",
117
+ "preview": "vite preview",
118
+ "package": "svelte-kit sync && svelte-package && publint",
119
+ "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
120
+ "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
121
+ "test": "vitest",
122
+ "bench": "vitest bench --run",
123
+ "bench:save": "vitest bench --run --outputJson benchmarks/baseline.json",
124
+ "bench:compare": "vitest bench --run --compare benchmarks/baseline.json",
125
+ "bench:snapshot": "node scripts/bench-snapshot.mjs",
126
+ "lint": "oxlint . && eslint .",
127
+ "format": "prettier --plugin-search-dir . --write .",
128
+ "publishBeta": "npm publish --tag beta"
129
+ }
130
+ }
Binary file