@ckeditor/ckeditor5-engine 44.1.0 → 44.2.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/dist/index-content.css +2 -2
- package/dist/index-editor.css +2 -2
- package/dist/index.css +4 -4
- package/dist/index.css.map +1 -1
- package/dist/index.js +646 -77
- package/dist/index.js.map +1 -1
- package/package.json +23 -3
- package/src/controller/datacontroller.d.ts +1 -1
- package/src/controller/datacontroller.js +1 -1
- package/src/controller/editingcontroller.d.ts +1 -1
- package/src/controller/editingcontroller.js +1 -1
- package/src/conversion/conversion.d.ts +1 -1
- package/src/conversion/conversion.js +1 -1
- package/src/conversion/conversionhelpers.d.ts +1 -1
- package/src/conversion/conversionhelpers.js +1 -1
- package/src/conversion/downcastdispatcher.d.ts +1 -1
- package/src/conversion/downcastdispatcher.js +1 -1
- package/src/conversion/downcasthelpers.d.ts +1 -1
- package/src/conversion/downcasthelpers.js +1 -1
- package/src/conversion/mapper.d.ts +249 -20
- package/src/conversion/mapper.js +524 -38
- package/src/conversion/modelconsumable.d.ts +1 -1
- package/src/conversion/modelconsumable.js +1 -1
- package/src/conversion/upcastdispatcher.d.ts +1 -1
- package/src/conversion/upcastdispatcher.js +1 -1
- package/src/conversion/upcasthelpers.d.ts +1 -1
- package/src/conversion/upcasthelpers.js +1 -1
- package/src/conversion/viewconsumable.d.ts +1 -1
- package/src/conversion/viewconsumable.js +1 -1
- package/src/dataprocessor/basichtmlwriter.d.ts +1 -1
- package/src/dataprocessor/basichtmlwriter.js +1 -1
- package/src/dataprocessor/dataprocessor.d.ts +1 -1
- package/src/dataprocessor/dataprocessor.js +1 -1
- package/src/dataprocessor/htmldataprocessor.d.ts +1 -1
- package/src/dataprocessor/htmldataprocessor.js +1 -1
- package/src/dataprocessor/htmlwriter.d.ts +1 -1
- package/src/dataprocessor/htmlwriter.js +1 -1
- package/src/dataprocessor/xmldataprocessor.d.ts +1 -1
- package/src/dataprocessor/xmldataprocessor.js +1 -1
- package/src/dev-utils/model.d.ts +1 -1
- package/src/dev-utils/model.js +1 -1
- package/src/dev-utils/operationreplayer.d.ts +1 -1
- package/src/dev-utils/operationreplayer.js +1 -1
- package/src/dev-utils/utils.d.ts +1 -1
- package/src/dev-utils/utils.js +1 -1
- package/src/dev-utils/view.d.ts +1 -1
- package/src/dev-utils/view.js +1 -1
- package/src/index.d.ts +4 -2
- package/src/index.js +2 -1
- package/src/model/batch.d.ts +1 -1
- package/src/model/batch.js +7 -3
- package/src/model/differ.d.ts +1 -1
- package/src/model/differ.js +1 -1
- package/src/model/document.d.ts +1 -1
- package/src/model/document.js +1 -1
- package/src/model/documentfragment.d.ts +1 -1
- package/src/model/documentfragment.js +1 -1
- package/src/model/documentselection.d.ts +1 -1
- package/src/model/documentselection.js +1 -1
- package/src/model/element.d.ts +1 -1
- package/src/model/element.js +1 -1
- package/src/model/history.d.ts +1 -1
- package/src/model/history.js +1 -1
- package/src/model/item.d.ts +1 -1
- package/src/model/item.js +1 -1
- package/src/model/liveposition.d.ts +1 -1
- package/src/model/liveposition.js +1 -1
- package/src/model/liverange.d.ts +1 -1
- package/src/model/liverange.js +1 -1
- package/src/model/markercollection.d.ts +1 -1
- package/src/model/markercollection.js +1 -1
- package/src/model/model.d.ts +1 -1
- package/src/model/model.js +1 -1
- package/src/model/node.d.ts +1 -1
- package/src/model/node.js +1 -1
- package/src/model/nodelist.d.ts +1 -1
- package/src/model/nodelist.js +1 -1
- package/src/model/operation/attributeoperation.d.ts +1 -1
- package/src/model/operation/attributeoperation.js +1 -1
- package/src/model/operation/detachoperation.d.ts +1 -1
- package/src/model/operation/detachoperation.js +1 -1
- package/src/model/operation/insertoperation.d.ts +1 -1
- package/src/model/operation/insertoperation.js +1 -1
- package/src/model/operation/markeroperation.d.ts +1 -1
- package/src/model/operation/markeroperation.js +1 -1
- package/src/model/operation/mergeoperation.d.ts +1 -1
- package/src/model/operation/mergeoperation.js +1 -1
- package/src/model/operation/moveoperation.d.ts +1 -1
- package/src/model/operation/moveoperation.js +1 -1
- package/src/model/operation/nooperation.d.ts +1 -1
- package/src/model/operation/nooperation.js +1 -1
- package/src/model/operation/operation.d.ts +4 -1
- package/src/model/operation/operation.js +2 -2
- package/src/model/operation/operationfactory.d.ts +1 -1
- package/src/model/operation/operationfactory.js +1 -1
- package/src/model/operation/renameoperation.d.ts +1 -1
- package/src/model/operation/renameoperation.js +1 -1
- package/src/model/operation/rootattributeoperation.d.ts +1 -1
- package/src/model/operation/rootattributeoperation.js +1 -1
- package/src/model/operation/rootoperation.d.ts +1 -1
- package/src/model/operation/rootoperation.js +1 -1
- package/src/model/operation/splitoperation.d.ts +1 -1
- package/src/model/operation/splitoperation.js +1 -1
- package/src/model/operation/transform.d.ts +1 -1
- package/src/model/operation/transform.js +1 -1
- package/src/model/operation/utils.d.ts +1 -1
- package/src/model/operation/utils.js +1 -1
- package/src/model/position.d.ts +1 -1
- package/src/model/position.js +1 -1
- package/src/model/range.d.ts +1 -1
- package/src/model/range.js +1 -1
- package/src/model/rootelement.d.ts +1 -1
- package/src/model/rootelement.js +1 -1
- package/src/model/schema.d.ts +1 -1
- package/src/model/schema.js +1 -1
- package/src/model/selection.d.ts +1 -1
- package/src/model/selection.js +9 -2
- package/src/model/text.d.ts +1 -1
- package/src/model/text.js +1 -1
- package/src/model/textproxy.d.ts +1 -1
- package/src/model/textproxy.js +1 -1
- package/src/model/treewalker.d.ts +17 -1
- package/src/model/treewalker.js +26 -1
- package/src/model/typecheckable.d.ts +1 -1
- package/src/model/typecheckable.js +1 -1
- package/src/model/utils/autoparagraphing.d.ts +1 -1
- package/src/model/utils/autoparagraphing.js +1 -1
- package/src/model/utils/deletecontent.d.ts +1 -1
- package/src/model/utils/deletecontent.js +1 -1
- package/src/model/utils/getselectedcontent.d.ts +1 -1
- package/src/model/utils/getselectedcontent.js +1 -1
- package/src/model/utils/insertcontent.d.ts +1 -1
- package/src/model/utils/insertcontent.js +1 -1
- package/src/model/utils/insertobject.d.ts +1 -1
- package/src/model/utils/insertobject.js +1 -1
- package/src/model/utils/modifyselection.d.ts +1 -1
- package/src/model/utils/modifyselection.js +1 -1
- package/src/model/utils/selection-post-fixer.d.ts +1 -1
- package/src/model/utils/selection-post-fixer.js +1 -1
- package/src/model/writer.d.ts +1 -1
- package/src/model/writer.js +1 -1
- package/src/view/attributeelement.d.ts +1 -1
- package/src/view/attributeelement.js +1 -1
- package/src/view/containerelement.d.ts +1 -1
- package/src/view/containerelement.js +1 -1
- package/src/view/datatransfer.d.ts +1 -1
- package/src/view/datatransfer.js +1 -1
- package/src/view/document.d.ts +1 -1
- package/src/view/document.js +1 -1
- package/src/view/documentfragment.d.ts +6 -4
- package/src/view/documentfragment.js +7 -7
- package/src/view/documentselection.d.ts +1 -1
- package/src/view/documentselection.js +1 -1
- package/src/view/domconverter.d.ts +1 -1
- package/src/view/domconverter.js +1 -1
- package/src/view/downcastwriter.d.ts +1 -1
- package/src/view/downcastwriter.js +1 -1
- package/src/view/editableelement.d.ts +1 -1
- package/src/view/editableelement.js +1 -1
- package/src/view/element.d.ts +1 -1
- package/src/view/element.js +3 -3
- package/src/view/elementdefinition.d.ts +1 -1
- package/src/view/elementdefinition.js +1 -1
- package/src/view/emptyelement.d.ts +1 -1
- package/src/view/emptyelement.js +1 -1
- package/src/view/filler.d.ts +1 -1
- package/src/view/filler.js +1 -1
- package/src/view/item.d.ts +1 -1
- package/src/view/item.js +1 -1
- package/src/view/matcher.d.ts +1 -1
- package/src/view/matcher.js +1 -1
- package/src/view/node.d.ts +13 -4
- package/src/view/node.js +5 -4
- package/src/view/observer/arrowkeysobserver.d.ts +1 -1
- package/src/view/observer/arrowkeysobserver.js +1 -1
- package/src/view/observer/bubblingemittermixin.d.ts +1 -1
- package/src/view/observer/bubblingemittermixin.js +1 -1
- package/src/view/observer/bubblingeventinfo.d.ts +1 -1
- package/src/view/observer/bubblingeventinfo.js +1 -1
- package/src/view/observer/clickobserver.d.ts +1 -1
- package/src/view/observer/clickobserver.js +1 -1
- package/src/view/observer/compositionobserver.d.ts +1 -1
- package/src/view/observer/compositionobserver.js +1 -1
- package/src/view/observer/domeventdata.d.ts +1 -1
- package/src/view/observer/domeventdata.js +1 -1
- package/src/view/observer/domeventobserver.d.ts +1 -1
- package/src/view/observer/domeventobserver.js +1 -1
- package/src/view/observer/fakeselectionobserver.d.ts +1 -1
- package/src/view/observer/fakeselectionobserver.js +1 -1
- package/src/view/observer/focusobserver.d.ts +1 -1
- package/src/view/observer/focusobserver.js +1 -1
- package/src/view/observer/inputobserver.d.ts +1 -1
- package/src/view/observer/inputobserver.js +1 -1
- package/src/view/observer/keyobserver.d.ts +1 -1
- package/src/view/observer/keyobserver.js +1 -1
- package/src/view/observer/mouseobserver.d.ts +1 -1
- package/src/view/observer/mouseobserver.js +1 -1
- package/src/view/observer/mutationobserver.d.ts +1 -1
- package/src/view/observer/mutationobserver.js +1 -1
- package/src/view/observer/observer.d.ts +1 -1
- package/src/view/observer/observer.js +1 -1
- package/src/view/observer/selectionobserver.d.ts +1 -1
- package/src/view/observer/selectionobserver.js +1 -1
- package/src/view/observer/tabobserver.d.ts +1 -1
- package/src/view/observer/tabobserver.js +1 -1
- package/src/view/observer/touchobserver.d.ts +73 -0
- package/src/view/observer/touchobserver.js +29 -0
- package/src/view/placeholder.d.ts +1 -1
- package/src/view/placeholder.js +23 -17
- package/src/view/position.d.ts +1 -1
- package/src/view/position.js +1 -1
- package/src/view/range.d.ts +1 -1
- package/src/view/range.js +1 -1
- package/src/view/rawelement.d.ts +1 -1
- package/src/view/rawelement.js +1 -1
- package/src/view/renderer.d.ts +1 -1
- package/src/view/renderer.js +1 -1
- package/src/view/rooteditableelement.d.ts +1 -1
- package/src/view/rooteditableelement.js +1 -1
- package/src/view/selection.d.ts +1 -1
- package/src/view/selection.js +1 -1
- package/src/view/styles/background.d.ts +1 -1
- package/src/view/styles/background.js +1 -1
- package/src/view/styles/border.d.ts +1 -1
- package/src/view/styles/border.js +1 -1
- package/src/view/styles/margin.d.ts +1 -1
- package/src/view/styles/margin.js +1 -1
- package/src/view/styles/padding.d.ts +1 -1
- package/src/view/styles/padding.js +1 -1
- package/src/view/styles/utils.d.ts +1 -1
- package/src/view/styles/utils.js +1 -1
- package/src/view/stylesmap.d.ts +1 -1
- package/src/view/stylesmap.js +1 -1
- package/src/view/text.d.ts +1 -1
- package/src/view/text.js +1 -1
- package/src/view/textproxy.d.ts +1 -1
- package/src/view/textproxy.js +1 -1
- package/src/view/treewalker.d.ts +17 -1
- package/src/view/treewalker.js +25 -1
- package/src/view/typecheckable.d.ts +1 -1
- package/src/view/typecheckable.js +1 -1
- package/src/view/uielement.d.ts +1 -1
- package/src/view/uielement.js +1 -1
- package/src/view/upcastwriter.d.ts +1 -1
- package/src/view/upcastwriter.js +1 -1
- package/src/view/view.d.ts +1 -1
- package/src/view/view.js +1 -1
- package/theme/placeholder.css +1 -1
- package/theme/renderer.css +1 -1
- package/dist/controller/datacontroller.d.ts +0 -339
- package/dist/controller/editingcontroller.d.ts +0 -102
- package/dist/conversion/conversion.d.ts +0 -482
- package/dist/conversion/conversionhelpers.d.ts +0 -30
- package/dist/conversion/downcastdispatcher.d.ts +0 -566
- package/dist/conversion/downcasthelpers.d.ts +0 -1194
- package/dist/conversion/mapper.d.ts +0 -507
- package/dist/conversion/modelconsumable.d.ts +0 -205
- package/dist/conversion/upcastdispatcher.d.ts +0 -496
- package/dist/conversion/upcasthelpers.d.ts +0 -503
- package/dist/conversion/viewconsumable.d.ts +0 -373
- package/dist/dataprocessor/basichtmlwriter.d.ts +0 -22
- package/dist/dataprocessor/dataprocessor.d.ts +0 -65
- package/dist/dataprocessor/htmldataprocessor.d.ts +0 -80
- package/dist/dataprocessor/htmlwriter.d.ts +0 -20
- package/dist/dataprocessor/xmldataprocessor.d.ts +0 -94
- package/dist/dev-utils/model.d.ts +0 -130
- package/dist/dev-utils/operationreplayer.d.ts +0 -55
- package/dist/dev-utils/utils.d.ts +0 -41
- package/dist/dev-utils/view.d.ts +0 -324
- package/dist/index.d.ts +0 -122
- package/dist/model/batch.d.ts +0 -110
- package/dist/model/differ.d.ts +0 -511
- package/dist/model/document.d.ts +0 -278
- package/dist/model/documentfragment.d.ts +0 -223
- package/dist/model/documentselection.d.ts +0 -424
- package/dist/model/element.d.ts +0 -191
- package/dist/model/history.d.ts +0 -118
- package/dist/model/item.d.ts +0 -18
- package/dist/model/liveposition.d.ts +0 -81
- package/dist/model/liverange.d.ts +0 -106
- package/dist/model/markercollection.d.ts +0 -339
- package/dist/model/model.d.ts +0 -923
- package/dist/model/node.d.ts +0 -262
- package/dist/model/nodelist.d.ts +0 -119
- package/dist/model/operation/attributeoperation.d.ts +0 -107
- package/dist/model/operation/detachoperation.d.ts +0 -64
- package/dist/model/operation/insertoperation.d.ts +0 -94
- package/dist/model/operation/markeroperation.d.ts +0 -95
- package/dist/model/operation/mergeoperation.d.ts +0 -104
- package/dist/model/operation/moveoperation.d.ts +0 -100
- package/dist/model/operation/nooperation.d.ts +0 -42
- package/dist/model/operation/operation.d.ts +0 -100
- package/dist/model/operation/operationfactory.d.ts +0 -22
- package/dist/model/operation/renameoperation.d.ts +0 -87
- package/dist/model/operation/rootattributeoperation.d.ts +0 -102
- package/dist/model/operation/rootoperation.d.ts +0 -80
- package/dist/model/operation/splitoperation.d.ts +0 -113
- package/dist/model/operation/transform.d.ts +0 -104
- package/dist/model/operation/utils.d.ts +0 -75
- package/dist/model/position.d.ts +0 -549
- package/dist/model/range.d.ts +0 -462
- package/dist/model/rootelement.d.ts +0 -64
- package/dist/model/schema.d.ts +0 -1334
- package/dist/model/selection.d.ts +0 -486
- package/dist/model/text.d.ts +0 -70
- package/dist/model/textproxy.d.ts +0 -148
- package/dist/model/treewalker.d.ts +0 -190
- package/dist/model/typecheckable.d.ts +0 -289
- package/dist/model/utils/autoparagraphing.d.ts +0 -41
- package/dist/model/utils/deletecontent.d.ts +0 -62
- package/dist/model/utils/getselectedcontent.d.ts +0 -34
- package/dist/model/utils/insertcontent.d.ts +0 -50
- package/dist/model/utils/insertobject.d.ts +0 -51
- package/dist/model/utils/modifyselection.d.ts +0 -52
- package/dist/model/utils/selection-post-fixer.d.ts +0 -78
- package/dist/model/writer.d.ts +0 -855
- package/dist/view/attributeelement.d.ts +0 -112
- package/dist/view/containerelement.d.ts +0 -53
- package/dist/view/datatransfer.d.ts +0 -83
- package/dist/view/document.d.ts +0 -188
- package/dist/view/documentfragment.d.ts +0 -157
- package/dist/view/documentselection.d.ts +0 -310
- package/dist/view/domconverter.d.ts +0 -665
- package/dist/view/downcastwriter.d.ts +0 -1000
- package/dist/view/editableelement.d.ts +0 -66
- package/dist/view/element.d.ts +0 -472
- package/dist/view/elementdefinition.d.ts +0 -91
- package/dist/view/emptyelement.d.ts +0 -45
- package/dist/view/filler.d.ts +0 -115
- package/dist/view/item.d.ts +0 -18
- package/dist/view/matcher.d.ts +0 -490
- package/dist/view/node.d.ts +0 -166
- package/dist/view/observer/arrowkeysobserver.d.ts +0 -49
- package/dist/view/observer/bubblingemittermixin.d.ts +0 -170
- package/dist/view/observer/bubblingeventinfo.d.ts +0 -51
- package/dist/view/observer/clickobserver.d.ts +0 -47
- package/dist/view/observer/compositionobserver.d.ts +0 -86
- package/dist/view/observer/domeventdata.d.ts +0 -54
- package/dist/view/observer/domeventobserver.d.ts +0 -82
- package/dist/view/observer/fakeselectionobserver.d.ts +0 -51
- package/dist/view/observer/focusobserver.d.ts +0 -98
- package/dist/view/observer/inputobserver.d.ts +0 -90
- package/dist/view/observer/keyobserver.d.ts +0 -70
- package/dist/view/observer/mouseobserver.d.ts +0 -93
- package/dist/view/observer/mutationobserver.d.ts +0 -119
- package/dist/view/observer/observer.d.ts +0 -93
- package/dist/view/observer/selectionobserver.d.ts +0 -151
- package/dist/view/observer/tabobserver.d.ts +0 -50
- package/dist/view/placeholder.d.ts +0 -100
- package/dist/view/position.d.ts +0 -192
- package/dist/view/range.d.ts +0 -283
- package/dist/view/rawelement.d.ts +0 -77
- package/dist/view/renderer.d.ts +0 -281
- package/dist/view/rooteditableelement.d.ts +0 -45
- package/dist/view/selection.d.ts +0 -379
- package/dist/view/styles/background.d.ts +0 -37
- package/dist/view/styles/border.d.ts +0 -47
- package/dist/view/styles/margin.d.ts +0 -33
- package/dist/view/styles/padding.d.ts +0 -33
- package/dist/view/styles/utils.d.ts +0 -97
- package/dist/view/stylesmap.d.ts +0 -685
- package/dist/view/text.d.ts +0 -78
- package/dist/view/textproxy.d.ts +0 -101
- package/dist/view/treewalker.d.ts +0 -199
- package/dist/view/typecheckable.d.ts +0 -452
- package/dist/view/uielement.d.ts +0 -100
- package/dist/view/upcastwriter.d.ts +0 -421
- package/dist/view/view.d.ts +0 -488
|
@@ -1,339 +0,0 @@
|
|
|
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
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
8
|
-
*/
|
|
9
|
-
import Mapper from '../conversion/mapper.js';
|
|
10
|
-
import DowncastDispatcher from '../conversion/downcastdispatcher.js';
|
|
11
|
-
import UpcastDispatcher from '../conversion/upcastdispatcher.js';
|
|
12
|
-
import ViewDocumentFragment from '../view/documentfragment.js';
|
|
13
|
-
import ViewDocument from '../view/document.js';
|
|
14
|
-
import type ViewElement from '../view/element.js';
|
|
15
|
-
import type { StylesProcessor } from '../view/stylesmap.js';
|
|
16
|
-
import type { MatcherPattern } from '../view/matcher.js';
|
|
17
|
-
import type Model from '../model/model.js';
|
|
18
|
-
import type ModelElement from '../model/element.js';
|
|
19
|
-
import type ModelDocumentFragment from '../model/documentfragment.js';
|
|
20
|
-
import type { SchemaContextDefinition } from '../model/schema.js';
|
|
21
|
-
import type { BatchType } from '../model/batch.js';
|
|
22
|
-
import HtmlDataProcessor from '../dataprocessor/htmldataprocessor.js';
|
|
23
|
-
import type DataProcessor from '../dataprocessor/dataprocessor.js';
|
|
24
|
-
declare const DataController_base: {
|
|
25
|
-
new (): import("@ckeditor/ckeditor5-utils").Emitter;
|
|
26
|
-
prototype: import("@ckeditor/ckeditor5-utils").Emitter;
|
|
27
|
-
};
|
|
28
|
-
/**
|
|
29
|
-
* Controller for the data pipeline. The data pipeline controls how data is retrieved from the document
|
|
30
|
-
* and set inside it. Hence, the controller features two methods which allow to {@link ~DataController#get get}
|
|
31
|
-
* and {@link ~DataController#set set} data of the {@link ~DataController#model model}
|
|
32
|
-
* using the given:
|
|
33
|
-
*
|
|
34
|
-
* * {@link module:engine/dataprocessor/dataprocessor~DataProcessor data processor},
|
|
35
|
-
* * downcast converters,
|
|
36
|
-
* * upcast converters.
|
|
37
|
-
*
|
|
38
|
-
* An instance of the data controller is always available in the {@link module:core/editor/editor~Editor#data `editor.data`}
|
|
39
|
-
* property:
|
|
40
|
-
*
|
|
41
|
-
* ```ts
|
|
42
|
-
* editor.data.get( { rootName: 'customRoot' } ); // -> '<p>Hello!</p>'
|
|
43
|
-
* ```
|
|
44
|
-
*/
|
|
45
|
-
export default class DataController extends /* #__PURE__ */ DataController_base {
|
|
46
|
-
/**
|
|
47
|
-
* Data model.
|
|
48
|
-
*/
|
|
49
|
-
readonly model: Model;
|
|
50
|
-
/**
|
|
51
|
-
* Mapper used for the conversion. It has no permanent bindings, because these are created while getting data and
|
|
52
|
-
* are cleared directly after the data are converted. However, the mapper is defined as a class property, because
|
|
53
|
-
* it needs to be passed to the `DowncastDispatcher` as a conversion API.
|
|
54
|
-
*/
|
|
55
|
-
readonly mapper: Mapper;
|
|
56
|
-
/**
|
|
57
|
-
* Downcast dispatcher used by the {@link #get get method}. Downcast converters should be attached to it.
|
|
58
|
-
*/
|
|
59
|
-
readonly downcastDispatcher: DowncastDispatcher;
|
|
60
|
-
/**
|
|
61
|
-
* Upcast dispatcher used by the {@link #set set method}. Upcast converters should be attached to it.
|
|
62
|
-
*/
|
|
63
|
-
readonly upcastDispatcher: UpcastDispatcher;
|
|
64
|
-
/**
|
|
65
|
-
* The view document used by the data controller.
|
|
66
|
-
*/
|
|
67
|
-
readonly viewDocument: ViewDocument;
|
|
68
|
-
/**
|
|
69
|
-
* Styles processor used during the conversion.
|
|
70
|
-
*/
|
|
71
|
-
readonly stylesProcessor: StylesProcessor;
|
|
72
|
-
/**
|
|
73
|
-
* Data processor used specifically for HTML conversion.
|
|
74
|
-
*/
|
|
75
|
-
readonly htmlProcessor: HtmlDataProcessor;
|
|
76
|
-
/**
|
|
77
|
-
* Data processor used during the conversion.
|
|
78
|
-
* Same instance as {@link #htmlProcessor} by default. Can be replaced at run time to handle different format, e.g. XML or Markdown.
|
|
79
|
-
*/
|
|
80
|
-
processor: DataProcessor;
|
|
81
|
-
/**
|
|
82
|
-
* The view downcast writer just for data conversion purposes, i.e. to modify
|
|
83
|
-
* the {@link #viewDocument}.
|
|
84
|
-
*/
|
|
85
|
-
private readonly _viewWriter;
|
|
86
|
-
/**
|
|
87
|
-
* Creates a data controller instance.
|
|
88
|
-
*
|
|
89
|
-
* @param model Data model.
|
|
90
|
-
* @param stylesProcessor The styles processor instance.
|
|
91
|
-
*/
|
|
92
|
-
constructor(model: Model, stylesProcessor: StylesProcessor);
|
|
93
|
-
/**
|
|
94
|
-
* Returns the model's data converted by downcast dispatchers attached to {@link #downcastDispatcher} and
|
|
95
|
-
* formatted by the {@link #processor data processor}.
|
|
96
|
-
*
|
|
97
|
-
* A warning is logged when you try to retrieve data for a detached root, as most probably this is a mistake. A detached root should
|
|
98
|
-
* be treated like it is removed, and you should not save its data. Note, that the detached root data is always an empty string.
|
|
99
|
-
*
|
|
100
|
-
* @fires get
|
|
101
|
-
* @param options Additional configuration for the retrieved data. `DataController` provides two optional
|
|
102
|
-
* properties: `rootName` and `trim`. Other properties of this object are specified by various editor features.
|
|
103
|
-
* @param options.rootName Root name. Default 'main'.
|
|
104
|
-
* @param options.trim Whether returned data should be trimmed. This option is set to `empty` by default,
|
|
105
|
-
* which means whenever editor content is considered empty, an empty string will be returned. To turn off trimming completely
|
|
106
|
-
* use `'none'`. In such cases the exact content will be returned (for example a `<p> </p>` for an empty editor).
|
|
107
|
-
* @returns Output data.
|
|
108
|
-
*/
|
|
109
|
-
get(options?: {
|
|
110
|
-
rootName?: string;
|
|
111
|
-
trim?: 'empty' | 'none';
|
|
112
|
-
[key: string]: unknown;
|
|
113
|
-
}): string;
|
|
114
|
-
/**
|
|
115
|
-
* Returns the content of the given {@link module:engine/model/element~Element model's element} or
|
|
116
|
-
* {@link module:engine/model/documentfragment~DocumentFragment model document fragment} converted by the downcast converters
|
|
117
|
-
* attached to the {@link #downcastDispatcher} and formatted by the {@link #processor data processor}.
|
|
118
|
-
*
|
|
119
|
-
* @param modelElementOrFragment The element whose content will be stringified.
|
|
120
|
-
* @param options Additional configuration passed to the conversion process.
|
|
121
|
-
* @returns Output data.
|
|
122
|
-
*/
|
|
123
|
-
stringify(modelElementOrFragment: ModelElement | ModelDocumentFragment, options?: Record<string, unknown>): string;
|
|
124
|
-
/**
|
|
125
|
-
* Returns the content of the given {@link module:engine/model/element~Element model element} or
|
|
126
|
-
* {@link module:engine/model/documentfragment~DocumentFragment model document fragment} converted by the downcast
|
|
127
|
-
* converters attached to {@link #downcastDispatcher} into a
|
|
128
|
-
* {@link module:engine/view/documentfragment~DocumentFragment view document fragment}.
|
|
129
|
-
*
|
|
130
|
-
* @fires toView
|
|
131
|
-
* @param modelElementOrFragment Element or document fragment whose content will be converted.
|
|
132
|
-
* @param options Additional configuration that will be available through the
|
|
133
|
-
* {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi#options} during the conversion process.
|
|
134
|
-
* @returns Output view DocumentFragment.
|
|
135
|
-
*/
|
|
136
|
-
toView(modelElementOrFragment: ModelElement | ModelDocumentFragment, options?: Record<string, unknown>): ViewDocumentFragment;
|
|
137
|
-
/**
|
|
138
|
-
* Sets the initial input data parsed by the {@link #processor data processor} and
|
|
139
|
-
* converted by the {@link #upcastDispatcher view-to-model converters}.
|
|
140
|
-
* Initial data can be only set to a document whose {@link module:engine/model/document~Document#version} is equal 0.
|
|
141
|
-
*
|
|
142
|
-
* **Note** This method is {@link module:utils/observablemixin~Observable#decorate decorated} which is
|
|
143
|
-
* used by e.g. collaborative editing plugin that syncs remote data on init.
|
|
144
|
-
*
|
|
145
|
-
* When data is passed as a string, it is initialized on the default `main` root:
|
|
146
|
-
*
|
|
147
|
-
* ```ts
|
|
148
|
-
* dataController.init( '<p>Foo</p>' ); // Initializes data on the `main` root only, as no other is specified.
|
|
149
|
-
* ```
|
|
150
|
-
*
|
|
151
|
-
* To initialize data on a different root or multiple roots at once, an object containing `rootName` - `data` pairs should be passed:
|
|
152
|
-
*
|
|
153
|
-
* ```ts
|
|
154
|
-
* dataController.init( { main: '<p>Foo</p>', title: '<h1>Bar</h1>' } ); // Initializes data on both the `main` and `title` roots.
|
|
155
|
-
* ```
|
|
156
|
-
*
|
|
157
|
-
* @fires init
|
|
158
|
-
* @param data Input data as a string or an object containing the `rootName` - `data`
|
|
159
|
-
* pairs to initialize data on multiple roots at once.
|
|
160
|
-
* @returns Promise that is resolved after the data is set on the editor.
|
|
161
|
-
*/
|
|
162
|
-
init(data: string | Record<string, string>): Promise<void>;
|
|
163
|
-
/**
|
|
164
|
-
* Sets the input data parsed by the {@link #processor data processor} and
|
|
165
|
-
* converted by the {@link #upcastDispatcher view-to-model converters}.
|
|
166
|
-
* This method can be used any time to replace existing editor data with the new one without clearing the
|
|
167
|
-
* {@link module:engine/model/document~Document#history document history}.
|
|
168
|
-
*
|
|
169
|
-
* This method also creates a batch with all the changes applied. If all you need is to parse data, use
|
|
170
|
-
* the {@link #parse} method.
|
|
171
|
-
*
|
|
172
|
-
* When data is passed as a string it is set on the default `main` root:
|
|
173
|
-
*
|
|
174
|
-
* ```ts
|
|
175
|
-
* dataController.set( '<p>Foo</p>' ); // Sets data on the `main` root, as no other is specified.
|
|
176
|
-
* ```
|
|
177
|
-
*
|
|
178
|
-
* To set data on a different root or multiple roots at once, an object containing `rootName` - `data` pairs should be passed:
|
|
179
|
-
*
|
|
180
|
-
* ```ts
|
|
181
|
-
* dataController.set( { main: '<p>Foo</p>', title: '<h1>Bar</h1>' } ); // Sets data on the `main` and `title` roots as specified.
|
|
182
|
-
* ```
|
|
183
|
-
*
|
|
184
|
-
* To set the data with a preserved undo stack and add the change to the undo stack, set `{ isUndoable: true }` as a `batchType` option.
|
|
185
|
-
*
|
|
186
|
-
* ```ts
|
|
187
|
-
* dataController.set( '<p>Foo</p>', { batchType: { isUndoable: true } } );
|
|
188
|
-
* ```
|
|
189
|
-
*
|
|
190
|
-
* @fires set
|
|
191
|
-
* @param data Input data as a string or an object containing the `rootName` - `data`
|
|
192
|
-
* pairs to set data on multiple roots at once.
|
|
193
|
-
* @param options Options for setting data.
|
|
194
|
-
* @param options.batchType The batch type that will be used to create a batch for the changes applied by this method.
|
|
195
|
-
* By default, the batch will be set as {@link module:engine/model/batch~Batch#isUndoable not undoable} and the undo stack will be
|
|
196
|
-
* cleared after the new data is applied (all undo steps will be removed). If the batch type `isUndoable` flag is be set to `true`,
|
|
197
|
-
* the undo stack will be preserved instead and not cleared when new data is applied.
|
|
198
|
-
*/
|
|
199
|
-
set(data: string | Record<string, string>, options?: {
|
|
200
|
-
batchType?: BatchType;
|
|
201
|
-
[key: string]: unknown;
|
|
202
|
-
}): void;
|
|
203
|
-
/**
|
|
204
|
-
* Returns the data parsed by the {@link #processor data processor} and then converted by upcast converters
|
|
205
|
-
* attached to the {@link #upcastDispatcher}.
|
|
206
|
-
*
|
|
207
|
-
* @see #set
|
|
208
|
-
* @param data Data to parse.
|
|
209
|
-
* @param context Base context in which the view will be converted to the model.
|
|
210
|
-
* See: {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher#convert}.
|
|
211
|
-
* @returns Parsed data.
|
|
212
|
-
*/
|
|
213
|
-
parse(data: string, context?: SchemaContextDefinition): ModelDocumentFragment;
|
|
214
|
-
/**
|
|
215
|
-
* Returns the result of the given {@link module:engine/view/element~Element view element} or
|
|
216
|
-
* {@link module:engine/view/documentfragment~DocumentFragment view document fragment} converted by the
|
|
217
|
-
* {@link #upcastDispatcher view-to-model converters}, wrapped by {@link module:engine/model/documentfragment~DocumentFragment}.
|
|
218
|
-
*
|
|
219
|
-
* When marker elements were converted during the conversion process, it will be set as a document fragment's
|
|
220
|
-
* {@link module:engine/model/documentfragment~DocumentFragment#markers static markers map}.
|
|
221
|
-
*
|
|
222
|
-
* @fires toModel
|
|
223
|
-
* @param viewElementOrFragment The element or document fragment whose content will be converted.
|
|
224
|
-
* @param context Base context in which the view will be converted to the model.
|
|
225
|
-
* See: {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher#convert}.
|
|
226
|
-
* @returns Output document fragment.
|
|
227
|
-
*/
|
|
228
|
-
toModel(viewElementOrFragment: ViewElement | ViewDocumentFragment, context?: SchemaContextDefinition): ModelDocumentFragment;
|
|
229
|
-
/**
|
|
230
|
-
* Adds the style processor normalization rules.
|
|
231
|
-
*
|
|
232
|
-
* You can implement your own rules as well as use one of the available processor rules:
|
|
233
|
-
*
|
|
234
|
-
* * background: {@link module:engine/view/styles/background~addBackgroundRules}
|
|
235
|
-
* * border: {@link module:engine/view/styles/border~addBorderRules}
|
|
236
|
-
* * margin: {@link module:engine/view/styles/margin~addMarginRules}
|
|
237
|
-
* * padding: {@link module:engine/view/styles/padding~addPaddingRules}
|
|
238
|
-
*/
|
|
239
|
-
addStyleProcessorRules(callback: (stylesProcessor: StylesProcessor) => void): void;
|
|
240
|
-
/**
|
|
241
|
-
* Registers a {@link module:engine/view/matcher~MatcherPattern} on an {@link #htmlProcessor htmlProcessor}
|
|
242
|
-
* and a {@link #processor processor} for view elements whose content should be treated as raw data
|
|
243
|
-
* and not processed during the conversion from DOM to view elements.
|
|
244
|
-
*
|
|
245
|
-
* The raw data can be later accessed by the {@link module:engine/view/element~Element#getCustomProperty view element custom property}
|
|
246
|
-
* `"$rawContent"`.
|
|
247
|
-
*
|
|
248
|
-
* @param pattern Pattern matching all view elements whose content should be treated as a raw data.
|
|
249
|
-
*/
|
|
250
|
-
registerRawContentMatcher(pattern: MatcherPattern): void;
|
|
251
|
-
/**
|
|
252
|
-
* Removes all event listeners set by the DataController.
|
|
253
|
-
*/
|
|
254
|
-
destroy(): void;
|
|
255
|
-
/**
|
|
256
|
-
* Checks whether all provided root names are actually existing editor roots.
|
|
257
|
-
*
|
|
258
|
-
* @param rootNames Root names to check.
|
|
259
|
-
* @returns Whether all provided root names are existing editor roots.
|
|
260
|
-
*/
|
|
261
|
-
private _checkIfRootsExists;
|
|
262
|
-
}
|
|
263
|
-
/**
|
|
264
|
-
* Event fired once the data initialization has finished.
|
|
265
|
-
*
|
|
266
|
-
* @eventName ~DataController#ready
|
|
267
|
-
*/
|
|
268
|
-
export type DataControllerReadyEvent = {
|
|
269
|
-
name: 'ready';
|
|
270
|
-
args: [];
|
|
271
|
-
};
|
|
272
|
-
/**
|
|
273
|
-
* An event fired after the {@link ~DataController#init `init()` method} was run. It can be {@link ~DataController#listenTo listened to} in
|
|
274
|
-
* order to adjust or modify the initialization flow. However, if the `init` event is stopped or prevented,
|
|
275
|
-
* the {@link ~DataController#event:ready `ready` event} should be fired manually.
|
|
276
|
-
*
|
|
277
|
-
* The `init` event is fired by the decorated {@link ~DataController#init} method.
|
|
278
|
-
* See {@link module:utils/observablemixin~Observable#decorate} for more information and samples.
|
|
279
|
-
*
|
|
280
|
-
* @eventName ~DataController#init
|
|
281
|
-
*/
|
|
282
|
-
export type DataControllerInitEvent = {
|
|
283
|
-
name: 'init';
|
|
284
|
-
args: [Parameters<DataController['init']>];
|
|
285
|
-
return: ReturnType<DataController['init']>;
|
|
286
|
-
};
|
|
287
|
-
/**
|
|
288
|
-
* An event fired after {@link ~DataController#set set() method} has been run.
|
|
289
|
-
*
|
|
290
|
-
* The `set` event is fired by the decorated {@link ~DataController#set} method.
|
|
291
|
-
* See {@link module:utils/observablemixin~Observable#decorate} for more information and samples.
|
|
292
|
-
*
|
|
293
|
-
* @eventName ~DataController#set
|
|
294
|
-
*/
|
|
295
|
-
export type DataControllerSetEvent = {
|
|
296
|
-
name: 'set';
|
|
297
|
-
args: [Parameters<DataController['set']>];
|
|
298
|
-
return: ReturnType<DataController['set']>;
|
|
299
|
-
};
|
|
300
|
-
/**
|
|
301
|
-
* Event fired after the {@link ~DataController#get get() method} has been run.
|
|
302
|
-
*
|
|
303
|
-
* The `get` event is fired by the decorated {@link ~DataController#get} method.
|
|
304
|
-
* See {@link module:utils/observablemixin~Observable#decorate} for more information and samples.
|
|
305
|
-
*
|
|
306
|
-
* @eventName ~DataController#get
|
|
307
|
-
*/
|
|
308
|
-
export type DataControllerGetEvent = {
|
|
309
|
-
name: 'get';
|
|
310
|
-
args: [Parameters<DataController['get']>];
|
|
311
|
-
return: ReturnType<DataController['get']>;
|
|
312
|
-
};
|
|
313
|
-
/**
|
|
314
|
-
* Event fired after the {@link ~DataController#toView toView() method} has been run.
|
|
315
|
-
*
|
|
316
|
-
* The `toView` event is fired by the decorated {@link ~DataController#toView} method.
|
|
317
|
-
* See {@link module:utils/observablemixin~Observable#decorate} for more information and samples.
|
|
318
|
-
*
|
|
319
|
-
* @eventName ~DataController#toView
|
|
320
|
-
*/
|
|
321
|
-
export type DataControllerToViewEvent = {
|
|
322
|
-
name: 'toView';
|
|
323
|
-
args: [Parameters<DataController['toView']>];
|
|
324
|
-
return: ReturnType<DataController['toView']>;
|
|
325
|
-
};
|
|
326
|
-
/**
|
|
327
|
-
* Event fired after the {@link ~DataController#toModel toModel() method} has been run.
|
|
328
|
-
*
|
|
329
|
-
* The `toModel` event is fired by the decorated {@link ~DataController#toModel} method.
|
|
330
|
-
* See {@link module:utils/observablemixin~Observable#decorate} for more information and samples.
|
|
331
|
-
*
|
|
332
|
-
* @eventName ~DataController#toModel
|
|
333
|
-
*/
|
|
334
|
-
export type DataControllerToModelEvent = {
|
|
335
|
-
name: 'toModel';
|
|
336
|
-
args: [Parameters<DataController['toModel']>];
|
|
337
|
-
return: ReturnType<DataController['toModel']>;
|
|
338
|
-
};
|
|
339
|
-
export {};
|
|
@@ -1,102 +0,0 @@
|
|
|
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
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
8
|
-
*/
|
|
9
|
-
import View from '../view/view.js';
|
|
10
|
-
import Mapper from '../conversion/mapper.js';
|
|
11
|
-
import DowncastDispatcher from '../conversion/downcastdispatcher.js';
|
|
12
|
-
import type { default as Model } from '../model/model.js';
|
|
13
|
-
import type ModelItem from '../model/item.js';
|
|
14
|
-
import type { Marker } from '../model/markercollection.js';
|
|
15
|
-
import type { StylesProcessor } from '../view/stylesmap.js';
|
|
16
|
-
declare const EditingController_base: {
|
|
17
|
-
new (): import("@ckeditor/ckeditor5-utils").Observable;
|
|
18
|
-
prototype: import("@ckeditor/ckeditor5-utils").Observable;
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* A controller for the editing pipeline. The editing pipeline controls the {@link ~EditingController#model model} rendering,
|
|
22
|
-
* including selection handling. It also creates the {@link ~EditingController#view view} which builds a
|
|
23
|
-
* browser-independent virtualization over the DOM elements. The editing controller also attaches default converters.
|
|
24
|
-
*/
|
|
25
|
-
export default class EditingController extends /* #__PURE__ */ EditingController_base {
|
|
26
|
-
/**
|
|
27
|
-
* Editor model.
|
|
28
|
-
*/
|
|
29
|
-
readonly model: Model;
|
|
30
|
-
/**
|
|
31
|
-
* Editing view controller.
|
|
32
|
-
*/
|
|
33
|
-
readonly view: View;
|
|
34
|
-
/**
|
|
35
|
-
* A mapper that describes the model-view binding.
|
|
36
|
-
*/
|
|
37
|
-
readonly mapper: Mapper;
|
|
38
|
-
/**
|
|
39
|
-
* Downcast dispatcher that converts changes from the model to the {@link #view editing view}.
|
|
40
|
-
*/
|
|
41
|
-
readonly downcastDispatcher: DowncastDispatcher;
|
|
42
|
-
/**
|
|
43
|
-
* Creates an editing controller instance.
|
|
44
|
-
*
|
|
45
|
-
* @param model Editing model.
|
|
46
|
-
* @param stylesProcessor The styles processor instance.
|
|
47
|
-
*/
|
|
48
|
-
constructor(model: Model, stylesProcessor: StylesProcessor);
|
|
49
|
-
/**
|
|
50
|
-
* Removes all event listeners attached to the `EditingController`. Destroys all objects created
|
|
51
|
-
* by `EditingController` that need to be destroyed.
|
|
52
|
-
*/
|
|
53
|
-
destroy(): void;
|
|
54
|
-
/**
|
|
55
|
-
* Calling this method will refresh the marker by triggering the downcast conversion for it.
|
|
56
|
-
*
|
|
57
|
-
* Reconverting the marker is useful when you want to change its {@link module:engine/view/element~Element view element}
|
|
58
|
-
* without changing any marker data. For instance:
|
|
59
|
-
*
|
|
60
|
-
* ```ts
|
|
61
|
-
* let isCommentActive = false;
|
|
62
|
-
*
|
|
63
|
-
* model.conversion.markerToHighlight( {
|
|
64
|
-
* model: 'comment',
|
|
65
|
-
* view: data => {
|
|
66
|
-
* const classes = [ 'comment-marker' ];
|
|
67
|
-
*
|
|
68
|
-
* if ( isCommentActive ) {
|
|
69
|
-
* classes.push( 'comment-marker--active' );
|
|
70
|
-
* }
|
|
71
|
-
*
|
|
72
|
-
* return { classes };
|
|
73
|
-
* }
|
|
74
|
-
* } );
|
|
75
|
-
*
|
|
76
|
-
* // ...
|
|
77
|
-
*
|
|
78
|
-
* // Change the property that indicates if marker is displayed as active or not.
|
|
79
|
-
* isCommentActive = true;
|
|
80
|
-
*
|
|
81
|
-
* // Reconverting will downcast and synchronize the marker with the new isCommentActive state value.
|
|
82
|
-
* editor.editing.reconvertMarker( 'comment' );
|
|
83
|
-
* ```
|
|
84
|
-
*
|
|
85
|
-
* **Note**: If you want to reconvert a model item, use {@link #reconvertItem} instead.
|
|
86
|
-
*
|
|
87
|
-
* @param markerOrName Name of a marker to update, or a marker instance.
|
|
88
|
-
*/
|
|
89
|
-
reconvertMarker(markerOrName: Marker | string): void;
|
|
90
|
-
/**
|
|
91
|
-
* Calling this method will downcast a model item on demand (by requesting a refresh in the {@link module:engine/model/differ~Differ}).
|
|
92
|
-
*
|
|
93
|
-
* You can use it if you want the view representation of a specific item updated as a response to external modifications. For instance,
|
|
94
|
-
* when the view structure depends not only on the associated model data but also on some external state.
|
|
95
|
-
*
|
|
96
|
-
* **Note**: If you want to reconvert a model marker, use {@link #reconvertMarker} instead.
|
|
97
|
-
*
|
|
98
|
-
* @param item Item to refresh.
|
|
99
|
-
*/
|
|
100
|
-
reconvertItem(item: ModelItem): void;
|
|
101
|
-
}
|
|
102
|
-
export {};
|