alchemy_cms 8.2.7 → 8.2.9

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.
@@ -16,7 +16,7 @@ module Alchemy
16
16
  end
17
17
 
18
18
  def call
19
- value.html_safe
19
+ h(value)
20
20
  end
21
21
 
22
22
  def render?
@@ -68,7 +68,7 @@ module Alchemy
68
68
  def caption
69
69
  return unless show_caption?
70
70
 
71
- @_caption ||= content_tag(:figcaption, ingredient.caption.html_safe)
71
+ @_caption ||= content_tag(:figcaption, sanitize(ingredient.caption))
72
72
  end
73
73
 
74
74
  def src
@@ -18,7 +18,7 @@ module Alchemy
18
18
 
19
19
  def call
20
20
  if disable_link?
21
- dom_id.present? ? anchor : value
21
+ dom_id.present? ? anchor : h(value)
22
22
  else
23
23
  link_to(value, url_for(link), {
24
24
  id: dom_id.presence,
@@ -26,7 +26,7 @@ module Alchemy
26
26
  target: link_target_value(link_target),
27
27
  rel: link_rel_value(link_target)
28
28
  }.merge(html_options))
29
- end.html_safe
29
+ end
30
30
  end
31
31
 
32
32
  private
@@ -1,6 +1,6 @@
1
1
  import { RemoteSelect } from "alchemy_admin/components/remote_select"
2
2
 
3
- class AttachmentSelect extends RemoteSelect {
3
+ export class AttachmentSelect extends RemoteSelect {
4
4
  _renderResult(item) {
5
5
  return this._renderListEntry(item)
6
6
  }
@@ -20,7 +20,7 @@ const formatItem = (icon, text, hint) => {
20
20
  `
21
21
  }
22
22
 
23
- class ElementSelect extends HTMLElement {
23
+ export class ElementSelect extends HTMLElement {
24
24
  constructor() {
25
25
  super()
26
26
  }
@@ -1,6 +1,6 @@
1
1
  import { RemoteSelect } from "alchemy_admin/components/remote_select"
2
2
 
3
- class PageSelect extends RemoteSelect {
3
+ export class PageSelect extends RemoteSelect {
4
4
  get pageId() {
5
5
  return this.selection ? JSON.parse(this.selection)["id"] : undefined
6
6
  }
@@ -1,6 +1,6 @@
1
1
  import { setupSelectLocale } from "alchemy_admin/i18n"
2
2
 
3
- class TagsAutocomplete extends HTMLElement {
3
+ export class TagsAutocomplete extends HTMLElement {
4
4
  async connectedCallback() {
5
5
  await setupSelectLocale()
6
6
 
@@ -5,7 +5,7 @@ import { currentLocale } from "alchemy_admin/i18n"
5
5
  const DARK_THEME = "alchemy-dark"
6
6
  const LIGHT_THEME = "alchemy"
7
7
 
8
- class Tinymce extends AlchemyHTMLElement {
8
+ export class Tinymce extends AlchemyHTMLElement {
9
9
  #min_height = null
10
10
 
11
11
  /**
@@ -53,6 +53,11 @@ document.addEventListener("turbo:load", Initializer)
53
53
 
54
54
  // Public API for extensions
55
55
  export { RemoteSelect } from "alchemy_admin/components/remote_select"
56
+ export { PageSelect } from "alchemy_admin/components/page_select"
57
+ export { AttachmentSelect } from "alchemy_admin/components/attachment_select"
58
+ export { ElementSelect } from "alchemy_admin/components/element_select"
59
+ export { TagsAutocomplete } from "alchemy_admin/components/tags_autocomplete"
60
+ export { Tinymce } from "alchemy_admin/components/tinymce"
56
61
  export { on } from "alchemy_admin/utils/events"
57
62
 
58
63
  // Page-specific modules - bundled to avoid dual-loading
data/config/importmap.rb CHANGED
@@ -13,7 +13,18 @@ pin "@rails/ujs", to: "rails-ujs.min.js", preload: true # @7.1.2
13
13
  pin "tinymce", to: "tinymce.min.js", preload: true
14
14
 
15
15
  pin "alchemy_admin", to: "alchemy/alchemy_admin.min.js", preload: true
16
- pin "alchemy_admin/components/remote_select", to: "alchemy/alchemy_admin.min.js"
16
+ # Individually importable admin components. These resolve to their source
17
+ # files (not the bundle) so host engines can import a single component without
18
+ # loading and executing the whole admin bundle. Not preloaded, so they add no
19
+ # fetches to normal admin page loads (which import the bundle instead).
20
+ pin "alchemy_admin/components/page_select"
21
+ pin "alchemy_admin/components/attachment_select"
22
+ pin "alchemy_admin/components/element_select"
23
+ pin "alchemy_admin/components/tags_autocomplete"
24
+ pin "alchemy_admin/components/tinymce"
25
+ pin "alchemy_admin/components/remote_select"
26
+ pin "alchemy_admin/components/select"
27
+ pin "alchemy_admin/i18n"
17
28
  pin "alchemy_admin/image_cropper", to: "alchemy/alchemy_admin.min.js"
18
29
  pin "alchemy_admin/image_overlay", to: "alchemy/alchemy_admin.min.js"
19
30
  pin "alchemy_admin/picture_selector", to: "alchemy/alchemy_admin.min.js"
@@ -0,0 +1,14 @@
1
+ class AddIndexToElementsPagesJoinTable < ActiveRecord::Migration[7.2]
2
+ disable_ddl_transaction! if connection.adapter_name.match?(/postgres/i)
3
+
4
+ def change
5
+ add_index :alchemy_elements_alchemy_pages, :element_id, if_not_exists: true, algorithm: algorithm
6
+ add_index :alchemy_elements_alchemy_pages, :page_id, if_not_exists: true, algorithm: algorithm
7
+ end
8
+
9
+ private
10
+
11
+ def algorithm
12
+ connection.adapter_name.match?(/postgres/i) ? :concurrently : nil
13
+ end
14
+ end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Alchemy
4
- VERSION = "8.2.7"
4
+ VERSION = "8.2.9"
5
5
 
6
6
  def self.version
7
7
  VERSION
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: 8.2.7
4
+ version: 8.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas von Deyen
@@ -1285,6 +1285,7 @@ files:
1285
1285
  - db/migrate/20260102121232_add_metadata_to_page_versions.rb
1286
1286
  - db/migrate/20260115164704_add_publication_timestamps_to_alchemy_elements.rb
1287
1287
  - db/migrate/20260115164705_add_index_to_element_publication_timestamps.rb
1288
+ - db/migrate/20260702090038_add_index_to_elements_pages_join_table.rb
1288
1289
  - lib/alchemy.rb
1289
1290
  - lib/alchemy/ability_helper.rb
1290
1291
  - lib/alchemy/admin/locale.rb
@@ -1490,7 +1491,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1490
1491
  version: '0'
1491
1492
  requirements:
1492
1493
  - ImageMagick (libmagick), v6.6 or greater.
1493
- rubygems_version: 4.0.10
1494
+ rubygems_version: 4.0.16
1494
1495
  specification_version: 4
1495
1496
  summary: A powerful, userfriendly and flexible CMS for Rails
1496
1497
  test_files: []