Skip to content

Commit 0a460bd

Browse files
committed
chore: misc fixes
1 parent 1803a7c commit 0a460bd

File tree

9 files changed

+16
-60
lines changed

9 files changed

+16
-60
lines changed

Gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ end
2626

2727
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
2828
gem "listen", ">= 3.5.1"
29-
gem "avo", ">= 3.2.1"
29+
# gem "avo", ">= 3.2.1"

Gemfile.lock

+1-38
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ PATH
44
marksmith (0.1.2)
55
activesupport
66
redcarpet
7+
zeitwerk
78

89
GEM
910
remote: https://rubygems.org/
@@ -51,9 +52,6 @@ GEM
5152
erubi (~> 1.11)
5253
rails-dom-testing (~> 2.2)
5354
rails-html-sanitizer (~> 1.6)
54-
active_link_to (1.0.5)
55-
actionpack
56-
addressable
5755
activejob (8.0.1)
5856
activesupport (= 8.0.1)
5957
globalid (>= 0.3.6)
@@ -82,24 +80,7 @@ GEM
8280
securerandom (>= 0.3)
8381
tzinfo (~> 2.0, >= 2.0.5)
8482
uri (>= 0.13.1)
85-
addressable (2.8.7)
86-
public_suffix (>= 2.0.2, < 7.0)
8783
ast (2.4.2)
88-
avo (3.17.5)
89-
actionview (>= 6.1)
90-
active_link_to
91-
activerecord (>= 6.1)
92-
activesupport (>= 6.1)
93-
addressable
94-
docile
95-
inline_svg
96-
meta-tags
97-
pagy (>= 7.0.0)
98-
prop_initializer (>= 0.2.0)
99-
turbo-rails (>= 2.0.0)
100-
turbo_power (>= 0.6.0)
101-
view_component (>= 3.7.0)
102-
zeitwerk (>= 2.6.12)
10384
base64 (0.2.0)
10485
benchmark (0.4.0)
10586
bigdecimal (3.1.9)
@@ -109,7 +90,6 @@ GEM
10990
connection_pool (2.5.0)
11091
crass (1.0.6)
11192
date (3.4.1)
112-
docile (1.4.1)
11393
drb (2.2.1)
11494
dry-cli (1.2.0)
11595
erubi (1.13.1)
@@ -125,9 +105,6 @@ GEM
125105
activesupport (>= 6.1)
126106
i18n (1.14.7)
127107
concurrent-ruby (~> 1.0)
128-
inline_svg (1.10.0)
129-
activesupport (>= 3.0)
130-
nokogiri (>= 1.6)
131108
io-console (0.8.0)
132109
irb (1.15.1)
133110
pp (>= 0.6.0)
@@ -148,9 +125,6 @@ GEM
148125
net-pop
149126
net-smtp
150127
marcel (1.0.4)
151-
meta-tags (2.22.1)
152-
actionpack (>= 6.0.0, < 8.1)
153-
method_source (1.1.0)
154128
mini_mime (1.1.5)
155129
minitest (5.25.4)
156130
mutex_m (0.3.0)
@@ -180,16 +154,13 @@ GEM
180154
racc (~> 1.4)
181155
nokogiri (1.18.2-x86_64-linux-musl)
182156
racc (~> 1.4)
183-
pagy (9.3.3)
184157
parallel (1.26.3)
185158
parser (3.3.7.0)
186159
ast (~> 2.4.1)
187160
racc
188161
pp (0.6.2)
189162
prettyprint
190163
prettyprint (0.2.0)
191-
prop_initializer (0.2.0)
192-
zeitwerk (>= 2.6.18)
193164
propshaft (1.1.0)
194165
actionpack (>= 7.0.0)
195166
activesupport (>= 7.0.0)
@@ -198,7 +169,6 @@ GEM
198169
psych (5.2.3)
199170
date
200171
stringio
201-
public_suffix (6.0.1)
202172
puma (6.6.0)
203173
nio4r (~> 2.0)
204174
racc (1.8.1)
@@ -298,19 +268,13 @@ GEM
298268
turbo-rails (2.0.11)
299269
actionpack (>= 6.0.0)
300270
railties (>= 6.0.0)
301-
turbo_power (0.7.0)
302-
turbo-rails (>= 1.3.0)
303271
tzinfo (2.0.6)
304272
concurrent-ruby (~> 1.0)
305273
unicode-display_width (3.1.4)
306274
unicode-emoji (~> 4.0, >= 4.0.4)
307275
unicode-emoji (4.0.4)
308276
uri (1.0.2)
309277
useragent (0.16.11)
310-
view_component (3.21.0)
311-
activesupport (>= 5.2.0, < 8.1)
312-
concurrent-ruby (~> 1.0)
313-
method_source (~> 1.0)
314278
vite_rails (3.0.19)
315279
railties (>= 5.1, < 9)
316280
vite_ruby (~> 3.0, >= 3.2.2)
@@ -342,7 +306,6 @@ PLATFORMS
342306
x86_64-linux-musl
343307

344308
DEPENDENCIES
345-
avo (>= 3.2.1)
346309
listen (>= 3.5.1)
347310
marksmith!
348311
propshaft
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# frozen_string_literal: true
2-
3-
class Marksmith::MarkdownField::EditComponent < Avo::Fields::EditComponent
4-
def unique_id
5-
[@field.type, @resource&.singular_route_key, @field.id].compact.join("_")
2+
if defined?(Avo)
3+
class Marksmith::MarkdownField::EditComponent < Avo::Fields::EditComponent
4+
def unique_id
5+
[@field.type, @resource&.singular_route_key, @field.id].compact.join("_")
6+
end
67
end
78
end
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# frozen_string_literal: true
2-
3-
class Marksmith::MarkdownField::ShowComponent < Avo::Fields::ShowComponent
2+
if defined?(Avo)
3+
class Marksmith::MarkdownField::ShowComponent < Avo::Fields::ShowComponent
4+
end
45
end

app/helpers/marksmith/application_helper.rb

-4
This file was deleted.

app/jobs/marksmith/application_job.rb

-4
This file was deleted.

app/mailers/marksmith/application_mailer.rb

-6
This file was deleted.

app/views/marksmith/shared/_editor.html.erb

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
<%= content_tag :div, class: "ms:flex ms:flex-1 ms:flex-col ms:size-full", data: { marksmith_target: "fieldContainer" } do %>
8585
<%= text_area_tag field_name, value,
8686
id: name,
87-
class: class_names("ms:flex ms:flex-1 ms:rounded ms:border-none ms:resize-y ms:focus:outline-none ms:font-mono ms:focus:ring-0 ms:leading-normal ms:p-2 ms:text-sm", classes),
87+
class: class_names("ms:flex ms:flex-1 ms:rounded ms:border-none ms:resize-none ms:focus:outline-none ms:font-mono ms:focus:ring-0 ms:leading-normal ms:p-2 ms:text-sm", classes),
8888
rows: rows,
8989
data: {
9090
action: "drop->marksmith#dropUpload paste->marksmith#pasteUpload",

lib/marksmith/engine.rb

+5
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ def marksmith(*args, **kwargs, &block)
5353
Avo.asset_manager.register_stimulus_controller "marksmith", "MarksmithController"
5454
Avo.asset_manager.register_stimulus_controller "list-continuation", "ListContinuationController"
5555
end
56+
else
57+
# Ignore the markdown_field components if Avo is not defined
58+
app.autoloaders.main.ignore(
59+
root.join("app", "components", "marksmith", "markdown_field"),
60+
)
5661
end
5762
end
5863
end

0 commit comments

Comments
 (0)