marksmith 0.0.16 → 0.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7d2521a8fb9baa46d9a114cd5eab01821f2174b57652047feab46a1792bda3ff
4
- data.tar.gz: 948e273446bc37951ac95723dd38c4d9cf0f02415cae2a34188e98bd8a146c09
3
+ metadata.gz: 62a833a3db7da2729cbe8743021710f452973784d3ce79d6612dc37201df3532
4
+ data.tar.gz: 192191de6e129b9ee26ef2fe7866efdf9d3e2cecd3d6448b8f3255847d1054e4
5
5
  SHA512:
6
- metadata.gz: 19c9735c29a246ee2e8b8a05ed9fb49b8168c22432a92e2361b227f223ca0f534504189d0686874f1cdbf8f1c33ef6b8c58d931d4d3a8277b91f3bb2fd36635b
7
- data.tar.gz: 587f3cd135ccbcdd211200f73a35263f38027cb533be50773e2cb3a092243e74e8a0a759d120a8021b264cff879f514f5f80f1bd312227e2ce342fcbc88c73ed
6
+ metadata.gz: 872a14aa320e5411628800c95c1ee9a2cb10a1e323af2d893c815fc075b3760f7d302c1410c47c09610828d444a6fde62129b2c8ab9d79127781cca77ea5a602
7
+ data.tar.gz: cc6358f58b2136dd31e1742bd92d210142eb44e93eaa65376541ed04d6beba08c7b963156de0092777613ec6c2892d90315d3e424b84f01ca45732d4182ce798
data/README.md CHANGED
@@ -4,7 +4,9 @@ Marksmith is a GitHub-style markdown editor for Rails apps.
4
4
 
5
5
  It supports Active Storage attachments and comes with a built-in mardown preview renderer.
6
6
 
7
- [![Marksmith demo](https://github.com/user-attachments/assets/09820413-7b2f-4d9d-a6a5-a9b1d5b90bea)](https://github.com/user-attachments/assets/f257db9d-6bfd-4fbc-ac10-dff1dfc99ff2)
7
+ ![Marksmith logo](./marksmith.png)
8
+
9
+ ![Marksmith demo](./marksmith.gif)
8
10
 
9
11
  ## Usage
10
12
 
@@ -107,7 +109,10 @@ bin/importmap pin @avo-hq/marksmith
107
109
 
108
110
  ## Active Storage
109
111
 
110
- The field supports Actve Storage uploads using drag and drop and pasting files into the field.
112
+ The editor supports [ActiveStorage](https://guides.rubyonrails.org/active_storage_overview.html) uploads using drag and drop and pasting files into the field.
113
+
114
+ Whe used in Avo it supports injecting assets using the [Media Library feature](http://docs.avohq.io/3.0/media-library.html).
115
+
111
116
 
112
117
  ## List Continuation
113
118
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Marksmith 0.0.16
2
+ Marksmith 0.1.1
3
3
  */
4
4
  var ListContinuationController = (function () {
5
5
  'use strict';
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Marksmith 0.0.16
2
+ Marksmith 0.1.1
3
3
  */
4
4
  var ListContinuationController = (function (stimulus) {
5
5
  'use strict';
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Marksmith 0.0.16
2
+ Marksmith 0.1.1
3
3
  */
4
4
  var MarksmithController = (function () {
5
5
  'use strict';
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Marksmith 0.0.16
2
+ Marksmith 0.1.1
3
3
  */
4
4
  var MarksmithController = (function (stimulus) {
5
5
  'use strict';
@@ -854,6 +854,9 @@
854
854
  margin-inline-end: calc(calc(var(--ms-spacing) * 2) * calc(1 - var(--tw-space-x-reverse)));
855
855
  }
856
856
  }
857
+ .ms\:overflow-auto {
858
+ overflow: auto;
859
+ }
857
860
  .ms\:rounded {
858
861
  border-radius: 0.25rem;
859
862
  }
@@ -900,15 +903,9 @@
900
903
  .ms\:px-2 {
901
904
  padding-inline: calc(var(--ms-spacing) * 2);
902
905
  }
903
- .ms\:px-3 {
904
- padding-inline: calc(var(--ms-spacing) * 3);
905
- }
906
906
  .ms\:py-1 {
907
907
  padding-block: calc(var(--ms-spacing) * 1);
908
908
  }
909
- .ms\:py-2 {
910
- padding-block: calc(var(--ms-spacing) * 2);
911
- }
912
909
  .ms\:py-px {
913
910
  padding-block: 1px;
914
911
  }
@@ -1027,6 +1024,9 @@
1027
1024
  flex-direction: row;
1028
1025
  }
1029
1026
  }
1027
+ .marksmith, .marksmith * {
1028
+ box-sizing: border-box;
1029
+ }
1030
1030
  .ms\:button-spinner {
1031
1031
  width: 24px;
1032
1032
  height: 24px;
@@ -12,6 +12,11 @@
12
12
  @source "./../../helpers/";
13
13
  @source "./../../../lib/";
14
14
 
15
+ .marksmith,
16
+ .marksmith * {
17
+ box-sizing: border-box;
18
+ }
19
+
15
20
  .ms\:button-spinner {
16
21
  width: 24px;
17
22
  height: 24px;
@@ -1,7 +1,9 @@
1
1
  import { application } from "./application"
2
2
 
3
3
  import MarksmithController from "./marksmith_controller"
4
+ import ListContinuationController from "./list_continuation_controller"
4
5
  // import MarksmithController from "./../../../../../app/assets/builds/marksmith.esm.js"
5
6
  // console.log(MarksmithController)
6
7
 
7
8
  application.register("marksmith", MarksmithController)
9
+ application.register("list-continuation", ListContinuationController)
@@ -1,6 +1,4 @@
1
1
  <%= turbo_stream.update params[:element_id] do %>
2
- <div class="ms:px-3 ms:py-2">
3
- <%= render partial: "marksmith/shared/rendered_body", locals: { body: @body } %>
4
- </div>
2
+ <%= render partial: "marksmith/shared/rendered_body", locals: { body: @body } %>
5
3
  <% end %>
6
4
 
@@ -26,7 +26,7 @@
26
26
  gallery_turbo_frame = local_assigns.dig(:gallery, :turbo_frame) || nil
27
27
  %>
28
28
  <%= content_tag :div,
29
- class: "ms:block ms:flex-col ms:w-full ms:border ms:border-neutral-300 ms:rounded ms:@container ms:focus-within:border-neutral-400",
29
+ class: "marksmith ms:block ms:flex-col ms:w-full ms:border ms:border-neutral-300 ms:rounded ms:@container ms:focus-within:border-neutral-400",
30
30
  data: {
31
31
  controller: "marksmith list-continuation",
32
32
  action: "
@@ -65,11 +65,11 @@
65
65
  </markdown-toolbar>
66
66
  </div>
67
67
  <% toolbar_button_classes = "ms:cursor-pointer ms:hover:bg-neutral-100 ms:px-1 ms:py-px ms:rounded ms:text-sm" %>
68
- <div class="ms:border-t ms:w-full ms:border-neutral-300 ms:flex">
69
- <%= content_tag :div, class: "ms:flex ms:flex-col ms:size-full", data: { marksmith_target: "fieldContainer" } do %>
68
+ <div class="ms:border-t ms:w-full ms:border-neutral-300 ms:flex ms:flex-1">
69
+ <%= content_tag :div, class: "ms:flex ms:flex-1 ms:flex-col ms:size-full", data: { marksmith_target: "fieldContainer" } do %>
70
70
  <%= text_area_tag field_name, value,
71
71
  id: name,
72
- class: class_names("ms:flex ms:flex-1 ms:rounded ms:border-none ms:p-2 ms:resize-y ms:focus:outline-none ms:font-mono ms:focus:ring-0 ms:leading-normal", classes),
72
+ 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),
73
73
  rows: rows,
74
74
  data: {
75
75
  action: "drop->marksmith#dropUpload paste->marksmith#pasteUpload",
@@ -81,7 +81,7 @@
81
81
  autofocus:,
82
82
  style:
83
83
  %>
84
- <div class="ms:flex ms:flex-1 ms:flex-grow ms:space-x-2 ms:py-1 ms:border-t ms:border-neutral-300 ms:px-2 ms:font-sans ms:text-sm">
84
+ <div class="ms:flex ms:flex-1 ms:flex-grow ms:space-x-2 ms:py-1 ms:border-t ms:border-neutral-300 ms:px-2 ms:font-sans ms:text-sm ms:p-2">
85
85
  <%= link_to "https://docs.github.com/github/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax", target: "_blank", class: class_names("ms:flex ms:items-center ms:text-neutral-800 ms:no-underline", toolbar_button_classes) do %>
86
86
  <%= image_tag asset_path("marksmith/svgs/markdown.svg"), class: "ms:inline ms:size-4 ms:mr-1" %> <%= t("marksmith.markdown_is_supported").humanize %>
87
87
  <% end %>
@@ -96,7 +96,7 @@
96
96
  </div>
97
97
  <% end %>
98
98
  <%= content_tag :div,
99
- class: "ms:hidden ms:markdown-preview ms:size-full ms:flex-1 ms:flex ms:size-full",
99
+ class: "ms:hidden ms:markdown-preview ms:size-full ms:flex-1 ms:flex ms:size-full ms:p-2 ms:overflow-auto",
100
100
  id: "markdown-preview-#{name}",
101
101
  data: {
102
102
  marksmith_target: "previewElement",
@@ -1,3 +1,3 @@
1
- <%= content_tag :div, class: "ms:prose ms:prose-neutral ms:max-w-none" do %>
1
+ <%= content_tag :div, class: "ms:block ms:w-full ms:prose ms:max-w-none ms:prose-neutral" do %>
2
2
  <%= sanitize(body, tags: %w(table th tr td span) + ActionView::Helpers::SanitizeHelper.sanitizer_vendor.safe_list_sanitizer.allowed_tags.to_a) %>
3
3
  <% end %>
@@ -1,3 +1,3 @@
1
1
  module Marksmith
2
- VERSION = "0.0.16"
2
+ VERSION = "0.1.1"
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.16
4
+ version: 0.1.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-01-31 00:00:00.000000000 Z
11
+ date: 2025-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails