@yuzhouu/canvas-standard 0.1.0 → 0.1.1
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/_vendor/plugin-arrow/_vendor/canvas-core/editor/editor.d.ts +1 -0
- package/_vendor/plugin-arrow/_vendor/canvas-core/editor/queries/shapeTransforms.d.ts +1 -0
- package/_vendor/plugin-arrow/_vendor/canvas-core/editor/shapes/shapeGeometry.d.ts +1 -0
- package/_vendor/plugin-arrow/_vendor/canvas-react/host/ShapeHeadingControl.d.ts +31 -0
- package/_vendor/plugin-arrow/_vendor/canvas-react/host/index.d.ts +2 -0
- package/_vendor/plugin-connector/_vendor/canvas-core/editor/editor.d.ts +1 -0
- package/_vendor/plugin-connector/_vendor/canvas-core/editor/queries/shapeTransforms.d.ts +1 -0
- package/_vendor/plugin-connector/_vendor/canvas-core/editor/shapes/shapeGeometry.d.ts +1 -0
- package/_vendor/plugin-connector/_vendor/canvas-react/host/ShapeHeadingControl.d.ts +31 -0
- package/_vendor/plugin-connector/_vendor/canvas-react/host/index.d.ts +2 -0
- package/_vendor/plugin-connector/index.d.ts +1 -1
- package/_vendor/plugin-connector/quickConnect.d.ts +1 -0
- package/_vendor/plugin-draw/_vendor/canvas-core/editor/editor.d.ts +1 -0
- package/_vendor/plugin-draw/_vendor/canvas-core/editor/queries/shapeTransforms.d.ts +1 -0
- package/_vendor/plugin-draw/_vendor/canvas-core/editor/shapes/shapeGeometry.d.ts +1 -0
- package/_vendor/plugin-draw/_vendor/canvas-react/host/ShapeHeadingControl.d.ts +31 -0
- package/_vendor/plugin-draw/_vendor/canvas-react/host/index.d.ts +2 -0
- package/_vendor/plugin-eraser/_vendor/canvas-core/editor/editor.d.ts +1 -0
- package/_vendor/plugin-eraser/_vendor/canvas-core/editor/queries/shapeTransforms.d.ts +1 -0
- package/_vendor/plugin-eraser/_vendor/canvas-core/editor/shapes/shapeGeometry.d.ts +1 -0
- package/_vendor/plugin-eraser/_vendor/canvas-react/host/ShapeHeadingControl.d.ts +31 -0
- package/_vendor/plugin-eraser/_vendor/canvas-react/host/index.d.ts +2 -0
- package/_vendor/plugin-flow/_vendor/canvas-core/editor/editor.d.ts +1 -0
- package/_vendor/plugin-flow/_vendor/canvas-core/editor/queries/shapeTransforms.d.ts +1 -0
- package/_vendor/plugin-flow/_vendor/canvas-core/editor/shapes/shapeGeometry.d.ts +1 -0
- package/_vendor/plugin-flow/_vendor/canvas-react/host/ShapeHeadingControl.d.ts +31 -0
- package/_vendor/plugin-flow/_vendor/canvas-react/host/index.d.ts +2 -0
- package/_vendor/plugin-flow/_vendor/plugin-connector/index.d.ts +1 -1
- package/_vendor/plugin-flow/_vendor/plugin-connector/quickConnect.d.ts +1 -0
- package/_vendor/plugin-flow/api.d.ts +13 -0
- package/_vendor/plugin-flow/editorRuntime.d.ts +8 -0
- package/_vendor/plugin-flow/flowNodeOperations.d.ts +19 -0
- package/_vendor/plugin-flow/flowNodeShapeUtil.d.ts +24 -0
- package/_vendor/plugin-flow/index.d.ts +8 -2
- package/_vendor/plugin-flow/nodeCreation.d.ts +2 -1
- package/_vendor/plugin-flow/types.d.ts +9 -1
- package/_vendor/plugin-frame/_vendor/canvas-core/editor/editor.d.ts +1 -0
- package/_vendor/plugin-frame/_vendor/canvas-core/editor/queries/shapeTransforms.d.ts +1 -0
- package/_vendor/plugin-frame/_vendor/canvas-core/editor/shapes/shapeGeometry.d.ts +1 -0
- package/_vendor/plugin-frame/_vendor/canvas-react/host/ShapeHeadingControl.d.ts +31 -0
- package/_vendor/plugin-frame/_vendor/canvas-react/host/index.d.ts +2 -0
- package/_vendor/plugin-geo/_vendor/canvas-core/editor/editor.d.ts +1 -0
- package/_vendor/plugin-geo/_vendor/canvas-core/editor/queries/shapeTransforms.d.ts +1 -0
- package/_vendor/plugin-geo/_vendor/canvas-core/editor/shapes/shapeGeometry.d.ts +1 -0
- package/_vendor/plugin-geo/_vendor/canvas-react/host/ShapeHeadingControl.d.ts +31 -0
- package/_vendor/plugin-geo/_vendor/canvas-react/host/index.d.ts +2 -0
- package/_vendor/plugin-group/_vendor/canvas-core/editor/editor.d.ts +1 -0
- package/_vendor/plugin-group/_vendor/canvas-core/editor/queries/shapeTransforms.d.ts +1 -0
- package/_vendor/plugin-group/_vendor/canvas-core/editor/shapes/shapeGeometry.d.ts +1 -0
- package/_vendor/plugin-group/_vendor/canvas-react/host/ShapeHeadingControl.d.ts +31 -0
- package/_vendor/plugin-group/_vendor/canvas-react/host/index.d.ts +2 -0
- package/_vendor/plugin-html/_vendor/canvas-core/editor/editor.d.ts +1 -0
- package/_vendor/plugin-html/_vendor/canvas-core/editor/queries/shapeTransforms.d.ts +1 -0
- package/_vendor/plugin-html/_vendor/canvas-core/editor/shapes/shapeGeometry.d.ts +1 -0
- package/_vendor/plugin-html/_vendor/canvas-react/host/ShapeHeadingControl.d.ts +31 -0
- package/_vendor/plugin-html/_vendor/canvas-react/host/index.d.ts +2 -0
- package/_vendor/plugin-image/_vendor/canvas-core/editor/editor.d.ts +1 -0
- package/_vendor/plugin-image/_vendor/canvas-core/editor/queries/shapeTransforms.d.ts +1 -0
- package/_vendor/plugin-image/_vendor/canvas-core/editor/shapes/shapeGeometry.d.ts +1 -0
- package/_vendor/plugin-image/_vendor/canvas-react/host/ShapeHeadingControl.d.ts +31 -0
- package/_vendor/plugin-image/_vendor/canvas-react/host/index.d.ts +2 -0
- package/_vendor/plugin-laser/_vendor/canvas-core/editor/editor.d.ts +1 -0
- package/_vendor/plugin-laser/_vendor/canvas-core/editor/queries/shapeTransforms.d.ts +1 -0
- package/_vendor/plugin-laser/_vendor/canvas-core/editor/shapes/shapeGeometry.d.ts +1 -0
- package/_vendor/plugin-laser/_vendor/canvas-react/host/ShapeHeadingControl.d.ts +31 -0
- package/_vendor/plugin-laser/_vendor/canvas-react/host/index.d.ts +2 -0
- package/_vendor/plugin-path/_vendor/canvas-core/editor/editor.d.ts +1 -0
- package/_vendor/plugin-path/_vendor/canvas-core/editor/queries/shapeTransforms.d.ts +1 -0
- package/_vendor/plugin-path/_vendor/canvas-core/editor/shapes/shapeGeometry.d.ts +1 -0
- package/_vendor/plugin-path/_vendor/canvas-react/host/ShapeHeadingControl.d.ts +31 -0
- package/_vendor/plugin-path/_vendor/canvas-react/host/index.d.ts +2 -0
- package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/editor.d.ts +1 -0
- package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/queries/shapeTransforms.d.ts +1 -0
- package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/shapes/shapeGeometry.d.ts +1 -0
- package/_vendor/plugin-runtime-clipboard/_vendor/canvas-react/host/ShapeHeadingControl.d.ts +31 -0
- package/_vendor/plugin-runtime-clipboard/_vendor/canvas-react/host/index.d.ts +2 -0
- package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/editor.d.ts +1 -0
- package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/queries/shapeTransforms.d.ts +1 -0
- package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/shapes/shapeGeometry.d.ts +1 -0
- package/_vendor/plugin-runtime-export/_vendor/canvas-react/host/ShapeHeadingControl.d.ts +31 -0
- package/_vendor/plugin-runtime-export/_vendor/canvas-react/host/index.d.ts +2 -0
- package/_vendor/plugin-text/_vendor/canvas-core/editor/editor.d.ts +1 -0
- package/_vendor/plugin-text/_vendor/canvas-core/editor/queries/shapeTransforms.d.ts +1 -0
- package/_vendor/plugin-text/_vendor/canvas-core/editor/shapes/shapeGeometry.d.ts +1 -0
- package/_vendor/plugin-text/_vendor/canvas-react/host/ShapeHeadingControl.d.ts +31 -0
- package/_vendor/plugin-text/_vendor/canvas-react/host/index.d.ts +2 -0
- package/_vendor/plugin-video/_vendor/canvas-core/editor/editor.d.ts +1 -0
- package/_vendor/plugin-video/_vendor/canvas-core/editor/queries/shapeTransforms.d.ts +1 -0
- package/_vendor/plugin-video/_vendor/canvas-core/editor/shapes/shapeGeometry.d.ts +1 -0
- package/_vendor/plugin-video/_vendor/canvas-react/host/ShapeHeadingControl.d.ts +31 -0
- package/_vendor/plugin-video/_vendor/canvas-react/host/index.d.ts +2 -0
- package/index.mjs +124 -168
- package/package.json +5 -1
|
@@ -176,6 +176,7 @@ export declare class Editor {
|
|
|
176
176
|
readonly computeLocalBounds: (shape: ShapeRecord) => Box;
|
|
177
177
|
readonly computeRenderBounds: (shape: ShapeRecord) => Box;
|
|
178
178
|
readonly computeExportBounds: (shape: ShapeRecord) => Box;
|
|
179
|
+
readonly computeExportBoundsInShapeSpace: (shape: ShapeRecord, coordinateSpaceShape: ShapeRecord) => Box | null;
|
|
179
180
|
readonly computeLocalToPageTransform: (shape: ShapeRecord) => Mat;
|
|
180
181
|
readonly computeRenderToPageTransform: (shape: ShapeRecord) => Mat;
|
|
181
182
|
readonly computeExportToPageTransform: (shape: ShapeRecord) => Mat;
|
|
@@ -39,5 +39,6 @@ export declare function getShapePositionedOutlineVertices<S extends ShapeRecord>
|
|
|
39
39
|
export declare function getShapePageCorners<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentToPage: Mat): Vec[];
|
|
40
40
|
export declare function getShapePageOutlineVertices<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentToPage: Mat): Vec[];
|
|
41
41
|
export declare function getShapePageBounds<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentToPage: Mat): Box;
|
|
42
|
+
export declare function getShapeExportTransformedBounds<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, localToTarget: Mat): Box;
|
|
42
43
|
export declare function getShapeExportPageBounds<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentToPage: Mat): Box;
|
|
43
44
|
export declare function getShapeGeometry<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentToPage: Mat): ShapeGeometry;
|
|
@@ -9,6 +9,7 @@ export declare function computeEditorShapePositionedBounds(editor: Editor, shape
|
|
|
9
9
|
export declare function computeEditorShapeLocalBounds(editor: Editor, shape: ShapeRecord): Box;
|
|
10
10
|
export declare function computeEditorShapeRenderBounds(editor: Editor, shape: ShapeRecord): Box;
|
|
11
11
|
export declare function computeEditorShapeExportBounds(editor: Editor, shape: ShapeRecord): Box;
|
|
12
|
+
export declare function computeEditorShapeExportBoundsInShapeSpace(editor: Editor, shape: ShapeRecord, coordinateSpaceShape: ShapeRecord): Box | null;
|
|
12
13
|
export declare function computeEditorShapeLocalToPageTransform(editor: Editor, shape: ShapeRecord): Mat;
|
|
13
14
|
export declare function computeEditorShapeRenderToPageTransform(editor: Editor, shape: ShapeRecord): Mat;
|
|
14
15
|
export declare function computeEditorShapeExportToPageTransform(editor: Editor, shape: ShapeRecord): Mat;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Editor, ShapeRecordBase } from "../../canvas-core/index";
|
|
2
|
+
import type { CanvasDomEventGuard } from "./canvasRenderPlugin";
|
|
3
|
+
export interface ShapeHeadingDataUi {
|
|
4
|
+
readonly heading: string;
|
|
5
|
+
readonly dragHandle: string;
|
|
6
|
+
readonly name: string;
|
|
7
|
+
readonly input: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ShapeHeadingControlProps<S extends ShapeRecordBase = ShapeRecordBase> {
|
|
10
|
+
readonly editor: Editor;
|
|
11
|
+
readonly shape: S;
|
|
12
|
+
readonly isEditing: boolean;
|
|
13
|
+
readonly value: string;
|
|
14
|
+
readonly fallback: string;
|
|
15
|
+
readonly bodyWidth: number;
|
|
16
|
+
readonly bodyHeight: number;
|
|
17
|
+
readonly renderHeight: number;
|
|
18
|
+
readonly operationKind: string;
|
|
19
|
+
readonly editAriaLabel: string;
|
|
20
|
+
readonly inputAriaLabel: string;
|
|
21
|
+
readonly dataUi: ShapeHeadingDataUi;
|
|
22
|
+
readonly onValueChange: (value: string) => void;
|
|
23
|
+
readonly editable?: boolean;
|
|
24
|
+
readonly showBackground?: boolean;
|
|
25
|
+
readonly showDragHandle?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export declare function createShapeHeadingDomEventGuard({ id, selector, }: {
|
|
28
|
+
id: string;
|
|
29
|
+
selector: string;
|
|
30
|
+
}): CanvasDomEventGuard;
|
|
31
|
+
export declare function ShapeHeadingControl<S extends ShapeRecordBase>({ editor, shape, isEditing, value, fallback, bodyWidth, bodyHeight, renderHeight, operationKind, editAriaLabel, inputAriaLabel, dataUi, onValueChange, editable, showBackground, showDragHandle, }: ShapeHeadingControlProps<S>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,4 +2,6 @@ export { CanvasRenderBindingsContext, useCanvasOverlays, useCanvasRenderBindings
|
|
|
2
2
|
export type { CanvasDomEventGuards, CanvasOverlayLookup, CanvasRendererLookup, } from "./canvasRenderBindings";
|
|
3
3
|
export type { AnyRegisteredSelectionCustomHandleRenderer, AnyRegisteredShapeRenderer, CanvasOverlayContribution, CanvasDomEventGuard, CanvasDomEventGuardCursorInput, CanvasDomEventGuardDecision, CanvasDomEventGuardInput, CanvasDomEventGuardName, CanvasRenderPluginComponent, CanvasRenderPlugin, RegisteredSelectionCustomHandleRenderer, RegisteredShapeRenderer, SelectionCustomHandleRendererProps, ShapeHoverRendererProps, ShapeRendererProps, ShapeOpacityModifier, } from "./canvasRenderPlugin";
|
|
4
4
|
export { SHAPE_HOVER_STROKE, SHAPE_HOVER_STROKE_WIDTH, } from "./canvasRenderPlugin";
|
|
5
|
+
export { ShapeHeadingControl, createShapeHeadingDomEventGuard, } from "./ShapeHeadingControl";
|
|
6
|
+
export type { ShapeHeadingControlProps, ShapeHeadingDataUi, } from "./ShapeHeadingControl";
|
|
5
7
|
export { createCanvasRenderBindings, type CanvasRenderBindings, } from "./canvasRenderBindings";
|
|
@@ -176,6 +176,7 @@ export declare class Editor {
|
|
|
176
176
|
readonly computeLocalBounds: (shape: ShapeRecord) => Box;
|
|
177
177
|
readonly computeRenderBounds: (shape: ShapeRecord) => Box;
|
|
178
178
|
readonly computeExportBounds: (shape: ShapeRecord) => Box;
|
|
179
|
+
readonly computeExportBoundsInShapeSpace: (shape: ShapeRecord, coordinateSpaceShape: ShapeRecord) => Box | null;
|
|
179
180
|
readonly computeLocalToPageTransform: (shape: ShapeRecord) => Mat;
|
|
180
181
|
readonly computeRenderToPageTransform: (shape: ShapeRecord) => Mat;
|
|
181
182
|
readonly computeExportToPageTransform: (shape: ShapeRecord) => Mat;
|
|
@@ -39,5 +39,6 @@ export declare function getShapePositionedOutlineVertices<S extends ShapeRecord>
|
|
|
39
39
|
export declare function getShapePageCorners<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentToPage: Mat): Vec[];
|
|
40
40
|
export declare function getShapePageOutlineVertices<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentToPage: Mat): Vec[];
|
|
41
41
|
export declare function getShapePageBounds<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentToPage: Mat): Box;
|
|
42
|
+
export declare function getShapeExportTransformedBounds<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, localToTarget: Mat): Box;
|
|
42
43
|
export declare function getShapeExportPageBounds<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentToPage: Mat): Box;
|
|
43
44
|
export declare function getShapeGeometry<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentToPage: Mat): ShapeGeometry;
|
|
@@ -9,6 +9,7 @@ export declare function computeEditorShapePositionedBounds(editor: Editor, shape
|
|
|
9
9
|
export declare function computeEditorShapeLocalBounds(editor: Editor, shape: ShapeRecord): Box;
|
|
10
10
|
export declare function computeEditorShapeRenderBounds(editor: Editor, shape: ShapeRecord): Box;
|
|
11
11
|
export declare function computeEditorShapeExportBounds(editor: Editor, shape: ShapeRecord): Box;
|
|
12
|
+
export declare function computeEditorShapeExportBoundsInShapeSpace(editor: Editor, shape: ShapeRecord, coordinateSpaceShape: ShapeRecord): Box | null;
|
|
12
13
|
export declare function computeEditorShapeLocalToPageTransform(editor: Editor, shape: ShapeRecord): Mat;
|
|
13
14
|
export declare function computeEditorShapeRenderToPageTransform(editor: Editor, shape: ShapeRecord): Mat;
|
|
14
15
|
export declare function computeEditorShapeExportToPageTransform(editor: Editor, shape: ShapeRecord): Mat;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Editor, ShapeRecordBase } from "../../canvas-core/index";
|
|
2
|
+
import type { CanvasDomEventGuard } from "./canvasRenderPlugin";
|
|
3
|
+
export interface ShapeHeadingDataUi {
|
|
4
|
+
readonly heading: string;
|
|
5
|
+
readonly dragHandle: string;
|
|
6
|
+
readonly name: string;
|
|
7
|
+
readonly input: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ShapeHeadingControlProps<S extends ShapeRecordBase = ShapeRecordBase> {
|
|
10
|
+
readonly editor: Editor;
|
|
11
|
+
readonly shape: S;
|
|
12
|
+
readonly isEditing: boolean;
|
|
13
|
+
readonly value: string;
|
|
14
|
+
readonly fallback: string;
|
|
15
|
+
readonly bodyWidth: number;
|
|
16
|
+
readonly bodyHeight: number;
|
|
17
|
+
readonly renderHeight: number;
|
|
18
|
+
readonly operationKind: string;
|
|
19
|
+
readonly editAriaLabel: string;
|
|
20
|
+
readonly inputAriaLabel: string;
|
|
21
|
+
readonly dataUi: ShapeHeadingDataUi;
|
|
22
|
+
readonly onValueChange: (value: string) => void;
|
|
23
|
+
readonly editable?: boolean;
|
|
24
|
+
readonly showBackground?: boolean;
|
|
25
|
+
readonly showDragHandle?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export declare function createShapeHeadingDomEventGuard({ id, selector, }: {
|
|
28
|
+
id: string;
|
|
29
|
+
selector: string;
|
|
30
|
+
}): CanvasDomEventGuard;
|
|
31
|
+
export declare function ShapeHeadingControl<S extends ShapeRecordBase>({ editor, shape, isEditing, value, fallback, bodyWidth, bodyHeight, renderHeight, operationKind, editAriaLabel, inputAriaLabel, dataUi, onValueChange, editable, showBackground, showDragHandle, }: ShapeHeadingControlProps<S>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,4 +2,6 @@ export { CanvasRenderBindingsContext, useCanvasOverlays, useCanvasRenderBindings
|
|
|
2
2
|
export type { CanvasDomEventGuards, CanvasOverlayLookup, CanvasRendererLookup, } from "./canvasRenderBindings";
|
|
3
3
|
export type { AnyRegisteredSelectionCustomHandleRenderer, AnyRegisteredShapeRenderer, CanvasOverlayContribution, CanvasDomEventGuard, CanvasDomEventGuardCursorInput, CanvasDomEventGuardDecision, CanvasDomEventGuardInput, CanvasDomEventGuardName, CanvasRenderPluginComponent, CanvasRenderPlugin, RegisteredSelectionCustomHandleRenderer, RegisteredShapeRenderer, SelectionCustomHandleRendererProps, ShapeHoverRendererProps, ShapeRendererProps, ShapeOpacityModifier, } from "./canvasRenderPlugin";
|
|
4
4
|
export { SHAPE_HOVER_STROKE, SHAPE_HOVER_STROKE_WIDTH, } from "./canvasRenderPlugin";
|
|
5
|
+
export { ShapeHeadingControl, createShapeHeadingDomEventGuard, } from "./ShapeHeadingControl";
|
|
6
|
+
export type { ShapeHeadingControlProps, ShapeHeadingDataUi, } from "./ShapeHeadingControl";
|
|
5
7
|
export { createCanvasRenderBindings, type CanvasRenderBindings, } from "./canvasRenderBindings";
|
|
@@ -12,7 +12,7 @@ export type { ConnectorInfo, ConnectorSegment, ConnectorTerminalOffsetInput, Con
|
|
|
12
12
|
export { CONNECTOR_ARROW_TERMINAL_PADDING, getConnectorArrowGlyphLength, getConnectorArrowLength, getConnectorArrowMagnification, getConnectorMarkerPath, getConnectorMarkerRefX, } from "./connectorMarker";
|
|
13
13
|
export { commitConnectorCreation, createConnectorBoundEndpoint, getConnectorCreationInvalidReason, getConnectorParentId, resolveConnectorDraftEndpoint, resolveConnectorDraftParentId, hasDirectedConnector, setConnectorTerminalPagePoint, } from "./connectorModel";
|
|
14
14
|
export type { CommitConnectorCreationInput, ConnectorBoundEndpoint, ConnectorCreationInvalidReason, ConnectorDraftEndpoint, ResolvedConnectorDraftEndpoint, } from "./connectorModel";
|
|
15
|
-
export { chooseFacingPort, createDefaultConnectorQuickCreateNodeFactory, findQuickConnectTargets, getBalancedConnectorBranchNodeInput, getConnectorVisualPortPoint, getNearestConnectorPortAtPoint, quickConnectFromPort, } from "./quickConnect";
|
|
15
|
+
export { chooseFacingPort, chooseOpposingPort, createDefaultConnectorQuickCreateNodeFactory, findQuickConnectTargets, getBalancedConnectorBranchNodeInput, getConnectorVisualPortPoint, getNearestConnectorPortAtPoint, quickConnectFromPort, } from "./quickConnect";
|
|
16
16
|
export type { ConnectorPortTarget, ConnectorQuickConnectPlan, } from "./quickConnect";
|
|
17
17
|
export { getConnectorPortInteractionState, getVisibleConnectorSourcePortAtPoint, } from "./connectorPortInteraction";
|
|
18
18
|
export * from "./constants";
|
|
@@ -26,4 +26,5 @@ export declare function getConnectorQuickConnectPlan(editor: Editor, source: Con
|
|
|
26
26
|
export declare function getBalancedConnectorBranchNodeInput(editor: Editor, source: ConnectorPortTarget, input: CreateShapeInput): CreateShapeInput;
|
|
27
27
|
export declare function findQuickConnectTargets(editor: Editor, source: ConnectorPortTarget): ConnectorPortTarget[];
|
|
28
28
|
export declare function chooseFacingPort(editor: Editor, shape: ShapeRecord, sourcePagePoint: Vec): ResolvedShapeTerminalBindingPort | null;
|
|
29
|
+
export declare function chooseOpposingPort(editor: Editor, shape: ShapeRecord, sourcePort: ResolvedShapeTerminalBindingPort): ResolvedShapeTerminalBindingPort | null;
|
|
29
30
|
export declare function createDefaultConnectorQuickCreateNodeFactory(): ConnectorQuickCreateNodeFactory;
|
|
@@ -176,6 +176,7 @@ export declare class Editor {
|
|
|
176
176
|
readonly computeLocalBounds: (shape: ShapeRecord) => Box;
|
|
177
177
|
readonly computeRenderBounds: (shape: ShapeRecord) => Box;
|
|
178
178
|
readonly computeExportBounds: (shape: ShapeRecord) => Box;
|
|
179
|
+
readonly computeExportBoundsInShapeSpace: (shape: ShapeRecord, coordinateSpaceShape: ShapeRecord) => Box | null;
|
|
179
180
|
readonly computeLocalToPageTransform: (shape: ShapeRecord) => Mat;
|
|
180
181
|
readonly computeRenderToPageTransform: (shape: ShapeRecord) => Mat;
|
|
181
182
|
readonly computeExportToPageTransform: (shape: ShapeRecord) => Mat;
|
|
@@ -39,5 +39,6 @@ export declare function getShapePositionedOutlineVertices<S extends ShapeRecord>
|
|
|
39
39
|
export declare function getShapePageCorners<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentToPage: Mat): Vec[];
|
|
40
40
|
export declare function getShapePageOutlineVertices<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentToPage: Mat): Vec[];
|
|
41
41
|
export declare function getShapePageBounds<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentToPage: Mat): Box;
|
|
42
|
+
export declare function getShapeExportTransformedBounds<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, localToTarget: Mat): Box;
|
|
42
43
|
export declare function getShapeExportPageBounds<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentToPage: Mat): Box;
|
|
43
44
|
export declare function getShapeGeometry<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentToPage: Mat): ShapeGeometry;
|
|
@@ -9,6 +9,7 @@ export declare function computeEditorShapePositionedBounds(editor: Editor, shape
|
|
|
9
9
|
export declare function computeEditorShapeLocalBounds(editor: Editor, shape: ShapeRecord): Box;
|
|
10
10
|
export declare function computeEditorShapeRenderBounds(editor: Editor, shape: ShapeRecord): Box;
|
|
11
11
|
export declare function computeEditorShapeExportBounds(editor: Editor, shape: ShapeRecord): Box;
|
|
12
|
+
export declare function computeEditorShapeExportBoundsInShapeSpace(editor: Editor, shape: ShapeRecord, coordinateSpaceShape: ShapeRecord): Box | null;
|
|
12
13
|
export declare function computeEditorShapeLocalToPageTransform(editor: Editor, shape: ShapeRecord): Mat;
|
|
13
14
|
export declare function computeEditorShapeRenderToPageTransform(editor: Editor, shape: ShapeRecord): Mat;
|
|
14
15
|
export declare function computeEditorShapeExportToPageTransform(editor: Editor, shape: ShapeRecord): Mat;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Editor, ShapeRecordBase } from "../../canvas-core/index";
|
|
2
|
+
import type { CanvasDomEventGuard } from "./canvasRenderPlugin";
|
|
3
|
+
export interface ShapeHeadingDataUi {
|
|
4
|
+
readonly heading: string;
|
|
5
|
+
readonly dragHandle: string;
|
|
6
|
+
readonly name: string;
|
|
7
|
+
readonly input: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ShapeHeadingControlProps<S extends ShapeRecordBase = ShapeRecordBase> {
|
|
10
|
+
readonly editor: Editor;
|
|
11
|
+
readonly shape: S;
|
|
12
|
+
readonly isEditing: boolean;
|
|
13
|
+
readonly value: string;
|
|
14
|
+
readonly fallback: string;
|
|
15
|
+
readonly bodyWidth: number;
|
|
16
|
+
readonly bodyHeight: number;
|
|
17
|
+
readonly renderHeight: number;
|
|
18
|
+
readonly operationKind: string;
|
|
19
|
+
readonly editAriaLabel: string;
|
|
20
|
+
readonly inputAriaLabel: string;
|
|
21
|
+
readonly dataUi: ShapeHeadingDataUi;
|
|
22
|
+
readonly onValueChange: (value: string) => void;
|
|
23
|
+
readonly editable?: boolean;
|
|
24
|
+
readonly showBackground?: boolean;
|
|
25
|
+
readonly showDragHandle?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export declare function createShapeHeadingDomEventGuard({ id, selector, }: {
|
|
28
|
+
id: string;
|
|
29
|
+
selector: string;
|
|
30
|
+
}): CanvasDomEventGuard;
|
|
31
|
+
export declare function ShapeHeadingControl<S extends ShapeRecordBase>({ editor, shape, isEditing, value, fallback, bodyWidth, bodyHeight, renderHeight, operationKind, editAriaLabel, inputAriaLabel, dataUi, onValueChange, editable, showBackground, showDragHandle, }: ShapeHeadingControlProps<S>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,4 +2,6 @@ export { CanvasRenderBindingsContext, useCanvasOverlays, useCanvasRenderBindings
|
|
|
2
2
|
export type { CanvasDomEventGuards, CanvasOverlayLookup, CanvasRendererLookup, } from "./canvasRenderBindings";
|
|
3
3
|
export type { AnyRegisteredSelectionCustomHandleRenderer, AnyRegisteredShapeRenderer, CanvasOverlayContribution, CanvasDomEventGuard, CanvasDomEventGuardCursorInput, CanvasDomEventGuardDecision, CanvasDomEventGuardInput, CanvasDomEventGuardName, CanvasRenderPluginComponent, CanvasRenderPlugin, RegisteredSelectionCustomHandleRenderer, RegisteredShapeRenderer, SelectionCustomHandleRendererProps, ShapeHoverRendererProps, ShapeRendererProps, ShapeOpacityModifier, } from "./canvasRenderPlugin";
|
|
4
4
|
export { SHAPE_HOVER_STROKE, SHAPE_HOVER_STROKE_WIDTH, } from "./canvasRenderPlugin";
|
|
5
|
+
export { ShapeHeadingControl, createShapeHeadingDomEventGuard, } from "./ShapeHeadingControl";
|
|
6
|
+
export type { ShapeHeadingControlProps, ShapeHeadingDataUi, } from "./ShapeHeadingControl";
|
|
5
7
|
export { createCanvasRenderBindings, type CanvasRenderBindings, } from "./canvasRenderBindings";
|
|
@@ -176,6 +176,7 @@ export declare class Editor {
|
|
|
176
176
|
readonly computeLocalBounds: (shape: ShapeRecord) => Box;
|
|
177
177
|
readonly computeRenderBounds: (shape: ShapeRecord) => Box;
|
|
178
178
|
readonly computeExportBounds: (shape: ShapeRecord) => Box;
|
|
179
|
+
readonly computeExportBoundsInShapeSpace: (shape: ShapeRecord, coordinateSpaceShape: ShapeRecord) => Box | null;
|
|
179
180
|
readonly computeLocalToPageTransform: (shape: ShapeRecord) => Mat;
|
|
180
181
|
readonly computeRenderToPageTransform: (shape: ShapeRecord) => Mat;
|
|
181
182
|
readonly computeExportToPageTransform: (shape: ShapeRecord) => Mat;
|
|
@@ -39,5 +39,6 @@ export declare function getShapePositionedOutlineVertices<S extends ShapeRecord>
|
|
|
39
39
|
export declare function getShapePageCorners<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentToPage: Mat): Vec[];
|
|
40
40
|
export declare function getShapePageOutlineVertices<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentToPage: Mat): Vec[];
|
|
41
41
|
export declare function getShapePageBounds<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentToPage: Mat): Box;
|
|
42
|
+
export declare function getShapeExportTransformedBounds<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, localToTarget: Mat): Box;
|
|
42
43
|
export declare function getShapeExportPageBounds<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentToPage: Mat): Box;
|
|
43
44
|
export declare function getShapeGeometry<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentToPage: Mat): ShapeGeometry;
|
|
@@ -9,6 +9,7 @@ export declare function computeEditorShapePositionedBounds(editor: Editor, shape
|
|
|
9
9
|
export declare function computeEditorShapeLocalBounds(editor: Editor, shape: ShapeRecord): Box;
|
|
10
10
|
export declare function computeEditorShapeRenderBounds(editor: Editor, shape: ShapeRecord): Box;
|
|
11
11
|
export declare function computeEditorShapeExportBounds(editor: Editor, shape: ShapeRecord): Box;
|
|
12
|
+
export declare function computeEditorShapeExportBoundsInShapeSpace(editor: Editor, shape: ShapeRecord, coordinateSpaceShape: ShapeRecord): Box | null;
|
|
12
13
|
export declare function computeEditorShapeLocalToPageTransform(editor: Editor, shape: ShapeRecord): Mat;
|
|
13
14
|
export declare function computeEditorShapeRenderToPageTransform(editor: Editor, shape: ShapeRecord): Mat;
|
|
14
15
|
export declare function computeEditorShapeExportToPageTransform(editor: Editor, shape: ShapeRecord): Mat;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Editor, ShapeRecordBase } from "../../canvas-core/index";
|
|
2
|
+
import type { CanvasDomEventGuard } from "./canvasRenderPlugin";
|
|
3
|
+
export interface ShapeHeadingDataUi {
|
|
4
|
+
readonly heading: string;
|
|
5
|
+
readonly dragHandle: string;
|
|
6
|
+
readonly name: string;
|
|
7
|
+
readonly input: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ShapeHeadingControlProps<S extends ShapeRecordBase = ShapeRecordBase> {
|
|
10
|
+
readonly editor: Editor;
|
|
11
|
+
readonly shape: S;
|
|
12
|
+
readonly isEditing: boolean;
|
|
13
|
+
readonly value: string;
|
|
14
|
+
readonly fallback: string;
|
|
15
|
+
readonly bodyWidth: number;
|
|
16
|
+
readonly bodyHeight: number;
|
|
17
|
+
readonly renderHeight: number;
|
|
18
|
+
readonly operationKind: string;
|
|
19
|
+
readonly editAriaLabel: string;
|
|
20
|
+
readonly inputAriaLabel: string;
|
|
21
|
+
readonly dataUi: ShapeHeadingDataUi;
|
|
22
|
+
readonly onValueChange: (value: string) => void;
|
|
23
|
+
readonly editable?: boolean;
|
|
24
|
+
readonly showBackground?: boolean;
|
|
25
|
+
readonly showDragHandle?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export declare function createShapeHeadingDomEventGuard({ id, selector, }: {
|
|
28
|
+
id: string;
|
|
29
|
+
selector: string;
|
|
30
|
+
}): CanvasDomEventGuard;
|
|
31
|
+
export declare function ShapeHeadingControl<S extends ShapeRecordBase>({ editor, shape, isEditing, value, fallback, bodyWidth, bodyHeight, renderHeight, operationKind, editAriaLabel, inputAriaLabel, dataUi, onValueChange, editable, showBackground, showDragHandle, }: ShapeHeadingControlProps<S>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,4 +2,6 @@ export { CanvasRenderBindingsContext, useCanvasOverlays, useCanvasRenderBindings
|
|
|
2
2
|
export type { CanvasDomEventGuards, CanvasOverlayLookup, CanvasRendererLookup, } from "./canvasRenderBindings";
|
|
3
3
|
export type { AnyRegisteredSelectionCustomHandleRenderer, AnyRegisteredShapeRenderer, CanvasOverlayContribution, CanvasDomEventGuard, CanvasDomEventGuardCursorInput, CanvasDomEventGuardDecision, CanvasDomEventGuardInput, CanvasDomEventGuardName, CanvasRenderPluginComponent, CanvasRenderPlugin, RegisteredSelectionCustomHandleRenderer, RegisteredShapeRenderer, SelectionCustomHandleRendererProps, ShapeHoverRendererProps, ShapeRendererProps, ShapeOpacityModifier, } from "./canvasRenderPlugin";
|
|
4
4
|
export { SHAPE_HOVER_STROKE, SHAPE_HOVER_STROKE_WIDTH, } from "./canvasRenderPlugin";
|
|
5
|
+
export { ShapeHeadingControl, createShapeHeadingDomEventGuard, } from "./ShapeHeadingControl";
|
|
6
|
+
export type { ShapeHeadingControlProps, ShapeHeadingDataUi, } from "./ShapeHeadingControl";
|
|
5
7
|
export { createCanvasRenderBindings, type CanvasRenderBindings, } from "./canvasRenderBindings";
|
|
@@ -176,6 +176,7 @@ export declare class Editor {
|
|
|
176
176
|
readonly computeLocalBounds: (shape: ShapeRecord) => Box;
|
|
177
177
|
readonly computeRenderBounds: (shape: ShapeRecord) => Box;
|
|
178
178
|
readonly computeExportBounds: (shape: ShapeRecord) => Box;
|
|
179
|
+
readonly computeExportBoundsInShapeSpace: (shape: ShapeRecord, coordinateSpaceShape: ShapeRecord) => Box | null;
|
|
179
180
|
readonly computeLocalToPageTransform: (shape: ShapeRecord) => Mat;
|
|
180
181
|
readonly computeRenderToPageTransform: (shape: ShapeRecord) => Mat;
|
|
181
182
|
readonly computeExportToPageTransform: (shape: ShapeRecord) => Mat;
|
|
@@ -39,5 +39,6 @@ export declare function getShapePositionedOutlineVertices<S extends ShapeRecord>
|
|
|
39
39
|
export declare function getShapePageCorners<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentToPage: Mat): Vec[];
|
|
40
40
|
export declare function getShapePageOutlineVertices<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentToPage: Mat): Vec[];
|
|
41
41
|
export declare function getShapePageBounds<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentToPage: Mat): Box;
|
|
42
|
+
export declare function getShapeExportTransformedBounds<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, localToTarget: Mat): Box;
|
|
42
43
|
export declare function getShapeExportPageBounds<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentToPage: Mat): Box;
|
|
43
44
|
export declare function getShapeGeometry<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentToPage: Mat): ShapeGeometry;
|
|
@@ -9,6 +9,7 @@ export declare function computeEditorShapePositionedBounds(editor: Editor, shape
|
|
|
9
9
|
export declare function computeEditorShapeLocalBounds(editor: Editor, shape: ShapeRecord): Box;
|
|
10
10
|
export declare function computeEditorShapeRenderBounds(editor: Editor, shape: ShapeRecord): Box;
|
|
11
11
|
export declare function computeEditorShapeExportBounds(editor: Editor, shape: ShapeRecord): Box;
|
|
12
|
+
export declare function computeEditorShapeExportBoundsInShapeSpace(editor: Editor, shape: ShapeRecord, coordinateSpaceShape: ShapeRecord): Box | null;
|
|
12
13
|
export declare function computeEditorShapeLocalToPageTransform(editor: Editor, shape: ShapeRecord): Mat;
|
|
13
14
|
export declare function computeEditorShapeRenderToPageTransform(editor: Editor, shape: ShapeRecord): Mat;
|
|
14
15
|
export declare function computeEditorShapeExportToPageTransform(editor: Editor, shape: ShapeRecord): Mat;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Editor, ShapeRecordBase } from "../../canvas-core/index";
|
|
2
|
+
import type { CanvasDomEventGuard } from "./canvasRenderPlugin";
|
|
3
|
+
export interface ShapeHeadingDataUi {
|
|
4
|
+
readonly heading: string;
|
|
5
|
+
readonly dragHandle: string;
|
|
6
|
+
readonly name: string;
|
|
7
|
+
readonly input: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ShapeHeadingControlProps<S extends ShapeRecordBase = ShapeRecordBase> {
|
|
10
|
+
readonly editor: Editor;
|
|
11
|
+
readonly shape: S;
|
|
12
|
+
readonly isEditing: boolean;
|
|
13
|
+
readonly value: string;
|
|
14
|
+
readonly fallback: string;
|
|
15
|
+
readonly bodyWidth: number;
|
|
16
|
+
readonly bodyHeight: number;
|
|
17
|
+
readonly renderHeight: number;
|
|
18
|
+
readonly operationKind: string;
|
|
19
|
+
readonly editAriaLabel: string;
|
|
20
|
+
readonly inputAriaLabel: string;
|
|
21
|
+
readonly dataUi: ShapeHeadingDataUi;
|
|
22
|
+
readonly onValueChange: (value: string) => void;
|
|
23
|
+
readonly editable?: boolean;
|
|
24
|
+
readonly showBackground?: boolean;
|
|
25
|
+
readonly showDragHandle?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export declare function createShapeHeadingDomEventGuard({ id, selector, }: {
|
|
28
|
+
id: string;
|
|
29
|
+
selector: string;
|
|
30
|
+
}): CanvasDomEventGuard;
|
|
31
|
+
export declare function ShapeHeadingControl<S extends ShapeRecordBase>({ editor, shape, isEditing, value, fallback, bodyWidth, bodyHeight, renderHeight, operationKind, editAriaLabel, inputAriaLabel, dataUi, onValueChange, editable, showBackground, showDragHandle, }: ShapeHeadingControlProps<S>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,4 +2,6 @@ export { CanvasRenderBindingsContext, useCanvasOverlays, useCanvasRenderBindings
|
|
|
2
2
|
export type { CanvasDomEventGuards, CanvasOverlayLookup, CanvasRendererLookup, } from "./canvasRenderBindings";
|
|
3
3
|
export type { AnyRegisteredSelectionCustomHandleRenderer, AnyRegisteredShapeRenderer, CanvasOverlayContribution, CanvasDomEventGuard, CanvasDomEventGuardCursorInput, CanvasDomEventGuardDecision, CanvasDomEventGuardInput, CanvasDomEventGuardName, CanvasRenderPluginComponent, CanvasRenderPlugin, RegisteredSelectionCustomHandleRenderer, RegisteredShapeRenderer, SelectionCustomHandleRendererProps, ShapeHoverRendererProps, ShapeRendererProps, ShapeOpacityModifier, } from "./canvasRenderPlugin";
|
|
4
4
|
export { SHAPE_HOVER_STROKE, SHAPE_HOVER_STROKE_WIDTH, } from "./canvasRenderPlugin";
|
|
5
|
+
export { ShapeHeadingControl, createShapeHeadingDomEventGuard, } from "./ShapeHeadingControl";
|
|
6
|
+
export type { ShapeHeadingControlProps, ShapeHeadingDataUi, } from "./ShapeHeadingControl";
|
|
5
7
|
export { createCanvasRenderBindings, type CanvasRenderBindings, } from "./canvasRenderBindings";
|
|
@@ -12,7 +12,7 @@ export type { ConnectorInfo, ConnectorSegment, ConnectorTerminalOffsetInput, Con
|
|
|
12
12
|
export { CONNECTOR_ARROW_TERMINAL_PADDING, getConnectorArrowGlyphLength, getConnectorArrowLength, getConnectorArrowMagnification, getConnectorMarkerPath, getConnectorMarkerRefX, } from "./connectorMarker";
|
|
13
13
|
export { commitConnectorCreation, createConnectorBoundEndpoint, getConnectorCreationInvalidReason, getConnectorParentId, resolveConnectorDraftEndpoint, resolveConnectorDraftParentId, hasDirectedConnector, setConnectorTerminalPagePoint, } from "./connectorModel";
|
|
14
14
|
export type { CommitConnectorCreationInput, ConnectorBoundEndpoint, ConnectorCreationInvalidReason, ConnectorDraftEndpoint, ResolvedConnectorDraftEndpoint, } from "./connectorModel";
|
|
15
|
-
export { chooseFacingPort, createDefaultConnectorQuickCreateNodeFactory, findQuickConnectTargets, getBalancedConnectorBranchNodeInput, getConnectorVisualPortPoint, getNearestConnectorPortAtPoint, quickConnectFromPort, } from "./quickConnect";
|
|
15
|
+
export { chooseFacingPort, chooseOpposingPort, createDefaultConnectorQuickCreateNodeFactory, findQuickConnectTargets, getBalancedConnectorBranchNodeInput, getConnectorVisualPortPoint, getNearestConnectorPortAtPoint, quickConnectFromPort, } from "./quickConnect";
|
|
16
16
|
export type { ConnectorPortTarget, ConnectorQuickConnectPlan, } from "./quickConnect";
|
|
17
17
|
export { getConnectorPortInteractionState, getVisibleConnectorSourcePortAtPoint, } from "./connectorPortInteraction";
|
|
18
18
|
export * from "./constants";
|
|
@@ -26,4 +26,5 @@ export declare function getConnectorQuickConnectPlan(editor: Editor, source: Con
|
|
|
26
26
|
export declare function getBalancedConnectorBranchNodeInput(editor: Editor, source: ConnectorPortTarget, input: CreateShapeInput): CreateShapeInput;
|
|
27
27
|
export declare function findQuickConnectTargets(editor: Editor, source: ConnectorPortTarget): ConnectorPortTarget[];
|
|
28
28
|
export declare function chooseFacingPort(editor: Editor, shape: ShapeRecord, sourcePagePoint: Vec): ResolvedShapeTerminalBindingPort | null;
|
|
29
|
+
export declare function chooseOpposingPort(editor: Editor, shape: ShapeRecord, sourcePort: ResolvedShapeTerminalBindingPort): ResolvedShapeTerminalBindingPort | null;
|
|
29
30
|
export declare function createDefaultConnectorQuickCreateNodeFactory(): ConnectorQuickCreateNodeFactory;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Editor, ShapeId } from "./_vendor/canvas-core/index";
|
|
2
|
+
import { type CanvasShapeRef } from "./_vendor/canvas-extension-contracts/index";
|
|
3
|
+
export interface FlowNodeRef extends CanvasShapeRef<"flow-node"> {
|
|
4
|
+
readonly contentId: ShapeId;
|
|
5
|
+
}
|
|
6
|
+
export interface FlowApi {
|
|
7
|
+
wrapShape(shapeId: ShapeId): FlowNodeRef | null;
|
|
8
|
+
unwrapNode(nodeId: ShapeId): CanvasShapeRef | null;
|
|
9
|
+
}
|
|
10
|
+
export declare const flowApiToken: import("./_vendor/canvas-extension-contracts/index").CanvasApiToken<FlowApi>;
|
|
11
|
+
export declare function createFlowPluginApi({ editor }: {
|
|
12
|
+
editor: Editor;
|
|
13
|
+
}): FlowApi;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type EditorPlugin, type ShapeSvgExporter, type SvgExportContext, type SvgNode } from "./_vendor/canvas-core/index";
|
|
2
|
+
import type { FlowNodeShapeRecord } from "./types";
|
|
3
|
+
export declare class FlowNodeSvgExporter implements ShapeSvgExporter<FlowNodeShapeRecord> {
|
|
4
|
+
readonly type: "flow-node";
|
|
5
|
+
toSvg(shape: FlowNodeShapeRecord, _context: SvgExportContext): SvgNode;
|
|
6
|
+
toSvgForeground(shape: FlowNodeShapeRecord, _context: SvgExportContext): SvgNode;
|
|
7
|
+
}
|
|
8
|
+
export declare function createFlowEditorPlugin(): EditorPlugin;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { CreateShapeInput, Editor, ShapeId, ShapeRecord } from "./_vendor/canvas-core/index";
|
|
2
|
+
import type { FlowNodeKind, FlowNodeShapeRecord } from "./types";
|
|
3
|
+
export interface FlowNodeCreationResult {
|
|
4
|
+
readonly contentId: ShapeId;
|
|
5
|
+
readonly nodeId: ShapeId;
|
|
6
|
+
}
|
|
7
|
+
interface FlowNodeDefinition {
|
|
8
|
+
readonly w: number;
|
|
9
|
+
readonly h: number;
|
|
10
|
+
readonly title: string;
|
|
11
|
+
readonly contentProps: Record<string, unknown>;
|
|
12
|
+
}
|
|
13
|
+
export declare function getDefaultFlowNodeTitle(kind: FlowNodeKind): string;
|
|
14
|
+
export declare function getFlowNodeDefinition(editor: Editor, kind: FlowNodeKind): FlowNodeDefinition;
|
|
15
|
+
export declare function createFlowNodeWithContent(editor: Editor, nodeInput: CreateShapeInput, kind: FlowNodeKind): FlowNodeCreationResult | null;
|
|
16
|
+
export declare function wrapShapeAsFlowNode(editor: Editor, shapeId: ShapeId): FlowNodeCreationResult | null;
|
|
17
|
+
export declare function unwrapFlowNode(editor: Editor, nodeId: ShapeId): ShapeRecord | null;
|
|
18
|
+
export declare function isFlowNodeShape(shape: ShapeRecord | null | undefined): shape is FlowNodeShapeRecord;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Box, ShapeUtil, Vec, type ShapeRecordBase } from "./_vendor/canvas-core/index";
|
|
2
|
+
import type { FlowNodeShapeProps, FlowNodeShapeRecord } from "./types";
|
|
3
|
+
export declare const FLOW_NODE_TITLE_RENDER_HEIGHT = 34;
|
|
4
|
+
export declare function getFlowNodeDisplayTitle(shape: FlowNodeShapeRecord): string;
|
|
5
|
+
export declare function getFlowNodeRenderBounds(shape: FlowNodeShapeRecord): Box;
|
|
6
|
+
export declare class FlowNodeShapeUtil extends ShapeUtil<FlowNodeShapeRecord> {
|
|
7
|
+
readonly type: "flow-node";
|
|
8
|
+
getDefaultProps(): FlowNodeShapeProps;
|
|
9
|
+
validateProps(props: unknown): FlowNodeShapeProps;
|
|
10
|
+
getLocalBounds(shape: FlowNodeShapeRecord): Box;
|
|
11
|
+
getRenderBounds(shape: FlowNodeShapeRecord): Box;
|
|
12
|
+
getPointHitTestBounds(shape: FlowNodeShapeRecord): Box;
|
|
13
|
+
hitTest(shape: FlowNodeShapeRecord, positionedPoint: Vec): boolean;
|
|
14
|
+
hitTestBindingTarget(shape: FlowNodeShapeRecord, positionedPoint: Vec): boolean;
|
|
15
|
+
canEdit(_shape: FlowNodeShapeRecord): boolean;
|
|
16
|
+
canReceiveTerminalBinding(_shape: FlowNodeShapeRecord): boolean;
|
|
17
|
+
canReceiveChildren(_shape: FlowNodeShapeRecord): boolean;
|
|
18
|
+
canReceiveChild(_shape: FlowNodeShapeRecord, child: ShapeRecordBase): boolean;
|
|
19
|
+
canAutomaticallyReceiveChildren(_shape: FlowNodeShapeRecord): boolean;
|
|
20
|
+
getChildClipLocalBounds(shape: FlowNodeShapeRecord): Box;
|
|
21
|
+
isSelectionTransformContainer(_shape: FlowNodeShapeRecord): boolean;
|
|
22
|
+
shouldResizeDescendants(_shape: FlowNodeShapeRecord): boolean;
|
|
23
|
+
getResizeToFitDescendantsProps(shape: FlowNodeShapeRecord, descendantBounds: Box): FlowNodeShapeProps;
|
|
24
|
+
}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
export { Flow, createFlowPlugin } from "./feature";
|
|
2
2
|
export { createFlowCanvasRenderPlugin } from "./canvasRender";
|
|
3
3
|
export { FLOW_NODE_GAP_PAGE, createFlowNodeFromPort, } from "./nodeCreation";
|
|
4
|
-
export type { CreateFlowNodeResult
|
|
5
|
-
export
|
|
4
|
+
export type { CreateFlowNodeResult } from "./nodeCreation";
|
|
5
|
+
export { getDefaultFlowNodeTitle, isFlowNodeShape, unwrapFlowNode, wrapShapeAsFlowNode, } from "./flowNodeOperations";
|
|
6
|
+
export type { FlowNodeCreationResult } from "./flowNodeOperations";
|
|
7
|
+
export { FlowNodeShapeUtil, FLOW_NODE_TITLE_RENDER_HEIGHT, getFlowNodeDisplayTitle, getFlowNodeRenderBounds, } from "./flowNodeShapeUtil";
|
|
8
|
+
export { FlowNodeSvgExporter, createFlowEditorPlugin, } from "./editorRuntime";
|
|
9
|
+
export { flowApiToken } from "./api";
|
|
10
|
+
export type { FlowApi, FlowNodeRef } from "./api";
|
|
11
|
+
export type { FlowNodeKind, FlowNodeShapeProps, FlowNodeShapeRecord, FlowPluginOptions, } from "./types";
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { type Editor, type ShapeId } from "./_vendor/canvas-core/index";
|
|
2
2
|
import { type ConnectorPortTarget } from "./_vendor/plugin-connector/index";
|
|
3
|
-
|
|
3
|
+
import type { FlowNodeKind } from "./types";
|
|
4
4
|
export interface CreateFlowNodeResult {
|
|
5
|
+
readonly contentId: ShapeId;
|
|
5
6
|
readonly connectorId: ShapeId;
|
|
6
7
|
readonly nodeId: ShapeId;
|
|
7
8
|
}
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
import type { TerminalBindingPortId } from "./_vendor/canvas-core/index";
|
|
1
|
+
import type { ShapeRecordBase, TerminalBindingPortId } from "./_vendor/canvas-core/index";
|
|
2
|
+
export type FlowNodeKind = "text" | "image";
|
|
3
|
+
export interface FlowNodeShapeProps {
|
|
4
|
+
readonly w: number;
|
|
5
|
+
readonly h: number;
|
|
6
|
+
readonly title: string;
|
|
7
|
+
readonly kind: FlowNodeKind;
|
|
8
|
+
}
|
|
9
|
+
export type FlowNodeShapeRecord = ShapeRecordBase<"flow-node", FlowNodeShapeProps>;
|
|
2
10
|
export interface FlowPluginOptions {
|
|
3
11
|
visiblePortIds?: readonly TerminalBindingPortId[];
|
|
4
12
|
}
|
|
@@ -176,6 +176,7 @@ export declare class Editor {
|
|
|
176
176
|
readonly computeLocalBounds: (shape: ShapeRecord) => Box;
|
|
177
177
|
readonly computeRenderBounds: (shape: ShapeRecord) => Box;
|
|
178
178
|
readonly computeExportBounds: (shape: ShapeRecord) => Box;
|
|
179
|
+
readonly computeExportBoundsInShapeSpace: (shape: ShapeRecord, coordinateSpaceShape: ShapeRecord) => Box | null;
|
|
179
180
|
readonly computeLocalToPageTransform: (shape: ShapeRecord) => Mat;
|
|
180
181
|
readonly computeRenderToPageTransform: (shape: ShapeRecord) => Mat;
|
|
181
182
|
readonly computeExportToPageTransform: (shape: ShapeRecord) => Mat;
|
|
@@ -39,5 +39,6 @@ export declare function getShapePositionedOutlineVertices<S extends ShapeRecord>
|
|
|
39
39
|
export declare function getShapePageCorners<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentToPage: Mat): Vec[];
|
|
40
40
|
export declare function getShapePageOutlineVertices<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentToPage: Mat): Vec[];
|
|
41
41
|
export declare function getShapePageBounds<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentToPage: Mat): Box;
|
|
42
|
+
export declare function getShapeExportTransformedBounds<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, localToTarget: Mat): Box;
|
|
42
43
|
export declare function getShapeExportPageBounds<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentToPage: Mat): Box;
|
|
43
44
|
export declare function getShapeGeometry<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentToPage: Mat): ShapeGeometry;
|
|
@@ -9,6 +9,7 @@ export declare function computeEditorShapePositionedBounds(editor: Editor, shape
|
|
|
9
9
|
export declare function computeEditorShapeLocalBounds(editor: Editor, shape: ShapeRecord): Box;
|
|
10
10
|
export declare function computeEditorShapeRenderBounds(editor: Editor, shape: ShapeRecord): Box;
|
|
11
11
|
export declare function computeEditorShapeExportBounds(editor: Editor, shape: ShapeRecord): Box;
|
|
12
|
+
export declare function computeEditorShapeExportBoundsInShapeSpace(editor: Editor, shape: ShapeRecord, coordinateSpaceShape: ShapeRecord): Box | null;
|
|
12
13
|
export declare function computeEditorShapeLocalToPageTransform(editor: Editor, shape: ShapeRecord): Mat;
|
|
13
14
|
export declare function computeEditorShapeRenderToPageTransform(editor: Editor, shape: ShapeRecord): Mat;
|
|
14
15
|
export declare function computeEditorShapeExportToPageTransform(editor: Editor, shape: ShapeRecord): Mat;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Editor, ShapeRecordBase } from "../../canvas-core/index";
|
|
2
|
+
import type { CanvasDomEventGuard } from "./canvasRenderPlugin";
|
|
3
|
+
export interface ShapeHeadingDataUi {
|
|
4
|
+
readonly heading: string;
|
|
5
|
+
readonly dragHandle: string;
|
|
6
|
+
readonly name: string;
|
|
7
|
+
readonly input: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ShapeHeadingControlProps<S extends ShapeRecordBase = ShapeRecordBase> {
|
|
10
|
+
readonly editor: Editor;
|
|
11
|
+
readonly shape: S;
|
|
12
|
+
readonly isEditing: boolean;
|
|
13
|
+
readonly value: string;
|
|
14
|
+
readonly fallback: string;
|
|
15
|
+
readonly bodyWidth: number;
|
|
16
|
+
readonly bodyHeight: number;
|
|
17
|
+
readonly renderHeight: number;
|
|
18
|
+
readonly operationKind: string;
|
|
19
|
+
readonly editAriaLabel: string;
|
|
20
|
+
readonly inputAriaLabel: string;
|
|
21
|
+
readonly dataUi: ShapeHeadingDataUi;
|
|
22
|
+
readonly onValueChange: (value: string) => void;
|
|
23
|
+
readonly editable?: boolean;
|
|
24
|
+
readonly showBackground?: boolean;
|
|
25
|
+
readonly showDragHandle?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export declare function createShapeHeadingDomEventGuard({ id, selector, }: {
|
|
28
|
+
id: string;
|
|
29
|
+
selector: string;
|
|
30
|
+
}): CanvasDomEventGuard;
|
|
31
|
+
export declare function ShapeHeadingControl<S extends ShapeRecordBase>({ editor, shape, isEditing, value, fallback, bodyWidth, bodyHeight, renderHeight, operationKind, editAriaLabel, inputAriaLabel, dataUi, onValueChange, editable, showBackground, showDragHandle, }: ShapeHeadingControlProps<S>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,4 +2,6 @@ export { CanvasRenderBindingsContext, useCanvasOverlays, useCanvasRenderBindings
|
|
|
2
2
|
export type { CanvasDomEventGuards, CanvasOverlayLookup, CanvasRendererLookup, } from "./canvasRenderBindings";
|
|
3
3
|
export type { AnyRegisteredSelectionCustomHandleRenderer, AnyRegisteredShapeRenderer, CanvasOverlayContribution, CanvasDomEventGuard, CanvasDomEventGuardCursorInput, CanvasDomEventGuardDecision, CanvasDomEventGuardInput, CanvasDomEventGuardName, CanvasRenderPluginComponent, CanvasRenderPlugin, RegisteredSelectionCustomHandleRenderer, RegisteredShapeRenderer, SelectionCustomHandleRendererProps, ShapeHoverRendererProps, ShapeRendererProps, ShapeOpacityModifier, } from "./canvasRenderPlugin";
|
|
4
4
|
export { SHAPE_HOVER_STROKE, SHAPE_HOVER_STROKE_WIDTH, } from "./canvasRenderPlugin";
|
|
5
|
+
export { ShapeHeadingControl, createShapeHeadingDomEventGuard, } from "./ShapeHeadingControl";
|
|
6
|
+
export type { ShapeHeadingControlProps, ShapeHeadingDataUi, } from "./ShapeHeadingControl";
|
|
5
7
|
export { createCanvasRenderBindings, type CanvasRenderBindings, } from "./canvasRenderBindings";
|
|
@@ -176,6 +176,7 @@ export declare class Editor {
|
|
|
176
176
|
readonly computeLocalBounds: (shape: ShapeRecord) => Box;
|
|
177
177
|
readonly computeRenderBounds: (shape: ShapeRecord) => Box;
|
|
178
178
|
readonly computeExportBounds: (shape: ShapeRecord) => Box;
|
|
179
|
+
readonly computeExportBoundsInShapeSpace: (shape: ShapeRecord, coordinateSpaceShape: ShapeRecord) => Box | null;
|
|
179
180
|
readonly computeLocalToPageTransform: (shape: ShapeRecord) => Mat;
|
|
180
181
|
readonly computeRenderToPageTransform: (shape: ShapeRecord) => Mat;
|
|
181
182
|
readonly computeExportToPageTransform: (shape: ShapeRecord) => Mat;
|
|
@@ -39,5 +39,6 @@ export declare function getShapePositionedOutlineVertices<S extends ShapeRecord>
|
|
|
39
39
|
export declare function getShapePageCorners<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentToPage: Mat): Vec[];
|
|
40
40
|
export declare function getShapePageOutlineVertices<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentToPage: Mat): Vec[];
|
|
41
41
|
export declare function getShapePageBounds<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentToPage: Mat): Box;
|
|
42
|
+
export declare function getShapeExportTransformedBounds<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, localToTarget: Mat): Box;
|
|
42
43
|
export declare function getShapeExportPageBounds<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentToPage: Mat): Box;
|
|
43
44
|
export declare function getShapeGeometry<S extends ShapeRecord>(shape: S, util: ShapeUtil<S>, parentToPage: Mat): ShapeGeometry;
|
|
@@ -9,6 +9,7 @@ export declare function computeEditorShapePositionedBounds(editor: Editor, shape
|
|
|
9
9
|
export declare function computeEditorShapeLocalBounds(editor: Editor, shape: ShapeRecord): Box;
|
|
10
10
|
export declare function computeEditorShapeRenderBounds(editor: Editor, shape: ShapeRecord): Box;
|
|
11
11
|
export declare function computeEditorShapeExportBounds(editor: Editor, shape: ShapeRecord): Box;
|
|
12
|
+
export declare function computeEditorShapeExportBoundsInShapeSpace(editor: Editor, shape: ShapeRecord, coordinateSpaceShape: ShapeRecord): Box | null;
|
|
12
13
|
export declare function computeEditorShapeLocalToPageTransform(editor: Editor, shape: ShapeRecord): Mat;
|
|
13
14
|
export declare function computeEditorShapeRenderToPageTransform(editor: Editor, shape: ShapeRecord): Mat;
|
|
14
15
|
export declare function computeEditorShapeExportToPageTransform(editor: Editor, shape: ShapeRecord): Mat;
|