@ckeditor/ckeditor5-template 0.0.0-nightly-20230926.0 → 0.0.0-nightly-20230928.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.
Files changed (108) hide show
  1. package/build/template.js +2 -2
  2. package/build/translations/ar.js +1 -1
  3. package/build/translations/bg.js +1 -1
  4. package/build/translations/bn.js +1 -1
  5. package/build/translations/ca.js +1 -1
  6. package/build/translations/cs.js +1 -1
  7. package/build/translations/da.js +1 -1
  8. package/build/translations/de.js +1 -1
  9. package/build/translations/el.js +1 -1
  10. package/build/translations/en-au.js +1 -1
  11. package/build/translations/es.js +1 -1
  12. package/build/translations/et.js +1 -1
  13. package/build/translations/fi.js +1 -1
  14. package/build/translations/fr.js +1 -1
  15. package/build/translations/gl.js +1 -1
  16. package/build/translations/he.js +1 -1
  17. package/build/translations/hi.js +1 -1
  18. package/build/translations/hr.js +1 -1
  19. package/build/translations/hu.js +1 -1
  20. package/build/translations/id.js +1 -1
  21. package/build/translations/it.js +1 -1
  22. package/build/translations/ja.js +1 -1
  23. package/build/translations/ko.js +1 -1
  24. package/build/translations/lt.js +1 -1
  25. package/build/translations/lv.js +1 -1
  26. package/build/translations/ms.js +1 -1
  27. package/build/translations/nl.js +1 -1
  28. package/build/translations/no.js +1 -1
  29. package/build/translations/pl.js +1 -1
  30. package/build/translations/pt-br.js +1 -1
  31. package/build/translations/pt.js +1 -1
  32. package/build/translations/ro.js +1 -1
  33. package/build/translations/ru.js +1 -1
  34. package/build/translations/sk.js +1 -1
  35. package/build/translations/sr.js +1 -1
  36. package/build/translations/sv.js +1 -1
  37. package/build/translations/th.js +1 -1
  38. package/build/translations/tr.js +1 -1
  39. package/build/translations/uk.js +1 -1
  40. package/build/translations/uz.js +1 -1
  41. package/build/translations/vi.js +1 -1
  42. package/build/translations/zh-cn.js +1 -1
  43. package/build/translations/zh.js +1 -1
  44. package/lang/contexts.json +1 -2
  45. package/lang/translations/ar.po +0 -4
  46. package/lang/translations/bg.po +0 -4
  47. package/lang/translations/bn.po +0 -4
  48. package/lang/translations/ca.po +0 -4
  49. package/lang/translations/cs.po +0 -4
  50. package/lang/translations/da.po +0 -4
  51. package/lang/translations/de.po +0 -4
  52. package/lang/translations/el.po +0 -4
  53. package/lang/translations/en-au.po +0 -4
  54. package/lang/translations/en.po +0 -4
  55. package/lang/translations/es.po +0 -4
  56. package/lang/translations/et.po +0 -4
  57. package/lang/translations/fi.po +0 -4
  58. package/lang/translations/fr.po +0 -4
  59. package/lang/translations/gl.po +0 -4
  60. package/lang/translations/he.po +0 -4
  61. package/lang/translations/hi.po +0 -4
  62. package/lang/translations/hr.po +0 -4
  63. package/lang/translations/hu.po +0 -4
  64. package/lang/translations/id.po +0 -4
  65. package/lang/translations/it.po +0 -4
  66. package/lang/translations/ja.po +0 -4
  67. package/lang/translations/ko.po +0 -4
  68. package/lang/translations/lt.po +0 -4
  69. package/lang/translations/lv.po +0 -4
  70. package/lang/translations/ms.po +0 -4
  71. package/lang/translations/nl.po +0 -4
  72. package/lang/translations/no.po +0 -4
  73. package/lang/translations/pl.po +0 -4
  74. package/lang/translations/pt-br.po +0 -4
  75. package/lang/translations/pt.po +0 -4
  76. package/lang/translations/ro.po +0 -4
  77. package/lang/translations/ru.po +0 -4
  78. package/lang/translations/sk.po +0 -4
  79. package/lang/translations/sr.po +0 -4
  80. package/lang/translations/sv.po +0 -4
  81. package/lang/translations/th.po +0 -4
  82. package/lang/translations/tr.po +0 -4
  83. package/lang/translations/uk.po +0 -4
  84. package/lang/translations/uz.po +0 -4
  85. package/lang/translations/vi.po +0 -4
  86. package/lang/translations/zh-cn.po +0 -4
  87. package/lang/translations/zh.po +0 -4
  88. package/package.json +3 -4
  89. package/src/index.js +1 -1
  90. package/src/template.js +1 -1
  91. package/src/templatecommand.js +1 -1
  92. package/src/templateediting.js +1 -1
  93. package/src/templateui.js +1 -1
  94. package/src/ui/templatelistbuttonview.d.ts +9 -9
  95. package/src/ui/templatelistbuttonview.js +1 -1
  96. package/src/ui/templatelistitemview.js +1 -1
  97. package/src/ui/templatelistview.d.ts +38 -0
  98. package/src/ui/templatelistview.js +23 -0
  99. package/theme/template.css +91 -187
  100. package/build/translations/sq.js +0 -1
  101. package/lang/translations/sq.po +0 -42
  102. package/src/ui/templateforminfoview.d.ts +0 -51
  103. package/src/ui/templateforminfoview.js +0 -23
  104. package/src/ui/templateformsearchfieldview.d.ts +0 -43
  105. package/src/ui/templateformsearchfieldview.js +0 -23
  106. package/src/ui/templateformview.d.ts +0 -110
  107. package/src/ui/templateformview.js +0 -23
  108. package/theme/icons/loupe.svg +0 -1
@@ -7,15 +7,12 @@
7
7
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
8
  */
9
9
 
10
- @import "@ckeditor/ckeditor5-ui/theme/mixins/_dir.css";
11
10
  @import "@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css";
12
11
 
13
12
  :root {
14
13
  --ck-template-dropdown-view-width: 345px;
15
14
  --ck-template-dropdown-view-height: 300px;
16
- --ck-template-list-height: 245px;
17
15
  --ck-template-icon-size: 45px;
18
- --ck-template-search-field-horizontal-spacing: calc(var(--ck-icon-size) + var(--ck-spacing-medium));
19
16
  }
20
17
 
21
18
  .ck.ck-template-form {
@@ -25,215 +22,122 @@
25
22
  --ck-template-dropdown-view-width: 260px;
26
23
  }
27
24
 
28
- & > .ck-template-form__info {
29
- width: 100%;
30
- padding: calc(2 * var(--ck-spacing-large)) var(--ck-spacing-large);
31
- text-align: center;
32
-
33
- & * {
34
- white-space: normal;
35
- text-align: center;
36
- }
37
-
38
- & > span:first-child {
39
- display: block;
40
- font-weight: bold;
41
- }
42
-
43
- & > span:last-child {
44
- margin-top: var(--ck-spacing-medium);
45
- }
46
-
47
- /* Hide the entire list when nothing was found */
48
- &:not(.ck-hidden) ~ .ck-list {
49
- display: none;
50
- }
25
+ & > .ck-labeled-field-view {
26
+ padding: var(--ck-spacing-large);
51
27
  }
52
28
 
53
- & > .ck.ck-list.ck-template-list {
54
- max-height: var(--ck-template-dropdown-view-height);
55
- padding: var(--ck-spacing-large);
56
- overflow-x: hidden;
57
- overflow-y: auto;
58
- overscroll-behavior: contain;
59
-
60
- /*
61
- * This is a dirty way to increase the selector specificity and override the default rounded corners
62
- * of a list inside a dropdown panel
63
- */
64
- @nest .ck-rounded-corners & {
65
- border-radius: 0;
66
- }
29
+ & > .ck-search__results {
30
+ border-top: 1px solid var(--ck-color-base-border);
67
31
 
68
- & > .ck.ck-list__item {
69
- /* This is an easy way to address the problem of spacings between hidden and visible list items */
70
- &:not(.ck-hidden) ~ .ck.ck-list__item {
71
- margin-top: var(--ck-spacing-large);
32
+ & > .ck.ck-list.ck-template-list {
33
+ max-height: var(--ck-template-dropdown-view-height);
34
+ padding: var(--ck-spacing-large);
35
+ overflow-x: hidden;
36
+ overflow-y: auto;
37
+ overscroll-behavior: contain;
38
+
39
+ /*
40
+ * This is a dirty way to increase the selector specificity and override the default rounded corners
41
+ * of a list inside a dropdown panel
42
+ */
43
+ @nest .ck-rounded-corners & {
44
+ border-radius: 0;
72
45
  }
73
46
 
74
- & > .ck.ck-button {
75
- width: 100%;
76
- margin: 0;
77
- padding: 0;
78
- border-radius: var(--ck-border-radius);
79
-
80
- /* Crop the icon when the border-radius is large */
81
- overflow: hidden;
82
-
83
- display: grid;
84
- grid-template-columns: var(--ck-template-icon-size) 1fr;
85
- grid-template-rows: var(--ck-template-icon-size);
86
- grid-auto-columns: 1fr;
87
-
88
- gap: var(--ck-spacing-large) var(--ck-spacing-large);
89
- grid-auto-flow: column dense;
90
- align-items: center;
91
- grid-template-areas: "ck-template-icon ck-template-content";
92
-
93
- &:not(:focus) {
94
- border-color: var(--ck-color-dropdown-panel-background);
47
+ & > .ck.ck-list__item {
48
+ /* This is an easy way to address the problem of spacings between hidden and visible list items */
49
+ &:not(.ck-hidden) ~ .ck.ck-list__item {
50
+ margin-top: var(--ck-spacing-large);
95
51
  }
96
52
 
97
- & > .ck.ck-icon {
98
- width: var(--ck-template-icon-size);
99
- height: auto;
100
- grid-area: ck-template-icon;
53
+ & > .ck.ck-button {
54
+ width: 100%;
101
55
  margin: 0;
56
+ padding: 0;
57
+ border-radius: var(--ck-border-radius);
102
58
 
103
- /* Override default rules for icons to allow any fill color. */
104
- color: unset;
105
-
106
- & * {
107
- color: unset;
108
-
109
- &:not([fill]) {
110
- fill: unset;
111
- }
112
- }
113
- }
59
+ /* Crop the icon when the border-radius is large */
60
+ overflow: hidden;
114
61
 
115
- & > .ck-template-form__text-part {
116
- display: flex;
117
- flex-direction: column;
118
- justify-content: space-evenly;
119
- height: 100%;
120
- grid-area: ck-template-content;
121
- min-width: 0;
122
- margin: 0;
62
+ display: grid;
63
+ grid-template-columns: var(--ck-template-icon-size) 1fr;
64
+ grid-template-rows: var(--ck-template-icon-size);
65
+ grid-auto-columns: 1fr;
123
66
 
124
- & > .ck.ck-button__label {
125
- display: block;
126
- font-weight: bold;
127
- font-size: var(--ck-font-size-base);
128
- color: var(--ck-color-text);
129
- line-height: 1.1;
67
+ gap: var(--ck-spacing-large) var(--ck-spacing-large);
68
+ grid-auto-flow: column dense;
69
+ align-items: center;
70
+ grid-template-areas: "ck-template-icon ck-template-content";
130
71
 
131
- white-space: nowrap;
132
- overflow: hidden;
133
- text-overflow: ellipsis;
72
+ &:not(:focus) {
73
+ border-color: var(--ck-color-dropdown-panel-background);
134
74
  }
135
75
 
136
- & .ck-template-form__description {
137
- display: -webkit-box;
138
- font-size: 0.85em;
139
- color: var(--ck-color-text);
140
- line-height: 1.1;
76
+ & > .ck.ck-icon {
77
+ width: var(--ck-template-icon-size);
78
+ height: auto;
79
+ grid-area: ck-template-icon;
80
+ margin: 0;
141
81
 
142
- /* Leave some tiny spacing between title and description. */
143
- margin-top: var(--ck-spacing-tiny);
82
+ /* Override default rules for icons to allow any fill color. */
83
+ color: unset;
144
84
 
145
- white-space: normal;
146
- overflow: hidden;
147
- text-overflow: ellipsis;
148
- -webkit-box-orient: vertical;
149
- -webkit-line-clamp: 2;
150
- }
85
+ & * {
86
+ color: unset;
151
87
 
152
- & mark {
153
- background: var(--ck-color-highlight-background);
154
- vertical-align: initial;
155
- font-weight: inherit;
156
- line-height: inherit;
157
- font-size: inherit;
88
+ &:not([fill]) {
89
+ fill: unset;
90
+ }
91
+ }
158
92
  }
159
- }
160
- }
161
- }
162
- }
163
93
 
164
- & > .ck-labeled-field-view {
165
- --ck-labeled-field-label-default-position-x: var(--ck-template-search-field-horizontal-spacing);
166
- --ck-labeled-field-empty-unfocused-max-width: 100% - 2 * var(--ck-template-search-field-horizontal-spacing);
167
-
168
- padding: var(--ck-spacing-large);
169
-
170
- &.ck-labeled-field-view_empty {
171
- --ck-labeled-field-empty-unfocused-max-width: 100% - var(--ck-template-search-field-horizontal-spacing) - var(--ck-spacing-medium);
172
- }
173
-
174
- & > .ck-labeled-field-view__input-wrapper > .ck-icon {
175
- position: absolute;
176
- top: 50%;
177
- transform: translateY(-50%);
178
- opacity: .5;
179
- pointer-events: none;
180
-
181
- @mixin ck-dir ltr {
182
- left: var(--ck-spacing-medium);
183
- }
184
-
185
- @mixin ck-dir rtl {
186
- right: var(--ck-spacing-medium);
187
- }
188
- }
189
-
190
- & .ck-input {
191
- width: 100%;
94
+ & > .ck-template-form__text-part {
95
+ display: flex;
96
+ flex-direction: column;
97
+ justify-content: space-evenly;
98
+ height: 100%;
99
+ grid-area: ck-template-content;
100
+ min-width: 0;
101
+ margin: 0;
102
+
103
+ & > .ck.ck-button__label {
104
+ display: block;
105
+ font-weight: bold;
106
+ font-size: var(--ck-font-size-base);
107
+ color: var(--ck-color-text);
108
+ line-height: 1.1;
109
+
110
+ white-space: nowrap;
111
+ overflow: hidden;
112
+ text-overflow: ellipsis;
113
+ }
192
114
 
193
- @mixin ck-dir ltr {
194
- padding-left: var(--ck-template-search-field-horizontal-spacing);
115
+ & .ck-template-form__description {
116
+ display: -webkit-box;
117
+ font-size: 0.85em;
118
+ color: var(--ck-color-text);
119
+ line-height: 1.1;
195
120
 
196
- &:not(.ck-input-text_empty) {
197
- padding-right: var(--ck-template-search-field-horizontal-spacing);
198
- }
199
- }
121
+ /* Leave some tiny spacing between title and description. */
122
+ margin-top: var(--ck-spacing-tiny);
200
123
 
201
- @mixin ck-dir rtl {
202
- padding-right: var(--ck-template-search-field-horizontal-spacing);
124
+ white-space: normal;
125
+ overflow: hidden;
126
+ text-overflow: ellipsis;
127
+ -webkit-box-orient: vertical;
128
+ -webkit-line-clamp: 2;
129
+ }
203
130
 
204
- &:not(.ck-input-text_empty) {
205
- padding-left: var(--ck-template-search-field-horizontal-spacing);
131
+ & mark {
132
+ background: var(--ck-color-highlight-background);
133
+ vertical-align: initial;
134
+ font-weight: inherit;
135
+ line-height: inherit;
136
+ font-size: inherit;
137
+ }
138
+ }
206
139
  }
207
140
  }
208
141
  }
209
-
210
- & .ck-template-form__clear-search {
211
- position: absolute;
212
- top: 50%;
213
- transform: translateY(-50%);
214
- min-width: auto;
215
- min-height: auto;
216
-
217
- background: none;
218
- opacity: .5;
219
- padding: 0;
220
-
221
- @mixin ck-dir ltr {
222
- right: var(--ck-spacing-medium);
223
- }
224
-
225
- @mixin ck-dir rtl {
226
- left: var(--ck-spacing-medium);
227
- }
228
-
229
- &:hover {
230
- opacity: 1;
231
- }
232
- }
233
- }
234
-
235
- & > .ck-template-form__info:not(:only-child),
236
- & > .ck.ck-list {
237
- border-top: 1px solid var(--ck-color-base-border);
238
142
  }
239
143
  }
@@ -1 +0,0 @@
1
- !function(e){const t=e.sq=e.sq||{};t.dictionary=Object.assign(t.dictionary||{},{Clear:"Pastro","Insert template":"","No templates available.":"",'No templates were found matching "%0".':"","Please try a different phrase or check the spelling.":"","Search template":""})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -1,42 +0,0 @@
1
- # Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
- #
3
- # !!! IMPORTANT !!!
4
- #
5
- # Before you edit this file, please keep in mind that contributing to the project
6
- # translations is possible ONLY via the Transifex online service.
7
- #
8
- # To submit your translations, visit https://www.transifex.com/ckeditor/ckeditor5.
9
- #
10
- # To learn more, check out the official contributor's guide:
11
- # https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html
12
- #
13
- msgid ""
14
- msgstr ""
15
- "Language-Team: Albanian (https://app.transifex.com/ckeditor/teams/11143/sq/)\n"
16
- "Language: sq\n"
17
- "Plural-Forms: nplurals=2; plural=(n != 1);\n"
18
- "Content-Type: text/plain; charset=UTF-8\n"
19
-
20
- msgctxt "The toolbar button tooltip for the template feature."
21
- msgid "Insert template"
22
- msgstr ""
23
-
24
- msgctxt "The main text of the message shown to the user when no templates are available in the template feature."
25
- msgid "No templates available."
26
- msgstr ""
27
-
28
- msgctxt "The main text of the message shown to the user when no templates are available for the search criteria."
29
- msgid "No templates were found matching \"%0\"."
30
- msgstr ""
31
-
32
- msgctxt "The secondary text of the message shown to the user when no templates are available for the search criteria."
33
- msgid "Please try a different phrase or check the spelling."
34
- msgstr ""
35
-
36
- msgctxt "The label of the input allowing users to search templates."
37
- msgid "Search template"
38
- msgstr ""
39
-
40
- msgctxt "The label of the button that clears the value of the search templates input."
41
- msgid "Clear"
42
- msgstr "Pastro"
@@ -1,51 +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/templateforminfoview
7
- */
8
- import type { Locale } from 'ckeditor5/src/utils';
9
- import { View } from 'ckeditor5/src/ui';
10
- /**
11
- * A view displaying an information text related to different states of the template form view.
12
- *
13
- * @private
14
- */
15
- export default class TemplateFormInfoView extends View {
16
- /**
17
- * Controls whether the view is visible.
18
- *
19
- * @observable
20
- * @default false
21
- */
22
- isVisible: boolean;
23
- /**
24
- * Controls the primary line of text in the info.
25
- *
26
- * @observable
27
- * @default ''
28
- */
29
- primaryText: string;
30
- /**
31
- * Controls the secondary line of text in the info.
32
- *
33
- * @observable
34
- * @default ''
35
- */
36
- secondaryText: string;
37
- /**
38
- * @inheritDoc
39
- */
40
- constructor(locale: Locale);
41
- /**
42
- * Displays the text informing about the feature being misconfigured.
43
- */
44
- setNoTemplatesAvailableText(): void;
45
- /**
46
- * Displays the text informing about no templates matching the search query.
47
- *
48
- * @param query The search query.
49
- */
50
- setNoTemplatesFoundText(query: string): void;
51
- }
@@ -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
- import{View as _0x235a03}from'ckeditor5/src/ui';export default class h extends _0x235a03{constructor(_0x46eaa8){super(_0x46eaa8);const _0x57f867=this['bindTemplate'];this['set']({'isVisible':!0x1,'primaryText':'','secondaryText':''}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-template-form__info',_0x57f867['if']('isVisible','ck-hidden',_0x502a12=>!_0x502a12)]},'children':[{'tag':'span','children':[{'text':[_0x57f867['to']('primaryText')]}]},{'tag':'span','children':[{'text':[_0x57f867['to']('secondaryText')]}]}]});}['setNoTemplatesAvailableText'](){const {t:t}=this['locale'];this['primaryText']=t('No\x20templates\x20available.'),this['secondaryText']='';}['setNoTemplatesFoundText'](_0x11f259){const {t:t}=this['locale'];this['primaryText']=t('No\x20templates\x20were\x20found\x20matching\x20\x22%0\x22.',_0x11f259),this['secondaryText']=t('Please\x20try\x20a\x20different\x20phrase\x20or\x20check\x20the\x20spelling.');}}
@@ -1,43 +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/templateformsearchfieldview
7
- */
8
- import { ButtonView, IconView, type InputView, LabeledFieldView } from 'ckeditor5/src/ui';
9
- import type { Locale } from 'ckeditor5/src/utils';
10
- /**
11
- * A search text field allowing to filter the list of templates.
12
- *
13
- * @private
14
- * @extends module:ui/labeledfield/labeledfieldview~LabeledFieldView
15
- */
16
- export default class TemplateFormSearchFieldView extends LabeledFieldView<InputView> {
17
- /**
18
- * The loupe icon displayed next to the {@link #fieldView}.
19
- */
20
- loupeIconView: IconView;
21
- /**
22
- * The button that clears and focuses the {@link #fieldView}.
23
- */
24
- clearButtonView: ButtonView;
25
- /**
26
- * @inheritDoc
27
- */
28
- constructor(locale: Locale, viewCreator: ConstructorParameters<typeof LabeledFieldView<InputView>>[1]);
29
- /**
30
- * Resets the search field to its default state.
31
- */
32
- reset(): void;
33
- }
34
- /**
35
- * An event fired when the field is reset using the
36
- * {@link module:template/ui/templateformsearchfieldview~TemplateFormSearchFieldView#clearButtonView}.
37
- *
38
- * @eventName ~TemplateFormSearchFieldView#reset
39
- */
40
- export type TemplateFormSearchFieldViewResetEvent = {
41
- name: 'reset';
42
- args: [];
43
- };
@@ -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
- import{ButtonView as _0x3a565f,IconView as _0x3dc1d9,LabeledFieldView as _0x47ecc5}from'ckeditor5/src/ui';import _0x4b843b from'../../theme/icons/loupe.svg';import{icons as _0x4e01e4}from'ckeditor5/src/core';export default class w extends _0x47ecc5{constructor(_0xc3763c,_0xf67b7e){super(_0xc3763c,_0xf67b7e);const t=_0xc3763c['t'];this['label']=t('Search\x20template'),this['loupeIconView']=new _0x3dc1d9(),this['loupeIconView']['content']=_0x4b843b,this['clearButtonView']=new _0x3a565f(_0xc3763c),this['clearButtonView']['set']({'label':t('Clear'),'icon':_0x4e01e4['cancel'],'class':'ck-template-form__clear-search','isVisible':!0x1,'tooltip':!0x0}),this['clearButtonView']['on']('execute',()=>{this['reset'](),this['focus'](),this['fire']('reset');}),this['clearButtonView']['bind']('isVisible')['to'](this['fieldView'],'isEmpty',_0x22070d=>!_0x22070d),this['fieldWrapperChildren']['add'](this['loupeIconView'],0x0),this['fieldWrapperChildren']['add'](this['clearButtonView']);}['reset'](){this['fieldView']['value']=this['fieldView']['element']['value']='',this['clearButtonView']['isVisible']=!0x1;}}
@@ -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 _0x209d=['clear','input','keystrokes','first','arrowright','map','tab','createCollection','infoView','value','arrowleft','_createTemplateListView','title','delegate','execute','fieldView','listenTo','isVisible','ck-template-list','_filterTemplates','add','set','templateListView','forEach','buttonView','includes','highlightText','filter','children','length','render','unfilter','addMany','originalIndex','div','element','searchFieldView','_createSearchFieldView','templatesDefinitions','setNoTemplatesFoundText','toLowerCase','focus','get','setTemplate','templateDefinition','reset','arrowdown','sort','items','focusTracker'];(function(_0x4f3042,_0x209d5b){const _0x504018=function(_0x141b7e){while(--_0x141b7e){_0x4f3042['push'](_0x4f3042['shift']());}};_0x504018(++_0x209d5b);}(_0x209d,0x1b0));const _0x5040=function(_0x4f3042,_0x209d5b){_0x4f3042=_0x4f3042-0x0;let _0x504018=_0x209d[_0x4f3042];return _0x504018;};import{FocusTracker as _0x25ccb4,KeystrokeHandler as _0x4562fc}from'ckeditor5/src/utils';import{View as _0x45943e,ListView as _0x1d5ac2,createLabeledInputText as _0x11f024,FocusCycler as _0x41d536,injectCssTransitionDisabler as _0x479928}from'ckeditor5/src/ui';import _0x2119be from'./templatelistbuttonview';import _0x45db98 from'./templateforminfoview';import _0x5a2e3e from'./templateformsearchfieldview';import{escapeRegExp as _0x26e010}from'lodash-es';import _0x42f2f6 from'./templatelistitemview';export default class f extends _0x45943e{constructor(_0x15d682,_0x1c749c){super(_0x15d682),this[_0x5040('0x11')]=new _0x25ccb4(),this[_0x5040('0x14')]=new _0x4562fc(),this[_0x5040('0x6')]=_0x1c749c,this[_0x5040('0x28')]=this[_0x5040('0x1d')](_0x15d682,_0x1c749c),this[_0x5040('0x4')]=this['_createSearchFieldView'](_0x15d682),this[_0x5040('0x1a')]=new _0x45db98(_0x15d682),_0x1c749c[_0x5040('0x2f')]||(this[_0x5040('0x1a')][_0x5040('0x23')]=!0x0,this['infoView']['setNoTemplatesAvailableText']()),this[_0x5040('0x2e')]=this[_0x5040('0x19')](_0x1c749c[_0x5040('0x2f')]?[this[_0x5040('0x4')],this[_0x5040('0x1a')],this[_0x5040('0x28')]]:[this['infoView']]),this['_focusCycler']=new _0x41d536({'focusables':this[_0x5040('0x2e')],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':_0x5040('0x18')}}),this[_0x5040('0xb')]({'tag':_0x5040('0x2'),'attributes':{'class':['ck','ck-template-form'],'tabindex':'-1'},'children':this[_0x5040('0x2e')]}),_0x479928(this);}[_0x5040('0x30')](){if(super['render'](),!this[_0x5040('0x6')][_0x5040('0x2f')])return;const _0xfea877=_0x3bb5c6=>_0x3bb5c6['stopPropagation']();this['focusTracker'][_0x5040('0x26')](this[_0x5040('0x4')][_0x5040('0x3')]),this['focusTracker']['add'](this['templateListView'][_0x5040('0x3')]),this[_0x5040('0x14')][_0x5040('0x22')](this['element']),this[_0x5040('0x14')]['set'](_0x5040('0x16'),_0xfea877),this[_0x5040('0x14')][_0x5040('0x27')](_0x5040('0x1c'),_0xfea877),this[_0x5040('0x14')][_0x5040('0x27')]('arrowup',_0xfea877),this[_0x5040('0x14')][_0x5040('0x27')](_0x5040('0xe'),_0xfea877);}['focus'](){this[_0x5040('0x6')][_0x5040('0x2f')]&&this[_0x5040('0x4')][_0x5040('0x9')]();}[_0x5040('0xd')](){this[_0x5040('0x6')][_0x5040('0x2f')]&&(this[_0x5040('0x4')][_0x5040('0xd')](),this[_0x5040('0x25')]());}['_filterTemplates'](_0x220396){if(!this[_0x5040('0x6')][_0x5040('0x2f')])return;let _0x163d42=!0x1;if(_0x220396)for(const _0x1c9b10 of this[_0x5040('0x28')][_0x5040('0x10')]){_0x1c9b10[_0x5040('0x2e')][_0x5040('0x15')][_0x5040('0xc')][_0x5040('0x1e')][_0x5040('0x8')]()[_0x5040('0x2b')](_0x220396[_0x5040('0x8')]())?_0x1c9b10[_0x5040('0x23')]=!0x0:_0x1c9b10[_0x5040('0x23')]=!0x1;const _0x2da1cf=new RegExp(_0x26e010(_0x220396),'ig');_0x163d42=this[_0x5040('0x28')][_0x5040('0x2d')](_0x2da1cf);}else this[_0x5040('0x28')][_0x5040('0x31')](),_0x163d42=!0x0;this[_0x5040('0x1a')]['isVisible']=!_0x163d42,_0x163d42||this[_0x5040('0x1a')][_0x5040('0x7')](_0x220396);}['_createTemplateListView'](_0x1c43ab,_0x2f0902){const _0x469fde=new L(_0x1c43ab);return _0x469fde['extendTemplate']({'attributes':{'class':[_0x5040('0x24')]}}),_0x469fde[_0x5040('0x10')][_0x5040('0x0')](_0x2f0902['map']((_0x212fb5,_0x276ba7)=>{const _0x271e10=new _0x42f2f6(_0x1c43ab,_0x276ba7),_0x115bd0=new _0x2119be(_0x1c43ab,_0x212fb5);return _0x271e10[_0x5040('0x2a')]=_0x115bd0,_0x271e10[_0x5040('0x2e')][_0x5040('0x26')](_0x115bd0),_0x271e10[_0x5040('0x2e')][_0x5040('0x1f')](_0x5040('0x20'))['to'](this),_0x271e10;})),_0x469fde;}[_0x5040('0x5')](_0x334cc3){const _0x59ba37=new _0x5a2e3e(_0x334cc3,_0x11f024);return this[_0x5040('0x22')](_0x59ba37[_0x5040('0x21')],_0x5040('0x13'),()=>{this['_filterTemplates'](_0x59ba37[_0x5040('0x21')][_0x5040('0x3')][_0x5040('0x1b')]);}),_0x59ba37['on'](_0x5040('0xd'),()=>{this[_0x5040('0xd')]();}),_0x59ba37;}}class L extends _0x1d5ac2{[_0x5040('0x2d')](_0x5c3b82){const _0x4f2a6a=new Map(),_0x806956=this[_0x5040('0x10')][_0x5040('0x17')](_0x5c3611=>{const _0x454e21=_0x5c3611[_0x5040('0x2a')]['isMatching'](_0x5c3b82);return _0x5c3611[_0x5040('0x23')]=!!_0x454e21,_0x5c3611[_0x5040('0x2a')][_0x5040('0x2c')](_0x454e21?_0x5c3b82:null),_0x454e21&&_0x4f2a6a[_0x5040('0x27')](_0x5c3611,_0x454e21),_0x5c3611;})[_0x5040('0xf')](M)[_0x5040('0xf')]((_0x2f1fb6,_0x390dfe)=>{const _0x5e9cc6=_0x4f2a6a[_0x5040('0xa')](_0x2f1fb6),_0x2c7b07=_0x4f2a6a[_0x5040('0xa')](_0x390dfe);return _0x5e9cc6&&!_0x2c7b07?-0x1:_0x2c7b07&&!_0x5e9cc6?0x1:_0x5e9cc6||_0x2c7b07?_0x5e9cc6[_0x5040('0x1e')]&&!_0x2c7b07[_0x5040('0x1e')]?-0x1:!_0x5e9cc6[_0x5040('0x1e')]&&_0x2c7b07[_0x5040('0x1e')]?0x1:0x0:0x0;});return this[_0x5040('0x10')][_0x5040('0x12')](),this[_0x5040('0x10')][_0x5040('0x0')](_0x806956),!!_0x4f2a6a['size'];}[_0x5040('0x31')](){const _0x107244=this[_0x5040('0x10')][_0x5040('0x17')](_0x23eddc=>_0x23eddc)[_0x5040('0xf')](M);_0x107244[_0x5040('0x29')](_0x3a5289=>{_0x3a5289[_0x5040('0x23')]=!0x0,_0x3a5289[_0x5040('0x2a')]['highlightText'](null);}),this[_0x5040('0x10')]['clear'](),this[_0x5040('0x10')][_0x5040('0x0')](_0x107244);}}function M(_0x4cb660,_0x33e871){return _0x4cb660[_0x5040('0x1')]-_0x33e871[_0x5040('0x1')];}
@@ -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>