@fileverse-dev/ddoc 2.1.0-patch-5 → 2.1.0-yjs-patch-2

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.
@@ -2,5 +2,6 @@ import { default as React } from 'react';
2
2
  import { NodeViewProps } from '@tiptap/react';
3
3
 
4
4
  export declare const DBlockNodeView: React.FC<NodeViewProps & {
5
+ zoomLevel: string;
5
6
  secureImageUploadUrl?: string;
6
7
  }>;
@@ -1,6 +1,7 @@
1
1
  import { Node } from '@tiptap/core';
2
2
 
3
3
  export interface DBlockOptions {
4
+ zoomLevel: string;
4
5
  HTMLAttributes: Record<string, any>;
5
6
  secureImageUploadUrl?: string;
6
7
  }
@@ -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) => (import('@tiptap/core').Node<any, any> | import('@tiptap/core').Extension<any, any> | import('@tiptap/core').Mark<any, any>)[];
4
+ export declare const defaultExtensions: (zoomLevel: string, onError: (error: string) => void, secureImageUploadUrl?: string) => (import('@tiptap/core').Node<any, any> | import('@tiptap/core').Extension<any, any> | import('@tiptap/core').Mark<any, any>)[];
5
5
  export declare const createInputRule: (pattern: RegExp, data: string, type: NodeType) => InputRule;
@@ -32,7 +32,9 @@ export interface DdocProps {
32
32
  isPreviewMode: boolean;
33
33
  ensResolutionUrl?: string;
34
34
  secureImageUploadUrl?: string;
35
- initialContent?: JSONContent | null;
35
+ enableIndexeddbSync?: boolean;
36
+ ddocId?: string;
37
+ initialContent?: JSONContent | string | string[] | null;
36
38
  walletAddress?: string | null;
37
39
  username?: string | null;
38
40
  renderNavbar?: ({ editor }: {
@@ -1,10 +1,11 @@
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, scrollPosition, unFocused, }: Partial<DdocProps>) => {
4
+ export declare const useDdocEditor: ({ isPreviewMode, initialContent, enableCollaboration, collaborationId, walletAddress, username, onChange, onCollaboratorChange, onCommentInteraction, ensResolutionUrl, onError, setCharacterCount, setWordCount, secureImageUploadUrl, scrollPosition, ddocId, enableIndexeddbSync, unFocused, zoomLevel, }: Partial<DdocProps>) => {
5
5
  editor: import('@tiptap/core').Editor | null;
6
6
  isContentLoading: boolean;
7
7
  ref: import('react').RefObject<HTMLDivElement>;
8
8
  connect: (username: string | null | undefined, isEns?: boolean) => () => void;
9
9
  ydoc: Y.Doc;
10
+ refreshYjsIndexedDbProvider: () => Promise<void>;
10
11
  };
@@ -0,0 +1,12 @@
1
+ import { AnyExtension } from '@tiptap/react';
2
+
3
+ export declare function useZoomLevelListener({ zoomLevel, setExtensions, defaultExtensions, onError, secureImageUploadUrl, customTextInputRules, SlashCommand, PageBreak, }: {
4
+ zoomLevel: string | undefined;
5
+ setExtensions: React.Dispatch<React.SetStateAction<AnyExtension[]>>;
6
+ defaultExtensions: (zoomLevel: string, errorHandler: (error: string) => void, secureImageUploadUrl?: string) => AnyExtension[];
7
+ onError?: (error: string) => void;
8
+ secureImageUploadUrl?: string;
9
+ customTextInputRules: AnyExtension;
10
+ SlashCommand: (errorHandler: (error: string) => void, secureImageUploadUrl: string) => AnyExtension;
11
+ PageBreak: AnyExtension;
12
+ }): void;
@@ -0,0 +1 @@
1
+ export declare function isJSONString(str: unknown): boolean;
@@ -11,5 +11,5 @@ type TemplateButtonProps = {
11
11
  declare const renderIcon: (icon: IconType, className?: string) => import("react/jsx-runtime").JSX.Element | null;
12
12
  declare const createTemplateButtons: (addTemplate: (template: JSONContent) => void) => TemplateButtonProps;
13
13
  declare const createMoreTemplates: (addTemplate: (template: JSONContent) => void) => TemplateButtonProps;
14
- declare const renderTemplateButtons: (templateButtons: TemplateButtonProps, moreTemplates: TemplateButtonProps, visibleTemplateCount: number, toggleAllTemplates: () => void, isExpanded: boolean) => import("react/jsx-runtime").JSX.Element;
14
+ declare const renderTemplateButtons: (templateButtons: TemplateButtonProps, moreTemplates: TemplateButtonProps, visibleTemplateCount: number, toggleAllTemplates: () => void, isExpanded: boolean, zoomLevel: string) => import("react/jsx-runtime").JSX.Element;
15
15
  export { renderIcon, createTemplateButtons, createMoreTemplates, renderTemplateButtons, };