marksmith 0.0.13 → 0.0.15

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.
@@ -1,4 +1,4 @@
1
- /*! tailwindcss v4.0.0 | MIT License | https://tailwindcss.com */
1
+ /*! tailwindcss v4.0.0-beta.10 | MIT License | https://tailwindcss.com */
2
2
  :root {
3
3
  --ms-font-sans: ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
4
4
  'Segoe UI Symbol', 'Noto Color Emoji';
@@ -0,0 +1,8 @@
1
+ <%= field_wrapper **field_wrapper_args, full_width: true do %>
2
+ <%= @form.marksmith @field.id,
3
+ extra_preview_params: {
4
+ resource_class: @resource.class.name,
5
+ field_id: field.id,
6
+ }
7
+ %>
8
+ <% end %>
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Marksmith::MarkdownField::EditComponent < Avo::Fields::EditComponent
4
+ end
@@ -0,0 +1,3 @@
1
+ <%= field_wrapper **field_wrapper_args, full_width: true do %>
2
+ <%= render partial: "marksmith/shared/rendered_body", locals: { body: Marksmith::Renderer.new.renderer.render(@field.value) } %>
3
+ <% end %>
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Marksmith::MarkdownField::ShowComponent < Avo::Fields::ShowComponent
4
+ end
@@ -19,8 +19,33 @@ module Marksmith
19
19
 
20
20
  initializer "marksmith.assets.precompile" do |app|
21
21
  if Rails.application.config.respond_to?(:assets)
22
+ # The manifest will expose the asset files to the main app.
22
23
  app.config.assets.precompile << "marksmith_manifest.js"
23
24
  end
24
25
  end
26
+
27
+ initializer "avo-markdown_field.init" do |app|
28
+ if defined?(Avo)
29
+ require "marksmith/fields/markdown_field"
30
+
31
+ app.routes.append do
32
+ mount Marksmith::Engine => "/marksmith"
33
+ end
34
+
35
+ ActiveSupport.on_load(:avo_boot) do
36
+ Avo.plugin_manager.register :marksmith_field
37
+
38
+ Avo.plugin_manager.register_field :markdown, Marksmith::Fields::MarkdownField
39
+ Avo.plugin_manager.register_field :marksmith, Marksmith::Fields::MarkdownField
40
+
41
+ Avo.asset_manager.add_stylesheet "marksmith"
42
+ Avo.asset_manager.add_javascript "marksmith_controller-no-stimulus.esm"
43
+ Avo.asset_manager.add_javascript "list_continuation_controller-no-stimulus.esm"
44
+
45
+ Avo.asset_manager.register_stimulus_controller "marksmith", "MarksmithController"
46
+ Avo.asset_manager.register_stimulus_controller "list-continuation", "ListContinuationController"
47
+ end
48
+ end
49
+ end
25
50
  end
26
51
  end
@@ -0,0 +1,15 @@
1
+ module Marksmith
2
+ module Fields
3
+ class MarkdownField < Avo::Fields::BaseField
4
+ def initialize(id, **args, &block)
5
+ super(id, **args, &block)
6
+
7
+ hide_on :index
8
+ end
9
+
10
+ def view_component_namespace
11
+ "Marksmith::MarkdownField"
12
+ end
13
+ end
14
+ end
15
+ end
@@ -1,3 +1,3 @@
1
1
  module Marksmith
2
- VERSION = "0.0.13"
2
+ VERSION = "0.0.15"
3
3
  end
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.0.13
4
+ version: 0.0.15
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-01-23 00:00:00.000000000 Z
11
+ date: 2025-01-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -64,8 +64,16 @@ files:
64
64
  - app/assets/images/marksmith/svgs/quote.svg
65
65
  - app/assets/images/marksmith/svgs/task-list.svg
66
66
  - app/assets/images/marksmith/svgs/unordered-list.svg
67
+ - app/assets/javascripts/list_continuation_controller-full.esm.js
68
+ - app/assets/javascripts/list_continuation_controller-no-stimulus.esm.js
69
+ - app/assets/javascripts/marksmith_controller-full.esm.js
70
+ - app/assets/javascripts/marksmith_controller-no-stimulus.esm.js
67
71
  - app/assets/stylesheets/marksmith.css
68
72
  - app/assets/stylesheets/marksmith/application.css
73
+ - app/components/marksmith/markdown_field/edit_component.html.erb
74
+ - app/components/marksmith/markdown_field/edit_component.rb
75
+ - app/components/marksmith/markdown_field/show_component.html.erb
76
+ - app/components/marksmith/markdown_field/show_component.rb
69
77
  - app/controllers/marksmith/application_controller.rb
70
78
  - app/controllers/marksmith/markdown_previews_controller.rb
71
79
  - app/frontend/entrypoints/application.css
@@ -89,6 +97,7 @@ files:
89
97
  - config/vite.json
90
98
  - lib/marksmith.rb
91
99
  - lib/marksmith/engine.rb
100
+ - lib/marksmith/fields/markdown_field.rb
92
101
  - lib/marksmith/helper.rb
93
102
  - lib/marksmith/version.rb
94
103
  - lib/tasks/marksmith_tasks.rake