fix(types): re-export isBadgeOverlayNode as deprecated alias

The previous commit renamed isBadgeOverlayNode → isOverlayNode without
a compat export, which would break external consumers of the published
@zseven-w/pen-core package on upgrade. Add a deprecated alias so the
old import name keeps resolving. JSDoc flags the behavior change —
the alias no longer matches role:'badge'|'pill'|'tag', since those are
inline-component roles and must flow in auto-layout.
This commit is contained in:
Fini 2026-04-16 21:09:56 +08:00
parent 1c0cb8c7ef
commit cb7fa00f5b
2 changed files with 10 additions and 1 deletions

View file

@ -143,7 +143,7 @@ export { type BooleanOpType, canBooleanOp, executeBooleanOp } from './boolean-op
export { cssFontFamily } from './font-utils.js';
// Node helpers
export { isOverlayNode, sanitizeName } from './node-helpers.js';
export { isOverlayNode, isBadgeOverlayNode, sanitizeName } from './node-helpers.js';
// Design-MD parser
export {

View file

@ -20,6 +20,15 @@ export function isOverlayNode(node: PenNode): boolean {
return false;
}
/**
* @deprecated Renamed to `isOverlayNode`. Semantics also tightened:
* this alias no longer returns true for `role: 'badge' | 'pill' | 'tag'`
* (those are inline-component roles in this repo and should flow in
* auto-layout, not float). Use `isOverlayNode` and mark true floating
* decorations with `role: 'overlay'`.
*/
export const isBadgeOverlayNode = isOverlayNode;
/**
* Convert a name string to PascalCase.
* Strips non-alphanumeric characters and joins words.