@fulate/ui 1.0.14 → 1.0.19

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.
@@ -109,7 +109,7 @@ export declare abstract class BaseLine extends Element<LineProperties, LineOptio
109
109
  readonly rotationPivot: "adjustable";
110
110
  };
111
111
  protected resolvePointPathPatch(path: AuthoredSubpath): LinePatch;
112
- captureTransformBaseline(): ElementTransformBaseline<LineTransformOwnedState>;
112
+ captureTransformBaseline(_bakeGeometry: boolean): ElementTransformBaseline<LineTransformOwnedState>;
113
113
  resolveTransformChange(baseline: Readonly<ElementTransformBaseline<LineTransformOwnedState>>, intent: Readonly<TransformIntent | ReparentTransformIntent>): readonly OwnerPropertyChange[];
114
114
  protected resolveOptions(options: LinePatch): LinePatch;
115
115
  get headAnchor(): AuthoredPathAnchor;
@@ -1,5 +1,5 @@
1
1
  import { ChangeImpact, Element, ElementProperties, type ElementTransformBaseline, type ConnectionPortRef, type Layer, type OwnerPropertyChange, type PropertyChanges, type ReparentTransformIntent, type Root, type AnchorId, type SubpathId, type TransformIntent } from "@fulate/core";
2
- import { type PointView } from "@fulate/share";
2
+ import type { PointView } from "@fulate/share";
3
3
  import { SelectionBehaviorMode, SelectionDiveMode, SelectionSnapMode, type EditorCapabilityToken, type PointEditRequest, type PointEditingScope, type PointOwnerEdit } from "../editor/capability";
4
4
  import { type BindableEndpoint, type EndpointRelation, type EndpointRelationBinding } from "../connection/types";
5
5
  import { LineTreeTransform } from "./transform";
@@ -43,8 +43,9 @@ export declare class LineTree extends Element<LineTreeProperties, LineTreeOption
43
43
  readonly rotationPivot: "adjustable";
44
44
  };
45
45
  private materializeEffectiveTopology;
46
- private preservePoseForTopology;
47
- captureTransformBaseline(): ElementTransformBaseline<LineTreeTransformOwnedState>;
46
+ /** @internal Point edits and branch extension retain the current world pose. */
47
+ resolvePointTopologyPatch(topology: LineTreeTopology): LineTreePatch;
48
+ captureTransformBaseline(_bakeGeometry: boolean): ElementTransformBaseline<LineTreeTransformOwnedState>;
48
49
  resolveTransformChange(baseline: Readonly<ElementTransformBaseline<LineTreeTransformOwnedState>>, intent: Readonly<TransformIntent | ReparentTransformIntent>): readonly OwnerPropertyChange[];
49
50
  getWorldSnapPointsView(): readonly PointView[];
50
51
  getEndpointRole(anchorId: AnchorId): "input" | "output";
@@ -70,5 +71,5 @@ export declare class LineTree extends Element<LineTreeProperties, LineTreeOption
70
71
  protected onDeactivate(root: Root | null, layer: Layer | null): void;
71
72
  }
72
73
  export { LineTreeTransform } from "./transform";
73
- export { EMPTY_LINE_TREE_TOPOLOGY, DEFAULT_LINE_TREE_BRANCH_STYLE, addLineTreeBranchAtTail, createLineTreeTopology, getLineTreeBranch, getLineTreeBindableEndpoints, getLineTreeEndpointRelationBindings, getLineTreeEndpointRole, getLineTreeJunctionAnchorIds, getLineTreePoint, getLineTreePointReferenceCounts, insertLineTreePoint, moveLineTreePoint, removeLineTreeBranch, removeLineTreePoint, remapLineTreeRelations, transformLineTreeTopology, updateLineTreeBranchStyle } from "./topology";
74
+ export { EMPTY_LINE_TREE_TOPOLOGY, DEFAULT_LINE_TREE_BRANCH_STYLE, addLineTreeBranchAtTail, createLineTreeTopology, getLineTreeBranch, getLineTreeJunctionAnchorIds, getLineTreePoint, getLineTreePointReferenceCounts, insertLineTreePoint, moveLineTreePoint, removeLineTreeBranch, removeLineTreePoint, remapLineTreeRelations, transformLineTreeTopology, updateLineTreeBranchStyle } from "./topology";
74
75
  export type { LineTreeBranch, LineTreeBranchRemoval, LineTreeBranchTailSource, LineTreeBranchStyle, LineTreeBranchVertex, LineTreeOption, LineTreePoint, LineTreeTopology } from "./types";
@@ -1,7 +1,7 @@
1
1
  import { type AnchorId, type SegmentId, type SubpathId } from "@fulate/core";
2
- import { type PointView, type Rect } from "@fulate/share";
2
+ import { type PointView, type ReadonlyMatrix2D, type Rect } from "@fulate/share";
3
3
  import type { LineEndpointRelationPatch } from "../line/base";
4
- import type { BindableEndpoint, EndpointRelation, EndpointRelationBinding } from "../connection/types";
4
+ import type { EndpointRelation } from "../connection/types";
5
5
  import type { LineTreeBranch, LineTreeBranchRemoval, LineTreeBranchStyle, LineTreePoint, LineTreeTopology } from "./types";
6
6
  export declare const EMPTY_LINE_TREE_TOPOLOGY: LineTreeTopology;
7
7
  export declare const DEFAULT_LINE_TREE_BRANCH_STYLE: LineTreeBranchStyle;
@@ -12,9 +12,6 @@ export declare function getLineTreeBranch(topology: LineTreeTopology, subpathId:
12
12
  export declare function getLineTreePointReferenceCounts(topology: LineTreeTopology): Map<AnchorId, number>;
13
13
  export declare function getLineTreeJunctionAnchorIds(topology: LineTreeTopology): AnchorId[];
14
14
  export declare function getLineTreePointDegrees(topology: LineTreeTopology): Map<AnchorId, number>;
15
- export declare function getLineTreeEndpointRelationBindings(topology: LineTreeTopology, elementKey: string): readonly EndpointRelationBinding[];
16
- export declare function getLineTreeBindableEndpoints(topology: LineTreeTopology, elementKey: string): readonly BindableEndpoint[];
17
- export declare function getLineTreeEndpointRole(topology: LineTreeTopology, anchorId: AnchorId): "input" | "output";
18
15
  export declare function moveLineTreePoint(topology: LineTreeTopology, anchorId: AnchorId, point: PointView, relation: EndpointRelation | undefined): LineTreeTopology;
19
16
  export declare function insertLineTreePoint(topology: LineTreeTopology, segmentId: SegmentId, point: PointView): {
20
17
  topology: {
@@ -35,5 +32,5 @@ export declare function addLineTreeBranchAtTail(topology: LineTreeTopology, pare
35
32
  };
36
33
  export declare function removeLineTreeBranch(topology: LineTreeTopology, subpathId: SubpathId): LineTreeBranchRemoval;
37
34
  export declare function updateLineTreeBranchStyle(topology: LineTreeTopology, subpathId: SubpathId, style: LineTreeBranchStyle): LineTreeTopology;
38
- export declare function transformLineTreeTopology(topology: LineTreeTopology, matrix: DOMMatrixReadOnly): LineTreeTopology;
35
+ export declare function transformLineTreeTopology(topology: LineTreeTopology, matrix: ReadonlyMatrix2D): LineTreeTopology;
39
36
  export declare function remapLineTreeRelations(topology: LineTreeTopology, keyMap: ReadonlyMap<string, string>): LineTreeTopology;
@@ -5,6 +5,7 @@ import type { LineTreeBranch, LineTreeBranchTailSource, LineTreePoint } from "./
5
5
  export declare class LineTreeTransform<E extends LineTree = LineTree> extends ElementTransform<E> {
6
6
  private topologySource;
7
7
  private pointById;
8
+ private hasEndpointRelations;
8
9
  private branchById;
9
10
  private endpointRoleById;
10
11
  private junctionAnchorIds;
package/dist/polygon.d.ts CHANGED
@@ -35,8 +35,9 @@ export declare class Polygon extends EditorShape<PolygonProperties, PolygonOptio
35
35
  };
36
36
  getPointControls(_scope: PointEditingScope): import(".").PointControlDescriptor[];
37
37
  getPointScopeOutline(_scope: PointEditingScope): any;
38
+ private resolvePointContourPatch;
38
39
  resolvePointEdit(request: PointEditRequest): PointOwnerEdit | null;
39
- captureTransformBaseline(): ElementTransformBaseline<AuthoredSubpath<import("@fulate/core").AuthoredPathAnchor>>;
40
+ captureTransformBaseline(_bakeGeometry: boolean): ElementTransformBaseline<AuthoredSubpath<import("@fulate/core").AuthoredPathAnchor>>;
40
41
  resolveTransformChange(baseline: Readonly<ElementTransformBaseline<AuthoredSubpath>>, intent: Readonly<TransformIntent | ReparentTransformIntent>): readonly OwnerPropertyChange[];
41
42
  protected buildPath(ctx: CanvasRenderingContext2D): void;
42
43
  protected buildBorderPath(ctx: CanvasRenderingContext2D): void;
@@ -1,6 +1,6 @@
1
1
  import { ChangeImpact, CustomEvent, type Layer, type PropertyChanges, type Root } from "@fulate/core";
2
2
  import { Rectangle, RectangleProperties, RectangleTransform, type RectangleOption } from "./rectangle";
3
- import type { PointView } from "@fulate/share";
3
+ import { type PointView, type ReadonlyMatrix2D } from "@fulate/share";
4
4
  export interface ScrollViewOption extends RectangleOption<ScrollView> {
5
5
  scrollX?: number;
6
6
  scrollY?: number;
@@ -29,7 +29,7 @@ export declare class ScrollViewTransform<E extends ScrollView = ScrollView> exte
29
29
  private readonly childWorldMatrix;
30
30
  protected onChildrenChanged(): void;
31
31
  protected onDescendantDirty(): void;
32
- protected getChildWorldMatrixView(): DOMMatrixReadOnly;
32
+ protected getChildWorldMatrixView(): ReadonlyMatrix2D;
33
33
  protected resolveFitSize(): void;
34
34
  }
35
35
  export declare class ScrollView extends Rectangle<ScrollViewProperties, ScrollViewOption> {
@@ -137,6 +137,7 @@ export declare class Text<P extends TextProperties = TextProperties, O extends T
137
137
  getVisibleTextBounds(): Rect | null;
138
138
  enterEditing(initialClickLocal?: PointView): void;
139
139
  exitEditing(): void;
140
+ /** 更新文本属性,并同步当前正在使用的 textarea。 */
140
141
  setEditingText(value: string): void;
141
142
  protected onPropertiesChanged(current: P, changes: PropertyChanges): void;
142
143
  protected onActivate(root: Root | null, layer: Layer | null): void;
@@ -111,6 +111,7 @@ export declare class TextLayoutSnapshot {
111
111
  getLineSourceRange(index: number): TextLineSourceRange;
112
112
  getLineIndex(offset: number): number;
113
113
  getLineX(index: number, width: number, textAlign: string): number;
114
+ getBlockHorizontalOffset(width: number, textAlign: string, contentWidth?: number): number;
114
115
  getBlockVerticalOffset(height: number, verticalAlign: string, contentHeight?: number): number;
115
116
  getCaretLocalXY(caretIndex: number, width: number, height: number, textAlign: string, verticalAlign: string, fontSize: number): {
116
117
  x: number;
@@ -1,4 +1,4 @@
1
- import { type PointView } from "@fulate/share";
1
+ import type { PointView } from "@fulate/share";
2
2
  import { ChangeImpact, ShapeProperties, type AuthoredSubpath, type GeometrySnapshot, type OwnerPropertyChange, type PropertyChanges, type ReparentTransformIntent, type ShapeOption, type ShapeOptionPatch, type ElementTransformBaseline, type TransformIntent } from "@fulate/core";
3
3
  import { EditorShape, EditorShapeTransform } from "./editor/shape";
4
4
  import { type EditorCapabilityToken, type PointControlDescriptor, type PointEditRequest, type PointEditingScope, type PointOwnerEdit } from "./editor/capability";
@@ -51,7 +51,7 @@ export declare class VectorPath extends EditorShape<VectorPathProperties, Vector
51
51
  private findAnchor;
52
52
  private findSegment;
53
53
  private ownerPathChange;
54
- captureTransformBaseline(): ElementTransformBaseline<VectorPathGeometry>;
54
+ captureTransformBaseline(_bakeGeometry: boolean): ElementTransformBaseline<VectorPathGeometry>;
55
55
  resolveTransformChange(baseline: Readonly<ElementTransformBaseline<VectorPathGeometry>>, intent: Readonly<TransformIntent | ReparentTransformIntent>): readonly OwnerPropertyChange[];
56
56
  protected buildPath(ctx: CanvasRenderingContext2D): void;
57
57
  }
@@ -89,7 +89,7 @@ var BitmapFrameEmitter = class {
89
89
  const pending = createImageBitmap(this.getCanvas());
90
90
  this.pending = pending;
91
91
  pending.then((bitmap) => {
92
- if (!this.active || this.paused || this.pending !== pending || this.queued) {
92
+ if (!this.active || this.paused || this.queued) {
93
93
  bitmap.close();
94
94
  return;
95
95
  }
@@ -100,7 +100,7 @@ var BitmapFrameEmitter = class {
100
100
  throw error;
101
101
  }
102
102
  }).finally(() => {
103
- if (this.pending === pending) this.pending = null;
103
+ this.pending = null;
104
104
  if (this.active && !this.paused && this.queued) this.flush();
105
105
  });
106
106
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fulate/ui",
3
- "version": "1.0.14",
3
+ "version": "1.0.19",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",