GithubHelp home page GithubHelp logo

buhayova / react-notion-wysiwyg Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 8.56 MB

Notion-style WYSIWYG editor

Home Page: https://www.npmjs.com/package/react-notion-wysiwyg

License: MIT License

JavaScript 1.49% TypeScript 91.16% CSS 7.35%

react-notion-wysiwyg's Introduction

This library is in active development!

Updates are released almost every day, and I hope it will soon work relatively stable and have a convenient API.

Your feedbacks is highly important to us, help make this product better.

This is my first experience in library development, so some errors or improvements might take time, but ultimately they will be addressed, as we are constantly learning! I'll also be glad to welcome contributors!

Wysiwyg demo

npm downloads npm npm

DEMO

Install

yarn add react-notion-wysiwyg

or

npm install --save react-notion-wysiwyg

Use and Setup

import { Editor } from 'react-notion-wysiwyg';

Params:

Prop Type Description Default
editable(optional) boolean This property is used to change the editor mode from "preview" to "edit" mode. true
mode(optional) light or dark This prop is used to change the editor theme palette. light
defaultValue(optional) JSONContent or string The default value to use for the editor. defaultEditorContent
onUpdate (editor: EditorType) => void A callback function that is called whenever the editor is updated () => {}
onUploadImage (file: File) => string or Promise<string> A callback function that is called whenever the image upload () => {}

Tech Stack

License

Licensed under the MIT license

react-notion-wysiwyg's People

Contributors

buhayova avatar

Stargazers

 avatar  avatar

Watchers

 avatar

react-notion-wysiwyg's Issues

Editor overriding root CSS styles of webpage

Describe the bug
The notion editor is overriding my CSS styles.
When I visit a page on my website which has the Editor component, all my custom CSS styles are overriden.

To Reproduce
Steps to reproduce the behavior:

  1. Import Editor component in either read or write mode
  2. On that same page (and also by going to other pages afterwards) the styles for elements like H1s H2s and other HTML elements like buttons, etc.
  3. All those elements will have their styles overridden. Its a lot of !important to add, too many to be viable.

Expected behavior
The Editor component should not override any styles. The styling should be scoped to a more specific CSS id/class.

Possible Solution

Scope the styles to a container id/class like "#notion-editor"

Screenshots
Description is self-explanatory.

Additional context
none

Your Environment

  • Next.js: 14.2.5
  • React: 18
  • react-notion-wysiwyg 0.1.13
  • Browser: chrome
  • Version: latest
  • Operating System: MacOS Sequoia:
  • Other relevant information:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.