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

@printwithsynergy/artwork-pdf-editor

v0.2.0

Published

artworkPDF WYSIWYG editor as a host-customizable React component. Drop-in mountable in Next.js, Astro, Remix, etc.

Readme

@printwithsynergy/artwork-pdf-editor

Host-customizable React editor for artworkPDF. Drop into any React 19 host (Next.js, Astro client:only, Remix, plain React) to give users a WYSIWYG packaging-artwork canvas with dieline templates, bleed visualization, and PDF export. AGPL-3.0-or-later.

Install

pnpm add @printwithsynergy/artwork-pdf-editor react react-dom react-konva konva

Peers: react@^19, react-dom@^19, react-konva@^19, konva@^10. pdf-lib is a regular dependency — it comes along automatically and powers the demo-mode client-side export.

Quick start

import {
  EditorApp,
  getDefaultTemplate,
  templateToInitialState,
} from "@printwithsynergy/artwork-pdf-editor";

const { objects, pageSize } = templateToInitialState(getDefaultTemplate());

export default function Page() {
  return (
    <EditorApp
      demo
      initialPhase="editor"
      initialObjects={objects}
      initialPageSize={pageSize}
    />
  );
}

In Astro with output: "static", mount under client:only="react" and seed initial state inside a useEffect (server has no window).

Customizing the top bar

The editor's top bar is the only host-customizable chrome. Pass any logo ReactNode (null to hide), wordmark text, and extra CTAs:

<EditorApp
  topBar={{
    logo: <img src="/acme-logo.svg" alt="Acme" height={24} />,
    brandText: "Acme Designer",
    extraButtons: [
      { label: "Features", href: "/features" },
      { label: "Sign up", href: "/signup", primary: true },
    ],
  }}
/>

The hamburger button is always rendered at the leftmost position on mobile so muscle memory is consistent across hosts.

Feature flags (EditorConfig)

Disable any feature globally, per mode (basic/pro), or per instance. Defaults to everything enabled.

<EditorApp
  config={{
    enable_layers_panel: false,
    enable_source_link: false,
  }}
/>

Resolution order: DEFAULT_EDITOR_CONFIG{BASIC,PRO}_MODE_OVERRIDES → instance overrides. The full flag list is in src/lib/editor-config.ts.

Bleed

Bleed defaults to industry-standard 0.125 in (3.175 mm). Override per mount or via URL on a hosted route:

<EditorApp bleedMm={5} />
/demo?bleed=0.25in
/demo?bleed=3mm
/demo?bleed=3.175

parseBleed() is exported for hosts that need to map their own URL contract.

Dieline deep-links

Templates live in src/data/dielines.json. Each has a stable id; one is flagged isDefault: true.

import { getTemplateById } from "@printwithsynergy/artwork-pdf-editor";
const tpl = getTemplateById("standup-pouch-4x6");

Hosted routes can deep-link with ?dieline=<id>. The demo route also accepts:

  • A bundled multi-page set id (?dieline=carton-6x4x2-set) — see TEMPLATE_SETS.
  • A comma-separated list of template ids (?dieline=carton-6x4x2,carton-6x4x2).

Unknown ids silently fall back to the default template.

Multi-page documents

Each page in a multi-page artwork carries its own objects, pageSize, bleedMm, and optional templateId + name. Seed via initialPages:

import {
  EditorApp,
  getTemplateSetById,
  templateSetToPages,
} from "@printwithsynergy/artwork-pdf-editor";

const set = getTemplateSetById("carton-6x4x2-set");
const pages = templateSetToPages(set!, 3.175); // 0.125 in bleed

<EditorApp demo initialPhase="editor" initialPages={pages} />

Helpers:

  • templateToPage(template, bleedMm?, name?) — single template → Page.
  • templatesToPages([{ template, name }], bleedMm?) — ordered ad-hoc set → Page[].
  • templateSetToPages(set, bleedMm?) — bundled set → Page[].

A PageNavigator strip renders above the canvas on desktop and a "Pages" section appears in the mobile drawer. Users can switch between pages, add (duplicate) pages, and delete pages. Per-page state is preserved across switches; each page has its own undo history.

Lens plugins (/lens subpath)

Hosts that mount @printwithsynergy/lens-pdf to display rendered output can register artwork-aware overlays:

import { LensPDF } from "@printwithsynergy/lens-pdf";
import {
  dielineOverlayPlugin,
  preflightFindingsPlugin,
} from "@printwithsynergy/artwork-pdf-editor/lens";

<LensPDF
  pdfUrl={blobUrl}
  plugins={[
    dielineOverlayPlugin({ pages: { 1: { template: tpl, bleedMm: 3.175 } } }),
    preflightFindingsPlugin({ report }),
  ]}
/>

@printwithsynergy/lens-pdf is an optional peer dep — only required when you import from the /lens subpath.

License

AGPL-3.0-or-later. Source: https://github.com/printwithsynergy/artwork-pdf.