@yft-design/engine 0.0.28 → 0.0.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,3 @@
1
- import type { EngineDocument } from './document';
2
- import { SceneNode } from './scene';
3
1
  interface PathBackgroundSpec {
4
2
  path: string;
5
3
  fill?: string;
@@ -7,12 +5,4 @@ interface PathBackgroundSpec {
7
5
  height: number;
8
6
  }
9
7
  export declare const pathBackgroundSpecOf: (raw: Record<string, unknown>) => PathBackgroundSpec | null;
10
- export declare const syncPathBackgroundNode: (document: EngineDocument, host: SceneNode) => boolean;
11
- export declare const ensurePathBackgroundNode: (document: EngineDocument, host: SceneNode) => SceneNode | null;
12
- export declare const synthesizePathBackgroundNodes: (document: EngineDocument) => number;
13
- export declare const syncAfterPropWrite: (document: EngineDocument, node: SceneNode) => void;
14
- export declare const repositionPathBackgroundNode: (document: EngineDocument, host: SceneNode) => void;
15
- export declare const attachPathBackgroundController: (document: EngineDocument, options?: {
16
- requestRender?: () => void;
17
- }) => (() => void);
18
8
  export {};
@@ -14,6 +14,7 @@ export declare class TextRenderer {
14
14
  private textDashBakes;
15
15
  private scrollBakes;
16
16
  private highlightBakes;
17
+ private pathBgBakes;
17
18
  constructor(gl: WebGL2RenderingContext, batch: QuadBatch, glyphAtlas: GlyphAtlas);
18
19
  invalidateNodeBakes(node: SceneNode): void;
19
20
  renderWarpedText(node: TextNode, kind: WarpKind): void;
@@ -22,6 +23,7 @@ export declare class TextRenderer {
22
23
  private renderArcGlyphs;
23
24
  renderTextGlyphs(node: TextNode, zoomX: number): void;
24
25
  private renderScrollText;
26
+ renderTextPathBackground(node: TextNode, zoomX: number): void;
25
27
  private renderTextBackgrounds;
26
28
  private renderTextDecorations;
27
29
  private textHasDashStroke;
@@ -3,6 +3,8 @@ import { type SceneNode, type SourceRect, type TextNode } from '../model/scene';
3
3
  export declare const STROKE_BAKE_PIXEL_BUDGET = 600000;
4
4
  export declare const strokeSupersampleCap: (node: SceneNode) => number;
5
5
  export declare const imageFiltersSig: (node: SceneNode) => string;
6
+ export declare const imageRoundedRadius: (node: SceneNode) => number | null;
7
+ export declare const imageRoundedSig: (node: SceneNode) => string;
6
8
  export declare const buildTextEffectSource: (node: TextNode, scale?: number) => HTMLCanvasElement | null;
7
9
  export interface PsdShadowBake {
8
10
  canvas: HTMLCanvasElement;
@@ -0,0 +1,23 @@
1
+ import type { TextNode } from '../model/scene';
2
+ export interface TextPathBackgroundPlan {
3
+ path: string;
4
+ fill: string;
5
+ bounds: {
6
+ left: number;
7
+ top: number;
8
+ right: number;
9
+ bottom: number;
10
+ };
11
+ scaleX: number;
12
+ scaleY: number;
13
+ logicalW: number;
14
+ logicalH: number;
15
+ sigBase: string;
16
+ }
17
+ export declare const planTextPathBackground: (node: TextNode) => TextPathBackgroundPlan | null;
18
+ export interface BakedTextPathBackground {
19
+ canvas: HTMLCanvasElement;
20
+ logicalW: number;
21
+ logicalH: number;
22
+ }
23
+ export declare const bakeTextPathBackground: (plan: TextPathBackgroundPlan, bucket: number) => BakedTextPathBackground | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yft-design/engine",
3
- "version": "0.0.28",
3
+ "version": "0.0.30",
4
4
  "description": "yft-design 的 WebGL2 画布引擎:接受 fabric toObject 格式 JSON,输出 GL 画布 / 位图(任意倍率 FBO 读回)/ SVG(纯数据序列化器)",
5
5
  "repository": {
6
6
  "type": "git",