New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@fileverse-dev/ddoc

Package Overview
Dependencies
Maintainers
2
Versions
293
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fileverse-dev/ddoc

DDoc

  • 1.0.7
  • npm
  • Socket score

Version published
Weekly downloads
304
decreased by-63.33%
Maintainers
2
Weekly downloads
 
Created
Source

Ddoc Editor

This repo contains example source code and package code

/src/packages/ddoc/ 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/dist/style.css' 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.
togglePreviewMode(flag: boolean) => voidFunction to toggle preview mode with a boolean flag.
onPublish(data: Data) => voidFunction to handle publishing of the page.
data (optional)DataOptional property holding data related to the page.
enableCollaboration (optional)booleanOptional property to enable collaboration
collaborationId (optional)stringWhen using enableCollaboration, you need to provide collaborationId, it can be uuid of doc
toggleCollaboration (optional)(flag: boolean) => voidFunction to toggle collaboration mode with a boolean flag

Data Interface

The Data interface defines the structure of the data object that can be passed to the onPublish function and optionally included in the data property of DdocProps.

Properties

PropertyTypeDescription
metaDataPluginMetaDataContains metadata related to the plugin.
editorJSONDataJSONContentContains JSON data for the editor content.

PluginMetaData Interface

The PluginMetaData interface defines the structure of the metadata related to the plugin.

Properties

PropertyTypeDescription
pluginPluginContains information about the plugin title.

Plugin Interface

The Plugin interface defines the structure of the plugin information.

Properties

PropertyTypeDescription
titlestring | nullTitle of the plugin (can be null).

Steps to run this example locally

  • npm i
  • npm run dev

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

FAQs

Package last updated on 11 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc