@ckeditor/ckeditor5-engine 41.4.0-alpha.0 → 41.4.0

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.
@@ -115,3 +115,5 @@ export * from './view/styles/border.js';
115
115
  export * from './view/styles/margin.js';
116
116
  export * from './view/styles/padding.js';
117
117
  export * from './view/styles/utils.js';
118
+ export { getData as _getModelData, setData as _setModelData, parse as _parseModel, stringify as _stringifyModel } from './dev-utils/model.js';
119
+ export { getData as _getViewData, setData as _setViewData, parse as _parseView, stringify as _stringifyView } from './dev-utils/view.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-engine",
3
- "version": "41.4.0-alpha.0",
3
+ "version": "41.4.0",
4
4
  "description": "The editing engine of CKEditor 5 – the best browser-based rich text editor.",
5
5
  "keywords": [
6
6
  "wysiwyg",
@@ -24,7 +24,7 @@
24
24
  "type": "module",
25
25
  "main": "src/index.js",
26
26
  "dependencies": {
27
- "@ckeditor/ckeditor5-utils": "41.4.0-alpha.0",
27
+ "@ckeditor/ckeditor5-utils": "41.4.0",
28
28
  "lodash-es": "4.17.21"
29
29
  },
30
30
  "author": "CKSource (http://cksource.com/)",
package/src/index.d.ts CHANGED
@@ -111,3 +111,5 @@ export * from './view/styles/border.js';
111
111
  export * from './view/styles/margin.js';
112
112
  export * from './view/styles/padding.js';
113
113
  export * from './view/styles/utils.js';
114
+ export { getData as _getModelData, setData as _setModelData, parse as _parseModel, stringify as _stringifyModel } from './dev-utils/model.js';
115
+ export { getData as _getViewData, setData as _setViewData, parse as _parseView, stringify as _stringifyView } from './dev-utils/view.js';
package/src/index.js CHANGED
@@ -75,3 +75,6 @@ export * from './view/styles/border.js';
75
75
  export * from './view/styles/margin.js';
76
76
  export * from './view/styles/padding.js';
77
77
  export * from './view/styles/utils.js';
78
+ // Development / testing utils.
79
+ export { getData as _getModelData, setData as _setModelData, parse as _parseModel, stringify as _stringifyModel } from './dev-utils/model.js';
80
+ export { getData as _getViewData, setData as _setViewData, parse as _parseView, stringify as _stringifyView } from './dev-utils/view.js';
@@ -293,7 +293,12 @@ export default class DomConverter {
293
293
  }
294
294
  if (options.withChildren !== false) {
295
295
  for (const child of this.viewChildrenToDom(viewElementOrFragment, options)) {
296
- domElement.appendChild(child);
296
+ if (domElement instanceof HTMLTemplateElement) {
297
+ domElement.content.appendChild(child);
298
+ }
299
+ else {
300
+ domElement.appendChild(child);
301
+ }
297
302
  }
298
303
  }
299
304
  return domElement;
@@ -512,8 +517,16 @@ export default class DomConverter {
512
517
  * @returns View nodes.
513
518
  */
514
519
  *domChildrenToView(domElement, options = {}, inlineNodes = []) {
515
- for (let i = 0; i < domElement.childNodes.length; i++) {
516
- const domChild = domElement.childNodes[i];
520
+ // Get child nodes from content document fragment if element is template
521
+ let childNodes = [];
522
+ if (domElement instanceof HTMLTemplateElement) {
523
+ childNodes = [...domElement.content.childNodes];
524
+ }
525
+ else {
526
+ childNodes = [...domElement.childNodes];
527
+ }
528
+ for (let i = 0; i < childNodes.length; i++) {
529
+ const domChild = childNodes[i];
517
530
  const generator = this._domToView(domChild, options, inlineNodes);
518
531
  // Get the first yielded value or a returned value.
519
532
  const viewChild = generator.next().value;