@fulate/ui 1.0.0
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 +199 -0
- package/dist/authored-path.d.ts +28 -0
- package/dist/bitmap.d.ts +19 -0
- package/dist/circle.d.ts +23 -0
- package/dist/connection/commands.d.ts +27 -0
- package/dist/connection/endpoint-relation-index.d.ts +27 -0
- package/dist/connection/index.d.ts +4 -0
- package/dist/connection/types.d.ts +37 -0
- package/dist/connection-port-decoration.d.ts +27 -0
- package/dist/editor/capability.d.ts +150 -0
- package/dist/editor/frame-flush.d.ts +39 -0
- package/dist/editor/shape.d.ts +38 -0
- package/dist/editor/transform.d.ts +8 -0
- package/dist/floating.d.ts +9 -0
- package/dist/group.d.ts +44 -0
- package/dist/image.d.ts +52 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.js +5956 -0
- package/dist/line/base.d.ts +142 -0
- package/dist/line/helpers/decoration.d.ts +4 -0
- package/dist/line/index.d.ts +3 -0
- package/dist/line/straight-primitives.d.ts +8 -0
- package/dist/line/straight.d.ts +19 -0
- package/dist/line-tree/history-delta.d.ts +22 -0
- package/dist/line-tree/index.d.ts +74 -0
- package/dist/line-tree/topology.d.ts +39 -0
- package/dist/line-tree/transform.d.ts +54 -0
- package/dist/line-tree/types.d.ts +46 -0
- package/dist/paint/circle.d.ts +3 -0
- package/dist/point-controls.d.ts +6 -0
- package/dist/polygon.d.ts +52 -0
- package/dist/rectangle.d.ts +27 -0
- package/dist/ripple.d.ts +29 -0
- package/dist/scrollview.d.ts +68 -0
- package/dist/text/block.d.ts +31 -0
- package/dist/text/editing.d.ts +16 -0
- package/dist/text/index.d.ts +149 -0
- package/dist/text/layout.d.ts +101 -0
- package/dist/text/paint.d.ts +59 -0
- package/dist/text/style.d.ts +13 -0
- package/dist/triangle.d.ts +20 -0
- package/dist/vector-path.d.ts +58 -0
- package/dist/worker-surface-protocol.d.ts +26 -0
- package/dist/worker-surface-worker.d.ts +25 -0
- package/dist/worker-surface-worker.js +109 -0
- package/dist/worker-surface.d.ts +23 -0
- package/dist/workspace.d.ts +44 -0
- package/package.json +33 -0
package/dist/group.d.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Element, ElementTransform, type BaseElementOption, type ElementTransformBaseline, type ReparentTransformIntent, type TransformIntent } from "@fulate/core";
|
|
2
|
+
import { Bound, type PointView } from "@fulate/share";
|
|
3
|
+
import { SelectionBehaviorMode, SelectionDiveMode, SelectionSnapMode, type EditorCapabilityToken } from "./editor/capability";
|
|
4
|
+
export interface GroupOption extends BaseElementOption<Group> {
|
|
5
|
+
}
|
|
6
|
+
export declare class GroupTransform<E extends Group = Group> extends ElementTransform<E> {
|
|
7
|
+
private localContentBounds;
|
|
8
|
+
protected onChildrenChanged(): void;
|
|
9
|
+
protected onDescendantDirty(_child: ElementTransform, affectsContentBounds: boolean): void;
|
|
10
|
+
private invalidateContentBounds;
|
|
11
|
+
/** @internal Group-local canonical content subtree bounds. */
|
|
12
|
+
getLocalContentBoundsView(): Readonly<Bound> | null;
|
|
13
|
+
/** Group 是 content bounds owner;ancestor 只投影这份 local view。 */
|
|
14
|
+
protected collectContentBoundsInReference(parentMatrix: DOMMatrixReadOnly, _referenceWorldInverse: DOMMatrixReadOnly): Bound;
|
|
15
|
+
/** 只合并真实 content members;不贡献 content bounds 的 branch 返回 null。 */
|
|
16
|
+
protected buildLocalContentBounds(): Bound | null;
|
|
17
|
+
protected buildLocalHitBounds(): Readonly<Bound>;
|
|
18
|
+
protected containsLocalHitPoint(point: PointView): boolean;
|
|
19
|
+
protected buildVisualBounds(): Readonly<Bound>;
|
|
20
|
+
protected buildVisualOutline(): {
|
|
21
|
+
x: number;
|
|
22
|
+
y: number;
|
|
23
|
+
}[];
|
|
24
|
+
dispose(): void;
|
|
25
|
+
}
|
|
26
|
+
export declare class Group extends Element {
|
|
27
|
+
readonly type = "group";
|
|
28
|
+
constructor(options?: GroupOption);
|
|
29
|
+
getEditorCapability<T>(token: EditorCapabilityToken<T>): T | undefined;
|
|
30
|
+
getSelectionBehavior(): {
|
|
31
|
+
readonly mode: SelectionBehaviorMode.Standard;
|
|
32
|
+
readonly dive: SelectionDiveMode.DirectChild;
|
|
33
|
+
readonly snap: SelectionSnapMode.Enabled;
|
|
34
|
+
};
|
|
35
|
+
getTransformPolicy(): {
|
|
36
|
+
readonly move: true;
|
|
37
|
+
readonly resize: "both";
|
|
38
|
+
readonly rotate: true;
|
|
39
|
+
readonly rotationPivot: "adjustable";
|
|
40
|
+
};
|
|
41
|
+
captureTransformBaseline(): ElementTransformBaseline<any>;
|
|
42
|
+
resolveTransformChange(baseline: Readonly<ElementTransformBaseline>, intent: Readonly<TransformIntent | ReparentTransformIntent>): import("@fulate/core").OwnerPropertyChange;
|
|
43
|
+
getWorldSnapPointsView(): readonly PointView[];
|
|
44
|
+
}
|
package/dist/image.d.ts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ChangeImpact, type ElementTransformClass, type Layer, type PropertyChanges, type Root } from "@fulate/core";
|
|
2
|
+
import { RectangleProperties, RectangleTransform, type RectangleOption } from "./rectangle";
|
|
3
|
+
import { Bitmap } from "./bitmap";
|
|
4
|
+
export type ImageResizeMode = "auto" | "none";
|
|
5
|
+
export interface ImageResizeOption {
|
|
6
|
+
mode?: ImageResizeMode;
|
|
7
|
+
resizeQuality?: ImageBitmapOptions["resizeQuality"];
|
|
8
|
+
}
|
|
9
|
+
export interface ImageOption<T = Image> extends RectangleOption<T> {
|
|
10
|
+
src?: string;
|
|
11
|
+
image?: HTMLImageElement | HTMLCanvasElement;
|
|
12
|
+
resize?: ImageResizeOption;
|
|
13
|
+
}
|
|
14
|
+
export declare class ImageProperties extends RectangleProperties {
|
|
15
|
+
src?: string;
|
|
16
|
+
resize: Readonly<ImageResizeOption>;
|
|
17
|
+
constructor(options?: ImageOption);
|
|
18
|
+
getImpact(changes: PropertyChanges): ChangeImpact;
|
|
19
|
+
}
|
|
20
|
+
export declare class ImageTransform<E extends Image = Image> extends RectangleTransform<E> {
|
|
21
|
+
}
|
|
22
|
+
export declare class Image<P extends ImageProperties = ImageProperties, O extends ImageOption<any> = ImageOption<any>> extends Bitmap<P, O> {
|
|
23
|
+
readonly type: string;
|
|
24
|
+
get src(): string;
|
|
25
|
+
get resize(): Readonly<ImageResizeOption>;
|
|
26
|
+
protected isLoaded: boolean;
|
|
27
|
+
private renderSize;
|
|
28
|
+
private naturalWidth;
|
|
29
|
+
private naturalHeight;
|
|
30
|
+
private isProcessing;
|
|
31
|
+
private processGeneration;
|
|
32
|
+
constructor(options?: NoInfer<O>, Transform?: ElementTransformClass, properties?: P);
|
|
33
|
+
get resizeMode(): ImageResizeMode;
|
|
34
|
+
get resizeQuality(): ImageBitmapOptions["resizeQuality"];
|
|
35
|
+
setResize(resize: ImageResizeOption): void;
|
|
36
|
+
protected onPropertiesChanged(current: P, changes: PropertyChanges): void;
|
|
37
|
+
protected onActivate(root: Root | null, layer: Layer | null): void;
|
|
38
|
+
protected onDeactivate(root: Root | null, layer: Layer | null): void;
|
|
39
|
+
protected paintContent(ctx: CanvasRenderingContext2D): void;
|
|
40
|
+
paintForExport(ctx: CanvasRenderingContext2D): Promise<void>;
|
|
41
|
+
protected onUnmount(): void;
|
|
42
|
+
private cancelProcessing;
|
|
43
|
+
protected clearBitmap(): void;
|
|
44
|
+
private setExternalImage;
|
|
45
|
+
protected loadAndProcess(): Promise<void>;
|
|
46
|
+
private processImage;
|
|
47
|
+
private applyBitmap;
|
|
48
|
+
private calcAutoSize;
|
|
49
|
+
/** @internal 实际绘制前按当前 Viewport 检查分辨率升级。 */
|
|
50
|
+
checkResolution(): void;
|
|
51
|
+
private loadHTMLImage;
|
|
52
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export { measureTextWidth, fitTextWithEllipsis } from "./text/layout";
|
|
2
|
+
export { measureTextRun } from "./text/paint";
|
|
3
|
+
export type { TextLineBoxMetrics, TextRunMetrics } from "./text/paint";
|
|
4
|
+
export { Rectangle, RectangleProperties, RectangleTransform } from "./rectangle";
|
|
5
|
+
export type { RectangleOption, RectangleOptionPatch } from "./rectangle";
|
|
6
|
+
export { Circle, CircleTransform } from "./circle";
|
|
7
|
+
export { Triangle, TriangleTransform } from "./triangle";
|
|
8
|
+
export { Polygon, PolygonTransform } from "./polygon";
|
|
9
|
+
export type { PolygonOption } from "./polygon";
|
|
10
|
+
export { VectorPath, VectorPathProperties, VectorPathTransform } from "./vector-path";
|
|
11
|
+
export type { VectorPathCommand, VectorPathGeometry, VectorPathOption } from "./vector-path";
|
|
12
|
+
export { Text, TextProperties, TextTransform } from "./text";
|
|
13
|
+
export type { TextOption } from "./text";
|
|
14
|
+
export { Image, ImageProperties, ImageTransform } from "./image";
|
|
15
|
+
export type { ImageOption, ImageResizeOption, ImageResizeMode } from "./image";
|
|
16
|
+
export { Bitmap } from "./bitmap";
|
|
17
|
+
export { WorkerSurfacePool } from "./worker-surface";
|
|
18
|
+
export type { WorkerSurfaceHandle, WorkerSurfacePoolOptions } from "./worker-surface";
|
|
19
|
+
export { fitWorkspace, workspaceFocusInsetsKey, Workspace, WorkspaceProperties } from "./workspace";
|
|
20
|
+
export type { WorkspaceFocusInsetsSource, WorkspaceFitOptions, WorkspaceJSON, WorkspaceOption } from "./workspace";
|
|
21
|
+
export { arrow, autoPlacement, computePosition, createFloatingPlatform, detectOverflow, flip, hide, limitShift, offset, shift, size } from "./floating";
|
|
22
|
+
export type { ComputePositionOptions, ComputePositionReturn, Middleware, MiddlewareData, Placement, Strategy } from "./floating";
|
|
23
|
+
export { Group, GroupTransform } from "./group";
|
|
24
|
+
export type { GroupOption } from "./group";
|
|
25
|
+
export { ContentEditingCapabilityToken, PointEditingCapabilityToken, SelectionBehaviorMode, SelectionBehaviorCapabilityToken, SelectionDiveMode, SelectionSnapMode, SnapSourceCapabilityToken, TransformInteractionCapabilityToken, defineEditorCapability, getEditorCapability, isEditorCapabilityHost } from "./editor/capability";
|
|
26
|
+
export type { ContentEditingCapability, ContentEditingConsumer, ContentEditingSession, EditorCapabilityHost, EditorCapabilityToken, PointControlDescriptor, PointEditRequest, PointEditTarget, PointEditingCapability, PointEditingScope, PointOwnerEdit, SelectionBehavior, SelectionBehaviorCapability, SnapSourceCapability, TransformInteractionCapability, TransformInteractionPolicy } from "./editor/capability";
|
|
27
|
+
export { EditorFrameFlush, getEditorFrameFlush } from "./editor/frame-flush";
|
|
28
|
+
export type { EditorAuthoredGesture, EditorOverlayClient, EditorSpatialClient } from "./editor/frame-flush";
|
|
29
|
+
export { ScrollView, ScrollViewTransform } from "./scrollview";
|
|
30
|
+
export type { ScrollViewOption } from "./scrollview";
|
|
31
|
+
export { RippleOverlay } from "./ripple";
|
|
32
|
+
export type { RippleOption } from "./ripple";
|
|
33
|
+
export { BaseLine, LineTransform, Line } from "./line/index";
|
|
34
|
+
export { connectionPortAccepts, connectEndpoint, disconnectEndpoint, getEndpointRelationIndex, hasConnectionPortCapacity, isEndpointRelationSource, resolveConnectionPortChanges, resolveConnectEndpointChange, resolveDisconnectEndpointChanges, EndpointRelationIndex } from "./connection";
|
|
35
|
+
export type { BindableEndpoint, EndpointConnectionRole, EndpointRef, EndpointRelation, EndpointRelationBinding, EndpointRelationSource } from "./connection";
|
|
36
|
+
export { LineTree, LineTreeProperties, LineTreeTransform, EMPTY_LINE_TREE_TOPOLOGY, DEFAULT_LINE_TREE_BRANCH_STYLE, addLineTreeBranchAtTail, createLineTreeTopology, getLineTreeBranch, getLineTreeBindableEndpoints, getLineTreeEndpointRelationBindings, getLineTreeJunctionAnchorIds, getLineTreePoint, getLineTreePointReferenceCounts, insertLineTreePoint, moveLineTreePoint, removeLineTreeBranch, removeLineTreePoint, remapLineTreeRelations, scaleLineTreeTopology, updateLineTreeBranchStyle } from "./line-tree";
|
|
37
|
+
export type { LineTreeBranch, LineTreeBranchRemoval, LineTreeBranchTailSource, LineTreeBranchStyle, LineTreeBranchVertex, LineTreeOption, LineTreePoint, LineTreeTopology } from "./line-tree";
|
|
38
|
+
export { applyLineTreeTopologyDelta, createLineTreeTopologyDelta } from "./line-tree/history-delta";
|
|
39
|
+
export type { LineTreeTopologyDelta } from "./line-tree/history-delta";
|
|
40
|
+
export type { LineDecoration, LineEndpointRelationPatch, LineEndpointUpdate, LineOption, } from "./line/index";
|