@turnix-co/konva-editor 3.0.1 → 3.0.2
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 +28 -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
|
@@ -416,12 +416,17 @@ type SlideHistory = {
|
|
|
416
416
|
past: Slide[];
|
|
417
417
|
future: Slide[];
|
|
418
418
|
};
|
|
419
|
+
type PresentationMetadata = {
|
|
420
|
+
title: string;
|
|
421
|
+
description: string;
|
|
422
|
+
};
|
|
419
423
|
type CanvasState = {
|
|
420
424
|
slides: Slide[];
|
|
421
425
|
currentSlideId: string;
|
|
422
426
|
history: Record<string, SlideHistory>;
|
|
423
427
|
isSketchMode: boolean;
|
|
424
428
|
editingTextId: string | null;
|
|
429
|
+
presentationMetadata: PresentationMetadata;
|
|
425
430
|
};
|
|
426
431
|
declare const createEmptySlide: (name?: string) => Slide;
|
|
427
432
|
declare const addSlide: _reduxjs_toolkit.ActionCreatorWithoutPayload<"canvas/addSlide">;
|
|
@@ -597,6 +602,12 @@ declare const saveToHistory: _reduxjs_toolkit.ActionCreatorWithoutPayload<"canva
|
|
|
597
602
|
declare const toggleSketchMode: _reduxjs_toolkit.ActionCreatorWithoutPayload<"canvas/toggleSketchMode">;
|
|
598
603
|
declare const setSketchMode: _reduxjs_toolkit.ActionCreatorWithOptionalPayload<boolean, "canvas/setSketchMode">;
|
|
599
604
|
declare const setEditingTextId: _reduxjs_toolkit.ActionCreatorWithOptionalPayload<string, "canvas/setEditingTextId">;
|
|
605
|
+
declare const setPresentationTitle: _reduxjs_toolkit.ActionCreatorWithOptionalPayload<string, "canvas/setPresentationTitle">;
|
|
606
|
+
declare const setPresentationDescription: _reduxjs_toolkit.ActionCreatorWithOptionalPayload<string, "canvas/setPresentationDescription">;
|
|
607
|
+
declare const loadPresentationMetadata$1: _reduxjs_toolkit.ActionCreatorWithOptionalPayload<{
|
|
608
|
+
title: string;
|
|
609
|
+
description: string;
|
|
610
|
+
}, "canvas/loadPresentationMetadata">;
|
|
600
611
|
|
|
601
612
|
declare const selectCurrentSlideId: (state: {
|
|
602
613
|
canvas: CanvasState;
|
|
@@ -613,6 +624,9 @@ declare const selectCanAddSlide: (state: {
|
|
|
613
624
|
declare const selectSlideById: (slideId: string) => (state: {
|
|
614
625
|
canvas: CanvasState;
|
|
615
626
|
}) => Slide;
|
|
627
|
+
declare const selectPresentationMetadata: (state: {
|
|
628
|
+
canvas: CanvasState;
|
|
629
|
+
}) => PresentationMetadata;
|
|
616
630
|
|
|
617
631
|
interface PublishProgress {
|
|
618
632
|
current: number;
|
|
@@ -626,38 +640,29 @@ interface PublishResponse {
|
|
|
626
640
|
url?: string;
|
|
627
641
|
}
|
|
628
642
|
interface PublishButtonProps {
|
|
629
|
-
onPublish?: (slides: Slide[], onProgress?: (progress: PublishProgress) => void) => Promise<PublishResponse>;
|
|
643
|
+
onPublish?: (slides: Slide[], metadata: PresentationMetadata, onProgress?: (progress: PublishProgress) => void) => Promise<PublishResponse>;
|
|
630
644
|
label?: string;
|
|
631
645
|
className?: string;
|
|
632
646
|
}
|
|
633
647
|
declare const PublishButton: React$1.FC<PublishButtonProps>;
|
|
634
648
|
|
|
635
649
|
type TopNavBarProps = {
|
|
636
|
-
/** Title displayed in the header */
|
|
637
650
|
title?: string;
|
|
638
|
-
/** Auto-save status message */
|
|
639
651
|
autoSaveMessage?: string;
|
|
640
|
-
/** Callback when back button is clicked */
|
|
641
652
|
onBack?: () => void;
|
|
642
|
-
/** Callback when settings button is clicked */
|
|
643
653
|
onSettings?: () => void;
|
|
644
|
-
/** Callback when user/profile button is clicked */
|
|
645
654
|
onProfile?: () => void;
|
|
646
|
-
/** Function to publish slides (passed to PublishButton) */
|
|
647
655
|
onPublish?: PublishButtonProps['onPublish'];
|
|
648
|
-
|
|
656
|
+
onTitleChange?: (newTitle: string) => void;
|
|
657
|
+
onDescriptionChange?: (newDescription: string) => void;
|
|
649
658
|
showPublishButton?: boolean;
|
|
650
|
-
/** Whether to show the settings button */
|
|
651
659
|
showSettingsButton?: boolean;
|
|
652
|
-
/** Whether to show the profile button */
|
|
653
660
|
showProfileButton?: boolean;
|
|
654
|
-
/** Whether to show the back button */
|
|
655
661
|
showBackButton?: boolean;
|
|
656
|
-
|
|
662
|
+
editableTitle?: boolean;
|
|
663
|
+
editableDescription?: boolean;
|
|
657
664
|
className?: string;
|
|
658
|
-
/** Custom content to render on the right side (replaces default buttons) */
|
|
659
665
|
rightContent?: React$1.ReactNode;
|
|
660
|
-
/** Custom content to render on the left side (replaces default content) */
|
|
661
666
|
leftContent?: React$1.ReactNode;
|
|
662
667
|
};
|
|
663
668
|
declare const TopNavBar: React$1.FC<TopNavBarProps>;
|
|
@@ -729,6 +734,7 @@ declare const store: _reduxjs_toolkit.EnhancedStore<{
|
|
|
729
734
|
}>;
|
|
730
735
|
isSketchMode: boolean;
|
|
731
736
|
editingTextId: string | null;
|
|
737
|
+
presentationMetadata: PresentationMetadata;
|
|
732
738
|
};
|
|
733
739
|
}, redux.UnknownAction, _reduxjs_toolkit.Tuple<[redux.StoreEnhancer<{
|
|
734
740
|
dispatch: redux_thunk.ThunkDispatch<{
|
|
@@ -742,6 +748,7 @@ declare const store: _reduxjs_toolkit.EnhancedStore<{
|
|
|
742
748
|
}>;
|
|
743
749
|
isSketchMode: boolean;
|
|
744
750
|
editingTextId: string | null;
|
|
751
|
+
presentationMetadata: PresentationMetadata;
|
|
745
752
|
};
|
|
746
753
|
}, undefined, redux.UnknownAction>;
|
|
747
754
|
}>, redux.StoreEnhancer]>>;
|
|
@@ -884,11 +891,14 @@ declare const useDispatch: () => redux_thunk.ThunkDispatch<{
|
|
|
884
891
|
}>;
|
|
885
892
|
isSketchMode: boolean;
|
|
886
893
|
editingTextId: string | null;
|
|
894
|
+
presentationMetadata: PresentationMetadata;
|
|
887
895
|
};
|
|
888
896
|
}, undefined, redux.UnknownAction> & redux.Dispatch<redux.UnknownAction>;
|
|
889
897
|
declare const useSelector: <T>(selector: (state: RootState) => T) => T;
|
|
890
898
|
|
|
891
|
-
declare const useSlidesPersistence: () =>
|
|
899
|
+
declare const useSlidesPersistence: () => {
|
|
900
|
+
isLoading: boolean;
|
|
901
|
+
};
|
|
892
902
|
|
|
893
903
|
/**
|
|
894
904
|
* Configuration options for loading initial slides
|
|
@@ -937,5 +947,7 @@ type SlidesPayload = {
|
|
|
937
947
|
declare const loadFromIndexedDB: () => Promise<Slide[] | null>;
|
|
938
948
|
declare const clearLocalData: () => Promise<void>;
|
|
939
949
|
declare const loadCurrentSlideId: () => string | null;
|
|
950
|
+
declare const savePresentationMetadata: (metadata: PresentationMetadata) => Promise<void>;
|
|
951
|
+
declare const loadPresentationMetadata: () => Promise<PresentationMetadata | null>;
|
|
940
952
|
|
|
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 };
|
|
953
|
+
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 };
|