@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.
- package/LICENSE.md +1 -1
- package/ckeditor5-metadata.json +6 -6
- package/{src → dist}/converters.d.ts +2 -2
- package/{src → dist}/datafilter.d.ts +3 -3
- package/{src → dist}/dataschema.d.ts +2 -2
- package/{src → dist}/emptyblock.d.ts +1 -1
- package/{src → dist}/fullpage.d.ts +1 -1
- package/{src → dist}/generalhtmlsupport.d.ts +3 -3
- package/{src → dist}/generalhtmlsupportconfig.d.ts +1 -1
- package/{src → dist}/htmlcomment.d.ts +2 -2
- package/{src → dist}/htmlpagedataprocessor.d.ts +1 -1
- package/dist/index-editor.css +29 -29
- package/dist/index.css +30 -40
- package/dist/index.css.map +1 -1
- package/dist/index.js +29 -8
- package/dist/index.js.map +1 -1
- package/{src → dist}/integrations/codeblock.d.ts +1 -1
- package/{src → dist}/integrations/customelement.d.ts +1 -1
- package/{src → dist}/integrations/dualcontent.d.ts +1 -1
- package/{src → dist}/integrations/heading.d.ts +2 -2
- package/{src → dist}/integrations/horizontalline.d.ts +1 -1
- package/{src → dist}/integrations/iframe.d.ts +1 -1
- package/{src → dist}/integrations/image.d.ts +1 -1
- package/{src → dist}/integrations/integrationutils.d.ts +1 -1
- package/{src → dist}/integrations/list.d.ts +1 -1
- package/{src → dist}/integrations/mediaembed.d.ts +1 -1
- package/{src → dist}/integrations/script.d.ts +1 -1
- package/{src → dist}/integrations/style.d.ts +1 -1
- package/{src → dist}/integrations/table.d.ts +1 -1
- package/{src → dist}/schemadefinitions.d.ts +2 -2
- package/{src → dist}/utils.d.ts +1 -1
- package/package.json +30 -53
- package/build/html-support.js +0 -5
- package/build/translations/af.js +0 -1
- package/build/translations/ar.js +0 -1
- package/build/translations/ast.js +0 -1
- package/build/translations/az.js +0 -1
- package/build/translations/be.js +0 -1
- package/build/translations/bg.js +0 -1
- package/build/translations/bn.js +0 -1
- package/build/translations/bs.js +0 -1
- package/build/translations/ca.js +0 -1
- package/build/translations/cs.js +0 -1
- package/build/translations/da.js +0 -1
- package/build/translations/de-ch.js +0 -1
- package/build/translations/de.js +0 -1
- package/build/translations/el.js +0 -1
- package/build/translations/en-au.js +0 -1
- package/build/translations/en-gb.js +0 -1
- package/build/translations/eo.js +0 -1
- package/build/translations/es-co.js +0 -1
- package/build/translations/es.js +0 -1
- package/build/translations/et.js +0 -1
- package/build/translations/eu.js +0 -1
- package/build/translations/fa.js +0 -1
- package/build/translations/fi.js +0 -1
- package/build/translations/fr.js +0 -1
- package/build/translations/gl.js +0 -1
- package/build/translations/gu.js +0 -1
- package/build/translations/he.js +0 -1
- package/build/translations/hi.js +0 -1
- package/build/translations/hr.js +0 -1
- package/build/translations/hu.js +0 -1
- package/build/translations/hy.js +0 -1
- package/build/translations/id.js +0 -1
- package/build/translations/it.js +0 -1
- package/build/translations/ja.js +0 -1
- package/build/translations/jv.js +0 -1
- package/build/translations/kk.js +0 -1
- package/build/translations/km.js +0 -1
- package/build/translations/kn.js +0 -1
- package/build/translations/ko.js +0 -1
- package/build/translations/ku.js +0 -1
- package/build/translations/lt.js +0 -1
- package/build/translations/lv.js +0 -1
- package/build/translations/ms.js +0 -1
- package/build/translations/nb.js +0 -1
- package/build/translations/ne.js +0 -1
- package/build/translations/nl.js +0 -1
- package/build/translations/no.js +0 -1
- package/build/translations/oc.js +0 -1
- package/build/translations/pl.js +0 -1
- package/build/translations/pt-br.js +0 -1
- package/build/translations/pt.js +0 -1
- package/build/translations/ro.js +0 -1
- package/build/translations/ru.js +0 -1
- package/build/translations/si.js +0 -1
- package/build/translations/sk.js +0 -1
- package/build/translations/sl.js +0 -1
- package/build/translations/sq.js +0 -1
- package/build/translations/sr-latn.js +0 -1
- package/build/translations/sr.js +0 -1
- package/build/translations/sv.js +0 -1
- package/build/translations/th.js +0 -1
- package/build/translations/ti.js +0 -1
- package/build/translations/tk.js +0 -1
- package/build/translations/tr.js +0 -1
- package/build/translations/tt.js +0 -1
- package/build/translations/ug.js +0 -1
- package/build/translations/uk.js +0 -1
- package/build/translations/ur.js +0 -1
- package/build/translations/uz.js +0 -1
- package/build/translations/vi.js +0 -1
- package/build/translations/zh-cn.js +0 -1
- package/build/translations/zh.js +0 -1
- package/lang/contexts.json +0 -3
- package/lang/translations/af.po +0 -16
- package/lang/translations/ar.po +0 -16
- package/lang/translations/ast.po +0 -16
- package/lang/translations/az.po +0 -16
- package/lang/translations/be.po +0 -16
- package/lang/translations/bg.po +0 -16
- package/lang/translations/bn.po +0 -16
- package/lang/translations/bs.po +0 -16
- package/lang/translations/ca.po +0 -16
- package/lang/translations/cs.po +0 -16
- package/lang/translations/da.po +0 -16
- package/lang/translations/de-ch.po +0 -16
- package/lang/translations/de.po +0 -16
- package/lang/translations/el.po +0 -16
- package/lang/translations/en-au.po +0 -16
- package/lang/translations/en-gb.po +0 -16
- package/lang/translations/en.po +0 -16
- package/lang/translations/eo.po +0 -16
- package/lang/translations/es-co.po +0 -16
- package/lang/translations/es.po +0 -16
- package/lang/translations/et.po +0 -16
- package/lang/translations/eu.po +0 -16
- package/lang/translations/fa.po +0 -16
- package/lang/translations/fi.po +0 -16
- package/lang/translations/fr.po +0 -16
- package/lang/translations/gl.po +0 -16
- package/lang/translations/gu.po +0 -16
- package/lang/translations/he.po +0 -16
- package/lang/translations/hi.po +0 -16
- package/lang/translations/hr.po +0 -16
- package/lang/translations/hu.po +0 -16
- package/lang/translations/hy.po +0 -16
- package/lang/translations/id.po +0 -16
- package/lang/translations/it.po +0 -16
- package/lang/translations/ja.po +0 -16
- package/lang/translations/jv.po +0 -16
- package/lang/translations/kk.po +0 -16
- package/lang/translations/km.po +0 -16
- package/lang/translations/kn.po +0 -16
- package/lang/translations/ko.po +0 -16
- package/lang/translations/ku.po +0 -16
- package/lang/translations/lt.po +0 -16
- package/lang/translations/lv.po +0 -16
- package/lang/translations/ms.po +0 -16
- package/lang/translations/nb.po +0 -16
- package/lang/translations/ne.po +0 -16
- package/lang/translations/nl.po +0 -16
- package/lang/translations/no.po +0 -16
- package/lang/translations/oc.po +0 -16
- package/lang/translations/pl.po +0 -16
- package/lang/translations/pt-br.po +0 -16
- package/lang/translations/pt.po +0 -16
- package/lang/translations/ro.po +0 -16
- package/lang/translations/ru.po +0 -16
- package/lang/translations/si.po +0 -16
- package/lang/translations/sk.po +0 -16
- package/lang/translations/sl.po +0 -16
- package/lang/translations/sq.po +0 -16
- package/lang/translations/sr-latn.po +0 -16
- package/lang/translations/sr.po +0 -16
- package/lang/translations/sv.po +0 -16
- package/lang/translations/th.po +0 -16
- package/lang/translations/ti.po +0 -16
- package/lang/translations/tk.po +0 -16
- package/lang/translations/tr.po +0 -16
- package/lang/translations/tt.po +0 -16
- package/lang/translations/ug.po +0 -16
- package/lang/translations/uk.po +0 -16
- package/lang/translations/ur.po +0 -16
- package/lang/translations/uz.po +0 -16
- package/lang/translations/vi.po +0 -16
- package/lang/translations/zh-cn.po +0 -16
- package/lang/translations/zh.po +0 -16
- package/src/augmentation.js +0 -5
- package/src/converters.js +0 -190
- package/src/datafilter.js +0 -837
- package/src/dataschema.js +0 -199
- package/src/emptyblock.js +0 -146
- package/src/fullpage.js +0 -184
- package/src/generalhtmlsupport.js +0 -257
- package/src/generalhtmlsupportconfig.js +0 -5
- package/src/htmlcomment.js +0 -225
- package/src/htmlpagedataprocessor.js +0 -70
- package/src/index.js +0 -31
- package/src/integrations/codeblock.js +0 -107
- package/src/integrations/customelement.js +0 -166
- package/src/integrations/dualcontent.js +0 -126
- package/src/integrations/heading.js +0 -72
- package/src/integrations/horizontalline.js +0 -80
- package/src/integrations/iframe.js +0 -76
- package/src/integrations/image.js +0 -195
- package/src/integrations/integrationutils.js +0 -21
- package/src/integrations/list.js +0 -185
- package/src/integrations/mediaembed.js +0 -125
- package/src/integrations/script.js +0 -66
- package/src/integrations/style.js +0 -66
- package/src/integrations/table.js +0 -209
- package/src/schemadefinitions.js +0 -979
- package/src/utils.js +0 -169
- package/theme/datafilter.css +0 -56
- /package/{src → dist}/augmentation.d.ts +0 -0
- /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
|
-
}
|
package/theme/datafilter.css
DELETED
|
@@ -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
|
/package/{src → dist}/index.d.ts
RENAMED
|
File without changes
|