@kedataindo/docflow-plugins 0.0.88 → 0.0.90

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.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _kedata_indonesia_docflow_core from '@kedataindo/docflow-core';
2
- import { AIAction, DocsEditorPlugin } from '@kedataindo/docflow-core';
2
+ import { AIAction, DocsEditorPlugin, DocumentMode } from '@kedataindo/docflow-core';
3
3
  export { DocsEditorPlugin, FontSizeExtension, SlashCommand, ToolbarItem } from '@kedataindo/docflow-core';
4
4
  import { Node, Editor, Extension, Mark } from '@tiptap/core';
5
5
  import { CiteEngine } from './citations.cjs';
@@ -267,6 +267,58 @@ declare const CommentMark: Mark<any, any>;
267
267
  */
268
268
  declare const commentPlugin: DocsEditorPlugin;
269
269
 
270
+ declare const SUGGESTION_INSERT = "suggestionInsert";
271
+ declare const SUGGESTION_DELETE = "suggestionDelete";
272
+ declare const SUGGESTION_FORMAT = "suggestionFormat";
273
+ interface SuggestionAuthor {
274
+ id?: string | null;
275
+ name?: string | null;
276
+ }
277
+ interface SuggestionSummary {
278
+ id: string;
279
+ type: 'insert' | 'delete' | 'format';
280
+ authorId: string | null;
281
+ authorName: string | null;
282
+ /** ProseMirror positions (from/to) of the suggestion range. */
283
+ from: number;
284
+ to: number;
285
+ /** For `type: 'format'` — the mark that would be added/removed. */
286
+ format?: string;
287
+ /** For `type: 'format'` — `add` applies the mark, `remove` clears it. */
288
+ delta?: 'add' | 'remove';
289
+ }
290
+ declare module '@tiptap/core' {
291
+ interface Commands<ReturnType> {
292
+ suggestChanges: {
293
+ /** Switch the document mode (editing / suggesting / viewing). */
294
+ setDocumentMode: (mode: DocumentMode) => ReturnType;
295
+ /** Set the author recorded on new suggestions. */
296
+ setSuggestionAuthor: (author: SuggestionAuthor) => ReturnType;
297
+ /** Accept one suggestion (keep insertions, drop deletions). */
298
+ acceptSuggestion: (id: string) => ReturnType;
299
+ /** Reject one suggestion (drop insertions, keep deletions). */
300
+ rejectSuggestion: (id: string) => ReturnType;
301
+ /** Accept every pending suggestion. */
302
+ acceptAllSuggestions: () => ReturnType;
303
+ /** Reject every pending suggestion. */
304
+ rejectAllSuggestions: () => ReturnType;
305
+ };
306
+ }
307
+ }
308
+ declare const SuggestionInsertMark: Mark<any, any>;
309
+ declare const SuggestionDeleteMark: Mark<any, any>;
310
+ /** A proposed inline-format change (P3): the mark is recorded, not applied. */
311
+ declare const SuggestionFormatMark: Mark<any, any>;
312
+ declare function setDocumentMode(editor: Editor, mode: DocumentMode): boolean;
313
+ declare function setSuggestionAuthor(editor: Editor, author: SuggestionAuthor): boolean;
314
+ /** All pending suggestions, ordered by position. */
315
+ declare function getSuggestions(editor: Editor): SuggestionSummary[];
316
+ declare const acceptSuggestion: (editor: Editor, id: string) => boolean;
317
+ declare const rejectSuggestion: (editor: Editor, id: string) => boolean;
318
+ declare const acceptAllSuggestions: (editor: Editor) => boolean;
319
+ declare const rejectAllSuggestions: (editor: Editor) => boolean;
320
+ declare const suggestChangesPlugin: _kedata_indonesia_docflow_core.DocsEditorPlugin;
321
+
270
322
  declare const DateChipNode: Node<any, any>;
271
323
  declare const PeopleChipNode: Node<any, any>;
272
324
  declare const FileChipNode: Node<any, any>;
@@ -308,4 +360,4 @@ declare const slashMenuPlugin: _kedata_indonesia_docflow_core.DocsEditorPlugin;
308
360
 
309
361
  declare const defaultPlugins: _kedata_indonesia_docflow_core.DocsEditorPlugin[];
310
362
 
311
- export { AIExtension, type AIPreviewState, BibliographyNode, CitationEngineExtension, CitationNode, CiteEngine, type CommentMarkAttrs, CommentMark as CommentMarkExtension, DateChipNode, DropdownChipNode, FileChipNode, FootnoteNode, LocationChipNode, PageBreak, PeopleChipNode, type PlaceholderPluginOptions, SlashMenuExtension, TocEntryNode, TocNode, TocPageNumNode, aiPlugin, aiPluginKey, alignmentPlugin, blockquotePlugin, citationPlugin, codeBlockPlugin, collectHeadings, commentPlugin, createPlaceholderPlugin, defaultPlugins, fontSizePlugin, footnotePlugin, formattingPlugin, getAIPreview, getCitationEngine, headingsPlugin, highlightPlugin, imagePlugin, insertMarkdownBlock, linkPlugin, listsPlugin, markdownToFragment, onSlashStateChange, pageBreakPlugin, placeholderPlugin, regenerateToc, registerSlashCommands, slashMenuPlugin, slashState, smartElementsPlugin, tablePageSplitPlugin, tablePlugin, textColorPlugin, tocPlugin };
363
+ export { AIExtension, type AIPreviewState, BibliographyNode, CitationEngineExtension, CitationNode, CiteEngine, type CommentMarkAttrs, CommentMark as CommentMarkExtension, DateChipNode, DropdownChipNode, FileChipNode, FootnoteNode, LocationChipNode, PageBreak, PeopleChipNode, type PlaceholderPluginOptions, SUGGESTION_DELETE, SUGGESTION_FORMAT, SUGGESTION_INSERT, SlashMenuExtension, type SuggestionAuthor, SuggestionDeleteMark, SuggestionFormatMark, SuggestionInsertMark, type SuggestionSummary, TocEntryNode, TocNode, TocPageNumNode, acceptAllSuggestions, acceptSuggestion, aiPlugin, aiPluginKey, alignmentPlugin, blockquotePlugin, citationPlugin, codeBlockPlugin, collectHeadings, commentPlugin, createPlaceholderPlugin, defaultPlugins, fontSizePlugin, footnotePlugin, formattingPlugin, getAIPreview, getCitationEngine, getSuggestions, headingsPlugin, highlightPlugin, imagePlugin, insertMarkdownBlock, linkPlugin, listsPlugin, markdownToFragment, onSlashStateChange, pageBreakPlugin, placeholderPlugin, regenerateToc, registerSlashCommands, rejectAllSuggestions, rejectSuggestion, setDocumentMode, setSuggestionAuthor, slashMenuPlugin, slashState, smartElementsPlugin, suggestChangesPlugin, tablePageSplitPlugin, tablePlugin, textColorPlugin, tocPlugin };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _kedata_indonesia_docflow_core from '@kedataindo/docflow-core';
2
- import { AIAction, DocsEditorPlugin } from '@kedataindo/docflow-core';
2
+ import { AIAction, DocsEditorPlugin, DocumentMode } from '@kedataindo/docflow-core';
3
3
  export { DocsEditorPlugin, FontSizeExtension, SlashCommand, ToolbarItem } from '@kedataindo/docflow-core';
4
4
  import { Node, Editor, Extension, Mark } from '@tiptap/core';
5
5
  import { CiteEngine } from './citations.js';
@@ -267,6 +267,58 @@ declare const CommentMark: Mark<any, any>;
267
267
  */
268
268
  declare const commentPlugin: DocsEditorPlugin;
269
269
 
270
+ declare const SUGGESTION_INSERT = "suggestionInsert";
271
+ declare const SUGGESTION_DELETE = "suggestionDelete";
272
+ declare const SUGGESTION_FORMAT = "suggestionFormat";
273
+ interface SuggestionAuthor {
274
+ id?: string | null;
275
+ name?: string | null;
276
+ }
277
+ interface SuggestionSummary {
278
+ id: string;
279
+ type: 'insert' | 'delete' | 'format';
280
+ authorId: string | null;
281
+ authorName: string | null;
282
+ /** ProseMirror positions (from/to) of the suggestion range. */
283
+ from: number;
284
+ to: number;
285
+ /** For `type: 'format'` — the mark that would be added/removed. */
286
+ format?: string;
287
+ /** For `type: 'format'` — `add` applies the mark, `remove` clears it. */
288
+ delta?: 'add' | 'remove';
289
+ }
290
+ declare module '@tiptap/core' {
291
+ interface Commands<ReturnType> {
292
+ suggestChanges: {
293
+ /** Switch the document mode (editing / suggesting / viewing). */
294
+ setDocumentMode: (mode: DocumentMode) => ReturnType;
295
+ /** Set the author recorded on new suggestions. */
296
+ setSuggestionAuthor: (author: SuggestionAuthor) => ReturnType;
297
+ /** Accept one suggestion (keep insertions, drop deletions). */
298
+ acceptSuggestion: (id: string) => ReturnType;
299
+ /** Reject one suggestion (drop insertions, keep deletions). */
300
+ rejectSuggestion: (id: string) => ReturnType;
301
+ /** Accept every pending suggestion. */
302
+ acceptAllSuggestions: () => ReturnType;
303
+ /** Reject every pending suggestion. */
304
+ rejectAllSuggestions: () => ReturnType;
305
+ };
306
+ }
307
+ }
308
+ declare const SuggestionInsertMark: Mark<any, any>;
309
+ declare const SuggestionDeleteMark: Mark<any, any>;
310
+ /** A proposed inline-format change (P3): the mark is recorded, not applied. */
311
+ declare const SuggestionFormatMark: Mark<any, any>;
312
+ declare function setDocumentMode(editor: Editor, mode: DocumentMode): boolean;
313
+ declare function setSuggestionAuthor(editor: Editor, author: SuggestionAuthor): boolean;
314
+ /** All pending suggestions, ordered by position. */
315
+ declare function getSuggestions(editor: Editor): SuggestionSummary[];
316
+ declare const acceptSuggestion: (editor: Editor, id: string) => boolean;
317
+ declare const rejectSuggestion: (editor: Editor, id: string) => boolean;
318
+ declare const acceptAllSuggestions: (editor: Editor) => boolean;
319
+ declare const rejectAllSuggestions: (editor: Editor) => boolean;
320
+ declare const suggestChangesPlugin: _kedata_indonesia_docflow_core.DocsEditorPlugin;
321
+
270
322
  declare const DateChipNode: Node<any, any>;
271
323
  declare const PeopleChipNode: Node<any, any>;
272
324
  declare const FileChipNode: Node<any, any>;
@@ -308,4 +360,4 @@ declare const slashMenuPlugin: _kedata_indonesia_docflow_core.DocsEditorPlugin;
308
360
 
309
361
  declare const defaultPlugins: _kedata_indonesia_docflow_core.DocsEditorPlugin[];
310
362
 
311
- export { AIExtension, type AIPreviewState, BibliographyNode, CitationEngineExtension, CitationNode, CiteEngine, type CommentMarkAttrs, CommentMark as CommentMarkExtension, DateChipNode, DropdownChipNode, FileChipNode, FootnoteNode, LocationChipNode, PageBreak, PeopleChipNode, type PlaceholderPluginOptions, SlashMenuExtension, TocEntryNode, TocNode, TocPageNumNode, aiPlugin, aiPluginKey, alignmentPlugin, blockquotePlugin, citationPlugin, codeBlockPlugin, collectHeadings, commentPlugin, createPlaceholderPlugin, defaultPlugins, fontSizePlugin, footnotePlugin, formattingPlugin, getAIPreview, getCitationEngine, headingsPlugin, highlightPlugin, imagePlugin, insertMarkdownBlock, linkPlugin, listsPlugin, markdownToFragment, onSlashStateChange, pageBreakPlugin, placeholderPlugin, regenerateToc, registerSlashCommands, slashMenuPlugin, slashState, smartElementsPlugin, tablePageSplitPlugin, tablePlugin, textColorPlugin, tocPlugin };
363
+ export { AIExtension, type AIPreviewState, BibliographyNode, CitationEngineExtension, CitationNode, CiteEngine, type CommentMarkAttrs, CommentMark as CommentMarkExtension, DateChipNode, DropdownChipNode, FileChipNode, FootnoteNode, LocationChipNode, PageBreak, PeopleChipNode, type PlaceholderPluginOptions, SUGGESTION_DELETE, SUGGESTION_FORMAT, SUGGESTION_INSERT, SlashMenuExtension, type SuggestionAuthor, SuggestionDeleteMark, SuggestionFormatMark, SuggestionInsertMark, type SuggestionSummary, TocEntryNode, TocNode, TocPageNumNode, acceptAllSuggestions, acceptSuggestion, aiPlugin, aiPluginKey, alignmentPlugin, blockquotePlugin, citationPlugin, codeBlockPlugin, collectHeadings, commentPlugin, createPlaceholderPlugin, defaultPlugins, fontSizePlugin, footnotePlugin, formattingPlugin, getAIPreview, getCitationEngine, getSuggestions, headingsPlugin, highlightPlugin, imagePlugin, insertMarkdownBlock, linkPlugin, listsPlugin, markdownToFragment, onSlashStateChange, pageBreakPlugin, placeholderPlugin, regenerateToc, registerSlashCommands, rejectAllSuggestions, rejectSuggestion, setDocumentMode, setSuggestionAuthor, slashMenuPlugin, slashState, smartElementsPlugin, suggestChangesPlugin, tablePageSplitPlugin, tablePlugin, textColorPlugin, tocPlugin };