@alitons/ckeditor5 0.0.17 → 0.0.18
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/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@alitons/ckeditor5",
|
|
3
3
|
"author": "Aliton Silva",
|
|
4
4
|
"description": "Ckeditor 5 Personalizado adicionados campos para atender as demandas da SEAD/AC",
|
|
5
|
-
"version": "0.0.
|
|
5
|
+
"version": "0.0.18",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
7
7
|
"private": false,
|
|
8
8
|
"main": "./build/ckeditor.js",
|
|
@@ -131,7 +131,7 @@ export default class NumberedDivList extends Plugin {
|
|
|
131
131
|
});
|
|
132
132
|
|
|
133
133
|
let firstConversion = true;
|
|
134
|
-
let nivelAtual = 1;
|
|
134
|
+
let nivelAtual = config?.forceList ? 1 : 0;
|
|
135
135
|
let lastItemAdded = {} as any;
|
|
136
136
|
editor.conversion.for('upcast').add( dispatcher => {
|
|
137
137
|
dispatcher.on( 'element:p', async ( evt, data, conversionApi ) => {
|
|
@@ -148,7 +148,6 @@ export default class NumberedDivList extends Plugin {
|
|
|
148
148
|
|
|
149
149
|
if(classAttr && (classAttr.match(/Item_Nivel(\d+)/) || classAttr.match(/Paragrafo_Numerado_Nivel(\d+)/))) {
|
|
150
150
|
const nivelLocal = parseInt(classAttr.replace(/\D/g, '') ?? 0);
|
|
151
|
-
console.log(nivelLocal);
|
|
152
151
|
|
|
153
152
|
if ( !consumable.test( viewItem, { name: true } ) ) {
|
|
154
153
|
return;
|
|
@@ -157,11 +156,11 @@ export default class NumberedDivList extends Plugin {
|
|
|
157
156
|
|
|
158
157
|
consumable.consume( viewItem, { name: true } );
|
|
159
158
|
|
|
160
|
-
if(
|
|
159
|
+
if(nivelLocal > nivelAtual) {
|
|
161
160
|
const numList = writer.createElement('numList', { 'dataBlock': 'true' });
|
|
162
161
|
let children = null;
|
|
163
162
|
|
|
164
|
-
if(nivelLocal > 2) {
|
|
163
|
+
if(nivelLocal > (config?.forceList ? 2 : 1)) {
|
|
165
164
|
children = lastItemAdded[nivelLocal - 1].parent ?? null;
|
|
166
165
|
}
|
|
167
166
|
|
|
@@ -176,7 +175,6 @@ export default class NumberedDivList extends Plugin {
|
|
|
176
175
|
lastItemAdded[nivelLocal] = numItem;
|
|
177
176
|
|
|
178
177
|
} else {
|
|
179
|
-
console.log(data.modelCursor);
|
|
180
178
|
const numItem = writer.createElement('numItem');
|
|
181
179
|
safeInsert( numItem, lastItemAdded[nivelLocal]?.parent ? writer.createPositionAt(lastItemAdded[nivelLocal]?.parent, 'end') : data.modelCursor );
|
|
182
180
|
convertChildren( viewItem, numItem );
|
|
@@ -281,7 +279,7 @@ export default class NumberedDivList extends Plugin {
|
|
|
281
279
|
'keydown',
|
|
282
280
|
(evt, data) => {
|
|
283
281
|
firstConversion = true;
|
|
284
|
-
nivelAtual = 1;
|
|
282
|
+
nivelAtual = config?.forceList ? 1 : 0;
|
|
285
283
|
lastItemAdded = {} as any;
|
|
286
284
|
const isBackspace = data.keyCode === keyCodes.backspace;
|
|
287
285
|
const isDelete = data.keyCode === keyCodes.delete;
|