forked from basecamp/trix
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
8,557 additions
and
6,865 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 |
---|---|---|
|
@@ -7,6 +7,12 @@ Created this to solve a few issues for my use case. Specifically when working on | |
3. Now when adding a link, if you didn't preselect text, it will use the link without protocol as text. So e.g. before https://example.com would be rendered as that, but now it is example.com that links to https://example.com | ||
4. Now the protocol is not required for linking, e.g. input of example.com will link to https://example.com, and [email protected] will link to mailto:[email protected] | ||
5. Fixed a bug where the toolbar would show up as default even when there's a custom toolbar set, specifically solves the need for this hack https://dev.to/konnorrogers/modifying-the-default-toolbar-in-trix-411b | ||
6. Now when trix-editor is bound to an input, the input will emit an 'input' event whenever it is programmatically changed. This fixes reactivity in modern frameworks, allowing you to bind to the inputs value. | ||
7. Added some simple types definitions for typescript environment imports. Might publish full types to separate @types package at some point. | ||
8. Added underline formatting support. | ||
|
||
Currently the css built from this is likely broken, the original package was using long deprecated node-sass package that did not work with JavaScript modules. | ||
I upgraded this to use the Dart Sass package but did not port the custom functions logic. It should be completely fine to use the css from the original package or just use your own. e.g. I do not important pacakge css and use tailwind. | ||
|
||
Original docs: | ||
|
||
|
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,31 @@ | ||
declare global { | ||
interface Window { | ||
Trix: { | ||
VERSION: string; | ||
config: any; | ||
core: any; | ||
models: any; | ||
views: any; | ||
controllers: any; | ||
observers: any; | ||
operations: any; | ||
elements: any; | ||
} | ||
} | ||
} | ||
|
||
declare namespace _default { | ||
function init(): Promise<{ | ||
VERSION: any; | ||
config: any; | ||
core: any; | ||
models: any; | ||
views: any; | ||
controllers: any; | ||
observers: any; | ||
operations: any; | ||
elements: any; | ||
filters: any; | ||
}>; | ||
} | ||
export default _default; |
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
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.