@yuzhouu/canvas-kit 0.1.8 → 0.1.9
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/canvas-core/index.d.ts +1 -1
- package/_vendor/canvas-core/surfaces/toolbar.d.ts +11 -1
- package/_vendor/plugin-image/index.d.ts +1 -1
- package/_vendor/plugin-image/smudge.d.ts +7 -0
- package/features/image/smudge/imageSmudgeTypes.d.ts +1 -0
- package/index.mjs +96 -96
- package/package.json +1 -1
|
@@ -50,7 +50,7 @@ export type { CustomShapeColorRef, ShapeColor, ShapeColorRef, ThemeColorSlot, Th
|
|
|
50
50
|
export type { ContextMenuBadgeItem, ContextMenuCanvasTarget, ContextMenuCommandItem, ContextMenuContext, ContextMenuContribution, ContextMenuContributionTarget, ContextMenuItem, ActiveContextMenu, ContextMenuSection, ContextMenuSelectionTarget, ContextMenuSeparatorItem, ContextMenuShapeTarget, ContextMenuTarget, } from "./surfaces/contextMenu";
|
|
51
51
|
export { getEditorOptionsFromEditorRuntimePlugins, setupEditorRuntimePlugins, type LandEditorRuntimePlugin, } from "./plugins";
|
|
52
52
|
export type { CanvasAction, CanvasActionRunInput, CanvasActionValue, CanvasActionContext, CanvasSelectionSnapshot, CanvasToolSnapshot, } from "./surfaces/actions";
|
|
53
|
-
export type { ToolbarBadgeItem, ToolbarButtonItem, ToolbarContribution, ToolbarGroup, ToolbarItem, ToolbarSegmentedItem, ToolbarSegmentedOption, ToolbarSeparatorItem, ToolbarStepperItem, ToolbarStepperOption, ToolbarTextInputItem, ToolbarPlacement, ToolbarSurface, ToolbarSwatchesItem, ToolbarSwatchOption, } from "./surfaces/toolbar";
|
|
53
|
+
export type { ToolbarBadgeItem, ToolbarButtonItem, ToolbarColorInputItem, ToolbarContribution, ToolbarGroup, ToolbarItem, ToolbarSegmentedItem, ToolbarSegmentedOption, ToolbarSeparatorItem, ToolbarStepperItem, ToolbarStepperOption, ToolbarTextInputItem, ToolbarPlacement, ToolbarSurface, ToolbarSwatchesItem, ToolbarSwatchOption, } from "./surfaces/toolbar";
|
|
54
54
|
export { DEFAULT_CAMERA, DEFAULT_DOCUMENT_ID, DEFAULT_PAGE_ID, DEFAULT_SESSION_ID, createDefaultDocument, createDefaultPage, createDefaultSession, isAnyAssetRecord, isAnyBindingRecord, isAnyShapeRecord, isAssetRecord, isBindingRecord, isDocumentRecord, isDocumentMetadataRecord, isPageRecord, isSessionRecord, isShapeRecord, type AnyBindingRecord, type AnyAssetRecord, type AnyShapeRecord, type AssetId, type AssetRecord, type AssetRecordBase, type BaseRecord, type BindingId, type BindingRecordBase, type BindingRecord, type Camera, type DocumentId, type DocumentMetadataRecord, type DocumentRecord, type EditorRecord, type PageCameraById, type PageId, type PageSelectionById, type PageRecord, type RecordScope, type SessionRecord, type ShapeId, type ShapeParentId, type ShapeRecordBase, type ShapeRecord, type ShapeEditingEntryRequest, type ShapeEditingEntryMode, type ShapeEditingPoint, type ShapeEditingSession, } from "./schema/records";
|
|
55
55
|
export { Vec } from "./geometry/vec";
|
|
56
56
|
export { Box } from "./geometry/box";
|
|
@@ -59,6 +59,16 @@ export interface ToolbarTextInputItem {
|
|
|
59
59
|
placeholder?: string;
|
|
60
60
|
dataUi?: string;
|
|
61
61
|
}
|
|
62
|
+
export interface ToolbarColorInputItem {
|
|
63
|
+
kind: "color-input";
|
|
64
|
+
id: string;
|
|
65
|
+
actionId: string;
|
|
66
|
+
label: string;
|
|
67
|
+
fallback?: string;
|
|
68
|
+
includeAlpha?: boolean;
|
|
69
|
+
opacityFallback?: number;
|
|
70
|
+
dataUi?: string;
|
|
71
|
+
}
|
|
62
72
|
export interface ToolbarSliderItem {
|
|
63
73
|
kind: "slider";
|
|
64
74
|
id: string;
|
|
@@ -79,7 +89,7 @@ export interface ToolbarSeparatorItem {
|
|
|
79
89
|
kind: "separator";
|
|
80
90
|
id: string;
|
|
81
91
|
}
|
|
82
|
-
export type ToolbarItem = ToolbarButtonItem | ToolbarSegmentedItem | ToolbarSwatchesItem | ToolbarStepperItem | ToolbarTextInputItem | ToolbarSliderItem | ToolbarBadgeItem | ToolbarSeparatorItem;
|
|
92
|
+
export type ToolbarItem = ToolbarButtonItem | ToolbarSegmentedItem | ToolbarSwatchesItem | ToolbarStepperItem | ToolbarTextInputItem | ToolbarColorInputItem | ToolbarSliderItem | ToolbarBadgeItem | ToolbarSeparatorItem;
|
|
83
93
|
export interface ToolbarGroup {
|
|
84
94
|
id: string;
|
|
85
95
|
order?: number;
|
|
@@ -4,7 +4,7 @@ export { createImageCropInteractionHandler, createImageCropSelectionHandleIntera
|
|
|
4
4
|
export { createImageSmudgeInteractionHandler } from "./smudgeInteractions";
|
|
5
5
|
export { getImageCropModeMarkId, getImageCropRectOrDefault, } from "./crop";
|
|
6
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";
|
|
7
|
+
export { DEFAULT_IMAGE_SMUDGE_BRUSH_COLOR, DEFAULT_IMAGE_SMUDGE_BRUSH_SIZE, IMAGE_SMUDGE_BRUSH_COLOR_TOOLBAR_ACTION_ID, IMAGE_SMUDGE_BRUSH_SIZE_MAX, IMAGE_SMUDGE_BRUSH_SIZE_MIN, IMAGE_SMUDGE_BRUSH_SIZE_TOOLBAR_ACTION_ID, 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, updateImageSmudgeBrush, } from "./smudge";
|
|
8
8
|
export type { ImageSmudgeBrush, ImageSmudgeStroke, ImageSmudgeStrokePoint, } from "./smudge";
|
|
9
9
|
export { Image, createImageFeatureBundle } from "./feature";
|
|
10
10
|
export { ImageShapeUtil } from "./imageShapeUtil";
|
|
@@ -3,8 +3,14 @@ import type { ImageShapeRecord } from "./types";
|
|
|
3
3
|
export declare const IMAGE_SMUDGE_TOOLBAR_ACTION_ID = "image.smudge";
|
|
4
4
|
export declare const IMAGE_SMUDGE_CANCEL_TOOLBAR_ACTION_ID = "image.smudge.cancel";
|
|
5
5
|
export declare const IMAGE_SMUDGE_CONFIRM_TOOLBAR_ACTION_ID = "image.smudge.confirm";
|
|
6
|
+
export declare const IMAGE_SMUDGE_BRUSH_SIZE_TOOLBAR_ACTION_ID = "image.smudge.brush-size";
|
|
7
|
+
export declare const IMAGE_SMUDGE_BRUSH_COLOR_TOOLBAR_ACTION_ID = "image.smudge.brush-color";
|
|
6
8
|
export declare const IMAGE_SMUDGE_HISTORY_MARK_PREFIX = "image.smudge:";
|
|
7
9
|
export declare const IMAGE_SMUDGE_MODE_ENTRY_MARK_PREFIX = "image.smudge:edit:";
|
|
10
|
+
export declare const DEFAULT_IMAGE_SMUDGE_BRUSH_SIZE = 24;
|
|
11
|
+
export declare const DEFAULT_IMAGE_SMUDGE_BRUSH_COLOR = "#ffff00";
|
|
12
|
+
export declare const IMAGE_SMUDGE_BRUSH_SIZE_MIN = 1;
|
|
13
|
+
export declare const IMAGE_SMUDGE_BRUSH_SIZE_MAX = 128;
|
|
8
14
|
export interface ImageSmudgeBrush {
|
|
9
15
|
size: number;
|
|
10
16
|
color?: string;
|
|
@@ -43,6 +49,7 @@ export declare function cancelImageSmudgeSession(editor: Editor): void;
|
|
|
43
49
|
export declare function completeImageSmudgeSession(editor: Editor): void;
|
|
44
50
|
export declare function cancelImageSmudgeSessionIfActive(editor: Editor): boolean;
|
|
45
51
|
export declare function clearImageSmudgeSessionForShape(editor: Editor, shapeId: ShapeId): void;
|
|
52
|
+
export declare function updateImageSmudgeBrush(editor: Editor, brush: Partial<ImageSmudgeBrush>): boolean;
|
|
46
53
|
export declare function getImageSmudgeSessionSnapshot(editor: Editor, shapeId: ShapeId): ImageSmudgeSessionSnapshot | null;
|
|
47
54
|
export declare function getActiveImageSmudgeSession(editor: Editor): ImageSmudgeSessionSnapshot | null;
|
|
48
55
|
export declare function subscribeImageSmudgeSession(editor: Editor, subscriber: ImageSmudgeSubscriber): () => void;
|