@polotno/core
v0.2.0
Published
Shared platform layer for Polotno packages: DOM/text/SVG rendering utilities, font resolution, canonical errors. No React, no MobX. Subpath exports are the API.
Readme
@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.
