uiwjs / uiwjs/react-md-editor

Redesigned Toolbar Custom Definition API

Open
#388 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
2.9k
Forks
201
Avg merge
12m
Merged PRs (30d)
1

Description

There is no good way to define icon size.
Because there needs to be an easier way to define toolbars. Unless we redesign the toolbar definition API.

Similar to the API design below:

<MDEditor.Markdown 
  source="...."
  commands={
    <Command>
      <Title3 />
      <CommandGroup>
        <Title1 />
        <Title2 />
        <Title3 width="12" height="12" buttonProps={{ 'aria-label': 'Insert title'}} />
      </CommandGroup>
    </Command>
  }
/>

This one has more work and can be considered for expansion in the next version. The only solution so far is as follows:

const title1: ICommand = {
  ...commands.title1,
  icon: (
    <svg width="23" height="23" viewBox="0 0 520 520">
      <path fill="currentColor" d="M15.708333..." />
    </svg>
  ),
};

@jeepers3327

Originally posted by @jaywcjlove in https://github.com/uiwjs/react-md-editor/issues/387#issuecomment-1133659574

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing toolbar command API, including ICommand and the commands.title1 example shown here. Before implementation, settle the intended nested command structure, icon sizing, and buttonProps behavior; this issue is done only when those decisions are specified and covered by suitable acceptance criteria.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
developer-experience, frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.