@ckeditor/ckeditor5-template 39.0.2 → 40.1.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 (109) hide show
  1. package/LICENSE.md +2 -2
  2. package/build/template.js +2 -2
  3. package/build/translations/ar.js +1 -1
  4. package/build/translations/bg.js +1 -1
  5. package/build/translations/bn.js +1 -1
  6. package/build/translations/ca.js +1 -1
  7. package/build/translations/cs.js +1 -1
  8. package/build/translations/da.js +1 -1
  9. package/build/translations/de.js +1 -1
  10. package/build/translations/el.js +1 -1
  11. package/build/translations/en-au.js +1 -1
  12. package/build/translations/es.js +1 -1
  13. package/build/translations/et.js +1 -1
  14. package/build/translations/fi.js +1 -1
  15. package/build/translations/fr.js +1 -1
  16. package/build/translations/gl.js +1 -1
  17. package/build/translations/he.js +1 -1
  18. package/build/translations/hi.js +1 -1
  19. package/build/translations/hr.js +1 -1
  20. package/build/translations/hu.js +1 -1
  21. package/build/translations/id.js +1 -1
  22. package/build/translations/it.js +1 -1
  23. package/build/translations/ja.js +1 -1
  24. package/build/translations/ko.js +1 -1
  25. package/build/translations/lt.js +1 -1
  26. package/build/translations/lv.js +1 -1
  27. package/build/translations/ms.js +1 -1
  28. package/build/translations/nl.js +1 -1
  29. package/build/translations/no.js +1 -1
  30. package/build/translations/pl.js +1 -1
  31. package/build/translations/pt-br.js +1 -1
  32. package/build/translations/pt.js +1 -1
  33. package/build/translations/ro.js +1 -1
  34. package/build/translations/ru.js +1 -1
  35. package/build/translations/sk.js +1 -1
  36. package/build/translations/sr.js +1 -1
  37. package/build/translations/sv.js +1 -1
  38. package/build/translations/th.js +1 -1
  39. package/build/translations/tr.js +1 -1
  40. package/build/translations/uk.js +1 -1
  41. package/build/translations/uz.js +1 -1
  42. package/build/translations/vi.js +1 -1
  43. package/build/translations/zh-cn.js +1 -1
  44. package/build/translations/zh.js +1 -1
  45. package/lang/contexts.json +1 -2
  46. package/lang/translations/ar.po +0 -4
  47. package/lang/translations/bg.po +0 -4
  48. package/lang/translations/bn.po +0 -4
  49. package/lang/translations/ca.po +0 -4
  50. package/lang/translations/cs.po +0 -4
  51. package/lang/translations/da.po +0 -4
  52. package/lang/translations/de.po +0 -4
  53. package/lang/translations/el.po +0 -4
  54. package/lang/translations/en-au.po +0 -4
  55. package/lang/translations/en.po +0 -4
  56. package/lang/translations/es.po +0 -4
  57. package/lang/translations/et.po +0 -4
  58. package/lang/translations/fi.po +0 -4
  59. package/lang/translations/fr.po +0 -4
  60. package/lang/translations/gl.po +0 -4
  61. package/lang/translations/he.po +0 -4
  62. package/lang/translations/hi.po +0 -4
  63. package/lang/translations/hr.po +0 -4
  64. package/lang/translations/hu.po +0 -4
  65. package/lang/translations/id.po +0 -4
  66. package/lang/translations/it.po +0 -4
  67. package/lang/translations/ja.po +0 -4
  68. package/lang/translations/ko.po +0 -4
  69. package/lang/translations/lt.po +0 -4
  70. package/lang/translations/lv.po +0 -4
  71. package/lang/translations/ms.po +0 -4
  72. package/lang/translations/nl.po +0 -4
  73. package/lang/translations/no.po +0 -4
  74. package/lang/translations/pl.po +0 -4
  75. package/lang/translations/pt-br.po +0 -4
  76. package/lang/translations/pt.po +0 -4
  77. package/lang/translations/ro.po +0 -4
  78. package/lang/translations/ru.po +0 -4
  79. package/lang/translations/sk.po +0 -4
  80. package/lang/translations/sr.po +0 -4
  81. package/lang/translations/sv.po +0 -4
  82. package/lang/translations/th.po +0 -4
  83. package/lang/translations/tr.po +0 -4
  84. package/lang/translations/uk.po +0 -4
  85. package/lang/translations/uz.po +0 -4
  86. package/lang/translations/vi.po +0 -4
  87. package/lang/translations/zh-cn.po +0 -4
  88. package/lang/translations/zh.po +0 -4
  89. package/package.json +3 -4
  90. package/src/index.js +1 -1
  91. package/src/template.js +1 -1
  92. package/src/templatecommand.js +1 -1
  93. package/src/templateediting.js +1 -1
  94. package/src/templateui.js +1 -1
  95. package/src/ui/templatelistbuttonview.d.ts +9 -9
  96. package/src/ui/templatelistbuttonview.js +1 -1
  97. package/src/ui/templatelistitemview.js +1 -1
  98. package/src/ui/templatelistview.d.ts +38 -0
  99. package/src/ui/templatelistview.js +23 -0
  100. package/theme/template.css +95 -187
  101. package/build/translations/sq.js +0 -1
  102. package/lang/translations/sq.po +0 -42
  103. package/src/ui/templateforminfoview.d.ts +0 -51
  104. package/src/ui/templateforminfoview.js +0 -23
  105. package/src/ui/templateformsearchfieldview.d.ts +0 -43
  106. package/src/ui/templateformsearchfieldview.js +0 -23
  107. package/src/ui/templateformview.d.ts +0 -110
  108. package/src/ui/templateformview.js +0 -23
  109. package/theme/icons/loupe.svg +0 -1
@@ -1,17 +1,18 @@
1
1
  /*
2
+ * What you're currently looking at is the source code of a legally protected, proprietary software.
3
+ * CKEditor 5 Collaboration is licensed under a commercial license and protected by copyright law. Where not otherwise indicated,
4
+ * all CKEditor 5 Collaboration content is authored by CKSource engineers and consists of CKSource-owned intellectual property.
5
+ *
2
6
  * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
7
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
8
  */
5
9
 
6
- @import "@ckeditor/ckeditor5-ui/theme/mixins/_dir.css";
7
10
  @import "@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css";
8
11
 
9
12
  :root {
10
13
  --ck-template-dropdown-view-width: 345px;
11
14
  --ck-template-dropdown-view-height: 300px;
12
- --ck-template-list-height: 245px;
13
15
  --ck-template-icon-size: 45px;
14
- --ck-template-search-field-horizontal-spacing: calc(var(--ck-icon-size) + var(--ck-spacing-medium));
15
16
  }
16
17
 
17
18
  .ck.ck-template-form {
@@ -21,215 +22,122 @@
21
22
  --ck-template-dropdown-view-width: 260px;
22
23
  }
23
24
 
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
- }
25
+ & > .ck-labeled-field-view {
26
+ padding: var(--ck-spacing-large);
47
27
  }
48
28
 
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
- }
29
+ & > .ck-search__results {
30
+ border-top: 1px solid var(--ck-color-base-border);
63
31
 
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);
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;
68
45
  }
69
46
 
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);
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);
91
51
  }
92
52
 
93
- & > .ck.ck-icon {
94
- width: var(--ck-template-icon-size);
95
- height: auto;
96
- grid-area: ck-template-icon;
53
+ & > .ck.ck-button {
54
+ width: 100%;
97
55
  margin: 0;
56
+ padding: 0;
57
+ border-radius: var(--ck-border-radius);
98
58
 
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
- }
59
+ /* Crop the icon when the border-radius is large */
60
+ overflow: hidden;
110
61
 
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;
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;
119
66
 
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;
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";
126
71
 
127
- white-space: nowrap;
128
- overflow: hidden;
129
- text-overflow: ellipsis;
72
+ &:not(:focus) {
73
+ border-color: var(--ck-color-dropdown-panel-background);
130
74
  }
131
75
 
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;
76
+ & > .ck.ck-icon {
77
+ width: var(--ck-template-icon-size);
78
+ height: auto;
79
+ grid-area: ck-template-icon;
80
+ margin: 0;
137
81
 
138
- /* Leave some tiny spacing between title and description. */
139
- margin-top: var(--ck-spacing-tiny);
82
+ /* Override default rules for icons to allow any fill color. */
83
+ color: unset;
140
84
 
141
- white-space: normal;
142
- overflow: hidden;
143
- text-overflow: ellipsis;
144
- -webkit-box-orient: vertical;
145
- -webkit-line-clamp: 2;
146
- }
85
+ & * {
86
+ color: unset;
147
87
 
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;
88
+ &:not([fill]) {
89
+ fill: unset;
90
+ }
91
+ }
154
92
  }
155
- }
156
- }
157
- }
158
- }
159
93
 
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%;
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
+ }
188
114
 
189
- @mixin ck-dir ltr {
190
- 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;
191
120
 
192
- &:not(.ck-input-text_empty) {
193
- padding-right: var(--ck-template-search-field-horizontal-spacing);
194
- }
195
- }
121
+ /* Leave some tiny spacing between title and description. */
122
+ margin-top: var(--ck-spacing-tiny);
196
123
 
197
- @mixin ck-dir rtl {
198
- 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
+ }
199
130
 
200
- &:not(.ck-input-text_empty) {
201
- 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
+ }
202
139
  }
203
140
  }
204
141
  }
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
142
  }
235
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 _0x5b2ef7}from'ckeditor5/src/ui';export default class h extends _0x5b2ef7{constructor(_0x522673){super(_0x522673);const _0x5f45f5=this['bindTemplate'];this['set']({'isVisible':!0x1,'primaryText':'','secondaryText':''}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-template-form__info',_0x5f45f5['if']('isVisible','ck-hidden',_0x133e01=>!_0x133e01)]},'children':[{'tag':'span','children':[{'text':[_0x5f45f5['to']('primaryText')]}]},{'tag':'span','children':[{'text':[_0x5f45f5['to']('secondaryText')]}]}]});}['setNoTemplatesAvailableText'](){const {t:t}=this['locale'];this['primaryText']=t('No\x20templates\x20available.'),this['secondaryText']='';}['setNoTemplatesFoundText'](_0x4e0391){const {t:t}=this['locale'];this['primaryText']=t('No\x20templates\x20were\x20found\x20matching\x20\x22%0\x22.',_0x4e0391),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 _0x975681,IconView as _0x3de58,LabeledFieldView as _0x27e7e8}from'ckeditor5/src/ui';import _0x4352e5 from'../../theme/icons/loupe.svg';import{icons as _0x2dbdfc}from'ckeditor5/src/core';export default class w extends _0x27e7e8{constructor(_0x586818,_0xa79358){super(_0x586818,_0xa79358);const t=_0x586818['t'];this['label']=t('Search\x20template'),this['loupeIconView']=new _0x3de58(),this['loupeIconView']['content']=_0x4352e5,this['clearButtonView']=new _0x975681(_0x586818),this['clearButtonView']['set']({'label':t('Clear'),'icon':_0x2dbdfc['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',_0x506d65=>!_0x506d65),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 _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')];}