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/dist/elements/editor/utils/query-all-editor-editables.d.ts.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +18 -18
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/elements/editor/editor.test.ts +3 -3
- package/src/elements/editor/utils/query-all-editor-editables.ts +4 -1
package/package.json
CHANGED
|
@@ -211,11 +211,11 @@ describe('editor component', () => {
|
|
|
211
211
|
});
|
|
212
212
|
});
|
|
213
213
|
|
|
214
|
-
it('should use
|
|
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: '$
|
|
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('$
|
|
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 (
|
|
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'] || '',
|