2.3.0-patch-1 • Published 5 months ago

@fileverse-dev/ddoc v2.3.0-patch-1

Weekly downloads
-
License
-
Repository
-
Last release
5 months ago

Ddoc Editor

ddocs.new is your onchain, privacy-first alternative to G*gle Dcs: peer-to-peer, end-to-end encrypted, and decentralized. It enables secure, real-time, and async collaboration without compromising user privacy.

This repository contains:

  • /package – The core package code.
  • Example & demo source code to showcase dDocs functionalities.

Usage

Prequisites

To use dDocs, ensure your project is set up with Tailwind CSS and have a Tailwind configuration file.

Install & import

Add the following imports :

import { DdocEditor } from '@fileverse-dev/ddoc';
import '@fileverse-dev/ddoc/styles'; // in App.jsx/App.tsx

Update Tailwind Config

In your tailwind config, add this line to content array :

@fileverse-dev/ddoc/dist/index.es.js

You should now be set to use dDocs!

dDocProps Interface

The DdocProps interface is a TypeScript interface that defines the properties for a page-related component. It includes properties for handling preview mode, managing publishing data, and optionally storing metadata and content associated with the page.

Core Props

PropertyTypeDescription
initialContentJSONContentInitial content of the editor
onChange(changes: JSONContent, chunk?: any) => voidCallback triggered on editor content changes
refReact.RefObjectReference to access editor instance
isPreviewModebooleanControls if editor is in preview/read-only mode
editorCanvasClassNamesstringAdditional CSS classes for editor canvas
ignoreCorruptedDatabooleanWhether to ignore corrupted data during loading
onInvalidContentError(error: any) => voidCallback for handling invalid content errors

Collaboration Props

PropertyTypeDescription
enableCollaborationbooleanEnables real-time collaboration features
collaborationIdstringUnique ID for collaboration session (required when collaboration enabled)
usernamestringUser's display name for collaboration
setUsername(username: string) => voidFunction to update username
walletAddressstringUser's wallet address
onCollaboratorChange(collaborators?: IDocCollabUsers[]) => voidCallback when collaborators change
enableIndexeddbSyncbooleanEnables IndexedDB sync for offline support
ddocIdstringUnique document ID (required for IndexedDB sync)

UI/UX Props

PropertyTypeDescription
zoomLevelstringCurrent zoom level of the editor
setZoomLevelReact.Dispatch<SetStateAction<string>>Function to update zoom level
isNavbarVisiblebooleanControls navbar visibility
setIsNavbarVisibleReact.Dispatch<SetStateAction<boolean>>Function to toggle navbar visibility
renderNavbar() => JSX.ElementCustom navbar renderer
renderThemeToggle() => JSX.ElementCustom theme toggle renderer
isPresentationModebooleanControls presentation mode
setIsPresentationModeReact.Dispatch<SetStateAction<boolean>>Function to toggle presentation mode
sharedSlidesLinkstringLink for shared presentation slides

Comments & Collaboration Props

PropertyTypeDescription
initialCommentsIComment[]Initial comments to display
setInitialComments(comments: IComment[]) => voidFunction to update comments
onCommentReply(id: string, reply: IComment) => voidCallback for comment replies
onNewComment(comment: IComment) => voidCallback for new comments
commentDrawerOpenbooleanControls comment drawer visibility
setCommentDrawerOpen(isOpen: boolean) => voidFunction to toggle comment drawer
onResolveComment(commentId: string) => voidCallback when resolving comments
onUnresolveComment(commentId: string) => voidCallback when unresolving comments
onDeleteComment(commentId: string) => voidCallback when deleting comments
disableInlineCommentbooleanDisables inline commenting feature

Authentication Props

PropertyTypeDescription
isConnectedbooleanUser connection status
isLoadingbooleanAuthentication loading state
connectViaUsername(username: string) => Promise<void>Username-based authentication
connectViaWallet() => Promise<void>Wallet-based authentication
isDDocOwnerbooleanIndicates if user owns the document

Utility Props

PropertyTypeDescription
setCharacterCountReact.Dispatch<SetStateAction<number>>Updates character count
setWordCountReact.Dispatch<SetStateAction<number>>Updates word count
ensResolutionUrlstringURL for ENS name resolution
secureImageUploadUrlstringURL for secure image uploads
onError(error: string) => voidGeneral error handler
onInlineComment() => voidCallback for inline comments
onMarkdownExport() => voidCallback for markdown export
onMarkdownImport() => voidCallback for markdown import
onPdfExport() => voidCallback for pdf export
onSlidesShare() => voidCallback for slides sharing
onComment() => voidGeneral comment callback

Pro Features

PropertyTypeDescription
showTOCbooleanControls table of contents visibility
setShowTOCReact.Dispatch<SetStateAction<boolean>>Function to toggle TOC
proExtensions{ TableOfContents: any, [key: string]: any }Pro feature extensions

AI Writer Props

PropertyTypeDescription
activeModelCustomModelCurrently selected AI model for text generation
maxTokensnumberMaximum token limit for AI-generated content
isAIAgentEnabledbooleanToggle for AI agent functionality

Steps to run this example locally

  • npm i
  • npm run dev

It will open up a vite server, that will have the Ddoc Editor.

⚠️ This repository is currently undergoing rapid development, with frequent updates and changes. We recommend not to use in production yet.

Pro Extensions Setup

  1. Configure your .npmrc with the appropriate registry and authentication token:

  2. Install the corresponding extension packages:

  3. Use the extension in your DdocEditor component:

proExtensions={{
  TableOfContents
}}
2.1.7-patch-4.1

7 months ago

2.2.9-patch-9

5 months ago

2.1.4-patch-9

7 months ago

2.1.4-patch-8

8 months ago

2.1.4-patch-7

8 months ago

2.2.9-patch-5

5 months ago

2.2.9-patch-6

5 months ago

2.2.9-patch-7

5 months ago

2.2.9-patch-8

5 months ago

2.2.9-patch-1

5 months ago

2.2.9-patch-2

5 months ago

2.2.9-patch-3

5 months ago

2.2.9-patch-4

5 months ago

2.1.4-patch-6

8 months ago

2.1.4-patch-5

8 months ago

2.1.4-patch-4

8 months ago

2.1.4-patch-3

8 months ago

2.1.4-patch-2

8 months ago

2.1.4-patch-1

8 months ago

2.2.9-patch-5.1

5 months ago

2.3.0

5 months ago

2.1.1-patch-13

9 months ago

2.1.1-patch-12

9 months ago

2.1.1-patch-11

9 months ago

2.1.1-patch-10

9 months ago

2.2.7-reminders-2

6 months ago

2.2.3-reminders-1

6 months ago

2.2.0

7 months ago

2.2.3

6 months ago

2.2.2

6 months ago

2.2.5

6 months ago

2.2.4

6 months ago

2.2.7

6 months ago

2.2.6

6 months ago

2.2.8-patch-1

6 months ago

2.2.8-patch-3

6 months ago

2.2.8-patch-2

6 months ago

2.2.8-patch-5

6 months ago

2.2.8-patch-4

6 months ago

2.2.8-patch-7

6 months ago

2.2.8-patch-6

6 months ago

2.2.8-patch-9

6 months ago

2.2.8-patch-8

6 months ago

2.2.0-patch-4.1

7 months ago

2.1.2

9 months ago

2.1.1

10 months ago

2.1.4

8 months ago

2.1.3

9 months ago

2.1.6

7 months ago

2.1.5

7 months ago

2.1.8

7 months ago

2.1.7

7 months ago

2.2.8-patch-10

6 months ago

2.1.0

11 months ago

2.2.9-pdf-1

5 months ago

2.2.9

5 months ago

2.1.5-patch-1

7 months ago

2.2.8

6 months ago

2.1.5-patch-2

7 months ago

2.1.4-patch-9.1

7 months ago

2.1.4-patch-9.2

7 months ago

2.1.3-patch-29.3

8 months ago

2.1.3-patch-15

9 months ago

2.1.3-patch-16

9 months ago

2.1.3-patch-17

9 months ago

2.1.0-patch-10

10 months ago

2.1.3-patch-18

9 months ago

2.1.0-patch-11

10 months ago

2.1.3-patch-11

9 months ago

2.1.0-patch-12

10 months ago

2.1.3-patch-12

9 months ago

2.1.0-patch-13

10 months ago

2.1.3-patch-29.1

8 months ago

2.1.3-patch-13

9 months ago

2.1.3-patch-29.2

8 months ago

2.1.3-patch-14

9 months ago

2.1.3-patch-10

9 months ago

2.1.3-patch-19

9 months ago

2.1.3-patch-26

8 months ago

2.1.0-patch-4

11 months ago

2.1.3-patch-27

8 months ago

2.1.0-patch-3

11 months ago

2.1.3-patch-28

8 months ago

2.1.0-patch-6

11 months ago

2.1.3-patch-29

8 months ago

2.1.0-patch-5

11 months ago

2.1.3-patch-22

9 months ago

2.1.0-patch-8

10 months ago

2.0.8-patch-2

12 months ago

2.1.3-patch-23

9 months ago

2.1.0-patch-7

11 months ago

2.0.8-patch-3

12 months ago

2.1.3-patch-24

9 months ago

2.1.3-patch-25

9 months ago

2.1.0-patch-9

10 months ago

2.0.8-patch-1

12 months ago

2.1.3-patch-20

9 months ago

2.2.7-patch-1

6 months ago

2.1.3-patch-21

9 months ago

2.1.3-patch-8

9 months ago

2.1.3-patch-9

9 months ago

2.1.0-patch-2

11 months ago

2.1.0-patch-1

11 months ago

2.1.3-patch-4

9 months ago

2.1.3-patch-5

9 months ago

2.1.3-patch-6

9 months ago

2.1.3-patch-7

9 months ago

2.1.3-patch-1

9 months ago

2.1.3-patch-2

9 months ago

2.1.3-patch-3

9 months ago

2.0.8-patch-6

11 months ago

2.0.8-patch-7

11 months ago

2.0.8-patch-4

12 months ago

2.0.8-patch-5

12 months ago

2.0.8-patch-8

11 months ago

2.0.8-patch-9

11 months ago

2.1.3-patch-33

8 months ago

2.1.3-patch-34

8 months ago

2.1.3-patch-30

8 months ago

2.1.3-patch-31

8 months ago

2.1.3-patch-32

8 months ago

2.2.4-reminders-1

6 months ago

2.1.4-patch-10

7 months ago

2.1.4-patch-11

7 months ago

2.1.4-patch-14

7 months ago

2.1.4-patch-15

7 months ago

2.1.4-patch-12

7 months ago

2.1.4-patch-13

7 months ago

2.1.4-patch-18

7 months ago

2.1.4-patch-19

7 months ago

2.1.4-patch-16

7 months ago

2.1.4-patch-17

7 months ago

2.1.4-patch-21

7 months ago

2.1.4-patch-22

7 months ago

2.1.4-patch-20

7 months ago

2.1.9-patch-3

7 months ago

2.0.9-patch-2.4

11 months ago

2.1.9-patch-2

7 months ago

2.0.9-patch-2.3

11 months ago

2.1.9-patch-4

7 months ago

2.0.9-patch-2.2

11 months ago

2.0.9-patch-2.1

11 months ago

2.1.1-v2-patch-5

9 months ago

2.1.1-v2-patch-6

9 months ago

2.1.1-v2-patch-7

9 months ago

2.1.1-v2-patch-8

9 months ago

2.1.1-v2-patch-1

9 months ago

2.1.1-v2-patch-2

9 months ago

2.1.1-v2-patch-3

9 months ago

2.2.1-beta-1

6 months ago

2.1.1-v2-patch-4

9 months ago

2.1.1-v2-patch-9

9 months ago

2.2.7-code-block

6 months ago

2.2.8-tec-374-3

6 months ago

2.2.8-tec-374-2

6 months ago

2.2.8-tec-374-1

6 months ago

2.1.0-patch-12.1

10 months ago

2.1.9-patch-1

7 months ago

2.2.8-reminder-1

6 months ago

2.2.8-reminder-2

6 months ago

2.2.8-reminder-3

6 months ago

2.2.8-reminder-4

6 months ago

2.2.8-reminder-5

5 months ago

2.2.8-reminder-6

5 months ago

2.0.7-patch-4

12 months ago

2.0.7-patch-3

12 months ago

2.1.1-patch-1

10 months ago

2.0.7-patch-2

12 months ago

2.3.0-patch-1

5 months ago

2.1.1-patch-7

10 months ago

2.1.1-patch-6

10 months ago

2.1.1-patch-9

9 months ago

2.1.1-patch-8

10 months ago

2.1.1-patch-3

10 months ago

2.1.1-patch-2

10 months ago

2.1.1-patch-5

10 months ago

2.2.9-webllm-1

5 months ago

2.1.1-patch-4

10 months ago

2.0.7-patch-7

12 months ago

2.0.7-patch-6

12 months ago

2.0.7-patch-5

12 months ago

2.2.8-byom-9

6 months ago

2.2.8-byom-8

6 months ago

2.1.0-patch-6.1

11 months ago

2.2.8-byom-7

6 months ago

2.1.0-patch-6.2

11 months ago

2.2.8-byom-6

6 months ago

2.2.8-byom-5

6 months ago

2.2.8-byom-4

6 months ago

2.2.8-byom-3

6 months ago

2.2.8-byom-2

6 months ago

2.2.8-byom-1

6 months ago

2.1.2-patch-3.3

9 months ago

2.1.2-patch-3.2

9 months ago

2.1.2-patch-3.1

9 months ago

2.2.1-alpha-10

6 months ago

2.1.7-patch-4

7 months ago

2.2.1-alpha-1

7 months ago

2.2.1-alpha-2

7 months ago

2.2.5-reminders-1

6 months ago

2.1.7-patch-2

7 months ago

2.1.7-patch-3

7 months ago

2.1.7-patch-1

7 months ago

2.2.1-alpha-9

6 months ago

2.2.1-alpha-7

7 months ago

2.2.1-alpha-8

7 months ago

2.2.1-alpha-5

7 months ago

2.2.1-alpha-6

7 months ago

2.2.1-alpha-3

7 months ago

2.2.1-alpha-4

7 months ago

2.0.9-patch-13

11 months ago

2.0.9-patch-12

11 months ago

2.0.9-patch-15

11 months ago

2.0.9-patch-14

11 months ago

2.0.9-patch-11

11 months ago

2.0.9-patch-10

11 months ago

2.2.0-patch-1

7 months ago

2.2.0-patch-2

7 months ago

2.2.0-patch-3

7 months ago

2.2.0-patch-4

7 months ago

2.2.0-patch-5

7 months ago

2.0.9-patch-6.1

11 months ago

2.2.5-patch-3

6 months ago

2.2.5-patch-4

6 months ago

2.2.5-patch-1

6 months ago

2.2.5-patch-2

6 months ago

2.1.2-patch-1

9 months ago

2.1.2-patch-2

9 months ago

2.1.2-patch-3

9 months ago

2.2.9-tocfix-1

5 months ago

2.1.1-v2-patch-15

9 months ago

2.1.1-v2-patch-14

9 months ago

2.1.1-v2-patch-11

9 months ago

2.1.1-v2-patch-10

9 months ago

2.1.1-v2-patch-13

9 months ago

2.1.1-v2-patch-12

9 months ago

2.2.2-patch-1

6 months ago

2.0.9

11 months ago

2.0.8

12 months ago

2.1.9

7 months ago

2.2.9-reminder-3

5 months ago

2.2.9-reminder-2

5 months ago

2.2.9-reminder-1

5 months ago

2.0.8-patch-11

11 months ago

2.0.8-patch-10

11 months ago

2.2.8-byom-15

5 months ago

2.2.8-byom-14

5 months ago

2.2.8-byom-13

5 months ago

2.2.8-byom-12

5 months ago

2.2.8-byom-11

5 months ago

2.2.8-byom-10

6 months ago

2.1.1-ws-patch-1

9 months ago

2.0.9-yjs-patch-1

11 months ago

2.1.0-yjs-patch-6

10 months ago

2.1.0-yjs-patch-7

10 months ago

2.0.9-yjs-patch-2

11 months ago

2.0.9-patch-1

11 months ago

2.0.9-patch-2

11 months ago

2.1.0-yjs-patch-4

10 months ago

2.1.0-yjs-patch-5

10 months ago

2.1.0-yjs-patch-2

11 months ago

2.1.0-yjs-patch-3

11 months ago

2.0.9-patch-9

11 months ago

2.0.9-patch-7

11 months ago

2.0.9-patch-8

11 months ago

2.0.9-patch-5

11 months ago

2.0.9-patch-6

11 months ago

2.0.9-patch-3

11 months ago

2.0.9-patch-4

11 months ago

2.0.3-sync-patch-16

12 months ago

2.0.3-sync-patch-17

12 months ago

2.2.9-patch-10

5 months ago

2.2.9-patch-11

5 months ago

2.1.4-patch-5.1

8 months ago

2.0.3-sync-patch-14

12 months ago

2.0.3-sync-patch-15

12 months ago

2.0.7-patch-1

1 year ago

2.0.7

1 year ago

2.0.6-patch-8

1 year ago

2.0.6-patch-5

1 year ago

2.0.6-patch-7

1 year ago

2.0.6-patch-6

1 year ago

2.0.6-patch-4

1 year ago

2.0.6-patch-3

1 year ago

2.0.6-patch-2

1 year ago

2.0.6

1 year ago

2.0.6-patch-1

1 year ago

2.0.5-patch-2

1 year ago

2.0.3-patch-9

1 year ago

2.0.5

1 year ago

2.0.4

1 year ago

2.0.3-patch-7

1 year ago

2.0.3-patch-8

1 year ago

2.0.4-patch-4

1 year ago

2.0.4-patch-1

1 year ago

2.0.4-patch-2

1 year ago

2.0.4-patch-3

1 year ago

2.0.3-patch-10

1 year ago

2.0.5-patch-1

1 year ago

2.0.3-patch-5

1 year ago

2.0.3-patch-6

1 year ago

2.0.3-patch-1

1 year ago

2.0.3-patch-2

1 year ago

2.0.3-patch-3

1 year ago

2.0.3-patch-4

1 year ago

2.0.3

1 year ago

2.0.2-patch-9

1 year ago

2.0.2-patch-8

1 year ago

2.0.2-patch-7

1 year ago

2.0.2-patch-6

1 year ago

2.0.2-patch-5

1 year ago

2.0.2-patch-4

1 year ago

2.0.2-patch-3

1 year ago

2.0.2-patch-2

1 year ago

2.0.2

1 year ago

2.0.1

1 year ago

2.0.1-patch

1 year ago

2.0.1-patch-2

1 year ago

2.0.1-patch-1

1 year ago

2.0.2-patch

1 year ago

2.0.2-patch-1

1 year ago

2.0.0-patch-2

1 year ago

2.0.0-patch-1

1 year ago

2.0.0-patch

1 year ago

2.0.0

1 year ago

2.0.0-beta-2

1 year ago

2.0.0-beta-1

1 year ago

2.0.0-beta

1 year ago

2.0.0-alpha

1 year ago

1.8.5

1 year ago

1.8.4

1 year ago

1.8.3

1 year ago

1.8.2

1 year ago

1.8.1

1 year ago

1.8.0

1 year ago

1.7.9-patch

1 year ago

1.7.9

1 year ago

1.7.8

1 year ago

1.7.7

1 year ago

1.7.6-patch-3

1 year ago

1.7.6-patch-2

1 year ago

1.7.6-patch-1

1 year ago

1.7.6-patch

1 year ago

1.7.6

1 year ago

1.7.5

1 year ago

1.7.4-patch-1

1 year ago

1.7.4-patch

1 year ago

1.7.4

1 year ago

1.7.3

1 year ago

1.7.2

1 year ago

1.7.1

1 year ago

1.7.0

1 year ago

1.6.9

1 year ago

1.6.8

1 year ago

1.6.7

1 year ago

1.6.6

1 year ago

1.6.5

1 year ago

1.6.4

1 year ago

1.6.3

1 year ago

1.6.2

1 year ago

1.6.1

1 year ago

1.6.0

1 year ago

1.5.9

1 year ago

1.5.8

1 year ago

1.5.7

1 year ago

1.5.6

1 year ago

1.5.5

1 year ago

1.5.4

1 year ago

1.5.3

1 year ago

1.5.2

1 year ago

1.5.1

1 year ago

1.5.0

1 year ago

1.4.9

1 year ago

1.4.8

1 year ago

1.4.7

1 year ago

1.4.6

1 year ago

1.4.5

1 year ago

1.4.4

1 year ago

1.4.3

1 year ago

1.4.2

1 year ago

1.4.1

1 year ago

1.4.0

1 year ago

1.3.9

1 year ago

1.3.8

1 year ago

1.3.7

1 year ago

1.3.6

1 year ago

1.3.5

1 year ago

1.3.4

1 year ago

1.3.3

1 year ago

1.3.2

1 year ago

1.3.1

1 year ago

1.3.0

1 year ago

1.2.9

1 year ago

1.2.8

1 year ago

1.2.7

1 year ago

1.2.6

1 year ago

1.2.5

1 year ago

1.2.4

1 year ago

1.2.3

1 year ago

1.2.2

1 year ago

1.2.1

1 year ago

1.2.0

1 year ago

1.1.9

1 year ago

1.1.8

1 year ago

1.1.7

1 year ago

1.1.6

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago