fix(vue): resolve unexported subpath import breaking npm consumers

- Export getAbsolutePositionFull from @open-pencil/core/canvas subpath
- Update vue import from @open-pencil/core/canvas/coordinate to @open-pencil/core/canvas
- Formatting fixes from oxfmt in pen/convert.ts, pen/read.ts, figma-factory.ts
This commit is contained in:
Danila Poyarkov 2026-04-22 21:11:53 +03:00
parent f3dbf2c271
commit d25d80083b
6 changed files with 14 additions and 6 deletions

View file

@ -1,5 +1,11 @@
# Changelog
## Unreleased
### Fixes
- Fix `@open-pencil/vue` failing to import from npm — `getAbsolutePositionFull` was imported from `@open-pencil/core/canvas/coordinate`, an unexported subpath. Re-exported the function from `@open-pencil/core/canvas` and updated the vue import.
## 0.11.7 — 2026-04-22
### Features

View file

@ -1 +1,2 @@
export { SkiaRenderer, type RenderOverlays } from './renderer'
export { getAbsolutePositionFull } from './coordinate'

View file

@ -383,7 +383,7 @@ export function applyCornerRadius(
export function applyPadding(node: SceneNode, padding: PenNode['padding'], ctx?: VarContext): void {
if (padding === undefined) return
const resolve = (v: number | string): number =>
typeof v === 'string' ? (isVarRef(v) && ctx ? ctx.resolveNumber(v) : (Number(v) || 0)) : v
typeof v === 'string' ? (isVarRef(v) && ctx ? ctx.resolveNumber(v) : Number(v) || 0) : v
if (Array.isArray(padding)) {
node.paddingTop = resolve(padding[0] ?? 0)
node.paddingRight = resolve(padding[1] ?? 0)

View file

@ -87,9 +87,10 @@ function applyAutoLayout(
overrides.layoutMode = layoutMode
overrides.primaryAxisAlign = mapJustifyContent(pen.justifyContent)
overrides.counterAxisAlign = mapAlignItems(pen.alignItems)
overrides.itemSpacing = typeof pen.gap === 'string' && isVarRef(pen.gap) && ctx
overrides.itemSpacing =
typeof pen.gap === 'string' && isVarRef(pen.gap) && ctx
? ctx.resolveNumber(pen.gap)
: (pen.gap ?? 0) as number
: ((pen.gap ?? 0) as number)
if (layoutMode === 'VERTICAL') {
overrides.primaryAxisSizing = heightSizing

View file

@ -8,7 +8,7 @@ import {
DEFAULT_TEXT_HEIGHT,
degToRad
} from '@open-pencil/core'
import { getAbsolutePositionFull } from '@open-pencil/core/canvas/coordinate'
import { getAbsolutePositionFull } from '@open-pencil/core/canvas'
import { handleDrawMove, handleDrawUp } from '@open-pencil/vue/shared/input/draw'
import { hitTestCornerRotationByMatrix } from '@open-pencil/vue/shared/input/geometry'
import { handleMoveMove, handleMoveUp } from '@open-pencil/vue/shared/input/move'

View file

@ -1,6 +1,6 @@
import { listFonts } from '@/engine/fonts'
import { FigmaAPI } from '@open-pencil/core'
import { listFonts } from '@/engine/fonts'
import type { EditorStore } from '@/stores/editor'
export function makeFigmaFromStore(store: EditorStore): FigmaAPI {