helios-press 0.3 → 0.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1d3b3438e1adcc7a8776aab2c1504eca5768bdb82529e1a8013b5c52786b1322
4
- data.tar.gz: 0caad891b10dc08f98f43ded048b20abfeec168829642cdcc26505f0360dc862
3
+ metadata.gz: 3ea59768263242ec8f88e1bd68e8d33f67f4b5a313d32626ac735632be159672
4
+ data.tar.gz: f2aa7c604191d1e340f18c1c9cf980d6f988407deff6127953a023572bcd1ef6
5
5
  SHA512:
6
- metadata.gz: 6f42ac281d93c06b6bbdd98b869f9c6a63f68309f4036a9cefd85f32e87770ae18f62a2fbce701b8940fcc6ba3d3d8569aee9175f72585ebb5ff80cb8c05001a
7
- data.tar.gz: c999f3186d81ee01f529de8170b3b32677c93939ca3a6af02979a670554b19dbce6e2a10d0f87d8222a70481147d4b3a56214bee24202acdaa8beb94b48949c6
6
+ metadata.gz: fa4299b094dca0fc56ef35d1c930146cabbf6020bc4561f7482c140a1d9fac88a995f56a18a7aa53da51331f03e1b75e9d4d88f3c26c66b52968594673567752
7
+ data.tar.gz: 6e804a7772de4fe2f6b29ed41b1f111bede76ef00b86e39e3215bf07f311ac30344e28cafde50df2e11e5878dc843cd585272536bfc4bd9bb43634a1168c6352
data/README.md CHANGED
@@ -89,9 +89,12 @@ mount Helios::Press::Admin::Engine, at: "/admin/press"
89
89
 
90
90
  ## JavaScript Setup
91
91
 
92
- Register the Stimulus controllers in your host app:
92
+ Register the Stimulus controllers in your host app. You **must** also import `trix` and `@rails/actiontext` — without these imports, the rich text editor will not render in text blocks:
93
93
 
94
94
  ```javascript
95
+ import 'trix'
96
+ import '@rails/actiontext'
97
+
95
98
  import {
96
99
  HeliosPressBlocksController,
97
100
  HeliosPressTextBlockController,
@@ -107,7 +110,7 @@ application.register("helios-press-image-block", HeliosPressImageBlockController
107
110
  - `sortablejs`
108
111
  - `@hotwired/stimulus`
109
112
  - `@rails/activestorage`
110
- - `trix` and `@rails/actiontext`
113
+ - `trix` and `@rails/actiontext` — **required** for text block editing
111
114
 
112
115
  ### Vite
113
116
 
@@ -1,6 +1,8 @@
1
1
  class CreateHeliosPressPosts < ActiveRecord::Migration[8.0]
2
2
  def change
3
- create_table :helios_press_posts do |t|
3
+ primary_key_type, foreign_key_type = primary_and_foreign_key_types
4
+
5
+ create_table :helios_press_posts, id: primary_key_type do |t|
4
6
  t.string :name, null: false
5
7
  t.string :slug, null: false
6
8
  t.text :description
@@ -15,4 +17,14 @@ class CreateHeliosPressPosts < ActiveRecord::Migration[8.0]
15
17
  add_index :helios_press_posts, :external_id, unique: true
16
18
  add_index :helios_press_posts, :published
17
19
  end
20
+
21
+ private
22
+
23
+ def primary_and_foreign_key_types
24
+ config = Rails.configuration.generators
25
+ setting = config.options[config.orm][:primary_key_type]
26
+ primary_key_type = setting || :primary_key
27
+ foreign_key_type = setting || :bigint
28
+ [primary_key_type, foreign_key_type]
29
+ end
18
30
  end
@@ -1,7 +1,9 @@
1
1
  class CreateHeliosPressBlocks < ActiveRecord::Migration[8.0]
2
2
  def change
3
- create_table :helios_press_blocks do |t|
4
- t.references :post, null: false, foreign_key: { to_table: :helios_press_posts }
3
+ primary_key_type, foreign_key_type = primary_and_foreign_key_types
4
+
5
+ create_table :helios_press_blocks, id: primary_key_type do |t|
6
+ t.references :post, null: false, foreign_key: { to_table: :helios_press_posts }, type: foreign_key_type
5
7
  t.string :block_type, null: false
6
8
  t.integer :position, null: false
7
9
  t.integer :columns, default: 3
@@ -11,4 +13,14 @@ class CreateHeliosPressBlocks < ActiveRecord::Migration[8.0]
11
13
 
12
14
  add_index :helios_press_blocks, [:post_id, :position]
13
15
  end
16
+
17
+ private
18
+
19
+ def primary_and_foreign_key_types
20
+ config = Rails.configuration.generators
21
+ setting = config.options[config.orm][:primary_key_type]
22
+ primary_key_type = setting || :primary_key
23
+ foreign_key_type = setting || :bigint
24
+ [primary_key_type, foreign_key_type]
25
+ end
14
26
  end
@@ -1,7 +1,9 @@
1
1
  class CreateHeliosPressBlockImages < ActiveRecord::Migration[8.0]
2
2
  def change
3
- create_table :helios_press_block_images do |t|
4
- t.references :block, null: false, foreign_key: { to_table: :helios_press_blocks }
3
+ primary_key_type, foreign_key_type = primary_and_foreign_key_types
4
+
5
+ create_table :helios_press_block_images, id: primary_key_type do |t|
6
+ t.references :block, null: false, foreign_key: { to_table: :helios_press_blocks }, type: foreign_key_type
5
7
  t.integer :position, null: false
6
8
  t.text :caption
7
9
 
@@ -10,4 +12,14 @@ class CreateHeliosPressBlockImages < ActiveRecord::Migration[8.0]
10
12
 
11
13
  add_index :helios_press_block_images, [:block_id, :position]
12
14
  end
15
+
16
+ private
17
+
18
+ def primary_and_foreign_key_types
19
+ config = Rails.configuration.generators
20
+ setting = config.options[config.orm][:primary_key_type]
21
+ primary_key_type = setting || :primary_key
22
+ foreign_key_type = setting || :bigint
23
+ [primary_key_type, foreign_key_type]
24
+ end
13
25
  end
@@ -1,5 +1,5 @@
1
1
  module Helios
2
2
  module Press
3
- VERSION = "0.3"
3
+ VERSION = "0.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: helios-press
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.3'
4
+ version: '0.4'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Fleetwood-Boldt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-05-26 00:00:00.000000000 Z
11
+ date: 2026-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails