Code Monkey home page Code Monkey logo

Comments (7)

jhchen avatar jhchen commented on August 23, 2024

Quill's clipboard module deliberately does not want to store all baseDeltas (which would be the entire document). Also its clipboard deals with insert-only deltas which can use diff() if one is willing to store all baseDeltas. Are there other use cases you have in mind?

from delta.

jaredly avatar jaredly commented on August 23, 2024

Right, you wouldn't be storing the baseDeltas. I'm envisioning this as a better way to do diff() that is aware of what the delta was that is making the change.
So instead of

const undoDelta = baseDelta.compose(delta).diff(baseDelta);

you can do

const undoDelta = delta.undoCompose(baseDelta)

from delta.

jhchen avatar jhchen commented on August 23, 2024

I see what you mean now. baseDelta needs to be an insert-only delta I believe but delta can be an arbitrary delta in your examples. I can see its use for undo and could replace guessUndoDelta. Are there other use cases though? If not it should arguably belong in Quill instead of here. Either way is this something you'd be willing to contribute a PR to?

from delta.

jaredly avatar jaredly commented on August 23, 2024

Yup, I'd definitely be willing to contribute a PR. I'd much rather have it live here, because quill is tied to the dom, and this undoCompose would be data-only

from delta.

jhchen avatar jhchen commented on August 23, 2024

Great thanks! Let me know when there is something to look at or if you have questions getting started.

from delta.

jhchen avatar jhchen commented on August 23, 2024

Hey is this something you are still planning on working on? We were planning on adding this soon if not.

from delta.

jaredly avatar jaredly commented on August 23, 2024

I haven't gotten to this yet, it's a little farther down on my priority list

from delta.

Related Issues (20)

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.