Giter Club home page Giter Club logo

slate-plugins's Introduction

Slate plugins

Collection of slate plugins, initially forked from great gitbook repositories.

⚠️ Ever since gitbook abandoned the original version of slate and decided to fork their own, some plugins have been greatly neglected. This is our attempt to bring these plugins up to date with latest versions of slate. Please note that we will accept pr with new plugins, but we won't accept requests for us updating plugins that we don't use in guestbell. Please note we've rewritten plugins in typescript and also made some changes that might cause api to be inconsistent.

Demo

Check out online demo

Getting Started

Plugins are publish via scope @guestbell, therefore to install, you do

yarn add @guestbell/slate-edit-list

Tests

We have temporarily disabled testing on these plugins. In some bright future, we expect to fix them and reenable.

Development

Slate plugins is a monorepo maintained using lerna. All standard lerna rules applies.

yarn start

Created and sponsored by

  • GuestBell - Customer centric online POS for Hotels and short terms stays.

Contributing

We'll be happy to accept PRs from anybody.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

  • It goes without saying most of this work is based on amazing work gitbook guys did.

slate-plugins's People

Contributors

peterkottas avatar sbezludny avatar

Stargazers

yoots avatar  avatar Daniel Batěk avatar Hgonagy avatar Claudéric Demers avatar Luke John avatar David Furlong avatar Eric Hartline avatar chikamim avatar John Johnson avatar  avatar Chris Lonardo avatar Cary Dunn avatar Bryan Haakman avatar Audun Halland avatar Quentin Calvez avatar Konrad Lisiczyński avatar  avatar

Watchers

James Cloos avatar  avatar

slate-plugins's Issues

Undo after an 'unwrapList' change creates invalid state

Hi, thank you so much for the amazing work you've done bringing these plugins up to date.

This issue is related to the 'slate-edit-list' plugin.

I am facing an issue when using the undo feature of slate after triggering an unwrapList action. When my selection is in a list item, I click on my list button, which is set up to trigger the unwrapList change. This works perfectly and unwraps the current list item's content.

However, when I try to undo, it seems to corrupt the editor's state, creating an empty list item at the beginning of my editor's content, and eventually resulting in the following error:

A schema rule could not be normalized after sufficient iterations. This is usually due to a `rule.normalize` or `plugin.normalizeNode` function of a schema being incorrectly written, causing an infinite loop

I don't define any custom normalise rules in my editor schema, so I think this error is caused by the schema defined in this plugin.

I think the problem comes from the way Slate reverses the logic implemented in unwrapList, but I'm not sure what it's doing exactly to be honest!

Have you come across anything like this, and is there an easy fix?

Issue Toggling Bullet Lists when highlighted

Currently, if you highlight an entire list item and click the ul_list icon, the list does not toggle off correctly.

Steps:

  1. Visit https://guestbell.github.io/slate-plugins/slate-edit-list
  2. Create a bulleted list
  3. highlight all or some of the bullets
  4. Click the list icon

Expected Outcome:
Bullets are toggled

Actual Outcome
Bullets are further indented

2019-05-21 11 13 30

Also note that if you just click in a list item (instead of highlighting), it works correctly.


I did notice that inList is false here when the whole list is highlighted. Is there another util function to use besides isSelectionInList if the entire list is highlighted? Or should isSelectionInList return true in these cases?

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.