marksmith 0.4.0 → 0.4.1
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 +14 -3
- data/app/assets/javascripts/list_continuation_controller-full.esm.js +1 -1
- data/app/assets/javascripts/list_continuation_controller-no-stimulus.esm.js +1 -1
- data/app/assets/javascripts/marksmith_controller-full.esm.js +1 -1
- data/app/assets/javascripts/marksmith_controller-no-stimulus.esm.js +1 -1
- data/app/components/marksmith/markdown_field/edit_component.html.erb +6 -4
- data/lib/marksmith/fields/markdown_field.rb +11 -0
- data/lib/marksmith/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: 287d682aee074cbb2c835b88f6891d20e9ed0f2ef53a16984c3f81e474664115
|
4
|
+
data.tar.gz: 4eff297c350411f5ad3bd61c24e758a359255377750452097cce8a2aef3c8603
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 595a0c5db128e373d5ebf2b0541fed436ede80c48a1a8f9b2fa725c53b3a25d6ebccb915b0712d77a1da031a461197e662ee55d502b6e23f0ea1eecaa5fa4fc6
|
7
|
+
data.tar.gz: 50bb0a632856c935057c230d4e7eea6f79ae4563186b2d2eb85641995efee4ece418ec5edba860e69968e0351dc4256d21e76d8156e736395c8c460a29f2cd69
|
data/README.md
CHANGED
@@ -227,11 +227,22 @@ application.register('list-continuation', ListContinuationController)
|
|
227
227
|
|
228
228
|
## Dark mode
|
229
229
|
|
230
|
-
Marksmith comes with dark mode built in using the `.dark` class on
|
230
|
+
Marksmith comes with dark mode built in using the `.dark` class on a wrapper element strategy.
|
231
231
|
|
232
|
-
```
|
232
|
+
```erb
|
233
|
+
<!-- Wrapper element -->
|
234
|
+
<div class="dark">
|
235
|
+
<%= marksmith_tag :body %>
|
236
|
+
</div>
|
237
|
+
|
238
|
+
<!-- or -->
|
239
|
+
<%= form_with model: post, class: "dark" do |form| %>
|
240
|
+
<%= form.marksmith :body %>
|
241
|
+
<% end %>
|
242
|
+
|
243
|
+
<!-- or -->
|
233
244
|
<html class="dark">
|
234
|
-
|
245
|
+
<%= marksmith_tag :body %>
|
235
246
|
</html>
|
236
247
|
```
|
237
248
|
|
@@ -1,13 +1,13 @@
|
|
1
1
|
<%= field_wrapper **field_wrapper_args, full_width: true do %>
|
2
2
|
<%= @form.marksmith @field.id,
|
3
3
|
gallery: {
|
4
|
-
enabled:
|
4
|
+
enabled: @field.gallery_enabled?,
|
5
5
|
open_path: avo.attach_media_path,
|
6
6
|
turbo_frame: ::Avo::MODAL_FRAME_ID,
|
7
7
|
params: {
|
8
8
|
resource_name: @resource.singular_route_key,
|
9
9
|
controller_name: "marksmith",
|
10
|
-
controller_selector: "[data-unique-selector
|
10
|
+
controller_selector: "[data-unique-selector=#{unique_id}]",
|
11
11
|
record_id: @resource&.record&.to_param,
|
12
12
|
}
|
13
13
|
},
|
@@ -16,7 +16,9 @@
|
|
16
16
|
},
|
17
17
|
extra_preview_params: {
|
18
18
|
resource_class: @resource.class.name,
|
19
|
-
field_id: field.id,
|
20
|
-
|
19
|
+
field_id: @field.id,
|
20
|
+
**@field.extra_preview_params
|
21
|
+
},
|
22
|
+
enable_file_uploads: @field.file_uploads
|
21
23
|
%>
|
22
24
|
<% end %>
|
@@ -1,7 +1,14 @@
|
|
1
1
|
module Marksmith
|
2
2
|
module Fields
|
3
3
|
class MarkdownField < Avo::Fields::BaseField
|
4
|
+
attr_reader :extra_preview_params,
|
5
|
+
:file_uploads
|
6
|
+
|
4
7
|
def initialize(id, **args, &block)
|
8
|
+
@media_library = args[:media_library].nil? ? true : args[:media_library]
|
9
|
+
@extra_preview_params = args[:extra_preview_params] || {}
|
10
|
+
@file_uploads = args[:file_uploads]
|
11
|
+
|
5
12
|
super(id, **args, &block)
|
6
13
|
|
7
14
|
hide_on :index
|
@@ -10,6 +17,10 @@ module Marksmith
|
|
10
17
|
def view_component_namespace
|
11
18
|
"Marksmith::MarkdownField"
|
12
19
|
end
|
20
|
+
|
21
|
+
def gallery_enabled?
|
22
|
+
Avo::MediaLibrary.configuration.enabled && @media_library
|
23
|
+
end
|
13
24
|
end
|
14
25
|
end
|
15
26
|
end
|
data/lib/marksmith/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: marksmith
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adrian Marin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-04-
|
11
|
+
date: 2025-04-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|