@ckeditor/ckeditor5-template 0.0.1 → 37.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.
- 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/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/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.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/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 +113 -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,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 _0xe7dc=['originalIndex','buttonView'];(function(_0x424a6a,_0xe7dc73){var _0x37b711=function(_0x3ec1f5){while(--_0x3ec1f5){_0x424a6a['push'](_0x424a6a['shift']());}};_0x37b711(++_0xe7dc73);}(_0xe7dc,0x17a));var _0x37b7=function(_0x424a6a,_0xe7dc73){_0x424a6a=_0x424a6a-0x0;var _0x37b711=_0xe7dc[_0x424a6a];return _0x37b711;};import{ListItemView as _0x3fb18e}from'ckeditor5/src/ui';export default class H extends _0x3fb18e{constructor(_0x1602b2,_0xe9a65f){super(_0x1602b2),this[_0x37b7('0x0')]=_0xe9a65f,this[_0x37b7('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
|
+
}
|