@fulate/ui 1.0.14 → 1.0.15
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 +19 -19
- package/dist/authored-path.d.ts +2 -2
- package/dist/editor/shape.d.ts +2 -2
- package/dist/editor/transform.d.ts +1 -1
- package/dist/group.d.ts +9 -7
- package/dist/index.d.ts +1 -1
- package/dist/index.js +41 -50
- package/dist/line-tree/topology.d.ts +2 -2
- package/dist/scrollview.d.ts +2 -2
- package/dist/vector-path.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -133,9 +133,9 @@ Rectangle、Triangle及其他Shape省略`backgroundColor`/`borderColor`时读取
|
|
|
133
133
|
`skin.lineStroke`。显式值始终优先,Shape的显式`null`关闭绘制,显式字段清回`undefined`后立即重新
|
|
134
134
|
继承Skin。Skin改变只触发现有Root/Layer重绘,不改写element、branch topology或History。
|
|
135
135
|
|
|
136
|
-
LineTree整体resize把全部拓扑点按完整仿射写回 authored topology。随后Point移动或插入anchor时在
|
|
137
|
-
同一owner change内保留当前world pose;包括反向scale在内,只有目标anchor改变world位置,其他points
|
|
138
|
-
保持不动。
|
|
136
|
+
LineTree整体resize把全部拓扑点按完整仿射写回 authored topology。随后Point移动或插入anchor时在
|
|
137
|
+
同一owner change内保留当前world pose;包括反向scale在内,只有目标anchor改变world位置,其他points
|
|
138
|
+
保持不动。
|
|
139
139
|
|
|
140
140
|
## Text 尺寸与显示
|
|
141
141
|
|
|
@@ -159,13 +159,13 @@ import { measureTextRun } from "@fulate/ui";
|
|
|
159
159
|
const metrics = measureTextRun(ctx, text, root.skin.text, 14, 500);
|
|
160
160
|
```
|
|
161
161
|
|
|
162
|
-
每次调用只执行一次 `ctx.measureText()`,返回 `font`、`width`、`lineHeight`、`drawY`、
|
|
163
|
-
`alphabeticBaseline`、`textBaseline` 和 `letterSpacing`。`drawY` 根据原生 Canvas 的
|
|
164
|
-
`fontBoundingBoxAscent`/`fontBoundingBoxDescent` 把字体行框放到行框中心;`alphabeticBaseline`
|
|
165
|
-
是同一行框内的规范 alphabetic baseline,因此不同字号的 run 可以直接对齐。空文本的 `width`
|
|
166
|
-
为 `0`,但仍测量一个空格以取得稳定字体度量。函数会把本次测量所需的文字状态写入 `ctx`,不会
|
|
167
|
-
调用 `save()` 或 `restore()`;Canvas 生命周期以及业务特有的文字顺序、对齐和绘制仍由 Shape
|
|
168
|
-
自己拥有。
|
|
162
|
+
每次调用只执行一次 `ctx.measureText()`,返回 `font`、`width`、`lineHeight`、`drawY`、
|
|
163
|
+
`alphabeticBaseline`、`textBaseline` 和 `letterSpacing`。`drawY` 根据原生 Canvas 的
|
|
164
|
+
`fontBoundingBoxAscent`/`fontBoundingBoxDescent` 把字体行框放到行框中心;`alphabeticBaseline`
|
|
165
|
+
是同一行框内的规范 alphabetic baseline,因此不同字号的 run 可以直接对齐。空文本的 `width`
|
|
166
|
+
为 `0`,但仍测量一个空格以取得稳定字体度量。函数会把本次测量所需的文字状态写入 `ctx`,不会
|
|
167
|
+
调用 `save()` 或 `restore()`;Canvas 生命周期以及业务特有的文字顺序、对齐和绘制仍由 Shape
|
|
168
|
+
自己拥有。
|
|
169
169
|
|
|
170
170
|
### 组合型多行文本
|
|
171
171
|
|
|
@@ -238,15 +238,15 @@ const behavior = {
|
|
|
238
238
|
};
|
|
239
239
|
```
|
|
240
240
|
|
|
241
|
-
`OwnerDirect` 用于不绘制单选 frame、首次位移可直接提升 owner drag 的自定义对象;Group 使用
|
|
242
|
-
`DirectChild` dive,普通 Shape/Line 使用 `Standard`。Transform provider 在 gesture start 捕获 frozen
|
|
243
|
-
reference 与领域 owned state,每帧只纯解析最终 owner change;frame-authored Shape、pose-authored
|
|
244
|
-
Group 与 authored-geometry Line/Polygon/VectorPath 共用 Core reference-transform primitive,结构化
|
|
245
|
-
authored value 不为 caller isolation clone。Group 的稳定 reference 由创建时的 width/height/origin 与
|
|
246
|
-
pose 拥有;当前 content bounds 是只读 local derived view。Line/LineTree 的
|
|
247
|
-
固定world paint padding不贡献ancestor content bounds,但仍进入各自render coverage。普通Group
|
|
248
|
-
move/rotate只写自身pose;Group或多选resize/flip递归写入子元素的frame或矢量geometry。group/ungroup
|
|
249
|
-
只转换 local pose,保留 width/path/contour/topology、effect 与 relation 的值和引用。
|
|
241
|
+
`OwnerDirect` 用于不绘制单选 frame、首次位移可直接提升 owner drag 的自定义对象;Group 使用
|
|
242
|
+
`DirectChild` dive,普通 Shape/Line 使用 `Standard`。Transform provider 在 gesture start 捕获 frozen
|
|
243
|
+
reference 与领域 owned state,每帧只纯解析最终 owner change;frame-authored Shape、pose-authored
|
|
244
|
+
Group 与 authored-geometry Line/Polygon/VectorPath 共用 Core reference-transform primitive,结构化
|
|
245
|
+
authored value 不为 caller isolation clone。Group 的稳定 reference 由创建时的 width/height/origin 与
|
|
246
|
+
pose 拥有;当前 content bounds 是只读 local derived view。Line/LineTree 的
|
|
247
|
+
固定world paint padding不贡献ancestor content bounds,但仍进入各自render coverage。普通Group
|
|
248
|
+
move/rotate只写自身pose;Group或多选resize/flip递归写入子元素的frame或矢量geometry。group/ungroup
|
|
249
|
+
只转换 local pose,保留 width/path/contour/topology、effect 与 relation 的值和引用。
|
|
250
250
|
|
|
251
251
|
`selectable:false`只限制Editor交互选择,并对该owner分支生效:普通点击、marquee、Select All与
|
|
252
252
|
Group DirectChild下钻都不能进入该分支。公开`Select.select(elements)`和History selection replay由
|
package/dist/authored-path.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createAuthoredLineSubpath, type AnchorId, type AuthoredSubpath, type SegmentId } 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
|
export { createAuthoredLineSubpath };
|
|
4
4
|
/** Replace one authored anchor point while retaining its record and all IDs. */
|
|
5
5
|
export declare function replaceAuthoredAnchorPoint(subpath: AuthoredSubpath, anchorId: AnchorId, point: PointView): AuthoredSubpath;
|
|
@@ -23,6 +23,6 @@ export declare function replaceAuthoredCubicHandle(subpath: AuthoredSubpath, seg
|
|
|
23
23
|
/** Delete one anchor and merge its predecessor directly to its successor. */
|
|
24
24
|
export declare function removeAuthoredAnchor(subpath: AuthoredSubpath, anchorId: AnchorId, minimumAnchorCount?: number): AuthoredSubpath;
|
|
25
25
|
/** Transform coordinates while retaining every subpath, anchor, segment, and record ID. */
|
|
26
|
-
export declare function transformAuthoredSubpath(subpath: AuthoredSubpath, matrix:
|
|
26
|
+
export declare function transformAuthoredSubpath(subpath: AuthoredSubpath, matrix: ReadonlyMatrix2D): AuthoredSubpath;
|
|
27
27
|
/** Read bounds directly from authored anchor coordinates. */
|
|
28
28
|
export declare function getAuthoredSubpathBounds(subpath: AuthoredSubpath): Readonly<Rect> | null;
|
package/dist/editor/shape.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
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";
|
|
2
|
-
import { Bound, type PointView, type Rect } from "@fulate/share";
|
|
2
|
+
import { Bound, type PointView, type ReadonlyMatrix2D, type Rect } from "@fulate/share";
|
|
3
3
|
import { SelectionBehaviorMode, SelectionDiveMode, SelectionSnapMode, type EditorCapabilityToken, type SelectionBehaviorCapability, type SnapSourceCapability, type TransformInteractionCapability } from "./capability";
|
|
4
4
|
export interface WorldRectPointsViewCache {
|
|
5
5
|
source: Readonly<Rect> | null;
|
|
@@ -13,7 +13,7 @@ export interface WorldRectPointsViewCache {
|
|
|
13
13
|
}
|
|
14
14
|
export declare function createWorldRectPointsViewCache(): WorldRectPointsViewCache;
|
|
15
15
|
/** Project one stable local frame to a borrowed world-point view. */
|
|
16
|
-
export declare function getWorldRectPointsView(cache: WorldRectPointsViewCache, frame: Readonly<Rect>, matrix:
|
|
16
|
+
export declare function getWorldRectPointsView(cache: WorldRectPointsViewCache, frame: Readonly<Rect>, matrix: ReadonlyMatrix2D): readonly PointView[];
|
|
17
17
|
/** UI frame-authored Shape 系列共享的 direct Editor provider。 */
|
|
18
18
|
export declare abstract class EditorShape<P extends ShapeProperties = ShapeProperties, O extends ShapeOption<any> = ShapeOption<any>> extends Shape<P, O> implements SelectionBehaviorCapability, TransformInteractionCapability, SnapSourceCapability {
|
|
19
19
|
private connectionPortDecoration;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Element, type ElementOptionPatch, type ElementTransformBaseline, type OwnerPropertyChange, type ReparentTransformIntent, type TransformIntent } from "@fulate/core";
|
|
2
|
-
import type
|
|
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
5
|
/** @internal 捕获一次 owner reference;structured ownedState 直接保留原引用。 */
|
package/dist/group.d.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { ChangeImpact, Element, ElementTransform, type BaseElementOption, type ElementTransformBaseline, type ReparentTransformIntent, type TransformIntent } from "@fulate/core";
|
|
2
|
-
import { Bound, type BoundingBox, type PointView } from "@fulate/share";
|
|
2
|
+
import { Bound, type BoundingBox, type PointView, type ReadonlyMatrix2D } from "@fulate/share";
|
|
3
3
|
import { SelectionBehaviorMode, SelectionDiveMode, SelectionSnapMode, type EditorCapabilityToken, type TransformInteractionCapability } from "./editor/capability";
|
|
4
|
+
/**
|
|
5
|
+
* Group 成员的逻辑范围:frame capability 优先(Text 等排除绘制溢出),否则为成员 content
|
|
6
|
+
* bounds(Line 取几何,不含描边外扩)。`space` 为 `parent` 时返回成员 parent 的 child 坐标。
|
|
7
|
+
* 编组命令与 Group 选区框共用这一口径。
|
|
8
|
+
*/
|
|
9
|
+
export declare function resolveGroupMemberBounds(element: Element, capability: TransformInteractionCapability | undefined, space: "world" | "parent"): Bound | null;
|
|
4
10
|
interface GroupTransformChildBaseline {
|
|
5
11
|
readonly capability: TransformInteractionCapability;
|
|
6
12
|
readonly baseline: ReturnType<TransformInteractionCapability["captureTransformBaseline"]>;
|
|
@@ -22,14 +28,10 @@ export declare class GroupTransform<E extends Group = Group> extends ElementTran
|
|
|
22
28
|
/** @internal Group-local selection frame derived from child owner frames. */
|
|
23
29
|
getLocalSelectionFrameBoundsView(): Readonly<Bound> | null;
|
|
24
30
|
/** Group 是 content bounds owner;ancestor 只投影这份 local view。 */
|
|
25
|
-
protected collectContentBoundsInReference(parentMatrix:
|
|
31
|
+
protected collectContentBoundsInReference(parentMatrix: ReadonlyMatrix2D, _referenceWorldInverse: ReadonlyMatrix2D): Bound;
|
|
26
32
|
/** 只合并真实 content members;不贡献 content bounds 的 branch 返回 null。 */
|
|
27
33
|
protected buildLocalContentBounds(): Bound | null;
|
|
28
|
-
/**
|
|
29
|
-
* Build the frame used by selection/transform/snap. Text-like owners expose
|
|
30
|
-
* authored frame bounds that intentionally exclude paint overflow; owners
|
|
31
|
-
* without that capability retain an explicit content/visual fallback.
|
|
32
|
-
*/
|
|
34
|
+
/** Build the frame used by selection/transform/snap from each visible member's logical bounds. */
|
|
33
35
|
protected buildLocalSelectionFrameBounds(): Bound | null;
|
|
34
36
|
protected buildLocalHitBounds(): Readonly<Bound>;
|
|
35
37
|
protected containsLocalHitPoint(point: PointView): boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export { fitWorkspace, workspaceFocusInsetsKey, Workspace, WorkspaceProperties }
|
|
|
24
24
|
export type { WorkspaceFocusInsetsSource, WorkspaceFitOptions, WorkspaceJSON, WorkspaceOption } from "./workspace";
|
|
25
25
|
export { computePosition, flip, offset, shift } from "./floating";
|
|
26
26
|
export type { ComputePositionOptions, Placement } from "./floating";
|
|
27
|
-
export { Group, GroupTransform } from "./group";
|
|
27
|
+
export { Group, GroupTransform, resolveGroupMemberBounds } from "./group";
|
|
28
28
|
export type { GroupOption } from "./group";
|
|
29
29
|
export { ContentEditingCapabilityToken, PointEditingCapabilityToken, SelectionBehaviorMode, SelectionBehaviorCapabilityToken, SelectionDiveMode, SelectionSnapMode, SnapSourceCapabilityToken, TransformInteractionCapabilityToken, defineEditorCapability, getEditorCapability, isEditorCapabilityHost, resolveSelectionFrameBounds } from "./editor/capability";
|
|
30
30
|
export type { ContentEditingCapability, ContentEditingConsumer, ContentEditingSession, EditorCapabilityHost, EditorCapabilityToken, PointControlDescriptor, PointEditRequest, PointEditTarget, PointEditingCapability, PointEditingScope, PointOwnerEdit, SelectionBehavior, SelectionBehaviorCapability, SnapSourceCapability, TransformInteractionCapability, TransformInteractionPolicy } from "./editor/capability";
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { clearCache, layoutNextLineRange, layoutWithLines, materializeLineRange, measureLineStats, measureNaturalWidth, prepareWithSegments } from "@chenglou/pretext";
|
|
2
2
|
import { ChangeImpact, CustomEvent, Element, ElementProperties, ElementTransform, SKIN_DEFAULTS, Shape, ShapeProperties, ShapeTransform, createAuthoredLineSubpath, createGeometrySnapshot, createLineSubpath, createPathLocalId, evaluatePathSegmentPoint, getElementConnectionPort, getElementConnectionPortPoint, isReparentTransformIntent, mergeOwnerPropertyChanges, resolveAuthoredGeometryFramePatch, resolveAuthoredSubpath, resolveReferenceBoundsTranslation, resolveReferenceTransform, resolveReferenceTransformTarget, splitPathSegment } from "@fulate/core";
|
|
3
3
|
import { clamp, has, isFunction, isNil, isNull, isString, isUndefined, last } from "lodash-es";
|
|
4
|
-
import { Bound, Intersection, createCanvasGradient, createPointView, isGradient,
|
|
4
|
+
import { Bound, Intersection, Matrix2D, createCanvasGradient, createPointView, isGradient, isPointWithinDistance, rectEdgePosition, transformPoint } from "@fulate/share";
|
|
5
5
|
import { computePosition as computePosition$1, flip, offset, shift } from "@floating-ui/core";
|
|
6
6
|
import { Easing, Tween } from "@tweenjs/tween.js";
|
|
7
7
|
//#region packages/ui/src/text/layout.ts
|
|
@@ -1299,14 +1299,7 @@ var ConnectionPortDecoration = class {
|
|
|
1299
1299
|
const distance = DOT_RADIUS * Math.hypot(matrix.a * ux + matrix.b * uy, matrix.c * ux + matrix.d * uy) + LABEL_GAP * normalLength + halfExtent;
|
|
1300
1300
|
const centerX = worldPosition.x + ux * distance;
|
|
1301
1301
|
const centerY = worldPosition.y + uy * distance;
|
|
1302
|
-
return new
|
|
1303
|
-
scaleX,
|
|
1304
|
-
0,
|
|
1305
|
-
0,
|
|
1306
|
-
scaleY,
|
|
1307
|
-
centerX - worldWidth / 2,
|
|
1308
|
-
centerY - worldHeight / 2
|
|
1309
|
-
]);
|
|
1302
|
+
return new Matrix2D(scaleX, 0, 0, scaleY, centerX - worldWidth / 2, centerY - worldHeight / 2);
|
|
1310
1303
|
}
|
|
1311
1304
|
handleTextMeasurementChanged = () => {
|
|
1312
1305
|
this.host.transform.invalidate(ChangeImpact.VisualBounds);
|
|
@@ -1681,7 +1674,7 @@ var ContentEditingCapabilityToken = defineEditorCapability();
|
|
|
1681
1674
|
//#region packages/ui/src/editor/transform.ts
|
|
1682
1675
|
function readElementTransformBaseline(owner, writeMode, ownedState) {
|
|
1683
1676
|
const parent = owner.parent instanceof Element ? owner.parent : null;
|
|
1684
|
-
const startParentWorldInverseMatrix = parent ?
|
|
1677
|
+
const startParentWorldInverseMatrix = parent ? parent.transform.getChildWorldInverseMatrixView() : new Matrix2D();
|
|
1685
1678
|
const startParentWorldMatrix = parent ? startParentWorldInverseMatrix.inverse() : startParentWorldInverseMatrix;
|
|
1686
1679
|
return {
|
|
1687
1680
|
ownedState,
|
|
@@ -2356,7 +2349,7 @@ function removeAuthoredAnchor(subpath, anchorId, minimumAnchorCount = 2) {
|
|
|
2356
2349
|
}
|
|
2357
2350
|
/** Transform coordinates while retaining every subpath, anchor, segment, and record ID. */
|
|
2358
2351
|
function transformAuthoredSubpath(subpath, matrix) {
|
|
2359
|
-
if (
|
|
2352
|
+
if (matrix.isIdentity) return subpath;
|
|
2360
2353
|
return {
|
|
2361
2354
|
...subpath,
|
|
2362
2355
|
anchors: subpath.anchors.map((anchor) => {
|
|
@@ -2916,7 +2909,7 @@ var VectorPath = class extends EditorShape {
|
|
|
2916
2909
|
}
|
|
2917
2910
|
resolveTransformChange(baseline, intent) {
|
|
2918
2911
|
const transform = resolveReferenceTransform(baseline.reference, intent);
|
|
2919
|
-
const path =
|
|
2912
|
+
const path = transform.authoredLocalDelta.isIdentity ? baseline.ownedState : { subpaths: baseline.ownedState.subpaths.map((subpath) => transformAuthoredSubpath(subpath, transform.authoredLocalDelta)) };
|
|
2920
2913
|
const bounds = path === baseline.ownedState ? null : createVectorPathSnapshot("", 0, path).layoutReferenceBounds;
|
|
2921
2914
|
const framePatch = bounds && intent.bakeGeometry && !isReparentTransformIntent(intent) ? resolveAuthoredGeometryFramePatch(baseline.reference, transform, bounds) : transform.framePatch;
|
|
2922
2915
|
const restoredFrameSize = intent.bakeGeometry && !isReparentTransformIntent(intent) && path === baseline.ownedState ? {
|
|
@@ -3832,27 +3825,35 @@ function computePosition(reference, floating, options = {}) {
|
|
|
3832
3825
|
}
|
|
3833
3826
|
//#endregion
|
|
3834
3827
|
//#region packages/ui/src/group.ts
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3828
|
+
/**
|
|
3829
|
+
* Group 成员的逻辑范围:frame capability 优先(Text 等排除绘制溢出),否则为成员 content
|
|
3830
|
+
* bounds(Line 取几何,不含描边外扩)。`space` 为 `parent` 时返回成员 parent 的 child 坐标。
|
|
3831
|
+
* 编组命令与 Group 选区框共用这一口径。
|
|
3832
|
+
*/
|
|
3833
|
+
function resolveGroupMemberBounds(element, capability, space) {
|
|
3834
|
+
const frame = capability?.getSelectionFrameBounds?.();
|
|
3835
|
+
if (!frame) {
|
|
3836
|
+
const content = space === "world" ? element.transform.getWorldContentBoundsView() : element.transform.getContentBoundsInParentView();
|
|
3837
|
+
return content ? new Bound(content.minX, content.minY, content.maxX, content.maxY) : null;
|
|
3838
|
+
}
|
|
3839
|
+
const world = element.transform.getWorldMatrixView();
|
|
3840
|
+
const parent = element.parent;
|
|
3841
|
+
const parentInverse = space === "parent" && parent instanceof Element ? parent.transform.getChildWorldInverseMatrixView() : null;
|
|
3842
|
+
const corner = (x, y) => {
|
|
3843
|
+
const point = transformPoint(world, {
|
|
3844
|
+
x,
|
|
3845
|
+
y
|
|
3846
|
+
});
|
|
3847
|
+
return parentInverse ? transformPoint(parentInverse, point) : point;
|
|
3848
|
+
};
|
|
3849
|
+
const right = frame.left + frame.width;
|
|
3850
|
+
const bottom = frame.top + frame.height;
|
|
3851
|
+
return Bound.fromPoints([
|
|
3852
|
+
corner(frame.left, frame.top),
|
|
3853
|
+
corner(right, frame.top),
|
|
3854
|
+
corner(right, bottom),
|
|
3855
|
+
corner(frame.left, bottom)
|
|
3856
|
+
]);
|
|
3856
3857
|
}
|
|
3857
3858
|
var GroupTransform = class extends ElementTransform {
|
|
3858
3859
|
localContentBounds;
|
|
@@ -3887,7 +3888,7 @@ var GroupTransform = class extends ElementTransform {
|
|
|
3887
3888
|
collectContentBoundsInReference(parentMatrix, _referenceWorldInverse) {
|
|
3888
3889
|
if (!this.element.visible) return null;
|
|
3889
3890
|
const bounds = this.getLocalContentBoundsView();
|
|
3890
|
-
return bounds ? this.toBounds(this.writeScalarMatrix(new
|
|
3891
|
+
return bounds ? this.toBounds(this.writeScalarMatrix(new Matrix2D(), parentMatrix), bounds) : null;
|
|
3891
3892
|
}
|
|
3892
3893
|
/** 只合并真实 content members;不贡献 content bounds 的 branch 返回 null。 */
|
|
3893
3894
|
buildLocalContentBounds() {
|
|
@@ -3910,23 +3911,13 @@ var GroupTransform = class extends ElementTransform {
|
|
|
3910
3911
|
bounds.maxY = Math.min(bounds.maxY, clip.top + clip.height);
|
|
3911
3912
|
return bounds.minX < bounds.maxX && bounds.minY < bounds.maxY ? bounds : null;
|
|
3912
3913
|
}
|
|
3913
|
-
/**
|
|
3914
|
-
* Build the frame used by selection/transform/snap. Text-like owners expose
|
|
3915
|
-
* authored frame bounds that intentionally exclude paint overflow; owners
|
|
3916
|
-
* without that capability retain an explicit content/visual fallback.
|
|
3917
|
-
*/
|
|
3914
|
+
/** Build the frame used by selection/transform/snap from each visible member's logical bounds. */
|
|
3918
3915
|
buildLocalSelectionFrameBounds() {
|
|
3919
|
-
const childWorldInverse = this.getChildWorldInverseMatrixView();
|
|
3920
3916
|
let bounds = null;
|
|
3921
3917
|
for (const child of this.element.children) {
|
|
3922
3918
|
if (!child.visible) continue;
|
|
3923
|
-
const
|
|
3924
|
-
|
|
3925
|
-
const content = child.transform.getContentBoundsInParentView();
|
|
3926
|
-
return content ? rectCorners(content) : [];
|
|
3927
|
-
})();
|
|
3928
|
-
if (points.length === 0) continue;
|
|
3929
|
-
const childBounds = Bound.fromPoints(points);
|
|
3919
|
+
const childBounds = resolveGroupMemberBounds(child, getEditorCapability(child, TransformInteractionCapabilityToken), "parent");
|
|
3920
|
+
if (!childBounds) continue;
|
|
3930
3921
|
bounds = bounds ? bounds.merge(childBounds) : childBounds;
|
|
3931
3922
|
}
|
|
3932
3923
|
const clip = bounds && this.element.getChildClipRect();
|
|
@@ -4120,7 +4111,7 @@ var ScrollViewProperties = class extends RectangleProperties {
|
|
|
4120
4111
|
}
|
|
4121
4112
|
};
|
|
4122
4113
|
var ScrollViewTransform = class extends RectangleTransform {
|
|
4123
|
-
childWorldMatrix = new
|
|
4114
|
+
childWorldMatrix = new Matrix2D();
|
|
4124
4115
|
onChildrenChanged() {
|
|
4125
4116
|
this.markGeometryNeedsLayout(false);
|
|
4126
4117
|
}
|
|
@@ -5525,7 +5516,7 @@ function updateLineTreeBranchStyle(topology, subpathId, style) {
|
|
|
5525
5516
|
};
|
|
5526
5517
|
}
|
|
5527
5518
|
function transformLineTreeTopology(topology, matrix) {
|
|
5528
|
-
if (
|
|
5519
|
+
if (matrix.isIdentity) return topology;
|
|
5529
5520
|
return {
|
|
5530
5521
|
...topology,
|
|
5531
5522
|
points: topology.points.map((point) => ({
|
|
@@ -6212,4 +6203,4 @@ function applyLineTreeTopologyDelta(topology, delta, direction) {
|
|
|
6212
6203
|
};
|
|
6213
6204
|
}
|
|
6214
6205
|
//#endregion
|
|
6215
|
-
export { BaseLine, Bitmap, Circle, CircleTransform, ContentEditingCapabilityToken, DEFAULT_LINE_TREE_BRANCH_STYLE, EMPTY_LINE_TREE_TOPOLOGY, EditorFrameFlush, EndpointRelationIndex, Group, GroupTransform, Image, ImageProperties, ImageTransform, Line, LineTransform, LineTree, LineTreeProperties, LineTreeTransform, PointEditingCapabilityToken, Polygon, PolygonTransform, Rectangle, RectangleProperties, RectangleTransform, RippleOverlay, ScrollView, ScrollViewTransform, SelectionBehaviorCapabilityToken, SelectionBehaviorMode, SelectionDiveMode, SelectionSnapMode, SnapSourceCapabilityToken, Text, TextBlock, TextProperties, TextTransform, TransformInteractionCapabilityToken, Triangle, TriangleTransform, VectorPath, VectorPathProperties, VectorPathTransform, WorkerSurfacePool, Workspace, WorkspaceProperties, addLineTreeBranchAtTail, applyLineTreeTopologyDelta, computePosition, connectEndpoint, connectionPortAccepts, createLineTreeTopology, createLineTreeTopologyDelta, defineEditorCapability, disconnectEndpoint, fitWorkspace, flip, getEditorCapability, getEditorFrameFlush, getEndpointRelationIndex, getLineTreeBindableEndpoints, getLineTreeBranch, getLineTreeEndpointRelationBindings, getLineTreeJunctionAnchorIds, getLineTreePoint, getLineTreePointReferenceCounts, getTextBlockVisualBounds, hasConnectionPortCapacity, insertLineTreePoint, isEditorCapabilityHost, isEndpointRelationSource, measureTextRun, measureTextWidth, moveLineTreePoint, offset, paintTextBlock, remapLineTreeRelations, removeLineTreeBranch, removeLineTreePoint, resolveConnectEndpointChange, resolveConnectionPortChanges, resolveDisconnectEndpointChanges, resolveSelectionFrameBounds, resolveTextStyle, shift, subscribeTextMeasurementChanges, transformLineTreeTopology, updateLineTreeBranchStyle, workspaceFocusInsetsKey };
|
|
6206
|
+
export { BaseLine, Bitmap, Circle, CircleTransform, ContentEditingCapabilityToken, DEFAULT_LINE_TREE_BRANCH_STYLE, EMPTY_LINE_TREE_TOPOLOGY, EditorFrameFlush, EndpointRelationIndex, Group, GroupTransform, Image, ImageProperties, ImageTransform, Line, LineTransform, LineTree, LineTreeProperties, LineTreeTransform, PointEditingCapabilityToken, Polygon, PolygonTransform, Rectangle, RectangleProperties, RectangleTransform, RippleOverlay, ScrollView, ScrollViewTransform, SelectionBehaviorCapabilityToken, SelectionBehaviorMode, SelectionDiveMode, SelectionSnapMode, SnapSourceCapabilityToken, Text, TextBlock, TextProperties, TextTransform, TransformInteractionCapabilityToken, Triangle, TriangleTransform, VectorPath, VectorPathProperties, VectorPathTransform, WorkerSurfacePool, Workspace, WorkspaceProperties, addLineTreeBranchAtTail, applyLineTreeTopologyDelta, computePosition, connectEndpoint, connectionPortAccepts, createLineTreeTopology, createLineTreeTopologyDelta, defineEditorCapability, disconnectEndpoint, fitWorkspace, flip, getEditorCapability, getEditorFrameFlush, getEndpointRelationIndex, getLineTreeBindableEndpoints, getLineTreeBranch, getLineTreeEndpointRelationBindings, getLineTreeJunctionAnchorIds, getLineTreePoint, getLineTreePointReferenceCounts, getTextBlockVisualBounds, hasConnectionPortCapacity, insertLineTreePoint, isEditorCapabilityHost, isEndpointRelationSource, measureTextRun, measureTextWidth, moveLineTreePoint, offset, paintTextBlock, remapLineTreeRelations, removeLineTreeBranch, removeLineTreePoint, resolveConnectEndpointChange, resolveConnectionPortChanges, resolveDisconnectEndpointChanges, resolveGroupMemberBounds, resolveSelectionFrameBounds, resolveTextStyle, shift, subscribeTextMeasurementChanges, transformLineTreeTopology, updateLineTreeBranchStyle, workspaceFocusInsetsKey };
|
|
@@ -1,5 +1,5 @@
|
|
|
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
4
|
import type { BindableEndpoint, EndpointRelation, EndpointRelationBinding } from "../connection/types";
|
|
5
5
|
import type { LineTreeBranch, LineTreeBranchRemoval, LineTreeBranchStyle, LineTreePoint, LineTreeTopology } from "./types";
|
|
@@ -35,5 +35,5 @@ export declare function addLineTreeBranchAtTail(topology: LineTreeTopology, pare
|
|
|
35
35
|
};
|
|
36
36
|
export declare function removeLineTreeBranch(topology: LineTreeTopology, subpathId: SubpathId): LineTreeBranchRemoval;
|
|
37
37
|
export declare function updateLineTreeBranchStyle(topology: LineTreeTopology, subpathId: SubpathId, style: LineTreeBranchStyle): LineTreeTopology;
|
|
38
|
-
export declare function transformLineTreeTopology(topology: LineTreeTopology, matrix:
|
|
38
|
+
export declare function transformLineTreeTopology(topology: LineTreeTopology, matrix: ReadonlyMatrix2D): LineTreeTopology;
|
|
39
39
|
export declare function remapLineTreeRelations(topology: LineTreeTopology, keyMap: ReadonlyMap<string, string>): LineTreeTopology;
|
package/dist/scrollview.d.ts
CHANGED
|
@@ -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
|
|
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():
|
|
32
|
+
protected getChildWorldMatrixView(): ReadonlyMatrix2D;
|
|
33
33
|
protected resolveFitSize(): void;
|
|
34
34
|
}
|
|
35
35
|
export declare class ScrollView extends Rectangle<ScrollViewProperties, ScrollViewOption> {
|
package/dist/vector-path.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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";
|