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.
editro
Advanced tools
Readme
Customizable html editor written in plain JS. You can think about MS FrontPage in web. This package contains two build.
Note: not production ready
This documentation describes Normal build and assumes you use webpack for buildig your app.
npm install --production editro
const Editro = require('editro')(); // note: this is factory
// Add addons here
// require('editro/addons/codeMirror')(Editro, CodeMirror);
const root = document.getElementById('html-editor');
const editro = new Editro(root, {
// options here
});
naming: Editro – class, editro – instance.
Set option value on instance.
Get option value.
Return DOM node that contains editro.
Return edited html.
Set html.
Select elemetn in editro by query selector.
You can call editro.selectByQuery('body')
to edit body element.
Save and restore data to/from local storage
Used by others.
Can be used to create panels. Constructor receive two args: editro and options.
options.position
Top panel for global buttons. Require addon/panel
Add new instrument to panel. instrument should contain two methods:
getNode() : Node
should retun dom node for instrumentgetGroup() : string
should retun string tagAllow you create new instruments on panel in easy way. Example:
editro.addInstrument(new Editro.type.Instrument(editro, {
icon: require('../../images/arrows-alt.svg'),
title: 'Fullscreen',
onClick: () => e.setOption('fullScreen', !e.getOption('fullScreen')),
group: 'panels'
}));
Constructor receive two args: editro and options.
Create tabs in toolbar. Can be enabled or disabled by option.
Toolbox panes. Used to hold controllers. When created it checks
Editro.controllers
object to obtain controllers.
Each value of this object should be a controller instance.
Helper. Used for extending.
Node param is optional.
Should be overrided. Called when new element selected.
Show/hide controller.
Return DOM node fro this controller.
Should be overrided.
You can toggle fullscreen
editro.setoption('fullScreen', true);
Redo
Undo
Define code prerocessors. Editro call them before paste html to/ get html from iframe. They changed scripts tag to prevent JS execution.
Takes array of Files (from form). Returns Promise with array of base64 strings for these files. Can be overrided for different behavior.
Create simple wywisig editro (Quill) for editing text nodes.
Create controller for font family. You can add additional fonts.
Editro.defineHelper('font', '"Super font", sans-serif', {
fontFamily: '"Super font", sans-serif',
source: 'http://' // link to css with font
})
Replace editro.upload
method. Allow uploding to server.
Specify address via uploadUrl option.
Max size via uploadMaxSize option.
CodeMirror integration
./node_modules/webpack-dev-server/bin/webpack-dev-server.js --port 3003 --config webpack.dev.config.js
You can use different versions of Editro depending on the instance.
FAQs
HTML WYSIWYG editor in HTML
The npm package editro receives a total of 5 weekly downloads. As such, editro popularity was classified as not popular.
We found that editro 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.