Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@minervaproject/html-text-collab-ext
Advanced tools
Readme
A set of utilities that enhances a normal HTML <textarea>
element with collaborative editing capabilities. The enhanced <textarea>
is able to render the cursor and selection of other collaborators. A tooltip with the collaborator's username can be flashed when remote edits are made. The utility also allows for non-disruptive modification of the <textarea>
where the local user's selection and cursor are not impacted by changes to the <textarea>
contents.
The animation below shows the basic functionality provided by this library.
You can see a live demo here (Convergence does the real-time sync). The code for it can be found here.
Install package with NPM and add it to your development dependencies:
npm install --save-dev @convergence/html-text-collab-ext
<html>
<body>
<textarea id="example">
Some example text to edit.
</textarea>
</body>
</html>
const textarea = document.getElementById("example");
const textEditor = new HtmlTextCollabExt.CollaborativeTextEditor({
control: textarea,
onInsert: (index, value) => console.log(`"${value}" was inserted at index ${index}`,
onDelete: (index, length) => console.log(`"${length}" characters were deleted at index ${index}`,
onSelectionChanged: (selection) => console.log(`selection was changed to ${JSON.stringify(selection)}`)
}
//
// Selection Management
//
const selectionManager = textEditor.selectionManager();
const collaborator = selectionManager.createCollaborator(
"test", "Test User", "red", {anchor: 10, target: 20});
collaborator.setSelection({anchor: 5, target: 10});
collaborator.flashCursorToolTip(2);
selectionManager.removeCollaborator("test");
//
// Text Modification
//
// Insert text at index 10
textEditor.insertText(10, "Inserted Text");
// Delete 5 charachters at index 10
textEditor.deleteText(10, 5);
// Set the entire value.
textEditor.setText("New textarea value");
npm install
to install requried dependencies.npm run dist
to build the distribution package.npm start
to start the example application.FAQs
Collaborative extension for HTML textareas
The npm package @minervaproject/html-text-collab-ext receives a total of 76 weekly downloads. As such, @minervaproject/html-text-collab-ext popularity was classified as not popular.
We found that @minervaproject/html-text-collab-ext demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.