Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
aurelia-froala-editor
Advanced tools
This package provides a custom element for the Froala editor in Aurelia.
Install aurelia-froala-editor
from npm
npm install angular-froala-editor --save
Note: you can skip this part if you already have application generated.
npm install aurelia-cli -g
au new my-app
cd my-app
npm install aurelia-froala-editor --save
src/main.js
or src/main.ts
file add:// Editor files.
import "froala-editor/js/froala_editor.pkgd.min";
...
// Use the aurelia-froala-editor plugin.
aurelia.use.plugin('aurelia-froala-editor');
src/app.html
include CSS files and Froala Editor component:<require from="font-awesome.css"></require>
<require from="froala-editor/css/froala_editor.pkgd.min.css"></require>
<require from="froala-editor/css/froala_style.min.css"></require>
<froala-editor></froala-editor>
aurelia_project/aurelia.json
file set the builder loader plugins stub to false
// Editor files.
import "froala-editor/js/froala_editor.pkgd.min";
...
// Use the aurelia-froala-editor plugin.
aurelia.use.plugin('aurelia-froala-editor');
"loader": {
"type": "require",
"configTarget": "vendor-bundle.js",
"includeBundleMetadataInConfig": "auto",
"plugins": [
{
"name": "text",
"extensions": [
".html",
".css"
],
"stub": false
}
]
}
aurelia_project/aurelia.json
add to vendor_bundle
{
"name": "font-awesome",
"path": "../node_modules/font-awesome/css",
"main": "font-awesome.css"
},
"jquery",
{
"name": "froala-editor",
"path": "../node_modules/froala-editor",
"main": "js/froala_editor.min",
"resources": [
"./js/**/*.{js}",
"./css/**/*.{css}"
]
},
{
"name": "aurelia-froala-editor",
"path": "../node_modules/aurelia-froala-editor/dist/amd",
"main": "index",
"resources": [
"froala-editor.js",
"froala-editor.html"
],
"deps": [
"jquery",
"froala-editor",
"font-awesome"
]
}
au generate task copy-assets
aurelia_project/tasks/copy-assets.js
file and make it look like this:import gulp from 'gulp';
import project from '../aurelia.json';
export default function copyAssets(done) {
let assets = project.paths.assets;
assets.forEach(item => {
gulp.src(item.src)
.pipe(gulp.dest(item.dest));
});
done();
}
aurelia-project/tasks/build.js
file and modify it to look like this:import copyAssets from './copy-assets';
let build = gulp.series(
readProjectConfiguration,
gulp.parallel(
...
copyAssets // Add this.
),
writeBundles
);
aurelia_project/aurelia.json
file:{
"paths": {
"root": "src",
"resources": "resources",
"elements": "resources/elements",
"attributes": "resources/attributes",
"valueConverters": "resources/value-converters",
"bindingBehaviors": "resources/binding-behaviors",
"assets": [
{
"src": "./node_modules/font-awesome/fonts/**/*.*",
"dest": "./fonts"
}
]
}
}
au run --watch
To configure your project with Webpack, follow the resources from Aurelia Docs: http://aurelia.io/hub.html#/doc/article/aurelia/framework/latest/setup-webpack/2 .
git clone git@github.com:aurelia/skeleton-navigation.git
cd skeleton-navigation/skeleton-esnext-webpack
npm install
npm install aurelia-froala-editor --save
src/main.js
or src/main.ts
file add:import { PLATFORM } from "aurelia-pal";
// Editor files.
import "froala-editor/js/froala_editor.pkgd.min";
...
// Use the aurelia-froala-editor plugin.
aurelia.use.plugin(PLATFORM.moduleName('aurelia-froala-editor'));
src/app.html
include CSS files and Froala Editor component:<require from="froala-editor/css/froala_editor.pkgd.min.css"></require>
<require from="froala-editor/css/froala_style.min.css"></require>
<froala-editor></froala-editor>
webpack.config.js
file include the Aurelia Froala Editor plugin:const { AureliaPlugin, ModuleDependenciesPlugin } = require('aurelia-webpack-plugin');
plugins: [
new AureliaPlugin(),
new ModuleDependenciesPlugin({
"aurelia-froala-editor": [ './froala-editor' ],
"parent-module": [ "child-module" ],
}),
]
npm run start
To configure your project with JSPM, follow the resources from Aurelia Docs: http://aurelia.io/hub.html#/doc/article/aurelia/framework/latest/setup-jspm/1 .
git clone git@github.com:aurelia/skeleton-navigation.git
cd skeleton-navigation/skeleton-esnext
npm install
jspm install -y
jspm install aurelia-froala-editor
src/main.js
or src/main.ts
file add:// Import jQuery
import * as $ from 'jquery';
// Import Editor.
import * as froala from 'froala-editor/js/froala_editor.pkgd.min.js';
...
// Use the aurelia-froala-editor plugin.
aurelia.use.plugin('aurelia-froala-editor');
src/app.html
include CSS files and Froala Editor component:<require from="froala-editor/css/froala_editor.pkgd.min.css"></require>
<require from="froala-editor/css/froala_style.min.css"></require>
<froala-editor></froala-editor>
package.json
file add the following overrides to the jspm
entry:"overrides": {
"npm:froala-editor@^2.6.0": {
"main": "js/froala-editor.min",
"format": "global",
"shim": {
"js/froala-editor.min": {
"deps": [
"jquery"
]
}
}
}
}
build/bundles.js
add aurelia-froala-editor
to dist/aurelia
bundles:module.exports = {
"bundles": {
...
"dist/aurelia": {
"includes": [
...
"aurelia-froala-editor",
...
],
"options": {
"inject": true,
"minify": true,
"depCache": false,
"rev": false
}
}
}
}
gulp watch
In an Aurelia template, just use the aurelia-froala custom element to instantiate an editor.
<froala-editor></froala-editor>
All configuration options can be set via the config attribute.
<froala-editor
value.two-way="value"
config.bind="{
toolbarButtons: ['redo' , '|', 'fontFamily', '|', 'fontSize', '|', 'paragraphFormat', 'color', '|', 'bold', 'italic', 'underline', 'strikethrough', 'subscript', 'superscript', 'outdent', 'indent', 'clearFormatting', 'insertTable', 'html'],
toolbarButtonsMD: ['redo' , '|', 'fontFamily', '|', 'fontSize', '|', 'paragraphFormat', 'color'],
toolbarButtonsSM: ['redo' , '|', 'fontFamily', '|', 'fontSize', '|', 'paragraphFormat', 'color'],
toolbarButtonsXS: ['redo' , '|', 'fontFamily', '|', 'fontSize', '|', 'paragraphFormat', 'color'],
fontFamilySelection: true,
fontSizeSelection: true
}"></froala-editor>
A custom config can also be passed when the plugin is loaded in src/main.js
or src/main.ts
file:
// Use the aurelia-froala-editor plugin.
aurelia.use.plugin('aurelia-froala-editor', config => {
config.options({
toolbarInline: true
})
});
All the event handlers are also available:
<froala-editor
value.two-way="value"
event-handlers.bind = "{
'paste.afterCleanup': processPaste
}"></froala-editor>
The aurelia-froala-editor
project is under the Apache licence. However, to use the Froala WYSIWYG HTML Editor you should purchase a license for it. Froala has 3 different licenses for commercial use. For details please see License Agreement.
FAQs
Aurelia plugin for Froala WYSIWYG HTML rich text editor.
The npm package aurelia-froala-editor receives a total of 65 weekly downloads. As such, aurelia-froala-editor popularity was classified as not popular.
We found that aurelia-froala-editor demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.