@starrykit/slides-editor 0.1.32 → 0.1.33

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.
@@ -12,6 +12,7 @@ interface EditorHeaderProps {
12
12
  onTitleChange?: (t: string) => void;
13
13
  onDeckSwitch?: (deckId: string) => void;
14
14
  onDeckImport?: (files: FileList) => void;
15
+ onDeckImportPath?: () => void;
15
16
  onPresent?: () => void;
16
17
  onExportPdf?: (selection: PdfExportSelection) => void;
17
18
  onExportHtml?: () => void;
@@ -21,5 +22,5 @@ interface EditorHeaderProps {
21
22
  isSaving: boolean;
22
23
  isSwitchingDeck?: boolean;
23
24
  }
24
- export declare function EditorHeader({ title, decks, currentDeckId, onTitleChange, onDeckSwitch, onDeckImport, onPresent, onExportPdf, onExportHtml, onExportSourceFiles, pdfSlides, pdfThumbnails, isSaving, isSwitchingDeck, }: EditorHeaderProps): import("react/jsx-runtime").JSX.Element;
25
+ export declare function EditorHeader({ title, decks, currentDeckId, onTitleChange, onDeckSwitch, onDeckImport, onDeckImportPath, onPresent, onExportPdf, onExportHtml, onExportSourceFiles, pdfSlides, pdfThumbnails, isSaving, isSwitchingDeck, }: EditorHeaderProps): import("react/jsx-runtime").JSX.Element;
25
26
  export {};
@@ -48,6 +48,7 @@ interface EditorWorkspaceProps {
48
48
  onDeckTitleChange?: (title: string) => void;
49
49
  onDeckSwitch?: (deckId: string) => void;
50
50
  onDeckImport?: (files: FileList) => void;
51
+ onDeckImportPath?: () => void;
51
52
  onExportPdf?: (selection: PdfExportSelection) => void;
52
53
  onExportHtml?: () => void;
53
54
  onExportSourceFiles?: () => void;
@@ -90,5 +91,5 @@ interface EditorWorkspaceProps {
90
91
  onDuplicateElement: () => void;
91
92
  onDeleteElement: () => void;
92
93
  }
93
- declare function EditorWorkspace({ slides, activeSlide, deckTitle, decks, currentDeckId, isSaving, isSwitchingDeck, isPresenting, thumbnails, slideWidth, slideHeight, offsetX, offsetY, scale, preselectionOverlay, marqueeOverlay, selectionOverlay, toolbarKey, inspectedStyles, selectedElementType, selectionCommandAvailability, isSelectedElementLocked, groupScopeOverlayPassive, isEditingText, isCropMode, cropOverlay, manipulationOverlay, attributeValues, iframeRef, stageViewportRef, selectionOverlayRef, selectionContextMenuTriggerRef, isManipulating, isToolbarSuppressed, onDeckTitleChange, onDeckSwitch, onDeckImport, onExportPdf, onExportHtml, onExportSourceFiles, onPresent, onExitPresenting, onSelectSlide, onSidebarSlideFocusChange, onAddSlide, onAddSlideAbove, onAddSlideBelow, onDuplicateSlide, onDeleteSlide, onToggleSlideHidden, onRenameSlide, onReorderSlide, onSidebarFocusChange, onSelectionOverlayMouseDown, onSelectionOverlayMouseUp, onSelectionOverlayMouseMove, onSelectionOverlayContextMenu, onStageMouseLeave, onResizeHandleMouseDown, onCornerRotationZoneMouseDown, onCropHandleMouseDown, onSelectionOverlayDoubleClick, onBackgroundClick, onStyleChange, onStyleChanges, onStylePreview, onAttributeChange, onAlignToSlide, onCropImage, onDistribute, onGroup, onLayerOrder, onUngroup, onDuplicateElement, onDeleteElement, }: EditorWorkspaceProps): import("react/jsx-runtime").JSX.Element;
94
+ declare function EditorWorkspace({ slides, activeSlide, deckTitle, decks, currentDeckId, isSaving, isSwitchingDeck, isPresenting, thumbnails, slideWidth, slideHeight, offsetX, offsetY, scale, preselectionOverlay, marqueeOverlay, selectionOverlay, toolbarKey, inspectedStyles, selectedElementType, selectionCommandAvailability, isSelectedElementLocked, groupScopeOverlayPassive, isEditingText, isCropMode, cropOverlay, manipulationOverlay, attributeValues, iframeRef, stageViewportRef, selectionOverlayRef, selectionContextMenuTriggerRef, isManipulating, isToolbarSuppressed, onDeckTitleChange, onDeckSwitch, onDeckImport, onDeckImportPath, onExportPdf, onExportHtml, onExportSourceFiles, onPresent, onExitPresenting, onSelectSlide, onSidebarSlideFocusChange, onAddSlide, onAddSlideAbove, onAddSlideBelow, onDuplicateSlide, onDeleteSlide, onToggleSlideHidden, onRenameSlide, onReorderSlide, onSidebarFocusChange, onSelectionOverlayMouseDown, onSelectionOverlayMouseUp, onSelectionOverlayMouseMove, onSelectionOverlayContextMenu, onStageMouseLeave, onResizeHandleMouseDown, onCornerRotationZoneMouseDown, onCropHandleMouseDown, onSelectionOverlayDoubleClick, onBackgroundClick, onStyleChange, onStyleChanges, onStylePreview, onAttributeChange, onAlignToSlide, onCropImage, onDistribute, onGroup, onLayerOrder, onUngroup, onDuplicateElement, onDeleteElement, }: EditorWorkspaceProps): import("react/jsx-runtime").JSX.Element;
94
95
  export { EditorWorkspace };
package/dist/index.d.ts CHANGED
@@ -10,6 +10,7 @@ export interface SlidesEditorProps {
10
10
  onDeckTitleChange?: (title: string) => void;
11
11
  onDeckSwitch?: (deckId: string) => void;
12
12
  onDeckImport?: (files: FileList) => void;
13
+ onDeckImportPath?: () => void;
13
14
  onExportPdf?: (selection: PdfExportSelection) => void;
14
15
  onExportHtml?: () => void;
15
16
  onExportSourceFiles?: () => void;
@@ -22,6 +23,6 @@ export interface DeckSwitcherOption {
22
23
  relativePath: string;
23
24
  isCurrent: boolean;
24
25
  }
25
- declare function SlidesEditor({ slides: loadedSlides, deckTitle, decks, currentDeckId, isSaving, isSwitchingDeck, onSlidesChange, onDeckTitleChange, onDeckSwitch, onDeckImport, onExportPdf, onExportHtml, onExportSourceFiles, }: SlidesEditorProps): import("react/jsx-runtime").JSX.Element;
26
+ declare function SlidesEditor({ slides: loadedSlides, deckTitle, decks, currentDeckId, isSaving, isSwitchingDeck, onSlidesChange, onDeckTitleChange, onDeckSwitch, onDeckImport, onDeckImportPath, onExportPdf, onExportHtml, onExportSourceFiles, }: SlidesEditorProps): import("react/jsx-runtime").JSX.Element;
26
27
  export { SlidesEditor };
27
28
  export * from "@starrykit/slides-core";
package/dist/index.js CHANGED
@@ -66,6 +66,7 @@ function EditorHeader({
66
66
  onTitleChange,
67
67
  onDeckSwitch,
68
68
  onDeckImport,
69
+ onDeckImportPath,
69
70
  onPresent,
70
71
  onExportPdf,
71
72
  onExportHtml,
@@ -83,7 +84,7 @@ function EditorHeader({
83
84
  const deckRef = useRef(null);
84
85
  const deckImportInputRef = useRef(null);
85
86
  const titleDisplay = title || "Untitled presentation";
86
- const canOpenDeckMenu = decks.length > 0 || Boolean(onDeckImport);
87
+ const canOpenDeckMenu = decks.length > 0 || Boolean(onDeckImportPath || onDeckImport);
87
88
  useEffect(() => {
88
89
  const onDoc = (e) => {
89
90
  if (exportRef.current && !exportRef.current.contains(e.target)) {
@@ -241,7 +242,7 @@ function EditorHeader({
241
242
  deck.id
242
243
  );
243
244
  }),
244
- onDeckImport ? /* @__PURE__ */ jsxs(Fragment, { children: [
245
+ onDeckImportPath || onDeckImport ? /* @__PURE__ */ jsxs(Fragment, { children: [
245
246
  /* @__PURE__ */ jsx("div", { className: "my-1 h-px bg-foreground/[0.08]" }),
246
247
  /* @__PURE__ */ jsxs(
247
248
  "button",
@@ -250,14 +251,18 @@ function EditorHeader({
250
251
  role: "menuitem",
251
252
  onClick: () => {
252
253
  setDeckOpen(false);
254
+ if (onDeckImportPath) {
255
+ onDeckImportPath();
256
+ return;
257
+ }
253
258
  deckImportInputRef.current?.click();
254
259
  },
255
260
  className: "flex w-full items-start gap-2.5 rounded-md px-2.5 py-2 text-left text-foreground/72 transition-colors hover:bg-foreground/[0.04] hover:text-foreground",
256
261
  children: [
257
262
  /* @__PURE__ */ jsx("span", { className: "mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center", children: /* @__PURE__ */ jsx(FolderInput, { className: "h-3.5 w-3.5" }) }),
258
263
  /* @__PURE__ */ jsxs("span", { className: "min-w-0 flex-1", children: [
259
- /* @__PURE__ */ jsx("span", { className: "block truncate text-[13px] font-medium", children: "Import deck..." }),
260
- /* @__PURE__ */ jsx("span", { className: "mt-0.5 block truncate text-[11px] text-foreground/45", children: "Choose a folder with manifest.json" })
264
+ /* @__PURE__ */ jsx("span", { className: "block truncate text-[13px] font-medium", children: "Open deck path..." }),
265
+ /* @__PURE__ */ jsx("span", { className: "mt-0.5 block truncate text-[11px] text-foreground/45", children: "Use an existing folder with manifest.json" })
261
266
  ] })
262
267
  ]
263
268
  }
@@ -5808,6 +5813,7 @@ function EditorWorkspace({
5808
5813
  onDeckTitleChange,
5809
5814
  onDeckSwitch,
5810
5815
  onDeckImport,
5816
+ onDeckImportPath,
5811
5817
  onExportPdf,
5812
5818
  onExportHtml,
5813
5819
  onExportSourceFiles,
@@ -5863,6 +5869,7 @@ function EditorWorkspace({
5863
5869
  isSwitchingDeck,
5864
5870
  onDeckSwitch,
5865
5871
  onDeckImport,
5872
+ onDeckImportPath,
5866
5873
  isSaving,
5867
5874
  onPresent,
5868
5875
  onExportHtml,
@@ -11350,6 +11357,7 @@ function SlidesEditor({
11350
11357
  onDeckTitleChange,
11351
11358
  onDeckSwitch,
11352
11359
  onDeckImport,
11360
+ onDeckImportPath,
11353
11361
  onExportPdf,
11354
11362
  onExportHtml,
11355
11363
  onExportSourceFiles
@@ -11645,6 +11653,7 @@ function SlidesEditor({
11645
11653
  onDeckTitleChange,
11646
11654
  onDeckSwitch,
11647
11655
  onDeckImport,
11656
+ onDeckImportPath,
11648
11657
  onExportHtml,
11649
11658
  onExportSourceFiles,
11650
11659
  onExportPdf,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@starrykit/slides-editor",
3
- "version": "0.1.32",
3
+ "version": "0.1.33",
4
4
  "description": "Embeddable React editor UI for Starry Slides — host-driven through props and callbacks.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/StarryKit/starry-slides#readme",
@@ -22,15 +22,12 @@
22
22
  "import": "./dist/index.js"
23
23
  }
24
24
  },
25
- "files": [
26
- "dist",
27
- "src/styles"
28
- ],
25
+ "files": ["dist", "src/styles"],
29
26
  "scripts": {
30
27
  "build": "tsc -p tsconfig.json && tsup src/index.tsx --format esm --external react --external react-dom"
31
28
  },
32
29
  "dependencies": {
33
- "@starrykit/slides-core": "0.1.32",
30
+ "@starrykit/slides-core": "0.1.33",
34
31
  "class-variance-authority": "^0.7.1",
35
32
  "clsx": "^2.1.1",
36
33
  "html-to-image": "^1.11.11",