![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
react-trix
Advanced tools
React wrapper around Trix editor from Basecamp. With additional features that I needed when I was CTO at Roadmap when sending emails and collaborating with comments.
npm install react-trix --save
Trix will be included as dependency. You should already have React installed.
Make sure you have the latest Trix JavaScript and optionally their CSS on pages where you are using react-trix.
<script src="https://rawgit.com/basecamp/trix/master/dist/trix.js"></script>
npm i trix
import "trix/dist/trix";
If you're using npm version with SSR make sure to import trix on page level.
import * as React from "react";
import { TrixEditor } from "react-trix";
export class Test extends React.Component {
handleEditorReady(editor) {
// this is a reference back to the editor if you want to
// do editing programatically
editor.insertString("editor is ready");
}
handleChange(html, text) {
// html is the new html content
// text is the new text content
}
render() {
return (
<TrixEditor onChange={this.handleChange} onEditorReady={this.handleEditorReady} />
);
}
}
Those are the optional properties you can use on the <TrixEditor />
.
New in v0.7.0
The default name for the file upload is file
. You may use the fileParamName
to change its name, for instance blob
to work with Ruby on Rails.
let mergeTags = [{
trigger: "@",
tags: [
{name: "Dominic St-Pierre", tag: "@dominic"},
{name: "John Doe", tag: "@john"}
]
}, {
trigger: "{",
tags: [
{name: "First name", tag: "{{ .FirstName }}"},
{name: "Last name", tag: "{{ .LastName }}"}
]
}]
<TrixEditor
className="custom-css-class"
autoFocus={true}
placeholder="editor's placeholder"
value="initial content <strong>for the editor</strong>"
uploadURL="https://domain.com/imgupload/receiving/post"
uploadData={{"key1": "value", "key2": "value"}}
fileParamName="blob"
mergeTags={mergeTags}
onChange={on_change_handler}
onEditorReady={on_editor_ready_handler}
/>
You give a trigger character, for example "@" and when the user type this character a small popup suggestions
will be displayed where user can click and the tag
will be added.
You may customize the suggestion box via the CSS class react-trix-suggestions
like this:
.react-trix-suggestions {
/* for the container */
}
.react-trix-suggestions a {
/* for each suggestion */
}
Still having some issues testing Trix with enzyme/jsdom.
Contributions are welcome and appreciated.
FAQs
React wrapper around Basecamp's Trix editor.
The npm package react-trix receives a total of 949 weekly downloads. As such, react-trix popularity was classified as not popular.
We found that react-trix demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.