@oh-just-another/renderer-svg 0.57.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/CHANGELOG.md +15 -0
- package/LICENSE +21 -0
- package/README.md +41 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/measure-text.d.ts +12 -0
- package/dist/measure-text.d.ts.map +1 -0
- package/dist/measure-text.js +38 -0
- package/dist/measure-text.js.map +1 -0
- package/dist/render-scene-to-svg.d.ts +33 -0
- package/dist/render-scene-to-svg.d.ts.map +1 -0
- package/dist/render-scene-to-svg.js +29 -0
- package/dist/render-scene-to-svg.js.map +1 -0
- package/dist/svg-target.d.ts +89 -0
- package/dist/svg-target.d.ts.map +1 -0
- package/dist/svg-target.js +308 -0
- package/dist/svg-target.js.map +1 -0
- package/package.json +55 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# @oh-just-another/renderer-svg
|
|
2
|
+
|
|
3
|
+
## 0.57.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Version bump just for publishing.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
- @oh-just-another/math@0.57.0
|
|
13
|
+
- @oh-just-another/renderer-core@0.57.0
|
|
14
|
+
- @oh-just-another/scene@0.57.0
|
|
15
|
+
- @oh-just-another/types@0.57.0
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Rustam Garifulin
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# @oh-just-another/renderer-svg
|
|
2
|
+
|
|
3
|
+
Second rendering backend — turns a `Scene` into an SVG-string snapshot. Pure TS, no DOM, runs identically in Node and the browser. Designed for headless rendering, file export (Phase 9), and pixel-parity testing against the Canvas backend.
|
|
4
|
+
|
|
5
|
+
## Quick start
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { renderSceneToSvg } from "@oh-just-another/renderer-svg";
|
|
9
|
+
import { writeFile } from "node:fs/promises";
|
|
10
|
+
|
|
11
|
+
await writeFile("diagram.svg", renderSceneToSvg(scene));
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
For lower-level access — composing several scenes, controlling each draw call — instantiate `SvgTarget` directly and call `renderScene(scene, target)` followed by `target.toSvg()`.
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
import { SvgTarget } from "@oh-just-another/renderer-svg";
|
|
18
|
+
import { installBuiltinRenderers, renderScene } from "@oh-just-another/renderer-core";
|
|
19
|
+
|
|
20
|
+
installBuiltinRenderers();
|
|
21
|
+
const target = new SvgTarget({ width: 800, height: 600 });
|
|
22
|
+
renderScene(scene, target);
|
|
23
|
+
const svg = target.toSvg();
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## API
|
|
27
|
+
|
|
28
|
+
| Name | Purpose |
|
|
29
|
+
| --------------------------------------------- | ------------------------------------------------------------------------------------------------- |
|
|
30
|
+
| `SvgTarget` | `RenderTarget` implementation backed by a string buffer. |
|
|
31
|
+
| `renderSceneToSvg(scene, options?)` | One-shot helper: instantiates `SvgTarget`, runs `renderScene`, returns the SVG string. |
|
|
32
|
+
| `RenderSceneToSvgOptions` | Options: `width`, `height`, `measureText`, `skipInstall`, plus the standard `RenderSceneOptions`. |
|
|
33
|
+
| `approxTextWidth(text, fontFamily, fontSize)` | Char-ratio-based text measurer for environments without a text engine. |
|
|
34
|
+
|
|
35
|
+
## Design notes
|
|
36
|
+
|
|
37
|
+
- **Coordinates are pre-baked into path data.** Every `moveTo` / `lineTo` / `quadraticCurveTo` / `bezierCurveTo` call is multiplied by the current transform before being written. The emitted SVG has no nested `<g transform>` elements — output is flat, smaller, and easier to diff.
|
|
38
|
+
- **Path elements are flushed on `fill()` / `stroke()`.** A single subpath can be both filled and stroked — those emit two `<path>` elements with different paint attributes, mirroring Canvas2D semantics.
|
|
39
|
+
- **`ellipse()` decomposes into 4 cubic Bezier curves** (kappa ≈ 0.5523). SVG's native `<ellipse>` would be more compact, but every other shape goes through `<path>` already; the uniformity is worth the few extra bytes.
|
|
40
|
+
- **Text measurement is pluggable.** Default `approxTextWidth` ratios match a system-ui sans-serif at 16px and are decent for ASCII; pixel-perfect callers supply their own measurer (typically wrapped around `node-canvas` or `opentype.js`).
|
|
41
|
+
- **`clear()` without bounds wipes the element buffer** (matches "erase the surface" semantics); bounded clears emit a white `<rect>` so callers don't have to special-case the backend.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"fileNames":["../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.array.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.object.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../types/dist/vec2.d.ts","../../types/dist/bounds.d.ts","../../types/dist/transform.d.ts","../../types/dist/color.d.ts","../../types/dist/ids.d.ts","../../types/dist/events.d.ts","../../types/dist/index.d.ts","../../math/dist/vec2.d.ts","../../math/dist/matrix.d.ts","../../math/dist/bounds.d.ts","../../math/dist/hit-test.d.ts","../../math/dist/bezier.d.ts","../../math/dist/intersect.d.ts","../../math/dist/color.d.ts","../../math/dist/polygon.d.ts","../../math/dist/index.d.ts","../../renderer-core/dist/render-target.d.ts","../../scene/dist/style.d.ts","../../scene/dist/constants.d.ts","../../../node_modules/.pnpm/fractional-keys@0.1.1/node_modules/fractional-keys/dist/types.d.ts","../../../node_modules/.pnpm/fractional-keys@0.1.1/node_modules/fractional-keys/dist/generate.d.ts","../../../node_modules/.pnpm/fractional-keys@0.1.1/node_modules/fractional-keys/dist/jitter.d.ts","../../../node_modules/.pnpm/fractional-keys@0.1.1/node_modules/fractional-keys/dist/digits.d.ts","../../../node_modules/.pnpm/fractional-keys@0.1.1/node_modules/fractional-keys/dist/errors.d.ts","../../../node_modules/.pnpm/fractional-keys@0.1.1/node_modules/fractional-keys/dist/index.d.ts","../../scene/dist/edge.d.ts","../../scene/dist/shape.d.ts","../../scene/dist/edge-curve.d.ts","../../scene/dist/annotation.d.ts","../../scene/dist/file.d.ts","../../scene/dist/layer.d.ts","../../scene/dist/viewport.d.ts","../../scene/dist/patch.d.ts","../../scene/dist/scene.d.ts","../../scene/dist/edge-geometry.d.ts","../../scene/dist/operations.d.ts","../../scene/dist/render-bounds.d.ts","../../scene/dist/text-measure.d.ts","../../scene/dist/anchors.d.ts","../../scene/dist/snap.d.ts","../../scene/dist/outline.d.ts","../../scene/dist/annotation-geometry.d.ts","../../scene/dist/spatial.d.ts","../../scene/dist/queries.d.ts","../../scene/dist/a11y.d.ts","../../scene/dist/layout.d.ts","../../scene/dist/layout-registry.d.ts","../../scene/dist/elbow-router.d.ts","../../scene/dist/elbow-link.d.ts","../../scene/dist/heading.d.ts","../../scene/dist/diff.d.ts","../../scene/dist/three-way-merge.d.ts","../../scene/dist/container.d.ts","../../scene/dist/index.d.ts","../../renderer-core/dist/shape-renderer.d.ts","../../renderer-core/dist/layers.d.ts","../../renderer-core/dist/shape-cache.d.ts","../../renderer-core/dist/layer-cache-composite.d.ts","../../renderer-core/dist/scene-renderer.d.ts","../../renderer-core/dist/edge-cache.d.ts","../../renderer-core/dist/edge-cache-bitmap.d.ts","../../renderer-core/dist/edge-renderer.d.ts","../../renderer-core/dist/grid-renderer.d.ts","../../renderer-core/dist/built-in-renderers.d.ts","../../renderer-core/dist/text-shaper.d.ts","../../renderer-core/dist/text-layout.d.ts","../../renderer-core/dist/text-editing.d.ts","../../renderer-core/dist/shape-cache-bitmap.d.ts","../../renderer-core/dist/animation-adapter.d.ts","../../renderer-core/dist/rasterizer.d.ts","../../renderer-core/dist/js-rasterizer.d.ts","../../renderer-core/dist/worker-render.d.ts","../../renderer-core/dist/tile-renderer.d.ts","../../renderer-core/dist/constants.d.ts","../../renderer-core/dist/index.d.ts","../src/measure-text.ts","../src/svg-target.ts","../src/render-scene-to-svg.ts","../src/index.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/compatibility/disposable.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/compatibility/indexable.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/compatibility/iterators.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/compatibility/index.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/globals.typedarray.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/buffer.buffer.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/globals.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/web-globals/abortcontroller.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/web-globals/domexception.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/web-globals/events.d.ts","../../../node_modules/.pnpm/buffer@5.7.1/node_modules/buffer/index.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/header.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/readable.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/file.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/fetch.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/formdata.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/connector.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/client.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/errors.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/dispatcher.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/global-dispatcher.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/global-origin.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/pool-stats.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/pool.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/handlers.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/balanced-pool.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/agent.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/mock-interceptor.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/mock-agent.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/mock-client.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/mock-pool.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/mock-errors.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/proxy-agent.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/env-http-proxy-agent.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/retry-handler.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/retry-agent.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/api.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/interceptors.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/util.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/cookies.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/patch.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/websocket.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/eventsource.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/filereader.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/diagnostics-channel.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/content-type.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/cache.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/index.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/web-globals/fetch.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/web-globals/navigator.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/web-globals/storage.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/assert.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/assert/strict.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/async_hooks.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/buffer.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/child_process.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/cluster.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/console.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/constants.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/crypto.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/dgram.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/dns.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/dns/promises.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/domain.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/events.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/fs.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/fs/promises.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/http.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/http2.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/https.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/inspector.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/inspector.generated.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/module.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/net.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/os.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/path.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/process.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/punycode.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/querystring.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/readline.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/readline/promises.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/repl.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/sea.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/sqlite.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/stream.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/stream/promises.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/stream/web.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/string_decoder.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/test.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/timers.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/timers/promises.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/tls.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/trace_events.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/tty.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/url.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/util.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/v8.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/vm.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/wasi.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/worker_threads.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/zlib.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/index.d.ts"],"fileIdsList":[[142,188,189,191,208,209],[142,190,191,208,209],[191,208,209],[142,191,196,208,209,226],[142,191,192,197,202,208,209,211,223,234],[142,191,192,193,202,208,209,211],[142,191,208,209],[137,138,139,142,191,208,209],[142,191,194,208,209,235],[142,191,195,196,203,208,209,212],[142,191,196,208,209,223,231],[142,191,197,199,202,208,209,211],[142,190,191,198,208,209],[142,191,199,200,208,209],[142,191,201,202,208,209],[142,190,191,202,208,209],[142,191,202,203,204,208,209,223,234],[142,191,202,203,204,208,209,218,223,226],[142,184,191,199,202,205,208,209,211,223,234],[142,191,202,203,205,206,208,209,211,223,231,234],[142,191,205,207,208,209,223,231,234],[140,141,142,143,144,145,146,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240],[142,191,202,208,209],[142,191,208,209,210,234],[142,191,199,202,208,209,211,223],[142,191,208,209,212],[142,191,208,209,213],[142,190,191,208,209,214],[142,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240],[142,191,208,209,216],[142,191,208,209,217],[142,191,202,208,209,218,219],[142,191,208,209,218,220,235,237],[142,191,203,208,209],[142,191,202,208,209,223,224,226],[142,191,208,209,225,226],[142,191,208,209,223,224],[142,191,208,209,226],[142,191,208,209,227],[142,188,191,208,209,223,228,234],[142,191,202,208,209,229,230],[142,191,208,209,229,230],[142,191,196,208,209,211,223,231],[142,191,208,209,232],[142,191,208,209,211,233],[142,191,205,208,209,217,234],[142,191,196,208,209,235],[142,191,208,209,223,236],[142,191,208,209,210,237],[142,191,208,209,238],[142,184,191,208,209],[142,184,191,202,204,208,209,214,223,226,234,236,237,239],[142,191,208,209,223,240],[77,142,191,208,209],[77,78,79,80,81,142,191,208,209],[142,156,160,191,208,209,234],[142,156,191,208,209,223,234],[142,151,191,208,209],[142,153,156,191,208,209,231,234],[142,191,208,209,211,231],[142,191,208,209,241],[142,151,191,208,209,241],[142,153,156,191,208,209,211,234],[142,148,149,152,155,191,202,208,209,223,234],[142,156,163,191,208,209],[142,148,154,191,208,209],[142,156,177,178,191,208,209],[142,152,156,191,208,209,226,234,241],[142,177,191,208,209,241],[142,150,151,191,208,209,241],[142,156,191,208,209],[142,150,151,152,153,154,155,156,157,158,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,178,179,180,181,182,183,191,208,209],[142,156,171,191,208,209],[142,156,163,164,191,208,209],[142,154,156,164,165,191,208,209],[142,155,191,208,209],[142,148,151,156,191,208,209],[142,156,160,164,165,191,208,209],[142,160,191,208,209],[142,154,156,159,191,208,209,234],[142,148,153,156,163,191,208,209],[142,191,208,209,223],[142,151,156,177,191,208,209,239,241],[64,142,191,208,209],[65,66,67,68,69,70,71,72,142,191,208,209],[116,142,191,208,209],[111,142,191,208,209],[64,111,142,191,208,209],[64,74,111,117,118,142,191,208,209],[74,111,142,191,208,209],[74,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,142,191,208,209],[127,142,191,208,209],[64,74,111,114,115,142,191,208,209],[74,142,191,208,209],[74,122,142,191,208,209],[133,134,135,142,191,208,209],[111,132,133,134,142,191,208,209],[64,73,132,133,142,191,208,209],[84,142,191,208,209],[64,83,84,142,191,208,209],[64,86,91,142,191,208,209],[64,84,91,142,191,208,209],[64,91,142,191,208,209],[64,83,85,91,142,191,208,209],[64,75,82,142,191,208,209],[64,83,91,142,191,208,209],[64,84,142,191,208,209],[75,76,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,142,191,208,209],[64,82,142,191,208,209],[64,90,91,142,191,208,209],[64,84,90,91,142,191,208,209],[64,83,84,86,88,89,90,91,142,191,208,209],[64,83,84,86,87,88,89,142,191,208,209],[64,83,84,88,91,100,142,191,208,209],[64,82,83,84,86,87,88,89,90,142,191,208,209],[64,75,82,83,142,191,208,209],[58,142,191,208,209],[58,59,60,61,62,63,142,191,208,209]],"fileInfos":[{"version":"c430d44666289dae81f30fa7b2edebf186ecc91a2d4c71266ea6ae76388792e1","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"ee7bad0c15b58988daa84371e0b89d313b762ab83cb5b31b8a2d1162e8eb41c2","impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"fb0f136d372979348d59b3f5020b4cdb81b5504192b1cacff5d1fbba29378aa1","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"a680117f487a4d2f30ea46f1b4b7f58bef1480456e18ba53ee85c2746eeca012","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"959d36cddf5e7d572a65045b876f2956c973a586da58e5d26cde519184fd9b8a","affectsGlobalScope":true,"impliedFormat":1},{"version":"965f36eae237dd74e6cca203a43e9ca801ce38824ead814728a2807b1910117d","affectsGlobalScope":true,"impliedFormat":1},{"version":"3925a6c820dcb1a06506c90b1577db1fdbf7705d65b62b99dce4be75c637e26b","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a3d63ef2b853447ec4f749d3f368ce642264246e02911fcb1590d8c161b8005","affectsGlobalScope":true,"impliedFormat":1},{"version":"8cdf8847677ac7d20486e54dd3fcf09eda95812ac8ace44b4418da1bbbab6eb8","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},"a9dc2e59fb40b94411bd995a0013c15385b99599a18b7141cf3eafd80c7f0f96","4015dc819b09b93f989d4df8f1f0f36cb99cb2aad8102ab8b4b27fb6020beb5f","ed06a7b359e2125c375f6bada6631fd038473dd624309b8a43a824693a6f6c89","46fa0b276ad58dc963c574f72bb9456b881f3d61bc0fe6827c24f3f02baa6038","1f0260dbafda11af88b11f1b6d662ee45517d44c8cc9a7248bd61d2d8ab1f880","502657b9a54e290098ba4f955efa476b91648b24d5310b8c6e7aa0d4cf8945ae","90755de39a18e2894ad3cced6cdf4cb670e09868b01a6f6465af558d865bf848","ebfd3e57d9e7a8b7ae4c5b663c8d2838eaca3b3285a0c637ba8ca517cc2175d3","505847c2f2ca51addcc453c33269991e9173e0aa62289b452c8ab47df42c9d69","f476c7b455d73ec2f6601f601cb25fe4394bc0507b11742ca79b47959bc5f973","dc0ba5853cc4410c20acb0600f50b11c6bf2d1c3d359e2f4fdb544978de9b448","6a77481ec55fb135de07b99035cfe300dcc4c88d835aa3ce53c3238e27945e56","0129e9c0c12e615cdba3f6269bb1fac6f3fbe2c921833af0bc20aec91d1f05f4","bb8c6f2ece97c4e140b70dff14764b74fe9f94126ac9349587c23a7b8d7ad312","ffd7698fd0112628fca684563c8713e9e00d8e1d6ab3434e97118f6b94da38d4","6890123c41eab2722f06e6a9e419772463d1f8cba50b835190fd5d97e9168b1d","799b9bc7d88f13ae6e51415c1e663e685fcbe77164eb2be78b08893d9b299bf0","b8e3c1f3a85e05bcbc56fa28558cffc68ac40e4158afdc2d702ea825ce21d14d","c196961c4aa13e3bf28a7e56ac7fa0b0cbfc668eca4496292d629dd18f43296b",{"version":"bce89d3ef847715b91ffd525a157c779be8fafebe823671815f7ce96f27afcda","impliedFormat":99},{"version":"c67f9d85070618f586d632cf184b986eb604f426b90aa68ecdad1ac68ca3151c","impliedFormat":99},{"version":"c656cc6ded557aff87a6c823142852e3548c6a14f84bb48ee35c3e57b6ebc03b","impliedFormat":99},{"version":"0e34130243c29d8d826f868c4e00ff586b349627cb241b3d89f0459a6cdeff4d","impliedFormat":99},{"version":"d555c6cb465cc5cf8127adbbc496720d5200c9dfafa777bbf9dfdea74ebfe3a3","impliedFormat":99},{"version":"27a6936a863edf777150af3ebc65939fa34f51d68385f8a7f198d8ea53685a4d","impliedFormat":99},"17ee722c53770caad5479081a3db9f0df8135a8f061ea9ce57a507ca0c424cce","78bde316dcb094df77d06b893e0b965d318ac5708d09e7cf6206931263be32e6","d081374b0bf74e2748138e8b0a56458e12e2ee7bd07fb239b92c97a33bba8d70","b85f83aa4b7fb1abc375a73cb706295a146b9f22cf9fa5ec89105fcff6ea1495","fd0cd0a179e95f7d4d5f7370209f6b413006242a045137d33ca230ae015ba760","fa716666e5bedc99e38d37def5182924b9dd9e6298c2751f8cebe0fc631ef697","48280d2635c39dd226b7e5bb71d0519f355b60d4d92e9f6b5b4a427aa28412f8","8bdcd8a58fead736e81808193884907482c8d354f13a0516e9b236a07622c727","8ebfa15cb2e79b885a21ae5f92507b5b9dd9b01041143554903c163f86611849","4233c4d8ac9cb79b3b71e4923eb486f08f5f2c6508fc177192081a402bee38b3","dfa88df7638cc24634255691d0a3fb72a4910b73211da89fab8f2362730cb3b2","75ea946ee4d31489f494b0def56b2db669c3aac052713387d6edc51dc2ca86db","26ce9aa6f798212e39770c45142239f3a54fa63697ba90bae90c6d7ac7da825a","eceda86937454d399a4e4cd4a3e25835a4ac80ab930f399b20f53d8f1c772457","8b12bcaa49f76ee1ce7f77943a297078dba53abedd344da6d370012eab482c07","ebfed381c5296dbb1ebae8265ca08dbce33929fa829f6ac11f2f591beb1f4485","ae557ba7a3d28e8909ac395365eb5f8ff63bc28eb2eaace61650ed51f1bc1808","95784f449b26dbdf4aadd2f99a5c2f6c419d80f993ececa6c0c3e0159b452aa5","89c0f7c64772fcb38eda1e15b26da3e53e4101c968a0eeb14954f154aee4dac1","6e7e44d7615d2899c2dd6be4e15bbb2cd0b7f4afec2379c08db14b9eac5c9b43","a1f5b4a129cd4b8f013533f200baf74615d690c41f1ef2147bd40ef6110c4a1b","d1b901b618ec72bff0fcb657edf03d83e2bcbb2687a9cddadea48a24ab23faf2","9a02cb3cccc3eeb3fea9327c47dbda2076e21f3da7b2eb659871dc91b8572f42","1778dfd35a7d5885896c436792662c8d602ea8cf03aeed97b0381b6e82c4e980","f730ff4577c8d45cb4a587d078ee5b692613c3de57f26a27a4be74c183adc226","60bd456f1b63861f880c386ddf1b3916098bbafbf4b5a46a5e5ebc4fcb9434c4","f2c0b5b634eed4010d9396710281a7fdc7019fe47507e8bcb706a58af985548a","baeb8f9be968778478ffa26099ec4211dd28c6dea1633fd8fd1560c34fdd0269","5df76ca2d799039334a825b621129061b89022808e0943397e045bc6feec894c","9b6e1a724771bd1fb7ea1a2551ed5b13b92d87aeaba331d520716e725d7b63a5","66c6888608b17316a09ede6335f5568748a24af4090990c9cf8050ac8b318c34","e89c865ca4785f4a56fbfe95b04df807ebf6d320b174b484f3a08d54321447a7","403e6bc805dc2cdcbb3f6bb38cf78bd70d4202ebe405178fd8dc917bf84dd124","fcf3b586398c415038922a229576ddc3c9ac81f17113f4564f860b90222fc463","e6a79d0cfe8e75f37a20cb36e05795fa8116c4510a4b3cfc3fa89a427f356b3c","6aee942b8a0c7c10cd2315315b0b88b85daf969ed761cda7d1c045badba8b058","2a113e6e70cb236e8f367e088f0470fe9155b04ea16ce315606095ea7f9a06c1","b505287deeb59270e8d172f30f625adf6e8394c16e68f1caeff1d933fb6a239a","f9bdf17d1b11f604f4c3db96f3ab31d1a5d0e81f95765ba3eaf60069b6892f49","d84043e3d658e5b2fd1351c18cefeeed153fa37c5828c234c2c343e89511ce34","8bfb061a2c3561bd22bdf252a4a32e504cd1cf1af601e377d51fc006104e927d","28bc1aaad7be71d47e0e278e97f43ab7b736e4f042a3c086a239543e7d0f9b24","71441b9d36fd4591e4606665559a533274dc04ebabfa841a45362ef273f2e8ce","2b7e1ab6757e4fed93a787ff649719bc13aaf8607e12c0b3c8c3e8c190d65680","6257c11ddda8274e26d5e46fb41272edddd4a8d6a9686ddd79c86b0f5484ba8f","5f442f7b5b287323065b77d9e991937bc10f974bfd65a0f36d2ccc10bb490a6c","e2467441777ecea9f274b465d652ac217fb76872b2403a2fd049929a57a9e15d","54f06de0591cca133a51d2004cb4d3f6370315e1e1dd6618280524fe91f8a01c","9dae069538bed39f3ffbe84975f1deac55843f229314982ee15a4b8ed4d9a98d","d9579c3abb9e4ed7d64b4619f2732191a1917989e63120156adcbfaff100b001",{"version":"b673892851ad2cad2251d13e1a82b6ee4cd770873e3b23c4c0e7fc507c93a286","signature":"13babdca228d463f6932c6690ce95d18d437713e23ea5ef9a1df024ebf2d9e77"},{"version":"0329eaee102944fcc681b14a786c3b8baf7f69397efee2d66515cdfe5b75e01e","signature":"307e9aab91c66eefa68a2e9d82ba128a7faab0610aa317c93f51d717cd4ac6af"},{"version":"7220ed1e128cd653a22358bdf63922da49c5a2b38d324d912f25e3d4559a29ba","signature":"32ad60ecb714081eb9e5460bf65dc094e4862f43949b4e72bf7ce35ab58f2bfa"},"081dcd50db7b36e603affccae9b91d3430bf310a280faf82191ccd116a9811ad",{"version":"6c7176368037af28cb72f2392010fa1cef295d6d6744bca8cfb54985f3a18c3e","affectsGlobalScope":true,"impliedFormat":1},{"version":"ab41ef1f2cdafb8df48be20cd969d875602483859dc194e9c97c8a576892c052","affectsGlobalScope":true,"impliedFormat":1},{"version":"437e20f2ba32abaeb7985e0afe0002de1917bc74e949ba585e49feba65da6ca1","affectsGlobalScope":true,"impliedFormat":1},{"version":"21d819c173c0cf7cc3ce57c3276e77fd9a8a01d35a06ad87158781515c9a438a","impliedFormat":1},{"version":"98cffbf06d6bab333473c70a893770dbe990783904002c4f1a960447b4b53dca","affectsGlobalScope":true,"impliedFormat":1},{"version":"3af97acf03cc97de58a3a4bc91f8f616408099bc4233f6d0852e72a8ffb91ac9","affectsGlobalScope":true,"impliedFormat":1},{"version":"808069bba06b6768b62fd22429b53362e7af342da4a236ed2d2e1c89fcca3b4a","affectsGlobalScope":true,"impliedFormat":1},{"version":"1db0b7dca579049ca4193d034d835f6bfe73096c73663e5ef9a0b5779939f3d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"9798340ffb0d067d69b1ae5b32faa17ab31b82466a3fc00d8f2f2df0c8554aaa","affectsGlobalScope":true,"impliedFormat":1},{"version":"f26b11d8d8e4b8028f1c7d618b22274c892e4b0ef5b3678a8ccbad85419aef43","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e9c23ba78aabc2e0a27033f18737a6df754067731e69dc5f52823957d60a4b6","impliedFormat":1},{"version":"5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","impliedFormat":1},{"version":"763fe0f42b3d79b440a9b6e51e9ba3f3f91352469c1e4b3b67bfa4ff6352f3f4","impliedFormat":1},{"version":"25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","impliedFormat":1},{"version":"c464d66b20788266e5353b48dc4aa6bc0dc4a707276df1e7152ab0c9ae21fad8","impliedFormat":1},{"version":"78d0d27c130d35c60b5e5566c9f1e5be77caf39804636bc1a40133919a949f21","impliedFormat":1},{"version":"c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","impliedFormat":1},{"version":"1d6e127068ea8e104a912e42fc0a110e2aa5a66a356a917a163e8cf9a65e4a75","impliedFormat":1},{"version":"5ded6427296cdf3b9542de4471d2aa8d3983671d4cac0f4bf9c637208d1ced43","impliedFormat":1},{"version":"7f182617db458e98fc18dfb272d40aa2fff3a353c44a89b2c0ccb3937709bfb5","impliedFormat":1},{"version":"cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","impliedFormat":1},{"version":"385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","impliedFormat":1},{"version":"9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","impliedFormat":1},{"version":"0b8a9268adaf4da35e7fa830c8981cfa22adbbe5b3f6f5ab91f6658899e657a7","impliedFormat":1},{"version":"11396ed8a44c02ab9798b7dca436009f866e8dae3c9c25e8c1fbc396880bf1bb","impliedFormat":1},{"version":"ba7bc87d01492633cb5a0e5da8a4a42a1c86270e7b3d2dea5d156828a84e4882","impliedFormat":1},{"version":"4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","impliedFormat":1},{"version":"c21dc52e277bcfc75fac0436ccb75c204f9e1b3fa5e12729670910639f27343e","impliedFormat":1},{"version":"13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","impliedFormat":1},{"version":"9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","impliedFormat":1},{"version":"4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","impliedFormat":1},{"version":"24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","impliedFormat":1},{"version":"ea0148f897b45a76544ae179784c95af1bd6721b8610af9ffa467a518a086a43","impliedFormat":1},{"version":"24c6a117721e606c9984335f71711877293a9651e44f59f3d21c1ea0856f9cc9","impliedFormat":1},{"version":"dd3273ead9fbde62a72949c97dbec2247ea08e0c6952e701a483d74ef92d6a17","impliedFormat":1},{"version":"405822be75ad3e4d162e07439bac80c6bcc6dbae1929e179cf467ec0b9ee4e2e","impliedFormat":1},{"version":"0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","impliedFormat":1},{"version":"e61be3f894b41b7baa1fbd6a66893f2579bfad01d208b4ff61daef21493ef0a8","impliedFormat":1},{"version":"bd0532fd6556073727d28da0edfd1736417a3f9f394877b6d5ef6ad88fba1d1a","impliedFormat":1},{"version":"89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","impliedFormat":1},{"version":"615ba88d0128ed16bf83ef8ccbb6aff05c3ee2db1cc0f89ab50a4939bfc1943f","impliedFormat":1},{"version":"a4d551dbf8746780194d550c88f26cf937caf8d56f102969a110cfaed4b06656","impliedFormat":1},{"version":"8bd86b8e8f6a6aa6c49b71e14c4ffe1211a0e97c80f08d2c8cc98838006e4b88","impliedFormat":1},{"version":"317e63deeb21ac07f3992f5b50cdca8338f10acd4fbb7257ebf56735bf52ab00","impliedFormat":1},{"version":"4732aec92b20fb28c5fe9ad99521fb59974289ed1e45aecb282616202184064f","impliedFormat":1},{"version":"2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","impliedFormat":1},{"version":"c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","impliedFormat":1},{"version":"bf67d53d168abc1298888693338cb82854bdb2e69ef83f8a0092093c2d562107","impliedFormat":1},{"version":"b52476feb4a0cbcb25e5931b930fc73cb6643fb1a5060bf8a3dda0eeae5b4b68","affectsGlobalScope":true,"impliedFormat":1},{"version":"f9501cc13ce624c72b61f12b3963e84fad210fbdf0ffbc4590e08460a3f04eba","affectsGlobalScope":true,"impliedFormat":1},{"version":"e7721c4f69f93c91360c26a0a84ee885997d748237ef78ef665b153e622b36c1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0fa06ada475b910e2106c98c68b10483dc8811d0c14a8a8dd36efb2672485b29","impliedFormat":1},{"version":"33e5e9aba62c3193d10d1d33ae1fa75c46a1171cf76fef750777377d53b0303f","impliedFormat":1},{"version":"2b06b93fd01bcd49d1a6bd1f9b65ddcae6480b9a86e9061634d6f8e354c1468f","impliedFormat":1},{"version":"6a0cd27e5dc2cfbe039e731cf879d12b0e2dded06d1b1dedad07f7712de0d7f4","affectsGlobalScope":true,"impliedFormat":1},{"version":"13f5c844119c43e51ce777c509267f14d6aaf31eafb2c2b002ca35584cd13b29","impliedFormat":1},{"version":"e60477649d6ad21542bd2dc7e3d9ff6853d0797ba9f689ba2f6653818999c264","impliedFormat":1},{"version":"c2510f124c0293ab80b1777c44d80f812b75612f297b9857406468c0f4dafe29","affectsGlobalScope":true,"impliedFormat":1},{"version":"5524481e56c48ff486f42926778c0a3cce1cc85dc46683b92b1271865bcf015a","impliedFormat":1},{"version":"4c829ab315f57c5442c6667b53769975acbf92003a66aef19bce151987675bd1","affectsGlobalScope":true,"impliedFormat":1},{"version":"b2ade7657e2db96d18315694789eff2ddd3d8aea7215b181f8a0b303277cc579","impliedFormat":1},{"version":"9855e02d837744303391e5623a531734443a5f8e6e8755e018c41d63ad797db2","impliedFormat":1},{"version":"4d631b81fa2f07a0e63a9a143d6a82c25c5f051298651a9b69176ba28930756d","impliedFormat":1},{"version":"836a356aae992ff3c28a0212e3eabcb76dd4b0cc06bcb9607aeef560661b860d","impliedFormat":1},{"version":"1e0d1f8b0adfa0b0330e028c7941b5a98c08b600efe7f14d2d2a00854fb2f393","impliedFormat":1},{"version":"41670ee38943d9cbb4924e436f56fc19ee94232bc96108562de1a734af20dc2c","affectsGlobalScope":true,"impliedFormat":1},{"version":"c906fb15bd2aabc9ed1e3f44eb6a8661199d6c320b3aa196b826121552cb3695","impliedFormat":1},{"version":"22295e8103f1d6d8ea4b5d6211e43421fe4564e34d0dd8e09e520e452d89e659","impliedFormat":1},{"version":"58647d85d0f722a1ce9de50955df60a7489f0593bf1a7015521efe901c06d770","impliedFormat":1},{"version":"73b5fa37db36eeac90c4d752e39586f1b57187400c4f5280fd05f16437287a45","impliedFormat":1},{"version":"a10f0e1854f3316d7ee437b79649e5a6ae3ae14ffe6322b02d4987071a95362e","impliedFormat":1},{"version":"e208f73ef6a980104304b0d2ca5f6bf1b85de6009d2c7e404028b875020fa8f2","impliedFormat":1},{"version":"d163b6bc2372b4f07260747cbc6c0a6405ab3fbcea3852305e98ac43ca59f5bc","impliedFormat":1},{"version":"e6fa9ad47c5f71ff733744a029d1dc472c618de53804eae08ffc243b936f87ff","affectsGlobalScope":true,"impliedFormat":1},{"version":"a6f137d651076822d4fe884287e68fd61785a0d3d1fdb250a5059b691fa897db","impliedFormat":1},{"version":"24826ed94a78d5c64bd857570fdbd96229ad41b5cb654c08d75a9845e3ab7dde","impliedFormat":1},{"version":"8b479a130ccb62e98f11f136d3ac80f2984fdc07616516d29881f3061f2dd472","impliedFormat":1},{"version":"928af3d90454bf656a52a48679f199f64c1435247d6189d1caf4c68f2eaf921f","affectsGlobalScope":true,"impliedFormat":1},{"version":"bceb58df66ab8fb00170df20cd813978c5ab84be1d285710c4eb005d8e9d8efb","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f16a7e4deafa527ed9995a772bb380eb7d3c2c0fd4ae178c5263ed18394db2c","impliedFormat":1},{"version":"933921f0bb0ec12ef45d1062a1fc0f27635318f4d294e4d99de9a5493e618ca2","impliedFormat":1},{"version":"71a0f3ad612c123b57239a7749770017ecfe6b66411488000aba83e4546fde25","impliedFormat":1},{"version":"77fbe5eecb6fac4b6242bbf6eebfc43e98ce5ccba8fa44e0ef6a95c945ff4d98","impliedFormat":1},{"version":"4f9d8ca0c417b67b69eeb54c7ca1bedd7b56034bb9bfd27c5d4f3bc4692daca7","impliedFormat":1},{"version":"814118df420c4e38fe5ae1b9a3bafb6e9c2aa40838e528cde908381867be6466","impliedFormat":1},{"version":"a3fc63c0d7b031693f665f5494412ba4b551fe644ededccc0ab5922401079c95","impliedFormat":1},{"version":"80523c00b8544a2000ae0143e4a90a00b47f99823eb7926c1e03c494216fc363","impliedFormat":1},{"version":"37ba7b45141a45ce6e80e66f2a96c8a5ab1bcef0fc2d0f56bb58df96ec67e972","impliedFormat":1},{"version":"45650f47bfb376c8a8ed39d4bcda5902ab899a3150029684ee4c10676d9fbaee","impliedFormat":1},{"version":"746911b62b329587939560deb5c036aca48aece03147b021fa680223255d5183","affectsGlobalScope":true,"impliedFormat":1},{"version":"18fd40412d102c5564136f29735e5d1c3b455b8a37f920da79561f1fde068208","impliedFormat":1},{"version":"c8d3e5a18ba35629954e48c4cc8f11dc88224650067a172685c736b27a34a4dc","impliedFormat":1},{"version":"f0be1b8078cd549d91f37c30c222c2a187ac1cf981d994fb476a1adc61387b14","affectsGlobalScope":true,"impliedFormat":1},{"version":"0aaed1d72199b01234152f7a60046bc947f1f37d78d182e9ae09c4289e06a592","impliedFormat":1},{"version":"2b55d426ff2b9087485e52ac4bc7cfafe1dc420fc76dad926cd46526567c501a","impliedFormat":1},{"version":"66ba1b2c3e3a3644a1011cd530fb444a96b1b2dfe2f5e837a002d41a1a799e60","impliedFormat":1},{"version":"7e514f5b852fdbc166b539fdd1f4e9114f29911592a5eb10a94bb3a13ccac3c4","impliedFormat":1},{"version":"5b7aa3c4c1a5d81b411e8cb302b45507fea9358d3569196b27eb1a27ae3a90ef","affectsGlobalScope":true,"impliedFormat":1},{"version":"5987a903da92c7462e0b35704ce7da94d7fdc4b89a984871c0e2b87a8aae9e69","affectsGlobalScope":true,"impliedFormat":1},{"version":"ea08a0345023ade2b47fbff5a76d0d0ed8bff10bc9d22b83f40858a8e941501c","impliedFormat":1},{"version":"47613031a5a31510831304405af561b0ffaedb734437c595256bb61a90f9311b","impliedFormat":1},{"version":"ae062ce7d9510060c5d7e7952ae379224fb3f8f2dd74e88959878af2057c143b","impliedFormat":1},{"version":"8a1a0d0a4a06a8d278947fcb66bf684f117bf147f89b06e50662d79a53be3e9f","affectsGlobalScope":true,"impliedFormat":1},{"version":"358765d5ea8afd285d4fd1532e78b88273f18cb3f87403a9b16fef61ac9fdcfe","impliedFormat":1},{"version":"9f55299850d4f0921e79b6bf344b47c420ce0f507b9dcf593e532b09ea7eeea1","impliedFormat":1}],"root":[[133,136]],"options":{"allowSyntheticDefaultImports":true,"composite":true,"declaration":true,"declarationMap":true,"esModuleInterop":true,"exactOptionalPropertyTypes":true,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitOverride":true,"noPropertyAccessFromIndexSignature":false,"noUncheckedIndexedAccess":true,"outDir":"./","rootDir":"../src","skipLibCheck":true,"sourceMap":true,"strict":true,"target":9,"tsBuildInfoFile":"./.tsbuildinfo","verbatimModuleSyntax":true},"referencedMap":[[188,1],[189,1],[190,2],[142,3],[191,4],[192,5],[193,6],[137,7],[140,8],[138,7],[139,7],[194,9],[195,10],[196,11],[197,12],[198,13],[199,14],[200,14],[201,15],[202,16],[203,17],[204,18],[143,7],[141,7],[205,19],[206,20],[207,21],[241,22],[208,23],[209,7],[210,24],[211,25],[212,26],[213,27],[214,28],[215,29],[216,30],[217,31],[218,32],[219,32],[220,33],[221,7],[222,34],[223,35],[225,36],[224,37],[226,38],[227,39],[228,40],[229,41],[230,42],[231,43],[232,44],[233,45],[234,46],[235,47],[236,48],[237,49],[238,50],[144,7],[145,7],[146,7],[185,51],[186,7],[187,7],[239,52],[240,53],[147,7],[80,7],[81,7],[78,54],[82,55],[79,54],[77,7],[56,7],[57,7],[11,7],[10,7],[2,7],[12,7],[13,7],[14,7],[15,7],[16,7],[17,7],[18,7],[19,7],[3,7],[20,7],[21,7],[4,7],[22,7],[26,7],[23,7],[24,7],[25,7],[27,7],[28,7],[29,7],[5,7],[30,7],[31,7],[32,7],[33,7],[6,7],[37,7],[34,7],[35,7],[36,7],[38,7],[7,7],[39,7],[44,7],[45,7],[40,7],[41,7],[42,7],[43,7],[8,7],[49,7],[46,7],[47,7],[48,7],[50,7],[9,7],[51,7],[52,7],[53,7],[55,7],[54,7],[1,7],[163,56],[173,57],[162,56],[183,58],[154,59],[153,60],[182,61],[176,62],[181,63],[156,64],[170,65],[155,66],[179,67],[151,68],[150,61],[180,69],[152,70],[157,71],[158,7],[161,71],[148,7],[184,72],[174,73],[165,74],[166,75],[168,76],[164,77],[167,78],[177,61],[159,79],[160,80],[169,81],[149,82],[172,73],[171,71],[175,7],[178,83],[69,84],[67,84],[71,84],[68,84],[73,85],[70,84],[66,84],[72,84],[65,84],[126,7],[121,7],[131,86],[118,87],[117,88],[119,89],[120,90],[132,91],[128,92],[115,84],[113,7],[127,88],[74,84],[116,93],[125,87],[114,88],[112,90],[124,94],[123,95],[122,94],[130,84],[129,88],[136,96],[133,7],[135,97],[134,98],[102,99],[96,100],[99,101],[86,84],[76,7],[110,102],[108,103],[85,84],[92,104],[83,105],[106,106],[105,84],[87,84],[107,107],[111,108],[88,109],[104,110],[103,111],[93,112],[98,107],[90,113],[101,114],[94,107],[91,115],[84,116],[97,103],[100,84],[75,84],[95,7],[109,102],[89,84],[59,7],[61,7],[63,117],[62,7],[64,118],[60,7],[58,7]],"latestChangedDtsFile":"./index.d.ts","version":"5.9.3"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,KAAK,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAC1F,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAgC,MAAM,0BAA0B,CAAC;AAC1F,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Backend-agnostic text measurer for environments without a real text engine
|
|
3
|
+
* (Node.js, headless rendering). Approximates glyph widths from a small
|
|
4
|
+
* char-width table; precision is "good enough" for layout — not for exact
|
|
5
|
+
* baseline metrics.
|
|
6
|
+
*
|
|
7
|
+
* For pixel-perfect text the caller can supply a custom `measureText` to
|
|
8
|
+
* `SvgTarget`. The default behaves like Canvas2D's `measureText` would for
|
|
9
|
+
* a system-ui font at the given size.
|
|
10
|
+
*/
|
|
11
|
+
export declare const approxTextWidth: (text: string, _fontFamily: string, fontSize: number) => number;
|
|
12
|
+
//# sourceMappingURL=measure-text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"measure-text.d.ts","sourceRoot":"","sources":["../src/measure-text.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAwBH,eAAO,MAAM,eAAe,GAAI,MAAM,MAAM,EAAE,aAAa,MAAM,EAAE,UAAU,MAAM,KAAG,MAMrF,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Backend-agnostic text measurer for environments without a real text engine
|
|
3
|
+
* (Node.js, headless rendering). Approximates glyph widths from a small
|
|
4
|
+
* char-width table; precision is "good enough" for layout — not for exact
|
|
5
|
+
* baseline metrics.
|
|
6
|
+
*
|
|
7
|
+
* For pixel-perfect text the caller can supply a custom `measureText` to
|
|
8
|
+
* `SvgTarget`. The default behaves like Canvas2D's `measureText` would for
|
|
9
|
+
* a system-ui font at the given size.
|
|
10
|
+
*/
|
|
11
|
+
// Per-glyph width ratios as a fraction of font-size. Calibrated against a
|
|
12
|
+
// system-ui sans-serif at 16px; broadly accurate for ASCII.
|
|
13
|
+
const CHAR_RATIOS = {
|
|
14
|
+
// Narrow
|
|
15
|
+
i: 0.28,
|
|
16
|
+
l: 0.28,
|
|
17
|
+
I: 0.34,
|
|
18
|
+
t: 0.34,
|
|
19
|
+
f: 0.36,
|
|
20
|
+
j: 0.3,
|
|
21
|
+
r: 0.4,
|
|
22
|
+
" ": 0.3,
|
|
23
|
+
// Wide
|
|
24
|
+
m: 0.86,
|
|
25
|
+
w: 0.82,
|
|
26
|
+
M: 0.86,
|
|
27
|
+
W: 0.92,
|
|
28
|
+
// Default ~0.55 (handled below)
|
|
29
|
+
};
|
|
30
|
+
const DEFAULT_RATIO = 0.55;
|
|
31
|
+
export const approxTextWidth = (text, _fontFamily, fontSize) => {
|
|
32
|
+
let total = 0;
|
|
33
|
+
for (const ch of text) {
|
|
34
|
+
total += (CHAR_RATIOS[ch] ?? DEFAULT_RATIO) * fontSize;
|
|
35
|
+
}
|
|
36
|
+
return total;
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=measure-text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"measure-text.js","sourceRoot":"","sources":["../src/measure-text.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,0EAA0E;AAC1E,4DAA4D;AAC5D,MAAM,WAAW,GAA2B;IAC1C,SAAS;IACT,CAAC,EAAE,IAAI;IACP,CAAC,EAAE,IAAI;IACP,CAAC,EAAE,IAAI;IACP,CAAC,EAAE,IAAI;IACP,CAAC,EAAE,IAAI;IACP,CAAC,EAAE,GAAG;IACN,CAAC,EAAE,GAAG;IACN,GAAG,EAAE,GAAG;IACR,OAAO;IACP,CAAC,EAAE,IAAI;IACP,CAAC,EAAE,IAAI;IACP,CAAC,EAAE,IAAI;IACP,CAAC,EAAE,IAAI;IACP,gCAAgC;CACjC,CAAC;AAEF,MAAM,aAAa,GAAG,IAAI,CAAC;AAE3B,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,IAAY,EAAE,WAAmB,EAAE,QAAgB,EAAU,EAAE;IAC7F,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,EAAE,IAAI,IAAI,EAAE,CAAC;QACtB,KAAK,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,IAAI,aAAa,CAAC,GAAG,QAAQ,CAAC;IACzD,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type RenderSceneOptions } from "@oh-just-another/renderer-core";
|
|
2
|
+
import type { Scene } from "@oh-just-another/scene";
|
|
3
|
+
import type { approxTextWidth } from "./measure-text.js";
|
|
4
|
+
export interface RenderSceneToSvgOptions extends RenderSceneOptions {
|
|
5
|
+
/**
|
|
6
|
+
* Output canvas size in CSS pixels. Defaults to the scene viewport's
|
|
7
|
+
* `size`, which is what most callers want.
|
|
8
|
+
*/
|
|
9
|
+
readonly width?: number;
|
|
10
|
+
readonly height?: number;
|
|
11
|
+
/** Text measurer; defaults to `approxTextWidth`. */
|
|
12
|
+
readonly measureText?: typeof approxTextWidth;
|
|
13
|
+
/**
|
|
14
|
+
* Skip the implicit `installBuiltinRenderers()` call. Defaults to `false`.
|
|
15
|
+
* Set this when you've already registered every shape renderer you need
|
|
16
|
+
* (including plugin types) and don't want the kernel to overwrite them.
|
|
17
|
+
*/
|
|
18
|
+
readonly skipInstall?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* One-shot helper: render a `Scene` into an SVG document string.
|
|
22
|
+
*
|
|
23
|
+
* ```ts
|
|
24
|
+
* import { renderSceneToSvg } from "@oh-just-another/renderer-svg";
|
|
25
|
+
* await writeFile("out.svg", renderSceneToSvg(scene));
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* For lower-level access — e.g. composing multiple scenes onto the same
|
|
29
|
+
* surface or controlling each draw call — instantiate `SvgTarget` directly
|
|
30
|
+
* and call `renderScene(scene, target, …)` followed by `target.toSvg()`.
|
|
31
|
+
*/
|
|
32
|
+
export declare const renderSceneToSvg: (scene: Scene, options?: RenderSceneToSvgOptions) => string;
|
|
33
|
+
//# sourceMappingURL=render-scene-to-svg.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-scene-to-svg.d.ts","sourceRoot":"","sources":["../src/render-scene-to-svg.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,kBAAkB,EACxB,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAEpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD,MAAM,WAAW,uBAAwB,SAAQ,kBAAkB;IACjE;;;OAGG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,oDAAoD;IACpD,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,eAAe,CAAC;IAC9C;;;;OAIG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;CAChC;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,gBAAgB,GAAI,OAAO,KAAK,EAAE,UAAS,uBAA4B,KAAG,MActF,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { installBuiltinRenderers, renderLinks, renderScene, } from "@oh-just-another/renderer-core";
|
|
2
|
+
import { SvgTarget } from "./svg-target.js";
|
|
3
|
+
/**
|
|
4
|
+
* One-shot helper: render a `Scene` into an SVG document string.
|
|
5
|
+
*
|
|
6
|
+
* ```ts
|
|
7
|
+
* import { renderSceneToSvg } from "@oh-just-another/renderer-svg";
|
|
8
|
+
* await writeFile("out.svg", renderSceneToSvg(scene));
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
* For lower-level access — e.g. composing multiple scenes onto the same
|
|
12
|
+
* surface or controlling each draw call — instantiate `SvgTarget` directly
|
|
13
|
+
* and call `renderScene(scene, target, …)` followed by `target.toSvg()`.
|
|
14
|
+
*/
|
|
15
|
+
export const renderSceneToSvg = (scene, options = {}) => {
|
|
16
|
+
if (!options.skipInstall)
|
|
17
|
+
installBuiltinRenderers();
|
|
18
|
+
const width = options.width ?? scene.viewport.size.width;
|
|
19
|
+
const height = options.height ?? scene.viewport.size.height;
|
|
20
|
+
const target = new SvgTarget({
|
|
21
|
+
width,
|
|
22
|
+
height,
|
|
23
|
+
...(options.measureText ? { measureText: options.measureText } : {}),
|
|
24
|
+
});
|
|
25
|
+
renderScene(scene, target, options);
|
|
26
|
+
renderLinks(scene, target);
|
|
27
|
+
return target.toSvg();
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=render-scene-to-svg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-scene-to-svg.js","sourceRoot":"","sources":["../src/render-scene-to-svg.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,WAAW,EACX,WAAW,GAEZ,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAoB5C;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAAY,EAAE,UAAmC,EAAE,EAAU,EAAE;IAC9F,IAAI,CAAC,OAAO,CAAC,WAAW;QAAE,uBAAuB,EAAE,CAAC;IAEpD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;IACzD,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC;IAC5D,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;QAC3B,KAAK;QACL,MAAM;QACN,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACrE,CAAC,CAAC;IAEH,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,WAAW,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC3B,OAAO,MAAM,CAAC,KAAK,EAAE,CAAC;AACxB,CAAC,CAAC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type { Bounds, Color, Transform } from "@oh-just-another/types";
|
|
2
|
+
import type { FillRule, LineCap, LineJoin, RenderTarget, TextAlign, TextBaseline } from "@oh-just-another/renderer-core";
|
|
3
|
+
/**
|
|
4
|
+
* `RenderTarget` implementation that builds an SVG-string snapshot of the
|
|
5
|
+
* scene. No DOM is touched, so it runs identically in Node and the browser.
|
|
6
|
+
*
|
|
7
|
+
* - Coordinates are pre-baked into the path data: every `moveTo` / `lineTo` is
|
|
8
|
+
* multiplied by the current transform before being written, so the emitted
|
|
9
|
+
* SVG has no nested `<g transform>` elements.
|
|
10
|
+
* - Path elements are flushed on `fill()` / `stroke()`. Multiple fills or
|
|
11
|
+
* strokes against the same subpath emit duplicate `<path>` elements with
|
|
12
|
+
* different paint attributes, matching Canvas2D semantics.
|
|
13
|
+
* - `clear()` resets the element list when called without bounds; bounded
|
|
14
|
+
* clears emit a white-filled rectangle.
|
|
15
|
+
*/
|
|
16
|
+
export declare class SvgTarget implements RenderTarget {
|
|
17
|
+
readonly size: {
|
|
18
|
+
readonly width: number;
|
|
19
|
+
readonly height: number;
|
|
20
|
+
};
|
|
21
|
+
/** Optional custom measurer; defaults to the char-ratio approximation. */
|
|
22
|
+
private readonly measure;
|
|
23
|
+
private fillColor;
|
|
24
|
+
private strokeColor;
|
|
25
|
+
private strokeWidth;
|
|
26
|
+
private opacity;
|
|
27
|
+
private lineCap;
|
|
28
|
+
private lineJoin;
|
|
29
|
+
private dashArray;
|
|
30
|
+
private fontFamily;
|
|
31
|
+
private fontSize;
|
|
32
|
+
private fontWeight;
|
|
33
|
+
private fontStyle;
|
|
34
|
+
private textAlign;
|
|
35
|
+
private textBaseline;
|
|
36
|
+
private currentTransform;
|
|
37
|
+
private pathSegments;
|
|
38
|
+
private pathCursor;
|
|
39
|
+
private readonly elements;
|
|
40
|
+
private readonly stack;
|
|
41
|
+
constructor(options: {
|
|
42
|
+
width: number;
|
|
43
|
+
height: number;
|
|
44
|
+
measureText?: (text: string, fontFamily: string, fontSize: number) => number;
|
|
45
|
+
});
|
|
46
|
+
/**
|
|
47
|
+
* Serialise the accumulated drawing into a self-contained SVG document
|
|
48
|
+
* string. Safe to call multiple times.
|
|
49
|
+
*/
|
|
50
|
+
toSvg(): string;
|
|
51
|
+
setFill(color: Color | null): void;
|
|
52
|
+
setStroke(color: Color | null): void;
|
|
53
|
+
setStrokeWidth(width: number): void;
|
|
54
|
+
setOpacity(alpha: number): void;
|
|
55
|
+
setLineCap(cap: LineCap): void;
|
|
56
|
+
setLineJoin(join: LineJoin): void;
|
|
57
|
+
setDashArray(dash: readonly number[] | null): void;
|
|
58
|
+
setFont(fontFamily: string, fontSize: number, options?: {
|
|
59
|
+
weight?: "normal" | "bold";
|
|
60
|
+
style?: "normal" | "italic";
|
|
61
|
+
}): void;
|
|
62
|
+
setTextAlign(align: TextAlign): void;
|
|
63
|
+
setTextBaseline(baseline: TextBaseline): void;
|
|
64
|
+
save(): void;
|
|
65
|
+
restore(): void;
|
|
66
|
+
translate(dx: number, dy: number): void;
|
|
67
|
+
rotate(radians: number): void;
|
|
68
|
+
scale(sx: number, sy: number): void;
|
|
69
|
+
setTransform(t: Transform): void;
|
|
70
|
+
resetTransform(): void;
|
|
71
|
+
beginPath(): void;
|
|
72
|
+
closePath(): void;
|
|
73
|
+
moveTo(x: number, y: number): void;
|
|
74
|
+
lineTo(x: number, y: number): void;
|
|
75
|
+
quadraticCurveTo(cx: number, cy: number, x: number, y: number): void;
|
|
76
|
+
bezierCurveTo(c1x: number, c1y: number, c2x: number, c2y: number, x: number, y: number): void;
|
|
77
|
+
rect(x: number, y: number, width: number, height: number): void;
|
|
78
|
+
ellipse(cx: number, cy: number, rx: number, ry: number): void;
|
|
79
|
+
fill(rule?: FillRule): void;
|
|
80
|
+
stroke(): void;
|
|
81
|
+
fillText(text: string, x: number, y: number, maxWidth?: number): void;
|
|
82
|
+
measureText(text: string): {
|
|
83
|
+
width: number;
|
|
84
|
+
};
|
|
85
|
+
drawImage(image: unknown, dx: number, dy: number, dw: number, dh: number): void;
|
|
86
|
+
clear(bounds?: Bounds): void;
|
|
87
|
+
private apply;
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=svg-target.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svg-target.d.ts","sourceRoot":"","sources":["../src/svg-target.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAQ,MAAM,wBAAwB,CAAC;AAE7E,OAAO,KAAK,EACV,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,YAAY,EACb,MAAM,gCAAgC,CAAC;AAGxC;;;;;;;;;;;;GAYG;AACH,qBAAa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AE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI;IAU7F,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAU/D,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI;IAe7D,IAAI,CAAC,IAAI,GAAE,QAAoB,GAAG,IAAI;IActC,MAAM,IAAI,IAAI;IAyBd,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI;IA+BrE,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE;IAM5C,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI;IAa/E,KAAK,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;IAoB5B,OAAO,CAAC,KAAK;CAGd"}
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
import { matrix } from "@oh-just-another/math";
|
|
2
|
+
import { approxTextWidth } from "./measure-text.js";
|
|
3
|
+
/**
|
|
4
|
+
* `RenderTarget` implementation that builds an SVG-string snapshot of the
|
|
5
|
+
* scene. No DOM is touched, so it runs identically in Node and the browser.
|
|
6
|
+
*
|
|
7
|
+
* - Coordinates are pre-baked into the path data: every `moveTo` / `lineTo` is
|
|
8
|
+
* multiplied by the current transform before being written, so the emitted
|
|
9
|
+
* SVG has no nested `<g transform>` elements.
|
|
10
|
+
* - Path elements are flushed on `fill()` / `stroke()`. Multiple fills or
|
|
11
|
+
* strokes against the same subpath emit duplicate `<path>` elements with
|
|
12
|
+
* different paint attributes, matching Canvas2D semantics.
|
|
13
|
+
* - `clear()` resets the element list when called without bounds; bounded
|
|
14
|
+
* clears emit a white-filled rectangle.
|
|
15
|
+
*/
|
|
16
|
+
export class SvgTarget {
|
|
17
|
+
size;
|
|
18
|
+
/** Optional custom measurer; defaults to the char-ratio approximation. */
|
|
19
|
+
measure;
|
|
20
|
+
// --- Style state ---
|
|
21
|
+
fillColor = null;
|
|
22
|
+
strokeColor = null;
|
|
23
|
+
strokeWidth = 1;
|
|
24
|
+
opacity = 1;
|
|
25
|
+
lineCap = "butt";
|
|
26
|
+
lineJoin = "miter";
|
|
27
|
+
dashArray = null;
|
|
28
|
+
fontFamily = "system-ui, sans-serif";
|
|
29
|
+
fontSize = 14;
|
|
30
|
+
fontWeight = "normal";
|
|
31
|
+
fontStyle = "normal";
|
|
32
|
+
textAlign = "left";
|
|
33
|
+
textBaseline = "top";
|
|
34
|
+
// --- Transform state ---
|
|
35
|
+
currentTransform = matrix.IDENTITY;
|
|
36
|
+
// --- Path buffer ---
|
|
37
|
+
pathSegments = [];
|
|
38
|
+
pathCursor = null;
|
|
39
|
+
// --- Output ---
|
|
40
|
+
elements = [];
|
|
41
|
+
// --- State stack ---
|
|
42
|
+
stack = [];
|
|
43
|
+
constructor(options) {
|
|
44
|
+
this.size = { width: options.width, height: options.height };
|
|
45
|
+
this.measure = options.measureText ?? approxTextWidth;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Serialise the accumulated drawing into a self-contained SVG document
|
|
49
|
+
* string. Safe to call multiple times.
|
|
50
|
+
*/
|
|
51
|
+
toSvg() {
|
|
52
|
+
const w = this.size.width;
|
|
53
|
+
const h = this.size.height;
|
|
54
|
+
return (`<svg xmlns="http://www.w3.org/2000/svg" width="${w}" height="${h}" viewBox="0 0 ${w} ${h}">` +
|
|
55
|
+
this.elements.join("") +
|
|
56
|
+
`</svg>`);
|
|
57
|
+
}
|
|
58
|
+
// --- Style ---
|
|
59
|
+
setFill(color) {
|
|
60
|
+
this.fillColor = color;
|
|
61
|
+
}
|
|
62
|
+
setStroke(color) {
|
|
63
|
+
this.strokeColor = color;
|
|
64
|
+
}
|
|
65
|
+
setStrokeWidth(width) {
|
|
66
|
+
this.strokeWidth = width;
|
|
67
|
+
}
|
|
68
|
+
setOpacity(alpha) {
|
|
69
|
+
this.opacity = alpha;
|
|
70
|
+
}
|
|
71
|
+
setLineCap(cap) {
|
|
72
|
+
this.lineCap = cap;
|
|
73
|
+
}
|
|
74
|
+
setLineJoin(join) {
|
|
75
|
+
this.lineJoin = join;
|
|
76
|
+
}
|
|
77
|
+
setDashArray(dash) {
|
|
78
|
+
this.dashArray = dash;
|
|
79
|
+
}
|
|
80
|
+
setFont(fontFamily, fontSize, options) {
|
|
81
|
+
this.fontFamily = fontFamily;
|
|
82
|
+
this.fontSize = fontSize;
|
|
83
|
+
this.fontWeight = options?.weight ?? "normal";
|
|
84
|
+
this.fontStyle = options?.style ?? "normal";
|
|
85
|
+
}
|
|
86
|
+
setTextAlign(align) {
|
|
87
|
+
this.textAlign = align;
|
|
88
|
+
}
|
|
89
|
+
setTextBaseline(baseline) {
|
|
90
|
+
this.textBaseline = baseline;
|
|
91
|
+
}
|
|
92
|
+
// --- State stack ---
|
|
93
|
+
save() {
|
|
94
|
+
this.stack.push({
|
|
95
|
+
fillColor: this.fillColor,
|
|
96
|
+
strokeColor: this.strokeColor,
|
|
97
|
+
strokeWidth: this.strokeWidth,
|
|
98
|
+
opacity: this.opacity,
|
|
99
|
+
lineCap: this.lineCap,
|
|
100
|
+
lineJoin: this.lineJoin,
|
|
101
|
+
dashArray: this.dashArray,
|
|
102
|
+
fontFamily: this.fontFamily,
|
|
103
|
+
fontSize: this.fontSize,
|
|
104
|
+
fontWeight: this.fontWeight,
|
|
105
|
+
fontStyle: this.fontStyle,
|
|
106
|
+
textAlign: this.textAlign,
|
|
107
|
+
textBaseline: this.textBaseline,
|
|
108
|
+
transform: this.currentTransform,
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
restore() {
|
|
112
|
+
const prev = this.stack.pop();
|
|
113
|
+
if (!prev)
|
|
114
|
+
return;
|
|
115
|
+
this.fillColor = prev.fillColor;
|
|
116
|
+
this.strokeColor = prev.strokeColor;
|
|
117
|
+
this.strokeWidth = prev.strokeWidth;
|
|
118
|
+
this.opacity = prev.opacity;
|
|
119
|
+
this.lineCap = prev.lineCap;
|
|
120
|
+
this.lineJoin = prev.lineJoin;
|
|
121
|
+
this.dashArray = prev.dashArray;
|
|
122
|
+
this.fontFamily = prev.fontFamily;
|
|
123
|
+
this.fontSize = prev.fontSize;
|
|
124
|
+
this.fontWeight = prev.fontWeight;
|
|
125
|
+
this.fontStyle = prev.fontStyle;
|
|
126
|
+
this.textAlign = prev.textAlign;
|
|
127
|
+
this.textBaseline = prev.textBaseline;
|
|
128
|
+
this.currentTransform = prev.transform;
|
|
129
|
+
}
|
|
130
|
+
// --- Transform ---
|
|
131
|
+
translate(dx, dy) {
|
|
132
|
+
this.currentTransform = matrix.multiply(this.currentTransform, matrix.translation(dx, dy));
|
|
133
|
+
}
|
|
134
|
+
rotate(radians) {
|
|
135
|
+
this.currentTransform = matrix.multiply(this.currentTransform, matrix.rotation(radians));
|
|
136
|
+
}
|
|
137
|
+
scale(sx, sy) {
|
|
138
|
+
this.currentTransform = matrix.multiply(this.currentTransform, matrix.scaling(sx, sy));
|
|
139
|
+
}
|
|
140
|
+
setTransform(t) {
|
|
141
|
+
this.currentTransform = t;
|
|
142
|
+
}
|
|
143
|
+
resetTransform() {
|
|
144
|
+
this.currentTransform = matrix.IDENTITY;
|
|
145
|
+
}
|
|
146
|
+
// --- Path primitives ---
|
|
147
|
+
beginPath() {
|
|
148
|
+
this.pathSegments = [];
|
|
149
|
+
this.pathCursor = null;
|
|
150
|
+
}
|
|
151
|
+
closePath() {
|
|
152
|
+
this.pathSegments.push("Z");
|
|
153
|
+
}
|
|
154
|
+
moveTo(x, y) {
|
|
155
|
+
const p = this.apply(x, y);
|
|
156
|
+
this.pathSegments.push(`M${fmt(p.x)} ${fmt(p.y)}`);
|
|
157
|
+
this.pathCursor = p;
|
|
158
|
+
}
|
|
159
|
+
lineTo(x, y) {
|
|
160
|
+
const p = this.apply(x, y);
|
|
161
|
+
this.pathSegments.push(`L${fmt(p.x)} ${fmt(p.y)}`);
|
|
162
|
+
this.pathCursor = p;
|
|
163
|
+
}
|
|
164
|
+
quadraticCurveTo(cx, cy, x, y) {
|
|
165
|
+
const c = this.apply(cx, cy);
|
|
166
|
+
const p = this.apply(x, y);
|
|
167
|
+
this.pathSegments.push(`Q${fmt(c.x)} ${fmt(c.y)} ${fmt(p.x)} ${fmt(p.y)}`);
|
|
168
|
+
this.pathCursor = p;
|
|
169
|
+
}
|
|
170
|
+
bezierCurveTo(c1x, c1y, c2x, c2y, x, y) {
|
|
171
|
+
const c1 = this.apply(c1x, c1y);
|
|
172
|
+
const c2 = this.apply(c2x, c2y);
|
|
173
|
+
const p = this.apply(x, y);
|
|
174
|
+
this.pathSegments.push(`C${fmt(c1.x)} ${fmt(c1.y)} ${fmt(c2.x)} ${fmt(c2.y)} ${fmt(p.x)} ${fmt(p.y)}`);
|
|
175
|
+
this.pathCursor = p;
|
|
176
|
+
}
|
|
177
|
+
rect(x, y, width, height) {
|
|
178
|
+
// Decompose into a 4-segment poly: lets the rest of the pipeline treat
|
|
179
|
+
// every fillable shape as a single `<path>`.
|
|
180
|
+
this.moveTo(x, y);
|
|
181
|
+
this.lineTo(x + width, y);
|
|
182
|
+
this.lineTo(x + width, y + height);
|
|
183
|
+
this.lineTo(x, y + height);
|
|
184
|
+
this.closePath();
|
|
185
|
+
}
|
|
186
|
+
ellipse(cx, cy, rx, ry) {
|
|
187
|
+
// Approximate an ellipse with 4 cubic Bezier curves (kappa = 0.5522847498).
|
|
188
|
+
const kappa = 0.5522847498307936;
|
|
189
|
+
const ox = rx * kappa;
|
|
190
|
+
const oy = ry * kappa;
|
|
191
|
+
this.moveTo(cx + rx, cy);
|
|
192
|
+
this.bezierCurveTo(cx + rx, cy + oy, cx + ox, cy + ry, cx, cy + ry);
|
|
193
|
+
this.bezierCurveTo(cx - ox, cy + ry, cx - rx, cy + oy, cx - rx, cy);
|
|
194
|
+
this.bezierCurveTo(cx - rx, cy - oy, cx - ox, cy - ry, cx, cy - ry);
|
|
195
|
+
this.bezierCurveTo(cx + ox, cy - ry, cx + rx, cy - oy, cx + rx, cy);
|
|
196
|
+
this.closePath();
|
|
197
|
+
}
|
|
198
|
+
// --- Fill / stroke ---
|
|
199
|
+
fill(rule = "nonzero") {
|
|
200
|
+
if (this.pathSegments.length === 0)
|
|
201
|
+
return;
|
|
202
|
+
const d = this.pathSegments.join(" ");
|
|
203
|
+
const attrs = [
|
|
204
|
+
`d="${d}"`,
|
|
205
|
+
`fill="${this.fillColor ?? "none"}"`,
|
|
206
|
+
rule === "evenodd" ? `fill-rule="evenodd"` : "",
|
|
207
|
+
this.opacity !== 1 ? `fill-opacity="${this.opacity}"` : "",
|
|
208
|
+
]
|
|
209
|
+
.filter(Boolean)
|
|
210
|
+
.join(" ");
|
|
211
|
+
this.elements.push(`<path ${attrs}/>`);
|
|
212
|
+
}
|
|
213
|
+
stroke() {
|
|
214
|
+
if (this.pathSegments.length === 0)
|
|
215
|
+
return;
|
|
216
|
+
if (this.strokeColor === null || this.strokeWidth <= 0)
|
|
217
|
+
return;
|
|
218
|
+
const d = this.pathSegments.join(" ");
|
|
219
|
+
const dash = this.dashArray && this.dashArray.length > 0
|
|
220
|
+
? `stroke-dasharray="${this.dashArray.join(" ")}"`
|
|
221
|
+
: "";
|
|
222
|
+
const attrs = [
|
|
223
|
+
`d="${d}"`,
|
|
224
|
+
`fill="none"`,
|
|
225
|
+
`stroke="${this.strokeColor}"`,
|
|
226
|
+
`stroke-width="${this.strokeWidth}"`,
|
|
227
|
+
this.lineCap !== "butt" ? `stroke-linecap="${this.lineCap}"` : "",
|
|
228
|
+
this.lineJoin !== "miter" ? `stroke-linejoin="${this.lineJoin}"` : "",
|
|
229
|
+
dash,
|
|
230
|
+
this.opacity !== 1 ? `stroke-opacity="${this.opacity}"` : "",
|
|
231
|
+
]
|
|
232
|
+
.filter(Boolean)
|
|
233
|
+
.join(" ");
|
|
234
|
+
this.elements.push(`<path ${attrs}/>`);
|
|
235
|
+
}
|
|
236
|
+
// --- Text ---
|
|
237
|
+
fillText(text, x, y, maxWidth) {
|
|
238
|
+
if (!text)
|
|
239
|
+
return;
|
|
240
|
+
const p = this.apply(x, y);
|
|
241
|
+
// SVG's text anchor matches Canvas's `textAlign`.
|
|
242
|
+
const anchor = this.textAlign === "center" ? "middle" : this.textAlign === "right" ? "end" : "start";
|
|
243
|
+
// SVG's `dominant-baseline` mapping for our 3 supported baselines.
|
|
244
|
+
const baseline = this.textBaseline === "middle"
|
|
245
|
+
? "central"
|
|
246
|
+
: this.textBaseline === "bottom"
|
|
247
|
+
? "alphabetic"
|
|
248
|
+
: "hanging";
|
|
249
|
+
const attrs = [
|
|
250
|
+
`x="${fmt(p.x)}"`,
|
|
251
|
+
`y="${fmt(p.y)}"`,
|
|
252
|
+
`font-family="${escapeAttr(this.fontFamily)}"`,
|
|
253
|
+
`font-size="${this.fontSize}"`,
|
|
254
|
+
this.fontWeight === "bold" ? `font-weight="bold"` : "",
|
|
255
|
+
this.fontStyle === "italic" ? `font-style="italic"` : "",
|
|
256
|
+
`fill="${this.fillColor ?? "#000"}"`,
|
|
257
|
+
`text-anchor="${anchor}"`,
|
|
258
|
+
`dominant-baseline="${baseline}"`,
|
|
259
|
+
this.opacity !== 1 ? `fill-opacity="${this.opacity}"` : "",
|
|
260
|
+
maxWidth !== undefined ? `textLength="${maxWidth}" lengthAdjust="spacingAndGlyphs"` : "",
|
|
261
|
+
]
|
|
262
|
+
.filter(Boolean)
|
|
263
|
+
.join(" ");
|
|
264
|
+
this.elements.push(`<text ${attrs}>${escapeText(text)}</text>`);
|
|
265
|
+
}
|
|
266
|
+
measureText(text) {
|
|
267
|
+
return { width: this.measure(text, this.fontFamily, this.fontSize) };
|
|
268
|
+
}
|
|
269
|
+
// --- Images ---
|
|
270
|
+
drawImage(image, dx, dy, dw, dh) {
|
|
271
|
+
if (typeof image !== "string" || image === "")
|
|
272
|
+
return;
|
|
273
|
+
const p = this.apply(dx, dy);
|
|
274
|
+
// Note: this is a 1:1 axis-aligned blit. Rotated/skewed transforms are
|
|
275
|
+
// not preserved on the `<image>` element. For richer cases the caller
|
|
276
|
+
// should compose with a `<g transform>` themselves.
|
|
277
|
+
this.elements.push(`<image x="${fmt(p.x)}" y="${fmt(p.y)}" width="${dw}" height="${dh}" href="${escapeAttr(image)}"/>`);
|
|
278
|
+
}
|
|
279
|
+
// --- Surface control ---
|
|
280
|
+
clear(bounds) {
|
|
281
|
+
if (!bounds) {
|
|
282
|
+
this.elements.length = 0;
|
|
283
|
+
return;
|
|
284
|
+
}
|
|
285
|
+
// Bounded clear → white rect (mirrors what a canvas `clearRect` would do
|
|
286
|
+
// visually on a default white background).
|
|
287
|
+
const p1 = this.apply(bounds.x, bounds.y);
|
|
288
|
+
const p2 = this.apply(bounds.x + bounds.width, bounds.y + bounds.height);
|
|
289
|
+
const x = Math.min(p1.x, p2.x);
|
|
290
|
+
const y = Math.min(p1.y, p2.y);
|
|
291
|
+
const w = Math.abs(p2.x - p1.x);
|
|
292
|
+
const h = Math.abs(p2.y - p1.y);
|
|
293
|
+
this.elements.push(`<rect x="${fmt(x)}" y="${fmt(y)}" width="${w}" height="${h}" fill="#fff"/>`);
|
|
294
|
+
}
|
|
295
|
+
// --- Internal ---
|
|
296
|
+
apply(x, y) {
|
|
297
|
+
return matrix.applyToPoint(this.currentTransform, { x, y });
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
/** Trim trailing zeros from numeric attributes to keep the output compact. */
|
|
301
|
+
const fmt = (n) => {
|
|
302
|
+
if (Number.isInteger(n))
|
|
303
|
+
return String(n);
|
|
304
|
+
return n.toFixed(3).replace(/\.?0+$/, "");
|
|
305
|
+
};
|
|
306
|
+
const escapeAttr = (s) => s.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">");
|
|
307
|
+
const escapeText = (s) => s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
308
|
+
//# sourceMappingURL=svg-target.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svg-target.js","sourceRoot":"","sources":["../src/svg-target.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAS/C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,SAAS;IACX,IAAI,CAAsD;IAEnE,0EAA0E;IACzD,OAAO,CAAiE;IAEzF,sBAAsB;IACd,SAAS,GAAiB,IAAI,CAAC;IAC/B,WAAW,GAAiB,IAAI,CAAC;IACjC,WAAW,GAAG,CAAC,CAAC;IAChB,OAAO,GAAG,CAAC,CAAC;IACZ,OAAO,GAAY,MAAM,CAAC;IAC1B,QAAQ,GAAa,OAAO,CAAC;IAC7B,SAAS,GAA6B,IAAI,CAAC;IAC3C,UAAU,GAAG,uBAAuB,CAAC;IACrC,QAAQ,GAAG,EAAE,CAAC;IACd,UAAU,GAAsB,QAAQ,CAAC;IACzC,SAAS,GAAwB,QAAQ,CAAC;IAC1C,SAAS,GAAc,MAAM,CAAC;IAC9B,YAAY,GAAiB,KAAK,CAAC;IAE3C,0BAA0B;IAClB,gBAAgB,GAAc,MAAM,CAAC,QAAQ,CAAC;IAEtD,sBAAsB;IACd,YAAY,GAAa,EAAE,CAAC;IAC5B,UAAU,GAAgB,IAAI,CAAC;IAEvC,iBAAiB;IACA,QAAQ,GAAa,EAAE,CAAC;IAEzC,sBAAsB;IACL,KAAK,GAAiB,EAAE,CAAC;IAE1C,YAAY,OAIX;QACC,IAAI,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AS,CAAC,CAAC,CAAC;QAAE,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC;IAC1C,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;AAC5C,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG,CAAC,CAAS,EAAU,EAAE,CACvC,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAE/F,MAAM,UAAU,GAAG,CAAC,CAAS,EAAU,EAAE,CACvC,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@oh-just-another/renderer-svg",
|
|
3
|
+
"version": "0.57.0",
|
|
4
|
+
"description": "renderer-svg package",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Rustam Garifulin <rustam@n69.in>",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/oh-just-another/diagram.git",
|
|
10
|
+
"directory": "packages/renderer-svg"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://github.com/oh-just-another/diagram#readme",
|
|
13
|
+
"bugs": "https://github.com/oh-just-another/diagram/issues",
|
|
14
|
+
"keywords": [
|
|
15
|
+
"diagram",
|
|
16
|
+
"canvas",
|
|
17
|
+
"svg",
|
|
18
|
+
"editor",
|
|
19
|
+
"graph",
|
|
20
|
+
"drawing"
|
|
21
|
+
],
|
|
22
|
+
"type": "module",
|
|
23
|
+
"main": "./dist/index.js",
|
|
24
|
+
"module": "./dist/index.js",
|
|
25
|
+
"types": "./dist/index.d.ts",
|
|
26
|
+
"exports": {
|
|
27
|
+
".": {
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
29
|
+
"import": "./dist/index.js"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"files": [
|
|
33
|
+
"dist",
|
|
34
|
+
"README.md",
|
|
35
|
+
"CHANGELOG.md"
|
|
36
|
+
],
|
|
37
|
+
"sideEffects": false,
|
|
38
|
+
"publishConfig": {
|
|
39
|
+
"access": "public"
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"@oh-just-another/types": "0.57.0",
|
|
43
|
+
"@oh-just-another/math": "0.57.0",
|
|
44
|
+
"@oh-just-another/renderer-core": "0.57.0",
|
|
45
|
+
"@oh-just-another/scene": "0.57.0"
|
|
46
|
+
},
|
|
47
|
+
"scripts": {
|
|
48
|
+
"build": "tsc -b tsconfig.build.json",
|
|
49
|
+
"typecheck": "tsc --noEmit",
|
|
50
|
+
"test": "vitest run",
|
|
51
|
+
"test:watch": "vitest",
|
|
52
|
+
"lint": "eslint src tests",
|
|
53
|
+
"clean": "rm -rf dist *.tsbuildinfo"
|
|
54
|
+
}
|
|
55
|
+
}
|