Fandom-OSS / quill-blot-formatter

A module for Quill that allows editor elements to be resized, repositioned, etc.
Apache License 2.0
135 stars 50 forks source link

Quill 2 Support #45

Open saulfrr opened 8 months ago

saulfrr commented 8 months ago

Hi, now that Quill Version 2.0.0-rc.2 is there, do you have plans to support it?

npm ERR! Could not resolve dependency:
npm ERR! peer quill@"^1.3.4" from quill-blot-formatter@1.0.5
npm ERR! node_modules/quill-blot-formatter
npm ERR! quill-blot-formatter@"*" from the root project

Thanks.

LukasKlement commented 8 months ago

This fork works fine with Quill Version 2: https://github.com/juandjara/quill-blot-formatter-mobile

To avoid type errors, make sure to register it with as any: Quill.register('modules/blotFormatter', BlotFormatter as any);

adgoncal commented 7 months ago

@saulfrr you can add an override to package.json:

  "overrides": {
    "quill-blot-formatter": {
      "quill": "^2.0.0"
    }
  },
xwiz commented 6 months ago

Thanks, can you open a PR with support for 2.0

@saulfrr you can add an override to package.json:

  "overrides": {
    "quill-blot-formatter": {
      "quill": "^2.0.0"
    }
  },
enzedonline commented 5 months ago

Overriding the quill version doesn't make it compatible unfortunately. Quill 2 has a very different methodology for applying styles.

The resizing still works fine, but the alignments (found in actions/align/DefaultAligner.js) need updating to the new syntax. Currently, these do not get written to the delta.

enzedonline commented 5 months ago

I have a working version here. It's converted to TypeScript and uses custom Quill formats to apply the alignments.

2024-06-28-162544-ezgif com-optimize

Feel free to clone etc if it's useful to you.

enzedonline commented 2 months ago

If anyone is looking for an updated version for this package to work with Quill v2, I have this published on npm at https://www.npmjs.com/package/@enzedonline/quill-blot-formatter2

The latest version fixes a lot of bugs to do with the overlay and proxy, particularly when used with a scrollable editor. Alt/title editing (and option to use title as caption) Choice to use relative sizing instead of fixed pixel. Size info display before and during resize. Custom blots that fix some Quill bugs. Touch screen compatibility (including resize with pinch gesture).

resize

adgoncal commented 2 months ago

@enzedonline that's awesome, thank you for sharing. I noticed you removed the License file from your repo. Why?

enzedonline commented 2 months ago

@adgoncal no reason, probably just got swept up as I was flushing out the config after converting to typescript and updating/removing dependencies etc. I've copied this one back in.

GlenHeart commented 1 month ago

I directly updated @quill2.0.2 using PNPM. The program ran perfectly, but there were some warnings. Can you tell me what hidden problems there may be?Thanks @enzedonline

enzedonline commented 1 month ago

@GlenHeart which program? This package or my one? If you're running mine, did you uninstall this one first?

The warnings will depend on your environment but should have been displayed when you installed. Did you check the logs for the warnings, they should be in there, or install with npm i --loglevel warn to filter out everything except warnings and errors.

Other things to look at are

If you're still stuck, maybe your cache is corrupt, try npm cache clean --force