dimitrov-adrian / directus-extension-editorjs-interface

Block editor (Editor.js) interface for Directus 9
https://www.npmjs.com/package/directus-extension-editorjs
GNU General Public License v3.0
180 stars 42 forks source link

addTokenToURL breaking change in v9.0.0-rc.92 #14

Closed definiteIymaybe closed 2 years ago

definiteIymaybe commented 2 years ago

addTokenToURL is no longer available though inject('system') after #7668. Would suggest a fix, but am still investigating where it can be picked from in rc92.

definiteIymaybe commented 2 years ago
dimitrov-adrian commented 2 years ago

@definiteIymaybe thanks, would you mind, if I open PR from your branch and go with the changes?

definiteIymaybe commented 2 years ago

Sure, Adrian. Honestly I was shy to suggest a PR cuz I basically was learning to create extensions based on your code – and this was the first breaking change managed to fix by myself.

Also I didn't want to change much – my eslint+prettier have opinions :) Not sure how to solve this for the future. Maybe you could add style configs? Please let me know if I can be of any help.

dimitrov-adrian commented 2 years ago

Sorry, for my delay.

You shouldn't be shy to suggest ;) ! About the styling, this is something I am in considering too, since don't want to include prettier/eslint config with the extension, but won't include directus as a dep.

Anyway, thanks for the PR, it seems that it fixes the things. I was just on par with the readonly switch, since didn't succeed in reproducing it (do you have scenario that reproduces it?)

definiteIymaybe commented 2 years ago

Thank, Adrian.

Not sure I 100% understood you regarding the style configs. In the end the extension is just what rollup would build. As I understand – you could even drop directus-extension and just have your own fully cusomizable rollup.config.js. Including the style configs was just my first idea to ensure consistency. Surely it's completely up to you.

On the readonly thing: I don't have a a firm case, but here is what my problem was: when open some collection items, the editors content is not rendered, showing just a narrow empty input field which does have text content: image I only have 1 per collection item.(I may have custom css for minimum textarea height).

Here is what I get when I click on such field image Going through them I saw that some items / editor fields are not affected by this bug. When went to the db, I see that those that are prone to this issues have "version":"2.22.2". The ones that have "version":"2.22.1" seem to be ok. But this is not confirmed. Just an observation for now.

Edit: Just to clarify – removing the toggle fixes the issue (so you would need to put back the toggler if you would want to try to reproduce):

editorjsInstance.value.isReady.then(() => {
    editorjsInstance.value.readOnly.toggle(newVal);
});
dimitrov-adrian commented 2 years ago

Yes, got it. It seems that if first come disabled, then toggling caused the issue. So it completely valid case for example in bulk editing mode. Anyway, until fix from editorjs, I had added a workaround with css pointer events disabling.

About the styling, I had in mind, a shared eslint/stylielint/prettier through the @directus/extensions-sdk so use more standardized approach from directus, but it seems there is no such yet.

@definiteIymaybe thanks!