@ckeditor/ckeditor5-upload 41.3.0-alpha.4 → 41.3.1
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +3 -5
- package/src/index.d.ts +0 -1
- package/src/index.js +0 -1
- package/dist/content-index.css +0 -4
- package/dist/editor-index.css +0 -4
- package/dist/index.css +0 -4
- package/dist/translations/ar.d.ts +0 -8
- package/dist/translations/ar.js +0 -5
- package/dist/translations/az.d.ts +0 -8
- package/dist/translations/az.js +0 -5
- package/dist/translations/bg.d.ts +0 -8
- package/dist/translations/bg.js +0 -5
- package/dist/translations/bn.d.ts +0 -8
- package/dist/translations/bn.js +0 -5
- package/dist/translations/ca.d.ts +0 -8
- package/dist/translations/ca.js +0 -5
- package/dist/translations/cs.d.ts +0 -8
- package/dist/translations/cs.js +0 -5
- package/dist/translations/da.d.ts +0 -8
- package/dist/translations/da.js +0 -5
- package/dist/translations/de-ch.d.ts +0 -8
- package/dist/translations/de-ch.js +0 -5
- package/dist/translations/de.d.ts +0 -8
- package/dist/translations/de.js +0 -5
- package/dist/translations/el.d.ts +0 -8
- package/dist/translations/el.js +0 -5
- package/dist/translations/en-au.d.ts +0 -8
- package/dist/translations/en-au.js +0 -5
- package/dist/translations/en-gb.d.ts +0 -8
- package/dist/translations/en-gb.js +0 -5
- package/dist/translations/en.d.ts +0 -8
- package/dist/translations/en.js +0 -5
- package/dist/translations/es-co.d.ts +0 -8
- package/dist/translations/es-co.js +0 -5
- package/dist/translations/es.d.ts +0 -8
- package/dist/translations/es.js +0 -5
- package/dist/translations/et.d.ts +0 -8
- package/dist/translations/et.js +0 -5
- package/dist/translations/fa.d.ts +0 -8
- package/dist/translations/fa.js +0 -5
- package/dist/translations/fi.d.ts +0 -8
- package/dist/translations/fi.js +0 -5
- package/dist/translations/fr.d.ts +0 -8
- package/dist/translations/fr.js +0 -5
- package/dist/translations/gl.d.ts +0 -8
- package/dist/translations/gl.js +0 -5
- package/dist/translations/he.d.ts +0 -8
- package/dist/translations/he.js +0 -5
- package/dist/translations/hi.d.ts +0 -8
- package/dist/translations/hi.js +0 -5
- package/dist/translations/hr.d.ts +0 -8
- package/dist/translations/hr.js +0 -5
- package/dist/translations/hu.d.ts +0 -8
- package/dist/translations/hu.js +0 -5
- package/dist/translations/id.d.ts +0 -8
- package/dist/translations/id.js +0 -5
- package/dist/translations/it.d.ts +0 -8
- package/dist/translations/it.js +0 -5
- package/dist/translations/ja.d.ts +0 -8
- package/dist/translations/ja.js +0 -5
- package/dist/translations/ko.d.ts +0 -8
- package/dist/translations/ko.js +0 -5
- package/dist/translations/ku.d.ts +0 -8
- package/dist/translations/ku.js +0 -5
- package/dist/translations/lt.d.ts +0 -8
- package/dist/translations/lt.js +0 -5
- package/dist/translations/lv.d.ts +0 -8
- package/dist/translations/lv.js +0 -5
- package/dist/translations/ms.d.ts +0 -8
- package/dist/translations/ms.js +0 -5
- package/dist/translations/nb.d.ts +0 -8
- package/dist/translations/nb.js +0 -5
- package/dist/translations/ne.d.ts +0 -8
- package/dist/translations/ne.js +0 -5
- package/dist/translations/nl.d.ts +0 -8
- package/dist/translations/nl.js +0 -5
- package/dist/translations/no.d.ts +0 -8
- package/dist/translations/no.js +0 -5
- package/dist/translations/pl.d.ts +0 -8
- package/dist/translations/pl.js +0 -5
- package/dist/translations/pt-br.d.ts +0 -8
- package/dist/translations/pt-br.js +0 -5
- package/dist/translations/pt.d.ts +0 -8
- package/dist/translations/pt.js +0 -5
- package/dist/translations/ro.d.ts +0 -8
- package/dist/translations/ro.js +0 -5
- package/dist/translations/ru.d.ts +0 -8
- package/dist/translations/ru.js +0 -5
- package/dist/translations/sk.d.ts +0 -8
- package/dist/translations/sk.js +0 -5
- package/dist/translations/sq.d.ts +0 -8
- package/dist/translations/sq.js +0 -5
- package/dist/translations/sr-latn.d.ts +0 -8
- package/dist/translations/sr-latn.js +0 -5
- package/dist/translations/sr.d.ts +0 -8
- package/dist/translations/sr.js +0 -5
- package/dist/translations/sv.d.ts +0 -8
- package/dist/translations/sv.js +0 -5
- package/dist/translations/th.d.ts +0 -8
- package/dist/translations/th.js +0 -5
- package/dist/translations/tk.d.ts +0 -8
- package/dist/translations/tk.js +0 -5
- package/dist/translations/tr.d.ts +0 -8
- package/dist/translations/tr.js +0 -5
- package/dist/translations/ug.d.ts +0 -8
- package/dist/translations/ug.js +0 -5
- package/dist/translations/uk.d.ts +0 -8
- package/dist/translations/uk.js +0 -5
- package/dist/translations/ur.d.ts +0 -8
- package/dist/translations/ur.js +0 -5
- package/dist/translations/uz.d.ts +0 -8
- package/dist/translations/uz.js +0 -5
- package/dist/translations/vi.d.ts +0 -8
- package/dist/translations/vi.js +0 -5
- package/dist/translations/zh-cn.d.ts +0 -8
- package/dist/translations/zh-cn.js +0 -5
- package/dist/translations/zh.d.ts +0 -8
- package/dist/translations/zh.js +0 -5
- package/dist/types/adapters/base64uploadadapter.d.ts +0 -37
- package/dist/types/adapters/simpleuploadadapter.d.ts +0 -52
- package/dist/types/augmentation.d.ts +0 -24
- package/dist/types/filereader.d.ts +0 -60
- package/dist/types/filerepository.d.ts +0 -346
- package/dist/types/index.d.ts +0 -17
- package/dist/types/ui/filedialogbuttonview.d.ts +0 -87
- package/dist/types/uploadconfig.d.ts +0 -94
- package/src/ui/filedialogbuttonview.d.ts +0 -83
- package/src/ui/filedialogbuttonview.js +0 -102
@@ -1,102 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @license Copyright (c) 2003-2024, 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 upload/ui/filedialogbuttonview
|
7
|
-
*/
|
8
|
-
import { ButtonView, View } from '@ckeditor/ckeditor5-ui';
|
9
|
-
/**
|
10
|
-
* The file dialog button view.
|
11
|
-
*
|
12
|
-
* This component provides a button that opens the native file selection dialog.
|
13
|
-
* It can be used to implement the UI of a file upload feature.
|
14
|
-
*
|
15
|
-
* ```ts
|
16
|
-
* const view = new FileDialogButtonView( locale );
|
17
|
-
*
|
18
|
-
* view.set( {
|
19
|
-
* acceptedType: 'image/*',
|
20
|
-
* allowMultipleFiles: true
|
21
|
-
* label: t( 'Insert image' ),
|
22
|
-
* icon: imageIcon,
|
23
|
-
* tooltip: true
|
24
|
-
* } );
|
25
|
-
*
|
26
|
-
* view.on( 'done', ( evt, files ) => {
|
27
|
-
* for ( const file of Array.from( files ) ) {
|
28
|
-
* console.log( 'Selected file', file );
|
29
|
-
* }
|
30
|
-
* } );
|
31
|
-
* ```
|
32
|
-
*/
|
33
|
-
export default class FileDialogButtonView extends ButtonView {
|
34
|
-
/**
|
35
|
-
* @inheritDoc
|
36
|
-
*/
|
37
|
-
constructor(locale) {
|
38
|
-
super(locale);
|
39
|
-
// For backward compatibility.
|
40
|
-
this.buttonView = this;
|
41
|
-
this._fileInputView = new FileInputView(locale);
|
42
|
-
this._fileInputView.bind('acceptedType').to(this);
|
43
|
-
this._fileInputView.bind('allowMultipleFiles').to(this);
|
44
|
-
this._fileInputView.delegate('done').to(this);
|
45
|
-
this.on('execute', () => {
|
46
|
-
this._fileInputView.open();
|
47
|
-
});
|
48
|
-
this.extendTemplate({
|
49
|
-
attributes: {
|
50
|
-
class: 'ck-file-dialog-button'
|
51
|
-
}
|
52
|
-
});
|
53
|
-
}
|
54
|
-
/**
|
55
|
-
* @inheritDoc
|
56
|
-
*/
|
57
|
-
render() {
|
58
|
-
super.render();
|
59
|
-
this.children.add(this._fileInputView);
|
60
|
-
}
|
61
|
-
}
|
62
|
-
/**
|
63
|
-
* The hidden file input view class.
|
64
|
-
*/
|
65
|
-
class FileInputView extends View {
|
66
|
-
/**
|
67
|
-
* @inheritDoc
|
68
|
-
*/
|
69
|
-
constructor(locale) {
|
70
|
-
super(locale);
|
71
|
-
this.set('acceptedType', undefined);
|
72
|
-
this.set('allowMultipleFiles', false);
|
73
|
-
const bind = this.bindTemplate;
|
74
|
-
this.setTemplate({
|
75
|
-
tag: 'input',
|
76
|
-
attributes: {
|
77
|
-
class: [
|
78
|
-
'ck-hidden'
|
79
|
-
],
|
80
|
-
type: 'file',
|
81
|
-
tabindex: '-1',
|
82
|
-
accept: bind.to('acceptedType'),
|
83
|
-
multiple: bind.to('allowMultipleFiles')
|
84
|
-
},
|
85
|
-
on: {
|
86
|
-
// Removing from code coverage since we cannot programmatically set input element files.
|
87
|
-
change: bind.to(/* istanbul ignore next -- @preserve */ () => {
|
88
|
-
if (this.element && this.element.files && this.element.files.length) {
|
89
|
-
this.fire('done', this.element.files);
|
90
|
-
}
|
91
|
-
this.element.value = '';
|
92
|
-
})
|
93
|
-
}
|
94
|
-
});
|
95
|
-
}
|
96
|
-
/**
|
97
|
-
* Opens file dialog.
|
98
|
-
*/
|
99
|
-
open() {
|
100
|
-
this.element.click();
|
101
|
-
}
|
102
|
-
}
|