diff --git a/CHANGELOG.md b/CHANGELOG.md index a00a08215..1eb9fdb4f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ ### Added +- Import `flattenNodesToVectorProps`, `outlineStrokeNodesToVectorProps`, and the `VectorFlattenProps` type from `@open-pencil/core/canvas` to compute Flatten and Outline stroke geometry in an embedding app without going through the editor's own write path. - Check designs from the new Lint tab in the right panel: issues on the page, in the selection, or across the document are grouped by rule, hovering one highlights its layer on the canvas, clicking selects it and brings it into view, and one-click fixes bind colors to the variable they match and round subpixel geometry for a row or a whole group, and snap radius, spacing, and small text to the scale, convert groups to frames, and delete hidden layers one row at a time. Rules can be turned off individually or switched between the Recommended, Strict, and Accessibility presets. - See which layer the code is about in the Code tab's Design JSX and Tailwind JSX: the element around the cursor marks its opening and closing tag and shows its layer on the canvas as a tinted box, apart from canvas hover, and design issues are underlined on the property that causes them, including while you edit Design JSX live. - Fix lint issues outside the app: `openpencil lint --fix -o fixed.fig` binds colors to the variable they match and rounds subpixel geometry, and the `lint` and `lint_fix` tools let MCP clients and AI chat check a page and apply those fixes, plus radius, spacing, text size, group-to-frame, and hidden-layer suggestions on request. Lint messages carry each fix as data in `fix` and `suggestions`. diff --git a/packages/core/src/canvas/flatten.ts b/packages/core/src/canvas/flatten.ts index 0cd4b8c57..ca0d102c6 100644 --- a/packages/core/src/canvas/flatten.ts +++ b/packages/core/src/canvas/flatten.ts @@ -5,7 +5,7 @@ import { parseSVGPath } from '@open-pencil/scene-graph/parse-path' import { makeBooleanSourcePath, makeStrokeOutlinePath, nodePathTransform } from './boolean' import type { SkiaRenderer } from './renderer' -type VectorFlattenProps = Pick< +export type VectorFlattenProps = Pick< SceneNode, 'name' | 'x' | 'y' | 'width' | 'height' | 'fills' | 'vectorNetwork' > diff --git a/packages/core/src/canvas/index.ts b/packages/core/src/canvas/index.ts index 11335f2e5..9af6db98a 100644 --- a/packages/core/src/canvas/index.ts +++ b/packages/core/src/canvas/index.ts @@ -4,6 +4,11 @@ export { hasVisibleStrokeSourceNode, nodeHasVisibleStroke } from './boolean' +export { + flattenNodesToVectorProps, + outlineStrokeNodesToVectorProps, + type VectorFlattenProps +} from './flatten' export { distanceToGuideSegment, getGuideScreenSegment,