@alitons/ckeditor5 0.0.14 → 0.0.15
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/build/ckeditor.d.ts +0 -2
- package/build/ckeditor.js +2 -2
- package/build/ckeditor.js.map +1 -1
- package/build/plugins/modelo.d.ts +1 -1
- package/package.json +1 -1
- package/sample/script.js +10 -10
- package/src/ckeditor.ts +0 -9
- package/src/components/list/listitemview.d.ts +35 -35
- package/src/components/list/listitemview.js +42 -42
- package/src/components/list/listview.d.ts +65 -65
- package/src/components/list/listview.js +92 -92
- package/src/css/custom.css +0 -9
- package/src/plugins/NumberedDivListSplit.ts +9 -0
- package/src/plugins/listaNumerada.ts +1 -3
- package/src/plugins/modelo.ts +16 -17
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Plugin } from '@ckeditor/ckeditor5-core';
|
|
2
2
|
import 'select2/dist/js/select2.full.min';
|
|
3
|
-
import 'select2/dist/css/select2.css';
|
|
3
|
+
import 'select2/dist/css/select2.min.css';
|
|
4
4
|
export default class DocumentoModelo extends Plugin {
|
|
5
5
|
options: any;
|
|
6
6
|
uid: string;
|
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.15",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
7
7
|
"private": false,
|
|
8
8
|
"main": "./build/ckeditor.js",
|
package/sample/script.js
CHANGED
|
@@ -34,21 +34,21 @@ watchdog.create( document.querySelector( '.editor' ), {
|
|
|
34
34
|
},
|
|
35
35
|
documentoModeloOptions: {
|
|
36
36
|
categoria: {
|
|
37
|
-
options: [
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
],
|
|
37
|
+
// options: [
|
|
38
|
+
// {
|
|
39
|
+
// autotexto: 'teste 1',
|
|
40
|
+
// titulo: 'Primeiro teste'
|
|
41
|
+
// }
|
|
42
|
+
// ],
|
|
43
43
|
ajax: {
|
|
44
|
-
url: '
|
|
44
|
+
url: 'https://compras.test/api/documento-modelo/categoria',
|
|
45
45
|
method: 'GET',
|
|
46
46
|
data: {
|
|
47
47
|
usuario: 'usuario',
|
|
48
48
|
},
|
|
49
49
|
results: {
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
id: 'id_categoria_autotexto',
|
|
51
|
+
text: 'descricao'
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
},
|
|
@@ -59,7 +59,7 @@ watchdog.create( document.querySelector( '.editor' ), {
|
|
|
59
59
|
}
|
|
60
60
|
],
|
|
61
61
|
ajax: {
|
|
62
|
-
url: '
|
|
62
|
+
url: 'https://compras.test/api/documento-modelo',
|
|
63
63
|
method: 'GET',
|
|
64
64
|
data: {
|
|
65
65
|
usuario: 'usuario',
|
package/src/ckeditor.ts
CHANGED
|
@@ -256,15 +256,6 @@ class Editor extends DecoupledEditor {
|
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
258
|
};
|
|
259
|
-
|
|
260
|
-
public static override create( sourceElementOrData, config ) {
|
|
261
|
-
console.log('CKEditor 5 is being created with the following config:', config);
|
|
262
|
-
return super.create( sourceElementOrData, config );
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
public static override destroy() {
|
|
266
|
-
return super.destroy();
|
|
267
|
-
}
|
|
268
259
|
}
|
|
269
260
|
|
|
270
261
|
export default { Editor, EditorWatchdog };
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2023, 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 ui/list/listitemview
|
|
7
|
-
*/
|
|
8
|
-
import View from '@ckeditor/ckeditor5-ui/src/view';
|
|
9
|
-
import type ViewCollection from '@ckeditor/ckeditor5-ui/src/viewcollection';
|
|
10
|
-
import type { Locale } from '@ckeditor/ckeditor5-utils';
|
|
11
|
-
/**
|
|
12
|
-
* The list item view class.
|
|
13
|
-
*/
|
|
14
|
-
export default class ListItemView extends View {
|
|
15
|
-
/**
|
|
16
|
-
* Collection of the child views inside of the list item {@link #element}.
|
|
17
|
-
*/
|
|
18
|
-
readonly children: ViewCollection;
|
|
19
|
-
/**
|
|
20
|
-
* Controls whether the item view is visible. Visible by default, list items are hidden
|
|
21
|
-
* using a CSS class.
|
|
22
|
-
*
|
|
23
|
-
* @observable
|
|
24
|
-
* @default true
|
|
25
|
-
*/
|
|
26
|
-
isVisible: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* @inheritDoc
|
|
29
|
-
*/
|
|
30
|
-
constructor(locale?: Locale);
|
|
31
|
-
/**
|
|
32
|
-
* Focuses the list item.
|
|
33
|
-
*/
|
|
34
|
-
focus(): void;
|
|
35
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2023, 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 ui/list/listitemview
|
|
7
|
+
*/
|
|
8
|
+
import View from '@ckeditor/ckeditor5-ui/src/view';
|
|
9
|
+
import type ViewCollection from '@ckeditor/ckeditor5-ui/src/viewcollection';
|
|
10
|
+
import type { Locale } from '@ckeditor/ckeditor5-utils';
|
|
11
|
+
/**
|
|
12
|
+
* The list item view class.
|
|
13
|
+
*/
|
|
14
|
+
export default class ListItemView extends View {
|
|
15
|
+
/**
|
|
16
|
+
* Collection of the child views inside of the list item {@link #element}.
|
|
17
|
+
*/
|
|
18
|
+
readonly children: ViewCollection;
|
|
19
|
+
/**
|
|
20
|
+
* Controls whether the item view is visible. Visible by default, list items are hidden
|
|
21
|
+
* using a CSS class.
|
|
22
|
+
*
|
|
23
|
+
* @observable
|
|
24
|
+
* @default true
|
|
25
|
+
*/
|
|
26
|
+
isVisible: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* @inheritDoc
|
|
29
|
+
*/
|
|
30
|
+
constructor(locale?: Locale);
|
|
31
|
+
/**
|
|
32
|
+
* Focuses the list item.
|
|
33
|
+
*/
|
|
34
|
+
focus(): void;
|
|
35
|
+
}
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2023, 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 ui/list/listitemview
|
|
7
|
-
*/
|
|
8
|
-
import View from '@ckeditor/ckeditor5-ui/src/view';
|
|
9
|
-
/**
|
|
10
|
-
* The list item view class.
|
|
11
|
-
*/
|
|
12
|
-
export default class ListItemView extends View {
|
|
13
|
-
/**
|
|
14
|
-
* @inheritDoc
|
|
15
|
-
*/
|
|
16
|
-
constructor(locale) {
|
|
17
|
-
super(locale);
|
|
18
|
-
const bind = this.bindTemplate;
|
|
19
|
-
this.set('isVisible', true);
|
|
20
|
-
this.children = this.createCollection();
|
|
21
|
-
this.setTemplate({
|
|
22
|
-
tag: 'div',
|
|
23
|
-
attributes: {
|
|
24
|
-
class: [
|
|
25
|
-
'ck',
|
|
26
|
-
'ck-list-properties',
|
|
27
|
-
'ck-list-properties_with',
|
|
28
|
-
'ck-list-numbered-properties',
|
|
29
|
-
bind.if('isVisible', 'ck-hidden', value => !value)
|
|
30
|
-
],
|
|
31
|
-
role: 'presentation'
|
|
32
|
-
},
|
|
33
|
-
children: this.children
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Focuses the list item.
|
|
38
|
-
*/
|
|
39
|
-
focus() {
|
|
40
|
-
this.children.first.focus();
|
|
41
|
-
}
|
|
42
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2023, 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 ui/list/listitemview
|
|
7
|
+
*/
|
|
8
|
+
import View from '@ckeditor/ckeditor5-ui/src/view';
|
|
9
|
+
/**
|
|
10
|
+
* The list item view class.
|
|
11
|
+
*/
|
|
12
|
+
export default class ListItemView extends View {
|
|
13
|
+
/**
|
|
14
|
+
* @inheritDoc
|
|
15
|
+
*/
|
|
16
|
+
constructor(locale) {
|
|
17
|
+
super(locale);
|
|
18
|
+
const bind = this.bindTemplate;
|
|
19
|
+
this.set('isVisible', true);
|
|
20
|
+
this.children = this.createCollection();
|
|
21
|
+
this.setTemplate({
|
|
22
|
+
tag: 'div',
|
|
23
|
+
attributes: {
|
|
24
|
+
class: [
|
|
25
|
+
'ck',
|
|
26
|
+
'ck-list-properties',
|
|
27
|
+
'ck-list-properties_with',
|
|
28
|
+
'ck-list-numbered-properties',
|
|
29
|
+
bind.if('isVisible', 'ck-hidden', value => !value)
|
|
30
|
+
],
|
|
31
|
+
role: 'presentation'
|
|
32
|
+
},
|
|
33
|
+
children: this.children
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Focuses the list item.
|
|
38
|
+
*/
|
|
39
|
+
focus() {
|
|
40
|
+
this.children.first.focus();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2023, 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 ui/list/listview
|
|
7
|
-
*/
|
|
8
|
-
import View from '@ckeditor/ckeditor5-ui/src/view';
|
|
9
|
-
import type DropdownPanelFocusable from '@ckeditor/ckeditor5-ui/src/dropdown/dropdownpanelfocusable';
|
|
10
|
-
import type ViewCollection from '@ckeditor/ckeditor5-ui/src/viewcollection';
|
|
11
|
-
import { FocusTracker, KeystrokeHandler, type Locale } from '@ckeditor/ckeditor5-utils';
|
|
12
|
-
import '@ckeditor/ckeditor5-ui/theme/components/list/list.css';
|
|
13
|
-
/**
|
|
14
|
-
* The list view class.
|
|
15
|
-
*/
|
|
16
|
-
export default class ListView extends View<HTMLUListElement> implements DropdownPanelFocusable {
|
|
17
|
-
/**
|
|
18
|
-
* Collection of the child list views.
|
|
19
|
-
*/
|
|
20
|
-
readonly items: ViewCollection;
|
|
21
|
-
/**
|
|
22
|
-
* Tracks information about DOM focus in the list.
|
|
23
|
-
*/
|
|
24
|
-
readonly focusTracker: FocusTracker;
|
|
25
|
-
/**
|
|
26
|
-
* Instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
|
|
27
|
-
*/
|
|
28
|
-
readonly keystrokes: KeystrokeHandler;
|
|
29
|
-
/**
|
|
30
|
-
* Label used by assistive technologies to describe this list element.
|
|
31
|
-
*
|
|
32
|
-
* @observable
|
|
33
|
-
*/
|
|
34
|
-
ariaLabel: string | undefined;
|
|
35
|
-
/**
|
|
36
|
-
* The property reflected by the `role` DOM attribute to be used by assistive technologies.
|
|
37
|
-
*
|
|
38
|
-
* @observable
|
|
39
|
-
*/
|
|
40
|
-
role: string | undefined;
|
|
41
|
-
/**
|
|
42
|
-
* Helps cycling over focusable {@link #items} in the list.
|
|
43
|
-
*/
|
|
44
|
-
private readonly _focusCycler;
|
|
45
|
-
/**
|
|
46
|
-
* @inheritDoc
|
|
47
|
-
*/
|
|
48
|
-
constructor(locale?: Locale);
|
|
49
|
-
/**
|
|
50
|
-
* @inheritDoc
|
|
51
|
-
*/
|
|
52
|
-
render(): void;
|
|
53
|
-
/**
|
|
54
|
-
* @inheritDoc
|
|
55
|
-
*/
|
|
56
|
-
destroy(): void;
|
|
57
|
-
/**
|
|
58
|
-
* Focuses the first focusable in {@link #items}.
|
|
59
|
-
*/
|
|
60
|
-
focus(): void;
|
|
61
|
-
/**
|
|
62
|
-
* Focuses the last focusable in {@link #items}.
|
|
63
|
-
*/
|
|
64
|
-
focusLast(): void;
|
|
65
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2023, 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 ui/list/listview
|
|
7
|
+
*/
|
|
8
|
+
import View from '@ckeditor/ckeditor5-ui/src/view';
|
|
9
|
+
import type DropdownPanelFocusable from '@ckeditor/ckeditor5-ui/src/dropdown/dropdownpanelfocusable';
|
|
10
|
+
import type ViewCollection from '@ckeditor/ckeditor5-ui/src/viewcollection';
|
|
11
|
+
import { FocusTracker, KeystrokeHandler, type Locale } from '@ckeditor/ckeditor5-utils';
|
|
12
|
+
import '@ckeditor/ckeditor5-ui/theme/components/list/list.css';
|
|
13
|
+
/**
|
|
14
|
+
* The list view class.
|
|
15
|
+
*/
|
|
16
|
+
export default class ListView extends View<HTMLUListElement> implements DropdownPanelFocusable {
|
|
17
|
+
/**
|
|
18
|
+
* Collection of the child list views.
|
|
19
|
+
*/
|
|
20
|
+
readonly items: ViewCollection;
|
|
21
|
+
/**
|
|
22
|
+
* Tracks information about DOM focus in the list.
|
|
23
|
+
*/
|
|
24
|
+
readonly focusTracker: FocusTracker;
|
|
25
|
+
/**
|
|
26
|
+
* Instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
|
|
27
|
+
*/
|
|
28
|
+
readonly keystrokes: KeystrokeHandler;
|
|
29
|
+
/**
|
|
30
|
+
* Label used by assistive technologies to describe this list element.
|
|
31
|
+
*
|
|
32
|
+
* @observable
|
|
33
|
+
*/
|
|
34
|
+
ariaLabel: string | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* The property reflected by the `role` DOM attribute to be used by assistive technologies.
|
|
37
|
+
*
|
|
38
|
+
* @observable
|
|
39
|
+
*/
|
|
40
|
+
role: string | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Helps cycling over focusable {@link #items} in the list.
|
|
43
|
+
*/
|
|
44
|
+
private readonly _focusCycler;
|
|
45
|
+
/**
|
|
46
|
+
* @inheritDoc
|
|
47
|
+
*/
|
|
48
|
+
constructor(locale?: Locale);
|
|
49
|
+
/**
|
|
50
|
+
* @inheritDoc
|
|
51
|
+
*/
|
|
52
|
+
render(): void;
|
|
53
|
+
/**
|
|
54
|
+
* @inheritDoc
|
|
55
|
+
*/
|
|
56
|
+
destroy(): void;
|
|
57
|
+
/**
|
|
58
|
+
* Focuses the first focusable in {@link #items}.
|
|
59
|
+
*/
|
|
60
|
+
focus(): void;
|
|
61
|
+
/**
|
|
62
|
+
* Focuses the last focusable in {@link #items}.
|
|
63
|
+
*/
|
|
64
|
+
focusLast(): void;
|
|
65
|
+
}
|
|
@@ -1,92 +1,92 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2023, 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 ui/list/listview
|
|
7
|
-
*/
|
|
8
|
-
import View from '@ckeditor/ckeditor5-ui/src/view';
|
|
9
|
-
import FocusCycler from '@ckeditor/ckeditor5-ui/src/focuscycler';
|
|
10
|
-
import { FocusTracker, KeystrokeHandler } from '@ckeditor/ckeditor5-utils';
|
|
11
|
-
import '@ckeditor/ckeditor5-ui/theme/components/list/list.css';
|
|
12
|
-
/**
|
|
13
|
-
* The list view class.
|
|
14
|
-
*/
|
|
15
|
-
export default class ListView extends View {
|
|
16
|
-
/**
|
|
17
|
-
* @inheritDoc
|
|
18
|
-
*/
|
|
19
|
-
constructor(locale) {
|
|
20
|
-
super(locale);
|
|
21
|
-
const bind = this.bindTemplate;
|
|
22
|
-
this.items = this.createCollection();
|
|
23
|
-
this.focusTracker = new FocusTracker();
|
|
24
|
-
this.keystrokes = new KeystrokeHandler();
|
|
25
|
-
this._focusCycler = new FocusCycler({
|
|
26
|
-
focusables: this.items,
|
|
27
|
-
focusTracker: this.focusTracker,
|
|
28
|
-
keystrokeHandler: this.keystrokes,
|
|
29
|
-
actions: {
|
|
30
|
-
// Navigate list items backwards using the arrowup key.
|
|
31
|
-
focusPrevious: 'arrowup',
|
|
32
|
-
// Navigate toolbar items forwards using the arrowdown key.
|
|
33
|
-
focusNext: 'arrowdown'
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
this.set('ariaLabel', undefined);
|
|
37
|
-
this.set('role', undefined);
|
|
38
|
-
this.setTemplate({
|
|
39
|
-
tag: 'div',
|
|
40
|
-
attributes: {
|
|
41
|
-
class: [
|
|
42
|
-
//ck ck-list-styles-list
|
|
43
|
-
'ck',
|
|
44
|
-
//ck ck-reset ck-dropdown__panel ck-dropdown__panel_se
|
|
45
|
-
'ck-list-styles-list',
|
|
46
|
-
'ck-numlist-panel'
|
|
47
|
-
],
|
|
48
|
-
role: bind.to('role'),
|
|
49
|
-
'aria-label': bind.to('ariaLabel')
|
|
50
|
-
},
|
|
51
|
-
children: this.items
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* @inheritDoc
|
|
56
|
-
*/
|
|
57
|
-
render() {
|
|
58
|
-
super.render();
|
|
59
|
-
// Items added before rendering should be known to the #focusTracker.
|
|
60
|
-
for (const item of this.items) {
|
|
61
|
-
this.focusTracker.add(item.element);
|
|
62
|
-
}
|
|
63
|
-
this.items.on('add', (evt, item) => {
|
|
64
|
-
this.focusTracker.add(item.element);
|
|
65
|
-
});
|
|
66
|
-
this.items.on('remove', (evt, item) => {
|
|
67
|
-
this.focusTracker.remove(item.element);
|
|
68
|
-
});
|
|
69
|
-
// Start listening for the keystrokes coming from #element.
|
|
70
|
-
this.keystrokes.listenTo(this.element);
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* @inheritDoc
|
|
74
|
-
*/
|
|
75
|
-
destroy() {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Focuses the first focusable in {@link #items}.
|
|
82
|
-
*/
|
|
83
|
-
focus() {
|
|
84
|
-
this._focusCycler.focusFirst();
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Focuses the last focusable in {@link #items}.
|
|
88
|
-
*/
|
|
89
|
-
focusLast() {
|
|
90
|
-
this._focusCycler.focusLast();
|
|
91
|
-
}
|
|
92
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2023, 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 ui/list/listview
|
|
7
|
+
*/
|
|
8
|
+
import View from '@ckeditor/ckeditor5-ui/src/view';
|
|
9
|
+
import FocusCycler from '@ckeditor/ckeditor5-ui/src/focuscycler';
|
|
10
|
+
import { FocusTracker, KeystrokeHandler } from '@ckeditor/ckeditor5-utils';
|
|
11
|
+
import '@ckeditor/ckeditor5-ui/theme/components/list/list.css';
|
|
12
|
+
/**
|
|
13
|
+
* The list view class.
|
|
14
|
+
*/
|
|
15
|
+
export default class ListView extends View {
|
|
16
|
+
/**
|
|
17
|
+
* @inheritDoc
|
|
18
|
+
*/
|
|
19
|
+
constructor(locale) {
|
|
20
|
+
super(locale);
|
|
21
|
+
const bind = this.bindTemplate;
|
|
22
|
+
this.items = this.createCollection();
|
|
23
|
+
this.focusTracker = new FocusTracker();
|
|
24
|
+
this.keystrokes = new KeystrokeHandler();
|
|
25
|
+
this._focusCycler = new FocusCycler({
|
|
26
|
+
focusables: this.items,
|
|
27
|
+
focusTracker: this.focusTracker,
|
|
28
|
+
keystrokeHandler: this.keystrokes,
|
|
29
|
+
actions: {
|
|
30
|
+
// Navigate list items backwards using the arrowup key.
|
|
31
|
+
focusPrevious: 'arrowup',
|
|
32
|
+
// Navigate toolbar items forwards using the arrowdown key.
|
|
33
|
+
focusNext: 'arrowdown'
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
this.set('ariaLabel', undefined);
|
|
37
|
+
this.set('role', undefined);
|
|
38
|
+
this.setTemplate({
|
|
39
|
+
tag: 'div',
|
|
40
|
+
attributes: {
|
|
41
|
+
class: [
|
|
42
|
+
//ck ck-list-styles-list
|
|
43
|
+
'ck',
|
|
44
|
+
//ck ck-reset ck-dropdown__panel ck-dropdown__panel_se
|
|
45
|
+
'ck-list-styles-list',
|
|
46
|
+
'ck-numlist-panel'
|
|
47
|
+
],
|
|
48
|
+
role: bind.to('role'),
|
|
49
|
+
'aria-label': bind.to('ariaLabel')
|
|
50
|
+
},
|
|
51
|
+
children: this.items
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* @inheritDoc
|
|
56
|
+
*/
|
|
57
|
+
render() {
|
|
58
|
+
super.render();
|
|
59
|
+
// Items added before rendering should be known to the #focusTracker.
|
|
60
|
+
for (const item of this.items) {
|
|
61
|
+
this.focusTracker.add(item.element);
|
|
62
|
+
}
|
|
63
|
+
this.items.on('add', (evt, item) => {
|
|
64
|
+
this.focusTracker.add(item.element);
|
|
65
|
+
});
|
|
66
|
+
this.items.on('remove', (evt, item) => {
|
|
67
|
+
this.focusTracker.remove(item.element);
|
|
68
|
+
});
|
|
69
|
+
// Start listening for the keystrokes coming from #element.
|
|
70
|
+
this.keystrokes.listenTo(this.element);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* @inheritDoc
|
|
74
|
+
*/
|
|
75
|
+
destroy() {
|
|
76
|
+
super.destroy();
|
|
77
|
+
this.focusTracker.destroy();
|
|
78
|
+
this.keystrokes.destroy();
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Focuses the first focusable in {@link #items}.
|
|
82
|
+
*/
|
|
83
|
+
focus() {
|
|
84
|
+
this._focusCycler.focusFirst();
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Focuses the last focusable in {@link #items}.
|
|
88
|
+
*/
|
|
89
|
+
focusLast() {
|
|
90
|
+
this._focusCycler.focusLast();
|
|
91
|
+
}
|
|
92
|
+
}
|
package/src/css/custom.css
CHANGED
|
@@ -127,6 +127,15 @@ export default class NumberedDivListSplit extends Plugin {
|
|
|
127
127
|
});
|
|
128
128
|
});
|
|
129
129
|
|
|
130
|
+
// Limpeza
|
|
131
|
+
split.on('destroy', () => {
|
|
132
|
+
try { panel.destroy(); } catch {}
|
|
133
|
+
// @ts-ignore
|
|
134
|
+
window.removeEventListener('scroll', onScrollOrResize, true);
|
|
135
|
+
// @ts-ignore
|
|
136
|
+
window.removeEventListener('resize', onScrollOrResize, true);
|
|
137
|
+
});
|
|
138
|
+
|
|
130
139
|
// Habilita/desabilita conforme comandos
|
|
131
140
|
const toggleCmd: any = editor.commands.get('toggleNumberedDivList');
|
|
132
141
|
if (toggleCmd) {
|
|
@@ -309,8 +309,7 @@ export default class NumberedDivList extends Plugin {
|
|
|
309
309
|
|
|
310
310
|
|
|
311
311
|
editor.model.document.on('change:data', () => {
|
|
312
|
-
|
|
313
|
-
executeForceList(editor, config);
|
|
312
|
+
executeForceList(editor, config);
|
|
314
313
|
});
|
|
315
314
|
|
|
316
315
|
|
|
@@ -320,7 +319,6 @@ export default class NumberedDivList extends Plugin {
|
|
|
320
319
|
|
|
321
320
|
// quando o editor for inicializado, dispara o change:data uma vez
|
|
322
321
|
editor.on('ready', () => {
|
|
323
|
-
const config = toolbar!.listaNumeradaOptions || {};
|
|
324
322
|
executeForceList(editor, config);
|
|
325
323
|
});
|
|
326
324
|
|