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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d58b4f365ee68fac527d4ffad812ad68343fcfcb0b17ace3348aebd57d25c4d3
4
- data.tar.gz: 91017ca029bc75e2f15d9c4ad3e60cf17f81a00f6bb72ca66f4a16c02d71f46b
3
+ metadata.gz: 52cea190db8dfb6571f62d93f72942df0c05afbf7b7988b952da56cbbba5dd91
4
+ data.tar.gz: efd336249755bc11de59ff751be0af224ab9861f902df7ddd4226a97208840b6
5
5
  SHA512:
6
- metadata.gz: 6d1a10956e3ee72021b402063f36f930da4db1d48b631159e9bec9535bddc4f9b369dffdfb5d20f5b3a4e33f699bee4b93f1d8eaa4e6cc1269b1585c14c9792e
7
- data.tar.gz: 0a3936c7a71f7d32ddc348f3cff42be35204816bc88cc6223e400dba647da412c4a009879d855c289b75be743375b81976e5a3038cc8023e86d4eb77195559ec
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))
@@ -14,6 +14,11 @@
14
14
  padding-left: 28px;
15
15
  padding-right: 24px;
16
16
  margin: 0;
17
+
18
+ .input & {
19
+ float: none;
20
+ width: 100%;
21
+ }
17
22
  }
18
23
 
19
24
  .js_filter_field_clear {
@@ -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
- link_to content, url,
58
- html_options.merge(
59
- "data-dialog-options" => options.to_json,
60
- :is => "alchemy-dialog-link"
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
- button_with_confirm(
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
@@ -1,4 +1,4 @@
1
- import Spinner from "../spinner"
1
+ import Spinner from "alchemy_admin/spinner"
2
2
 
3
3
  class Button extends HTMLButtonElement {
4
4
  connectedCallback() {
@@ -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 "../utils/dom_helpers"
7
+ import { createHtmlElement } from "alchemy_admin/utils/dom_helpers"
8
8
 
9
- import "./element_editor/publish_element_button"
9
+ import "alchemy_admin/components/element_editor/publish_element_button"
10
10
 
11
11
  export class ElementEditor extends HTMLElement {
12
12
  constructor() {
@@ -103,7 +103,7 @@ class Tinymce extends AlchemyHTMLElement {
103
103
  return {
104
104
  ...Alchemy.TinymceDefaults,
105
105
  ...customConfig,
106
- locale: currentLocale(),
106
+ language: currentLocale(),
107
107
  selector: `#${this.editorId}`
108
108
  }
109
109
  }
@@ -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
- <a data-clipboard-text="<%= @attachment.url %>" data-clipboard-success-text="<%= Alchemy.t("Copied to clipboard") %>" class="icon_button--right">
12
- <%= render_icon(:clipboard) %>
13
- </a>
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
- <a data-clipboard-text="<%= @attachment.url(download: true) %>" data-clipboard-success-text="<%= Alchemy.t("Copied to clipboard") %>" class="icon_button--right">
19
- <%= render_icon(:clipboard) %>
20
- </a>
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' %>
@@ -11,6 +11,7 @@
11
11
  label: Alchemy.t(:create_menu),
12
12
  url: alchemy.new_admin_node_path,
13
13
  hotkey: 'alt+n',
14
+ tooltip_placement: "top-start",
14
15
  dialog_options: {
15
16
  title: Alchemy.t(:create_menu),
16
17
  size: '450x120'
@@ -7,7 +7,6 @@
7
7
  options[:dialog_options],
8
8
  {
9
9
  class: ["icon_button", options[:active] && "active"].compact,
10
- title: options[:title],
11
10
  "data-alchemy-hotkey" => options[:hotkey]
12
11
  }.merge(options[:link_options])
13
12
  ) %>
@@ -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
- <%= render partial: 'picture', collection: @pictures %>
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
- <div id="overlay_picture_list" class="picture-size--<%= @size %>">
12
- <%= render 'overlay_picture_list' %>
13
- </div>
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
@@ -0,0 +1,17 @@
1
+ module.exports = [
2
+ {
3
+ rules: {
4
+ "no-restricted-imports": [
5
+ "error",
6
+ {
7
+ patterns: [
8
+ {
9
+ group: ["./", "../"],
10
+ message: "Relative imports are not allowed."
11
+ }
12
+ ]
13
+ }
14
+ ]
15
+ }
16
+ }
17
+ ]
@@ -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 = {})
@@ -47,7 +47,7 @@ module Alchemy
47
47
  end
48
48
 
49
49
  def click_button_with_tooltip(content)
50
- find(%([content="#{content}"] > button)).click
50
+ find(%([content="#{content}"] button)).click
51
51
  end
52
52
 
53
53
  def click_link_with_tooltip(content)
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Alchemy
4
- VERSION = "7.1.0-b2"
4
+ VERSION = "7.1.0-rc1"
5
5
 
6
6
  def self.version
7
7
  VERSION
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.b2
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-09 00:00:00.000000000 Z
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 %>