@turnix-co/konva-editor 2.0.57 → 3.0.0

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/dist/index.d.ts CHANGED
@@ -8,6 +8,14 @@ import * as redux_thunk from 'redux-thunk';
8
8
  import * as redux from 'redux';
9
9
  export { Provider as ReduxProvider } from 'react-redux';
10
10
 
11
+ type CanvasProps = {
12
+ onStageReady?: (stageRef: React$1.RefObject<Konva.Stage | null>) => void;
13
+ onSelectionChange?: (selectedId: string | null) => void;
14
+ onTextEditingReady?: (startEditingFn: (textId: string) => void) => void;
15
+ onDirectDrawingCanvasReady?: (canvasRef: React$1.RefObject<HTMLCanvasElement | null>) => void;
16
+ };
17
+ declare const Canvas: React$1.FC<CanvasProps>;
18
+
11
19
  /**
12
20
  * Tool identifiers for the main toolbar
13
21
  */
@@ -100,20 +108,6 @@ declare const VIEWER_TOOLBAR_CONFIG: ToolbarConfig;
100
108
  */
101
109
  declare const BASIC_EDITOR_TOOLBAR_CONFIG: ToolbarConfig;
102
110
 
103
- type CanvasProps = {
104
- onStageReady?: (stageRef: React$1.RefObject<Konva.Stage | null>) => void;
105
- onSelectionChange?: (selectedId: string | null) => void;
106
- onTextEditingReady?: (startEditingFn: (textId: string) => void) => void;
107
- onDirectDrawingCanvasReady?: (canvasRef: React$1.RefObject<HTMLCanvasElement | null>) => void;
108
- /** Configuration for context menu permissions and visibility */
109
- contextMenuConfig?: ContextMenuConfig;
110
- /** Custom className for the canvas container */
111
- className?: string;
112
- /** Custom style for the canvas container */
113
- style?: React$1.CSSProperties;
114
- };
115
- declare const Canvas: React$1.FC<CanvasProps>;
116
-
117
111
  type ToolbarProps = {
118
112
  isOpen?: boolean;
119
113
  onClose?: () => void;
@@ -124,7 +118,7 @@ type ToolbarProps = {
124
118
  /** Configuration for which tools and actions to show */
125
119
  config?: ToolbarConfig;
126
120
  };
127
- declare const Toolbar: ({ isOpen: isOpenProp, onClose, onScreenRecord, stageRef, onTextAdded, showToggleButton, config, }?: ToolbarProps) => react_jsx_runtime.JSX.Element;
121
+ declare const Toolbar: ({ isOpen: isOpenProp, onScreenRecord, stageRef, onTextAdded, config, }?: ToolbarProps) => react_jsx_runtime.JSX.Element;
128
122
 
129
123
  type Line$1 = {
130
124
  id?: string;
@@ -429,6 +423,7 @@ type CanvasState = {
429
423
  isSketchMode: boolean;
430
424
  editingTextId: string | null;
431
425
  };
426
+ declare const createEmptySlide: (name?: string) => Slide;
432
427
  declare const addSlide: _reduxjs_toolkit.ActionCreatorWithoutPayload<"canvas/addSlide">;
433
428
  declare const deleteSlide: _reduxjs_toolkit.ActionCreatorWithOptionalPayload<string, "canvas/deleteSlide">;
434
429
  declare const duplicateSlide: _reduxjs_toolkit.ActionCreatorWithOptionalPayload<string, "canvas/duplicateSlide">;
@@ -602,6 +597,7 @@ declare const saveToHistory: _reduxjs_toolkit.ActionCreatorWithoutPayload<"canva
602
597
  declare const toggleSketchMode: _reduxjs_toolkit.ActionCreatorWithoutPayload<"canvas/toggleSketchMode">;
603
598
  declare const setSketchMode: _reduxjs_toolkit.ActionCreatorWithOptionalPayload<boolean, "canvas/setSketchMode">;
604
599
  declare const setEditingTextId: _reduxjs_toolkit.ActionCreatorWithOptionalPayload<string, "canvas/setEditingTextId">;
600
+
605
601
  declare const selectCurrentSlideId: (state: {
606
602
  canvas: CanvasState;
607
603
  }) => string;
@@ -942,4 +938,4 @@ declare const loadFromIndexedDB: () => Promise<Slide[] | null>;
942
938
  declare const clearLocalData: () => Promise<void>;
943
939
  declare const loadCurrentSlideId: () => string | null;
944
940
 
945
- export { type ActionType, type ActivityType, type AppDispatch, BASIC_EDITOR_TOOLBAR_CONFIG, BottomToolbar, type BottomToolbarProps, Canvas, type CanvasProps, type ContextMenuConfig, DEFAULT_CONTEXT_MENU_CONFIG, DEFAULT_TOOLBAR_CONFIG, EditorRoot, type EditorRootProps, type ExportOptions, type FillInTheBlanks, type FlashcardElement, type ImageElement, type InitialSlidesConfig, type Line$1 as Line, type LongAnswer, type MediaType, type MultipleChoice, type PhotoFrameElement, type PreparedImageElement, type PreparedPhotoFrameElement, type PreparedSlide, type PreparedVideoElement, PublishButton, type PublishButtonProps, type PublishPayload, type PublishProgress, type PublishResponse, type RootState, ScreenRecorder, type Shape, type ShapeType, type ShortAnswer, type Slide, SlideNavigation, type SlidesPayload, type TextElement, type ToolType, Toolbar, type ToolbarActionsConfig, type ToolbarConfig, type ToolbarProps, type ToolbarToolsConfig, TopNavBar, type TopNavBarProps, type TrueFalse, VIEWER_TOOLBAR_CONFIG, type VideoElement, addFillInTheBlanks, addFlashcard, addImage, addImageAnnotation, addLine, addLongAnswer, addMultipleChoice, addPhotoFrame, addPhotoFrameAnnotation, addShape, addShortAnswer, addSlide, addText, addTrueFalse, addVideo, arrayBufferToBase64, bringToFront, clearCanvas, clearImageAnnotations, clearLocalData, clearPhotoFrameAnnotations, deleteFillInTheBlanks, deleteFlashcard, deleteImage, deleteLineById, deleteLongAnswer, deleteMultipleChoice, deletePhotoFrame, deleteShape, deleteShortAnswer, deleteSlide, deleteText, deleteTrueFalse, deleteVideo, duplicateFillInTheBlanks, duplicateFlashcard, duplicateImage, duplicateLine, duplicateLongAnswer, duplicateMultipleChoice, duplicatePhotoFrame, duplicateShape, duplicateShortAnswer, duplicateSlide, duplicateText, duplicateTrueFalse, duplicateVideo, editFlashcard, editMultipleChoice, exportSlideAsBlob, exportSlideAsImage, finalizeDrawing, getCompressionStats, getSlideDataURL, loadCurrentSlideId, loadFromIndexedDB, loadSlides, mergeToolbarConfig, nextFlashcard, prepareFormData, prepareSlidesForPublishing, previousFlashcard, redo, removeLine, reorderSlides, saveToHistory, selectAllSlides, selectCanAddSlide, selectCurrentSlide, selectCurrentSlideId, selectSlideById, sendToBack, setActivityType, setAltText, setAudioData, setBackgroundColor, setCurrentSlide, setEditingActivity, setEditingTextId, setLines, setLink, setPenColor, setShowFlashcardForm, setShowMcqForm, setSketchMode, setStrokeWidth, setTool, simplifyFlatPoints, simplifyLine, simplifyLines, store, toggleImageDrawingMode, toggleLock, togglePhotoFrameDrawingMode, toggleSketchMode, toggleVideoPlaying, undo, updateElementOrder, updateFillInTheBlanks, updateFlashcard, updateImage, updateImageAnnotation, updateLastLine, updateLinePosition, updateLineTransform, updateLongAnswer, updateMultipleChoice, updatePhotoFrame, updatePhotoFrameAnnotation, updateShape, updateShortAnswer, updateSlideThumbnail, updateText, updateTrueFalse, updateVideo, useDispatch, useInitialSlides, useSelector, useSlidesPersistence };
941
+ export { type ActionType, type ActivityType, type AppDispatch, BASIC_EDITOR_TOOLBAR_CONFIG, BottomToolbar, type BottomToolbarProps, Canvas, type CanvasProps, type ContextMenuConfig, DEFAULT_CONTEXT_MENU_CONFIG, DEFAULT_TOOLBAR_CONFIG, EditorRoot, type EditorRootProps, type ExportOptions, type FillInTheBlanks, type FlashcardElement, type ImageElement, type InitialSlidesConfig, type Line$1 as Line, type LongAnswer, type MediaType, type MultipleChoice, type PhotoFrameElement, type PreparedImageElement, type PreparedPhotoFrameElement, type PreparedSlide, type PreparedVideoElement, PublishButton, type PublishButtonProps, type PublishPayload, type PublishProgress, type PublishResponse, type RootState, ScreenRecorder, type Shape, type ShapeType, type ShortAnswer, type Slide, SlideNavigation, type SlidesPayload, type TextElement, type ToolType, Toolbar, type ToolbarActionsConfig, type ToolbarConfig, type ToolbarProps, type ToolbarToolsConfig, TopNavBar, type TopNavBarProps, type TrueFalse, VIEWER_TOOLBAR_CONFIG, type VideoElement, addFillInTheBlanks, addFlashcard, addImage, addImageAnnotation, addLine, addLongAnswer, addMultipleChoice, addPhotoFrame, addPhotoFrameAnnotation, addShape, addShortAnswer, addSlide, addText, addTrueFalse, addVideo, arrayBufferToBase64, bringToFront, clearCanvas, clearImageAnnotations, clearLocalData, clearPhotoFrameAnnotations, createEmptySlide, deleteFillInTheBlanks, deleteFlashcard, deleteImage, deleteLineById, deleteLongAnswer, deleteMultipleChoice, deletePhotoFrame, deleteShape, deleteShortAnswer, deleteSlide, deleteText, deleteTrueFalse, deleteVideo, duplicateFillInTheBlanks, duplicateFlashcard, duplicateImage, duplicateLine, duplicateLongAnswer, duplicateMultipleChoice, duplicatePhotoFrame, duplicateShape, duplicateShortAnswer, duplicateSlide, duplicateText, duplicateTrueFalse, duplicateVideo, editFlashcard, editMultipleChoice, exportSlideAsBlob, exportSlideAsImage, finalizeDrawing, getCompressionStats, getSlideDataURL, loadCurrentSlideId, loadFromIndexedDB, loadSlides, mergeToolbarConfig, nextFlashcard, prepareFormData, prepareSlidesForPublishing, previousFlashcard, redo, removeLine, reorderSlides, saveToHistory, selectAllSlides, selectCanAddSlide, selectCurrentSlide, selectCurrentSlideId, selectSlideById, sendToBack, setActivityType, setAltText, setAudioData, setBackgroundColor, setCurrentSlide, setEditingActivity, setEditingTextId, setLines, setLink, setPenColor, setShowFlashcardForm, setShowMcqForm, setSketchMode, setStrokeWidth, setTool, simplifyFlatPoints, simplifyLine, simplifyLines, store, toggleImageDrawingMode, toggleLock, togglePhotoFrameDrawingMode, toggleSketchMode, toggleVideoPlaying, undo, updateElementOrder, updateFillInTheBlanks, updateFlashcard, updateImage, updateImageAnnotation, updateLastLine, updateLinePosition, updateLineTransform, updateLongAnswer, updateMultipleChoice, updatePhotoFrame, updatePhotoFrameAnnotation, updateShape, updateShortAnswer, updateSlideThumbnail, updateText, updateTrueFalse, updateVideo, useDispatch, useInitialSlides, useSelector, useSlidesPersistence };