react-reason-editor 1.0.60 → 1.0.61

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.
@@ -41,11 +41,18 @@ interface ReasonDocsProps {
41
41
  initialDocId?: string | null;
42
42
  /** Called whenever the active document changes, so the host can mirror it (e.g. into a URL param). */
43
43
  onActiveDocumentChange?: (docId: string | null) => void;
44
+ /**
45
+ * Generates short AI tips about the active document's content, given its
46
+ * title and HTML content. Powers the sidebar "ai" panel's "Page tips"
47
+ * section. Omitted when the host app has no tips-generation capability —
48
+ * the section is hidden entirely in that case.
49
+ */
50
+ onGenerateTips?: (title: string, contentHtml: string) => Promise<string[]>;
44
51
  }
45
52
  /**
46
53
  * Root application component that wires together all major UI regions.
47
54
  * Uses `useReasonDocsState` for shared state and `next-themes` for theme control.
48
55
  * Renders a resizable panel layout on desktop and a stacked layout on mobile.
49
56
  */
50
- declare const Index: ({ mainContent, belowMainContent, openFilesSidebarSignal, extraTabs, activeExtraTabId, onExtraTabSelect, onExtraTabClose, onExtraTabAdd, onFileTabSelect, initialDocId, onActiveDocumentChange, }: ReasonDocsProps) => import("react").JSX.Element;
57
+ declare const Index: ({ mainContent, belowMainContent, openFilesSidebarSignal, extraTabs, activeExtraTabId, onExtraTabSelect, onExtraTabClose, onExtraTabAdd, onFileTabSelect, initialDocId, onActiveDocumentChange, onGenerateTips, }: ReasonDocsProps) => import("react").JSX.Element;
51
58
  export default Index;
@@ -1,5 +1,5 @@
1
1
  import { RefObject } from 'react';
2
- import { SidebarPanelType, SidebarAiProps, OpenTabItem } from '../layout/sidebar/types';
2
+ import { SidebarPanelType, SidebarAiProps, SidebarTipsProps, OpenTabItem } from '../layout/sidebar/types';
3
3
  import { OutlineViewHandle } from '../search/OutlineView';
4
4
  import { ActiveHeadingEditorHandle } from '../search/useActiveHeading';
5
5
  import { TocEntry } from '../app-types/toc';
@@ -35,6 +35,8 @@ interface RightPanelProps {
35
35
  tabItems?: OpenTabItem[];
36
36
  onNewChat?: () => void;
37
37
  aiProps: SidebarAiProps;
38
+ /** AI-generated page tips state/handlers (used by the "ai" panel). */
39
+ tipsProps?: SidebarTipsProps;
38
40
  /** Closes the panel by clearing the right sidebar's panel list. */
39
41
  onClose: () => void;
40
42
  /** Renders as a slide-in drawer instead of an inset resizable panel. */
@@ -49,5 +51,5 @@ interface RightPanelProps {
49
51
  * by dragging its left edge; its body renders whichever panels are enabled
50
52
  * for the right sidebar.
51
53
  */
52
- export declare function RightPanel({ panels, split, documents, activeId, activeDocument, onSelect, onAdd, onDelete, onDuplicate, onMove, onManageTags, onRename, headings, onNavigate, openTabs, activeTab, onTabChange, onTabClose, onTabRename, onSplitRight, onReopenLastClosed, canReopenLastClosed, outlineRef, editorRef, tabItems, onNewChat, aiProps, onClose, isMobile, isOpen, onOpenChange, }: RightPanelProps): import("react").JSX.Element;
54
+ export declare function RightPanel({ panels, split, documents, activeId, activeDocument, onSelect, onAdd, onDelete, onDuplicate, onMove, onManageTags, onRename, headings, onNavigate, openTabs, activeTab, onTabChange, onTabClose, onTabRename, onSplitRight, onReopenLastClosed, canReopenLastClosed, outlineRef, editorRef, tabItems, onNewChat, aiProps, tipsProps, onClose, isMobile, isOpen, onOpenChange, }: RightPanelProps): import("react").JSX.Element;
53
55
  export {};
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./rolldown-runtime-BeavJI0R.cjs");const e=require("./editorConfig-Cx4ilZJV.cjs"),o=require("./ReasonDocs-CIatd_iE.cjs"),r=require("./RichTextProvider-CSKrKcEv.cjs"),t=require("./externalLibsMode-Dm8a-Jd9.cjs");exports.NovelEditor=e.NovelEditor,exports.ReasonDocs=o.Index,exports.RichTextProvider=r.RichTextProvider,exports.externalLibsModeActions=t.externalLibsModeActions,exports.getExternalLibsMode=t.getExternalLibsMode,exports.useExternalLibsMode=t.useExternalLibsMode,exports.useNovelEditor=e.useNovelEditor;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./rolldown-runtime-BeavJI0R.cjs");const e=require("./editorConfig-Cx4ilZJV.cjs"),o=require("./ReasonDocs-YyAZ8_Ks.cjs"),r=require("./RichTextProvider-CSKrKcEv.cjs"),t=require("./externalLibsMode-Dm8a-Jd9.cjs");exports.NovelEditor=e.NovelEditor,exports.ReasonDocs=o.Index,exports.RichTextProvider=r.RichTextProvider,exports.externalLibsModeActions=t.externalLibsModeActions,exports.getExternalLibsMode=t.getExternalLibsMode,exports.useExternalLibsMode=t.useExternalLibsMode,exports.useNovelEditor=e.useNovelEditor;
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{a as o,i as s}from"./editorConfig-BDVG1hyU.js";import{t as r}from"./ReasonDocs-Bgyy-dnb.js";import{t as a}from"./RichTextProvider-CHcaIPMd.js";import{n as t,r as i,t as e}from"./externalLibsMode-DEDBnK98.js";export{s as NovelEditor,r as ReasonDocs,a as RichTextProvider,e as externalLibsModeActions,t as getExternalLibsMode,i as useExternalLibsMode,o as useNovelEditor};
1
+ import{a as o,i as s}from"./editorConfig-BDVG1hyU.js";import{t as r}from"./ReasonDocs-B1yliWVq.js";import{t as a}from"./RichTextProvider-CHcaIPMd.js";import{n as t,r as i,t as e}from"./externalLibsMode-DEDBnK98.js";export{s as NovelEditor,r as ReasonDocs,a as RichTextProvider,e as externalLibsModeActions,t as getExternalLibsMode,i as useExternalLibsMode,o as useNovelEditor};
@@ -1,2 +1,2 @@
1
1
  import { SidebarProps } from './types';
2
- export declare const Sidebar: ({ documents, activeId, activeDocument, onSelect, onAdd, onDelete, onDuplicate, onMove, onManageTags, onRename, onSearchFocus, isOpen, onOpenChange, isMobile, leftPanels, onLeftPanelsChange, leftSplit, onLeftSplitChange, rightPanels, onRightPanelsChange, rightSplit, onRightSplitChange, onSettingsClick, onRestore, newDocumentId, showDynamicIsland, onToggleDynamicIsland, activeFileSourceId, onFileSourceChange, headings, onNavigate, editorRef, openTabs, activeTab, onTabChange, onTabClose, onTabRename, onSplitRight, onReopenLastClosed, canReopenLastClosed, aiProps, tabItems, onNewChat, }: SidebarProps) => import("react").JSX.Element;
2
+ export declare const Sidebar: ({ documents, activeId, activeDocument, onSelect, onAdd, onDelete, onDuplicate, onMove, onManageTags, onRename, onSearchFocus, isOpen, onOpenChange, isMobile, leftPanels, onLeftPanelsChange, leftSplit, onLeftSplitChange, rightPanels, onRightPanelsChange, rightSplit, onRightSplitChange, onSettingsClick, onRestore, newDocumentId, showDynamicIsland, onToggleDynamicIsland, activeFileSourceId, onFileSourceChange, headings, onNavigate, editorRef, openTabs, activeTab, onTabChange, onTabClose, onTabRename, onSplitRight, onReopenLastClosed, canReopenLastClosed, aiProps, tipsProps, tabItems, onNewChat, }: SidebarProps) => import("react").JSX.Element;
@@ -2,7 +2,7 @@ import { RefObject } from 'react';
2
2
  import { OutlineViewHandle } from '../../search/OutlineView';
3
3
  import { ActiveHeadingEditorHandle } from '../../search/useActiveHeading';
4
4
  import { Document } from '../../documents/DocumentTree';
5
- import { SidebarPanelType, SidebarAiProps, OpenTabItem } from './types';
5
+ import { SidebarPanelType, SidebarAiProps, SidebarTipsProps, OpenTabItem } from './types';
6
6
  import { TocEntry } from '../../app-types/toc';
7
7
  type DocumentTreeHandle = {
8
8
  collapseAll: () => void;
@@ -71,6 +71,8 @@ interface SidebarContentProps {
71
71
  onNavigate?: (key: string) => void;
72
72
  /** AI suggestion state/handlers (used by the "ai" panel). */
73
73
  aiProps?: SidebarAiProps;
74
+ /** AI-generated page tips state/handlers (used by the "ai" panel). */
75
+ tipsProps?: SidebarTipsProps;
74
76
  /** Unified tab list (files + chats). Overrides file-only tab derivation when set. */
75
77
  tabItems?: OpenTabItem[];
76
78
  /** Opens a new chat tab from the "Open Tabs" panel header. */
@@ -80,5 +82,5 @@ interface SidebarContentProps {
80
82
  * Renders the enabled panels for one side of the layout, stacked in a
81
83
  * resizable vertical split when more than one panel is active.
82
84
  */
83
- export declare const SidebarContent: ({ panels, split, persistenceKey, activeDocuments, activeId, activeDocument, headings, isMobile, onSelect, onAdd, onDelete, onDuplicate, onMove, onManageTags, onRename, onOpenChange, treeRef, outlineRef, editorRef, openTabs, activeTab, onTabChange, onTabClose, onTabRename, onSplitRight, onReopenLastClosed, canReopenLastClosed, onNavigate, aiProps, tabItems, onNewChat, }: SidebarContentProps) => import("react").JSX.Element;
85
+ export declare const SidebarContent: ({ panels, split, persistenceKey, activeDocuments, activeId, activeDocument, headings, isMobile, onSelect, onAdd, onDelete, onDuplicate, onMove, onManageTags, onRename, onOpenChange, treeRef, outlineRef, editorRef, openTabs, activeTab, onTabChange, onTabClose, onTabRename, onSplitRight, onReopenLastClosed, canReopenLastClosed, onNavigate, aiProps, tipsProps, tabItems, onNewChat, }: SidebarContentProps) => import("react").JSX.Element;
84
86
  export {};
@@ -32,6 +32,19 @@ export interface SidebarAiProps {
32
32
  onAiReject?: () => void;
33
33
  onAiRegenerate?: (mode: any) => void;
34
34
  }
35
+ /**
36
+ * AI-generated tips about the currently active document, shown as a section
37
+ * of the "ai" panel. Omitted entirely (and the section hidden) when the
38
+ * host app has no tips-generation capability to offer.
39
+ */
40
+ export interface SidebarTipsProps {
41
+ /** Tips generated for the active document by the most recent request. */
42
+ tips?: string[];
43
+ /** Whether a tips-generation request is in flight. */
44
+ isTipsLoading?: boolean;
45
+ /** Requests (re)generation of tips for the active document. */
46
+ onGenerateTips?: () => void;
47
+ }
35
48
  export interface SidebarProps {
36
49
  documents: Document[];
37
50
  activeId: string | null;
@@ -82,4 +95,5 @@ export interface SidebarProps {
82
95
  tabItems?: OpenTabItem[];
83
96
  onNewChat?: () => void;
84
97
  aiProps?: SidebarAiProps;
98
+ tipsProps?: SidebarTipsProps;
85
99
  }
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./rolldown-runtime-BeavJI0R.cjs");const e=require("./ReasonDocs-CIatd_iE.cjs");exports.ReasonDocs=e.Index;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./rolldown-runtime-BeavJI0R.cjs");const e=require("./ReasonDocs-YyAZ8_Ks.cjs");exports.ReasonDocs=e.Index;
@@ -1 +1 @@
1
- import{t as o}from"./ReasonDocs-Bgyy-dnb.js";export{o as ReasonDocs};
1
+ import{t as o}from"./ReasonDocs-B1yliWVq.js";export{o as ReasonDocs};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-reason-editor",
3
- "version": "1.0.60",
3
+ "version": "1.0.61",
4
4
  "description": "A modern WYSIWYG rich text editor based on tiptap and shadcn ui for React",
5
5
  "repository": {
6
6
  "type": "git",