@fileverse-dev/ddoc 2.2.7 → 2.2.8-byom-1

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-VXMTdRFb.mjs";
1
+ import { D as d, P as r, h as s, u as t } from "./index-D6IOHyDa.mjs";
2
2
  export {
3
3
  d as DdocEditor,
4
4
  r as PreviewDdocEditor,
@@ -0,0 +1,3 @@
1
+ import { Extension } from '@tiptap/core';
2
+
3
+ export declare const AiAutocomplete: Extension<any, any>;
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { NodeViewProps } from '@tiptap/react';
3
+
4
+ export declare const AIWriterNodeView: React.MemoExoticComponent<({ node, editor, getPos, updateAttributes }: NodeViewProps) => import("react/jsx-runtime").JSX.Element>;
@@ -0,0 +1,20 @@
1
+ import { Node } from '@tiptap/react';
2
+
3
+ export interface AIWriterOptions {
4
+ HTMLAttributes: Record<string, any>;
5
+ }
6
+ declare module '@tiptap/core' {
7
+ interface Commands<ReturnType> {
8
+ aiWriter: {
9
+ /**
10
+ * Add a prompt card
11
+ */
12
+ insertAIWriter: (options: {
13
+ prompt: string;
14
+ content: string;
15
+ tone: string;
16
+ }) => ReturnType;
17
+ };
18
+ }
19
+ }
20
+ export declare const AIWriter: Node<AIWriterOptions, any>;
@@ -0,0 +1 @@
1
+ export * from './ai-writer';
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Represents a tone option for AI text generation
3
+ */
4
+ export interface ToneOption {
5
+ value: string;
6
+ label: string;
7
+ }
8
+ /**
9
+ * Available tone options for AI text generation
10
+ */
11
+ export declare const TONE_OPTIONS: ToneOption[];
@@ -0,0 +1,3 @@
1
+ import { NodeViewProps } from '@tiptap/react';
2
+
3
+ export default function CodeBlockNodeView({ node, updateAttributes, editor, deleteNode, }: NodeViewProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare const CustomCodeBlockLowlight: import('@tiptap/core').Node<import('@tiptap/extension-code-block-lowlight').CodeBlockLowlightOptions, any>;
@@ -4,6 +4,7 @@ export interface DBlockOptions {
4
4
  HTMLAttributes: Record<string, any>;
5
5
  secureImageUploadUrl?: string;
6
6
  onCopyHeadingLink?: (link: string) => void;
7
+ hasAvailableModels?: boolean;
7
8
  }
8
9
  declare module '@tiptap/core' {
9
10
  interface Commands<ReturnType> {
@@ -1,5 +1,5 @@
1
1
  import { NodeType } from '@tiptap/pm/model';
2
2
  import { InputRule } from '@tiptap/core';
3
3
 
4
- export declare const defaultExtensions: (onError: (error: string) => void, secureImageUploadUrl?: string, metadataProxyUrl?: string, onCopyHeadingLink?: (link: string) => void) => (import('@tiptap/core').Extension<any, any> | import('@tiptap/core').Node<any, any> | import('@tiptap/core').Mark<any, any>)[];
4
+ export declare const defaultExtensions: (onError: (error: string) => void, secureImageUploadUrl?: string, metadataProxyUrl?: string, onCopyHeadingLink?: (link: string) => void, hasAvailableModels?: boolean) => (import('@tiptap/core').Extension<any, any> | import('@tiptap/core').Node<any, any> | import('@tiptap/core').Mark<any, any>)[];
5
5
  export declare const createInputRule: (pattern: RegExp, data: string, type: NodeType) => InputRule;
@@ -23,6 +23,15 @@ export interface CommentAccountProps {
23
23
  connectViaUsername?: (username: string) => Promise<void>;
24
24
  isDDocOwner?: boolean;
25
25
  }
26
+ export interface CustomModel {
27
+ id?: string;
28
+ label: string;
29
+ modelName: string;
30
+ endpoint: string;
31
+ contextSize: number;
32
+ apiKey: string;
33
+ systemPrompt: string;
34
+ }
26
35
  export interface DdocProps extends CommentAccountProps {
27
36
  isCollabDocumentPublished?: boolean;
28
37
  disableInlineComment?: boolean;
@@ -95,6 +104,9 @@ export interface DdocProps extends CommentAccountProps {
95
104
  metadataProxyUrl?: string;
96
105
  onCopyHeadingLink?: (link: string) => void;
97
106
  footerHeight?: string;
107
+ hasAvailableModels?: boolean;
108
+ activeModel?: CustomModel;
109
+ maxTokens?: number;
98
110
  }
99
111
  export interface IEditorSelectionData {
100
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, }: 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, hasAvailableModels, activeModel, maxTokens, }: Partial<DdocProps>) => {
5
5
  editor: import('@tiptap/core').Editor | null;
6
6
  isContentLoading: boolean;
7
7
  ref: import('react').RefObject<HTMLDivElement>;
@@ -4,4 +4,5 @@ export declare const useResponsive: () => {
4
4
  isMobileScreen: boolean;
5
5
  isNativeMobile: boolean;
6
6
  isIOS: boolean;
7
+ isMobile: boolean;
7
8
  };