@ckeditor/ckeditor5-upload 41.3.0-alpha.3 → 41.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. package/package.json +3 -5
  2. package/src/index.d.ts +0 -1
  3. package/src/index.js +0 -1
  4. package/dist/content-index.css +0 -4
  5. package/dist/editor-index.css +0 -4
  6. package/dist/index.css +0 -4
  7. package/dist/translations/ar.d.ts +0 -8
  8. package/dist/translations/ar.js +0 -5
  9. package/dist/translations/az.d.ts +0 -8
  10. package/dist/translations/az.js +0 -5
  11. package/dist/translations/bg.d.ts +0 -8
  12. package/dist/translations/bg.js +0 -5
  13. package/dist/translations/bn.d.ts +0 -8
  14. package/dist/translations/bn.js +0 -5
  15. package/dist/translations/ca.d.ts +0 -8
  16. package/dist/translations/ca.js +0 -5
  17. package/dist/translations/cs.d.ts +0 -8
  18. package/dist/translations/cs.js +0 -5
  19. package/dist/translations/da.d.ts +0 -8
  20. package/dist/translations/da.js +0 -5
  21. package/dist/translations/de-ch.d.ts +0 -8
  22. package/dist/translations/de-ch.js +0 -5
  23. package/dist/translations/de.d.ts +0 -8
  24. package/dist/translations/de.js +0 -5
  25. package/dist/translations/el.d.ts +0 -8
  26. package/dist/translations/el.js +0 -5
  27. package/dist/translations/en-au.d.ts +0 -8
  28. package/dist/translations/en-au.js +0 -5
  29. package/dist/translations/en-gb.d.ts +0 -8
  30. package/dist/translations/en-gb.js +0 -5
  31. package/dist/translations/en.d.ts +0 -8
  32. package/dist/translations/en.js +0 -5
  33. package/dist/translations/es-co.d.ts +0 -8
  34. package/dist/translations/es-co.js +0 -5
  35. package/dist/translations/es.d.ts +0 -8
  36. package/dist/translations/es.js +0 -5
  37. package/dist/translations/et.d.ts +0 -8
  38. package/dist/translations/et.js +0 -5
  39. package/dist/translations/fa.d.ts +0 -8
  40. package/dist/translations/fa.js +0 -5
  41. package/dist/translations/fi.d.ts +0 -8
  42. package/dist/translations/fi.js +0 -5
  43. package/dist/translations/fr.d.ts +0 -8
  44. package/dist/translations/fr.js +0 -5
  45. package/dist/translations/gl.d.ts +0 -8
  46. package/dist/translations/gl.js +0 -5
  47. package/dist/translations/he.d.ts +0 -8
  48. package/dist/translations/he.js +0 -5
  49. package/dist/translations/hi.d.ts +0 -8
  50. package/dist/translations/hi.js +0 -5
  51. package/dist/translations/hr.d.ts +0 -8
  52. package/dist/translations/hr.js +0 -5
  53. package/dist/translations/hu.d.ts +0 -8
  54. package/dist/translations/hu.js +0 -5
  55. package/dist/translations/id.d.ts +0 -8
  56. package/dist/translations/id.js +0 -5
  57. package/dist/translations/it.d.ts +0 -8
  58. package/dist/translations/it.js +0 -5
  59. package/dist/translations/ja.d.ts +0 -8
  60. package/dist/translations/ja.js +0 -5
  61. package/dist/translations/ko.d.ts +0 -8
  62. package/dist/translations/ko.js +0 -5
  63. package/dist/translations/ku.d.ts +0 -8
  64. package/dist/translations/ku.js +0 -5
  65. package/dist/translations/lt.d.ts +0 -8
  66. package/dist/translations/lt.js +0 -5
  67. package/dist/translations/lv.d.ts +0 -8
  68. package/dist/translations/lv.js +0 -5
  69. package/dist/translations/ms.d.ts +0 -8
  70. package/dist/translations/ms.js +0 -5
  71. package/dist/translations/nb.d.ts +0 -8
  72. package/dist/translations/nb.js +0 -5
  73. package/dist/translations/ne.d.ts +0 -8
  74. package/dist/translations/ne.js +0 -5
  75. package/dist/translations/nl.d.ts +0 -8
  76. package/dist/translations/nl.js +0 -5
  77. package/dist/translations/no.d.ts +0 -8
  78. package/dist/translations/no.js +0 -5
  79. package/dist/translations/pl.d.ts +0 -8
  80. package/dist/translations/pl.js +0 -5
  81. package/dist/translations/pt-br.d.ts +0 -8
  82. package/dist/translations/pt-br.js +0 -5
  83. package/dist/translations/pt.d.ts +0 -8
  84. package/dist/translations/pt.js +0 -5
  85. package/dist/translations/ro.d.ts +0 -8
  86. package/dist/translations/ro.js +0 -5
  87. package/dist/translations/ru.d.ts +0 -8
  88. package/dist/translations/ru.js +0 -5
  89. package/dist/translations/sk.d.ts +0 -8
  90. package/dist/translations/sk.js +0 -5
  91. package/dist/translations/sq.d.ts +0 -8
  92. package/dist/translations/sq.js +0 -5
  93. package/dist/translations/sr-latn.d.ts +0 -8
  94. package/dist/translations/sr-latn.js +0 -5
  95. package/dist/translations/sr.d.ts +0 -8
  96. package/dist/translations/sr.js +0 -5
  97. package/dist/translations/sv.d.ts +0 -8
  98. package/dist/translations/sv.js +0 -5
  99. package/dist/translations/th.d.ts +0 -8
  100. package/dist/translations/th.js +0 -5
  101. package/dist/translations/tk.d.ts +0 -8
  102. package/dist/translations/tk.js +0 -5
  103. package/dist/translations/tr.d.ts +0 -8
  104. package/dist/translations/tr.js +0 -5
  105. package/dist/translations/ug.d.ts +0 -8
  106. package/dist/translations/ug.js +0 -5
  107. package/dist/translations/uk.d.ts +0 -8
  108. package/dist/translations/uk.js +0 -5
  109. package/dist/translations/ur.d.ts +0 -8
  110. package/dist/translations/ur.js +0 -5
  111. package/dist/translations/uz.d.ts +0 -8
  112. package/dist/translations/uz.js +0 -5
  113. package/dist/translations/vi.d.ts +0 -8
  114. package/dist/translations/vi.js +0 -5
  115. package/dist/translations/zh-cn.d.ts +0 -8
  116. package/dist/translations/zh-cn.js +0 -5
  117. package/dist/translations/zh.d.ts +0 -8
  118. package/dist/translations/zh.js +0 -5
  119. package/dist/types/adapters/base64uploadadapter.d.ts +0 -37
  120. package/dist/types/adapters/simpleuploadadapter.d.ts +0 -52
  121. package/dist/types/augmentation.d.ts +0 -24
  122. package/dist/types/filereader.d.ts +0 -60
  123. package/dist/types/filerepository.d.ts +0 -346
  124. package/dist/types/index.d.ts +0 -17
  125. package/dist/types/ui/filedialogbuttonview.d.ts +0 -87
  126. package/dist/types/uploadconfig.d.ts +0 -94
  127. package/src/ui/filedialogbuttonview.d.ts +0 -83
  128. 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
- }