alchemy_cms 7.1.0.pre.b2 → 7.1.0.pre.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/app/assets/stylesheets/alchemy/filter_field.scss +5 -0
- data/app/assets/stylesheets/tinymce/skins/ui/alchemy/skin.min.scss +5 -0
- data/app/helpers/alchemy/admin/base_helper.rb +23 -10
- data/app/helpers/alchemy/base_helper.rb +16 -1
- data/app/javascript/alchemy_admin/components/button.js +1 -1
- data/app/javascript/alchemy_admin/components/clipboard_button.js +27 -0
- data/app/javascript/alchemy_admin/components/element_editor.js +2 -2
- data/app/javascript/alchemy_admin/components/tinymce.js +1 -1
- data/app/javascript/alchemy_admin.js +1 -1
- data/app/views/alchemy/admin/attachments/show.html.erb +10 -6
- data/app/views/alchemy/admin/crop.html.erb +1 -1
- data/app/views/alchemy/admin/nodes/index.html.erb +1 -0
- data/app/views/alchemy/admin/partials/_toolbar_button.html.erb +0 -1
- data/app/views/alchemy/admin/pictures/_archive.html.erb +3 -3
- data/app/views/alchemy/admin/pictures/_archive_overlay.html.erb +16 -3
- data/app/views/layouts/alchemy/admin.html.erb +1 -1
- data/eslint.config.js +17 -0
- data/lib/alchemy/forms/builder.rb +7 -0
- data/lib/alchemy/test_support/capybara_helpers.rb +1 -1
- data/lib/alchemy/version.rb +1 -1
- data/package.json +2 -0
- metadata +4 -4
- data/app/javascript/alchemy_admin/clipboard.js +0 -16
- data/app/views/alchemy/admin/pictures/_overlay_picture_list.html.erb +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 52cea190db8dfb6571f62d93f72942df0c05afbf7b7988b952da56cbbba5dd91
|
4
|
+
data.tar.gz: efd336249755bc11de59ff751be0af224ab9861f902df7ddd4226a97208840b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 587dee2f8372e32252543bbf6dd86bad7ab69d1734c2f129b3b6c4d11519e32f476f8605d2675e3df8cde2a1485ec470383baab818ab236895d61e0f37f9b631
|
7
|
+
data.tar.gz: dfdaa30ab9f4429d75fdc1bf4930cce9e5b093f9a5e4ca2a3a090008e90c0747b8efb6c7dc40fecc0874fd788db9de82da3a6e071eeed2c65e297ca2a3c9b7a2
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 7.1.0-rc1 (2024-01-15)
|
4
|
+
|
5
|
+
- 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))
|
6
|
+
- Add alchemy-clipboard-button component [#2687](https://github.com/AlchemyCMS/alchemy_cms/pull/2687) ([tvdeyen](https://github.com/tvdeyen))
|
7
|
+
- Fix layout of empty picture archive [#2686](https://github.com/AlchemyCMS/alchemy_cms/pull/2686) ([tvdeyen](https://github.com/tvdeyen))
|
8
|
+
- Fix Tinymce language config [#2685](https://github.com/AlchemyCMS/alchemy_cms/pull/2685) ([tvdeyen](https://github.com/tvdeyen))
|
9
|
+
- Add richtext input type for form builder [#2684](https://github.com/AlchemyCMS/alchemy_cms/pull/2684) ([tvdeyen](https://github.com/tvdeyen))
|
10
|
+
- Add support for legacy icon styles [#2683](https://github.com/AlchemyCMS/alchemy_cms/pull/2683) ([tvdeyen](https://github.com/tvdeyen))
|
11
|
+
- Fix imports of ES modules [#2682](https://github.com/AlchemyCMS/alchemy_cms/pull/2682) ([tvdeyen](https://github.com/tvdeyen))
|
12
|
+
- Use webp for image cropper [#2681](https://github.com/AlchemyCMS/alchemy_cms/pull/2681) ([tvdeyen](https://github.com/tvdeyen))
|
13
|
+
- Fix sizing of tinymce textarea [#2680](https://github.com/AlchemyCMS/alchemy_cms/pull/2680) ([tvdeyen](https://github.com/tvdeyen))
|
14
|
+
|
3
15
|
## 7.1.0-b2 (2024-01-09)
|
4
16
|
|
5
17
|
- Download and bundle third party JS packages with npm [#2679](https://github.com/AlchemyCMS/alchemy_cms/pull/2679) ([tvdeyen](https://github.com/tvdeyen))
|
@@ -2229,6 +2229,11 @@ body.tox-dialog__disable-scroll {
|
|
2229
2229
|
-ms-flex-preferred-size: auto;
|
2230
2230
|
}
|
2231
2231
|
|
2232
|
+
.tox .tox-form__group--stretched .tox-textarea-wrap {
|
2233
|
+
display: flex;
|
2234
|
+
flex: 1;
|
2235
|
+
}
|
2236
|
+
|
2232
2237
|
.tox .tox-form__group--stretched .tox-textarea {
|
2233
2238
|
flex: 1;
|
2234
2239
|
-ms-flex-preferred-size: auto;
|
@@ -54,11 +54,18 @@ module Alchemy
|
|
54
54
|
def link_to_dialog(content, url, options = {}, html_options = {})
|
55
55
|
default_options = {modal: true}
|
56
56
|
options = default_options.merge(options)
|
57
|
-
|
58
|
-
html_options.
|
59
|
-
|
60
|
-
|
61
|
-
|
57
|
+
if html_options[:title]
|
58
|
+
tooltip = html_options.delete(:title)
|
59
|
+
end
|
60
|
+
anchor = link_to(content, url, html_options.merge(
|
61
|
+
"data-dialog-options" => options.to_json,
|
62
|
+
:is => "alchemy-dialog-link"
|
63
|
+
))
|
64
|
+
if tooltip
|
65
|
+
content_tag("sl-tooltip", anchor, content: tooltip)
|
66
|
+
else
|
67
|
+
anchor
|
68
|
+
end
|
62
69
|
end
|
63
70
|
|
64
71
|
# Used for translations selector in Alchemy cockpit user settings.
|
@@ -194,16 +201,22 @@ module Alchemy
|
|
194
201
|
message: Alchemy.t("Are you sure?"),
|
195
202
|
icon: "delete-bin-2"
|
196
203
|
}.merge(options)
|
197
|
-
|
204
|
+
|
205
|
+
if html_options[:title]
|
206
|
+
tooltip = html_options.delete(:title)
|
207
|
+
end
|
208
|
+
button = button_with_confirm(
|
198
209
|
render_icon(options[:icon]),
|
199
|
-
url, {
|
200
|
-
message: options[:message]
|
201
|
-
}, {
|
210
|
+
url, options, {
|
202
211
|
method: "delete",
|
203
|
-
title: options[:title],
|
204
212
|
class: "icon_button #{html_options.delete(:class)}".strip
|
205
213
|
}.merge(html_options)
|
206
214
|
)
|
215
|
+
if tooltip
|
216
|
+
content_tag("sl-tooltip", button, content: tooltip)
|
217
|
+
else
|
218
|
+
button
|
219
|
+
end
|
207
220
|
end
|
208
221
|
|
209
222
|
# (internal) Renders translated Module Names for html title element.
|
@@ -28,7 +28,7 @@ module Alchemy
|
|
28
28
|
# @return [String]
|
29
29
|
def render_icon(icon_name, options = {})
|
30
30
|
options = {style: "line", fixed_width: true}.merge(options)
|
31
|
-
style = options[:style] && "-#{options[:style]}"
|
31
|
+
style = options[:style] && "-#{ri_style(options[:style])}"
|
32
32
|
classes = [
|
33
33
|
"icon",
|
34
34
|
"ri-#{ri_icon(icon_name)}#{style}",
|
@@ -134,5 +134,20 @@ module Alchemy
|
|
134
134
|
icon_name
|
135
135
|
end
|
136
136
|
end
|
137
|
+
|
138
|
+
# Returns the Remix icon style for given style
|
139
|
+
#
|
140
|
+
# @param style [String] The style name
|
141
|
+
# @return [String] The RemixIcon style
|
142
|
+
def ri_style(style)
|
143
|
+
case style.to_s
|
144
|
+
when "solid", "fill"
|
145
|
+
"fill"
|
146
|
+
when "line", "regular"
|
147
|
+
"line"
|
148
|
+
else
|
149
|
+
style
|
150
|
+
end
|
151
|
+
end
|
137
152
|
end
|
138
153
|
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import "clipboard"
|
2
|
+
|
3
|
+
class ClipboardButton extends HTMLElement {
|
4
|
+
constructor() {
|
5
|
+
super()
|
6
|
+
|
7
|
+
this.innerHTML = `
|
8
|
+
<i class="icon ri-clipboard-line ri-fw"></i>
|
9
|
+
`
|
10
|
+
|
11
|
+
this.clipboard = new ClipboardJS(this, {
|
12
|
+
text: () => {
|
13
|
+
return this.getAttribute("content")
|
14
|
+
}
|
15
|
+
})
|
16
|
+
|
17
|
+
this.clipboard.on("success", () => {
|
18
|
+
Alchemy.growl(this.getAttribute("success-text"))
|
19
|
+
})
|
20
|
+
}
|
21
|
+
|
22
|
+
disconnectedCallback() {
|
23
|
+
this.clipboard.destroy()
|
24
|
+
}
|
25
|
+
}
|
26
|
+
|
27
|
+
customElements.define("alchemy-clipboard-button", ClipboardButton)
|
@@ -4,9 +4,9 @@ import fileEditors from "alchemy_admin/file_editors"
|
|
4
4
|
import pictureEditors from "alchemy_admin/picture_editors"
|
5
5
|
import IngredientAnchorLink from "alchemy_admin/ingredient_anchor_link"
|
6
6
|
import { post } from "alchemy_admin/utils/ajax"
|
7
|
-
import { createHtmlElement } from "
|
7
|
+
import { createHtmlElement } from "alchemy_admin/utils/dom_helpers"
|
8
8
|
|
9
|
-
import "
|
9
|
+
import "alchemy_admin/components/element_editor/publish_element_button"
|
10
10
|
|
11
11
|
export class ElementEditor extends HTMLElement {
|
12
12
|
constructor() {
|
@@ -21,6 +21,7 @@ import PagePublicationFields from "alchemy_admin/page_publication_fields"
|
|
21
21
|
// Web Components
|
22
22
|
import "alchemy_admin/components/button"
|
23
23
|
import "alchemy_admin/components/char_counter"
|
24
|
+
import "alchemy_admin/components/clipboard_button"
|
24
25
|
import "alchemy_admin/components/datepicker"
|
25
26
|
import "alchemy_admin/components/dialog_link"
|
26
27
|
import "alchemy_admin/components/element_editor"
|
@@ -33,7 +34,6 @@ import "alchemy_admin/components/page_select"
|
|
33
34
|
import "alchemy_admin/components/select"
|
34
35
|
import "alchemy_admin/components/spinner"
|
35
36
|
import "alchemy_admin/components/tinymce"
|
36
|
-
import "alchemy_admin/clipboard"
|
37
37
|
|
38
38
|
import { setDefaultAnimation } from "shoelace"
|
39
39
|
|
@@ -8,16 +8,20 @@
|
|
8
8
|
<div class="value with-icon">
|
9
9
|
<label><%= Alchemy::Attachment.human_attribute_name(:url) %></label>
|
10
10
|
<p><%= @attachment.url %></p>
|
11
|
-
<
|
12
|
-
<%=
|
13
|
-
|
11
|
+
<alchemy-clipboard-button
|
12
|
+
content="<%= @attachment.url %>"
|
13
|
+
success-text="<%= Alchemy.t("Copied to clipboard") %>"
|
14
|
+
class="icon_button--right"
|
15
|
+
></alchemy-clipboard-button>
|
14
16
|
</div>
|
15
17
|
<div class="value with-icon">
|
16
18
|
<label><%= Alchemy::Attachment.human_attribute_name(:download_url) %></label>
|
17
19
|
<p><%= @attachment.url(download: true) %></p>
|
18
|
-
<
|
19
|
-
<%=
|
20
|
-
|
20
|
+
<alchemy-clipboard-button
|
21
|
+
content="<%= @attachment.url(download: true) %>"
|
22
|
+
success-text="<%= Alchemy.t("Copied to clipboard") %>"
|
23
|
+
class="icon_button--right"
|
24
|
+
></alchemy-clipboard-button>
|
21
25
|
</div>
|
22
26
|
</div>
|
23
27
|
|
@@ -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.url(size: '800x600', flatten: true), id: 'imageToCrop' %>
|
11
|
+
<%= image_tag @picture.url(size: '800x600', flatten: true, format: "webp"), id: 'imageToCrop' %>
|
12
12
|
</div>
|
13
13
|
<form>
|
14
14
|
<%= button_tag Alchemy.t(:apply), type: 'submit' %>
|
@@ -38,7 +38,6 @@
|
|
38
38
|
style: 'float: none'
|
39
39
|
) %>
|
40
40
|
</div>
|
41
|
-
<div id="pictures" class="picture-size--<%= @size %>">
|
42
41
|
<% if @pictures.blank? and @recent_pictures.blank? and search_filter_params[:q].blank? %>
|
43
42
|
<%= render_message do %>
|
44
43
|
<%= Alchemy.t(:no_images_in_archive) %>
|
@@ -48,9 +47,10 @@
|
|
48
47
|
<%= Alchemy.t(:no_search_results) %>
|
49
48
|
<% end %>
|
50
49
|
<% else %>
|
51
|
-
|
50
|
+
<div id="pictures" class="picture-size--<%= @size %>">
|
51
|
+
<%= render partial: 'picture', collection: @pictures %>
|
52
|
+
</div>
|
52
53
|
<% end %>
|
53
|
-
</div>
|
54
54
|
<% end %>
|
55
55
|
|
56
56
|
<%= paginate @pictures, theme: 'alchemy' %>
|
@@ -8,7 +8,20 @@
|
|
8
8
|
<%= render 'tag_list' %>
|
9
9
|
</div>
|
10
10
|
</div>
|
11
|
-
|
12
|
-
<%=
|
13
|
-
|
11
|
+
<% if @pictures.empty? %>
|
12
|
+
<%= render_message do %>
|
13
|
+
<% if search_filter_params.empty? %>
|
14
|
+
<%= Alchemy.t(:no_images_in_archive) %>
|
15
|
+
<% else %>
|
16
|
+
<%= Alchemy.t(:no_search_results) %>
|
17
|
+
<% end %>
|
18
|
+
<% end %>
|
19
|
+
<% else %>
|
20
|
+
<div id="overlay_picture_list" class="picture-size--<%= @size %>">
|
21
|
+
<%= render partial: 'picture_to_assign',
|
22
|
+
collection: @pictures,
|
23
|
+
locals: {size: @size} %>
|
24
|
+
<%= paginate @pictures, theme: 'alchemy', remote: true, hide_per_page_select: true %>
|
25
|
+
</div>
|
26
|
+
<% end %>
|
14
27
|
</div>
|
@@ -55,7 +55,7 @@
|
|
55
55
|
}, {'data-alchemy-hotkey' => 'alt+q'}) %>
|
56
56
|
<% else %>
|
57
57
|
<%= link_to(alchemy.root_path) do %>
|
58
|
-
<i class="icon ri-logout-r-line ri-fw ri-lg"></i>
|
58
|
+
<i class="icon ri-logout-box-r-line ri-fw ri-lg"></i>
|
59
59
|
<label><%= Alchemy.t(:leave) %></label>
|
60
60
|
<% end %>
|
61
61
|
<% end %>
|
data/eslint.config.js
ADDED
@@ -43,6 +43,13 @@ module Alchemy
|
|
43
43
|
template.content_tag("alchemy-datepicker", date_field, type: type)
|
44
44
|
end
|
45
45
|
|
46
|
+
# Renders a simple_form input that displays a richtext editor
|
47
|
+
#
|
48
|
+
def richtext(attribute_name, options = {})
|
49
|
+
text_area = input(attribute_name, options.merge(as: :text))
|
50
|
+
template.content_tag("alchemy-tinymce", text_area)
|
51
|
+
end
|
52
|
+
|
46
53
|
# Renders a button tag wrapped in a div with 'submit' class.
|
47
54
|
#
|
48
55
|
def submit(label, options = {})
|
data/lib/alchemy/version.rb
CHANGED
data/package.json
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
"scripts": {
|
4
4
|
"test": "jest",
|
5
5
|
"lint": "prettier --check 'app/javascript/**/*.js'",
|
6
|
+
"eslint": "eslint app/javascript/**/*.js",
|
6
7
|
"build": "rollup -c"
|
7
8
|
},
|
8
9
|
"keywords": [],
|
@@ -25,6 +26,7 @@
|
|
25
26
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
26
27
|
"@rollup/plugin-terser": "^0.4.4",
|
27
28
|
"babel-jest": "^29.6.4",
|
29
|
+
"eslint": "^8.56.0",
|
28
30
|
"jest": "^29.6.4",
|
29
31
|
"jest-environment-jsdom": "^29.6.4",
|
30
32
|
"jquery": "^3.7.1",
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alchemy_cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.1.0.pre.
|
4
|
+
version: 7.1.0.pre.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas von Deyen
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date: 2024-01-
|
16
|
+
date: 2024-01-15 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: actionmailer
|
@@ -884,10 +884,10 @@ files:
|
|
884
884
|
- app/helpers/alchemy/pages_helper.rb
|
885
885
|
- app/helpers/alchemy/url_helper.rb
|
886
886
|
- app/javascript/alchemy_admin.js
|
887
|
-
- app/javascript/alchemy_admin/clipboard.js
|
888
887
|
- app/javascript/alchemy_admin/components/alchemy_html_element.js
|
889
888
|
- app/javascript/alchemy_admin/components/button.js
|
890
889
|
- app/javascript/alchemy_admin/components/char_counter.js
|
890
|
+
- app/javascript/alchemy_admin/components/clipboard_button.js
|
891
891
|
- app/javascript/alchemy_admin/components/datepicker.js
|
892
892
|
- app/javascript/alchemy_admin/components/dialog_link.js
|
893
893
|
- app/javascript/alchemy_admin/components/element_editor.js
|
@@ -1128,7 +1128,6 @@ files:
|
|
1128
1128
|
- app/views/alchemy/admin/pictures/_filter_and_size_bar.html.erb
|
1129
1129
|
- app/views/alchemy/admin/pictures/_form.html.erb
|
1130
1130
|
- app/views/alchemy/admin/pictures/_infos.html.erb
|
1131
|
-
- app/views/alchemy/admin/pictures/_overlay_picture_list.html.erb
|
1132
1131
|
- app/views/alchemy/admin/pictures/_picture.html.erb
|
1133
1132
|
- app/views/alchemy/admin/pictures/_picture_to_assign.html.erb
|
1134
1133
|
- app/views/alchemy/admin/pictures/_tag_list.html.erb
|
@@ -1252,6 +1251,7 @@ files:
|
|
1252
1251
|
- db/migrate/20230123112425_add_searchable_to_alchemy_pages.rb
|
1253
1252
|
- db/migrate/20230505132743_add_indexes_to_alchemy_pictures.rb
|
1254
1253
|
- db/migrate/20231113104432_create_page_mutexes.rb
|
1254
|
+
- eslint.config.js
|
1255
1255
|
- lib/alchemy.rb
|
1256
1256
|
- lib/alchemy/ability_helper.rb
|
1257
1257
|
- lib/alchemy/admin/locale.rb
|
@@ -1,16 +0,0 @@
|
|
1
|
-
import "clipboard"
|
2
|
-
|
3
|
-
const clipboard = new ClipboardJS("[data-clipboard-text]")
|
4
|
-
|
5
|
-
clipboard.on("success", (e) => {
|
6
|
-
Alchemy.growl(e.trigger.dataset.clipboardSuccessText)
|
7
|
-
e.clearSelection()
|
8
|
-
})
|
9
|
-
|
10
|
-
const currentDialog = Alchemy.currentDialog()
|
11
|
-
|
12
|
-
if (currentDialog) {
|
13
|
-
currentDialog.dialog.on("DialogClose.Alchemy", () => {
|
14
|
-
clipboard.destroy()
|
15
|
-
})
|
16
|
-
}
|
@@ -1,10 +0,0 @@
|
|
1
|
-
<% if @pictures.empty? %>
|
2
|
-
<%= render_message do %>
|
3
|
-
<%= Alchemy.t(:no_images_in_archive) %>
|
4
|
-
<% end %>
|
5
|
-
<% else %>
|
6
|
-
<%= render partial: 'picture_to_assign',
|
7
|
-
collection: @pictures,
|
8
|
-
locals: {size: @size} %>
|
9
|
-
<%= paginate @pictures, theme: 'alchemy', remote: true, hide_per_page_select: true %>
|
10
|
-
<% end %>
|