-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fixing attachment galleries * working on att * working on fixing * finishing touches on attachments * prettier * prettier * add changeset
- Loading branch information
1 parent
627b9ce
commit ba79275
Showing
24 changed files
with
468 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
"rhino-editor": patch | ||
--- | ||
|
||
- `previewable` attribute is now more consistently applied and checked on attachments. | ||
- Fixed a bug where attachments were not rendering properly when the raw action-text HTML passed to the editor. | ||
- Fixed a bug where all attachments were not being properly rendered. | ||
- Figcaption now jumps to the end of the block when you click on the `figure` | ||
- `"Add a caption"` will no longer show up on custom attachments. | ||
- Added a note about custom attachments need an actual content-type unlike Trix. | ||
- Added a small amount of `margin-top` to `figcaption` to match Trix. | ||
- `toMemorySize` now does not return decimales for KB / MB sizes. This is to align with Trix. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
docs/src/_documentation/references/05-differences-from-trix.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--- | ||
title: Differences from Trix | ||
permalink: /references/differences-from-trix/ | ||
--- | ||
|
||
<%= render Alert.new(type: "primary") do %> | ||
This section is still in progress and incomplete. This will be a running list of differences, features, | ||
where Rhino has diverged, etc, from Trix. | ||
<% end %> | ||
|
||
|
||
## Custom Attachments | ||
|
||
Custom Attachments in Rhino Editor must have a `content-type` set on them. To do this, go into the Model you are rendering and do the following: | ||
|
||
```rb | ||
class Mention < ApplicationRecord | ||
def attachable_content_type | ||
"application/vnd.active_record.mention" | ||
end | ||
end | ||
``` | ||
|
||
Or using an `ActiveModel::Model` | ||
|
||
```rb | ||
class Mention | ||
include ActiveModel::Model | ||
include ActiveModel::Attributes | ||
include GlobalID::Identification | ||
include ActionText::Attachable | ||
|
||
def attachable_content_type | ||
"application/vnd.active_record.mention" | ||
end | ||
end | ||
``` | ||
|
||
The reason for this is because sometimes you may want to render an ActiveStorage attachment from your server into | ||
Rhino Editor, but don't want it to go through the default image processing, for example, Mentions. | ||
|
||
This is an active choice to break backwards compatibility, but it's intended to allow for more powerful | ||
interactions with custom extensions on TipTap. | ||
|
||
For more context, check out this issue: | ||
|
||
<https://github.com/KonnorRogers/rhino-editor/pull/112> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.