@turnix-co/konva-editor 3.0.1 → 3.0.3
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 +32 -16
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -13,6 +13,10 @@ type CanvasProps = {
|
|
|
13
13
|
onSelectionChange?: (selectedId: string | null) => void;
|
|
14
14
|
onTextEditingReady?: (startEditingFn: (textId: string) => void) => void;
|
|
15
15
|
onDirectDrawingCanvasReady?: (canvasRef: React$1.RefObject<HTMLCanvasElement | null>) => void;
|
|
16
|
+
/** Context menu configuration - controls right-click menu behavior */
|
|
17
|
+
contextMenuConfig?: {
|
|
18
|
+
enabled: boolean;
|
|
19
|
+
};
|
|
16
20
|
};
|
|
17
21
|
declare const Canvas: React$1.FC<CanvasProps>;
|
|
18
22
|
|
|
@@ -416,12 +420,17 @@ type SlideHistory = {
|
|
|
416
420
|
past: Slide[];
|
|
417
421
|
future: Slide[];
|
|
418
422
|
};
|
|
423
|
+
type PresentationMetadata = {
|
|
424
|
+
title: string;
|
|
425
|
+
description: string;
|
|
426
|
+
};
|
|
419
427
|
type CanvasState = {
|
|
420
428
|
slides: Slide[];
|
|
421
429
|
currentSlideId: string;
|
|
422
430
|
history: Record<string, SlideHistory>;
|
|
423
431
|
isSketchMode: boolean;
|
|
424
432
|
editingTextId: string | null;
|
|
433
|
+
presentationMetadata: PresentationMetadata;
|
|
425
434
|
};
|
|
426
435
|
declare const createEmptySlide: (name?: string) => Slide;
|
|
427
436
|
declare const addSlide: _reduxjs_toolkit.ActionCreatorWithoutPayload<"canvas/addSlide">;
|
|
@@ -597,6 +606,12 @@ declare const saveToHistory: _reduxjs_toolkit.ActionCreatorWithoutPayload<"canva
|
|
|
597
606
|
declare const toggleSketchMode: _reduxjs_toolkit.ActionCreatorWithoutPayload<"canvas/toggleSketchMode">;
|
|
598
607
|
declare const setSketchMode: _reduxjs_toolkit.ActionCreatorWithOptionalPayload<boolean, "canvas/setSketchMode">;
|
|
599
608
|
declare const setEditingTextId: _reduxjs_toolkit.ActionCreatorWithOptionalPayload<string, "canvas/setEditingTextId">;
|
|
609
|
+
declare const setPresentationTitle: _reduxjs_toolkit.ActionCreatorWithOptionalPayload<string, "canvas/setPresentationTitle">;
|
|
610
|
+
declare const setPresentationDescription: _reduxjs_toolkit.ActionCreatorWithOptionalPayload<string, "canvas/setPresentationDescription">;
|
|
611
|
+
declare const loadPresentationMetadata$1: _reduxjs_toolkit.ActionCreatorWithOptionalPayload<{
|
|
612
|
+
title: string;
|
|
613
|
+
description: string;
|
|
614
|
+
}, "canvas/loadPresentationMetadata">;
|
|
600
615
|
|
|
601
616
|
declare const selectCurrentSlideId: (state: {
|
|
602
617
|
canvas: CanvasState;
|
|
@@ -613,6 +628,9 @@ declare const selectCanAddSlide: (state: {
|
|
|
613
628
|
declare const selectSlideById: (slideId: string) => (state: {
|
|
614
629
|
canvas: CanvasState;
|
|
615
630
|
}) => Slide;
|
|
631
|
+
declare const selectPresentationMetadata: (state: {
|
|
632
|
+
canvas: CanvasState;
|
|
633
|
+
}) => PresentationMetadata;
|
|
616
634
|
|
|
617
635
|
interface PublishProgress {
|
|
618
636
|
current: number;
|
|
@@ -626,38 +644,29 @@ interface PublishResponse {
|
|
|
626
644
|
url?: string;
|
|
627
645
|
}
|
|
628
646
|
interface PublishButtonProps {
|
|
629
|
-
onPublish?: (slides: Slide[], onProgress?: (progress: PublishProgress) => void) => Promise<PublishResponse>;
|
|
647
|
+
onPublish?: (slides: Slide[], metadata: PresentationMetadata, onProgress?: (progress: PublishProgress) => void) => Promise<PublishResponse>;
|
|
630
648
|
label?: string;
|
|
631
649
|
className?: string;
|
|
632
650
|
}
|
|
633
651
|
declare const PublishButton: React$1.FC<PublishButtonProps>;
|
|
634
652
|
|
|
635
653
|
type TopNavBarProps = {
|
|
636
|
-
/** Title displayed in the header */
|
|
637
654
|
title?: string;
|
|
638
|
-
/** Auto-save status message */
|
|
639
655
|
autoSaveMessage?: string;
|
|
640
|
-
/** Callback when back button is clicked */
|
|
641
656
|
onBack?: () => void;
|
|
642
|
-
/** Callback when settings button is clicked */
|
|
643
657
|
onSettings?: () => void;
|
|
644
|
-
/** Callback when user/profile button is clicked */
|
|
645
658
|
onProfile?: () => void;
|
|
646
|
-
/** Function to publish slides (passed to PublishButton) */
|
|
647
659
|
onPublish?: PublishButtonProps['onPublish'];
|
|
648
|
-
|
|
660
|
+
onTitleChange?: (newTitle: string) => void;
|
|
661
|
+
onDescriptionChange?: (newDescription: string) => void;
|
|
649
662
|
showPublishButton?: boolean;
|
|
650
|
-
/** Whether to show the settings button */
|
|
651
663
|
showSettingsButton?: boolean;
|
|
652
|
-
/** Whether to show the profile button */
|
|
653
664
|
showProfileButton?: boolean;
|
|
654
|
-
/** Whether to show the back button */
|
|
655
665
|
showBackButton?: boolean;
|
|
656
|
-
|
|
666
|
+
editableTitle?: boolean;
|
|
667
|
+
editableDescription?: boolean;
|
|
657
668
|
className?: string;
|
|
658
|
-
/** Custom content to render on the right side (replaces default buttons) */
|
|
659
669
|
rightContent?: React$1.ReactNode;
|
|
660
|
-
/** Custom content to render on the left side (replaces default content) */
|
|
661
670
|
leftContent?: React$1.ReactNode;
|
|
662
671
|
};
|
|
663
672
|
declare const TopNavBar: React$1.FC<TopNavBarProps>;
|
|
@@ -729,6 +738,7 @@ declare const store: _reduxjs_toolkit.EnhancedStore<{
|
|
|
729
738
|
}>;
|
|
730
739
|
isSketchMode: boolean;
|
|
731
740
|
editingTextId: string | null;
|
|
741
|
+
presentationMetadata: PresentationMetadata;
|
|
732
742
|
};
|
|
733
743
|
}, redux.UnknownAction, _reduxjs_toolkit.Tuple<[redux.StoreEnhancer<{
|
|
734
744
|
dispatch: redux_thunk.ThunkDispatch<{
|
|
@@ -742,6 +752,7 @@ declare const store: _reduxjs_toolkit.EnhancedStore<{
|
|
|
742
752
|
}>;
|
|
743
753
|
isSketchMode: boolean;
|
|
744
754
|
editingTextId: string | null;
|
|
755
|
+
presentationMetadata: PresentationMetadata;
|
|
745
756
|
};
|
|
746
757
|
}, undefined, redux.UnknownAction>;
|
|
747
758
|
}>, redux.StoreEnhancer]>>;
|
|
@@ -884,11 +895,14 @@ declare const useDispatch: () => redux_thunk.ThunkDispatch<{
|
|
|
884
895
|
}>;
|
|
885
896
|
isSketchMode: boolean;
|
|
886
897
|
editingTextId: string | null;
|
|
898
|
+
presentationMetadata: PresentationMetadata;
|
|
887
899
|
};
|
|
888
900
|
}, undefined, redux.UnknownAction> & redux.Dispatch<redux.UnknownAction>;
|
|
889
901
|
declare const useSelector: <T>(selector: (state: RootState) => T) => T;
|
|
890
902
|
|
|
891
|
-
declare const useSlidesPersistence: () =>
|
|
903
|
+
declare const useSlidesPersistence: () => {
|
|
904
|
+
isLoading: boolean;
|
|
905
|
+
};
|
|
892
906
|
|
|
893
907
|
/**
|
|
894
908
|
* Configuration options for loading initial slides
|
|
@@ -937,5 +951,7 @@ type SlidesPayload = {
|
|
|
937
951
|
declare const loadFromIndexedDB: () => Promise<Slide[] | null>;
|
|
938
952
|
declare const clearLocalData: () => Promise<void>;
|
|
939
953
|
declare const loadCurrentSlideId: () => string | null;
|
|
954
|
+
declare const savePresentationMetadata: (metadata: PresentationMetadata) => Promise<void>;
|
|
955
|
+
declare const loadPresentationMetadata: () => Promise<PresentationMetadata | null>;
|
|
940
956
|
|
|
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 };
|
|
957
|
+
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, type PresentationMetadata, 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, loadPresentationMetadata$1 as loadPresentationMetadata, loadPresentationMetadata as loadPresentationMetadataFromDB, loadSlides, mergeToolbarConfig, nextFlashcard, prepareFormData, prepareSlidesForPublishing, previousFlashcard, redo, removeLine, reorderSlides, savePresentationMetadata, saveToHistory, selectAllSlides, selectCanAddSlide, selectCurrentSlide, selectCurrentSlideId, selectPresentationMetadata, selectSlideById, sendToBack, setActivityType, setAltText, setAudioData, setBackgroundColor, setCurrentSlide, setEditingActivity, setEditingTextId, setLines, setLink, setPenColor, setPresentationDescription, setPresentationTitle, 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 };
|