@yuzhouu/canvas-kit 0.1.7 → 0.1.8
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 +5 -1
- package/_vendor/canvas-core/editor/commands.d.ts +10 -1
- package/_vendor/canvas-core/editor/createEditorWithRuntimePlugins.d.ts +6 -0
- package/_vendor/canvas-core/editor/editor.d.ts +6 -1
- package/_vendor/canvas-core/editor/index.d.ts +1 -1
- package/_vendor/canvas-core/editor/managers/documentSnapshotManager.d.ts +1 -1
- package/_vendor/canvas-core/editor/managers/snapCalculations.d.ts +34 -4
- package/_vendor/canvas-core/editor/managers/snapManager.d.ts +7 -0
- package/_vendor/canvas-core/editor/managers/snapTypes.d.ts +15 -0
- package/_vendor/canvas-core/editor/middleMousePanInteraction.d.ts +2 -0
- package/_vendor/canvas-core/index.d.ts +6 -6
- package/_vendor/canvas-core/plugins/{editorPlugin.d.ts → editorRuntimePlugin.d.ts} +3 -3
- package/_vendor/canvas-core/plugins/index.d.ts +1 -1
- package/_vendor/canvas-core/schema/records.d.ts +10 -1
- package/_vendor/canvas-core/shapes/shapeUtil.d.ts +13 -4
- package/_vendor/canvas-core/shapes/types.d.ts +2 -2
- package/_vendor/canvas-react/components/CanvasView.d.ts +3 -3
- package/_vendor/canvas-react/components/useCanvasDomEvents.d.ts +2 -0
- package/_vendor/canvas-react/host/actionRegistry.d.ts +15 -0
- package/_vendor/canvas-react/host/{canvasPlugin.d.ts → canvasRenderPlugin.d.ts} +5 -5
- package/_vendor/canvas-react/host/canvasRenderPluginHost.d.ts +2 -0
- package/_vendor/canvas-react/host/canvasRenderPluginHostManifest.d.ts +2 -0
- package/_vendor/canvas-react/host/canvasRenderPluginHostRuntime.d.ts +3 -0
- package/_vendor/canvas-react/host/canvasRenderPluginHostTypes.d.ts +104 -0
- package/_vendor/canvas-react/host/canvasRenderPluginHostValidation.d.ts +11 -0
- package/_vendor/canvas-react/host/contextMenuRegistry.d.ts +8 -3
- package/_vendor/canvas-react/host/domEventGuards.d.ts +3 -3
- package/_vendor/canvas-react/host/extension.d.ts +4 -4
- package/_vendor/canvas-react/host/index.d.ts +5 -4
- package/_vendor/canvas-react/host/overlayRegistry.d.ts +3 -3
- package/_vendor/canvas-react/host/rendererRegistry.d.ts +3 -3
- package/_vendor/canvas-react/host/toolbarRegistry.d.ts +9 -13
- package/_vendor/plugin-arrow/canvasRender.d.ts +2 -0
- package/_vendor/plugin-arrow/{editor.d.ts → editorRuntime.d.ts} +2 -2
- package/_vendor/plugin-arrow/index.d.ts +2 -2
- package/_vendor/plugin-draw/canvasRender.d.ts +2 -0
- package/_vendor/plugin-draw/{editor.d.ts → editorRuntime.d.ts} +2 -2
- package/_vendor/plugin-draw/index.d.ts +2 -2
- package/_vendor/plugin-eraser/canvasRender.d.ts +2 -0
- package/_vendor/plugin-eraser/editorRuntime.d.ts +2 -0
- package/_vendor/plugin-eraser/index.d.ts +2 -2
- package/_vendor/plugin-frame/{canvas.d.ts → canvasRender.d.ts} +2 -2
- package/_vendor/plugin-frame/{editor.d.ts → editorRuntime.d.ts} +2 -2
- package/_vendor/plugin-frame/index.d.ts +2 -2
- package/_vendor/plugin-geo/{canvas.d.ts → canvasRender.d.ts} +2 -2
- package/_vendor/plugin-geo/{editor.d.ts → editorRuntime.d.ts} +2 -2
- package/_vendor/plugin-geo/geoGeometry.d.ts +19 -3
- package/_vendor/plugin-geo/index.d.ts +2 -2
- package/_vendor/plugin-geo/types.d.ts +1 -0
- package/_vendor/plugin-group/{canvas.d.ts → canvasRender.d.ts} +2 -2
- package/_vendor/plugin-group/{editor.d.ts → editorRuntime.d.ts} +2 -2
- package/_vendor/plugin-group/index.d.ts +2 -2
- package/_vendor/plugin-image/{editor.d.ts → actionIds.d.ts} +0 -8
- package/_vendor/plugin-image/canvasRender.d.ts +2 -0
- package/_vendor/plugin-image/cropRuntime.d.ts +2 -0
- package/_vendor/plugin-image/editorRuntime.d.ts +5 -0
- package/_vendor/plugin-image/imageHostActionContract.d.ts +2 -0
- package/_vendor/plugin-image/imageShapeUtil.d.ts +2 -1
- package/_vendor/plugin-image/imageSvgExporter.d.ts +6 -0
- package/_vendor/plugin-image/index.d.ts +8 -4
- package/_vendor/plugin-image/runtimeShared.d.ts +5 -0
- package/_vendor/plugin-image/smudge.d.ts +56 -0
- package/_vendor/plugin-image/smudgeInteractions.d.ts +2 -0
- package/_vendor/plugin-image/smudgeRuntime.d.ts +2 -0
- package/_vendor/plugin-image/styleRuntime.d.ts +17 -0
- package/_vendor/plugin-image/toolbarRuntime.d.ts +3 -0
- package/_vendor/plugin-image/types.d.ts +16 -1
- package/_vendor/plugin-laser/canvasRender.d.ts +2 -0
- package/_vendor/plugin-laser/editorRuntime.d.ts +2 -0
- package/_vendor/plugin-laser/index.d.ts +2 -2
- package/_vendor/plugin-text/canvasRender.d.ts +5 -0
- package/_vendor/plugin-text/editorRuntime.d.ts +5 -0
- package/_vendor/plugin-text/host/RichTextLinkPopover.d.ts +14 -0
- package/_vendor/plugin-text/host/richTextRendering.d.ts +9 -1
- package/_vendor/plugin-text/index.d.ts +2 -0
- package/_vendor/plugin-text/richTextLinks.d.ts +3 -0
- package/_vendor/plugin-text/richTextUtils.d.ts +2 -1
- package/browser/indexedDb.d.ts +10 -0
- package/browser/persistence.d.ts +2 -4
- package/builtins/controller/createBuiltInCanvasController.d.ts +1 -1
- package/builtins/controller/layerController.d.ts +1 -1
- package/builtins/controller/shapeCreationController.d.ts +6 -2
- package/builtins/index.d.ts +1 -1
- package/chrome/toolbar/CanvasKitWheelCapture.d.ts +2 -0
- package/chrome/{FloatingSelectionToolbarPageSpace.d.ts → toolbar/FloatingSelectionToolbarPageSpace.d.ts} +1 -1
- package/{core/features → chrome}/toolbar/toolbarLabels.d.ts +1 -1
- package/chrome/{bindings → toolbar}/useToolbarSurfaces.d.ts +2 -2
- package/chrome/types.d.ts +12 -8
- package/chrome/useCanvasKitChromeContext.d.ts +6 -4
- package/chrome/{bindings/useCanvasKitLayerTree.d.ts → useCanvasKitLayerTree.d.ts} +1 -1
- package/chrome/{bindings/useContextMenuSurface.d.ts → useContextMenuSurface.d.ts} +3 -3
- package/chrome/useHistoryControls.d.ts +12 -0
- package/chrome/usePageControls.d.ts +16 -0
- package/chrome/{bindings/useSvgExport.d.ts → useSvgExport.d.ts} +2 -2
- package/chrome/useZoomControls.d.ts +9 -0
- package/controller/canvasKitController.d.ts +10 -7
- package/core/api/apiRegistry.d.ts +12 -0
- package/core/index.d.ts +4 -19
- package/core/{controller → product-controller}/canvasProductController.d.ts +17 -4
- package/core/product-controller/index.d.ts +2 -0
- package/core/runtime/productDefinition.d.ts +5 -4
- package/core/runtime/productHost.d.ts +5 -2
- package/{core/features/actions/canvasActionContext.d.ts → features/actions/actionRuntime.d.ts} +7 -1
- package/{core/features → features}/clipboard/clipboardContextMenuContributions.d.ts +1 -1
- package/features/clipboard/clipboardContribution.d.ts +11 -0
- package/features/clipboard/clipboardHostExtension.d.ts +2 -0
- package/{core/features → features}/clipboard/clipboardService.d.ts +3 -3
- package/features/context-menu/contextMenuRuntime.d.ts +13 -0
- package/{core/features → features}/export/svgExport.d.ts +1 -1
- package/features/image/asset/imageAssetService.d.ts +11 -0
- package/features/image/{imageBlobStore.d.ts → asset/imageBlobStore.d.ts} +3 -2
- package/features/image/asset/imageFileHelpers.d.ts +49 -0
- package/features/image/{svgImageAssetInliner.d.ts → asset/svgImageAssetInliner.d.ts} +1 -1
- package/features/image/controller/imageProductController.d.ts +27 -0
- package/features/image/imageHostExtension.d.ts +10 -5
- package/features/image/{ImageImportController.d.ts → import/ImageImportController.d.ts} +3 -3
- package/features/image/{useImageImport.d.ts → import/useImageImport.d.ts} +3 -4
- package/features/image/index.d.ts +17 -15
- package/features/image/smudge/imageSmudgeHostActions.d.ts +10 -0
- package/features/image/smudge/imageSmudgeTypes.d.ts +24 -0
- package/features/image/toolbar/imageHostActions.d.ts +69 -0
- package/features/image/{imageToolbarHostBridge.d.ts → toolbar/imageToolbarHostBridge.d.ts} +2 -2
- package/features/keyboard/keyboardShortcutHostExtension.d.ts +2 -0
- package/features/keyboard/useCanvasKitKeyboardShortcuts.d.ts +6 -0
- package/{react → features/persistence}/CanvasKitPersistenceNotice.d.ts +1 -1
- package/features/persistence/persistenceHostExtension.d.ts +2 -0
- package/{core/features/actions/canvasActions.d.ts → features/selection/selectionActions.d.ts} +3 -9
- package/{core/features/toolbar → features/selection}/selectionContextMenuContributions.d.ts +1 -1
- package/features/selection/selectionHostExtension.d.ts +2 -0
- package/features/selection/selectionToolbarContributions.d.ts +2 -0
- package/features/tool/toolActions.d.ts +2 -0
- package/{core/features/toolbar → features/tool}/toolContextMenuContributions.d.ts +1 -1
- package/features/tool/toolHostExtension.d.ts +2 -0
- package/features/tool/toolToolbarContributions.d.ts +2 -0
- package/features/view/viewActions.d.ts +5 -0
- package/{core/features/context-menu → features/view}/viewContextMenuContributions.d.ts +1 -1
- package/features/view/viewHostExtension.d.ts +2 -0
- package/host/defaultHostExtensions.d.ts +2 -0
- package/index.d.ts +12 -7
- package/index.mjs +96 -76
- package/package.json +1 -1
- package/product/canvasKitProduct.d.ts +8 -7
- package/react/useCanvasKitController.d.ts +1 -1
- package/react/useCanvasKitRuntime.d.ts +1 -1
- package/runtime/canvasKitHostContracts.d.ts +135 -0
- package/runtime/canvasKitHostFeatureHooks.d.ts +12 -0
- package/runtime/canvasKitRuntime.d.ts +8 -6
- package/runtime/canvasKitRuntimePlan.d.ts +50 -0
- package/_vendor/canvas-core/editor/createEditorWithPlugins.d.ts +0 -6
- package/_vendor/canvas-react/host/pluginHost.d.ts +0 -2
- package/_vendor/canvas-react/host/pluginHostManifest.d.ts +0 -2
- package/_vendor/canvas-react/host/pluginHostRuntime.d.ts +0 -3
- package/_vendor/canvas-react/host/pluginHostTypes.d.ts +0 -102
- package/_vendor/canvas-react/host/pluginHostValidation.d.ts +0 -11
- package/_vendor/plugin-arrow/canvas.d.ts +0 -2
- package/_vendor/plugin-draw/canvas.d.ts +0 -2
- package/_vendor/plugin-eraser/canvas.d.ts +0 -2
- package/_vendor/plugin-eraser/editor.d.ts +0 -2
- package/_vendor/plugin-image/canvas.d.ts +0 -2
- package/_vendor/plugin-laser/canvas.d.ts +0 -2
- package/_vendor/plugin-laser/editor.d.ts +0 -2
- package/_vendor/plugin-text/canvas.d.ts +0 -5
- package/_vendor/plugin-text/editor.d.ts +0 -5
- package/chrome/bindings/useCanvasKitChromeControls.d.ts +0 -27
- package/core/controller/featureControllerRegistry.d.ts +0 -12
- package/core/controller/index.d.ts +0 -4
- package/core/features/clipboard/clipboardContribution.d.ts +0 -19
- package/core/features/context-menu/contextMenuActions.d.ts +0 -12
- package/core/features/context-menu/contextMenuContext.d.ts +0 -6
- package/core/features/context-menu/contextMenuContribution.d.ts +0 -4
- package/core/features/hostActionIds.d.ts +0 -1
- package/core/features/toolbar/toolbarContribution.d.ts +0 -4
- package/core/runtime/productContributions.d.ts +0 -9
- package/features/image/imageAssetService.d.ts +0 -7
- package/features/image/imageFileHelpers.d.ts +0 -35
- package/features/image/imageHostActions.d.ts +0 -36
- package/features/image/imageProductController.d.ts +0 -22
- package/features/image/imageProductToolbarActions.d.ts +0 -2
- package/react/useCanvasKitKeyboardShortcuts.d.ts +0 -6
- package/runtime/canvasKitHostExtensions.d.ts +0 -19
- package/runtime/canvasKitRuntimeInitializer.d.ts +0 -11
- /package/chrome/{CanvasKitFloatingToolbarLayer.d.ts → toolbar/CanvasKitFloatingToolbarLayer.d.ts} +0 -0
- /package/core/{controller → product-controller}/productLayerTree.d.ts +0 -0
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
import type { ContextMenuContext, ContextMenuContribution, ContextMenuContributionTarget, ContextMenuSection,
|
|
1
|
+
import type { ContextMenuContext, ContextMenuContribution, ContextMenuContributionTarget, ContextMenuSection, LandEditorRuntimePlugin } from "../../canvas-core/index";
|
|
2
2
|
export declare class CanvasContextMenuRegistry {
|
|
3
3
|
private readonly contributions;
|
|
4
|
+
private readonly contributionsByTarget;
|
|
5
|
+
private readonly contributionIndexes;
|
|
4
6
|
private readonly duplicateContributionIds;
|
|
7
|
+
private nextContributionIndex;
|
|
5
8
|
registerContribution(contribution: ContextMenuContribution, options?: {
|
|
6
9
|
replace?: boolean;
|
|
7
10
|
}): void;
|
|
8
|
-
|
|
11
|
+
registerEditorRuntimePlugins(plugins: readonly LandEditorRuntimePlugin[]): void;
|
|
9
12
|
getDuplicateContributionIds(): string[];
|
|
10
13
|
getSections(target: ContextMenuContributionTarget, context: ContextMenuContext): ContextMenuSection[];
|
|
14
|
+
private addToIndex;
|
|
15
|
+
private removeFromIndex;
|
|
11
16
|
}
|
|
12
|
-
export declare function createCanvasContextMenuRegistry(plugins?: readonly
|
|
17
|
+
export declare function createCanvasContextMenuRegistry(plugins?: readonly LandEditorRuntimePlugin[]): CanvasContextMenuRegistry;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { type CanvasDomEventGuard, type CanvasDomEventGuardCursorInput, type CanvasDomEventGuardInput, type
|
|
1
|
+
import { type CanvasDomEventGuard, type CanvasDomEventGuardCursorInput, type CanvasDomEventGuardInput, type LandCanvasRenderPlugin } from "./canvasRenderPlugin";
|
|
2
2
|
export declare class CanvasDomEventGuardRegistry {
|
|
3
3
|
private readonly guards;
|
|
4
4
|
private readonly registeredGuardIds;
|
|
5
5
|
register(guard: CanvasDomEventGuard): void;
|
|
6
|
-
|
|
6
|
+
registerCanvasRenderPlugins(plugins: readonly LandCanvasRenderPlugin[]): void;
|
|
7
7
|
getGuards(): readonly CanvasDomEventGuard[];
|
|
8
8
|
handle(input: CanvasDomEventGuardInput): "continue" | "handled";
|
|
9
9
|
getCursor(input: CanvasDomEventGuardCursorInput): string | undefined;
|
|
10
10
|
}
|
|
11
|
-
export declare function createCanvasDomEventGuardRegistry(plugins?: readonly
|
|
11
|
+
export declare function createCanvasDomEventGuardRegistry(plugins?: readonly LandCanvasRenderPlugin[]): CanvasDomEventGuardRegistry;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { LandEditorRuntimePlugin, ShapeRecordBase } from "../../canvas-core/index";
|
|
2
|
+
import type { LandCanvasRenderPlugin } from "./canvasRenderPlugin";
|
|
3
3
|
type LandExtensionOptions = Record<string, unknown>;
|
|
4
4
|
export interface LandFeatureBundle {
|
|
5
5
|
id: string;
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
editorRuntimePlugins: readonly LandEditorRuntimePlugin[];
|
|
7
|
+
canvasRenderPlugins: readonly LandCanvasRenderPlugin[];
|
|
8
8
|
shapeTypes: readonly ShapeRecordBase["type"][];
|
|
9
9
|
}
|
|
10
10
|
export interface LandExtension {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { CanvasActionRegistry, createCanvasActionRegistry, } from "./actionRegistry";
|
|
1
2
|
export { CanvasRendererRegistryContext, useCanvasRendererRegistry, } from "./canvasRendererRegistryContext";
|
|
2
3
|
export { CanvasOverlayRegistryContext, useCanvasOverlayRegistry, } from "./canvasOverlayRegistryContext";
|
|
3
4
|
export { CanvasDomEventGuardRegistry, createCanvasDomEventGuardRegistry, } from "./domEventGuards";
|
|
@@ -5,9 +6,9 @@ export { CanvasOverlayRegistry, createCanvasOverlayRegistry, } from "./overlayRe
|
|
|
5
6
|
export { CanvasRendererRegistry, createCanvasRendererRegistry, } from "./rendererRegistry";
|
|
6
7
|
export { CanvasToolbarRegistry, createCanvasToolbarRegistry, } from "./toolbarRegistry";
|
|
7
8
|
export { CanvasContextMenuRegistry, createCanvasContextMenuRegistry, } from "./contextMenuRegistry";
|
|
8
|
-
export type { AnyRegisteredSelectionCustomHandleRenderer, AnyRegisteredShapeRenderer, CanvasOverlayContribution, CanvasOverlayLayer, CanvasDomEventGuard, CanvasDomEventGuardCursorInput, CanvasDomEventGuardDecision, CanvasDomEventGuardInput, CanvasDomEventGuardName,
|
|
9
|
-
export { getShapeStrokeForHover, SHAPE_HOVER_STROKE, } from "./
|
|
9
|
+
export type { AnyRegisteredSelectionCustomHandleRenderer, AnyRegisteredShapeRenderer, CanvasOverlayContribution, CanvasOverlayLayer, CanvasDomEventGuard, CanvasDomEventGuardCursorInput, CanvasDomEventGuardDecision, CanvasDomEventGuardInput, CanvasDomEventGuardName, CanvasRenderPluginComponent, CanvasRenderPluginProvider, LandCanvasRenderPlugin, RegisteredSelectionCustomHandleRenderer, RegisteredShapeRenderer, SelectionCustomHandleRendererProps, ShapeRendererProps, } from "./canvasRenderPlugin";
|
|
10
|
+
export { getShapeStrokeForHover, SHAPE_HOVER_STROKE, } from "./canvasRenderPlugin";
|
|
10
11
|
export { defineLandExtension, resolveLandExtensions, } from "./extension";
|
|
11
12
|
export type { ConfigurableLandExtension, LandExtension, LandExtensionConfig, LandExtensionOptionsInput, LandFeatureBundle, ResolvedLandExtension, } from "./extension";
|
|
12
|
-
export {
|
|
13
|
-
export type {
|
|
13
|
+
export { createCanvasRenderPluginHostRuntime } from "./canvasRenderPluginHost";
|
|
14
|
+
export type { CanvasRenderPluginHostManifestContextMenuContributionEntry, CanvasRenderPluginHostManifestEntry, CanvasRenderPluginHostManifestToolbarContributionEntry, CanvasRenderPluginHostRuntime, CanvasRenderPluginHostShapeValidationSummary, CanvasRenderPluginHostSource, CanvasRenderPluginHostValidationIssue, CanvasRenderPluginHostValidationIssueSeverity, CanvasRenderPluginHostValidationSummary, CanvasRenderPluginHostVerdict, CreateCanvasRenderPluginHostRuntimeOptions, } from "./canvasRenderPluginHost";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SelectionCustomHandle } from "../../canvas-core/index";
|
|
2
|
-
import type { AnyRegisteredSelectionCustomHandleRenderer, CanvasOverlayContribution, CanvasOverlayLayer,
|
|
2
|
+
import type { AnyRegisteredSelectionCustomHandleRenderer, CanvasOverlayContribution, CanvasOverlayLayer, LandCanvasRenderPlugin, RegisteredSelectionCustomHandleRenderer } from "./canvasRenderPlugin";
|
|
3
3
|
export declare class CanvasOverlayRegistry {
|
|
4
4
|
private readonly selectionCustomHandleRenderers;
|
|
5
5
|
private readonly canvasOverlays;
|
|
@@ -13,6 +13,6 @@ export declare class CanvasOverlayRegistry {
|
|
|
13
13
|
getSelectionCustomHandleRenderer(type: SelectionCustomHandle["type"]): AnyRegisteredSelectionCustomHandleRenderer | null;
|
|
14
14
|
hasSelectionCustomHandleRenderer(type: SelectionCustomHandle["type"]): boolean;
|
|
15
15
|
getRegisteredSelectionCustomHandleTypes(): SelectionCustomHandle["type"][];
|
|
16
|
-
|
|
16
|
+
registerCanvasRenderPlugins(plugins: readonly LandCanvasRenderPlugin[]): void;
|
|
17
17
|
}
|
|
18
|
-
export declare function createCanvasOverlayRegistry(plugins?: readonly
|
|
18
|
+
export declare function createCanvasOverlayRegistry(plugins?: readonly LandCanvasRenderPlugin[]): CanvasOverlayRegistry;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ShapeRecordBase } from "../../canvas-core/index";
|
|
2
|
-
import type { AnyRegisteredShapeRenderer,
|
|
2
|
+
import type { AnyRegisteredShapeRenderer, LandCanvasRenderPlugin, RegisteredShapeRenderer } from "./canvasRenderPlugin";
|
|
3
3
|
export declare class CanvasRendererRegistry {
|
|
4
4
|
private readonly registry;
|
|
5
5
|
private readonly registeredPluginIds;
|
|
@@ -7,6 +7,6 @@ export declare class CanvasRendererRegistry {
|
|
|
7
7
|
getShapeRenderer(type: ShapeRecordBase["type"]): AnyRegisteredShapeRenderer | null;
|
|
8
8
|
hasShapeRenderer(type: ShapeRecordBase["type"]): boolean;
|
|
9
9
|
getRegisteredShapeTypes(): ShapeRecordBase["type"][];
|
|
10
|
-
|
|
10
|
+
registerCanvasRenderPlugins(plugins: readonly LandCanvasRenderPlugin[]): void;
|
|
11
11
|
}
|
|
12
|
-
export declare function createCanvasRendererRegistry(plugins?: readonly
|
|
12
|
+
export declare function createCanvasRendererRegistry(plugins?: readonly LandCanvasRenderPlugin[]): CanvasRendererRegistry;
|
|
@@ -1,24 +1,20 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { LandEditorRuntimePlugin, CanvasActionContext, ToolbarContribution, ToolbarGroup, ToolbarPlacement, ToolbarSurface } from "../../canvas-core/index";
|
|
2
2
|
export declare class CanvasToolbarRegistry {
|
|
3
|
-
private readonly actions;
|
|
4
3
|
private readonly contributions;
|
|
5
|
-
private readonly
|
|
6
|
-
private readonly
|
|
4
|
+
private readonly contributionsBySurface;
|
|
5
|
+
private readonly contributionsBySurfaceAndPlacement;
|
|
6
|
+
private readonly contributionIndexes;
|
|
7
7
|
private readonly duplicateContributionIds;
|
|
8
|
-
|
|
9
|
-
replace?: boolean;
|
|
10
|
-
}): void;
|
|
11
|
-
registerHostAction(action: CanvasAction): void;
|
|
8
|
+
private nextContributionIndex;
|
|
12
9
|
registerContribution(contribution: ToolbarContribution, options?: {
|
|
13
10
|
replace?: boolean;
|
|
14
11
|
}): void;
|
|
15
|
-
|
|
16
|
-
getAction(actionId: string): CanvasAction | null;
|
|
17
|
-
getHostActionIds(): string[];
|
|
18
|
-
getDuplicateActionIds(): string[];
|
|
12
|
+
registerEditorRuntimePlugins(plugins: readonly LandEditorRuntimePlugin[]): void;
|
|
19
13
|
getDuplicateContributionIds(): string[];
|
|
20
14
|
getGroups(surface: ToolbarSurface, context: CanvasActionContext, options?: {
|
|
21
15
|
placement?: ToolbarPlacement;
|
|
22
16
|
}): ToolbarGroup[];
|
|
17
|
+
private addToIndexes;
|
|
18
|
+
private removeFromIndexes;
|
|
23
19
|
}
|
|
24
|
-
export declare function createCanvasToolbarRegistry(plugins?: readonly
|
|
20
|
+
export declare function createCanvasToolbarRegistry(plugins?: readonly LandEditorRuntimePlugin[]): CanvasToolbarRegistry;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type LandEditorRuntimePlugin, type ShapeSvgExporter, type SvgExportContext, type SvgNode } from "../canvas-core/index";
|
|
2
2
|
import type { ArrowShapeRecord } from "./types";
|
|
3
3
|
export declare class ArrowShapeSvgExporter implements ShapeSvgExporter<ArrowShapeRecord> {
|
|
4
4
|
readonly type: "arrow";
|
|
5
5
|
toSvg(shape: ArrowShapeRecord, context: SvgExportContext): SvgNode;
|
|
6
6
|
}
|
|
7
|
-
export declare function
|
|
7
|
+
export declare function createArrowEditorRuntimePlugin(): LandEditorRuntimePlugin;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { ArrowBindingUtil } from "./arrowBindingUtil";
|
|
2
2
|
export { ArrowShapeUtil } from "./arrowShapeUtil";
|
|
3
3
|
export { ArrowTool } from "./arrowTool";
|
|
4
|
-
export { ArrowShapeSvgExporter,
|
|
5
|
-
export {
|
|
4
|
+
export { ArrowShapeSvgExporter, createArrowEditorRuntimePlugin } from "./editorRuntime";
|
|
5
|
+
export { createArrowCanvasRenderPlugin } from "./canvasRender";
|
|
6
6
|
export { Arrow, createArrowFeatureBundle } from "./feature";
|
|
7
7
|
export { isArrowBindingRecord, isArrowShapeRecord, type ArrowBindingProps, type ArrowBindingRecord, type ArrowPoint, type ArrowShapeProps, type ArrowShapeRecord, type ArrowTerminal, } from "./types";
|
|
8
8
|
export { getArrowBindingAnchorPagePoint, resolveArrowBindingPagePoint, } from "./arrowBindingAnchors";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type LandEditorRuntimePlugin, type ShapeSvgExporter, type SvgExportContext, type SvgNode } from "../canvas-core/index";
|
|
2
2
|
import { type DrawShapeRecord } from "./types";
|
|
3
3
|
export declare class DrawShapeSvgExporter implements ShapeSvgExporter<DrawShapeRecord> {
|
|
4
4
|
readonly type: "draw";
|
|
5
5
|
toSvg(shape: DrawShapeRecord, context: SvgExportContext): SvgNode | null;
|
|
6
6
|
}
|
|
7
|
-
export declare function
|
|
7
|
+
export declare function createDrawEditorRuntimePlugin(): LandEditorRuntimePlugin;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { DrawTool } from "./drawTool";
|
|
2
2
|
export { DrawShapeUtil } from "./drawShapeUtil";
|
|
3
|
-
export { DrawShapeSvgExporter,
|
|
3
|
+
export { DrawShapeSvgExporter, createDrawEditorRuntimePlugin } from "./editorRuntime";
|
|
4
4
|
export { DrawShapeSvg } from "./DrawShapeRenderer";
|
|
5
|
-
export {
|
|
5
|
+
export { createDrawCanvasRenderPlugin } from "./canvasRender";
|
|
6
6
|
export { Draw, createDrawFeatureBundle } from "./feature";
|
|
7
7
|
export { flipDrawShapeInSelectionBounds, getDrawShapeDiagnostics, getDrawShapePageSegments, getDrawShapePagePoints, normalizeTransformedDrawShape, } from "./drawGeometry";
|
|
8
8
|
export { interpolateDrawShapeRecords } from "./drawInterpolation";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { EraserTool } from "./eraserTool";
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
2
|
+
export { createEraserCanvasRenderPlugin } from "./canvasRender";
|
|
3
|
+
export { createEraserEditorRuntimePlugin } from "./editorRuntime";
|
|
4
4
|
export { Eraser, createEraserFeatureBundle } from "./feature";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type LandCanvasRenderPlugin } from "../canvas-react/host/index";
|
|
2
2
|
import type { FrameShapeRecord } from "./frameShapeUtil";
|
|
3
3
|
interface FrameShapeSvgProps {
|
|
4
4
|
shape: FrameShapeRecord;
|
|
5
5
|
isHovered?: boolean;
|
|
6
6
|
}
|
|
7
|
-
export declare function
|
|
7
|
+
export declare function createFrameCanvasRenderPlugin(): LandCanvasRenderPlugin;
|
|
8
8
|
export declare function FrameShapeSvg({ shape, isHovered }: FrameShapeSvgProps): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type LandEditorRuntimePlugin, type ShapeSvgExporter, type SvgNode, type SvgExportContext } from "../canvas-core/index";
|
|
2
2
|
import { type FrameShapeRecord } from "./frameShapeUtil";
|
|
3
3
|
export declare class FrameShapeSvgExporter implements ShapeSvgExporter<FrameShapeRecord> {
|
|
4
4
|
readonly type: "frame";
|
|
5
5
|
toSvg(shape: FrameShapeRecord, context: SvgExportContext): SvgNode;
|
|
6
6
|
}
|
|
7
|
-
export declare function
|
|
7
|
+
export declare function createFrameEditorRuntimePlugin(): LandEditorRuntimePlugin;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { FrameShapeUtil } from "./frameShapeUtil";
|
|
2
2
|
export type { FrameShapeProps, FrameShapeRecord } from "./frameShapeUtil";
|
|
3
3
|
export { FrameTool } from "./frameTool";
|
|
4
|
-
export { FrameShapeSvgExporter,
|
|
5
|
-
export {
|
|
4
|
+
export { FrameShapeSvgExporter, createFrameEditorRuntimePlugin } from "./editorRuntime";
|
|
5
|
+
export { createFrameCanvasRenderPlugin } from "./canvasRender";
|
|
6
6
|
export { Frame, createFrameFeatureBundle } from "./feature";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ShapeColor } from "../canvas-core/index";
|
|
2
|
-
import { type
|
|
2
|
+
import { type LandCanvasRenderPlugin } from "../canvas-react/host/index";
|
|
3
3
|
import type { GeoShapeRecord } from "./types";
|
|
4
4
|
interface GeoShapeSvgProps {
|
|
5
5
|
shape: GeoShapeRecord;
|
|
@@ -8,6 +8,6 @@ interface GeoShapeSvgProps {
|
|
|
8
8
|
stroke?: ShapeColor;
|
|
9
9
|
strokeWidth?: number;
|
|
10
10
|
}
|
|
11
|
-
export declare function
|
|
11
|
+
export declare function createGeoCanvasRenderPlugin(): LandCanvasRenderPlugin;
|
|
12
12
|
export declare function GeoShapeSvg({ shape, fill, isHovered, stroke, strokeWidth, }: GeoShapeSvgProps): import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type LandEditorRuntimePlugin, type ShapeSvgExporter, type SvgExportContext, type SvgNode } from "../canvas-core/index";
|
|
2
2
|
import { type GeoShapeRecord } from "./types";
|
|
3
3
|
export declare class GeoShapeSvgExporter implements ShapeSvgExporter<GeoShapeRecord> {
|
|
4
4
|
readonly type: "geo";
|
|
5
5
|
toSvg(shape: GeoShapeRecord, context: SvgExportContext): SvgNode;
|
|
6
6
|
}
|
|
7
|
-
export declare function
|
|
7
|
+
export declare function createGeoEditorRuntimePlugin(): LandEditorRuntimePlugin;
|
|
@@ -1,8 +1,24 @@
|
|
|
1
1
|
import { Box, Vec } from "../canvas-core/index";
|
|
2
2
|
import type { GeoShapeKind } from "./types";
|
|
3
3
|
export declare const GEO_ELLIPSE_SEGMENTS = 32;
|
|
4
|
-
export declare
|
|
4
|
+
export declare const GEO_RECTANGLE_DEFAULT_CORNER_RADIUS_PERCENT = 12;
|
|
5
|
+
export declare const GEO_RECTANGLE_MAX_CORNER_RADIUS_PERCENT = 50;
|
|
6
|
+
export declare const GEO_RECTANGLE_CORNER_SEGMENTS = 4;
|
|
7
|
+
export declare function getGeoOutlinePoints(bounds: Box, geo: GeoShapeKind, options?: {
|
|
8
|
+
cornerRadiusPercent?: unknown;
|
|
9
|
+
}): Vec[];
|
|
5
10
|
export declare function getGeoEllipsePoints(bounds: Box, segments?: number): Vec[];
|
|
6
|
-
export declare function
|
|
7
|
-
export declare function
|
|
11
|
+
export declare function normalizeGeoRectangleCornerRadiusPercent(value: unknown, fallback?: number): number;
|
|
12
|
+
export declare function getGeoRectangleCornerRadius({ cornerRadiusPercent, h, w, }: {
|
|
13
|
+
cornerRadiusPercent?: unknown;
|
|
14
|
+
h: number;
|
|
15
|
+
w: number;
|
|
16
|
+
}): number;
|
|
17
|
+
export declare function getGeoRoundedRectanglePoints(bounds: Box, radius?: number, segments?: number): Vec[];
|
|
18
|
+
export declare function getGeoPolygonPoints(bounds: Box, geo: Exclude<GeoShapeKind, "ellipse">, options?: {
|
|
19
|
+
cornerRadiusPercent?: unknown;
|
|
20
|
+
}): Vec[];
|
|
21
|
+
export declare function getGeoPolygonPoints(bounds: Box, geo: GeoShapeKind, options?: {
|
|
22
|
+
cornerRadiusPercent?: unknown;
|
|
23
|
+
}): Vec[];
|
|
8
24
|
export declare function isPointInPolygon(point: Vec, points: readonly Vec[]): boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { DiamondTool, EllipseTool, HexagonTool, RectangleTool, StarTool, TriangleTool, } from "./geoTools";
|
|
2
2
|
export { GeoShapeUtil } from "./geoShapeUtil";
|
|
3
|
-
export { GeoShapeSvgExporter,
|
|
4
|
-
export { GeoShapeSvg,
|
|
3
|
+
export { GeoShapeSvgExporter, createGeoEditorRuntimePlugin } from "./editorRuntime";
|
|
4
|
+
export { GeoShapeSvg, createGeoCanvasRenderPlugin } from "./canvasRender";
|
|
5
5
|
export { Geo, createGeoFeatureBundle } from "./feature";
|
|
6
6
|
export type { GeoShapeKind, GeoShapeProps, GeoShapeRecord } from "./types";
|
|
7
7
|
export { GEO_SHAPE_KINDS, isGeoShapeKind, isGeoShapeRecord } from "./types";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type LandCanvasRenderPlugin } from "../canvas-react/host/index";
|
|
2
2
|
import type { GroupShapeRecord } from "./groupShapeUtil";
|
|
3
3
|
interface GroupShapeSvgProps {
|
|
4
4
|
shape: GroupShapeRecord;
|
|
5
5
|
isHovered?: boolean;
|
|
6
6
|
isSelected?: boolean;
|
|
7
7
|
}
|
|
8
|
-
export declare function
|
|
8
|
+
export declare function createGroupCanvasRenderPlugin(): LandCanvasRenderPlugin;
|
|
9
9
|
export declare function GroupShapeSvg({ shape, isHovered, isSelected, }: GroupShapeSvgProps): import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type LandEditorRuntimePlugin, type ShapeSvgExporter, type SvgNode } from "../canvas-core/index";
|
|
2
2
|
import { type GroupShapeRecord } from "./groupShapeUtil";
|
|
3
3
|
export declare class GroupShapeSvgExporter implements ShapeSvgExporter<GroupShapeRecord> {
|
|
4
4
|
readonly type: "group";
|
|
5
5
|
toSvg(_shape: GroupShapeRecord): SvgNode;
|
|
6
6
|
}
|
|
7
|
-
export declare function
|
|
7
|
+
export declare function createGroupEditorRuntimePlugin(): LandEditorRuntimePlugin;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { GroupShapeUtil } from "./groupShapeUtil";
|
|
2
2
|
export type { GroupShapeProps, GroupShapeRecord } from "./groupShapeUtil";
|
|
3
|
-
export { GroupShapeSvgExporter,
|
|
4
|
-
export {
|
|
3
|
+
export { GroupShapeSvgExporter, createGroupEditorRuntimePlugin } from "./editorRuntime";
|
|
4
|
+
export { createGroupCanvasRenderPlugin } from "./canvasRender";
|
|
5
5
|
export { Group, createGroupFeatureBundle } from "./feature";
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { type LandEditorPlugin, type ShapeSvgExporter, type SvgExportContext, type SvgNode, type CanvasActionContext } from "../canvas-core/index";
|
|
2
|
-
import { type ImageShapeRecord } from "./types";
|
|
3
1
|
export declare const IMAGE_REPLACE_TOOLBAR_ACTION_ID = "image.replace";
|
|
4
2
|
export declare const IMAGE_DOWNLOAD_TOOLBAR_ACTION_ID = "image.download-original";
|
|
5
3
|
export declare const IMAGE_INSERT_TOOLBAR_ACTION_ID = "image.insert";
|
|
@@ -9,9 +7,3 @@ export declare const IMAGE_CROP_ZOOM_TOOLBAR_ACTION_ID = "image.crop.zoom";
|
|
|
9
7
|
export declare const IMAGE_CROP_ASPECT_RATIO_TOOLBAR_ACTION_ID = "image.crop.aspect-ratio";
|
|
10
8
|
export declare const IMAGE_CROP_RESET_TOOLBAR_ACTION_ID = "image.crop.reset";
|
|
11
9
|
export declare const IMAGE_CORNER_RADIUS_TOOLBAR_ACTION_ID = "image.corner-radius";
|
|
12
|
-
export declare class ImageShapeSvgExporter implements ShapeSvgExporter<ImageShapeRecord> {
|
|
13
|
-
readonly type: "image";
|
|
14
|
-
toSvg(shape: ImageShapeRecord, context: SvgExportContext): SvgNode | null;
|
|
15
|
-
}
|
|
16
|
-
export declare function createImageEditorPlugin(): LandEditorPlugin;
|
|
17
|
-
export declare function isImageCropToolbarSession(context: CanvasActionContext): boolean;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { LandEditorRuntimePlugin } from "../canvas-core/index";
|
|
2
|
+
export { IMAGE_CORNER_RADIUS_TOOLBAR_ACTION_ID, IMAGE_CROP_ASPECT_RATIO_TOOLBAR_ACTION_ID, IMAGE_CROP_DONE_TOOLBAR_ACTION_ID, IMAGE_CROP_RESET_TOOLBAR_ACTION_ID, IMAGE_CROP_TOOLBAR_ACTION_ID, IMAGE_CROP_ZOOM_TOOLBAR_ACTION_ID, IMAGE_DOWNLOAD_TOOLBAR_ACTION_ID, IMAGE_INSERT_TOOLBAR_ACTION_ID, IMAGE_REPLACE_TOOLBAR_ACTION_ID, } from "./actionIds";
|
|
3
|
+
export { ImageShapeSvgExporter } from "./imageSvgExporter";
|
|
4
|
+
export { isImageCropToolbarSession, isImageSmudgeToolbarSession, } from "./runtimeShared";
|
|
5
|
+
export declare function createImageEditorRuntimePlugin(): LandEditorRuntimePlugin;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Box, ShapeUtil, type ShapeSelectionHandleAnchorInput, type ShapeSelectionHandleAnchors, type ShapeSelectionResizeAspectRatioLockInput } from "../canvas-core/index";
|
|
1
|
+
import { Box, ShapeUtil, type ShapeEditEndInput, type ShapeSelectionHandleAnchorInput, type ShapeSelectionHandleAnchors, type ShapeSelectionResizeAspectRatioLockInput } from "../canvas-core/index";
|
|
2
2
|
import type { ImageShapeProps, ImageShapeRecord } from "./types";
|
|
3
3
|
export declare class ImageShapeUtil extends ShapeUtil<ImageShapeRecord> {
|
|
4
4
|
readonly type: "image";
|
|
@@ -8,5 +8,6 @@ export declare class ImageShapeUtil extends ShapeUtil<ImageShapeRecord> {
|
|
|
8
8
|
canReceiveTerminalBinding(_shape: ImageShapeRecord): boolean;
|
|
9
9
|
getSelectionResizeAspectRatioLock(_shape: ImageShapeRecord, input: ShapeSelectionResizeAspectRatioLockInput): boolean | null;
|
|
10
10
|
canEdit(_shape: ImageShapeRecord): boolean;
|
|
11
|
+
onEditEnd(shape: ImageShapeRecord, input: ShapeEditEndInput): void;
|
|
11
12
|
getSelectionHandleAnchors(shape: ImageShapeRecord, input: ShapeSelectionHandleAnchorInput): ShapeSelectionHandleAnchors;
|
|
12
13
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ShapeSvgExporter, SvgExportContext, SvgNode } from "../canvas-core/index";
|
|
2
|
+
import type { ImageShapeRecord } from "./types";
|
|
3
|
+
export declare class ImageShapeSvgExporter implements ShapeSvgExporter<ImageShapeRecord> {
|
|
4
|
+
readonly type: "image";
|
|
5
|
+
toSvg(shape: ImageShapeRecord, context: SvgExportContext): SvgNode | null;
|
|
6
|
+
}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
export { IMAGE_CROP_ASPECT_RATIO_TOOLBAR_ACTION_ID, IMAGE_CROP_DONE_TOOLBAR_ACTION_ID, IMAGE_CROP_RESET_TOOLBAR_ACTION_ID, IMAGE_CROP_TOOLBAR_ACTION_ID, IMAGE_CROP_ZOOM_TOOLBAR_ACTION_ID, IMAGE_CORNER_RADIUS_TOOLBAR_ACTION_ID, IMAGE_DOWNLOAD_TOOLBAR_ACTION_ID, IMAGE_INSERT_TOOLBAR_ACTION_ID, IMAGE_REPLACE_TOOLBAR_ACTION_ID, ImageShapeSvgExporter,
|
|
2
|
-
export {
|
|
1
|
+
export { IMAGE_CROP_ASPECT_RATIO_TOOLBAR_ACTION_ID, IMAGE_CROP_DONE_TOOLBAR_ACTION_ID, IMAGE_CROP_RESET_TOOLBAR_ACTION_ID, IMAGE_CROP_TOOLBAR_ACTION_ID, IMAGE_CROP_ZOOM_TOOLBAR_ACTION_ID, IMAGE_CORNER_RADIUS_TOOLBAR_ACTION_ID, IMAGE_DOWNLOAD_TOOLBAR_ACTION_ID, IMAGE_INSERT_TOOLBAR_ACTION_ID, IMAGE_REPLACE_TOOLBAR_ACTION_ID, ImageShapeSvgExporter, createImageEditorRuntimePlugin, isImageCropToolbarSession, isImageSmudgeToolbarSession, } from "./editorRuntime";
|
|
2
|
+
export { createImageCanvasRenderPlugin } from "./canvasRender";
|
|
3
3
|
export { createImageCropInteractionHandler, createImageCropSelectionHandleInteractionHandler, } from "./cropInteractions";
|
|
4
|
-
export {
|
|
4
|
+
export { createImageSmudgeInteractionHandler } from "./smudgeInteractions";
|
|
5
|
+
export { getImageCropModeMarkId, getImageCropRectOrDefault, } from "./crop";
|
|
6
|
+
export type { ImageCropRect } from "./crop";
|
|
7
|
+
export { IMAGE_SMUDGE_CANCEL_TOOLBAR_ACTION_ID, IMAGE_SMUDGE_CONFIRM_TOOLBAR_ACTION_ID, IMAGE_SMUDGE_TOOLBAR_ACTION_ID, cancelImageSmudgeSession, cancelImageSmudgeSessionIfActive, cloneImageSmudgeStrokes, completeImageSmudgeSession, getActiveImageSmudgeSession, getImageSmudgeModeMarkId, isImageSmudgeModeForShape, isImageSmudgeToolbarActionId, registerImageSmudgeConfirmHandler, requestImageSmudgeConfirm, startImageSmudgeSession, } from "./smudge";
|
|
8
|
+
export type { ImageSmudgeBrush, ImageSmudgeStroke, ImageSmudgeStrokePoint, } from "./smudge";
|
|
5
9
|
export { Image, createImageFeatureBundle } from "./feature";
|
|
6
10
|
export { ImageShapeUtil } from "./imageShapeUtil";
|
|
7
|
-
export type { ImageAssetProps, ImageAssetRecord, ImageShapeCrop, ImageShapeProps, ImageShapeRecord, } from "./types";
|
|
11
|
+
export type { ImageAssetProps, ImageAssetRecord, ImageAssetSource, ImageRemoteCopyState, ImageShapeCrop, ImageShapeProps, ImageShapeRecord, } from "./types";
|
|
8
12
|
export { isImageAssetRecord, isImageShapeRecord } from "./types";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CanvasActionContext } from "../canvas-core/index";
|
|
2
|
+
import { type ImageShapeRecord } from "./types";
|
|
3
|
+
export declare function getSingleSelectedImageShape(context: CanvasActionContext): ImageShapeRecord | null;
|
|
4
|
+
export declare function isImageCropToolbarSession(context: CanvasActionContext): boolean;
|
|
5
|
+
export declare function isImageSmudgeToolbarSession(context: CanvasActionContext): boolean;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { Editor, ShapeId } from "../canvas-core/index";
|
|
2
|
+
import type { ImageShapeRecord } from "./types";
|
|
3
|
+
export declare const IMAGE_SMUDGE_TOOLBAR_ACTION_ID = "image.smudge";
|
|
4
|
+
export declare const IMAGE_SMUDGE_CANCEL_TOOLBAR_ACTION_ID = "image.smudge.cancel";
|
|
5
|
+
export declare const IMAGE_SMUDGE_CONFIRM_TOOLBAR_ACTION_ID = "image.smudge.confirm";
|
|
6
|
+
export declare const IMAGE_SMUDGE_HISTORY_MARK_PREFIX = "image.smudge:";
|
|
7
|
+
export declare const IMAGE_SMUDGE_MODE_ENTRY_MARK_PREFIX = "image.smudge:edit:";
|
|
8
|
+
export interface ImageSmudgeBrush {
|
|
9
|
+
size: number;
|
|
10
|
+
color?: string;
|
|
11
|
+
opacity?: number;
|
|
12
|
+
}
|
|
13
|
+
export interface ImageSmudgeStrokePoint {
|
|
14
|
+
x: number;
|
|
15
|
+
y: number;
|
|
16
|
+
pressure?: number;
|
|
17
|
+
}
|
|
18
|
+
export interface ImageSmudgeStroke {
|
|
19
|
+
id: string;
|
|
20
|
+
points: ImageSmudgeStrokePoint[];
|
|
21
|
+
brush: ImageSmudgeBrush;
|
|
22
|
+
}
|
|
23
|
+
export interface ImageSmudgeConfirmInput {
|
|
24
|
+
replace?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export type ImageSmudgeSessionSnapshot = Readonly<{
|
|
27
|
+
shapeId: ShapeId;
|
|
28
|
+
brush: ImageSmudgeBrush;
|
|
29
|
+
strokes: readonly ImageSmudgeStroke[];
|
|
30
|
+
}>;
|
|
31
|
+
type ImageSmudgeSubscriber = () => void;
|
|
32
|
+
type ImageSmudgeConfirmHandler = (input?: ImageSmudgeConfirmInput) => Promise<unknown>;
|
|
33
|
+
export declare function getImageSmudgeModeMarkId(shapeId: ShapeId): string;
|
|
34
|
+
export declare function isImageSmudgeModeForShape(shape: ImageShapeRecord, markId: string | null | undefined): boolean;
|
|
35
|
+
export declare function isImageSmudgeToolbarActionId(actionId: string): boolean;
|
|
36
|
+
export declare function normalizeImageSmudgeBrush(brush?: Partial<ImageSmudgeBrush>): ImageSmudgeBrush;
|
|
37
|
+
export declare function startImageSmudgeSession({ brush, editor, shape, }: {
|
|
38
|
+
brush?: Partial<ImageSmudgeBrush>;
|
|
39
|
+
editor: Editor;
|
|
40
|
+
shape: ImageShapeRecord;
|
|
41
|
+
}): boolean;
|
|
42
|
+
export declare function cancelImageSmudgeSession(editor: Editor): void;
|
|
43
|
+
export declare function completeImageSmudgeSession(editor: Editor): void;
|
|
44
|
+
export declare function cancelImageSmudgeSessionIfActive(editor: Editor): boolean;
|
|
45
|
+
export declare function clearImageSmudgeSessionForShape(editor: Editor, shapeId: ShapeId): void;
|
|
46
|
+
export declare function getImageSmudgeSessionSnapshot(editor: Editor, shapeId: ShapeId): ImageSmudgeSessionSnapshot | null;
|
|
47
|
+
export declare function getActiveImageSmudgeSession(editor: Editor): ImageSmudgeSessionSnapshot | null;
|
|
48
|
+
export declare function subscribeImageSmudgeSession(editor: Editor, subscriber: ImageSmudgeSubscriber): () => void;
|
|
49
|
+
export declare function beginImageSmudgeStroke(editor: Editor, point: ImageSmudgeStrokePoint): void;
|
|
50
|
+
export declare function addImageSmudgeStrokePoint(editor: Editor, point: ImageSmudgeStrokePoint): void;
|
|
51
|
+
export declare function appendImageSmudgeStrokePoint(editor: Editor, point: ImageSmudgeStrokePoint): void;
|
|
52
|
+
export declare function endImageSmudgeStroke(editor: Editor): void;
|
|
53
|
+
export declare function registerImageSmudgeConfirmHandler(editor: Editor, handler: ImageSmudgeConfirmHandler): () => void;
|
|
54
|
+
export declare function requestImageSmudgeConfirm(editor: Editor, input?: ImageSmudgeConfirmInput): Promise<unknown>;
|
|
55
|
+
export declare function cloneImageSmudgeStrokes(strokes: readonly ImageSmudgeStroke[]): ImageSmudgeStroke[];
|
|
56
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type CanvasAction, type ToolbarGroup } from "../canvas-core/index";
|
|
2
|
+
export declare function createImageStyleCanvasActions(): CanvasAction[];
|
|
3
|
+
export declare function createImageCornerRadiusToolbarGroup({ dataUiPrefix, id, order, }: {
|
|
4
|
+
dataUiPrefix: string;
|
|
5
|
+
id: string;
|
|
6
|
+
order: number;
|
|
7
|
+
}): ToolbarGroup;
|
|
8
|
+
export declare function createImageCornerRadiusToolbarItem({ dataUiPrefix, }: {
|
|
9
|
+
dataUiPrefix: string;
|
|
10
|
+
}): {
|
|
11
|
+
kind: "text-input";
|
|
12
|
+
id: string;
|
|
13
|
+
actionId: string;
|
|
14
|
+
label: string;
|
|
15
|
+
placeholder: string;
|
|
16
|
+
dataUi: string;
|
|
17
|
+
};
|
|
@@ -1,9 +1,24 @@
|
|
|
1
1
|
import { type AssetId, type AssetRecordBase, type BaseRecord, type ShapeRecordBase } from "../canvas-core/index";
|
|
2
|
+
export type ImageRemoteCopyState = {
|
|
3
|
+
status: "pending-local-copy";
|
|
4
|
+
} | {
|
|
5
|
+
status: "copy-failed";
|
|
6
|
+
errorMessage?: string;
|
|
7
|
+
};
|
|
8
|
+
export type ImageAssetSource = {
|
|
9
|
+
kind: "local";
|
|
10
|
+
storageKey: string;
|
|
11
|
+
originalUrl?: string;
|
|
12
|
+
} | {
|
|
13
|
+
kind: "remote";
|
|
14
|
+
url: string;
|
|
15
|
+
copyState?: ImageRemoteCopyState;
|
|
16
|
+
};
|
|
2
17
|
export interface ImageAssetProps {
|
|
3
18
|
w: number;
|
|
4
19
|
h: number;
|
|
5
20
|
name: string;
|
|
6
|
-
|
|
21
|
+
source: ImageAssetSource;
|
|
7
22
|
mimeType: string | null;
|
|
8
23
|
fileSize?: number;
|
|
9
24
|
isAnimated: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { LaserTool } from "./laserTool";
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
2
|
+
export { createLaserCanvasRenderPlugin } from "./canvasRender";
|
|
3
|
+
export { createLaserEditorRuntimePlugin } from "./editorRuntime";
|
|
4
4
|
export { Laser, createLaserFeatureBundle } from "./feature";
|