takumi-js 2.12.0 → 2.13.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.
@@ -3,7 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const loadNative = () => import("@takumi-rs/core").catch((cause) => {
4
4
  throw new Error("Failed to load the native @takumi-rs/core backend. On a runtime without the native addon, pass a `module` (a WASM binary) to render with the WASM backend instead.", { cause });
5
5
  });
6
- const loadWasm = (module) => Promise.resolve().then(() => require("../wasm-node-CaSIdQS-.cjs")).then((backend) => backend.loadBackend(module));
6
+ const loadWasm = (module) => Promise.resolve().then(() => require("../wasm-node-BB44t5QI.cjs")).then((backend) => backend.loadBackend(module));
7
7
  const loadBackend = (module) => typeof process !== "undefined" && process.versions?.webcontainer ? loadWasm(module) : loadNative(module);
8
8
  //#endregion
9
9
  exports.loadBackend = loadBackend;
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_rolldown_runtime = require("../rolldown-runtime-DakpK96I.cjs");
3
- const require_wasm_init = require("../wasm-init-H65IoN11.cjs");
2
+ const require_rolldown_runtime = require("../rolldown-runtime-C0BPl7ul.cjs");
3
+ const require_wasm_init = require("../wasm-init-Dl-su2Ub.cjs");
4
4
  let _takumi_rs_wasm_auto = require("@takumi-rs/wasm/auto");
5
5
  _takumi_rs_wasm_auto = require_rolldown_runtime.__toESM(_takumi_rs_wasm_auto, 1);
6
6
  //#region src/backend/wasm.ts
package/dist/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_render = require("./render-f5o4nsy9.cjs");
2
+ const require_render = require("./render-C7kRwHMk.cjs");
3
3
  exports.render = require_render.render;
4
4
  exports.renderAnimation = require_render.renderAnimation;
5
5
  exports.renderSvg = require_render.renderSvg;
package/dist/index.d.cts CHANGED
@@ -1,6 +1,6 @@
1
- import { a as RenderOptions, c as renderAnimation, i as RenderInput, l as renderSvg, n as ImagesInput, o as RenderSvgOptions, r as RenderAnimationOptions, s as render, t as AnimationScene } from "./render-BIupnPO8.cjs";
1
+ import { a as RenderOptions, c as renderAnimation, i as RenderInput, l as renderSvg, n as ImagesInput, o as RenderSvgOptions, r as RenderAnimationOptions, s as render, t as AnimationScene } from "./render-DDQRhVd1.cjs";
2
2
  import { AnimationOutputFormat, DitheringAlgorithm, Font, FontDetails, FontLoader, ImageSource, Keyframes, KeyframesMap, KeyframesRuleList, MeasuredNode, MeasuredTextRun, OutputFormat } from "@takumi-rs/core";
3
- import { ContainerNode, FetchOptions, ImageNode, Node, NodeAttributes, NodeMetadata, ReactElementLike, RgbaImage, TextNode } from "@takumi-rs/helpers";
3
+ import { AnimationRule, ContainerNode, CssInput, Declarations, FetchOptions, ImageNode, LayerRule, MediaRule, Node, NodeAttributes, NodeMetadata, ReactElementLike, RgbaImage, StyleRule, SupportsRule, TextNode } from "@takumi-rs/helpers";
4
4
  //#region src/glyph-cache.d.ts
5
5
  /**
6
6
  * Sets the byte budget shared by the resolved-glyph and glyph-mask caches; `0` stops
@@ -24,4 +24,4 @@ declare module "react" {
24
24
  }
25
25
  }
26
26
  //#endregion
27
- export { type AnimationOutputFormat, type AnimationScene, type ContainerNode, type DitheringAlgorithm, type FetchOptions, type Font, type FontDetails, type FontLoader, type ImageNode, type ImageSource, type ImagesInput, type Keyframes, type KeyframesMap, type KeyframesRuleList, type MeasuredNode, type MeasuredTextRun, type Node, type NodeAttributes, type NodeMetadata, type OutputFormat, type ReactElementLike, type RenderAnimationOptions, type RenderInput, type RenderOptions, type RenderSvgOptions, type RgbaImage, type TextNode, render, renderAnimation, renderSvg, setGlyphCacheMaxBytes };
27
+ export { type AnimationOutputFormat, type AnimationRule, type AnimationScene, type ContainerNode, type CssInput, type Declarations, type DitheringAlgorithm, type FetchOptions, type Font, type FontDetails, type FontLoader, type ImageNode, type ImageSource, type ImagesInput, type Keyframes, type KeyframesMap, type KeyframesRuleList, type LayerRule, type MeasuredNode, type MeasuredTextRun, type MediaRule, type Node, type NodeAttributes, type NodeMetadata, type OutputFormat, type ReactElementLike, type RenderAnimationOptions, type RenderInput, type RenderOptions, type RenderSvgOptions, type RgbaImage, type StyleRule, type SupportsRule, type TextNode, render, renderAnimation, renderSvg, setGlyphCacheMaxBytes };
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { a as RenderOptions, c as renderAnimation, i as RenderInput, l as renderSvg, n as ImagesInput, o as RenderSvgOptions, r as RenderAnimationOptions, s as render, t as AnimationScene } from "./render-CSv0fCuQ.mjs";
2
- import { ContainerNode, FetchOptions, ImageNode, Node, NodeAttributes, NodeMetadata, ReactElementLike, RgbaImage, TextNode } from "@takumi-rs/helpers";
1
+ import { a as RenderOptions, c as renderAnimation, i as RenderInput, l as renderSvg, n as ImagesInput, o as RenderSvgOptions, r as RenderAnimationOptions, s as render, t as AnimationScene } from "./render-9RT7wd29.mjs";
2
+ import { AnimationRule, ContainerNode, CssInput, Declarations, FetchOptions, ImageNode, LayerRule, MediaRule, Node, NodeAttributes, NodeMetadata, ReactElementLike, RgbaImage, StyleRule, SupportsRule, TextNode } from "@takumi-rs/helpers";
3
3
  import { AnimationOutputFormat, DitheringAlgorithm, Font, FontDetails, FontLoader, ImageSource, Keyframes, KeyframesMap, KeyframesRuleList, MeasuredNode, MeasuredTextRun, OutputFormat } from "@takumi-rs/core";
4
4
  //#region src/glyph-cache.d.ts
5
5
  /**
@@ -24,4 +24,4 @@ declare module "react" {
24
24
  }
25
25
  }
26
26
  //#endregion
27
- export { type AnimationOutputFormat, type AnimationScene, type ContainerNode, type DitheringAlgorithm, type FetchOptions, type Font, type FontDetails, type FontLoader, type ImageNode, type ImageSource, type ImagesInput, type Keyframes, type KeyframesMap, type KeyframesRuleList, type MeasuredNode, type MeasuredTextRun, type Node, type NodeAttributes, type NodeMetadata, type OutputFormat, type ReactElementLike, type RenderAnimationOptions, type RenderInput, type RenderOptions, type RenderSvgOptions, type RgbaImage, type TextNode, render, renderAnimation, renderSvg, setGlyphCacheMaxBytes };
27
+ export { type AnimationOutputFormat, type AnimationRule, type AnimationScene, type ContainerNode, type CssInput, type Declarations, type DitheringAlgorithm, type FetchOptions, type Font, type FontDetails, type FontLoader, type ImageNode, type ImageSource, type ImagesInput, type Keyframes, type KeyframesMap, type KeyframesRuleList, type LayerRule, type MeasuredNode, type MeasuredTextRun, type MediaRule, type Node, type NodeAttributes, type NodeMetadata, type OutputFormat, type ReactElementLike, type RenderAnimationOptions, type RenderInput, type RenderOptions, type RenderSvgOptions, type RgbaImage, type StyleRule, type SupportsRule, type TextNode, render, renderAnimation, renderSvg, setGlyphCacheMaxBytes };
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { i as setGlyphCacheMaxBytes, n as renderAnimation, r as renderSvg, t as render } from "./render-CPSfpCxT.mjs";
1
+ import { i as setGlyphCacheMaxBytes, n as renderAnimation, r as renderSvg, t as render } from "./render-BPTOJWUk.mjs";
2
2
  export { render, renderAnimation, renderSvg, setGlyphCacheMaxBytes };
@@ -1,8 +1,8 @@
1
- import * as napi from "@takumi-rs/core";
2
- import * as wasm from "@takumi-rs/wasm";
3
1
  import { EmojiType } from "@takumi-rs/helpers/emoji";
4
- import { FetchOptions, ImageFetchCache, Node, ReactElementLike } from "@takumi-rs/helpers";
2
+ import { CssInput, FetchOptions, ImageFetchCache, Node, ReactElementLike } from "@takumi-rs/helpers";
5
3
  import { FromJsxOptions } from "@takumi-rs/helpers/jsx";
4
+ import * as napi from "@takumi-rs/core";
5
+ import * as wasm from "@takumi-rs/wasm";
6
6
  import { ReactNode } from "react";
7
7
  //#region src/render.d.ts
8
8
  type Renderer = napi.Renderer | wasm.Renderer;
@@ -50,9 +50,19 @@ type Managed<TInner> = (TInner & SharedRenderExtras) | (TInner & Omit<SharedRend
50
50
  * tagged union survives instead of collapsing into one flat member.
51
51
  */
52
52
  type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;
53
- type InnerRenderOptions = DistributiveOmit<napi.RenderOptions | wasm.RenderOptions, "images">;
54
- type InnerSvgRenderOptions = DistributiveOmit<napi.SvgRenderOptions | wasm.SvgRenderOptions, "images">;
55
- type InnerRenderAnimationOptions = DistributiveOmit<napi.RenderAnimationOptions | wasm.RenderAnimationOptions, "images">;
53
+ /** The wrapper-level CSS inputs, replacing the backends' `stylesheets` field. */
54
+ type CssOptions = {
55
+ /** CSS to apply before rendering, one string or a list cascading in order. */
56
+ css?: CssInput | readonly CssInput[];
57
+ /**
58
+ * CSS stylesheets to apply before rendering.
59
+ * @deprecated Use `css` instead. Will be removed in v3.
60
+ */
61
+ stylesheets?: string[];
62
+ };
63
+ type InnerRenderOptions = DistributiveOmit<napi.RenderOptions | wasm.RenderOptions, "images" | "css"> & CssOptions;
64
+ type InnerSvgRenderOptions = DistributiveOmit<napi.SvgRenderOptions | wasm.SvgRenderOptions, "images" | "css"> & CssOptions;
65
+ type InnerRenderAnimationOptions = DistributiveOmit<napi.RenderAnimationOptions | wasm.RenderAnimationOptions, "images" | "css"> & CssOptions;
56
66
  type RenderOptions = Managed<InnerRenderOptions>;
57
67
  type RenderSvgOptions = Managed<InnerSvgRenderOptions>;
58
68
  /** A single animation scene whose content is any renderable input. */
@@ -57,7 +57,7 @@ function isTakumiNode(element) {
57
57
  async function transformElement(element, options) {
58
58
  if (isTakumiNode(element)) return {
59
59
  node: element,
60
- stylesheets: []
60
+ css: []
61
61
  };
62
62
  if (typeof element === "string") return fromHtml(element);
63
63
  return fromJsx(element, options?.jsx);
@@ -70,11 +70,11 @@ async function resolveRenderer(options) {
70
70
  }
71
71
  /** Transforms an input into a node tree and extracts its emojis. */
72
72
  async function resolveContent(element, options) {
73
- const { node: originalNode, stylesheets } = await transformElement(element, options);
73
+ const { node: originalNode, css } = await transformElement(element, options);
74
74
  const emojiType = options?.emoji ?? "twemoji";
75
75
  return {
76
76
  node: emojiType !== "from-font" ? extractEmojis(originalNode, emojiType) : originalNode,
77
- stylesheets
77
+ css
78
78
  };
79
79
  }
80
80
  /** Resolves the render's `images` option into concrete entries via {@link prepareImages}. */
@@ -96,8 +96,20 @@ async function collectImages(node, options) {
96
96
  cache: ("cache" in image ? image.cache : void 0) ?? cache
97
97
  })) : prepared;
98
98
  }
99
- function mergeStylesheets(options, extra) {
100
- return [...options?.stylesheets ?? [], ...extra];
99
+ let warnedStylesheets = false;
100
+ function warnStylesheetsDeprecated() {
101
+ if (warnedStylesheets) return;
102
+ warnedStylesheets = true;
103
+ console.warn("takumi: the `stylesheets` option is deprecated, use `css` instead.");
104
+ }
105
+ /** Narrows the `css` option, which takes one entry or a list of them. */
106
+ function isCssList(css) {
107
+ return Array.isArray(css);
108
+ }
109
+ function mergeCss(options, extra) {
110
+ if (options?.css !== void 0 && options?.stylesheets !== void 0) throw new Error("pass either `css` or `stylesheets`, not both");
111
+ if (options?.stylesheets !== void 0) warnStylesheetsDeprecated();
112
+ return [...options?.css !== void 0 ? isCssList(options.css) ? options.css : [options.css] : options?.stylesheets ?? [], ...extra];
101
113
  }
102
114
  /**
103
115
  * Renders a React element, HTML string, or Takumi node tree into an image.
@@ -122,13 +134,14 @@ function mergeStylesheets(options, extra) {
122
134
  async function render(element, options) {
123
135
  options?.signal?.throwIfAborted();
124
136
  const renderer = await resolveRenderer(options);
125
- const { node, stylesheets } = await resolveContent(element, options);
137
+ const { node, css: extractedCss } = await resolveContent(element, options);
126
138
  const images = await collectImages(node, options);
127
139
  options?.signal?.throwIfAborted();
140
+ const { css: _, stylesheets: _alias, ...forward } = options ?? {};
128
141
  return renderer.render(node, {
129
- ...options,
142
+ ...forward,
130
143
  images,
131
- stylesheets: mergeStylesheets(options, stylesheets)
144
+ css: mergeCss(options, extractedCss)
132
145
  });
133
146
  }
134
147
  /**
@@ -154,13 +167,14 @@ async function render(element, options) {
154
167
  async function renderSvg(element, options) {
155
168
  options?.signal?.throwIfAborted();
156
169
  const renderer = await resolveRenderer(options);
157
- const { node, stylesheets } = await resolveContent(element, options);
170
+ const { node, css: extractedCss } = await resolveContent(element, options);
158
171
  const images = await collectImages(node, options);
159
172
  options?.signal?.throwIfAborted();
173
+ const { css: _, stylesheets: _alias, ...forward } = options ?? {};
160
174
  return renderer.renderSvg(node, {
161
- ...options,
175
+ ...forward,
162
176
  images,
163
- stylesheets: mergeStylesheets(options, stylesheets)
177
+ css: mergeCss(options, extractedCss)
164
178
  });
165
179
  }
166
180
  /**
@@ -189,26 +203,27 @@ async function renderSvg(element, options) {
189
203
  */
190
204
  async function renderAnimation(options) {
191
205
  options.signal?.throwIfAborted();
206
+ const { css: _, stylesheets: _alias, ...forward } = options;
192
207
  const renderer = await resolveRenderer(options);
193
208
  const scenes = await Promise.all(options.scenes.map(async (scene) => {
194
- const { node, stylesheets } = await resolveContent(scene.node, options);
209
+ const { node, css } = await resolveContent(scene.node, options);
195
210
  return {
196
211
  node,
197
212
  durationMs: scene.durationMs,
198
- stylesheets
213
+ css
199
214
  };
200
215
  }));
201
216
  const images = await collectImages(scenes.map((scene) => scene.node), options);
202
- const stylesheets = mergeStylesheets(options, scenes.flatMap((scene) => scene.stylesheets));
217
+ const css = mergeCss(options, scenes.flatMap((scene) => scene.css));
203
218
  options.signal?.throwIfAborted();
204
219
  return renderer.renderAnimation({
205
- ...options,
220
+ ...forward,
206
221
  scenes: scenes.map(({ node, durationMs }) => ({
207
222
  node,
208
223
  durationMs
209
224
  })),
210
225
  images,
211
- stylesheets
226
+ css
212
227
  });
213
228
  }
214
229
  //#endregion
@@ -38,7 +38,7 @@ let importPromise = null;
38
38
  * Node target that can't load the native addon. A failed load clears the cache.
39
39
  */
40
40
  function getImports(module) {
41
- importPromise ??= (module === void 0 ? (0, _backend.loadBackend)() : Promise.resolve().then(() => require("./wasm-init-H65IoN11.cjs")).then((n) => n.wasm_init_exports).then(({ initWasm }) => initWasm(module))).then((backend) => {
41
+ importPromise ??= (module === void 0 ? (0, _backend.loadBackend)() : Promise.resolve().then(() => require("./wasm-init-Dl-su2Ub.cjs")).then((n) => n.wasm_init_exports).then(({ initWasm }) => initWasm(module))).then((backend) => {
42
42
  applyGlyphCacheMaxBytes(backend);
43
43
  return backend;
44
44
  }).catch((error) => {
@@ -57,7 +57,7 @@ function isTakumiNode(element) {
57
57
  async function transformElement(element, options) {
58
58
  if (isTakumiNode(element)) return {
59
59
  node: element,
60
- stylesheets: []
60
+ css: []
61
61
  };
62
62
  if (typeof element === "string") return (0, _takumi_rs_helpers_html.fromHtml)(element);
63
63
  return (0, _takumi_rs_helpers_jsx.fromJsx)(element, options?.jsx);
@@ -70,11 +70,11 @@ async function resolveRenderer(options) {
70
70
  }
71
71
  /** Transforms an input into a node tree and extracts its emojis. */
72
72
  async function resolveContent(element, options) {
73
- const { node: originalNode, stylesheets } = await transformElement(element, options);
73
+ const { node: originalNode, css } = await transformElement(element, options);
74
74
  const emojiType = options?.emoji ?? "twemoji";
75
75
  return {
76
76
  node: emojiType !== "from-font" ? (0, _takumi_rs_helpers_emoji.extractEmojis)(originalNode, emojiType) : originalNode,
77
- stylesheets
77
+ css
78
78
  };
79
79
  }
80
80
  /** Resolves the render's `images` option into concrete entries via {@link prepareImages}. */
@@ -96,8 +96,20 @@ async function collectImages(node, options) {
96
96
  cache: ("cache" in image ? image.cache : void 0) ?? cache
97
97
  })) : prepared;
98
98
  }
99
- function mergeStylesheets(options, extra) {
100
- return [...options?.stylesheets ?? [], ...extra];
99
+ let warnedStylesheets = false;
100
+ function warnStylesheetsDeprecated() {
101
+ if (warnedStylesheets) return;
102
+ warnedStylesheets = true;
103
+ console.warn("takumi: the `stylesheets` option is deprecated, use `css` instead.");
104
+ }
105
+ /** Narrows the `css` option, which takes one entry or a list of them. */
106
+ function isCssList(css) {
107
+ return Array.isArray(css);
108
+ }
109
+ function mergeCss(options, extra) {
110
+ if (options?.css !== void 0 && options?.stylesheets !== void 0) throw new Error("pass either `css` or `stylesheets`, not both");
111
+ if (options?.stylesheets !== void 0) warnStylesheetsDeprecated();
112
+ return [...options?.css !== void 0 ? isCssList(options.css) ? options.css : [options.css] : options?.stylesheets ?? [], ...extra];
101
113
  }
102
114
  /**
103
115
  * Renders a React element, HTML string, or Takumi node tree into an image.
@@ -122,13 +134,14 @@ function mergeStylesheets(options, extra) {
122
134
  async function render(element, options) {
123
135
  options?.signal?.throwIfAborted();
124
136
  const renderer = await resolveRenderer(options);
125
- const { node, stylesheets } = await resolveContent(element, options);
137
+ const { node, css: extractedCss } = await resolveContent(element, options);
126
138
  const images = await collectImages(node, options);
127
139
  options?.signal?.throwIfAborted();
140
+ const { css: _, stylesheets: _alias, ...forward } = options ?? {};
128
141
  return renderer.render(node, {
129
- ...options,
142
+ ...forward,
130
143
  images,
131
- stylesheets: mergeStylesheets(options, stylesheets)
144
+ css: mergeCss(options, extractedCss)
132
145
  });
133
146
  }
134
147
  /**
@@ -154,13 +167,14 @@ async function render(element, options) {
154
167
  async function renderSvg(element, options) {
155
168
  options?.signal?.throwIfAborted();
156
169
  const renderer = await resolveRenderer(options);
157
- const { node, stylesheets } = await resolveContent(element, options);
170
+ const { node, css: extractedCss } = await resolveContent(element, options);
158
171
  const images = await collectImages(node, options);
159
172
  options?.signal?.throwIfAborted();
173
+ const { css: _, stylesheets: _alias, ...forward } = options ?? {};
160
174
  return renderer.renderSvg(node, {
161
- ...options,
175
+ ...forward,
162
176
  images,
163
- stylesheets: mergeStylesheets(options, stylesheets)
177
+ css: mergeCss(options, extractedCss)
164
178
  });
165
179
  }
166
180
  /**
@@ -189,26 +203,27 @@ async function renderSvg(element, options) {
189
203
  */
190
204
  async function renderAnimation(options) {
191
205
  options.signal?.throwIfAborted();
206
+ const { css: _, stylesheets: _alias, ...forward } = options;
192
207
  const renderer = await resolveRenderer(options);
193
208
  const scenes = await Promise.all(options.scenes.map(async (scene) => {
194
- const { node, stylesheets } = await resolveContent(scene.node, options);
209
+ const { node, css } = await resolveContent(scene.node, options);
195
210
  return {
196
211
  node,
197
212
  durationMs: scene.durationMs,
198
- stylesheets
213
+ css
199
214
  };
200
215
  }));
201
216
  const images = await collectImages(scenes.map((scene) => scene.node), options);
202
- const stylesheets = mergeStylesheets(options, scenes.flatMap((scene) => scene.stylesheets));
217
+ const css = mergeCss(options, scenes.flatMap((scene) => scene.css));
203
218
  options.signal?.throwIfAborted();
204
219
  return renderer.renderAnimation({
205
- ...options,
220
+ ...forward,
206
221
  scenes: scenes.map(({ node, durationMs }) => ({
207
222
  node,
208
223
  durationMs
209
224
  })),
210
225
  images,
211
- stylesheets
226
+ css
212
227
  });
213
228
  }
214
229
  //#endregion
@@ -1,8 +1,8 @@
1
- import { EmojiType } from "@takumi-rs/helpers/emoji";
2
- import { FetchOptions, ImageFetchCache, Node, ReactElementLike } from "@takumi-rs/helpers";
3
- import { FromJsxOptions } from "@takumi-rs/helpers/jsx";
4
1
  import * as napi from "@takumi-rs/core";
5
2
  import * as wasm from "@takumi-rs/wasm";
3
+ import { EmojiType } from "@takumi-rs/helpers/emoji";
4
+ import { CssInput, FetchOptions, ImageFetchCache, Node, ReactElementLike } from "@takumi-rs/helpers";
5
+ import { FromJsxOptions } from "@takumi-rs/helpers/jsx";
6
6
  import { ReactNode } from "react";
7
7
  //#region src/render.d.ts
8
8
  type Renderer = napi.Renderer | wasm.Renderer;
@@ -50,9 +50,19 @@ type Managed<TInner> = (TInner & SharedRenderExtras) | (TInner & Omit<SharedRend
50
50
  * tagged union survives instead of collapsing into one flat member.
51
51
  */
52
52
  type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;
53
- type InnerRenderOptions = DistributiveOmit<napi.RenderOptions | wasm.RenderOptions, "images">;
54
- type InnerSvgRenderOptions = DistributiveOmit<napi.SvgRenderOptions | wasm.SvgRenderOptions, "images">;
55
- type InnerRenderAnimationOptions = DistributiveOmit<napi.RenderAnimationOptions | wasm.RenderAnimationOptions, "images">;
53
+ /** The wrapper-level CSS inputs, replacing the backends' `stylesheets` field. */
54
+ type CssOptions = {
55
+ /** CSS to apply before rendering, one string or a list cascading in order. */
56
+ css?: CssInput | readonly CssInput[];
57
+ /**
58
+ * CSS stylesheets to apply before rendering.
59
+ * @deprecated Use `css` instead. Will be removed in v3.
60
+ */
61
+ stylesheets?: string[];
62
+ };
63
+ type InnerRenderOptions = DistributiveOmit<napi.RenderOptions | wasm.RenderOptions, "images" | "css"> & CssOptions;
64
+ type InnerSvgRenderOptions = DistributiveOmit<napi.SvgRenderOptions | wasm.SvgRenderOptions, "images" | "css"> & CssOptions;
65
+ type InnerRenderAnimationOptions = DistributiveOmit<napi.RenderAnimationOptions | wasm.RenderAnimationOptions, "images" | "css"> & CssOptions;
56
66
  type RenderOptions = Managed<InnerRenderOptions>;
57
67
  type RenderSvgOptions = Managed<InnerSvgRenderOptions>;
58
68
  /** A single animation scene whose content is any renderable input. */
package/dist/response.cjs CHANGED
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_render = require("./render-f5o4nsy9.cjs");
5
+ const require_render = require("./render-C7kRwHMk.cjs");
6
6
  //#region src/response/index.ts
7
7
  const contentTypeMap = {
8
8
  png: "image/png",
@@ -1,4 +1,4 @@
1
- import { a as RenderOptions, i as RenderInput } from "./render-BIupnPO8.cjs";
1
+ import { a as RenderOptions, i as RenderInput } from "./render-DDQRhVd1.cjs";
2
2
  //#region src/response/index.d.ts
3
3
  type ImageResponseResult = Response & {
4
4
  readonly ready: Promise<void>;
@@ -1,4 +1,4 @@
1
- import { a as RenderOptions, i as RenderInput } from "./render-CSv0fCuQ.mjs";
1
+ import { a as RenderOptions, i as RenderInput } from "./render-9RT7wd29.mjs";
2
2
  //#region src/response/index.d.ts
3
3
  type ImageResponseResult = Response & {
4
4
  readonly ready: Promise<void>;
package/dist/response.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { t as render } from "./render-CPSfpCxT.mjs";
1
+ import { t as render } from "./render-BPTOJWUk.mjs";
2
2
  //#region src/response/index.ts
3
3
  const contentTypeMap = {
4
4
  png: "image/png",
@@ -24,7 +24,7 @@ var __copyProps = (to, from, except, desc) => {
24
24
  }
25
25
  return to;
26
26
  };
27
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
27
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
28
28
  value: mod,
29
29
  enumerable: true
30
30
  }) : target, mod));
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_rolldown_runtime = require("../rolldown-runtime-DakpK96I.cjs");
2
+ const require_rolldown_runtime = require("../rolldown-runtime-C0BPl7ul.cjs");
3
3
  let _takumi_rs_wasm = require("@takumi-rs/wasm");
4
4
  _takumi_rs_wasm = require_rolldown_runtime.__toESM(_takumi_rs_wasm, 1);
5
5
  Object.defineProperty(exports, "init", {
@@ -1,4 +1,4 @@
1
- const require_rolldown_runtime = require("./rolldown-runtime-DakpK96I.cjs");
1
+ const require_rolldown_runtime = require("./rolldown-runtime-C0BPl7ul.cjs");
2
2
  let _takumi_rs_wasm = require("@takumi-rs/wasm");
3
3
  _takumi_rs_wasm = require_rolldown_runtime.__toESM(_takumi_rs_wasm, 1);
4
4
  //#region src/backend/wasm-init.ts
@@ -1,5 +1,5 @@
1
- const require_rolldown_runtime = require("./rolldown-runtime-DakpK96I.cjs");
2
- const require_wasm_init = require("./wasm-init-H65IoN11.cjs");
1
+ const require_rolldown_runtime = require("./rolldown-runtime-C0BPl7ul.cjs");
2
+ const require_wasm_init = require("./wasm-init-Dl-su2Ub.cjs");
3
3
  let _takumi_rs_wasm_node = require("@takumi-rs/wasm/node");
4
4
  _takumi_rs_wasm_node = require_rolldown_runtime.__toESM(_takumi_rs_wasm_node, 1);
5
5
  //#region src/backend/wasm-node.ts
package/dist/wasm.cjs CHANGED
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_rolldown_runtime = require("./rolldown-runtime-DakpK96I.cjs");
5
+ const require_rolldown_runtime = require("./rolldown-runtime-C0BPl7ul.cjs");
6
6
  let _takumi_rs_wasm_auto = require("@takumi-rs/wasm/auto");
7
7
  _takumi_rs_wasm_auto = require_rolldown_runtime.__toESM(_takumi_rs_wasm_auto, 1);
8
8
  let _takumi_rs_wasm = require("@takumi-rs/wasm");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "takumi-js",
3
- "version": "2.12.0",
3
+ "version": "2.13.0",
4
4
  "description": "Render OG images from JSX, HTML, and CSS. No headless browser.",
5
5
  "keywords": [
6
6
  "animated-webp",
@@ -238,12 +238,12 @@
238
238
  "publish-lint": "attw --pack . && publint --strict ."
239
239
  },
240
240
  "dependencies": {
241
- "@takumi-rs/core": "2.12.0",
242
- "@takumi-rs/helpers": "2.12.0",
243
- "@takumi-rs/wasm": "2.12.0"
241
+ "@takumi-rs/core": "2.13.0",
242
+ "@takumi-rs/helpers": "2.13.0",
243
+ "@takumi-rs/wasm": "2.13.0"
244
244
  },
245
245
  "devDependencies": {
246
- "@types/bun": "^1.3.14",
246
+ "@types/bun": "^1.4.0",
247
247
  "@types/react": "19.2.18",
248
248
  "react": "^19.2.8",
249
249
  "tsdown": "0.22.14",