@ckeditor/ckeditor5-template 39.0.2 → 40.0.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/build/template.js +2 -2
- package/build/translations/ar.js +1 -1
- package/build/translations/bg.js +1 -1
- package/build/translations/bn.js +1 -1
- package/build/translations/ca.js +1 -1
- package/build/translations/cs.js +1 -1
- package/build/translations/da.js +1 -1
- package/build/translations/de.js +1 -1
- package/build/translations/el.js +1 -1
- package/build/translations/en-au.js +1 -1
- package/build/translations/es.js +1 -1
- package/build/translations/et.js +1 -1
- package/build/translations/fi.js +1 -1
- package/build/translations/fr.js +1 -1
- package/build/translations/gl.js +1 -1
- package/build/translations/he.js +1 -1
- package/build/translations/hi.js +1 -1
- package/build/translations/hr.js +1 -1
- package/build/translations/hu.js +1 -1
- package/build/translations/id.js +1 -1
- package/build/translations/it.js +1 -1
- package/build/translations/ja.js +1 -1
- package/build/translations/ko.js +1 -1
- package/build/translations/lt.js +1 -1
- package/build/translations/lv.js +1 -1
- package/build/translations/ms.js +1 -1
- package/build/translations/nl.js +1 -1
- package/build/translations/no.js +1 -1
- package/build/translations/pl.js +1 -1
- package/build/translations/pt-br.js +1 -1
- package/build/translations/pt.js +1 -1
- package/build/translations/ro.js +1 -1
- package/build/translations/ru.js +1 -1
- package/build/translations/sk.js +1 -1
- package/build/translations/sr.js +1 -1
- package/build/translations/sv.js +1 -1
- package/build/translations/th.js +1 -1
- package/build/translations/tr.js +1 -1
- package/build/translations/uk.js +1 -1
- package/build/translations/uz.js +1 -1
- package/build/translations/vi.js +1 -1
- package/build/translations/zh-cn.js +1 -1
- package/build/translations/zh.js +1 -1
- package/lang/contexts.json +1 -2
- package/lang/translations/ar.po +0 -4
- package/lang/translations/bg.po +0 -4
- package/lang/translations/bn.po +0 -4
- package/lang/translations/ca.po +0 -4
- package/lang/translations/cs.po +0 -4
- package/lang/translations/da.po +0 -4
- package/lang/translations/de.po +0 -4
- package/lang/translations/el.po +0 -4
- package/lang/translations/en-au.po +0 -4
- package/lang/translations/en.po +0 -4
- package/lang/translations/es.po +0 -4
- package/lang/translations/et.po +0 -4
- package/lang/translations/fi.po +0 -4
- package/lang/translations/fr.po +0 -4
- package/lang/translations/gl.po +0 -4
- package/lang/translations/he.po +0 -4
- package/lang/translations/hi.po +0 -4
- package/lang/translations/hr.po +0 -4
- package/lang/translations/hu.po +0 -4
- package/lang/translations/id.po +0 -4
- package/lang/translations/it.po +0 -4
- package/lang/translations/ja.po +0 -4
- package/lang/translations/ko.po +0 -4
- package/lang/translations/lt.po +0 -4
- package/lang/translations/lv.po +0 -4
- package/lang/translations/ms.po +0 -4
- package/lang/translations/nl.po +0 -4
- package/lang/translations/no.po +0 -4
- package/lang/translations/pl.po +0 -4
- package/lang/translations/pt-br.po +0 -4
- package/lang/translations/pt.po +0 -4
- package/lang/translations/ro.po +0 -4
- package/lang/translations/ru.po +0 -4
- package/lang/translations/sk.po +0 -4
- package/lang/translations/sr.po +0 -4
- package/lang/translations/sv.po +0 -4
- package/lang/translations/th.po +0 -4
- package/lang/translations/tr.po +0 -4
- package/lang/translations/uk.po +0 -4
- package/lang/translations/uz.po +0 -4
- package/lang/translations/vi.po +0 -4
- package/lang/translations/zh-cn.po +0 -4
- package/lang/translations/zh.po +0 -4
- package/package.json +3 -4
- package/src/augmentation.d.ts +23 -23
- package/src/index.d.ts +13 -13
- package/src/index.js +1 -1
- package/src/template.d.ts +115 -115
- package/src/template.js +1 -1
- package/src/templatecommand.d.ts +23 -23
- package/src/templatecommand.js +1 -1
- package/src/templateediting.d.ts +30 -30
- package/src/templateediting.js +1 -1
- package/src/templateui.d.ts +29 -29
- package/src/templateui.js +1 -1
- package/src/ui/templatelistbuttonview.d.ts +104 -104
- package/src/ui/templatelistbuttonview.js +1 -1
- package/src/ui/templatelistitemview.d.ts +34 -34
- package/src/ui/templatelistitemview.js +1 -1
- package/src/ui/templatelistview.d.ts +38 -0
- package/src/ui/templatelistview.js +23 -0
- package/theme/template.css +95 -187
- package/build/translations/sq.js +0 -1
- package/lang/translations/sq.po +0 -42
- package/src/ui/templateforminfoview.d.ts +0 -51
- package/src/ui/templateforminfoview.js +0 -23
- package/src/ui/templateformsearchfieldview.d.ts +0 -43
- package/src/ui/templateformsearchfieldview.js +0 -23
- package/src/ui/templateformview.d.ts +0 -110
- package/src/ui/templateformview.js +0 -23
- package/theme/icons/loupe.svg +0 -1
|
@@ -1,110 +0,0 @@
|
|
|
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 template/ui/templateformview
|
|
7
|
-
*/
|
|
8
|
-
import { FocusTracker, KeystrokeHandler, type Locale } from 'ckeditor5/src/utils';
|
|
9
|
-
import { View, ListView, type ViewCollection } from 'ckeditor5/src/ui';
|
|
10
|
-
import TemplateFormInfoView from './templateforminfoview';
|
|
11
|
-
import TemplateFormSearchFieldView from './templateformsearchfieldview';
|
|
12
|
-
import { type TemplateDefinition } from '../template';
|
|
13
|
-
/**
|
|
14
|
-
* A class representing the panel with a list of available templates.
|
|
15
|
-
*
|
|
16
|
-
* @extends module:ui/view~View
|
|
17
|
-
*/
|
|
18
|
-
export default class TemplateFormView extends View {
|
|
19
|
-
/**
|
|
20
|
-
* Tracks information about the DOM focus in the form.
|
|
21
|
-
*
|
|
22
|
-
* @readonly
|
|
23
|
-
*/
|
|
24
|
-
focusTracker: FocusTracker;
|
|
25
|
-
/**
|
|
26
|
-
* An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
|
|
27
|
-
*
|
|
28
|
-
* @readonly
|
|
29
|
-
*/
|
|
30
|
-
keystrokes: KeystrokeHandler;
|
|
31
|
-
/**
|
|
32
|
-
* The definition of the template that the button will apply when executed.
|
|
33
|
-
*
|
|
34
|
-
* @readonly
|
|
35
|
-
*/
|
|
36
|
-
templatesDefinitions: Array<TemplateDefinition>;
|
|
37
|
-
/**
|
|
38
|
-
* The templates list view.
|
|
39
|
-
*/
|
|
40
|
-
templateListView: TemplateListView;
|
|
41
|
-
/**
|
|
42
|
-
* A search text field allowing to filter the {@link #templateListView list of templates}.
|
|
43
|
-
*/
|
|
44
|
-
searchFieldView: TemplateFormSearchFieldView;
|
|
45
|
-
/**
|
|
46
|
-
* A view displaying information text when the feature is not configured or no templates were
|
|
47
|
-
* found for the particular phrase.
|
|
48
|
-
*/
|
|
49
|
-
infoView: TemplateFormInfoView;
|
|
50
|
-
/**
|
|
51
|
-
* The collection of the child views inside of the list item {@link #element}.
|
|
52
|
-
*
|
|
53
|
-
* @readonly
|
|
54
|
-
*/
|
|
55
|
-
children: ViewCollection;
|
|
56
|
-
/**
|
|
57
|
-
* Creates an instance of the {@link module:template/ui/templateformview~TemplateFormView} class.
|
|
58
|
-
*
|
|
59
|
-
* @param locale The localization services instance.
|
|
60
|
-
* @param templatesDefinitions Definitions of the templates.
|
|
61
|
-
*/
|
|
62
|
-
constructor(locale: Locale, templatesDefinitions: Array<TemplateDefinition>);
|
|
63
|
-
/**
|
|
64
|
-
* @inheritDoc
|
|
65
|
-
*/
|
|
66
|
-
render(): void;
|
|
67
|
-
/**
|
|
68
|
-
* Focuses the {@link #searchFieldView} if some templates were configured.
|
|
69
|
-
*/
|
|
70
|
-
focus(): void;
|
|
71
|
-
/**
|
|
72
|
-
* Resets the form to its initial state (no search query, all available templates are listed).
|
|
73
|
-
*/
|
|
74
|
-
reset(): void;
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* The template list view class with filtering and sorting.
|
|
78
|
-
*
|
|
79
|
-
* @private
|
|
80
|
-
*/
|
|
81
|
-
declare class TemplateListView extends ListView {
|
|
82
|
-
/**
|
|
83
|
-
* Filters the list of templates according to a specified regular expression. The filtered list is sorted so that items that
|
|
84
|
-
* match the regular expression in their titles are displayed first.
|
|
85
|
-
*
|
|
86
|
-
* Matching items highlight the regular expression (query) in their titles and/or descriptions.
|
|
87
|
-
*
|
|
88
|
-
* See {@link #unfilter}.
|
|
89
|
-
*
|
|
90
|
-
* **Note**: The `Collection` (also `ViewCollection`) class does not provide sorting functionality. Thus, the functionality
|
|
91
|
-
* implemented in this method is **extremely inefficient** because it clones the entire collection, sorts it as an array,
|
|
92
|
-
* then purges the original collection and sets it from scratch with the sorted array. Purging and resetting the
|
|
93
|
-
* collection triggers an avalanche of `add` and `remove` events synchronously handled by the `Template` (UI bindings)
|
|
94
|
-
* and **rendered in the DOM**. As long as sorting takes shorter than rendering of the DOM this should not be noticeable
|
|
95
|
-
* but the moment it does not, the UI will start glitching. A proper `Collection#sort` is needed to work around
|
|
96
|
-
* this overhead (see https://github.com/ckeditor/ckeditor5/issues/2065).
|
|
97
|
-
*
|
|
98
|
-
* @param regExp A regular expression used to match the list title and description.
|
|
99
|
-
* @returns True if some list items matched the regular expression. False otherwise.
|
|
100
|
-
*/
|
|
101
|
-
filter(regExp: RegExp): boolean;
|
|
102
|
-
/**
|
|
103
|
-
* Resets the filtering of the list of templates. Removes highlighting in titles and descriptions
|
|
104
|
-
* of list items and restores the default order of the list (as in editor configuration).
|
|
105
|
-
*
|
|
106
|
-
* See {@link #filter}.
|
|
107
|
-
*/
|
|
108
|
-
unfilter(): void;
|
|
109
|
-
}
|
|
110
|
-
export {};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* +---------------------------------------------------------------------------------+
|
|
8
|
-
* | |
|
|
9
|
-
* | Hello stranger! |
|
|
10
|
-
* | |
|
|
11
|
-
* | |
|
|
12
|
-
* | What you're currently looking at is the source code of a legally protected, |
|
|
13
|
-
* | proprietary software. Any attempts to deobfuscate / disassemble this code |
|
|
14
|
-
* | are forbidden and will result in legal consequences. |
|
|
15
|
-
* | |
|
|
16
|
-
* | |
|
|
17
|
-
* +---------------------------------------------------------------------------------+
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*/
|
|
23
|
-
const _0x4d17=['set','templateDefinition','add','shift\x20+\x20tab','searchFieldView','originalIndex','arrowdown','stopPropagation','items','forEach','get','children','element','sort','execute','unfilter','isVisible','render','infoView','focus','addMany','tab','setTemplate','arrowup','clear','arrowleft','extendTemplate','_createTemplateListView','title','length','focusTracker','_filterTemplates','keystrokes','map','toLowerCase','_createSearchFieldView','ck-template-form','value','templatesDefinitions','includes','setNoTemplatesAvailableText','buttonView','fieldView','reset','arrowright','highlightText','input','delegate','isMatching','filter','templateListView','listenTo'];(function(_0x39cad5,_0x4d17e3){const _0x524920=function(_0x411883){while(--_0x411883){_0x39cad5['push'](_0x39cad5['shift']());}};_0x524920(++_0x4d17e3);}(_0x4d17,0x156));const _0x5249=function(_0x39cad5,_0x4d17e3){_0x39cad5=_0x39cad5-0x0;let _0x524920=_0x4d17[_0x39cad5];return _0x524920;};import{FocusTracker as _0x3dc2e9,KeystrokeHandler as _0x526266}from'ckeditor5/src/utils';import{View as _0x1d677a,ListView as _0x2a9124,createLabeledInputText as _0x174173,FocusCycler as _0x40de72,injectCssTransitionDisabler as _0x26fcb8}from'ckeditor5/src/ui';import _0x1f73a7 from'./templatelistbuttonview';import _0x581fd4 from'./templateforminfoview';import _0x225ef4 from'./templateformsearchfieldview';import{escapeRegExp as _0x52849d}from'lodash-es';import _0x4f13e9 from'./templatelistitemview';export default class f extends _0x1d677a{constructor(_0x141184,_0xadc506){super(_0x141184),this[_0x5249('0x0')]=new _0x3dc2e9(),this['keystrokes']=new _0x526266(),this[_0x5249('0x8')]=_0xadc506,this[_0x5249('0x14')]=this[_0x5249('0x31')](_0x141184,_0xadc506),this[_0x5249('0x1a')]=this['_createSearchFieldView'](_0x141184),this[_0x5249('0x28')]=new _0x581fd4(_0x141184),_0xadc506[_0x5249('0x33')]||(this[_0x5249('0x28')][_0x5249('0x26')]=!0x0,this[_0x5249('0x28')][_0x5249('0xa')]()),this[_0x5249('0x21')]=this['createCollection'](_0xadc506['length']?[this['searchFieldView'],this[_0x5249('0x28')],this[_0x5249('0x14')]]:[this[_0x5249('0x28')]]),this['_focusCycler']=new _0x40de72({'focusables':this[_0x5249('0x21')],'focusTracker':this[_0x5249('0x0')],'keystrokeHandler':this[_0x5249('0x2')],'actions':{'focusPrevious':_0x5249('0x19'),'focusNext':_0x5249('0x2b')}}),this[_0x5249('0x2c')]({'tag':'div','attributes':{'class':['ck',_0x5249('0x6')],'tabindex':'-1'},'children':this[_0x5249('0x21')]}),_0x26fcb8(this);}[_0x5249('0x27')](){if(super[_0x5249('0x27')](),!this['templatesDefinitions'][_0x5249('0x33')])return;const _0x18de6f=_0x12d9bc=>_0x12d9bc[_0x5249('0x1d')]();this[_0x5249('0x0')][_0x5249('0x18')](this[_0x5249('0x1a')][_0x5249('0x22')]),this[_0x5249('0x0')][_0x5249('0x18')](this[_0x5249('0x14')]['element']),this[_0x5249('0x2')][_0x5249('0x15')](this[_0x5249('0x22')]),this[_0x5249('0x2')][_0x5249('0x16')](_0x5249('0xe'),_0x18de6f),this[_0x5249('0x2')]['set'](_0x5249('0x2f'),_0x18de6f),this['keystrokes']['set'](_0x5249('0x2d'),_0x18de6f),this[_0x5249('0x2')][_0x5249('0x16')](_0x5249('0x1c'),_0x18de6f);}[_0x5249('0x29')](){this[_0x5249('0x8')][_0x5249('0x33')]&&this[_0x5249('0x1a')][_0x5249('0x29')]();}[_0x5249('0xd')](){this[_0x5249('0x8')][_0x5249('0x33')]&&(this[_0x5249('0x1a')]['reset'](),this[_0x5249('0x1')]());}[_0x5249('0x1')](_0x5cafbc){if(!this[_0x5249('0x8')][_0x5249('0x33')])return;let _0x1ff121=!0x1;if(_0x5cafbc)for(const _0x5bd2b7 of this['templateListView'][_0x5249('0x1e')]){_0x5bd2b7[_0x5249('0x21')]['first'][_0x5249('0x17')]['title'][_0x5249('0x4')]()[_0x5249('0x9')](_0x5cafbc['toLowerCase']())?_0x5bd2b7[_0x5249('0x26')]=!0x0:_0x5bd2b7['isVisible']=!0x1;const _0x4eb37b=new RegExp(_0x52849d(_0x5cafbc),'ig');_0x1ff121=this[_0x5249('0x14')]['filter'](_0x4eb37b);}else this[_0x5249('0x14')][_0x5249('0x25')](),_0x1ff121=!0x0;this['infoView']['isVisible']=!_0x1ff121,_0x1ff121||this[_0x5249('0x28')]['setNoTemplatesFoundText'](_0x5cafbc);}[_0x5249('0x31')](_0x27f854,_0x1c8dd3){const _0x2ed2e5=new L(_0x27f854);return _0x2ed2e5[_0x5249('0x30')]({'attributes':{'class':['ck-template-list']}}),_0x2ed2e5[_0x5249('0x1e')]['addMany'](_0x1c8dd3[_0x5249('0x3')]((_0x262b43,_0x2c107a)=>{const _0x535c77=new _0x4f13e9(_0x27f854,_0x2c107a),_0x321e19=new _0x1f73a7(_0x27f854,_0x262b43);return _0x535c77['buttonView']=_0x321e19,_0x535c77[_0x5249('0x21')][_0x5249('0x18')](_0x321e19),_0x535c77['children'][_0x5249('0x11')](_0x5249('0x24'))['to'](this),_0x535c77;})),_0x2ed2e5;}[_0x5249('0x5')](_0x5a2b6e){const _0x2e7a87=new _0x225ef4(_0x5a2b6e,_0x174173);return this[_0x5249('0x15')](_0x2e7a87[_0x5249('0xc')],_0x5249('0x10'),()=>{this[_0x5249('0x1')](_0x2e7a87[_0x5249('0xc')][_0x5249('0x22')][_0x5249('0x7')]);}),_0x2e7a87['on'](_0x5249('0xd'),()=>{this[_0x5249('0xd')]();}),_0x2e7a87;}}class L extends _0x2a9124{[_0x5249('0x13')](_0xbde4fe){const _0x41b0d1=new Map(),_0x45569f=this[_0x5249('0x1e')][_0x5249('0x3')](_0x339f18=>{const _0x4dfea8=_0x339f18[_0x5249('0xb')][_0x5249('0x12')](_0xbde4fe);return _0x339f18[_0x5249('0x26')]=!!_0x4dfea8,_0x339f18[_0x5249('0xb')][_0x5249('0xf')](_0x4dfea8?_0xbde4fe:null),_0x4dfea8&&_0x41b0d1[_0x5249('0x16')](_0x339f18,_0x4dfea8),_0x339f18;})[_0x5249('0x23')](M)[_0x5249('0x23')]((_0x54458f,_0x1de351)=>{const _0x38ed0b=_0x41b0d1[_0x5249('0x20')](_0x54458f),_0x52ae82=_0x41b0d1[_0x5249('0x20')](_0x1de351);return _0x38ed0b&&!_0x52ae82?-0x1:_0x52ae82&&!_0x38ed0b?0x1:_0x38ed0b||_0x52ae82?_0x38ed0b[_0x5249('0x32')]&&!_0x52ae82[_0x5249('0x32')]?-0x1:!_0x38ed0b['title']&&_0x52ae82['title']?0x1:0x0:0x0;});return this[_0x5249('0x1e')][_0x5249('0x2e')](),this[_0x5249('0x1e')][_0x5249('0x2a')](_0x45569f),!!_0x41b0d1['size'];}['unfilter'](){const _0x170a7b=this[_0x5249('0x1e')][_0x5249('0x3')](_0xf4a444=>_0xf4a444)[_0x5249('0x23')](M);_0x170a7b[_0x5249('0x1f')](_0x374e2f=>{_0x374e2f[_0x5249('0x26')]=!0x0,_0x374e2f[_0x5249('0xb')][_0x5249('0xf')](null);}),this[_0x5249('0x1e')][_0x5249('0x2e')](),this['items'][_0x5249('0x2a')](_0x170a7b);}}function M(_0x30327d,_0x4cd068){return _0x30327d[_0x5249('0x1b')]-_0x4cd068[_0x5249('0x1b')];}
|
package/theme/icons/loupe.svg
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M12.68 13.74a6 6 0 1 1 1.355-1.474l4.267 4.268a1 1 0 1 1-1.414 1.414l-4.209-4.208ZM13 9a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z"/></svg>
|