@fulate/ui 1.0.19 → 3.0.2

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.
Files changed (49) hide show
  1. package/README.md +130 -177
  2. package/dist/circle.d.ts +2 -1
  3. package/dist/connection/commands.d.ts +3 -3
  4. package/dist/connection/types.d.ts +5 -1
  5. package/dist/connection-port-decoration.d.ts +18 -2
  6. package/dist/editor/capability.d.ts +37 -6
  7. package/dist/editor/frame-flush.d.ts +3 -4
  8. package/dist/editor/properties.d.ts +31 -0
  9. package/dist/editor/shape-capability.d.ts +13 -0
  10. package/dist/editor/shape.d.ts +16 -19
  11. package/dist/editor/transform.d.ts +1 -3
  12. package/dist/editor-vector-path.d.ts +70 -0
  13. package/dist/floating.d.ts +12 -2
  14. package/dist/group.d.ts +17 -8
  15. package/dist/image.d.ts +16 -19
  16. package/dist/index.d.ts +15 -6
  17. package/dist/index.js +2757 -1555
  18. package/dist/line/base.d.ts +64 -27
  19. package/dist/line/geometry.d.ts +28 -0
  20. package/dist/line/index.d.ts +2 -0
  21. package/dist/line/label.d.ts +58 -0
  22. package/dist/line/orthogonal.d.ts +23 -0
  23. package/dist/line/serialization.d.ts +11 -0
  24. package/dist/line/straight.d.ts +7 -3
  25. package/dist/line-tree/history-delta.d.ts +2 -0
  26. package/dist/line-tree/index.d.ts +15 -8
  27. package/dist/line-tree/serialization.d.ts +2 -0
  28. package/dist/line-tree/transform.d.ts +1 -0
  29. package/dist/line-tree/types.d.ts +3 -2
  30. package/dist/polygon.d.ts +19 -38
  31. package/dist/rectangle.d.ts +5 -4
  32. package/dist/ripple.d.ts +18 -4
  33. package/dist/scrollbars.d.ts +36 -0
  34. package/dist/scrollview.d.ts +27 -21
  35. package/dist/serialization.d.ts +4 -0
  36. package/dist/text/block.d.ts +5 -1
  37. package/dist/text/editing.d.ts +54 -12
  38. package/dist/text/index.d.ts +22 -20
  39. package/dist/text/layout.d.ts +8 -2
  40. package/dist/text/paint.d.ts +3 -2
  41. package/dist/text/style.d.ts +4 -0
  42. package/dist/triangle.d.ts +10 -5
  43. package/dist/worker-surface-worker.d.ts +4 -1
  44. package/dist/worker-surface-worker.js +11 -8
  45. package/dist/worker-surface.d.ts +1 -0
  46. package/dist/workspace.d.ts +3 -3
  47. package/package.json +33 -33
  48. package/dist/authored-path.d.ts +0 -28
  49. package/dist/vector-path.d.ts +0 -58
@@ -0,0 +1,31 @@
1
+ import { ChangeImpact, ElementProperties, ShapeProperties, type BaseElementOption, type OriginX, type OriginY, type PropertyChanges, type ShapeOption } from "@fulate/core";
2
+ /** 编辑器旋转中心的 authored 配置。 */
3
+ export interface EditorPivotOptions {
4
+ /** x 轴旋转中心,默认 `"center"`。 */
5
+ rotationPivotX?: OriginX;
6
+ /** y 轴旋转中心,默认 `"center"`。 */
7
+ rotationPivotY?: OriginY;
8
+ }
9
+ export interface EditorElementOption<T = any> extends BaseElementOption<T>, EditorPivotOptions {
10
+ }
11
+ export interface EditorShapeOption<T = any> extends ShapeOption<T>, EditorPivotOptions {
12
+ }
13
+ /** runtime 覆盖只接受可参与当前显示的字段。 */
14
+ export type EditorRuntimePatch<Patch> = Omit<Patch, keyof EditorPivotOptions> & {
15
+ [K in keyof EditorPivotOptions]?: never;
16
+ };
17
+ export declare function pivotImpact(changes: PropertyChanges): ChangeImpact.None | ChangeImpact.Hover;
18
+ /** Element 派生领域对象的编辑器配置。 */
19
+ export declare class EditorElementProperties extends ElementProperties {
20
+ rotationPivotX: OriginX;
21
+ rotationPivotY: OriginY;
22
+ constructor(options?: EditorElementOption);
23
+ getImpact(changes: PropertyChanges): number;
24
+ }
25
+ /** Shape 派生领域对象的编辑器配置。 */
26
+ export declare class EditorShapeProperties extends ShapeProperties {
27
+ rotationPivotX: OriginX;
28
+ rotationPivotY: OriginY;
29
+ constructor(options?: EditorShapeOption);
30
+ getImpact(changes: PropertyChanges): number;
31
+ }
@@ -0,0 +1,13 @@
1
+ import { SelectionBehaviorMode, SelectionDiveMode, SelectionSnapMode, type EditorCapabilityToken, type SelectionBehaviorCapability, type SnapSourceCapability, type TransformInteractionCapability } from "./capability";
2
+ export declare const STANDARD_SELECTION: {
3
+ readonly mode: SelectionBehaviorMode.Standard;
4
+ readonly dive: SelectionDiveMode.None;
5
+ readonly snap: SelectionSnapMode.Enabled;
6
+ };
7
+ export declare const FRAME_TRANSFORM_POLICY: {
8
+ readonly move: true;
9
+ readonly resize: "both";
10
+ readonly rotate: true;
11
+ readonly rotationPivot: "adjustable";
12
+ };
13
+ export declare function getShapeEditorCapability<T>(host: SelectionBehaviorCapability & TransformInteractionCapability & SnapSourceCapability, token: EditorCapabilityToken<T>): T | undefined;
@@ -1,6 +1,8 @@
1
- import { type Layer, type PropertyChanges, type Root, Shape, ShapeProperties, ShapeTransform, type ConnectionPortConfiguration, type ElementOptionPatch, type ElementTransformBaseline, type ReparentTransformIntent, type ShapeOption, type TransformIntent } from "@fulate/core";
1
+ import type { PaintContext } from "@fulate/core";
2
+ import { Shape, ShapeTransform, type ElementOptionPatch, type ElementTransformBaseline, type Layer, type PropertyChanges, type ReparentTransformIntent, type Root, type TransformIntent } from "@fulate/core";
2
3
  import { Bound, type PointView, type ReadonlyMatrix2D, type Rect } from "@fulate/share";
3
- import { SelectionBehaviorMode, SelectionDiveMode, SelectionSnapMode, type EditorCapabilityToken, type SelectionBehaviorCapability, type SnapSourceCapability, type TransformInteractionCapability } from "./capability";
4
+ import type { EditorCapabilityToken, SelectionBehaviorCapability, SnapSourceCapability, TransformInteractionCapability, TransformInteractionPolicy } from "./capability";
5
+ import { EditorShapeProperties, type EditorRuntimePatch, type EditorShapeOption } from "./properties";
4
6
  export interface WorldRectPointsViewCache {
5
7
  source: Readonly<Rect> | null;
6
8
  a: number;
@@ -15,39 +17,34 @@ export declare function createWorldRectPointsViewCache(): WorldRectPointsViewCac
15
17
  /** Project one stable local frame to a borrowed world-point view. */
16
18
  export declare function getWorldRectPointsView(cache: WorldRectPointsViewCache, frame: Readonly<Rect>, matrix: ReadonlyMatrix2D): readonly PointView[];
17
19
  /** UI frame-authored Shape 系列共享的 direct Editor provider。 */
18
- export declare abstract class EditorShape<P extends ShapeProperties = ShapeProperties, O extends ShapeOption<any> = ShapeOption<any>> extends Shape<P, O> implements SelectionBehaviorCapability, TransformInteractionCapability, SnapSourceCapability {
20
+ export declare abstract class EditorShape<P extends EditorShapeProperties = EditorShapeProperties, O extends EditorShapeOption<any> = EditorShapeOption<any>> extends Shape<P, O, EditorRuntimePatch<ElementOptionPatch<O>>> implements SelectionBehaviorCapability, TransformInteractionCapability, SnapSourceCapability {
19
21
  private connectionPortDecoration;
20
22
  private readonly worldSnapPointsCache;
23
+ get rotationPivotX(): import("@fulate/core").OriginX;
24
+ get rotationPivotY(): import("@fulate/core").OriginY;
21
25
  getEditorCapability<T>(token: EditorCapabilityToken<T>): T | undefined;
22
26
  getSelectionBehavior(): {
23
- readonly mode: SelectionBehaviorMode.Standard;
24
- readonly dive: SelectionDiveMode.None;
25
- readonly snap: SelectionSnapMode.Enabled;
26
- };
27
- getTransformPolicy(): {
28
- readonly move: true;
29
- readonly resize: "both";
30
- readonly rotate: true;
31
- readonly rotationPivot: "adjustable";
27
+ readonly mode: import("./capability").SelectionBehaviorMode.Standard;
28
+ readonly dive: import("./capability").SelectionDiveMode.None;
29
+ readonly snap: import("./capability").SelectionSnapMode.Enabled;
32
30
  };
31
+ getTransformPolicy(): TransformInteractionPolicy;
33
32
  captureTransformBaseline(_bakeGeometry: boolean): ElementTransformBaseline;
34
33
  resolveTransformChange(baseline: Readonly<ElementTransformBaseline>, intent: Readonly<TransformIntent | ReparentTransformIntent>): readonly import("@fulate/core").OwnerPropertyChange[];
35
34
  getSelectionFrameBounds(): Readonly<Rect> | null;
36
- setOptions(options?: ElementOptionPatch<O>): this;
37
- replacePorts(value: ConnectionPortConfiguration): this;
38
- restorePropertySnapshot(snapshot: Record<string, unknown>): this;
35
+ protected commitConfiguredOptions(options: ElementOptionPatch<O>): void;
39
36
  getWorldSnapPointsView(): readonly PointView[];
40
- paint(ctx?: CanvasRenderingContext2D): void;
37
+ paint(paint: PaintContext): void;
41
38
  /** 绘制宿主本体;`paint()` 随后统一绘制 custom Port decoration。 */
42
- protected paintHost(ctx: CanvasRenderingContext2D): void;
39
+ protected paintHost(paint: PaintContext): void;
43
40
  /** @internal EditorShapeTransform 合并非节点 Port decoration bounds。 */
44
41
  getConnectionPortDecorationWorldBounds(): Bound;
45
- protected onPropertiesChanged(current: P, changes: PropertyChanges): void;
42
+ protected onPropertiesInstalled(current: P, changes: PropertyChanges): void;
46
43
  protected onActivate(root: Root | null, layer: Layer | null): void;
47
44
  protected onDeactivate(root: Root | null, layer: Layer | null): void;
48
45
  private getConnectionPortDecoration;
49
46
  }
50
47
  /** UI shape family 统一合并 custom Port decoration world visual bounds。 */
51
48
  export declare class EditorShapeTransform<E extends EditorShape = EditorShape> extends ShapeTransform<E> {
52
- protected buildWorldVisualBounds(): Bound;
49
+ protected buildWorldVisualBounds(includeShadow?: boolean): Bound;
53
50
  }
@@ -1,8 +1,6 @@
1
1
  import { Element, type ElementOptionPatch, type ElementTransformBaseline, type OwnerPropertyChange, type ReparentTransformIntent, type TransformIntent } from "@fulate/core";
2
- import { type Rect } from "@fulate/share";
2
+ import type { Rect } from "@fulate/share";
3
3
  /** @internal frame-authored provider 共用的纯 resolver。 */
4
4
  export declare function resolveFrameTransformChange(owner: Element, baseline: Readonly<ElementTransformBaseline>, intent: Readonly<TransformIntent | ReparentTransformIntent>): readonly OwnerPropertyChange[];
5
- /** @internal 捕获一次 owner reference;structured ownedState 直接保留原引用。 */
6
- export declare function captureElementTransformBaseline<Owned>(owner: Element, writeMode: "frame-authored" | "authored-geometry" | "pose-authored", ownedState: Owned): ElementTransformBaseline<Owned>;
7
5
  /** @internal Geometry reference 变化时保持当前 world pose 的最小 frame patch。 */
8
6
  export declare function resolveReferenceBoundsPosePatch(owner: Element, readBounds: () => readonly [Readonly<Rect>, Readonly<Rect>], patch?: Readonly<ElementOptionPatch>): Readonly<ElementOptionPatch>;
@@ -0,0 +1,70 @@
1
+ import { VectorPath, VectorPathProperties, VectorPathTransform, type AuthoredSubpath, type ElementOptionPatch, type ElementTransformBaseline, type ElementTransformClass, type Layer, type OwnerPropertyChange, type PaintContext, type PropertyChanges, type ReparentTransformIntent, type Root, type TransformIntent, type VectorPathCommand, type VectorPathGeometry, type VectorPathOption } from "@fulate/core";
2
+ import type { Bound, PointView, Rect } from "@fulate/share";
3
+ import { type EditorCapabilityToken, type PointControlDescriptor, type PointEditRequest, type PointEditTarget, type PointEditingScope, type PointOwnerEdit } from "./editor/capability";
4
+ import { type EditorPivotOptions, type EditorRuntimePatch } from "./editor/properties";
5
+ export interface EditorVectorPathOption<Input = readonly VectorPathCommand[], T = EditorVectorPath<any, any>> extends VectorPathOption<Input, T>, EditorPivotOptions {
6
+ }
7
+ export declare class EditorVectorPathProperties extends VectorPathProperties {
8
+ rotationPivotX: any;
9
+ rotationPivotY: any;
10
+ constructor(options?: EditorVectorPathOption<readonly VectorPathCommand[], any>);
11
+ getImpact(changes: PropertyChanges): number;
12
+ }
13
+ export declare class EditorVectorPathTransform<E extends EditorVectorPath<any, any> = EditorVectorPath> extends VectorPathTransform<E> {
14
+ protected buildWorldVisualBounds(includeShadow?: boolean): Bound;
15
+ }
16
+ /** One Core path owner with the UI's selection, Point, Transform, Snap and Port behavior. */
17
+ export declare class EditorVectorPath<P extends EditorVectorPathProperties = EditorVectorPathProperties, O extends EditorVectorPathOption<unknown, any> = EditorVectorPathOption> extends VectorPath<P, O, EditorRuntimePatch<ElementOptionPatch<O>>> {
18
+ private connectionPortDecoration;
19
+ private worldSnapPointsCache?;
20
+ constructor(options?: NoInfer<O>, properties?: P, Transform?: ElementTransformClass);
21
+ get rotationPivotX(): any;
22
+ get rotationPivotY(): any;
23
+ getEditorCapability<T>(token: EditorCapabilityToken<T>): T | undefined;
24
+ getSelectionBehavior(): {
25
+ readonly mode: import(".").SelectionBehaviorMode.Standard;
26
+ readonly dive: import(".").SelectionDiveMode.None;
27
+ readonly snap: import(".").SelectionSnapMode.Enabled;
28
+ };
29
+ getTransformPolicy(): {
30
+ readonly move: true;
31
+ readonly resize: "both";
32
+ readonly rotate: true;
33
+ readonly rotationPivot: "adjustable";
34
+ };
35
+ getSelectionFrameBounds(): Readonly<Rect> | null;
36
+ resolvePointScope(worldPoint: PointView): {
37
+ readonly kind: "owner";
38
+ };
39
+ hasPointScope(scope: PointEditingScope): scope is {
40
+ readonly kind: "owner";
41
+ };
42
+ hasPointTarget(_scope: PointEditingScope, target: PointEditTarget): boolean;
43
+ getPointControls(_scope: PointEditingScope): readonly PointControlDescriptor[];
44
+ getPointScopeOutline(_scope: PointEditingScope): any;
45
+ resolvePointEdit(request: PointEditRequest): PointOwnerEdit | null;
46
+ private findAnchor;
47
+ private findSegment;
48
+ private ownerPathChange;
49
+ captureTransformBaseline(_bakeGeometry: boolean): {
50
+ reference: import("@fulate/core").ReferenceTransformBaseline;
51
+ ownedState: VectorPathGeometry;
52
+ };
53
+ resolveTransformChange(baseline: Readonly<ElementTransformBaseline<VectorPathGeometry>>, intent: Readonly<TransformIntent | ReparentTransformIntent>): readonly OwnerPropertyChange[];
54
+ protected getMinimumAnchorCount(subpath: AuthoredSubpath): number;
55
+ /** Point pose compensation includes single-anchor layout geometry. */
56
+ protected getPathLayoutBounds(path: VectorPathGeometry): Readonly<Rect> | null;
57
+ /** Transform replaces frame dimensions only when the product has resizable geometry. */
58
+ protected getTransformedPathBounds(path: VectorPathGeometry): Readonly<Rect> | null;
59
+ protected commitConfiguredOptions(options: ElementOptionPatch<O>): void;
60
+ getWorldSnapPointsView(): readonly PointView[];
61
+ paint(paint: PaintContext): void;
62
+ /** 绘制宿主本体;`paint()` 随后统一绘制 custom Port decoration。 */
63
+ protected paintHost(paint: PaintContext): void;
64
+ /** @internal EditorVectorPathTransform 合并非节点 Port decoration bounds。 */
65
+ getConnectionPortDecorationWorldBounds(): Bound;
66
+ protected onPropertiesInstalled(current: P, changes: PropertyChanges): void;
67
+ protected onActivate(root: Root | null, layer: Layer | null): void;
68
+ protected onDeactivate(root: Root | null, layer: Layer | null): void;
69
+ private getConnectionPortDecoration;
70
+ }
@@ -3,5 +3,15 @@ import { type ComputePositionConfig } from "@floating-ui/core";
3
3
  export { flip, offset, shift } from "@floating-ui/core";
4
4
  export type { Placement } from "@floating-ui/core";
5
5
  export type ComputePositionOptions = Omit<ComputePositionConfig, "platform" | "strategy">;
6
- /** Computes world-space coordinates without mutating either element. */
7
- export declare function computePosition(reference: Element, floating: Element, options?: ComputePositionOptions): Promise<import("@floating-ui/core").ComputePositionReturn>;
6
+ /**
7
+ * Reads prepared world geometry; callers await the owning Root before use.
8
+ * Returns parent-space left/top for setOptions({ left: x, top: y }).
9
+ * Middleware dimensions, offsets and middlewareData remain in world space.
10
+ */
11
+ export declare function computePosition(reference: Element, floating: Element, options?: ComputePositionOptions): Promise<{
12
+ x: number;
13
+ y: number;
14
+ placement: import("@floating-ui/utils").Placement;
15
+ strategy: import("@floating-ui/utils").Strategy;
16
+ middlewareData: import("@floating-ui/core").MiddlewareData;
17
+ }>;
package/dist/group.d.ts CHANGED
@@ -1,5 +1,6 @@
1
- import { ChangeImpact, Element, ElementTransform, type BaseElementOption, type ElementTransformBaseline, type ReparentTransformIntent, type TransformIntent } from "@fulate/core";
2
- import { Bound, type BoundingBox, type PointView, type ReadonlyMatrix2D } from "@fulate/share";
1
+ import { EditorElementProperties, type EditorElementOption, type EditorRuntimePatch } from "./editor/properties";
2
+ import { ChangeImpact, Element, ElementTransform, type ElementOptionPatch, type ElementTransformBaseline, type ReparentTransformIntent, type TransformIntent } from "@fulate/core";
3
+ import { Bound, type PointView, type ReadonlyMatrix2D } from "@fulate/share";
3
4
  import { SelectionBehaviorMode, SelectionDiveMode, SelectionSnapMode, type EditorCapabilityToken, type TransformInteractionCapability } from "./editor/capability";
4
5
  /**
5
6
  * Group 成员的逻辑范围:frame capability 优先(Text 等排除绘制溢出),否则为成员 content
@@ -14,7 +15,7 @@ interface GroupTransformChildBaseline {
14
15
  interface GroupTransformOwnedState {
15
16
  readonly children: readonly GroupTransformChildBaseline[];
16
17
  }
17
- export interface GroupOption extends BaseElementOption<Group> {
18
+ export interface GroupOption extends EditorElementOption<Group> {
18
19
  }
19
20
  export declare class GroupTransform<E extends Group = Group> extends ElementTransform<E> {
20
21
  private localContentBounds;
@@ -22,7 +23,7 @@ export declare class GroupTransform<E extends Group = Group> extends ElementTran
22
23
  protected onChildrenChanged(): void;
23
24
  protected onDescendantDirty(_child: ElementTransform, affectsContentBounds: boolean): void;
24
25
  private invalidateContentBounds;
25
- invalidate(impact: ChangeImpact, previousBounds?: Readonly<BoundingBox> | null): void;
26
+ invalidate(impact: ChangeImpact): void;
26
27
  /** @internal Group-local canonical content subtree bounds. */
27
28
  getLocalContentBoundsView(): Readonly<Bound> | null;
28
29
  /** @internal Group-local selection frame derived from child owner frames. */
@@ -35,6 +36,8 @@ export declare class GroupTransform<E extends Group = Group> extends ElementTran
35
36
  protected buildLocalSelectionFrameBounds(): Bound | null;
36
37
  protected buildLocalHitBounds(): Readonly<Bound>;
37
38
  protected containsLocalHitPoint(point: PointView): boolean;
39
+ /** Group 的 visual bounds 是成员的聚合,只由成员贡献 render coverage。 */
40
+ protected getOwnRenderCoverageBoundsView(): any;
38
41
  protected buildVisualBounds(): Readonly<Bound>;
39
42
  protected buildVisualOutline(): {
40
43
  x: number;
@@ -42,11 +45,14 @@ export declare class GroupTransform<E extends Group = Group> extends ElementTran
42
45
  }[];
43
46
  dispose(): void;
44
47
  }
45
- export declare class Group extends Element {
48
+ export declare class Group extends Element<EditorElementProperties, GroupOption, ElementOptionPatch<GroupOption>, EditorRuntimePatch<ElementOptionPatch<GroupOption>>> {
49
+ get rotationPivotX(): import("@fulate/core").OriginX;
50
+ get rotationPivotY(): import("@fulate/core").OriginY;
46
51
  readonly type = "group";
47
52
  private readonly worldSnapPointsCache;
48
53
  readonly transform: GroupTransform<this>;
49
54
  constructor(options?: GroupOption);
55
+ protected commitConfiguredOptions(options: ElementOptionPatch<GroupOption>): void;
50
56
  getEditorCapability<T>(token: EditorCapabilityToken<T>): T | undefined;
51
57
  getSelectionBehavior(): {
52
58
  readonly mode: SelectionBehaviorMode.Standard;
@@ -59,9 +65,12 @@ export declare class Group extends Element {
59
65
  readonly rotate: true;
60
66
  readonly rotationPivot: "adjustable";
61
67
  };
62
- captureTransformBaseline(bakeGeometry: boolean): ElementTransformBaseline<{
63
- children: GroupTransformChildBaseline[];
64
- }>;
68
+ captureTransformBaseline(bakeGeometry: boolean): {
69
+ reference: import("@fulate/core").ReferenceTransformBaseline;
70
+ ownedState: {
71
+ children: GroupTransformChildBaseline[];
72
+ };
73
+ };
65
74
  resolveTransformChange(baseline: Readonly<ElementTransformBaseline<GroupTransformOwnedState>>, intent: Readonly<TransformIntent | ReparentTransformIntent>): readonly import("@fulate/core").OwnerPropertyChange[];
66
75
  getWorldSnapPointsView(): readonly PointView[];
67
76
  getSelectionFrameBounds(): Readonly<Bound>;
package/dist/image.d.ts CHANGED
@@ -1,5 +1,6 @@
1
- import { ChangeImpact, type ElementTransformClass, type Layer, type PropertyChanges, type Root } from "@fulate/core";
2
- import { RectangleProperties, RectangleTransform, type RectangleOption } from "./rectangle";
1
+ import type { PaintContext } from "@fulate/core";
2
+ import { type ElementTransformClass, type Layer, type PropertyChanges, type Root } from "@fulate/core";
3
+ import { RectangleProperties, type RectangleOption } from "./rectangle";
3
4
  import { Bitmap } from "./bitmap";
4
5
  export type ImageResizeMode = "auto" | "none";
5
6
  export interface ImageResizeOption {
@@ -15,43 +16,39 @@ export declare class ImageProperties extends RectangleProperties {
15
16
  src?: string;
16
17
  resize: Readonly<ImageResizeOption>;
17
18
  constructor(options?: ImageOption);
18
- getImpact(changes: PropertyChanges): ChangeImpact;
19
- }
20
- export declare class ImageTransform<E extends Image = Image> extends RectangleTransform<E> {
21
- protected resolveFitSize(): void;
19
+ getImpact(changes: PropertyChanges): number;
22
20
  }
23
21
  export declare class Image<P extends ImageProperties = ImageProperties, O extends ImageOption<any> = ImageOption<any>> extends Bitmap<P, O> {
24
22
  readonly type: string;
23
+ get width(): number;
24
+ get height(): number;
25
25
  get src(): string;
26
26
  get resize(): Readonly<ImageResizeOption>;
27
- protected isLoaded: boolean;
28
- private renderSize;
27
+ /** 已完成的源仍可复用,但不再持有取消句柄。 */
28
+ private sourceLoad;
29
29
  private sourceWidth;
30
30
  private sourceHeight;
31
31
  private externalImage;
32
- private isProcessing;
33
- private processGeneration;
32
+ /** Current load or decode; replacing it retires only that continuation. */
33
+ private processing;
34
34
  constructor(options?: NoInfer<O>, Transform?: ElementTransformClass, properties?: P);
35
- /** Intrinsic width of the current image source, before authored or fit sizing. */
35
+ /** Intrinsic width of the current image source, before authored sizing. */
36
36
  get naturalWidth(): number;
37
- /** Intrinsic height of the current image source, before authored or fit sizing. */
37
+ /** Intrinsic height of the current image source, before authored sizing. */
38
38
  get naturalHeight(): number;
39
39
  get resizeMode(): ImageResizeMode;
40
40
  get resizeQuality(): ImageBitmapOptions["resizeQuality"];
41
41
  setResize(resize: ImageResizeOption): void;
42
+ protected onPropertiesInstalled(current: P, changes: PropertyChanges): void;
42
43
  protected onPropertiesChanged(current: P, changes: PropertyChanges): void;
43
44
  protected onActivate(root: Root | null, layer: Layer | null): void;
44
45
  protected onDeactivate(root: Root | null, layer: Layer | null): void;
45
- protected paintContent(ctx: CanvasRenderingContext2D): void;
46
- paintForExport(ctx: CanvasRenderingContext2D): Promise<void>;
46
+ protected paintContent(paint: PaintContext): void;
47
47
  protected onUnmount(): void;
48
- private cancelProcessing;
49
- protected clearBitmap(): void;
48
+ /** Loads the current source and transfers only its current decoded bitmap to Bitmap. */
50
49
  protected loadAndProcess(): Promise<void>;
51
- private processImage;
52
- private applyBitmap;
53
50
  private calcAutoSize;
54
51
  /** @internal 实际绘制前按当前 Viewport 检查分辨率升级。 */
55
52
  checkResolution(): void;
56
- private loadHTMLImage;
53
+ private getSourceImage;
57
54
  }
package/dist/index.d.ts CHANGED
@@ -11,25 +11,29 @@ export { Circle, CircleTransform } from "./circle";
11
11
  export { Triangle, TriangleTransform } from "./triangle";
12
12
  export { Polygon, PolygonTransform } from "./polygon";
13
13
  export type { PolygonOption } from "./polygon";
14
- export { VectorPath, VectorPathProperties, VectorPathTransform } from "./vector-path";
15
- export type { VectorPathCommand, VectorPathGeometry, VectorPathOption } from "./vector-path";
14
+ export { EditorVectorPath, EditorVectorPathProperties, EditorVectorPathTransform } from "./editor-vector-path";
15
+ export type { EditorVectorPathOption } from "./editor-vector-path";
16
16
  export { Text, TextProperties, TextTransform, resolveTextStyle } from "./text";
17
17
  export type { TextOption, TextStyleConfig, TextStyleKey, ResolvedTextStyle } from "./text";
18
- export { Image, ImageProperties, ImageTransform } from "./image";
18
+ export { Image, ImageProperties } from "./image";
19
19
  export type { ImageOption, ImageResizeOption, ImageResizeMode } from "./image";
20
20
  export { Bitmap } from "./bitmap";
21
21
  export { WorkerSurfacePool } from "./worker-surface";
22
22
  export type { WorkerSurfaceHandle, WorkerSurfacePoolOptions } from "./worker-surface";
23
23
  export { fitWorkspace, workspaceFocusInsetsKey, Workspace, WorkspaceProperties } from "./workspace";
24
- export type { WorkspaceFocusInsetsSource, WorkspaceFitOptions, WorkspaceJSON, WorkspaceOption } from "./workspace";
24
+ export type { WorkspaceFocusInsetsSource, WorkspaceFitOptions, WorkspaceOption } from "./workspace";
25
25
  export { computePosition, flip, offset, shift } from "./floating";
26
26
  export type { ComputePositionOptions, Placement } from "./floating";
27
27
  export { Group, GroupTransform, resolveGroupMemberBounds } from "./group";
28
+ export { EditorElementProperties, EditorShapeProperties } from "./editor/properties";
29
+ export type { EditorElementOption, EditorPivotOptions, EditorRuntimePatch, EditorShapeOption } from "./editor/properties";
28
30
  export type { GroupOption } from "./group";
29
31
  export { ContentEditingCapabilityToken, PointEditingCapabilityToken, SelectionBehaviorMode, SelectionBehaviorCapabilityToken, SelectionDiveMode, SelectionSnapMode, SnapSourceCapabilityToken, TransformInteractionCapabilityToken, defineEditorCapability, getEditorCapability, isEditorCapabilityHost, resolveSelectionFrameBounds } from "./editor/capability";
30
32
  export type { ContentEditingCapability, ContentEditingConsumer, ContentEditingSession, EditorCapabilityHost, EditorCapabilityToken, PointControlDescriptor, PointEditRequest, PointEditTarget, PointEditingCapability, PointEditingScope, PointOwnerEdit, SelectionBehavior, SelectionBehaviorCapability, SnapSourceCapability, TransformInteractionCapability, TransformInteractionPolicy } from "./editor/capability";
31
33
  export { EditorFrameFlush, getEditorFrameFlush } from "./editor/frame-flush";
32
34
  export type { EditorAuthoredGesture, EditorOverlayClient, EditorSpatialClient } from "./editor/frame-flush";
35
+ export { Scrollbars, SCROLLBAR_DEFAULTS } from "./scrollbars";
36
+ export type { ScrollbarOptions } from "./scrollbars";
33
37
  export { ScrollView, ScrollViewTransform } from "./scrollview";
34
38
  export type { ScrollViewOption } from "./scrollview";
35
39
  export { RippleOverlay } from "./ripple";
@@ -39,6 +43,11 @@ export { connectionPortAccepts, connectEndpoint, disconnectEndpoint, getEndpoint
39
43
  export type { BindableEndpoint, EndpointConnectionRole, EndpointRef, EndpointRelation, EndpointRelationBinding, EndpointRelationSource } from "./connection";
40
44
  export { LineTree, LineTreeProperties, LineTreeTransform, EMPTY_LINE_TREE_TOPOLOGY, DEFAULT_LINE_TREE_BRANCH_STYLE, addLineTreeBranchAtTail, createLineTreeTopology, getLineTreeBranch, getLineTreeJunctionAnchorIds, getLineTreePoint, getLineTreePointReferenceCounts, insertLineTreePoint, moveLineTreePoint, removeLineTreeBranch, removeLineTreePoint, remapLineTreeRelations, transformLineTreeTopology, updateLineTreeBranchStyle } from "./line-tree";
41
45
  export type { LineTreeBranch, LineTreeBranchRemoval, LineTreeBranchTailSource, LineTreeBranchStyle, LineTreeBranchVertex, LineTreeOption, LineTreePoint, LineTreeTopology } from "./line-tree";
42
- export { applyLineTreeTopologyDelta, createLineTreeTopologyDelta } from "./line-tree/history-delta";
46
+ export { applyLineTreeTopologyDelta, createLineTreeTopologyDelta, hasLineTreeTopologyChange } from "./line-tree/history-delta";
43
47
  export type { LineTreeTopologyDelta } from "./line-tree/history-delta";
44
- export type { LineDecoration, LineEndpointRelationPatch, LineEndpointUpdate, LineOption, } from "./line/index";
48
+ export type { LineDecoration, LineEndpointRelationPatch, LineEndpointUpdate, LineOption } from "./line/index";
49
+ export * from "./line/geometry";
50
+ export * from "./line/orthogonal";
51
+ export { resolveOrthogonalEndpoint } from "./line/base";
52
+ export { elementV2Codecs } from "./serialization";
53
+ export type { LineV2 } from "./serialization";