0.2.0 • Published 6d ago
@polotno/core
Licence
SEE LICENSE IN LICENSE.md
Version
0.2.0
Deps
7
Size
316 kB
Vulns
0
Weekly
0
@polotno/core
Shared platform layer for Polotno packages: the DOM/text/SVG rendering
utilities the Polotno canvas renders with, font resolution, and canonical
errors. The polotno editor and the export packages
(@polotno/svg-export, @polotno/html-export, …) build on it.
No React. No MobX. Browser-first (DOM APIs are used); in Node run under jsdom.
Usage
Subpath exports are the API — import the module you need:
import { getHtml } from '@polotno/core/text-html';
import { normalizeRichTextHtml } from '@polotno/core/rich-text-html';
import { figureToSvg } from '@polotno/core/figure-to-svg';
import { fetchGoogleFontFaces } from '@polotno/core/fonts';
import { polotnoError } from '@polotno/core/errors';
The root import exists for discoverability only; prefer subpaths so bundlers ship just what you use.
Stability
This package is semi-internal: it exists to keep Polotno's renderer and converters pixel-identical, and its API moves with them. Pin a minor version if you depend on it directly.