@ckeditor/ckeditor5-template 0.0.1 → 38.0.0-rc.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/CHANGELOG.md +4 -0
- package/README.md +36 -3
- package/build/template.js +5 -0
- package/build/translations/ar.js +1 -0
- package/build/translations/bg.js +1 -0
- package/build/translations/bn.js +1 -0
- package/build/translations/ca.js +1 -0
- package/build/translations/cs.js +1 -0
- package/build/translations/da.js +1 -0
- package/build/translations/de.js +1 -0
- package/build/translations/el.js +1 -0
- package/build/translations/en-au.js +1 -0
- package/build/translations/es.js +1 -0
- package/build/translations/et.js +1 -0
- package/build/translations/fi.js +1 -0
- package/build/translations/fr.js +1 -0
- package/build/translations/he.js +1 -0
- package/build/translations/hi.js +1 -0
- package/build/translations/hr.js +1 -0
- package/build/translations/hu.js +1 -0
- package/build/translations/id.js +1 -0
- package/build/translations/it.js +1 -0
- package/build/translations/ja.js +1 -0
- package/build/translations/ko.js +1 -0
- package/build/translations/lt.js +1 -0
- package/build/translations/lv.js +1 -0
- package/build/translations/ms.js +1 -0
- package/build/translations/nl.js +1 -0
- package/build/translations/no.js +1 -0
- package/build/translations/pl.js +1 -0
- package/build/translations/pt-br.js +1 -0
- package/build/translations/pt.js +1 -0
- package/build/translations/ro.js +1 -0
- package/build/translations/ru.js +1 -0
- package/build/translations/sk.js +1 -0
- package/build/translations/sr.js +1 -0
- package/build/translations/sv.js +1 -0
- package/build/translations/th.js +1 -0
- package/build/translations/tr.js +1 -0
- package/build/translations/uk.js +1 -0
- package/build/translations/uz.js +1 -0
- package/build/translations/vi.js +1 -0
- package/build/translations/zh-cn.js +1 -0
- package/build/translations/zh.js +1 -0
- package/ckeditor5-metadata.json +18 -0
- package/lang/contexts.json +8 -0
- package/lang/translations/ar.po +41 -0
- package/lang/translations/bg.po +41 -0
- package/lang/translations/bn.po +41 -0
- package/lang/translations/ca.po +41 -0
- package/lang/translations/cs.po +41 -0
- package/lang/translations/da.po +41 -0
- package/lang/translations/de.po +41 -0
- package/lang/translations/el.po +41 -0
- package/lang/translations/en-au.po +41 -0
- package/lang/translations/en.po +41 -0
- package/lang/translations/es.po +41 -0
- package/lang/translations/et.po +41 -0
- package/lang/translations/fi.po +41 -0
- package/lang/translations/fr.po +41 -0
- package/lang/translations/he.po +41 -0
- package/lang/translations/hi.po +41 -0
- package/lang/translations/hr.po +41 -0
- package/lang/translations/hu.po +41 -0
- package/lang/translations/id.po +41 -0
- package/lang/translations/it.po +41 -0
- package/lang/translations/ja.po +41 -0
- package/lang/translations/ko.po +41 -0
- package/lang/translations/lt.po +41 -0
- package/lang/translations/lv.po +41 -0
- package/lang/translations/ms.po +41 -0
- package/lang/translations/nl.po +41 -0
- package/lang/translations/no.po +41 -0
- package/lang/translations/pl.po +41 -0
- package/lang/translations/pt-br.po +41 -0
- package/lang/translations/pt.po +41 -0
- package/lang/translations/ro.po +41 -0
- package/lang/translations/ru.po +41 -0
- package/lang/translations/sk.po +41 -0
- package/lang/translations/sr.po +41 -0
- package/lang/translations/sv.po +41 -0
- package/lang/translations/th.po +41 -0
- package/lang/translations/tr.po +41 -0
- package/lang/translations/uk.po +41 -0
- package/lang/translations/uz.po +41 -0
- package/lang/translations/vi.po +41 -0
- package/lang/translations/zh-cn.po +41 -0
- package/lang/translations/zh.po +41 -0
- package/package.json +36 -4
- package/src/augmentation.d.ts +23 -0
- package/src/augmentation.js +23 -0
- package/src/index.d.ts +13 -0
- package/src/index.js +23 -0
- package/src/template.d.ts +115 -0
- package/src/template.js +23 -0
- package/src/templatecommand.d.ts +23 -0
- package/src/templatecommand.js +23 -0
- package/src/templateediting.d.ts +26 -0
- package/src/templateediting.js +23 -0
- package/src/templateui.d.ts +29 -0
- package/src/templateui.js +23 -0
- package/src/ui/templateforminfoview.d.ts +51 -0
- package/src/ui/templateforminfoview.js +23 -0
- package/src/ui/templateformsearchfieldview.d.ts +43 -0
- package/src/ui/templateformsearchfieldview.js +23 -0
- package/src/ui/templateformview.d.ts +110 -0
- package/src/ui/templateformview.js +23 -0
- package/src/ui/templatelistbuttonview.d.ts +104 -0
- package/src/ui/templatelistbuttonview.js +23 -0
- package/src/ui/templatelistitemview.d.ts +34 -0
- package/src/ui/templatelistitemview.js +23 -0
- package/theme/icons/loupe.svg +1 -0
- package/theme/icons/template-generic.svg +6 -0
- package/theme/icons/template.svg +1 -0
- package/theme/template.css +235 -0
|
@@ -0,0 +1,104 @@
|
|
|
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/templatelistbuttonview
|
|
7
|
+
*/
|
|
8
|
+
import type { Locale } from 'ckeditor5/src/utils';
|
|
9
|
+
import { ButtonView, View } from 'ckeditor5/src/ui';
|
|
10
|
+
import type { TemplateDefinition } from '../template';
|
|
11
|
+
/**
|
|
12
|
+
* A class representing an individual button (template) in the list. Renders a rich preview of the template option.
|
|
13
|
+
*
|
|
14
|
+
* @protected
|
|
15
|
+
*/
|
|
16
|
+
export default class TemplateListButtonView extends ButtonView {
|
|
17
|
+
/**
|
|
18
|
+
* The definition of the template that the button will apply when executed.
|
|
19
|
+
*
|
|
20
|
+
* @readonly
|
|
21
|
+
*/
|
|
22
|
+
templateDefinition: TemplateDefinition;
|
|
23
|
+
/**
|
|
24
|
+
* The view rendering the text part of the template definition.
|
|
25
|
+
*
|
|
26
|
+
* @protected
|
|
27
|
+
* @readonly
|
|
28
|
+
*/
|
|
29
|
+
textPartView: TextPartView | null;
|
|
30
|
+
/**
|
|
31
|
+
* Creates an instance of the {@link module:template/ui/templatelistbuttonview~TemplateListButtonView} class.
|
|
32
|
+
*
|
|
33
|
+
* @param locale The localization services instance.
|
|
34
|
+
* @param templateDefinition The definition of the template.
|
|
35
|
+
*/
|
|
36
|
+
constructor(locale: Locale, templateDefinition: TemplateDefinition);
|
|
37
|
+
/**
|
|
38
|
+
* @inheritDoc
|
|
39
|
+
*/
|
|
40
|
+
render(): void;
|
|
41
|
+
destroy(): void;
|
|
42
|
+
/**
|
|
43
|
+
* Tells whether the `title` or `description` of the {@link #templateDefinition} match against the provided regular expression.
|
|
44
|
+
*
|
|
45
|
+
* @param regExp A regular expression to match the definition against.
|
|
46
|
+
* @returns When the match is positive, an object with the `title` and `description` keys is returned that describes
|
|
47
|
+
* the match. Otherwise, this method returns `null`.
|
|
48
|
+
*/
|
|
49
|
+
isMatching(regExp: RegExp): object | null;
|
|
50
|
+
/**
|
|
51
|
+
* Highlights a subset of the {@link #textPartView} text according to a specified regular expression. When `null` is passed,
|
|
52
|
+
* the highlighting is turned off.
|
|
53
|
+
*
|
|
54
|
+
* @param regExp A regular expression used to highlight the matching text in the {@link #textPartView}.
|
|
55
|
+
*/
|
|
56
|
+
highlightText(regExp: RegExp | null): void;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* A view representing the title and the description of the template.
|
|
60
|
+
*
|
|
61
|
+
* @protected
|
|
62
|
+
*/
|
|
63
|
+
export declare class TextPartView extends View {
|
|
64
|
+
/**
|
|
65
|
+
* The title text of the template.
|
|
66
|
+
*
|
|
67
|
+
* @readonly
|
|
68
|
+
*/
|
|
69
|
+
title: string;
|
|
70
|
+
/**
|
|
71
|
+
* The description text of the template.
|
|
72
|
+
*
|
|
73
|
+
* @readonly
|
|
74
|
+
*/
|
|
75
|
+
description: string | undefined;
|
|
76
|
+
/**
|
|
77
|
+
* A regular expression used to highlight the matching text in the {@link #titleView} and {@link #descriptionView}.
|
|
78
|
+
*
|
|
79
|
+
* **Note**: When set to `null`, no text gets highlighted.
|
|
80
|
+
*/
|
|
81
|
+
highlightRegExp: RegExp | null;
|
|
82
|
+
/**
|
|
83
|
+
* Renders the title text of a template.
|
|
84
|
+
*
|
|
85
|
+
* **Note**: It acts as a label of the entire button in the context of accessibility.
|
|
86
|
+
*
|
|
87
|
+
* @readonly
|
|
88
|
+
*/
|
|
89
|
+
titleView: View;
|
|
90
|
+
/**
|
|
91
|
+
* Renders the description text of a template.
|
|
92
|
+
*
|
|
93
|
+
* @readonly
|
|
94
|
+
*/
|
|
95
|
+
descriptionView: View;
|
|
96
|
+
/**
|
|
97
|
+
* Creates an instance of the text part view.
|
|
98
|
+
*
|
|
99
|
+
* @param locale The {@link module:core/editor/editor~Editor#locale} instance.
|
|
100
|
+
* @param templateDefinition The definition of the template.
|
|
101
|
+
* @param labelId A unique ID that connects the entire button with the {@link #titleView} in the context of accessibility.
|
|
102
|
+
*/
|
|
103
|
+
constructor(locale: Locale, templateDefinition: TemplateDefinition, labelId: string);
|
|
104
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2016 - 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 _0x2405=['div','extendTemplate','templateDefinition','textPartView','text','isMatch','locale','match','exec','render','<mark>','setTemplate','ck-template-form__description','set','element','_setupTextContentRendering','push','ck-template-form__text-part','destroy','iconView','description','innerHTML','title','descriptionView','highlightRegExp','change:highlightRegExp','map','substring','labelView','index','add','span','length','titleView','join','children'];(function(_0x3540e3,_0x24053e){const _0x329e47=function(_0x17fa07){while(--_0x17fa07){_0x3540e3['push'](_0x3540e3['shift']());}};_0x329e47(++_0x24053e);}(_0x2405,0x143));const _0x329e=function(_0x3540e3,_0x24053e){_0x3540e3=_0x3540e3-0x0;let _0x329e47=_0x2405[_0x3540e3];return _0x329e47;};import{ButtonView as _0x1d25e3,View as _0x56658e}from'ckeditor5/src/ui';import{escape as _0x488754}from'lodash-es';import _0x492559 from'../../theme/icons/template-generic.svg';export default class E extends _0x1d25e3{constructor(_0x515621,_0x43c24b){super(_0x515621),this[_0x329e('0x3')]=_0x43c24b,this['textPartView']=null;const {icon:_0x53d08c=_0x492559}=_0x43c24b;this[_0x329e('0xe')]({'withText':!0x0,'icon':_0x53d08c}),this[_0x329e('0x2')]({'attributes':{'role':'option'}}),this[_0x329e('0x14')]['isColorInherited']=!0x1;}[_0x329e('0xa')](){super[_0x329e('0xa')](),this[_0x329e('0x4')]=new TextPartView(this[_0x329e('0x7')],this[_0x329e('0x3')],this[_0x329e('0x1d')][_0x329e('0xf')]['id']),this[_0x329e('0x0')]['remove'](this[_0x329e('0x1d')]),this[_0x329e('0x0')][_0x329e('0x1f')](this[_0x329e('0x4')]);}['destroy'](){super[_0x329e('0x13')](),this['labelView']['destroy']();}['isMatching'](_0x148d94){const {title:_0x6f6113,description:_0x222592}=this[_0x329e('0x3')],_0x48f2e5=!!_0x6f6113[_0x329e('0x8')](_0x148d94),_0x2f716e=!(!_0x222592||!_0x222592['match'](_0x148d94));return _0x48f2e5||_0x2f716e?{'title':_0x48f2e5,'description':_0x2f716e}:null;}['highlightText'](_0x44baf3){this[_0x329e('0x4')][_0x329e('0x19')]=_0x44baf3;}}export class TextPartView extends _0x56658e{constructor(_0xe8b52c,_0x29f63c,_0x1ee2d7){super(_0xe8b52c),this[_0x329e('0x17')]=_0x29f63c['title'],this['description']=_0x29f63c[_0x329e('0x15')],this[_0x329e('0xe')](_0x329e('0x19'),null),this[_0x329e('0x22')]=new _0x56658e(_0xe8b52c),this[_0x329e('0x22')][_0x329e('0xc')]({'tag':_0x329e('0x20'),'attributes':{'class':['ck','ck-button__label'],'id':_0x1ee2d7}});const _0x263666=[this[_0x329e('0x22')]];this[_0x329e('0x15')]&&(this[_0x329e('0x18')]=new _0x56658e(_0xe8b52c),this[_0x329e('0x18')][_0x329e('0xc')]({'tag':'p','attributes':{'class':['ck',_0x329e('0xd')]}}),_0x263666[_0x329e('0x11')](this[_0x329e('0x18')])),this[_0x329e('0xc')]({'tag':_0x329e('0x1'),'attributes':{'class':['ck',_0x329e('0x12')]},'children':_0x263666}),this['_setupTextContentRendering']();}[_0x329e('0x10')](){const {title:_0x316977,description:_0x30e758,titleView:_0x3fefbf,descriptionView:_0xace585}=this,_0x1cabef=()=>{_0x3fefbf[_0x329e('0xf')]['innerHTML']=C(_0x316977,this[_0x329e('0x19')]),_0x30e758&&(_0xace585[_0x329e('0xf')][_0x329e('0x16')]=C(_0x30e758,this[_0x329e('0x19')]));};this['on']('render',()=>{_0x1cabef(),this['on'](_0x329e('0x1a'),_0x1cabef);});}}function C(_0x12e486,_0x178da6){if(!_0x178da6)return _0x488754(_0x12e486);const _0x228468=[];let _0x456d68,_0x1252a2=0x0;for(;null!==(_0x456d68=_0x178da6[_0x329e('0x9')](_0x12e486));){const _0x5baaf2=_0x456d68[_0x329e('0x1e')];_0x5baaf2!==_0x1252a2&&_0x228468[_0x329e('0x11')]({'text':_0x12e486['substring'](_0x1252a2,_0x5baaf2),'isMatch':!0x1}),_0x228468['push']({'text':_0x456d68[0x0],'isMatch':!0x0}),_0x1252a2=_0x178da6['lastIndex'];}return _0x1252a2!==_0x12e486[_0x329e('0x21')]&&_0x228468['push']({'text':_0x12e486[_0x329e('0x1c')](_0x1252a2),'isMatch':!0x1}),_0x228468[_0x329e('0x1b')](_0x52ec5b=>(_0x52ec5b['text']=_0x488754(_0x52ec5b[_0x329e('0x5')]),_0x52ec5b))[_0x329e('0x1b')](_0x3b9143=>_0x3b9143[_0x329e('0x6')]?_0x329e('0xb')+_0x3b9143[_0x329e('0x5')]+'</mark>':_0x3b9143[_0x329e('0x5')])[_0x329e('0x23')]('');}
|
|
@@ -0,0 +1,34 @@
|
|
|
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/templatelistitemview
|
|
7
|
+
*/
|
|
8
|
+
import { type Locale } from 'ckeditor5/src/utils';
|
|
9
|
+
import { ListItemView } from 'ckeditor5/src/ui';
|
|
10
|
+
import type TemplateListButtonView from './templatelistbuttonview';
|
|
11
|
+
/**
|
|
12
|
+
* A view representing an item in the list of tempaltes.
|
|
13
|
+
*
|
|
14
|
+
* @protected
|
|
15
|
+
*/
|
|
16
|
+
export default class TemplateListItemView extends ListItemView {
|
|
17
|
+
/**
|
|
18
|
+
* The initial index of the item in the list of templates.
|
|
19
|
+
* Useful while searching and sorting to reverse the list to the same order.
|
|
20
|
+
*/
|
|
21
|
+
readonly originalIndex: number;
|
|
22
|
+
/**
|
|
23
|
+
* The instance of the template button view containing the title,
|
|
24
|
+
* icon, and description of the template.
|
|
25
|
+
*/
|
|
26
|
+
buttonView: TemplateListButtonView | null;
|
|
27
|
+
/**
|
|
28
|
+
* Creates an instance of the {@link module:template/ui/templatelistitemview~TemplateListItemView} class.
|
|
29
|
+
*
|
|
30
|
+
* @param locale The localization services instance.
|
|
31
|
+
* @param originalIndex The initial index of the item in the list of templates.
|
|
32
|
+
*/
|
|
33
|
+
constructor(locale: Locale, originalIndex: number);
|
|
34
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2016 - 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
|
+
var _0x5545=['buttonView','originalIndex'];(function(_0x2bbf54,_0x5545e2){var _0x264690=function(_0x5816f5){while(--_0x5816f5){_0x2bbf54['push'](_0x2bbf54['shift']());}};_0x264690(++_0x5545e2);}(_0x5545,0x11b));var _0x2646=function(_0x2bbf54,_0x5545e2){_0x2bbf54=_0x2bbf54-0x0;var _0x264690=_0x5545[_0x2bbf54];return _0x264690;};import{ListItemView as _0xa4d1d6}from'ckeditor5/src/ui';export default class H extends _0xa4d1d6{constructor(_0x3dee63,_0x3a6b5b){super(_0x3dee63),this[_0x2646('0x0')]=_0x3a6b5b,this[_0x2646('0x1')]=null;}}
|
|
@@ -0,0 +1 @@
|
|
|
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>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 45 45">
|
|
2
|
+
<path fill="#F0F0F0" d="M2 0h41s2 0 2 2v41s0 2 -2 2h-41s-2 0 -2 -2v-41s0 -2 2 -2" />
|
|
3
|
+
<path fill="#D5D5D5" d="M11 10h10s1 0 1 1v24s0 1 -1 1h-10s-1 0 -1 -1v-24s0 -1 1 -1" />
|
|
4
|
+
<path fill="#D5D5D5" d="M25 10h10s1 0 1 1v10s0 1 -1 1h-10s-1 0 -1 -1v-10s0 -1 1 -1" />
|
|
5
|
+
<path fill="#D5D5D5" d="M25 24h10s1 0 1 1v10s0 1 -1 1h-10s-1 0 -1 -1v-10s0 -1 1 -1" />
|
|
6
|
+
</svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M8 0H3a2 2 0 0 0-2 2v15a2 2 0 0 0 2 2h5a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2ZM2.5 2a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5v15a.5.5 0 0 1-.5.5H3a.5.5 0 0 1-.5-.5V2Z"/><path clip-rule="evenodd" d="M13 0h5a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-5a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2Zm0 1.5a.5.5 0 0 0-.5.5v5a.5.5 0 0 0 .5.5h5a.5.5 0 0 0 .5-.5V2a.5.5 0 0 0-.5-.5h-5Z"/><path clip-rule="evenodd" d="M13 10h5a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-5a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2Zm0 1.5a.5.5 0 0 0-.5.5v5a.5.5 0 0 0 .5.5h5a.5.5 0 0 0 .5-.5v-5a.5.5 0 0 0-.5-.5h-5Z"/></svg>
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* 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
|
+
@import "@ckeditor/ckeditor5-ui/theme/mixins/_dir.css";
|
|
7
|
+
@import "@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css";
|
|
8
|
+
|
|
9
|
+
:root {
|
|
10
|
+
--ck-template-dropdown-view-width: 345px;
|
|
11
|
+
--ck-template-dropdown-view-height: 300px;
|
|
12
|
+
--ck-template-list-height: 245px;
|
|
13
|
+
--ck-template-icon-size: 45px;
|
|
14
|
+
--ck-template-search-field-horizontal-spacing: calc(var(--ck-icon-size) + var(--ck-spacing-medium));
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.ck.ck-template-form {
|
|
18
|
+
width: var(--ck-template-dropdown-view-width);
|
|
19
|
+
|
|
20
|
+
@mixin ck-media-phone {
|
|
21
|
+
--ck-template-dropdown-view-width: 260px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
& > .ck-template-form__info {
|
|
25
|
+
width: 100%;
|
|
26
|
+
padding: calc(2 * var(--ck-spacing-large)) var(--ck-spacing-large);
|
|
27
|
+
text-align: center;
|
|
28
|
+
|
|
29
|
+
& * {
|
|
30
|
+
white-space: normal;
|
|
31
|
+
text-align: center;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
& > span:first-child {
|
|
35
|
+
display: block;
|
|
36
|
+
font-weight: bold;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
& > span:last-child {
|
|
40
|
+
margin-top: var(--ck-spacing-medium);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* Hide the entire list when nothing was found */
|
|
44
|
+
&:not(.ck-hidden) ~ .ck-list {
|
|
45
|
+
display: none;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
& > .ck.ck-list.ck-template-list {
|
|
50
|
+
max-height: var(--ck-template-dropdown-view-height);
|
|
51
|
+
padding: var(--ck-spacing-large);
|
|
52
|
+
overflow-x: hidden;
|
|
53
|
+
overflow-y: auto;
|
|
54
|
+
overscroll-behavior: contain;
|
|
55
|
+
|
|
56
|
+
/*
|
|
57
|
+
* This is a dirty way to increase the selector specificity and override the default rounded corners
|
|
58
|
+
* of a list inside a dropdown panel
|
|
59
|
+
*/
|
|
60
|
+
@nest .ck-rounded-corners & {
|
|
61
|
+
border-radius: 0;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
& > .ck.ck-list__item {
|
|
65
|
+
/* This is an easy way to address the problem of spacings between hidden and visible list items */
|
|
66
|
+
&:not(.ck-hidden) ~ .ck.ck-list__item {
|
|
67
|
+
margin-top: var(--ck-spacing-large);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
& > .ck.ck-button {
|
|
71
|
+
width: 100%;
|
|
72
|
+
margin: 0;
|
|
73
|
+
padding: 0;
|
|
74
|
+
border-radius: var(--ck-border-radius);
|
|
75
|
+
|
|
76
|
+
/* Crop the icon when the border-radius is large */
|
|
77
|
+
overflow: hidden;
|
|
78
|
+
|
|
79
|
+
display: grid;
|
|
80
|
+
grid-template-columns: var(--ck-template-icon-size) 1fr;
|
|
81
|
+
grid-template-rows: var(--ck-template-icon-size);
|
|
82
|
+
grid-auto-columns: 1fr;
|
|
83
|
+
|
|
84
|
+
gap: var(--ck-spacing-large) var(--ck-spacing-large);
|
|
85
|
+
grid-auto-flow: column dense;
|
|
86
|
+
align-items: center;
|
|
87
|
+
grid-template-areas: "ck-template-icon ck-template-content";
|
|
88
|
+
|
|
89
|
+
&:not(:focus) {
|
|
90
|
+
border-color: var(--ck-color-dropdown-panel-background);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
& > .ck.ck-icon {
|
|
94
|
+
width: var(--ck-template-icon-size);
|
|
95
|
+
height: auto;
|
|
96
|
+
grid-area: ck-template-icon;
|
|
97
|
+
margin: 0;
|
|
98
|
+
|
|
99
|
+
/* Override default rules for icons to allow any fill color. */
|
|
100
|
+
color: unset;
|
|
101
|
+
|
|
102
|
+
& * {
|
|
103
|
+
color: unset;
|
|
104
|
+
|
|
105
|
+
&:not([fill]) {
|
|
106
|
+
fill: unset;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
& > .ck-template-form__text-part {
|
|
112
|
+
display: flex;
|
|
113
|
+
flex-direction: column;
|
|
114
|
+
justify-content: space-evenly;
|
|
115
|
+
height: 100%;
|
|
116
|
+
grid-area: ck-template-content;
|
|
117
|
+
min-width: 0;
|
|
118
|
+
margin: 0;
|
|
119
|
+
|
|
120
|
+
& > .ck.ck-button__label {
|
|
121
|
+
display: block;
|
|
122
|
+
font-weight: bold;
|
|
123
|
+
font-size: var(--ck-font-size-base);
|
|
124
|
+
color: var(--ck-color-text);
|
|
125
|
+
line-height: 1.1;
|
|
126
|
+
|
|
127
|
+
white-space: nowrap;
|
|
128
|
+
overflow: hidden;
|
|
129
|
+
text-overflow: ellipsis;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
& .ck-template-form__description {
|
|
133
|
+
display: -webkit-box;
|
|
134
|
+
font-size: 0.85em;
|
|
135
|
+
color: var(--ck-color-text);
|
|
136
|
+
line-height: 1.1;
|
|
137
|
+
|
|
138
|
+
/* Leave some tiny spacing between title and description. */
|
|
139
|
+
margin-top: var(--ck-spacing-tiny);
|
|
140
|
+
|
|
141
|
+
white-space: normal;
|
|
142
|
+
overflow: hidden;
|
|
143
|
+
text-overflow: ellipsis;
|
|
144
|
+
-webkit-box-orient: vertical;
|
|
145
|
+
-webkit-line-clamp: 2;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
& mark {
|
|
149
|
+
background: var(--ck-color-highlight-background);
|
|
150
|
+
vertical-align: initial;
|
|
151
|
+
font-weight: inherit;
|
|
152
|
+
line-height: inherit;
|
|
153
|
+
font-size: inherit;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
& > .ck-labeled-field-view {
|
|
161
|
+
--ck-labeled-field-label-default-position-x: var(--ck-template-search-field-horizontal-spacing);
|
|
162
|
+
--ck-labeled-field-empty-unfocused-max-width: 100% - 2 * var(--ck-template-search-field-horizontal-spacing);
|
|
163
|
+
|
|
164
|
+
padding: var(--ck-spacing-large);
|
|
165
|
+
|
|
166
|
+
&.ck-labeled-field-view_empty {
|
|
167
|
+
--ck-labeled-field-empty-unfocused-max-width: 100% - var(--ck-template-search-field-horizontal-spacing) - var(--ck-spacing-medium);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
& > .ck-labeled-field-view__input-wrapper > .ck-icon {
|
|
171
|
+
position: absolute;
|
|
172
|
+
top: 50%;
|
|
173
|
+
transform: translateY(-50%);
|
|
174
|
+
opacity: .5;
|
|
175
|
+
pointer-events: none;
|
|
176
|
+
|
|
177
|
+
@mixin ck-dir ltr {
|
|
178
|
+
left: var(--ck-spacing-medium);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
@mixin ck-dir rtl {
|
|
182
|
+
right: var(--ck-spacing-medium);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
& .ck-input {
|
|
187
|
+
width: 100%;
|
|
188
|
+
|
|
189
|
+
@mixin ck-dir ltr {
|
|
190
|
+
padding-left: var(--ck-template-search-field-horizontal-spacing);
|
|
191
|
+
|
|
192
|
+
&:not(.ck-input-text_empty) {
|
|
193
|
+
padding-right: var(--ck-template-search-field-horizontal-spacing);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
@mixin ck-dir rtl {
|
|
198
|
+
padding-right: var(--ck-template-search-field-horizontal-spacing);
|
|
199
|
+
|
|
200
|
+
&:not(.ck-input-text_empty) {
|
|
201
|
+
padding-left: var(--ck-template-search-field-horizontal-spacing);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
& .ck-template-form__clear-search {
|
|
207
|
+
position: absolute;
|
|
208
|
+
top: 50%;
|
|
209
|
+
transform: translateY(-50%);
|
|
210
|
+
min-width: auto;
|
|
211
|
+
min-height: auto;
|
|
212
|
+
|
|
213
|
+
background: none;
|
|
214
|
+
opacity: .5;
|
|
215
|
+
padding: 0;
|
|
216
|
+
|
|
217
|
+
@mixin ck-dir ltr {
|
|
218
|
+
right: var(--ck-spacing-medium);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
@mixin ck-dir rtl {
|
|
222
|
+
left: var(--ck-spacing-medium);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
&:hover {
|
|
226
|
+
opacity: 1;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
& > .ck-template-form__info:not(:only-child),
|
|
232
|
+
& > .ck.ck-list {
|
|
233
|
+
border-top: 1px solid var(--ck-color-base-border);
|
|
234
|
+
}
|
|
235
|
+
}
|