@holoviz/panel 1.5.0-a.3 → 1.5.0-a.5
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/dist/bundled/filedropper/filepond-plugin-file-validate-size/dist/filepond-plugin-file-validate-size.js +173 -0
- package/dist/bundled/filedropper/filepond-plugin-file-validate-type/dist/filepond-plugin-file-validate-type.js +231 -0
- package/dist/bundled/filedropper/filepond-plugin-image-preview/dist/filepond-plugin-image-preview.css +163 -0
- package/dist/bundled/filedropper/filepond-plugin-image-preview/dist/filepond-plugin-image-preview.js +3783 -0
- package/dist/bundled/filedropper/filepond-plugin-pdf-preview/dist/filepond-plugin-pdf-preview.css +56 -0
- package/dist/bundled/filedropper/filepond-plugin-pdf-preview/dist/filepond-plugin-pdf-preview.min.js +8 -0
- package/dist/bundled/filedropper/filepond@^4/dist/filepond.css +1049 -0
- package/dist/bundled/filedropper/filepond@^4/dist/filepond.js +12750 -0
- package/dist/bundled/notificationarea/panel/1.5.0-a.5/dist/bundled/font-awesome/css/all.min.css +2 -0
- package/dist/bundled/panel/1.5.0-a.5/dist/bundled/bootstrap5/css/bootstrap.min.css +2 -0
- package/dist/bundled/panel/1.5.0-a.5/dist/bundled/bootstrap5/js/bootstrap.bundle.min.js +2 -0
- package/dist/bundled/panel/1.5.0-a.5/dist/bundled/font-awesome/css/all.min.css +2 -0
- package/dist/bundled/panel/1.5.0-a.5/dist/bundled/jquery/jquery.slim.min.js +2 -0
- package/dist/bundled/plotlyplot/panel/1.5.0-a.5/dist/bundled/jquery/jquery.slim.min.js +2 -0
- package/dist/css/models/filedropper.css +4 -0
- package/dist/dts/styles/models/filedropper.css.d.ts +4 -0
- package/dist/lib/models/ace.js +1 -1
- package/dist/lib/models/ace.js.map +1 -1
- package/dist/lib/models/card.d.ts +1 -1
- package/dist/lib/models/card.js +5 -5
- package/dist/lib/models/card.js.map +1 -1
- package/dist/lib/models/column.js +2 -2
- package/dist/lib/models/column.js.map +1 -1
- package/dist/lib/models/echarts.js +1 -1
- package/dist/lib/models/echarts.js.map +1 -1
- package/dist/lib/models/file_dropper.d.ts +50 -0
- package/dist/lib/models/file_dropper.js +147 -0
- package/dist/lib/models/file_dropper.js.map +1 -0
- package/dist/lib/models/index.d.ts +1 -0
- package/dist/lib/models/index.js +1 -0
- package/dist/lib/models/index.js.map +1 -1
- package/dist/lib/models/perspective.js +1 -1
- package/dist/lib/models/perspective.js.map +1 -1
- package/dist/lib/models/quill.js +1 -1
- package/dist/lib/models/quill.js.map +1 -1
- package/dist/lib/models/reactive_html.js +1 -1
- package/dist/lib/models/reactive_html.js.map +1 -1
- package/dist/lib/models/tabulator.js +3 -3
- package/dist/lib/models/tabulator.js.map +1 -1
- package/dist/lib/models/trend.js +6 -6
- package/dist/lib/models/trend.js.map +1 -1
- package/dist/lib/models/vizzu.js +1 -1
- package/dist/lib/models/vizzu.js.map +1 -1
- package/dist/lib/models/vtk/util.js.map +1 -1
- package/dist/lib/models/vtk/vtkvolume.js +1 -1
- package/dist/lib/models/vtk/vtkvolume.js.map +1 -1
- package/dist/lib/styles/models/filedropper.css.d.ts +2 -0
- package/dist/lib/styles/models/filedropper.css.js +2 -0
- package/dist/panel.js +455 -263
- package/dist/panel.js.map +1 -1
- package/dist/panel.json +1 -1
- package/dist/panel.min.js +23 -21
- package/package.json +2 -2
- package/dist/bundled/font-awesome/LICENSE.txt +0 -34
- package/dist/bundled/notificationarea/panel/1.5.0-a.3/dist/bundled/font-awesome/css/all.min.css +0 -2
- package/dist/bundled/panel/1.5.0-a.3/dist/bundled/bootstrap5/css/bootstrap.min.css +0 -2
- package/dist/bundled/panel/1.5.0-a.3/dist/bundled/bootstrap5/js/bootstrap.bundle.min.js +0 -2
- package/dist/bundled/panel/1.5.0-a.3/dist/bundled/font-awesome/css/all.min.css +0 -2
- package/dist/bundled/panel/1.5.0-a.3/dist/bundled/jquery/jquery.slim.min.js +0 -2
- package/dist/bundled/plotlyplot/panel/1.5.0-a.3/dist/bundled/jquery/jquery.slim.min.js +0 -2
- package/dist/bundled/reveal.js@4.5.0/LICENSE +0 -19
- package/dist/bundled/reveal.js@4.5.0/dist/theme/fonts/league-gothic/LICENSE +0 -2
- package/dist/bundled/reveal.js@4.5.0/dist/theme/fonts/source-sans-pro/LICENSE +0 -45
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* FilePondPluginFileValidateSize 2.2.8
|
|
3
|
+
* Licensed under MIT, https://opensource.org/licenses/MIT/
|
|
4
|
+
* Please visit https://pqina.nl/filepond/ for details.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
|
|
9
|
+
(function(global, factory) {
|
|
10
|
+
typeof exports === 'object' && typeof module !== 'undefined'
|
|
11
|
+
? (module.exports = factory())
|
|
12
|
+
: typeof define === 'function' && define.amd
|
|
13
|
+
? define(factory)
|
|
14
|
+
: ((global = global || self), (global.FilePondPluginFileValidateSize = factory()));
|
|
15
|
+
})(this, function() {
|
|
16
|
+
'use strict';
|
|
17
|
+
|
|
18
|
+
var plugin = function plugin(_ref) {
|
|
19
|
+
var addFilter = _ref.addFilter,
|
|
20
|
+
utils = _ref.utils;
|
|
21
|
+
// get quick reference to Type utils
|
|
22
|
+
var Type = utils.Type,
|
|
23
|
+
replaceInString = utils.replaceInString,
|
|
24
|
+
toNaturalFileSize = utils.toNaturalFileSize;
|
|
25
|
+
|
|
26
|
+
// filtering if an item is allowed in hopper
|
|
27
|
+
addFilter('ALLOW_HOPPER_ITEM', function(file, _ref2) {
|
|
28
|
+
var query = _ref2.query;
|
|
29
|
+
if (!query('GET_ALLOW_FILE_SIZE_VALIDATION')) {
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
var sizeMax = query('GET_MAX_FILE_SIZE');
|
|
34
|
+
if (sizeMax !== null && file.size > sizeMax) {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
var sizeMin = query('GET_MIN_FILE_SIZE');
|
|
39
|
+
if (sizeMin !== null && file.size < sizeMin) {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return true;
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
// called for each file that is loaded
|
|
47
|
+
// right before it is set to the item state
|
|
48
|
+
// should return a promise
|
|
49
|
+
addFilter('LOAD_FILE', function(file, _ref3) {
|
|
50
|
+
var query = _ref3.query;
|
|
51
|
+
return new Promise(function(resolve, reject) {
|
|
52
|
+
// if not allowed, all fine, exit
|
|
53
|
+
if (!query('GET_ALLOW_FILE_SIZE_VALIDATION')) {
|
|
54
|
+
return resolve(file);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// check if file should be filtered
|
|
58
|
+
var fileFilter = query('GET_FILE_VALIDATE_SIZE_FILTER');
|
|
59
|
+
if (fileFilter && !fileFilter(file)) {
|
|
60
|
+
return resolve(file);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// reject or resolve based on file size
|
|
64
|
+
var sizeMax = query('GET_MAX_FILE_SIZE');
|
|
65
|
+
if (sizeMax !== null && file.size > sizeMax) {
|
|
66
|
+
reject({
|
|
67
|
+
status: {
|
|
68
|
+
main: query('GET_LABEL_MAX_FILE_SIZE_EXCEEDED'),
|
|
69
|
+
sub: replaceInString(query('GET_LABEL_MAX_FILE_SIZE'), {
|
|
70
|
+
filesize: toNaturalFileSize(
|
|
71
|
+
sizeMax,
|
|
72
|
+
'.',
|
|
73
|
+
query('GET_FILE_SIZE_BASE'),
|
|
74
|
+
query('GET_FILE_SIZE_LABELS', query)
|
|
75
|
+
),
|
|
76
|
+
}),
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// reject or resolve based on file size
|
|
84
|
+
var sizeMin = query('GET_MIN_FILE_SIZE');
|
|
85
|
+
if (sizeMin !== null && file.size < sizeMin) {
|
|
86
|
+
reject({
|
|
87
|
+
status: {
|
|
88
|
+
main: query('GET_LABEL_MIN_FILE_SIZE_EXCEEDED'),
|
|
89
|
+
sub: replaceInString(query('GET_LABEL_MIN_FILE_SIZE'), {
|
|
90
|
+
filesize: toNaturalFileSize(
|
|
91
|
+
sizeMin,
|
|
92
|
+
'.',
|
|
93
|
+
query('GET_FILE_SIZE_BASE'),
|
|
94
|
+
query('GET_FILE_SIZE_LABELS', query)
|
|
95
|
+
),
|
|
96
|
+
}),
|
|
97
|
+
},
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// returns the current option value
|
|
104
|
+
var totalSizeMax = query('GET_MAX_TOTAL_FILE_SIZE');
|
|
105
|
+
if (totalSizeMax !== null) {
|
|
106
|
+
// get the current total file size
|
|
107
|
+
var currentTotalSize = query('GET_ACTIVE_ITEMS').reduce(function(total, item) {
|
|
108
|
+
return total + item.fileSize;
|
|
109
|
+
}, 0);
|
|
110
|
+
|
|
111
|
+
// get the size of the new file
|
|
112
|
+
if (currentTotalSize > totalSizeMax) {
|
|
113
|
+
reject({
|
|
114
|
+
status: {
|
|
115
|
+
main: query('GET_LABEL_MAX_TOTAL_FILE_SIZE_EXCEEDED'),
|
|
116
|
+
sub: replaceInString(query('GET_LABEL_MAX_TOTAL_FILE_SIZE'), {
|
|
117
|
+
filesize: toNaturalFileSize(
|
|
118
|
+
totalSizeMax,
|
|
119
|
+
'.',
|
|
120
|
+
query('GET_FILE_SIZE_BASE'),
|
|
121
|
+
query('GET_FILE_SIZE_LABELS', query)
|
|
122
|
+
),
|
|
123
|
+
}),
|
|
124
|
+
},
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// file is fine, let's pass it back
|
|
132
|
+
resolve(file);
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
return {
|
|
137
|
+
options: {
|
|
138
|
+
// Enable or disable file type validation
|
|
139
|
+
allowFileSizeValidation: [true, Type.BOOLEAN],
|
|
140
|
+
|
|
141
|
+
// Max individual file size in bytes
|
|
142
|
+
maxFileSize: [null, Type.INT],
|
|
143
|
+
|
|
144
|
+
// Min individual file size in bytes
|
|
145
|
+
minFileSize: [null, Type.INT],
|
|
146
|
+
|
|
147
|
+
// Max total file size in bytes
|
|
148
|
+
maxTotalFileSize: [null, Type.INT],
|
|
149
|
+
|
|
150
|
+
// Filter the files that need to be validated for size
|
|
151
|
+
fileValidateSizeFilter: [null, Type.FUNCTION],
|
|
152
|
+
|
|
153
|
+
// error labels
|
|
154
|
+
labelMinFileSizeExceeded: ['File is too small', Type.STRING],
|
|
155
|
+
labelMinFileSize: ['Minimum file size is {filesize}', Type.STRING],
|
|
156
|
+
|
|
157
|
+
labelMaxFileSizeExceeded: ['File is too large', Type.STRING],
|
|
158
|
+
labelMaxFileSize: ['Maximum file size is {filesize}', Type.STRING],
|
|
159
|
+
|
|
160
|
+
labelMaxTotalFileSizeExceeded: ['Maximum total size exceeded', Type.STRING],
|
|
161
|
+
labelMaxTotalFileSize: ['Maximum total file size is {filesize}', Type.STRING],
|
|
162
|
+
},
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
// fire pluginloaded event if running in browser, this allows registering the plugin when using async script tags
|
|
167
|
+
var isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
|
|
168
|
+
if (isBrowser) {
|
|
169
|
+
document.dispatchEvent(new CustomEvent('FilePond:pluginloaded', { detail: plugin }));
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
return plugin;
|
|
173
|
+
});
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* FilePondPluginFileValidateType 1.2.9
|
|
3
|
+
* Licensed under MIT, https://opensource.org/licenses/MIT/
|
|
4
|
+
* Please visit https://pqina.nl/filepond/ for details.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
|
|
9
|
+
(function(global, factory) {
|
|
10
|
+
typeof exports === 'object' && typeof module !== 'undefined'
|
|
11
|
+
? (module.exports = factory())
|
|
12
|
+
: typeof define === 'function' && define.amd
|
|
13
|
+
? define(factory)
|
|
14
|
+
: ((global = global || self), (global.FilePondPluginFileValidateType = factory()));
|
|
15
|
+
})(this, function() {
|
|
16
|
+
'use strict';
|
|
17
|
+
|
|
18
|
+
var plugin = function plugin(_ref) {
|
|
19
|
+
var addFilter = _ref.addFilter,
|
|
20
|
+
utils = _ref.utils;
|
|
21
|
+
// get quick reference to Type utils
|
|
22
|
+
var Type = utils.Type,
|
|
23
|
+
isString = utils.isString,
|
|
24
|
+
replaceInString = utils.replaceInString,
|
|
25
|
+
guesstimateMimeType = utils.guesstimateMimeType,
|
|
26
|
+
getExtensionFromFilename = utils.getExtensionFromFilename,
|
|
27
|
+
getFilenameFromURL = utils.getFilenameFromURL;
|
|
28
|
+
|
|
29
|
+
var mimeTypeMatchesWildCard = function mimeTypeMatchesWildCard(mimeType, wildcard) {
|
|
30
|
+
var mimeTypeGroup = (/^[^/]+/.exec(mimeType) || []).pop(); // image/png -> image
|
|
31
|
+
var wildcardGroup = wildcard.slice(0, -2); // image/* -> image
|
|
32
|
+
return mimeTypeGroup === wildcardGroup;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
var isValidMimeType = function isValidMimeType(acceptedTypes, userInputType) {
|
|
36
|
+
return acceptedTypes.some(function(acceptedType) {
|
|
37
|
+
// accepted is wildcard mime type
|
|
38
|
+
if (/\*$/.test(acceptedType)) {
|
|
39
|
+
return mimeTypeMatchesWildCard(userInputType, acceptedType);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// is normal mime type
|
|
43
|
+
return acceptedType === userInputType;
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
var getItemType = function getItemType(item) {
|
|
48
|
+
// if the item is a url we guess the mime type by the extension
|
|
49
|
+
var type = '';
|
|
50
|
+
if (isString(item)) {
|
|
51
|
+
var filename = getFilenameFromURL(item);
|
|
52
|
+
var extension = getExtensionFromFilename(filename);
|
|
53
|
+
if (extension) {
|
|
54
|
+
type = guesstimateMimeType(extension);
|
|
55
|
+
}
|
|
56
|
+
} else {
|
|
57
|
+
type = item.type;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return type;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
var validateFile = function validateFile(item, acceptedFileTypes, typeDetector) {
|
|
64
|
+
// no types defined, everything is allowed \o/
|
|
65
|
+
if (acceptedFileTypes.length === 0) {
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// gets the item type
|
|
70
|
+
var type = getItemType(item);
|
|
71
|
+
|
|
72
|
+
// no type detector, test now
|
|
73
|
+
if (!typeDetector) {
|
|
74
|
+
return isValidMimeType(acceptedFileTypes, type);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// use type detector
|
|
78
|
+
return new Promise(function(resolve, reject) {
|
|
79
|
+
typeDetector(item, type)
|
|
80
|
+
.then(function(detectedType) {
|
|
81
|
+
if (isValidMimeType(acceptedFileTypes, detectedType)) {
|
|
82
|
+
resolve();
|
|
83
|
+
} else {
|
|
84
|
+
reject();
|
|
85
|
+
}
|
|
86
|
+
})
|
|
87
|
+
.catch(reject);
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
var applyMimeTypeMap = function applyMimeTypeMap(map) {
|
|
92
|
+
return function(acceptedFileType) {
|
|
93
|
+
return map[acceptedFileType] === null
|
|
94
|
+
? false
|
|
95
|
+
: map[acceptedFileType] || acceptedFileType;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
// setup attribute mapping for accept
|
|
100
|
+
addFilter('SET_ATTRIBUTE_TO_OPTION_MAP', function(map) {
|
|
101
|
+
return Object.assign(map, {
|
|
102
|
+
accept: 'acceptedFileTypes',
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
// filtering if an item is allowed in hopper
|
|
107
|
+
addFilter('ALLOW_HOPPER_ITEM', function(file, _ref2) {
|
|
108
|
+
var query = _ref2.query;
|
|
109
|
+
// if we are not doing file type validation exit
|
|
110
|
+
if (!query('GET_ALLOW_FILE_TYPE_VALIDATION')) {
|
|
111
|
+
return true;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// we validate the file against the accepted file types
|
|
115
|
+
return validateFile(file, query('GET_ACCEPTED_FILE_TYPES'));
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
// called for each file that is loaded
|
|
119
|
+
// right before it is set to the item state
|
|
120
|
+
// should return a promise
|
|
121
|
+
addFilter('LOAD_FILE', function(file, _ref3) {
|
|
122
|
+
var query = _ref3.query;
|
|
123
|
+
return new Promise(function(resolve, reject) {
|
|
124
|
+
if (!query('GET_ALLOW_FILE_TYPE_VALIDATION')) {
|
|
125
|
+
resolve(file);
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
var acceptedFileTypes = query('GET_ACCEPTED_FILE_TYPES');
|
|
130
|
+
|
|
131
|
+
// custom type detector method
|
|
132
|
+
var typeDetector = query('GET_FILE_VALIDATE_TYPE_DETECT_TYPE');
|
|
133
|
+
|
|
134
|
+
// if invalid, exit here
|
|
135
|
+
var validationResult = validateFile(file, acceptedFileTypes, typeDetector);
|
|
136
|
+
|
|
137
|
+
var handleRejection = function handleRejection() {
|
|
138
|
+
var acceptedFileTypesMapped = acceptedFileTypes
|
|
139
|
+
.map(
|
|
140
|
+
applyMimeTypeMap(
|
|
141
|
+
query('GET_FILE_VALIDATE_TYPE_LABEL_EXPECTED_TYPES_MAP')
|
|
142
|
+
)
|
|
143
|
+
)
|
|
144
|
+
.filter(function(label) {
|
|
145
|
+
return label !== false;
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
var acceptedFileTypesMappedUnique = acceptedFileTypesMapped.filter(function(
|
|
149
|
+
item,
|
|
150
|
+
index
|
|
151
|
+
) {
|
|
152
|
+
return acceptedFileTypesMapped.indexOf(item) === index;
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
reject({
|
|
156
|
+
status: {
|
|
157
|
+
main: query('GET_LABEL_FILE_TYPE_NOT_ALLOWED'),
|
|
158
|
+
sub: replaceInString(
|
|
159
|
+
query('GET_FILE_VALIDATE_TYPE_LABEL_EXPECTED_TYPES'),
|
|
160
|
+
{
|
|
161
|
+
allTypes: acceptedFileTypesMappedUnique.join(', '),
|
|
162
|
+
allButLastType: acceptedFileTypesMappedUnique
|
|
163
|
+
.slice(0, -1)
|
|
164
|
+
.join(', '),
|
|
165
|
+
lastType:
|
|
166
|
+
acceptedFileTypesMappedUnique[
|
|
167
|
+
acceptedFileTypesMappedUnique.length - 1
|
|
168
|
+
],
|
|
169
|
+
}
|
|
170
|
+
),
|
|
171
|
+
},
|
|
172
|
+
});
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
// has returned new filename immidiately
|
|
176
|
+
if (typeof validationResult === 'boolean') {
|
|
177
|
+
if (!validationResult) {
|
|
178
|
+
return handleRejection();
|
|
179
|
+
}
|
|
180
|
+
return resolve(file);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// is promise
|
|
184
|
+
validationResult
|
|
185
|
+
.then(function() {
|
|
186
|
+
resolve(file);
|
|
187
|
+
})
|
|
188
|
+
.catch(handleRejection);
|
|
189
|
+
});
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
// expose plugin
|
|
193
|
+
return {
|
|
194
|
+
// default options
|
|
195
|
+
options: {
|
|
196
|
+
// Enable or disable file type validation
|
|
197
|
+
allowFileTypeValidation: [true, Type.BOOLEAN],
|
|
198
|
+
|
|
199
|
+
// What file types to accept
|
|
200
|
+
acceptedFileTypes: [[], Type.ARRAY],
|
|
201
|
+
// - must be comma separated
|
|
202
|
+
// - mime types: image/png, image/jpeg, image/gif
|
|
203
|
+
// - extensions: .png, .jpg, .jpeg ( not enabled yet )
|
|
204
|
+
// - wildcards: image/*
|
|
205
|
+
|
|
206
|
+
// label to show when a type is not allowed
|
|
207
|
+
labelFileTypeNotAllowed: ['File is of invalid type', Type.STRING],
|
|
208
|
+
|
|
209
|
+
// nicer label
|
|
210
|
+
fileValidateTypeLabelExpectedTypes: [
|
|
211
|
+
'Expects {allButLastType} or {lastType}',
|
|
212
|
+
Type.STRING,
|
|
213
|
+
],
|
|
214
|
+
|
|
215
|
+
// map mime types to extensions
|
|
216
|
+
fileValidateTypeLabelExpectedTypesMap: [{}, Type.OBJECT],
|
|
217
|
+
|
|
218
|
+
// Custom function to detect type of file
|
|
219
|
+
fileValidateTypeDetectType: [null, Type.FUNCTION],
|
|
220
|
+
},
|
|
221
|
+
};
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
// fire pluginloaded event if running in browser, this allows registering the plugin when using async script tags
|
|
225
|
+
var isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
|
|
226
|
+
if (isBrowser) {
|
|
227
|
+
document.dispatchEvent(new CustomEvent('FilePond:pluginloaded', { detail: plugin }));
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
return plugin;
|
|
231
|
+
});
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* FilePondPluginImagePreview 4.6.12
|
|
3
|
+
* Licensed under MIT, https://opensource.org/licenses/MIT/
|
|
4
|
+
* Please visit https://pqina.nl/filepond/ for details.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
.filepond--image-preview-markup {
|
|
9
|
+
position: absolute;
|
|
10
|
+
left: 0;
|
|
11
|
+
top: 0;
|
|
12
|
+
}
|
|
13
|
+
.filepond--image-preview-wrapper {
|
|
14
|
+
z-index: 2;
|
|
15
|
+
}
|
|
16
|
+
.filepond--image-preview-overlay {
|
|
17
|
+
display: block;
|
|
18
|
+
position: absolute;
|
|
19
|
+
left: 0;
|
|
20
|
+
top: 0;
|
|
21
|
+
width: 100%;
|
|
22
|
+
min-height: 5rem;
|
|
23
|
+
max-height: 7rem;
|
|
24
|
+
margin: 0;
|
|
25
|
+
opacity: 0;
|
|
26
|
+
z-index: 2;
|
|
27
|
+
pointer-events: none;
|
|
28
|
+
-webkit-user-select: none;
|
|
29
|
+
-moz-user-select: none;
|
|
30
|
+
-ms-user-select: none;
|
|
31
|
+
user-select: none;
|
|
32
|
+
}
|
|
33
|
+
.filepond--image-preview-overlay svg {
|
|
34
|
+
width: 100%;
|
|
35
|
+
height: auto;
|
|
36
|
+
color: inherit;
|
|
37
|
+
max-height: inherit;
|
|
38
|
+
}
|
|
39
|
+
.filepond--image-preview-overlay-idle {
|
|
40
|
+
mix-blend-mode: multiply;
|
|
41
|
+
color: rgba(40, 40, 40, 0.85);
|
|
42
|
+
}
|
|
43
|
+
.filepond--image-preview-overlay-success {
|
|
44
|
+
mix-blend-mode: normal;
|
|
45
|
+
color: rgba(54, 151, 99, 1);
|
|
46
|
+
}
|
|
47
|
+
.filepond--image-preview-overlay-failure {
|
|
48
|
+
mix-blend-mode: normal;
|
|
49
|
+
color: rgba(196, 78, 71, 1);
|
|
50
|
+
}
|
|
51
|
+
/* disable for Safari as mix-blend-mode causes the overflow:hidden of the parent container to not work */
|
|
52
|
+
@supports (-webkit-marquee-repetition: infinite) and
|
|
53
|
+
((-o-object-fit: fill) or (object-fit: fill)) {
|
|
54
|
+
.filepond--image-preview-overlay-idle {
|
|
55
|
+
mix-blend-mode: normal;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
.filepond--image-preview-wrapper {
|
|
59
|
+
/* no interaction */
|
|
60
|
+
-webkit-user-select: none;
|
|
61
|
+
-moz-user-select: none;
|
|
62
|
+
-ms-user-select: none;
|
|
63
|
+
user-select: none;
|
|
64
|
+
|
|
65
|
+
/* have preview fill up all available space */
|
|
66
|
+
position: absolute;
|
|
67
|
+
left: 0;
|
|
68
|
+
top: 0;
|
|
69
|
+
right: 0;
|
|
70
|
+
height: 100%;
|
|
71
|
+
margin: 0;
|
|
72
|
+
|
|
73
|
+
/* radius is .05em less to prevent the panel background color from shining through */
|
|
74
|
+
border-radius: 0.45em;
|
|
75
|
+
overflow: hidden;
|
|
76
|
+
|
|
77
|
+
/* this seems to prevent Chrome from redrawing this layer constantly */
|
|
78
|
+
background: rgba(0, 0, 0, 0.01);
|
|
79
|
+
}
|
|
80
|
+
.filepond--image-preview {
|
|
81
|
+
position: absolute;
|
|
82
|
+
left: 0;
|
|
83
|
+
top: 0;
|
|
84
|
+
z-index: 1;
|
|
85
|
+
display: flex; /* this aligns the graphic vertically if the panel is higher than the image */
|
|
86
|
+
align-items: center;
|
|
87
|
+
height: 100%;
|
|
88
|
+
width: 100%;
|
|
89
|
+
pointer-events: none;
|
|
90
|
+
background: #222;
|
|
91
|
+
|
|
92
|
+
/* will be animated */
|
|
93
|
+
will-change: transform, opacity;
|
|
94
|
+
}
|
|
95
|
+
.filepond--image-clip {
|
|
96
|
+
position: relative;
|
|
97
|
+
overflow: hidden;
|
|
98
|
+
margin: 0 auto;
|
|
99
|
+
|
|
100
|
+
/* transparency indicator (currently only supports grid or basic color) */
|
|
101
|
+
}
|
|
102
|
+
.filepond--image-clip[data-transparency-indicator='grid'] img,
|
|
103
|
+
.filepond--image-clip[data-transparency-indicator='grid'] canvas {
|
|
104
|
+
background-color: #fff;
|
|
105
|
+
background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg' fill='%23eee'%3E%3Cpath d='M0 0 H50 V50 H0'/%3E%3Cpath d='M50 50 H100 V100 H50'/%3E%3C/svg%3E");
|
|
106
|
+
background-size: 1.25em 1.25em;
|
|
107
|
+
}
|
|
108
|
+
.filepond--image-bitmap,
|
|
109
|
+
.filepond--image-vector {
|
|
110
|
+
position: absolute;
|
|
111
|
+
left: 0;
|
|
112
|
+
top: 0;
|
|
113
|
+
will-change: transform;
|
|
114
|
+
}
|
|
115
|
+
.filepond--root[data-style-panel-layout~='integrated']
|
|
116
|
+
.filepond--image-preview-wrapper {
|
|
117
|
+
border-radius: 0;
|
|
118
|
+
}
|
|
119
|
+
.filepond--root[data-style-panel-layout~='integrated']
|
|
120
|
+
.filepond--image-preview {
|
|
121
|
+
height: 100%;
|
|
122
|
+
display: flex;
|
|
123
|
+
justify-content: center;
|
|
124
|
+
align-items: center;
|
|
125
|
+
}
|
|
126
|
+
.filepond--root[data-style-panel-layout~='circle']
|
|
127
|
+
.filepond--image-preview-wrapper {
|
|
128
|
+
border-radius: 99999rem;
|
|
129
|
+
}
|
|
130
|
+
.filepond--root[data-style-panel-layout~='circle']
|
|
131
|
+
.filepond--image-preview-overlay {
|
|
132
|
+
top: auto;
|
|
133
|
+
bottom: 0;
|
|
134
|
+
-webkit-transform: scaleY(-1);
|
|
135
|
+
transform: scaleY(-1);
|
|
136
|
+
}
|
|
137
|
+
.filepond--root[data-style-panel-layout~='circle']
|
|
138
|
+
.filepond--file
|
|
139
|
+
.filepond--file-action-button[data-align*='bottom']:not([data-align*='center']) {
|
|
140
|
+
margin-bottom: 0.325em;
|
|
141
|
+
}
|
|
142
|
+
.filepond--root[data-style-panel-layout~='circle']
|
|
143
|
+
.filepond--file
|
|
144
|
+
[data-align*='left'] {
|
|
145
|
+
left: calc(50% - 3em);
|
|
146
|
+
}
|
|
147
|
+
.filepond--root[data-style-panel-layout~='circle']
|
|
148
|
+
.filepond--file
|
|
149
|
+
[data-align*='right'] {
|
|
150
|
+
right: calc(50% - 3em);
|
|
151
|
+
}
|
|
152
|
+
.filepond--root[data-style-panel-layout~='circle']
|
|
153
|
+
.filepond--progress-indicator[data-align*='bottom'][data-align*='left'],
|
|
154
|
+
.filepond--root[data-style-panel-layout~='circle']
|
|
155
|
+
.filepond--progress-indicator[data-align*='bottom'][data-align*='right'] {
|
|
156
|
+
margin-bottom: calc(0.325em + 0.1875em);
|
|
157
|
+
}
|
|
158
|
+
.filepond--root[data-style-panel-layout~='circle']
|
|
159
|
+
.filepond--progress-indicator[data-align*='bottom'][data-align*='center'] {
|
|
160
|
+
margin-top: 0;
|
|
161
|
+
margin-bottom: 0.1875em;
|
|
162
|
+
margin-left: 0.1875em;
|
|
163
|
+
}
|