/** * @module ui */ import type { CanUndef, IDictionary, IUIIconState, IViewBased } from 'jodit/types'; import { css } from 'jodit/core/helpers/utils/css'; import { camelCase, kebabCase } from 'jodit/core/helpers'; export class Icon { private static icons: IDictionary = {}; private static getIcon(name: string): string | undefined { if (/ { let iconElement: CanUndef; if (icon) { const clearName = icon.name.replace(/[^a-zA-Z0-9]/g, '_'); if (icon.iconURL) { iconElement = jodit.c.span(); css( iconElement, 'backgroundImage', 'url(' + icon.iconURL.replace( '{basePath}', jodit?.basePath || '' ) + ')' ); } else { const svg = jodit.e.fire('getIcon', icon.name, icon, clearName) || Icon.get(icon.name, '') || jodit.o.extraIcons?.[icon.name]; if (svg) { iconElement = jodit.c.fromHTML(svg.trim()); if (!/^