@fulate/ui 1.0.19 → 2.0.11
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.
- package/README.md +81 -12
- package/dist/circle.d.ts +2 -1
- package/dist/connection/commands.d.ts +3 -3
- package/dist/connection/types.d.ts +5 -1
- package/dist/connection-port-decoration.d.ts +18 -2
- package/dist/editor/capability.d.ts +37 -6
- package/dist/editor/frame-flush.d.ts +3 -4
- package/dist/editor/properties.d.ts +31 -0
- package/dist/editor/shape-capability.d.ts +13 -0
- package/dist/editor/shape.d.ts +16 -19
- package/dist/editor/transform.d.ts +1 -3
- package/dist/editor-vector-path.d.ts +70 -0
- package/dist/floating.d.ts +12 -2
- package/dist/group.d.ts +17 -8
- package/dist/image.d.ts +16 -19
- package/dist/index.d.ts +13 -6
- package/dist/index.js +2683 -1590
- package/dist/line/base.d.ts +64 -27
- package/dist/line/geometry.d.ts +28 -0
- package/dist/line/index.d.ts +2 -0
- package/dist/line/label.d.ts +58 -0
- package/dist/line/orthogonal.d.ts +23 -0
- package/dist/line/straight.d.ts +7 -3
- package/dist/line-tree/history-delta.d.ts +2 -0
- package/dist/line-tree/index.d.ts +15 -8
- package/dist/line-tree/transform.d.ts +1 -0
- package/dist/line-tree/types.d.ts +3 -2
- package/dist/polygon.d.ts +19 -38
- package/dist/rectangle.d.ts +5 -4
- package/dist/ripple.d.ts +18 -4
- package/dist/scrollbars.d.ts +36 -0
- package/dist/scrollview.d.ts +27 -21
- package/dist/text/block.d.ts +5 -1
- package/dist/text/editing.d.ts +54 -12
- package/dist/text/index.d.ts +22 -20
- package/dist/text/layout.d.ts +8 -2
- package/dist/text/paint.d.ts +3 -2
- package/dist/text/style.d.ts +4 -0
- package/dist/triangle.d.ts +10 -5
- package/dist/worker-surface-worker.d.ts +4 -1
- package/dist/worker-surface-worker.js +11 -8
- package/dist/worker-surface.d.ts +1 -0
- package/dist/workspace.d.ts +3 -3
- package/package.json +33 -33
- package/dist/authored-path.d.ts +0 -28
- package/dist/vector-path.d.ts +0 -58
package/dist/group.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
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
|
|
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
|
|
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):
|
|
63
|
-
|
|
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
|
|
2
|
-
import {
|
|
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):
|
|
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
|
-
|
|
28
|
-
private
|
|
27
|
+
/** 已完成的源仍可复用,但不再持有取消句柄。 */
|
|
28
|
+
private sourceLoad;
|
|
29
29
|
private sourceWidth;
|
|
30
30
|
private sourceHeight;
|
|
31
31
|
private externalImage;
|
|
32
|
-
|
|
33
|
-
private
|
|
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
|
|
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
|
|
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(
|
|
46
|
-
paintForExport(ctx: CanvasRenderingContext2D): Promise<void>;
|
|
46
|
+
protected paintContent(paint: PaintContext): void;
|
|
47
47
|
protected onUnmount(): void;
|
|
48
|
-
|
|
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
|
|
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 {
|
|
15
|
-
export type {
|
|
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
|
|
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,
|
|
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,9 @@ 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
|
|
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";
|