alchemy_cms 7.1.0.pre.rc1 → 7.1.1
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.
Potentially problematic release.
This version of alchemy_cms might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +19 -0
- data/app/assets/config/alchemy_manifest.js +1 -0
- data/app/assets/javascripts/alchemy/alchemy.elements_window.js.coffee +1 -1
- data/app/assets/javascripts/alchemy/alchemy.link_dialog.js.coffee +3 -2
- data/app/javascript/alchemy_admin/components/element_editor.js +1 -0
- data/app/javascript/alchemy_admin/components/tinymce.js +8 -1
- data/app/javascript/alchemy_admin/components/uploader/progress.js +3 -4
- data/app/javascript/alchemy_admin/components/uploader.js +0 -3
- data/app/models/alchemy/picture.rb +15 -0
- data/app/models/concerns/alchemy/picture_thumbnails.rb +1 -1
- data/app/views/alchemy/admin/crop.html.erb +1 -1
- data/app/views/alchemy/admin/layoutpages/_layoutpage.html.erb +1 -1
- data/app/views/alchemy/admin/pages/_page.html.erb +1 -1
- data/app/views/alchemy/admin/pages/_page_status.html.erb +2 -2
- data/app/views/alchemy/admin/pages/edit.html.erb +2 -2
- data/app/views/alchemy/admin/pictures/_picture.html.erb +1 -1
- data/app/views/alchemy/admin/pictures/_picture_to_assign.html.erb +1 -1
- data/app/views/alchemy/admin/uploader/_button.html.erb +2 -1
- data/lib/alchemy/test_support/having_picture_thumbnails_examples.rb +6 -6
- data/lib/alchemy/tinymce.rb +0 -1
- data/lib/alchemy/version.rb +1 -1
- data/package.json +7 -7
- data/vendor/javascript/shoelace.min.js +63 -38
- data/vendor/javascript/sortable.min.js +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 158a3b005d476cb225569f0efa198ee7d9a5da5d056ba2125470d7bd21d2b99e
|
4
|
+
data.tar.gz: 9a5d55fff7333965e9510cb45deab35a4db635f2e98fdde484cf450656fa64bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56860b5eaf6cf7915bc90d5d96ac0f9d9e62bab6291a4d6d56f7a5f8e41dd451568c9ace0646c69a64e4541bddeaf45d2378726079012259149ad335cc70e8d1
|
7
|
+
data.tar.gz: 2d0241d235446e3e9a5058abeb5bbb249e5809b7fdbd1266f851748260d2f877d01a16d338af4f3c974699a2bf03f390e06e1b6d78fe0d2c61047fe1606035c4
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,24 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 7.1.1 (2024-01-31)
|
4
|
+
|
5
|
+
- Translate collapse all elements button [#2711](https://github.com/AlchemyCMS/alchemy_cms/pull/2711) ([tvdeyen](https://github.com/tvdeyen))
|
6
|
+
- Slighty raise page properties dialog width [#2710](https://github.com/AlchemyCMS/alchemy_cms/pull/2710) ([tvdeyen](https://github.com/tvdeyen))
|
7
|
+
- [js] Update @shoelace-style/shoelace 2.12.0 → 2.13.1 (minor) [#2709](https://github.com/AlchemyCMS/alchemy_cms/pull/2709) ([depfu](https://github.com/apps/depfu))
|
8
|
+
|
9
|
+
## 7.1.0 (2024-01-25)
|
10
|
+
|
11
|
+
- Revert "Set admin picture thumbnail quality to 90" [#2706](https://github.com/AlchemyCMS/alchemy_cms/pull/2706) ([tvdeyen](https://github.com/tvdeyen))
|
12
|
+
- [js] Update all development Yarn dependencies (2024-01-25) [#2705](https://github.com/AlchemyCMS/alchemy_cms/pull/2705) ([depfu](https://github.com/apps/depfu))
|
13
|
+
- 7.1 Fix UI glitches [#2704](https://github.com/AlchemyCMS/alchemy_cms/pull/2704) ([tvdeyen](https://github.com/tvdeyen))
|
14
|
+
- [7.1] Revert WebP thumbnails [#2703](https://github.com/AlchemyCMS/alchemy_cms/pull/2703) ([tvdeyen](https://github.com/tvdeyen))
|
15
|
+
- TinyMCE: Trim spaces from pasted links [#2702](https://github.com/AlchemyCMS/alchemy_cms/pull/2702) ([mamhoff](https://github.com/mamhoff))
|
16
|
+
- [js] Update sortablejs 1.15.1 → 1.15.2 (patch) [#2698](https://github.com/AlchemyCMS/alchemy_cms/pull/2698) ([depfu](https://github.com/apps/depfu))
|
17
|
+
- [js] Update @rails/ujs 7.1.2 → 7.1.3 (patch) [#2697](https://github.com/AlchemyCMS/alchemy_cms/pull/2697) ([depfu](https://github.com/apps/depfu))
|
18
|
+
- Set admin picture thumbnail quality to 90 [#2692](https://github.com/AlchemyCMS/alchemy_cms/pull/2692) ([tvdeyen](https://github.com/tvdeyen))
|
19
|
+
- Set Tinymce editor form min-height [#2691](https://github.com/AlchemyCMS/alchemy_cms/pull/2691) ([tvdeyen](https://github.com/tvdeyen))
|
20
|
+
- Link tinymce icons [#2690](https://github.com/AlchemyCMS/alchemy_cms/pull/2690) ([tvdeyen](https://github.com/tvdeyen))
|
21
|
+
|
3
22
|
## 7.1.0-rc1 (2024-01-15)
|
4
23
|
|
5
24
|
- Use title attribute for link_to_dialog and delete_button tooltip [#2688](https://github.com/AlchemyCMS/alchemy_cms/pull/2688) ([tvdeyen](https://github.com/tvdeyen))
|
@@ -5,6 +5,7 @@
|
|
5
5
|
//= link alchemy/print.css
|
6
6
|
//= link alchemy/welcome.css
|
7
7
|
//= link tinymce/plugins/alchemy_link/plugin.min.js
|
8
|
+
//= link tinymce/icons/remixicons/icons.js
|
8
9
|
//= link_directory ../stylesheets/tinymce/skins/ui/alchemy/ .css
|
9
10
|
//= link_directory ../stylesheets/tinymce/skins/content/alchemy/ .css
|
10
11
|
//= link_tree ../images/alchemy/
|
@@ -60,7 +60,7 @@ Alchemy.ElementsWindow =
|
|
60
60
|
createToolbar: (buttons) ->
|
61
61
|
@toolbar = $('<div class="elements-window-toolbar" />')
|
62
62
|
buttons.push
|
63
|
-
label: "Collapse all elements"
|
63
|
+
label: Alchemy.t("Collapse all elements")
|
64
64
|
iconClass: "contract-up-down-line"
|
65
65
|
align: "end"
|
66
66
|
class: "right"
|
@@ -129,10 +129,11 @@ class window.Alchemy.LinkDialog extends Alchemy.Dialog
|
|
129
129
|
|
130
130
|
# Sets the link either in TinyMCE or on an Ingredient.
|
131
131
|
setLink: (url, title, target) ->
|
132
|
+
trimmedUrl = url.trim()
|
132
133
|
if @link_object.editor
|
133
|
-
@setTinyMCELink(
|
134
|
+
@setTinyMCELink(trimmedUrl, title, target)
|
134
135
|
else
|
135
|
-
@link_object.setLink(
|
136
|
+
@link_object.setLink(trimmedUrl, title, target, @link_type)
|
136
137
|
return
|
137
138
|
|
138
139
|
# Sets a link in TinyMCE editor.
|
@@ -121,6 +121,7 @@ export class ElementEditor extends HTMLElement {
|
|
121
121
|
this.setClean()
|
122
122
|
// Reset errors that might be visible from last save attempt
|
123
123
|
this.errorsDisplay.innerHTML = ""
|
124
|
+
this.elementErrors.classList.add("hidden")
|
124
125
|
this.body
|
125
126
|
.querySelectorAll(".ingredient-editor")
|
126
127
|
.forEach((el) => el.classList.remove("validation_failed"))
|
@@ -100,12 +100,19 @@ class Tinymce extends AlchemyHTMLElement {
|
|
100
100
|
}
|
101
101
|
})
|
102
102
|
|
103
|
-
|
103
|
+
const config = {
|
104
104
|
...Alchemy.TinymceDefaults,
|
105
105
|
...customConfig,
|
106
106
|
language: currentLocale(),
|
107
107
|
selector: `#${this.editorId}`
|
108
108
|
}
|
109
|
+
|
110
|
+
// Tinymce has a height of 400px by default
|
111
|
+
// if the element has a min_height set, we use this value for the height as well
|
112
|
+
// so we do not need to set both values in the element configuration
|
113
|
+
config.height = config.min_height
|
114
|
+
|
115
|
+
return config
|
109
116
|
}
|
110
117
|
|
111
118
|
get editorId() {
|
@@ -27,7 +27,6 @@ export class Progress extends AlchemyHTMLElement {
|
|
27
27
|
this.actionButton.addEventListener("click", () => {
|
28
28
|
if (this.finished) {
|
29
29
|
this.onComplete(this.status)
|
30
|
-
this.visible = false
|
31
30
|
} else {
|
32
31
|
this.cancel()
|
33
32
|
}
|
@@ -126,6 +125,7 @@ export class Progress extends AlchemyHTMLElement {
|
|
126
125
|
*/
|
127
126
|
_updateView() {
|
128
127
|
const status = this.status
|
128
|
+
this.className = status
|
129
129
|
|
130
130
|
// update progress bar
|
131
131
|
this.progressElement.value = this.totalProgress
|
@@ -143,10 +143,9 @@ export class Progress extends AlchemyHTMLElement {
|
|
143
143
|
if (this.finished) {
|
144
144
|
this._setupCloseButton()
|
145
145
|
this.onComplete(status)
|
146
|
+
} else {
|
147
|
+
this.visible = true
|
146
148
|
}
|
147
|
-
|
148
|
-
this.className = status
|
149
|
-
this.visible = true
|
150
149
|
}
|
151
150
|
|
152
151
|
/**
|
@@ -112,9 +112,6 @@ export class Uploader extends AlchemyHTMLElement {
|
|
112
112
|
}
|
113
113
|
this.uploadProgress = new Progress(fileUploads)
|
114
114
|
this.uploadProgress.onComplete = (status) => {
|
115
|
-
if (status === "successful" || status === "canceled") {
|
116
|
-
this.uploadProgress.visible = false
|
117
|
-
}
|
118
115
|
this.dispatchCustomEvent(`upload.${status}`)
|
119
116
|
}
|
120
117
|
|
@@ -192,6 +192,21 @@ module Alchemy
|
|
192
192
|
nil
|
193
193
|
end
|
194
194
|
|
195
|
+
# Returns an url for the thumbnail representation of the picture
|
196
|
+
#
|
197
|
+
# @param [String] size - The size of the thumbnail
|
198
|
+
#
|
199
|
+
# @return [String]
|
200
|
+
def thumbnail_url(size: "160x120")
|
201
|
+
return if image_file.nil?
|
202
|
+
|
203
|
+
url(
|
204
|
+
flatten: true,
|
205
|
+
format: image_file_format || "jpg",
|
206
|
+
size: size
|
207
|
+
)
|
208
|
+
end
|
209
|
+
|
195
210
|
# Updates name and tag_list attributes.
|
196
211
|
#
|
197
212
|
# Used by +Admin::PicturesController#update_multiple+
|
@@ -84,7 +84,7 @@ module Alchemy
|
|
84
84
|
crop_from: crop && crop_from.presence || default_crop_from&.join("x"),
|
85
85
|
crop_size: crop && crop_size.presence || default_crop_size&.join("x"),
|
86
86
|
flatten: true,
|
87
|
-
format: "
|
87
|
+
format: picture&.image_file_format || "jpg"
|
88
88
|
}
|
89
89
|
end
|
90
90
|
|
@@ -8,7 +8,7 @@
|
|
8
8
|
<%= simple_format Alchemy.t(:explain_cropping) %>
|
9
9
|
<% end %>
|
10
10
|
<div class="thumbnail_background">
|
11
|
-
<%= image_tag @picture.
|
11
|
+
<%= image_tag @picture.thumbnail_url(size: '800x600'), id: 'imageToCrop' %>
|
12
12
|
</div>
|
13
13
|
<form>
|
14
14
|
<%= button_tag Alchemy.t(:apply), type: 'submit' %>
|
@@ -1,8 +1,8 @@
|
|
1
1
|
<span class="page_status">
|
2
2
|
<% if page.public? %>
|
3
|
-
<%= render_icon(:cloud, size: "1x"
|
3
|
+
<%= render_icon(:cloud, size: "1x") %>
|
4
4
|
<% else %>
|
5
|
-
<%= render_icon("cloud-off", size: "1x") %>
|
5
|
+
<%= render_icon("cloud-off", size: "1x", class: "disabled") %>
|
6
6
|
<% end %>
|
7
7
|
</span>
|
8
8
|
<span class="page_status">
|
@@ -38,7 +38,7 @@
|
|
38
38
|
alchemy.edit_admin_layoutpage_path(@page),
|
39
39
|
{
|
40
40
|
title: Alchemy.t(:page_properties),
|
41
|
-
size: '
|
41
|
+
size: '500x170'
|
42
42
|
},
|
43
43
|
class: :icon_button,
|
44
44
|
'data-alchemy-hotkey' => 'alt+e'
|
@@ -49,7 +49,7 @@
|
|
49
49
|
alchemy.configure_admin_page_path(@page),
|
50
50
|
{
|
51
51
|
title: Alchemy.t(:page_properties),
|
52
|
-
size: '
|
52
|
+
size: '500x680'
|
53
53
|
},
|
54
54
|
class: :icon_button,
|
55
55
|
'data-alchemy-hotkey' => 'alt+e'
|
@@ -20,7 +20,7 @@
|
|
20
20
|
</sl-tooltip>
|
21
21
|
</span>
|
22
22
|
<% end %>
|
23
|
-
<% picture_url = picture.
|
23
|
+
<% picture_url = picture.thumbnail_url(size: preview_size(@size)) %>
|
24
24
|
<% image = image_tag(picture_url || "alchemy/missing-image.svg", alt: picture.name) %>
|
25
25
|
<% if can?(:edit, picture) && picture_url %>
|
26
26
|
<%= link_to(
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<sl-tooltip content="<%= Alchemy.t(:assign_image) %>">
|
3
3
|
<%= link_to(
|
4
4
|
image_tag(
|
5
|
-
picture_to_assign.
|
5
|
+
picture_to_assign.thumbnail_url(size: preview_size(size)) || "alchemy/missing-image.svg",
|
6
6
|
alt: picture_to_assign.name
|
7
7
|
),
|
8
8
|
alchemy.assign_admin_picture_path(
|
@@ -17,9 +17,10 @@
|
|
17
17
|
</alchemy-uploader>
|
18
18
|
|
19
19
|
<script type='text/javascript'>
|
20
|
-
document.querySelector("alchemy-uploader").addEventListener("Alchemy.upload.successful", () => {
|
20
|
+
document.querySelector("alchemy-uploader").addEventListener("Alchemy.upload.successful", (evt) => {
|
21
21
|
setTimeout(() => {
|
22
22
|
var url = '<%= redirect_url.html_safe %>';
|
23
|
+
evt.target.uploadProgress.visible = false;
|
23
24
|
<% if local_assigns[:in_dialog] %>
|
24
25
|
$.get(url, null, null, 'script');
|
25
26
|
<% else %>
|
@@ -203,8 +203,8 @@ RSpec.shared_examples_for "having picture thumbnails" do
|
|
203
203
|
allow(record).to receive(:settings) { settings }
|
204
204
|
end
|
205
205
|
|
206
|
-
it "includes
|
207
|
-
expect(thumbnail_url).to match(/\.
|
206
|
+
it "includes the image's original file format." do
|
207
|
+
expect(thumbnail_url).to match(/\.png/)
|
208
208
|
end
|
209
209
|
|
210
210
|
it "flattens the image." do
|
@@ -305,8 +305,8 @@ RSpec.shared_examples_for "having picture thumbnails" do
|
|
305
305
|
create(:alchemy_picture)
|
306
306
|
end
|
307
307
|
|
308
|
-
it "
|
309
|
-
expect(thumbnail_url_options[:format]).to eq("
|
308
|
+
it "includes the image's original file format." do
|
309
|
+
expect(thumbnail_url_options[:format]).to eq("png")
|
310
310
|
end
|
311
311
|
|
312
312
|
it "flattens the image." do
|
@@ -381,7 +381,7 @@ RSpec.shared_examples_for "having picture thumbnails" do
|
|
381
381
|
crop_from: nil,
|
382
382
|
crop_size: nil,
|
383
383
|
flatten: true,
|
384
|
-
format: "
|
384
|
+
format: "jpg",
|
385
385
|
size: "160x120"
|
386
386
|
)
|
387
387
|
end
|
@@ -400,7 +400,7 @@ RSpec.shared_examples_for "having picture thumbnails" do
|
|
400
400
|
crop_from: nil,
|
401
401
|
crop_size: nil,
|
402
402
|
flatten: true,
|
403
|
-
format: "
|
403
|
+
format: "jpg",
|
404
404
|
size: "160x120"
|
405
405
|
)
|
406
406
|
end
|
data/lib/alchemy/tinymce.rb
CHANGED
data/lib/alchemy/version.rb
CHANGED
data/package.json
CHANGED
@@ -10,18 +10,18 @@
|
|
10
10
|
"author": "Thomas von Deyen",
|
11
11
|
"license": "BSD-3-Clause",
|
12
12
|
"dependencies": {
|
13
|
-
"@rails/ujs": "^7.1.
|
14
|
-
"@shoelace-style/shoelace": "^2.
|
13
|
+
"@rails/ujs": "^7.1.3",
|
14
|
+
"@shoelace-style/shoelace": "^2.13.1",
|
15
15
|
"@ungap/custom-elements": "^1.3.0",
|
16
16
|
"clipboard": "^2.0.11",
|
17
17
|
"flatpickr": "^4.6.13",
|
18
18
|
"keymaster": "^1.6.2",
|
19
|
-
"sortablejs": "^1.15.
|
19
|
+
"sortablejs": "^1.15.2",
|
20
20
|
"tinymce": "^6.8.2"
|
21
21
|
},
|
22
22
|
"devDependencies": {
|
23
|
-
"@babel/core": "^7.
|
24
|
-
"@babel/preset-env": "^7.
|
23
|
+
"@babel/core": "^7.23.7",
|
24
|
+
"@babel/preset-env": "^7.23.7",
|
25
25
|
"@rollup/plugin-commonjs": "^25.0.7",
|
26
26
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
27
27
|
"@rollup/plugin-terser": "^0.4.4",
|
@@ -31,8 +31,8 @@
|
|
31
31
|
"jest-environment-jsdom": "^29.6.4",
|
32
32
|
"jquery": "^3.7.1",
|
33
33
|
"jsdom-testing-mocks": "^1.11.0",
|
34
|
-
"prettier": "^3.
|
35
|
-
"rollup": "^4.9.
|
34
|
+
"prettier": "^3.2.4",
|
35
|
+
"rollup": "^4.9.5",
|
36
36
|
"xhr-mock": "^2.5.1"
|
37
37
|
},
|
38
38
|
"jest": {
|