Skip to content

Big refactoring and Bug fix

Compare
Choose a tag to compare
@xdan xdan released this 23 Feb 20:51

3.6.1

πŸ› Bug Fix

πŸš€ New Feature

const editor = new Jodit('#editor', {
 	controls: {
 		classSpan: {
 			list: {
 				class1: 'Classe 1',
 				class2: 'Classe 2',
 				class3: 'Classe 3',
 				class4: 'Classe 4',
 				class5: 'Classe 5'
 			}
 		}
 	}
});
  • Added UIFileInput element.
  • Added UIButtonGroup element.
const group = new UIButtonGroup(jodit, {
	label: 'Theme',
	name: 'theme',
	value: this.state.theme,
	radio: true,
	options: [
		{ value: 'default', text: 'Light' },
		{ value: 'dark', text: 'Dark' }
	],
	onChange: (values) => {
		this.state.theme = values[0].value as string;
	}
}),

🏠 Internal

  • Enabled "importsNotUsedAsValues": "error" in tsconfig
  • Refactoring Filebrowser module
  • Refactoring Dialog module
  • Added "stylelint-config-idiomatic-order" in style linter
  • Added "en" bundle without another languages.
  • Replaced Config system. You can change default setting in you extensions.
// before
const a = new Jodit();
a.options.allowResizeY; // true
Jodit.defaultOptions.allowResizeY = false;
a.options.allowResizeY; // true

// Now
const a = new Jodit();
a.options.allowResizeY; // true
Jodit.defaultOptions.allowResizeY = false;
a.options.allowResizeY; // false
  • Added promisify mode in debounce and throttle decorators.
  • Removed src/core/ui/form/validators/key-validator.ts.
  • Added Async.requestIdlePromise method.
  • Removed Helpers.extend method.
  • Added Helpers.loadImage method.
  • Changed render method in state/ui system.
// Before
@component()
class UIBtn extends UIElement {
	className() {
		return 'UIBtn';
	}

	createContainer() {
		const button = this.j.c.element('button');
		button.style.color = 'red';

		button.classList.add(this.getFullElName('button'))

		this.j.e.on('click', button, this.onClick);
		return button;
	}

	@autobind
	onClick() {
		alert('click');
	}
}

// Now
@component()
class UIBtn extends UIElement {
	className() {
		return 'UIBtn';
	}

	render() {
		return `<button class="&__button" style="color:red"></button>`;
	}

	@watch('container:click')
	onClick() {
		alert('click');
	}
}

and styles

.jodit-ui-btn__button {
	border: 1px solid #ccc;
}