-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Add and use the registerIcon
and useIcon
utils
#17755
Conversation
registerIcon
and useIcon
utils
const POSSIBLE_INSERTION_POSITIONS = [ 'before', 'after' ] as const; | ||
|
||
// Do the SVG parsing once and then clone the result <svg> DOM element for each new button. | ||
const RETURN_ARROW_ICON_ELEMENT = new DOMParser().parseFromString( IconReturnArrow, 'image/svg+xml' ).firstChild!; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How much this change can affect performance?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🎉
import { MenuBarMenuListItemButtonView, ButtonView } from 'ckeditor5/src/ui.js'; | ||
import { getButtonCreator } from '../utils.js'; | ||
|
||
const ITALIC = 'italic'; | ||
const italicIcon = /* #__PURE__ */ registerIcon( 'utalic', IconItalic ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const italicIcon = /* #__PURE__ */ registerIcon( 'utalic', IconItalic ); | |
const italicIcon = /* #__PURE__ */ registerIcon( 'italic', IconItalic ); |
Suggested merge commit message (convention)
Feature (core): Add a new
icons
configuration option to the editor. Related to #16546.Feature (utils): Add
registerIcon
anduseIcon
helpers for registering and using customizable icons. Related to #16546.Feature: Use
registerIcon
anduseIcon
helpers in all packages.Additional information
This is a follow-up to #17750.