@turnix-co/konva-editor 2.0.45 → 2.0.46
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 +69 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -894,4 +894,72 @@ declare const useSelector: <T>(selector: (state: RootState) => T) => T;
|
|
|
894
894
|
|
|
895
895
|
declare const useSlidesPersistence: () => void;
|
|
896
896
|
|
|
897
|
-
|
|
897
|
+
/**
|
|
898
|
+
* Configuration options for loading initial slides
|
|
899
|
+
*/
|
|
900
|
+
type InitialSlidesConfig = {
|
|
901
|
+
/**
|
|
902
|
+
* Array of slides to load into the editor.
|
|
903
|
+
* These are typically slides previously published/saved and retrieved from your backend.
|
|
904
|
+
*/
|
|
905
|
+
slides: Slide[];
|
|
906
|
+
/**
|
|
907
|
+
* Optional: ID of the slide to set as current/active.
|
|
908
|
+
* If not provided or invalid, defaults to the first slide.
|
|
909
|
+
*/
|
|
910
|
+
currentSlideId?: string;
|
|
911
|
+
/**
|
|
912
|
+
* Optional: Skip loading from IndexedDB persistence.
|
|
913
|
+
* Set to true when you want to override any locally cached slides.
|
|
914
|
+
* Default: true (will skip local persistence when initial slides are provided)
|
|
915
|
+
*/
|
|
916
|
+
skipLocalPersistence?: boolean;
|
|
917
|
+
};
|
|
918
|
+
/**
|
|
919
|
+
* Loads slides into the editor.
|
|
920
|
+
* Use this when you want users to edit previously published/uploaded slides.
|
|
921
|
+
*
|
|
922
|
+
* @example
|
|
923
|
+
* ```tsx
|
|
924
|
+
* // In your component that wraps the editor
|
|
925
|
+
* const MyEditor = ({ savedSlides }) => {
|
|
926
|
+
* const { loadSlides } = useInitialSlides();
|
|
927
|
+
*
|
|
928
|
+
* useEffect(() => {
|
|
929
|
+
* if (savedSlides) {
|
|
930
|
+
* loadSlides({ slides: savedSlides, currentSlideId: savedSlides[0]?.id });
|
|
931
|
+
* }
|
|
932
|
+
* }, [savedSlides, loadSlides]);
|
|
933
|
+
*
|
|
934
|
+
* return (
|
|
935
|
+
* <div>
|
|
936
|
+
* <Canvas />
|
|
937
|
+
* <Toolbar />
|
|
938
|
+
* <SlideNavigation />
|
|
939
|
+
* </div>
|
|
940
|
+
* );
|
|
941
|
+
* };
|
|
942
|
+
* ```
|
|
943
|
+
*
|
|
944
|
+
* @returns Object with methods to load/reload slides
|
|
945
|
+
*/
|
|
946
|
+
declare const useInitialSlides: () => {
|
|
947
|
+
/**
|
|
948
|
+
* Load slides from config (only loads once per config object)
|
|
949
|
+
*/
|
|
950
|
+
loadSlides: (config: InitialSlidesConfig) => void;
|
|
951
|
+
/**
|
|
952
|
+
* Force reload slides (bypasses the duplicate load check)
|
|
953
|
+
*/
|
|
954
|
+
reloadSlides: (config: InitialSlidesConfig) => void;
|
|
955
|
+
};
|
|
956
|
+
/**
|
|
957
|
+
* Type for slides payload that can be sent from user's backend.
|
|
958
|
+
* This is the minimal structure needed to load slides.
|
|
959
|
+
*/
|
|
960
|
+
type SlidesPayload = {
|
|
961
|
+
slides: Slide[];
|
|
962
|
+
currentSlideId?: string;
|
|
963
|
+
};
|
|
964
|
+
|
|
965
|
+
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, 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, 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 };
|