@ckeditor/ckeditor5-html-support 47.6.1 → 48.0.0-alpha.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.
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
package/src/utils.js DELETED
@@ -1,169 +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 { startCase, cloneDeep } from 'es-toolkit/compat';
6
- /**
7
- * Helper function for the downcast converter. Updates attributes on the given view element.
8
- *
9
- * @param writer The view writer.
10
- * @param oldViewAttributes The previous GHS attribute value.
11
- * @param newViewAttributes The current GHS attribute value.
12
- * @param viewElement The view element to update.
13
- * @internal
14
- */
15
- export function updateViewAttributes(writer, oldViewAttributes, newViewAttributes, viewElement) {
16
- if (oldViewAttributes) {
17
- removeViewAttributes(writer, oldViewAttributes, viewElement);
18
- }
19
- if (newViewAttributes) {
20
- setViewAttributes(writer, newViewAttributes, viewElement);
21
- }
22
- }
23
- /**
24
- * Helper function for the downcast converter. Sets attributes on the given view element.
25
- *
26
- * @param writer The view writer.
27
- * @param viewAttributes The GHS attribute value.
28
- * @param viewElement The view element to update.
29
- * @internal
30
- */
31
- export function setViewAttributes(writer, viewAttributes, viewElement) {
32
- if (viewAttributes.attributes) {
33
- for (const [key, value] of Object.entries(viewAttributes.attributes)) {
34
- writer.setAttribute(key, value, viewElement);
35
- }
36
- }
37
- if (viewAttributes.styles) {
38
- writer.setStyle(viewAttributes.styles, viewElement);
39
- }
40
- if (viewAttributes.classes) {
41
- writer.addClass(viewAttributes.classes, viewElement);
42
- }
43
- }
44
- /**
45
- * Helper function for the downcast converter. Removes attributes on the given view element.
46
- *
47
- * @param writer The view writer.
48
- * @param viewAttributes The GHS attribute value.
49
- * @param viewElement The view element to update.
50
- * @internal
51
- */
52
- export function removeViewAttributes(writer, viewAttributes, viewElement) {
53
- if (viewAttributes.attributes) {
54
- for (const [key] of Object.entries(viewAttributes.attributes)) {
55
- writer.removeAttribute(key, viewElement);
56
- }
57
- }
58
- if (viewAttributes.styles) {
59
- for (const style of Object.keys(viewAttributes.styles)) {
60
- writer.removeStyle(style, viewElement);
61
- }
62
- }
63
- if (viewAttributes.classes) {
64
- writer.removeClass(viewAttributes.classes, viewElement);
65
- }
66
- }
67
- /**
68
- * Merges view element attribute objects.
69
- *
70
- * @internal
71
- */
72
- export function mergeViewElementAttributes(target, source) {
73
- const result = cloneDeep(target);
74
- let key = 'attributes';
75
- for (key in source) {
76
- // Merge classes.
77
- if (key == 'classes') {
78
- result[key] = Array.from(new Set([...(target[key] || []), ...source[key]]));
79
- }
80
- // Merge attributes or styles.
81
- else {
82
- result[key] = { ...target[key], ...source[key] };
83
- }
84
- }
85
- return result;
86
- }
87
- export function modifyGhsAttribute(writer, item, ghsAttributeName, subject, callback) {
88
- const oldValue = item.getAttribute(ghsAttributeName);
89
- const newValue = {};
90
- for (const kind of ['attributes', 'styles', 'classes']) {
91
- // Properties other than `subject` should be assigned from `oldValue`.
92
- if (kind != subject) {
93
- if (oldValue && oldValue[kind]) {
94
- newValue[kind] = oldValue[kind];
95
- }
96
- continue;
97
- }
98
- // `callback` should be applied on property [`subject`].
99
- if (subject == 'classes') {
100
- const values = new Set(oldValue && oldValue.classes || []);
101
- callback(values);
102
- if (values.size) {
103
- newValue[kind] = Array.from(values);
104
- }
105
- continue;
106
- }
107
- const values = new Map(Object.entries(oldValue && oldValue[kind] || {}));
108
- callback(values);
109
- if (values.size) {
110
- newValue[kind] = Object.fromEntries(values);
111
- }
112
- }
113
- if (Object.keys(newValue).length) {
114
- if (item.is('documentSelection')) {
115
- writer.setSelectionAttribute(ghsAttributeName, newValue);
116
- }
117
- else {
118
- writer.setAttribute(ghsAttributeName, newValue, item);
119
- }
120
- }
121
- else if (oldValue) {
122
- if (item.is('documentSelection')) {
123
- writer.removeSelectionAttribute(ghsAttributeName);
124
- }
125
- else {
126
- writer.removeAttribute(ghsAttributeName, item);
127
- }
128
- }
129
- }
130
- /**
131
- * Strips the `styles`, and `classes` keys from the GHS attribute value on the given item.
132
- *
133
- * @internal
134
- */
135
- export function removeFormatting(ghsAttributeName, itemRange, writer) {
136
- for (const item of itemRange.getItems({ shallow: true })) {
137
- const value = item.getAttribute(ghsAttributeName);
138
- // Copy only attributes to the new attribute value.
139
- if (value && value.attributes && Object.keys(value.attributes).length) {
140
- // But reset the GHS attribute only when there is anything more than just attributes.
141
- if (Object.keys(value).length > 1) {
142
- writer.setAttribute(ghsAttributeName, { attributes: value.attributes }, item);
143
- }
144
- }
145
- else {
146
- // There are no attributes, so remove the GHS attribute completely.
147
- writer.removeAttribute(ghsAttributeName, item);
148
- }
149
- }
150
- }
151
- /**
152
- * Transforms passed string to PascalCase format. Examples:
153
- * * `div` => `Div`
154
- * * `h1` => `H1`
155
- * * `table` => `Table`
156
- *
157
- * @internal
158
- */
159
- export function toPascalCase(data) {
160
- return startCase(data).replace(/ /g, '');
161
- }
162
- /**
163
- * Returns the attribute name of the model element that holds raw HTML attributes.
164
- *
165
- * @internal
166
- */
167
- export function getHtmlAttributeName(viewElementName) {
168
- return `html${toPascalCase(viewElementName)}Attributes`;
169
- }
@@ -1,56 +0,0 @@
1
- /*
2
- * 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
-
6
- :root {
7
- --ck-html-object-embed-unfocused-outline-width: 1px;
8
- }
9
-
10
- .ck-widget.html-object-embed {
11
- font-size: var(--ck-font-size-base);
12
- background-color: var(--ck-color-base-foreground);
13
- padding: var(--ck-spacing-small);
14
- /* Leave space for label */
15
- padding-top: calc(var(--ck-font-size-tiny) + var(--ck-spacing-large));
16
- min-width: calc(76px + var(--ck-spacing-standard));
17
-
18
- &:not(.ck-widget_selected):not(:hover) {
19
- outline: var(--ck-html-object-embed-unfocused-outline-width) dashed var(--ck-color-widget-blurred-border);
20
- }
21
-
22
- &::before {
23
- font-weight: normal;
24
- font-style: normal;
25
- position: absolute;
26
- content: attr(data-html-object-embed-label);
27
- top: 0;
28
- left: var(--ck-spacing-standard);
29
- background: hsl(0deg 0% 60%);
30
- transition: background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);
31
- padding: calc(var(--ck-spacing-tiny) + var(--ck-html-object-embed-unfocused-outline-width)) var(--ck-spacing-small) var(--ck-spacing-tiny);
32
- border-radius: 0 0 var(--ck-border-radius) var(--ck-border-radius);
33
- color: var(--ck-color-base-background);
34
- font-size: var(--ck-font-size-tiny);
35
- font-family: var(--ck-font-face);
36
- }
37
-
38
- /* Make space for label. */
39
- & .ck-widget__type-around .ck-widget__type-around__button.ck-widget__type-around__button_before {
40
- margin-left: 50px;
41
- }
42
-
43
- & .html-object-embed__content {
44
- /* Disable user interaction with embed content */
45
- pointer-events: none;
46
- }
47
- }
48
-
49
- div.ck-widget.html-object-embed {
50
- margin: 1em auto;
51
- }
52
-
53
- span.ck-widget.html-object-embed {
54
- display: inline-block;
55
- }
56
-
File without changes
File without changes