/*! * Jodit Editor (https://xdsoft.net/jodit/) * Released under MIT see LICENSE.txt in the project root for license information. * Copyright (c) 2013-2021 Valeriy Chupurnov. All rights reserved. https://xdsoft.net */ import type { ImageEditorOptions, IViewBased } from '../../../types'; import { Icon } from '../../../core/ui'; const jie = 'jodit-image-editor'; const gi = Icon.get.bind(Icon); const act = (el: boolean, className = 'jodti-image-editor_active') => 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 ) => `
`; 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')}
` : '' }
`); };