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 +4 -4
- data/README.md +5 -2
- data/db/migrate/20250510000001_create_helios_press_posts.rb +13 -1
- data/db/migrate/20250510000002_create_helios_press_blocks.rb +14 -2
- data/db/migrate/20250510000003_create_helios_press_block_images.rb +14 -2
- data/lib/helios/press/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3ea59768263242ec8f88e1bd68e8d33f67f4b5a313d32626ac735632be159672
|
|
4
|
+
data.tar.gz: f2aa7c604191d1e340f18c1c9cf980d6f988407deff6127953a023572bcd1ef6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
|
|
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
|
-
|
|
4
|
-
|
|
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
|
-
|
|
4
|
-
|
|
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
|
data/lib/helios/press/version.rb
CHANGED
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.
|
|
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-
|
|
11
|
+
date: 2026-05-28 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|