2.0.3-sync-patch-15 • Published 8 months ago

@fileverse-dev/ddoc v2.0.3-sync-patch-15

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

Ddoc Editor

This repo contains example - demo source code and package code

/package contains the package code

Usage

Prequisites

  • You should be using tailwindcss and it must have tailwind configuration

import { DdocEditor } from '@fileverse-dev/ddoc'

import '@fileverse-dev/ddoc/styles' in App.jsx/App.tsx

In your tailwind config, add this line to content array

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

That's it, you should be able to use DdocEditor now

Props

DdocProps Interface

The DdocProps interface is a TypeScript interface that defines the properties for a component related to a page. This interface includes properties for handling preview mode, publishing data, and optional data related to the page's metadata and content.

Properties

PropertyTypeDescription
isPreviewModebooleanIndicates whether the page is in preview mode or not.
data (optional)DataOptional property holding data related to the page.
enableCollaboration (optional)booleanOptional property to enable collaboration
onCommentInteraction (optional)(commentInfo: IEditSelectionData) => voidOptional function that get's called whenever there is a mouse-over and click interaction on a comment
collaborationId (optional)stringWhen using enableCollaboration, you need to provide collaborationId, it can be uuid of doc
onTextSelection (optional)(data: IEditorSelectionData) => voidFunction called when a text is selected on the editor
renderToolRightSection (optional)({editor}) => JSX.ElementFunction that render the right section of the toolbar. it calls the function with the editor instance
renderToolLeftSection (optional)({editor}) => JSX.ElementAccept a react component
username (required when using collaboration)booleanTakes a username which can be used by collaboration cursor
walletAddress (optional)stringTakes a wallet address
ref (optional)anyGets editor instance
ensResolutionUrl (optional)stringApi Url for resolving ens names
secureImageUploadUrl (optional)stringApi Url for secure image upload
initialContent (optional)JSONContentInitial content of the editor
onChange (optional)(changes: JSONContent) => voidOptional function that gets triggered with the latest content of the editor on every change in the editor
onCollaboratorChange (optional)(collaborators?: IDocCollabUsers[] ) => voidOptional function that gets triggered when a user join or leave the doc during collaboration
onError (optional)(errorString: string) => voidFunction to call on error
setCharacterCount (optional)React.Dispatch<SetStateAction<number>>Optional. React Set State function to update Character Count
setWordCount (optional)React.Dispatch<SetStateAction<number>>Optional. React Set State function to update Word Count
scrollPosition(optionalnumberUser cursor position to scroll to on intitalising the content of the editor

Data Interface

The Data interface defines the structure of the data object

Properties

PropertyTypeDescription
editorJSONDataJSONContentContains JSON data for the editor content.

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

2.0.7-patch-1

8 months ago

2.0.7

8 months ago

2.0.6-patch-8

8 months ago

2.0.6-patch-5

8 months ago

2.0.6-patch-7

8 months ago

2.0.6-patch-6

8 months ago

2.0.6-patch-4

8 months ago

2.0.6-patch-3

8 months ago

2.0.6-patch-2

8 months ago

2.0.6

8 months ago

2.0.6-patch-1

8 months ago

2.0.5-patch-2

8 months ago

2.0.3-patch-9

9 months ago

2.0.5

8 months ago

2.0.4

9 months ago

2.0.3-patch-7

9 months ago

2.0.3-patch-8

9 months ago

2.0.4-patch-4

9 months ago

2.0.4-patch-1

9 months ago

2.0.4-patch-2

9 months ago

2.0.4-patch-3

9 months ago

2.0.3-patch-10

9 months ago

2.0.3-sync-patch-7

9 months ago

2.0.3-sync-patch-8

9 months ago

2.0.3-sync-patch-9

9 months ago

2.0.3-sync-patch-3

9 months ago

2.0.3-sync-patch-4

9 months ago

2.0.3-sync-patch-5

9 months ago

2.0.3-sync-patch-6

9 months ago

2.0.5-patch-1

8 months ago

2.0.3-patch-5

9 months ago

2.0.3-patch-6

9 months ago

2.0.3-sync-patch-1

9 months ago

2.0.3-sync-patch-2

9 months ago

2.0.3-patch-1

9 months ago

2.0.3-patch-2

9 months ago

2.0.3-patch-3

9 months ago

2.0.3-patch-4

9 months ago

2.0.3

9 months ago

2.0.2-patch-9

9 months ago

2.0.2-patch-8

9 months ago

2.0.2-patch-7

10 months ago

2.0.2-patch-6

10 months ago

2.0.2-patch-5

10 months ago

2.0.2-patch-4

10 months ago

2.0.2-patch-3

10 months ago

2.0.2-patch-2

10 months ago

2.0.2

10 months ago

2.0.1

10 months ago

2.0.1-patch

10 months ago

2.0.1-patch-2

10 months ago

2.0.1-patch-1

10 months ago

2.0.2-patch

10 months ago

2.0.2-patch-1

10 months ago

2.0.0-patch-2

10 months ago

2.0.0-patch-1

10 months ago

2.0.0-patch

10 months ago

2.0.0

10 months ago

2.0.0-beta-2

11 months ago

2.0.0-beta-1

11 months ago

2.0.0-beta

11 months ago

2.0.0-alpha

11 months ago

1.8.5

11 months ago

1.8.4

11 months ago

1.8.3

11 months ago

1.8.2

11 months ago

1.8.1

11 months ago

1.8.0

11 months ago

1.7.9-patch

11 months ago

1.7.9

11 months ago

1.7.8

11 months ago

1.7.7

11 months ago

1.7.6-patch-3

11 months ago

1.7.6-patch-2

11 months ago

1.7.6-patch-1

11 months ago

1.7.6-patch

11 months ago

1.7.6

11 months ago

1.7.5

11 months ago

1.7.4-patch-1

11 months ago

1.7.4-patch

11 months ago

1.7.4

11 months ago

1.7.3

11 months ago

1.7.2

11 months ago

1.7.1

11 months ago

1.7.0

11 months ago

1.6.9

11 months ago

1.6.8

11 months ago

1.6.7

11 months ago

1.6.6

11 months ago

1.6.5

11 months ago

1.6.4

11 months ago

1.6.3

11 months ago

1.6.2

11 months ago

1.6.1

11 months ago

1.6.0

11 months ago

1.5.9

11 months ago

1.5.8

11 months ago

1.5.7

11 months ago

1.5.6

12 months ago

1.5.5

12 months ago

1.5.4

12 months ago

1.5.3

12 months ago

1.5.2

12 months ago

1.5.1

12 months ago

1.5.0

12 months ago

1.4.9

12 months ago

1.4.8

12 months ago

1.4.7

12 months ago

1.4.6

12 months ago

1.4.5

12 months ago

1.4.4

12 months ago

1.4.3

12 months ago

1.4.2

12 months ago

1.4.1

12 months ago

1.4.0

12 months ago

1.3.9

12 months ago

1.3.8

12 months ago

1.3.7

12 months ago

1.3.6

12 months ago

1.3.5

12 months ago

1.3.4

12 months ago

1.3.3

12 months ago

1.3.2

12 months ago

1.3.1

12 months ago

1.3.0

12 months ago

1.2.9

12 months ago

1.2.8

12 months 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