Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZUIEditor tools: Ordered list, bullet list, bold and italic #2479

Open
wants to merge 6 commits into
base: undocumented/ZUI-text-editor
Choose a base branch
from

Conversation

richardolsson
Copy link
Member

Description

This PR integrates four builtin remirror extensions into the editor, and introduces the link extension into the same patterns as all other tools.

Screenshots

image

Changes

  • Refactors block factories to support more arbitrary commands
  • Enable built-in ordered list extension
  • Enable built-in unordered (bullet) list extension extension
  • Enable built-in bold extension
  • Enable built-in italic extension
  • Fix bug causing block toolbar to be available in non-paragraph blocks
  • Introduce new pattern for toolbar buttons that are more self-contained components

Notes to reviewer

None

Related issues

Undocumented

Copy link
Contributor

@ziggabyte ziggabyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm approving, but if the "Foo button" text was not intentionally left for later, it needs internationalisation i think.

Also thought about this when i played with it, that I'm not enjoying that the toolbar is open already when i go to the tab. Arriving in this state does not feel smooth to me. Also not for this pr to solve, but noticed it now so writing it now.
bild

const { dispatch, state, tr } = props;
const newNode = this.type.create(
null,
this.type.schema.text('Foo button')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm assuming this is either left in here accidentally, or intentionally left to be internationalised at a later point?

const blockExtensions: ZetkinExtension[] = [];
const otherExtensions: Extension[] = [];
const otherExtensions: AnyExtension[] = [];
const blockExtensions: BlockExtension[] = [];

if (enableButton) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't say I like this very long list of "if this - add that" but maybe it is inevitable. Also not to be fixed in this pr, just a thought for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants