/** * @module modules/image-editor */ import type { ImageEditorOptions, IViewBased } from 'jodit/types'; import { Icon } from 'jodit/core/ui'; const jie = 'jodit-image-editor'; const gi = Icon.get.bind(Icon); const act = (el: boolean, className = 'jodti-image-editor_active'): string => el ? className : ''; export const form = ( editor: IViewBased, o: ImageEditorOptions ): HTMLElement => { const i = editor.i18n.bind(editor); const switcher = ( label: string, ref: string, active: boolean = true ): string => `
`; return editor.create.fromHTML(`
${ o.resize ? `
` : '' } ${ o.crop ? `
` : '' }
${ o.resize ? `
${gi('resize')} ${i('Resize')}
${switcher('Keep Aspect Ratio', 'keepAspectRatioResize')}
` : '' } ${ o.crop ? `
${gi('crop')} ${i('Crop')}
${switcher('Keep Aspect Ratio', 'keepAspectRatioCrop')}
` : '' }
`); };