@yuzhouu/canvas-kit 0.1.21 → 0.1.22

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.
@@ -1,12 +1,17 @@
1
- import type { Editor, ShapeRecord } from "../../../canvas-core/index";
1
+ import { type Editor, type ShapeId, type ShapeRecord } from "../../../canvas-core/index";
2
2
  import { type AnyRegisteredShapeRenderer, type ShapeRendererProps } from "../../host/canvasRenderPlugin";
3
+ import type { ShapeFrame } from "./shapeFrame";
3
4
  interface MemoizedShapeRendererProps extends ShapeRendererProps {
4
5
  Component: AnyRegisteredShapeRenderer["component"];
5
6
  }
6
7
  export declare const MemoizedShapeRenderer: import("react").NamedExoticComponent<MemoizedShapeRendererProps>;
7
- export declare function ShapeHoverDecoration({ Component, editor, shape, }: {
8
+ export declare function ShapeHoverDecoration({ Component, editor, shape, frame, clipAncestorIds, opacity, stackingOrder, }: {
8
9
  Component: NonNullable<AnyRegisteredShapeRenderer["hoverComponent"]>;
9
10
  editor: Editor;
10
11
  shape: ShapeRecord;
11
- }): import("react/jsx-runtime").JSX.Element;
12
+ frame: ShapeFrame;
13
+ clipAncestorIds: readonly ShapeId[];
14
+ opacity: number;
15
+ stackingOrder: number;
16
+ }): import("react/jsx-runtime").JSX.Element | null;
12
17
  export {};
@@ -0,0 +1,9 @@
1
+ export declare function ShapeHoverRect({ dataUi, width, height, x, y, radius, strokeWidth, }: {
2
+ dataUi: string;
3
+ width: number;
4
+ height: number;
5
+ x?: number;
6
+ y?: number;
7
+ radius?: number;
8
+ strokeWidth: number;
9
+ }): import("react/jsx-runtime").JSX.Element;
@@ -7,13 +7,14 @@ export interface ShapeRendererProps<S extends ShapeRecordBase = ShapeRecordBase>
7
7
  shapeEditingSession: ShapeEditingSession | null;
8
8
  }
9
9
  /**
10
- * Rendered inside the shape's render-bounds host. SVG coordinates should match
11
- * the shape util's `getRenderBounds()` coordinate space.
10
+ * Rendered inside an SVG hover host that handles shape and ancestor transforms.
11
+ * Return SVG content with non-scaling strokes. Nested SVG coordinates should
12
+ * match the shape util's `getRenderBounds()` coordinate space; use x/y for offsets.
12
13
  */
13
14
  export interface ShapeHoverRendererProps<S extends ShapeRecordBase = ShapeRecordBase> {
14
15
  shape: S;
15
16
  editor: Editor;
16
- /** Local-space width that renders as the standard hover width on screen. */
17
+ /** Zoom-adjusted SVG non-scaling stroke width, independent of shape scale. */
17
18
  strokeWidth: number;
18
19
  }
19
20
  export declare const SHAPE_HOVER_STROKE = "var(--land-shape-hover, var(--land-selection, #2563eb))";
@@ -2,6 +2,7 @@ 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, RegisteredShapeDecoration, RegisteredShapeRenderer, SelectionCustomHandleRendererProps, ShapeHoverRendererProps, ShapeRendererProps, ShapeOpacityModifier, } from "./canvasRenderPlugin";
4
4
  export { SHAPE_HOVER_STROKE, SHAPE_HOVER_STROKE_WIDTH, } from "./canvasRenderPlugin";
5
+ export { ShapeHoverRect } from "./ShapeHoverRect";
5
6
  export { ShapeHeadingControl, createShapeHeadingDomEventGuard, } from "./ShapeHeadingControl";
6
7
  export type { ShapeHeadingControlProps, ShapeHeadingDataUi, } from "./ShapeHeadingControl";
7
8
  export { createCanvasRenderBindings, type CanvasRenderBindings, } from "./canvasRenderBindings";