npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@create-design/model

v0.2.11

Published

Reusable document geometry, color, and coordinate operations for create-design

Readme

@create-design/model

Headless document operations shared by create-design editors, exporters, and automation. This package owns geometry projection, painted bounds, color resolution, artboard lookup, and coordinate transforms without depending on a browser or editor runtime.

Live contour blends

createDesignBlend() captures explicit contour and point correspondence for two endpoint objects. resolveDesignBlend() deterministically derives the requested intermediate path objects, aggregate diagnostics, and transient paint swatches without mutating the document. projectDesignDocumentBlends() inserts ready intermediates immediately before the later-painted endpoint; reordering endpoints therefore moves the derived stack while keeping stable references.

Compatible contours have equal contour and point counts, equal open/closed state and fill rules, the persisted first point/order, and the same direction. Positions, optional handles (missing means a zero-length handle), all six affine-transform components, stroke metrics, and compatible colors interpolate linearly. Two CMYK paints remain CMYK. RGB/RGB and mixed RGB/CMYK pairs interpolate in normalized RGB. A missing fill or stroke and categorical cap/join differences switch at the midpoint with a warning; unequal dash-array lengths are errors. Missing endpoints, contours, points, or swatches and topology mismatches are recoverable errors that suppress only that blend.

A hidden blend or endpoint suppresses intermediates. A locked blend or endpoint makes all derived steps locked. Bounds cover the intermediate steps, and selection treats the blend as one unit. Native blend clipboard helpers copy both endpoints, correspondence, and referenced swatches, then paste fresh object/contour/point/blend identities as one document edit.

updateDesignBlend(), reverseDesignBlendEndpoint(), and setDesignBlendFirstPoint() author deterministic live options and endpoint correspondence without importing the editor. expandDesignBlend() retains both ordinary endpoints, assigns fresh object/contour/point/swatch identities to the resolved intermediate paths, inserts them at the live projection position, and removes the live record as one immutable document replacement.

Output projection

projectDesignObjectContours() lowers live corner profiles after applying the object transform. Corner amounts therefore remain document-space distances, and circular and squircle profiles retain their 1:1 proportions through non-uniform scaling. projectDesignObjectCornerResolutions() reports intended and applied amounts so editors can disclose temporary contour clamping without discarding the authored preference.

projectDesignOutput() is the shared flattening boundary for renderers, exporters, previews, and interchange. It walks layers and nested groups in canonical paint order, omits objects hidden by either their object or layer, keeps locked-layer artwork output-visible, and lowers live blend steps into the later-painted endpoint's layer and group slot. The returned entries retain their containing layer and group ancestry for structured output and diagnostics; formats without editable layers flatten the entry order exactly.

Open contour paint projection

Open contours are durable authored geometry. projectDesignObjectContours() preserves closed: false for editing, centerline hit testing, stroke caps, dashes, and expansion. Fill-only consumers use projectDesignObjectFillContours(), which derives a closed region by joining the endpoint anchors with a straight segment and ignores only the first incoming and last outgoing dangling controls. The derived contour never mutates source. This matches SVG and PDF implicit subpath fill closure while allowing a fill and stroke on the same path to close only the fill.