@ckeditor/ckeditor5-html-support 47.6.1 → 48.0.0-alpha.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.
Files changed (208) hide show
  1. package/LICENSE.md +1 -1
  2. package/ckeditor5-metadata.json +6 -6
  3. package/{src → dist}/converters.d.ts +2 -2
  4. package/{src → dist}/datafilter.d.ts +3 -3
  5. package/{src → dist}/dataschema.d.ts +2 -2
  6. package/{src → dist}/emptyblock.d.ts +1 -1
  7. package/{src → dist}/fullpage.d.ts +1 -1
  8. package/{src → dist}/generalhtmlsupport.d.ts +3 -3
  9. package/{src → dist}/generalhtmlsupportconfig.d.ts +1 -1
  10. package/{src → dist}/htmlcomment.d.ts +2 -2
  11. package/{src → dist}/htmlpagedataprocessor.d.ts +1 -1
  12. package/dist/index-editor.css +29 -29
  13. package/dist/index.css +30 -40
  14. package/dist/index.css.map +1 -1
  15. package/dist/index.js +29 -8
  16. package/dist/index.js.map +1 -1
  17. package/{src → dist}/integrations/codeblock.d.ts +1 -1
  18. package/{src → dist}/integrations/customelement.d.ts +1 -1
  19. package/{src → dist}/integrations/dualcontent.d.ts +1 -1
  20. package/{src → dist}/integrations/heading.d.ts +2 -2
  21. package/{src → dist}/integrations/horizontalline.d.ts +1 -1
  22. package/{src → dist}/integrations/iframe.d.ts +1 -1
  23. package/{src → dist}/integrations/image.d.ts +1 -1
  24. package/{src → dist}/integrations/integrationutils.d.ts +1 -1
  25. package/{src → dist}/integrations/list.d.ts +1 -1
  26. package/{src → dist}/integrations/mediaembed.d.ts +1 -1
  27. package/{src → dist}/integrations/script.d.ts +1 -1
  28. package/{src → dist}/integrations/style.d.ts +1 -1
  29. package/{src → dist}/integrations/table.d.ts +1 -1
  30. package/{src → dist}/schemadefinitions.d.ts +2 -2
  31. package/{src → dist}/utils.d.ts +1 -1
  32. package/package.json +30 -53
  33. package/build/html-support.js +0 -5
  34. package/build/translations/af.js +0 -1
  35. package/build/translations/ar.js +0 -1
  36. package/build/translations/ast.js +0 -1
  37. package/build/translations/az.js +0 -1
  38. package/build/translations/be.js +0 -1
  39. package/build/translations/bg.js +0 -1
  40. package/build/translations/bn.js +0 -1
  41. package/build/translations/bs.js +0 -1
  42. package/build/translations/ca.js +0 -1
  43. package/build/translations/cs.js +0 -1
  44. package/build/translations/da.js +0 -1
  45. package/build/translations/de-ch.js +0 -1
  46. package/build/translations/de.js +0 -1
  47. package/build/translations/el.js +0 -1
  48. package/build/translations/en-au.js +0 -1
  49. package/build/translations/en-gb.js +0 -1
  50. package/build/translations/eo.js +0 -1
  51. package/build/translations/es-co.js +0 -1
  52. package/build/translations/es.js +0 -1
  53. package/build/translations/et.js +0 -1
  54. package/build/translations/eu.js +0 -1
  55. package/build/translations/fa.js +0 -1
  56. package/build/translations/fi.js +0 -1
  57. package/build/translations/fr.js +0 -1
  58. package/build/translations/gl.js +0 -1
  59. package/build/translations/gu.js +0 -1
  60. package/build/translations/he.js +0 -1
  61. package/build/translations/hi.js +0 -1
  62. package/build/translations/hr.js +0 -1
  63. package/build/translations/hu.js +0 -1
  64. package/build/translations/hy.js +0 -1
  65. package/build/translations/id.js +0 -1
  66. package/build/translations/it.js +0 -1
  67. package/build/translations/ja.js +0 -1
  68. package/build/translations/jv.js +0 -1
  69. package/build/translations/kk.js +0 -1
  70. package/build/translations/km.js +0 -1
  71. package/build/translations/kn.js +0 -1
  72. package/build/translations/ko.js +0 -1
  73. package/build/translations/ku.js +0 -1
  74. package/build/translations/lt.js +0 -1
  75. package/build/translations/lv.js +0 -1
  76. package/build/translations/ms.js +0 -1
  77. package/build/translations/nb.js +0 -1
  78. package/build/translations/ne.js +0 -1
  79. package/build/translations/nl.js +0 -1
  80. package/build/translations/no.js +0 -1
  81. package/build/translations/oc.js +0 -1
  82. package/build/translations/pl.js +0 -1
  83. package/build/translations/pt-br.js +0 -1
  84. package/build/translations/pt.js +0 -1
  85. package/build/translations/ro.js +0 -1
  86. package/build/translations/ru.js +0 -1
  87. package/build/translations/si.js +0 -1
  88. package/build/translations/sk.js +0 -1
  89. package/build/translations/sl.js +0 -1
  90. package/build/translations/sq.js +0 -1
  91. package/build/translations/sr-latn.js +0 -1
  92. package/build/translations/sr.js +0 -1
  93. package/build/translations/sv.js +0 -1
  94. package/build/translations/th.js +0 -1
  95. package/build/translations/ti.js +0 -1
  96. package/build/translations/tk.js +0 -1
  97. package/build/translations/tr.js +0 -1
  98. package/build/translations/tt.js +0 -1
  99. package/build/translations/ug.js +0 -1
  100. package/build/translations/uk.js +0 -1
  101. package/build/translations/ur.js +0 -1
  102. package/build/translations/uz.js +0 -1
  103. package/build/translations/vi.js +0 -1
  104. package/build/translations/zh-cn.js +0 -1
  105. package/build/translations/zh.js +0 -1
  106. package/lang/contexts.json +0 -3
  107. package/lang/translations/af.po +0 -16
  108. package/lang/translations/ar.po +0 -16
  109. package/lang/translations/ast.po +0 -16
  110. package/lang/translations/az.po +0 -16
  111. package/lang/translations/be.po +0 -16
  112. package/lang/translations/bg.po +0 -16
  113. package/lang/translations/bn.po +0 -16
  114. package/lang/translations/bs.po +0 -16
  115. package/lang/translations/ca.po +0 -16
  116. package/lang/translations/cs.po +0 -16
  117. package/lang/translations/da.po +0 -16
  118. package/lang/translations/de-ch.po +0 -16
  119. package/lang/translations/de.po +0 -16
  120. package/lang/translations/el.po +0 -16
  121. package/lang/translations/en-au.po +0 -16
  122. package/lang/translations/en-gb.po +0 -16
  123. package/lang/translations/en.po +0 -16
  124. package/lang/translations/eo.po +0 -16
  125. package/lang/translations/es-co.po +0 -16
  126. package/lang/translations/es.po +0 -16
  127. package/lang/translations/et.po +0 -16
  128. package/lang/translations/eu.po +0 -16
  129. package/lang/translations/fa.po +0 -16
  130. package/lang/translations/fi.po +0 -16
  131. package/lang/translations/fr.po +0 -16
  132. package/lang/translations/gl.po +0 -16
  133. package/lang/translations/gu.po +0 -16
  134. package/lang/translations/he.po +0 -16
  135. package/lang/translations/hi.po +0 -16
  136. package/lang/translations/hr.po +0 -16
  137. package/lang/translations/hu.po +0 -16
  138. package/lang/translations/hy.po +0 -16
  139. package/lang/translations/id.po +0 -16
  140. package/lang/translations/it.po +0 -16
  141. package/lang/translations/ja.po +0 -16
  142. package/lang/translations/jv.po +0 -16
  143. package/lang/translations/kk.po +0 -16
  144. package/lang/translations/km.po +0 -16
  145. package/lang/translations/kn.po +0 -16
  146. package/lang/translations/ko.po +0 -16
  147. package/lang/translations/ku.po +0 -16
  148. package/lang/translations/lt.po +0 -16
  149. package/lang/translations/lv.po +0 -16
  150. package/lang/translations/ms.po +0 -16
  151. package/lang/translations/nb.po +0 -16
  152. package/lang/translations/ne.po +0 -16
  153. package/lang/translations/nl.po +0 -16
  154. package/lang/translations/no.po +0 -16
  155. package/lang/translations/oc.po +0 -16
  156. package/lang/translations/pl.po +0 -16
  157. package/lang/translations/pt-br.po +0 -16
  158. package/lang/translations/pt.po +0 -16
  159. package/lang/translations/ro.po +0 -16
  160. package/lang/translations/ru.po +0 -16
  161. package/lang/translations/si.po +0 -16
  162. package/lang/translations/sk.po +0 -16
  163. package/lang/translations/sl.po +0 -16
  164. package/lang/translations/sq.po +0 -16
  165. package/lang/translations/sr-latn.po +0 -16
  166. package/lang/translations/sr.po +0 -16
  167. package/lang/translations/sv.po +0 -16
  168. package/lang/translations/th.po +0 -16
  169. package/lang/translations/ti.po +0 -16
  170. package/lang/translations/tk.po +0 -16
  171. package/lang/translations/tr.po +0 -16
  172. package/lang/translations/tt.po +0 -16
  173. package/lang/translations/ug.po +0 -16
  174. package/lang/translations/uk.po +0 -16
  175. package/lang/translations/ur.po +0 -16
  176. package/lang/translations/uz.po +0 -16
  177. package/lang/translations/vi.po +0 -16
  178. package/lang/translations/zh-cn.po +0 -16
  179. package/lang/translations/zh.po +0 -16
  180. package/src/augmentation.js +0 -5
  181. package/src/converters.js +0 -190
  182. package/src/datafilter.js +0 -837
  183. package/src/dataschema.js +0 -199
  184. package/src/emptyblock.js +0 -146
  185. package/src/fullpage.js +0 -184
  186. package/src/generalhtmlsupport.js +0 -257
  187. package/src/generalhtmlsupportconfig.js +0 -5
  188. package/src/htmlcomment.js +0 -225
  189. package/src/htmlpagedataprocessor.js +0 -70
  190. package/src/index.js +0 -31
  191. package/src/integrations/codeblock.js +0 -107
  192. package/src/integrations/customelement.js +0 -166
  193. package/src/integrations/dualcontent.js +0 -126
  194. package/src/integrations/heading.js +0 -72
  195. package/src/integrations/horizontalline.js +0 -80
  196. package/src/integrations/iframe.js +0 -76
  197. package/src/integrations/image.js +0 -195
  198. package/src/integrations/integrationutils.js +0 -21
  199. package/src/integrations/list.js +0 -185
  200. package/src/integrations/mediaembed.js +0 -125
  201. package/src/integrations/script.js +0 -66
  202. package/src/integrations/style.js +0 -66
  203. package/src/integrations/table.js +0 -209
  204. package/src/schemadefinitions.js +0 -979
  205. package/src/utils.js +0 -169
  206. package/theme/datafilter.css +0 -56
  207. /package/{src → dist}/augmentation.d.ts +0 -0
  208. /package/{src → dist}/index.d.ts +0 -0
@@ -1,16 +0,0 @@
1
- # Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
2
- #
3
- # Want to contribute to this file? Submit your changes via a GitHub Pull Request.
4
- #
5
- # Check out the official contributor's guide:
6
- # https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html
7
- #
8
- msgid ""
9
- msgstr ""
10
- "Language: ug\n"
11
- "Plural-Forms: nplurals=1; plural=0;\n"
12
- "Content-Type: text/plain; charset=UTF-8\n"
13
-
14
- msgctxt "A label describing an HTML object widget."
15
- msgid "HTML object"
16
- msgstr "HTML جىسىم"
@@ -1,16 +0,0 @@
1
- # Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
2
- #
3
- # Want to contribute to this file? Submit your changes via a GitHub Pull Request.
4
- #
5
- # Check out the official contributor's guide:
6
- # https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html
7
- #
8
- msgid ""
9
- msgstr ""
10
- "Language: uk\n"
11
- "Plural-Forms: nplurals=3; plural=(n % 10 == 1 && n % 100 != 11 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2);\n"
12
- "Content-Type: text/plain; charset=UTF-8\n"
13
-
14
- msgctxt "A label describing an HTML object widget."
15
- msgid "HTML object"
16
- msgstr "HTML об'єкт"
@@ -1,16 +0,0 @@
1
- # Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
2
- #
3
- # Want to contribute to this file? Submit your changes via a GitHub Pull Request.
4
- #
5
- # Check out the official contributor's guide:
6
- # https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html
7
- #
8
- msgid ""
9
- msgstr ""
10
- "Language: ur\n"
11
- "Plural-Forms: nplurals=2; plural=(n != 1);\n"
12
- "Content-Type: text/plain; charset=UTF-8\n"
13
-
14
- msgctxt "A label describing an HTML object widget."
15
- msgid "HTML object"
16
- msgstr "ایچ ٹی ایم ایل آبجیکٹ"
@@ -1,16 +0,0 @@
1
- # Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
2
- #
3
- # Want to contribute to this file? Submit your changes via a GitHub Pull Request.
4
- #
5
- # Check out the official contributor's guide:
6
- # https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html
7
- #
8
- msgid ""
9
- msgstr ""
10
- "Language: uz\n"
11
- "Plural-Forms: nplurals=2; plural=(n > 1);\n"
12
- "Content-Type: text/plain; charset=UTF-8\n"
13
-
14
- msgctxt "A label describing an HTML object widget."
15
- msgid "HTML object"
16
- msgstr ""
@@ -1,16 +0,0 @@
1
- # Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
2
- #
3
- # Want to contribute to this file? Submit your changes via a GitHub Pull Request.
4
- #
5
- # Check out the official contributor's guide:
6
- # https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html
7
- #
8
- msgid ""
9
- msgstr ""
10
- "Language: vi\n"
11
- "Plural-Forms: nplurals=1; plural=0;\n"
12
- "Content-Type: text/plain; charset=UTF-8\n"
13
-
14
- msgctxt "A label describing an HTML object widget."
15
- msgid "HTML object"
16
- msgstr "Đối tượng HTML"
@@ -1,16 +0,0 @@
1
- # Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
2
- #
3
- # Want to contribute to this file? Submit your changes via a GitHub Pull Request.
4
- #
5
- # Check out the official contributor's guide:
6
- # https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html
7
- #
8
- msgid ""
9
- msgstr ""
10
- "Language: zh_CN\n"
11
- "Plural-Forms: nplurals=1; plural=0;\n"
12
- "Content-Type: text/plain; charset=UTF-8\n"
13
-
14
- msgctxt "A label describing an HTML object widget."
15
- msgid "HTML object"
16
- msgstr "HTML对象"
@@ -1,16 +0,0 @@
1
- # Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
2
- #
3
- # Want to contribute to this file? Submit your changes via a GitHub Pull Request.
4
- #
5
- # Check out the official contributor's guide:
6
- # https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html
7
- #
8
- msgid ""
9
- msgstr ""
10
- "Language: zh_TW\n"
11
- "Plural-Forms: nplurals=1; plural=0;\n"
12
- "Content-Type: text/plain; charset=UTF-8\n"
13
-
14
- msgctxt "A label describing an HTML object widget."
15
- msgid "HTML object"
16
- msgstr "HTML 物件"
@@ -1,5 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
5
- export {};
package/src/converters.js DELETED
@@ -1,190 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
5
- import { toWidget } from 'ckeditor5/src/widget.js';
6
- import { setViewAttributes, mergeViewElementAttributes, updateViewAttributes, getHtmlAttributeName } from './utils.js';
7
- /**
8
- * View-to-model conversion helper for object elements.
9
- *
10
- * Preserves object element content in `htmlContent` attribute.
11
- *
12
- * @returns Returns a conversion callback.
13
- * @internal
14
- */
15
- export function viewToModelObjectConverter({ model: modelName }) {
16
- return (viewElement, conversionApi) => {
17
- // Let's keep element HTML and its attributes, so we can rebuild element in downcast conversions.
18
- return conversionApi.writer.createElement(modelName, {
19
- htmlContent: viewElement.getCustomProperty('$rawContent')
20
- });
21
- };
22
- }
23
- /**
24
- * Conversion helper converting an object element to an HTML object widget.
25
- *
26
- * @returns Returns a conversion callback.
27
- * @internal
28
- */
29
- export function toObjectWidgetConverter(editor, { view: viewName, isInline }) {
30
- const t = editor.t;
31
- return (modelElement, { writer }) => {
32
- const widgetLabel = t('HTML object');
33
- const viewElement = createObjectView(viewName, modelElement, writer);
34
- const viewAttributes = modelElement.getAttribute(getHtmlAttributeName(viewName));
35
- writer.addClass('html-object-embed__content', viewElement);
36
- if (viewAttributes) {
37
- setViewAttributes(writer, viewAttributes, viewElement);
38
- }
39
- // Widget cannot be a raw element because the widget system would not be able
40
- // to add its UI to it. Thus, we need separate view container.
41
- const viewContainer = writer.createContainerElement(isInline ? 'span' : 'div', {
42
- class: 'html-object-embed',
43
- 'data-html-object-embed-label': widgetLabel
44
- }, viewElement);
45
- return toWidget(viewContainer, writer, { label: widgetLabel });
46
- };
47
- }
48
- /**
49
- * Creates object view element from the given model element.
50
- *
51
- * @internal
52
- */
53
- export function createObjectView(viewName, modelElement, writer) {
54
- return writer.createRawElement(viewName, null, (domElement, domConverter) => {
55
- domConverter.setContentOf(domElement, modelElement.getAttribute('htmlContent'));
56
- });
57
- }
58
- /**
59
- * View-to-attribute conversion helper preserving inline element attributes on `$text`.
60
- *
61
- * @returns Returns a conversion callback.
62
- * @internal
63
- */
64
- export function viewToAttributeInlineConverter({ view: viewName, model: attributeKey, allowEmpty }, dataFilter) {
65
- return dispatcher => {
66
- dispatcher.on(`element:${viewName}`, (evt, data, conversionApi) => {
67
- let viewAttributes = dataFilter.processViewAttributes(data.viewItem, conversionApi);
68
- // Do not apply the attribute if the element itself is already consumed and there are no view attributes to store.
69
- if (!viewAttributes && !conversionApi.consumable.test(data.viewItem, { name: true })) {
70
- return;
71
- }
72
- // Otherwise, we might need to convert it to an empty object just to preserve element itself,
73
- // for example `<cite>` => <$text htmlCite="{}">.
74
- viewAttributes = viewAttributes || {};
75
- // Consume the element itself if it wasn't consumed by any other converter.
76
- conversionApi.consumable.consume(data.viewItem, { name: true });
77
- // Since we are converting to attribute we need a range on which we will set the attribute.
78
- // If the range is not created yet, we will create it.
79
- if (!data.modelRange) {
80
- data = Object.assign(data, conversionApi.convertChildren(data.viewItem, data.modelCursor));
81
- }
82
- // Convert empty inline element if allowed and has any attributes.
83
- if (allowEmpty && data.modelRange.isCollapsed && Object.keys(viewAttributes).length) {
84
- const modelElement = conversionApi.writer.createElement('htmlEmptyElement');
85
- if (!conversionApi.safeInsert(modelElement, data.modelCursor)) {
86
- return;
87
- }
88
- const parts = conversionApi.getSplitParts(modelElement);
89
- data.modelRange = conversionApi.writer.createRange(data.modelRange.start, conversionApi.writer.createPositionAfter(parts[parts.length - 1]));
90
- conversionApi.updateConversionResult(modelElement, data);
91
- setAttributeOnItem(modelElement, viewAttributes, conversionApi);
92
- return;
93
- }
94
- // Set attribute on each item in range according to the schema.
95
- for (const node of data.modelRange.getItems()) {
96
- setAttributeOnItem(node, viewAttributes, conversionApi);
97
- }
98
- }, { priority: 'low' });
99
- };
100
- function setAttributeOnItem(node, viewAttributes, conversionApi) {
101
- if (conversionApi.schema.checkAttribute(node, attributeKey)) {
102
- // Node's children are converted recursively, so node can already include model attribute.
103
- // We want to extend it, not replace.
104
- const nodeAttributes = node.getAttribute(attributeKey);
105
- const attributesToAdd = mergeViewElementAttributes(viewAttributes, nodeAttributes || {});
106
- conversionApi.writer.setAttribute(attributeKey, attributesToAdd, node);
107
- }
108
- }
109
- }
110
- /**
111
- * Conversion helper converting an empty inline model element to an HTML element or widget.
112
- *
113
- * @internal
114
- */
115
- export function emptyInlineModelElementToViewConverter({ model: attributeKey, view: viewName }, asWidget) {
116
- return (item, { writer, consumable }) => {
117
- if (!item.hasAttribute(attributeKey)) {
118
- return null;
119
- }
120
- const viewElement = writer.createContainerElement(viewName);
121
- const attributeValue = item.getAttribute(attributeKey);
122
- consumable.consume(item, `attribute:${attributeKey}`);
123
- setViewAttributes(writer, attributeValue, viewElement);
124
- viewElement.getFillerOffset = () => null;
125
- return asWidget ? toWidget(viewElement, writer) : viewElement;
126
- };
127
- }
128
- /**
129
- * Attribute-to-view conversion helper applying attributes to view element preserved on `$text`.
130
- *
131
- * @returns Returns a conversion callback.
132
- * @internal
133
- */
134
- export function attributeToViewInlineConverter({ priority, view: viewName }) {
135
- return (attributeValue, conversionApi) => {
136
- if (!attributeValue) {
137
- return;
138
- }
139
- const { writer } = conversionApi;
140
- const viewElement = writer.createAttributeElement(viewName, null, { priority });
141
- setViewAttributes(writer, attributeValue, viewElement);
142
- return viewElement;
143
- };
144
- }
145
- /**
146
- * View-to-model conversion helper preserving allowed attributes on block element.
147
- *
148
- * All matched attributes will be preserved on `html*Attributes` attribute.
149
- *
150
- * @returns Returns a conversion callback.
151
- * @internal
152
- */
153
- export function viewToModelBlockAttributeConverter({ view: viewName }, dataFilter) {
154
- return (dispatcher) => {
155
- dispatcher.on(`element:${viewName}`, (evt, data, conversionApi) => {
156
- // Converting an attribute of an element that has not been converted to anything does not make sense
157
- // because there will be nowhere to set that attribute on. At this stage, the element should've already
158
- // been converted. A collapsed range can show up in to-do lists (<input>) or complex widgets (e.g. table).
159
- // (https://github.com/ckeditor/ckeditor5/issues/11000).
160
- if (!data.modelRange || data.modelRange.isCollapsed) {
161
- return;
162
- }
163
- const viewAttributes = dataFilter.processViewAttributes(data.viewItem, conversionApi);
164
- if (!viewAttributes) {
165
- return;
166
- }
167
- conversionApi.writer.setAttribute(getHtmlAttributeName(data.viewItem.name), viewAttributes, data.modelRange);
168
- }, { priority: 'low' });
169
- };
170
- }
171
- /**
172
- * Model-to-view conversion helper applying attributes preserved in `html*Attributes` attribute
173
- * for block elements.
174
- *
175
- * @returns Returns a conversion callback.
176
- * @internal
177
- */
178
- export function modelToViewBlockAttributeConverter({ view: viewName, model: modelName }) {
179
- return (dispatcher) => {
180
- dispatcher.on(`attribute:${getHtmlAttributeName(viewName)}:${modelName}`, (evt, data, conversionApi) => {
181
- if (!conversionApi.consumable.consume(data.item, evt.name)) {
182
- return;
183
- }
184
- const { attributeOldValue, attributeNewValue } = data;
185
- const viewWriter = conversionApi.writer;
186
- const viewElement = conversionApi.mapper.toViewElement(data.item);
187
- updateViewAttributes(viewWriter, attributeOldValue, attributeNewValue, viewElement);
188
- });
189
- };
190
- }