alchemy-media 0.7.4 → 0.7.6

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 (57) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/assets/fonts/fontawesome6/fa-brands-400.ttf +0 -0
  3. package/assets/fonts/fontawesome6/fa-brands-400.woff2 +0 -0
  4. package/assets/fonts/fontawesome6/fa-regular-400.ttf +0 -0
  5. package/assets/fonts/fontawesome6/fa-regular-400.woff2 +0 -0
  6. package/assets/fonts/fontawesome6/fa-solid-900.ttf +0 -0
  7. package/assets/fonts/fontawesome6/fa-solid-900.woff2 +0 -0
  8. package/assets/fonts/fontawesome6/fa-v4compatibility.ttf +0 -0
  9. package/assets/fonts/fontawesome6/fa-v4compatibility.woff2 +0 -0
  10. package/assets/stylesheets/alchemy_media.scss +0 -0
  11. package/assets/stylesheets/chimera/mediafield.less +0 -0
  12. package/assets/stylesheets/fontawesome6/_animated.scss +0 -0
  13. package/assets/stylesheets/fontawesome6/_bordered-pulled.scss +0 -0
  14. package/assets/stylesheets/fontawesome6/_core.scss +0 -0
  15. package/assets/stylesheets/fontawesome6/_fixed-width.scss +0 -0
  16. package/assets/stylesheets/fontawesome6/_functions.scss +0 -0
  17. package/assets/stylesheets/fontawesome6/_icons.scss +0 -0
  18. package/assets/stylesheets/fontawesome6/_list.scss +0 -0
  19. package/assets/stylesheets/fontawesome6/_mixins.scss +0 -0
  20. package/assets/stylesheets/fontawesome6/_rotated-flipped.scss +0 -0
  21. package/assets/stylesheets/fontawesome6/_screen-reader.scss +0 -0
  22. package/assets/stylesheets/fontawesome6/_shims.scss +0 -0
  23. package/assets/stylesheets/fontawesome6/_sizing.scss +0 -0
  24. package/assets/stylesheets/fontawesome6/_stacked.scss +0 -0
  25. package/assets/stylesheets/fontawesome6/_variables.scss +0 -0
  26. package/assets/stylesheets/fontawesome6/brands.scss +0 -0
  27. package/assets/stylesheets/fontawesome6/fontawesome.scss +0 -0
  28. package/assets/stylesheets/fontawesome6/regular.scss +0 -0
  29. package/assets/stylesheets/fontawesome6/solid.scss +0 -0
  30. package/assets/stylesheets/fontawesome6/v4-shims.scss +0 -0
  31. package/assets/stylesheets/media_elements/_file.scss +17 -2
  32. package/assets/stylesheets/media_elements/_icon.scss +0 -0
  33. package/assets/stylesheets/media_elements/_image.scss +0 -0
  34. package/assets/stylesheets/media_elements/_svg.scss +0 -0
  35. package/assets/stylesheets/media_elements/index.scss +0 -0
  36. package/bootstrap.js +0 -0
  37. package/controller/media_files_controller.js +0 -0
  38. package/controller/media_gallery_chimera_controller.js +0 -0
  39. package/element/00-media_base.js +0 -0
  40. package/element/al_file.js +21 -4
  41. package/element/al_icon.js +0 -0
  42. package/element/al_icon_stack.js +0 -0
  43. package/element/al_svg.js +0 -0
  44. package/helper/media_helper.js +2 -2
  45. package/helper/widgets/image_widget.js +0 -0
  46. package/helper_field/file_field_type.js +0 -0
  47. package/lib/media_types/image_media_type.js +0 -0
  48. package/model/media_file_model.js +0 -0
  49. package/model/media_raw_model.js +0 -0
  50. package/package.json +1 -1
  51. package/view/element/al_file.hwk +4 -1
  52. package/view/element/al_file_selection.hwk +0 -0
  53. package/view/form/inputs/edit/file.hwk +0 -4
  54. package/view/form/inputs/edit/file_preview.hwk +0 -0
  55. package/view/form/inputs/view_inline/file.hwk +0 -0
  56. package/view/form/inputs/view_inline/file_preview.hwk +0 -0
  57. package/view/form/wrappers/edit/file_preview.hwk +0 -0
package/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## 0.7.6 (2023-10-05)
2
+
3
+ * Let `Media#imageUrl()` helper handle image instructions that start with a slash
4
+
5
+ ## 0.7.5 (2023-07-28)
6
+
7
+ * Remove old reference to `chimera/mediafield` script
8
+ * Add upload percentage feedback to `al-file` element
9
+
1
10
  ## 0.7.4 (2023-03-13)
2
11
 
3
12
  * By default, conceal SVGs that have the `graphics-symbol` role from assistive technologies
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -10,14 +10,29 @@ al-file {
10
10
  display: none !important;
11
11
  }
12
12
 
13
- &:not(.uploading) .uploading-icon {
14
- display: none;
13
+ &:not(.uploading) {
14
+ .upload-percentage,
15
+ .uploading-icon {
16
+ display: none;
17
+ }
15
18
  }
16
19
 
17
20
  &.uploading {
18
21
  .empty-icon {
19
22
  display: none !important;
20
23
  }
24
+
25
+ .upload-percentage {
26
+ position: absolute;
27
+ bottom: 4px;
28
+ width: 100%;
29
+ text-align: center;
30
+ font-size: 1.5rem;
31
+ }
32
+
33
+ .uploading-icon {
34
+ margin-top: -7px;
35
+ }
21
36
  }
22
37
 
23
38
  .al-file-drop-target {
File without changes
File without changes
File without changes
File without changes
package/bootstrap.js CHANGED
File without changes
File without changes
File without changes
File without changes
@@ -144,7 +144,7 @@ AlFile.setMethod(function updatePreview(value) {
144
144
  *
145
145
  * @author Jelle De Loecker <jelle@elevenways.be>
146
146
  * @since 0.6.0
147
- * @version 0.7.1
147
+ * @version 0.7.5
148
148
  */
149
149
  AlFile.setMethod(async function uploadFile(config) {
150
150
 
@@ -172,13 +172,30 @@ AlFile.setMethod(async function uploadFile(config) {
172
172
  form_data.append('accept', this.accept);
173
173
  }
174
174
 
175
+ let upload_percentage = this.querySelector('.upload-percentage');
176
+
177
+ if (upload_percentage) {
178
+ upload_percentage.textContent = '';
179
+ }
180
+
175
181
  let response;
176
182
 
177
183
  try {
178
- response = await Blast.fetch({
179
- url : url,
180
- post : form_data,
184
+ let pledge = Blast.fetch({
185
+ url : url,
186
+ post : form_data,
187
+ timeout : 60 * 1000,
181
188
  });
189
+
190
+ let request = pledge.request;
191
+
192
+ request.on('progress_upload', data => {
193
+ if (upload_percentage) {
194
+ upload_percentage.textContent = Math.round(data.percentage) + '%';
195
+ }
196
+ });
197
+
198
+ response = await pledge;
182
199
  } catch (err) {
183
200
 
184
201
  let alchemy_field = this.queryUp('al-field');
File without changes
File without changes
package/element/al_svg.js CHANGED
File without changes
@@ -248,7 +248,7 @@ Media.setMethod(function fileAnchor(file_id, options) {
248
248
  *
249
249
  * @author Jelle De Loecker <jelle@develry.be>
250
250
  * @since 0.2.0
251
- * @version 0.7.2
251
+ * @version 0.7.6
252
252
  *
253
253
  * @param {String} image_id
254
254
  *
@@ -273,7 +273,7 @@ Media.setMethod(function imageUrl(image_id, options) {
273
273
  }
274
274
 
275
275
  url = this.parseURL(this.view.helpers.Router.routeUrl(routeName, {id: image_id}));
276
- } else if (typeof image_id == 'string' && image_id.indexOf('http') === 0) {
276
+ } else if (typeof image_id == 'string' && (image_id.indexOf('http') === 0 || image_id[0] == '/')) {
277
277
  url = this.parseURL(image_id);
278
278
  } else if (image_id) {
279
279
  url = this.parseURL('/media/static/' + image_id);
File without changes
File without changes
File without changes
File without changes
File without changes
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "alchemy-media",
3
3
  "description": "The media plugin for Alchemy",
4
- "version": "0.7.4",
4
+ "version": "0.7.6",
5
5
  "repository": {
6
6
  "type" : "git",
7
7
  "url" : "https://github.com/11ways/alchemy-media.git"
@@ -4,7 +4,8 @@
4
4
  <al-icon
5
5
  icon-name="spinner"
6
6
  icon-style="duotone"
7
- class="uploading-icon fa-spin-pulse"
7
+ icon-flags="spin-pulse"
8
+ class="uploading-icon"
8
9
  ></al-icon>
9
10
 
10
11
  <al-icon
@@ -13,6 +14,8 @@
13
14
  class="empty-icon"
14
15
  ><% if (self.value) $0.hidden = true %></al-icon>
15
16
 
17
+ <span class="upload-percentage"></span>
18
+
16
19
  <input
17
20
  class="al-file-input"
18
21
  type="file"
File without changes
@@ -1,7 +1,3 @@
1
- <%
2
- script('chimera/mediafield');
3
- style('chimera/mediafield');
4
- %>
5
1
  <al-file
6
2
  class="alchemy-field-value"
7
3
  value=<% value %>
File without changes
File without changes
File without changes
File without changes