@fileverse-dev/ddoc 2.2.8-byom-13 → 2.2.8-byom-15

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.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { D as d, P as r, h as s, u as t } from "./index-CHoroELQ.mjs";
1
+ import { D as d, P as r, h as s, u as t } from "./index-DtfHKbzf.mjs";
2
2
  export {
3
3
  d as DdocEditor,
4
4
  r as PreviewDdocEditor,
@@ -1,6 +1,4 @@
1
1
  import { default as React } from 'react';
2
2
  import { NodeViewProps } from '@tiptap/react';
3
3
 
4
- export declare const AIWriterNodeView: React.MemoExoticComponent<({ node, editor: parentEditor, getPos, updateAttributes, onPromptUsage, }: NodeViewProps & {
5
- onPromptUsage: () => void;
6
- }) => import("react/jsx-runtime").JSX.Element | null>;
4
+ export declare const AIWriterNodeView: React.MemoExoticComponent<({ node, editor: parentEditor, getPos, updateAttributes }: NodeViewProps) => import("react/jsx-runtime").JSX.Element | null>;
@@ -2,7 +2,6 @@ import { Node } from '@tiptap/react';
2
2
 
3
3
  export interface AIWriterOptions {
4
4
  HTMLAttributes: Record<string, any>;
5
- onPromptUsage?: () => void;
6
5
  }
7
6
  declare module '@tiptap/core' {
8
7
  interface Commands<ReturnType> {
@@ -9,3 +9,36 @@ export interface ToneOption {
9
9
  * Available tone options for AI text generation
10
10
  */
11
11
  export declare const TONE_OPTIONS: ToneOption[];
12
+ export declare const loadingMessages: string[];
13
+ export interface ModelOption {
14
+ value: string;
15
+ label: string;
16
+ }
17
+ export interface CustomModel {
18
+ modelName: string;
19
+ label: string;
20
+ }
21
+ export interface ModelContextType {
22
+ defaultModels: CustomModel[];
23
+ isLoadingDefaultModels: boolean;
24
+ ollamaError: string | null;
25
+ activeModel?: CustomModel;
26
+ setActiveModel: (model: CustomModel | undefined) => void;
27
+ maxTokens: number;
28
+ setMaxTokens: (maxTokens: number) => void;
29
+ tone: string;
30
+ setTone: (tone: string) => void;
31
+ systemPrompt: string;
32
+ setSystemPrompt: (prompt: string) => void;
33
+ selectedLLM: string | null;
34
+ setSelectedLLM: (llm: string | null) => void;
35
+ onPromptUsage?: () => void;
36
+ }
37
+ export interface ModelService {
38
+ callModel?: (prompt: string, model: string) => Promise<string>;
39
+ streamModel?: (prompt: string, model: string, onChunk: (chunk: string) => void, signal?: AbortSignal) => Promise<void>;
40
+ getAvailableModels?: () => Promise<ModelOption[]>;
41
+ }
42
+ export interface WindowWithModelContext extends Window {
43
+ __MODEL_CONTEXT__?: ModelContextType;
44
+ }
@@ -0,0 +1,5 @@
1
+ import { default as MarkdownIt } from 'markdown-it';
2
+
3
+ export declare const getLoadingMessageInOrder: () => string;
4
+ export declare const getRandomLoadingMessage: () => string;
5
+ export declare const md: MarkdownIt;
@@ -95,7 +95,6 @@ export interface DdocProps extends CommentAccountProps {
95
95
  onMarkdownExport?: () => void;
96
96
  onMarkdownImport?: () => void;
97
97
  onPdfExport?: () => void;
98
- onPromptUsage?: () => void;
99
98
  sharedSlidesLink?: string;
100
99
  documentName?: string;
101
100
  onInvalidContentError?: (e: unknown) => void;
@@ -107,6 +106,7 @@ export interface DdocProps extends CommentAccountProps {
107
106
  footerHeight?: string;
108
107
  activeModel?: CustomModel;
109
108
  maxTokens?: number;
109
+ isAIAgentEnabled?: boolean;
110
110
  }
111
111
  export interface IEditorSelectionData {
112
112
  from: number;
@@ -1,7 +1,7 @@
1
1
  import { DdocProps } from './types';
2
2
 
3
3
  import * as Y from 'yjs';
4
- export declare const useDdocEditor: ({ isPreviewMode, initialContent, enableCollaboration, collaborationId, walletAddress, username, onChange, onCollaboratorChange, onCommentInteraction, ensResolutionUrl, onError, setCharacterCount, setWordCount, secureImageUploadUrl, ddocId, enableIndexeddbSync, unFocused, zoomLevel, onInvalidContentError, ignoreCorruptedData, isPresentationMode, proExtensions, metadataProxyUrl, onCopyHeadingLink, activeModel, maxTokens, }: Partial<DdocProps>) => {
4
+ export declare const useDdocEditor: ({ isPreviewMode, initialContent, enableCollaboration, collaborationId, walletAddress, username, onChange, onCollaboratorChange, onCommentInteraction, ensResolutionUrl, onError, setCharacterCount, setWordCount, secureImageUploadUrl, ddocId, enableIndexeddbSync, unFocused, zoomLevel, onInvalidContentError, ignoreCorruptedData, isPresentationMode, proExtensions, metadataProxyUrl, onCopyHeadingLink, activeModel, maxTokens, isAIAgentEnabled, }: Partial<DdocProps>) => {
5
5
  editor: import('@tiptap/core').Editor | null;
6
6
  isContentLoading: boolean;
7
7
  ref: import('react').RefObject<HTMLDivElement>;