@ckeditor/ckeditor5-html-support 41.2.0 → 41.3.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/dist/content-index.css +4 -0
- package/dist/editor-index.css +44 -0
- package/dist/index.css +63 -0
- package/dist/index.css.map +1 -0
- package/dist/index.js +4004 -0
- package/dist/index.js.map +1 -0
- package/dist/types/augmentation.d.ts +33 -0
- package/dist/types/converters.d.ts +60 -0
- package/dist/types/datafilter.d.ts +304 -0
- package/dist/types/dataschema.d.ts +183 -0
- package/dist/types/fullpage.d.ts +21 -0
- package/dist/types/generalhtmlsupport.d.ts +98 -0
- package/dist/types/generalhtmlsupportconfig.d.ts +77 -0
- package/dist/types/htmlcomment.d.ts +71 -0
- package/dist/types/htmlpagedataprocessor.d.ts +22 -0
- package/dist/types/index.d.ts +25 -0
- package/dist/types/integrations/codeblock.d.ts +23 -0
- package/dist/types/integrations/customelement.d.ts +27 -0
- package/dist/types/integrations/dualcontent.d.ts +45 -0
- package/dist/types/integrations/heading.d.ts +31 -0
- package/dist/types/integrations/image.d.ts +26 -0
- package/dist/types/integrations/integrationutils.d.ts +15 -0
- package/dist/types/integrations/list.d.ts +27 -0
- package/dist/types/integrations/mediaembed.d.ts +26 -0
- package/dist/types/integrations/script.d.ts +26 -0
- package/dist/types/integrations/style.d.ts +26 -0
- package/dist/types/integrations/table.d.ts +23 -0
- package/dist/types/schemadefinitions.d.ts +13 -0
- package/dist/types/utils.d.ts +72 -0
- package/package.json +3 -2
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module html-support/utils
|
|
7
|
+
*/
|
|
8
|
+
import type { DocumentSelection, DowncastWriter, Item, ViewElement, Writer } from 'ckeditor5/src/engine.js';
|
|
9
|
+
export interface GHSViewAttributes {
|
|
10
|
+
attributes?: Record<string, unknown>;
|
|
11
|
+
classes?: Array<string>;
|
|
12
|
+
styles?: Record<string, string>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Helper function for the downcast converter. Updates attributes on the given view element.
|
|
16
|
+
*
|
|
17
|
+
* @param writer The view writer.
|
|
18
|
+
* @param oldViewAttributes The previous GHS attribute value.
|
|
19
|
+
* @param newViewAttributes The current GHS attribute value.
|
|
20
|
+
* @param viewElement The view element to update.
|
|
21
|
+
*/
|
|
22
|
+
export declare function updateViewAttributes(writer: DowncastWriter, oldViewAttributes: GHSViewAttributes, newViewAttributes: GHSViewAttributes, viewElement: ViewElement): void;
|
|
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
|
+
*/
|
|
30
|
+
export declare function setViewAttributes(writer: DowncastWriter, viewAttributes: GHSViewAttributes, viewElement: ViewElement): void;
|
|
31
|
+
/**
|
|
32
|
+
* Helper function for the downcast converter. Removes attributes on the given view element.
|
|
33
|
+
*
|
|
34
|
+
* @param writer The view writer.
|
|
35
|
+
* @param viewAttributes The GHS attribute value.
|
|
36
|
+
* @param viewElement The view element to update.
|
|
37
|
+
*/
|
|
38
|
+
export declare function removeViewAttributes(writer: DowncastWriter, viewAttributes: GHSViewAttributes, viewElement: ViewElement): void;
|
|
39
|
+
/**
|
|
40
|
+
* Merges view element attribute objects.
|
|
41
|
+
*/
|
|
42
|
+
export declare function mergeViewElementAttributes(target: GHSViewAttributes, source: GHSViewAttributes): GHSViewAttributes;
|
|
43
|
+
type ModifyGhsAttributesCallback = (t: Map<string, unknown>) => void;
|
|
44
|
+
type ModifyGhsClassesCallback = (t: Set<string>) => void;
|
|
45
|
+
type ModifyGhsStylesCallback = (t: Map<string, string>) => void;
|
|
46
|
+
/**
|
|
47
|
+
* Updates a GHS attribute on a specified item.
|
|
48
|
+
* @param callback That receives a map as an argument and should modify it (add or remove entries).
|
|
49
|
+
*/
|
|
50
|
+
export declare function modifyGhsAttribute(writer: Writer, item: Item | DocumentSelection, ghsAttributeName: string, subject: 'attributes', callback: ModifyGhsAttributesCallback): void;
|
|
51
|
+
/**
|
|
52
|
+
* Updates a GHS attribute on a specified item.
|
|
53
|
+
* @param callback That receives a set as an argument and should modify it (add or remove entries).
|
|
54
|
+
*/
|
|
55
|
+
export declare function modifyGhsAttribute(writer: Writer, item: Item | DocumentSelection, ghsAttributeName: string, subject: 'classes', callback: ModifyGhsClassesCallback): void;
|
|
56
|
+
/**
|
|
57
|
+
* Updates a GHS attribute on a specified item.
|
|
58
|
+
* @param callback That receives a map as an argument and should modify it (add or remove entries).
|
|
59
|
+
*/
|
|
60
|
+
export declare function modifyGhsAttribute(writer: Writer, item: Item | DocumentSelection, ghsAttributeName: string, subject: 'styles', callback: ModifyGhsStylesCallback): void;
|
|
61
|
+
/**
|
|
62
|
+
* Transforms passed string to PascalCase format. Examples:
|
|
63
|
+
* * `div` => `Div`
|
|
64
|
+
* * `h1` => `H1`
|
|
65
|
+
* * `table` => `Table`
|
|
66
|
+
*/
|
|
67
|
+
export declare function toPascalCase(data: string): string;
|
|
68
|
+
/**
|
|
69
|
+
* Returns the attribute name of the model element that holds raw HTML attributes.
|
|
70
|
+
*/
|
|
71
|
+
export declare function getHtmlAttributeName(viewElementName: string): string;
|
|
72
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-html-support",
|
|
3
|
-
"version": "41.
|
|
3
|
+
"version": "41.3.0-alpha.0",
|
|
4
4
|
"description": "HTML Support feature for CKEditor 5.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ckeditor",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"type": "module",
|
|
18
18
|
"main": "src/index.js",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"ckeditor5": "41.
|
|
20
|
+
"ckeditor5": "41.3.0-alpha.0",
|
|
21
21
|
"lodash-es": "4.17.21"
|
|
22
22
|
},
|
|
23
23
|
"author": "CKSource (http://cksource.com/)",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"directory": "packages/ckeditor5-html-support"
|
|
31
31
|
},
|
|
32
32
|
"files": [
|
|
33
|
+
"dist",
|
|
33
34
|
"lang",
|
|
34
35
|
"src/**/*.js",
|
|
35
36
|
"src/**/*.d.ts",
|