ckeditor5-blazor 1.12.0 → 1.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ckeditor5-blazor",
3
- "version": "1.12.0",
3
+ "version": "1.12.1",
4
4
  "description": "CKEditor 5 integration for Blazor",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -211,11 +211,11 @@ describe('editor component', () => {
211
211
  });
212
212
  });
213
213
 
214
- it('should use default `$root` if editable root name is not specified', async () => {
214
+ it('should use `main` root element name if editable root name is not specified', async () => {
215
215
  renderTestEditor({
216
216
  preset: createEditorPreset('decoupled'),
217
217
  content: {},
218
- rootModelElementName: '$miamia',
218
+ rootModelElementName: '$inlineRoot',
219
219
  });
220
220
 
221
221
  renderTestEditable();
@@ -223,7 +223,7 @@ describe('editor component', () => {
223
223
  const editor = await waitForTestEditor<DecoupledEditor>();
224
224
 
225
225
  await vi.waitFor(() => {
226
- expect(editor.model.document.getRoot()?.name).toEqual('$root');
226
+ expect(editor.model.document.getRoot()?.name).toEqual('$inlineRoot');
227
227
  });
228
228
  });
229
229
  });
@@ -40,7 +40,10 @@ export function queryAllEditorEditables(editorId: EditorId): Record<string, Edit
40
40
  const classicMainElement = document.querySelector<HTMLElement>(`#${editorId}_editor`);
41
41
  const rootEditorModelElement = rootEditorElement.getAttribute('data-cke-root-model-element-name');
42
42
 
43
- if (classicMainElement && !acc['main']) {
43
+ if ('main' in acc) {
44
+ acc['main'].modelElement ??= rootEditorModelElement;
45
+ }
46
+ else if (classicMainElement) {
44
47
  acc['main'] = {
45
48
  element: classicMainElement,
46
49
  content: editorContent['main'] || '',