Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4,001 changes: 899 additions & 3,102 deletions package-lock.json

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@
"sinon": "1.15.4",
"uglifyjs-webpack-plugin": "^1.2.4",
"walk": "^2.3.9",
"webpack": "^4.6.0",
"webpack-cli": "^2.0.12",
"webpack-dev-server": "^3.1.1",
"webpack-merge": "^4.1.2",
"webpack": "^4.28.1",
"webpack-cli": "^3.2.1",
"webpack-dev-server": "^3.1.14",
"webpack-merge": "^4.2.1",
"yargs": "6.6.0"
},
"main": "dist/alloy-editor/alloy-editor-no-react.js",
Expand All @@ -77,6 +77,7 @@
},
"homepage": "http://alloyeditor.com",
"dependencies": {
"clay-css": "2.5.1",
"create-react-class": "^15.6.3",
"prop-types": "^15.6.2",
"react": "^16.6.3",
Expand Down
2 changes: 1 addition & 1 deletion scripts/build/gulp/_hash
Original file line number Diff line number Diff line change
@@ -1 +1 @@
c53f3ac54b9661a152f35743c3075261527c3b82
cc3dcb64e9a96a8c6ea572d15efbb68a3b70ca02
3 changes: 2 additions & 1 deletion scripts/build/gulp/tasks/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ gulp.task('build', function(callback) {
[
'build-css',
'copy-ckeditor',
'copy-languages'
'copy-languages',
'copy-svgs'
],
task,
callback
Expand Down
12 changes: 12 additions & 0 deletions scripts/build/gulp/tasks/icons.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const gulp = require('gulp');

const Constants = require('../constants');
const path = require('path');
const fs = require('fs');

gulp.task('copy-svgs', function() {
var iconsPath = path.join(Constants.rootDir, 'node_modules', 'clay-css', 'lib', 'images', 'icons', 'icons.svg');

return gulp.src(iconsPath)
.pipe(gulp.dest(path.join(Constants.editorDistFolder, 'assets', 'icons')));
});
81 changes: 80 additions & 1 deletion src/adapter/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,17 @@ extend(Core, Base, {

editor.config.extraPlugins = this.get('extraPlugins');

editor.config.embedProviders = this.get('embedProviders');

editor.config.placeholderClass = this.get('placeholderClass');

editor.config.pasteFromWordRemoveStyles = false;
editor.config.pasteFromWordRemoveFontStyles = false;

editor.config.selectionKeystrokes = this.get('selectionKeystrokes');

editor.config.spritemap = this.get('spritemap');

Lang.mix(editor.config, config);

if (CKEDITOR.env.ie && !CKEDITOR.env.edge) {
Expand Down Expand Up @@ -315,6 +319,66 @@ extend(Core, Base, {
writeOnce: true
},


/**
* List of embed providers for videos
*
* @memberof Core
* @instance
* @property embedProviders
* @default []
* @type Array}
*/
embedProviders: {
validator: Lang.isArray,
value: [
{
id: 'facebook',
tpl: '<iframe allowFullScreen="true" allowTransparency="true" ' +
'frameborder="0" height="315" ' +
'src="https://www.facebook.com/plugins/video.php?href={embedId}' +
'&show_text=0&width=560&height=315" scrolling="no" ' +
'style="border:none;overflow:hidden" width="560"></iframe>',
urlSchemes: [
'(https?:\\/\\/(?:www\\.)?facebook.com\\/\\S*\\/videos\\/\\S*)'
]
},
{
id: 'twitch',
tpl: '<iframe allowfullscreen="true" frameborder="0" ' +
'height="315" ' +
'src="https://player.twitch.tv/?autoplay=false&video={embedId}" ' +
'scrolling="no" width="560"></iframe>',
urlSchemes: [
'https?:\\/\\/(?:www\\.)?twitch.tv\\/videos\\/(\\S*)$'
]
},
{
id: 'vimeo',
tpl: '<iframe allowfullscreen frameborder="0" height="315" ' +
'mozallowfullscreen ' +
'src="https://player.vimeo.com/video/{embedId}" ' +
'webkitallowfullscreen width="560"></iframe>',
urlSchemes: [
'https?:\\/\\/(?:www\\.)?vimeo\\.com\\/album\\/.*\\/video\\/(\\S*)',
'https?:\\/\\/(?:www\\.)?vimeo\\.com\\/channels\\/.*\\/(\\S*)',
'https?:\\/\\/(?:www\\.)?vimeo\\.com\\/groups\\/.*\\/videos\\/(\\S*)',
'https?:\\/\\/(?:www\\.)?vimeo\\.com\\/(\\S*)$'
]
},
{
id: 'youtube',
tpl: '<iframe allow="autoplay; encrypted-media" allowfullscreen ' +
'height="315" frameborder="0" ' +
'src="https://www.youtube.com/embed/{embedId}?rel=0" ' +
'width="560"></iframe>',
urlSchemes: [
'https?:\\/\\/(?:www\\.)?youtube.com\\/watch\\?v=(\\S*)$'
]
}
]
},

/**
* Specifies whether AlloyEditor set the contenteditable attribute
* to "true" on its srcNode.
Expand Down Expand Up @@ -456,6 +520,21 @@ extend(Core, Base, {
}]
},

/**
* The path to the spritemap SVG used for icons
*
* @memberof Core
* @instance
* @property spritemap
* @type String
* @writeOnce
*/
spritemap: {
validator: Lang.isString,
value: 'alloy-editor/assets/icons/icons.svg',
writeOnce: true
},

/**
* The Node ID or HTMl node, which AlloyEditor should use as an editable area.
*
Expand All @@ -481,7 +560,7 @@ extend(Core, Base, {
validator: '_validateToolbars',
value: {
add: {
buttons: ['image', 'embed', 'camera', 'hline', 'table'],
buttons: ['image', 'embed', 'camera', 'hline', 'table', 'embedVideo'],
tabIndex: 2
},
styles: {
Expand Down
16 changes: 14 additions & 2 deletions src/assets/lang/en.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,37 @@
{
"add": "Add",
"ariaUpdateManyToolbars": "{toolbars} toolbars are available. Press ALT+F10 to focus.",
"ariaUpdateNoToolbar": "No toolbars are available",
"ariaUpdateOneToolbar": "{toolbars} toolbar is available. Press ALT+F10 to focus.",
"ariaUpdateManyToolbars": "{toolbars} toolbars are available. Press ALT+F10 to focus.",
"camera": "Insert Image from Camera",
"cameraDisabled": "The browser does not support this action, or it is available on https only (Chrome).",
"cite": "Cite",
"clearInput": "Clear Input Field",
"clear": "Clear",
"code": "Code",
"columns": "Cols",
"confirm": "Confirm",
"danger": "Danger",
"deleteEmbed": "Delete embed",
"disabled": "Disabled",
"editLink": "Type or paste link here",
"enterValidUrl": "Please enter a valid url",
"image": "Insert Image",
"info": "Info",
"link": "Link",
"linkTargetBlank": "_blank (new tab)",
"linkTargetDefault": "default",
"linkTargetParent": "_parent",
"linkTargetSelf": "_self (same tab)",
"linkTargetTop": "_top",
"normal": "Normal",
"pasteVideoLink": "Paste Video Link",
"platformNotSupported": "Sorry, this platform is not supported",
"primary": "Primary",
"removeLink": "Remove link",
"rows": "Rows",
"table": "Insert Table"
"success": "Success",
"table": "Insert Table",
"videoPlaybackDisabled": "Video playback is disabled during edit mode",
"warning": "Warning"
}
3 changes: 3 additions & 0 deletions src/assets/sass/components/ae-icon/skin.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.ae-svg-icon {
fill: $svg-icon;
}
8 changes: 8 additions & 0 deletions src/assets/sass/components/ae-icon/structure.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.ae-svg-icon {
display: inline-block;
height: $svg-icon-size;
margin-top: $svg-icon-margin-top;
pointer-events: none;
vertical-align: middle;
width: $svg-icon-size;
}
1 change: 1 addition & 0 deletions src/assets/sass/components/ae-icon/variables/skin.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$svg-icon: currentColor;
2 changes: 2 additions & 0 deletions src/assets/sass/components/ae-icon/variables/structure.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
$svg-icon-size: 1em;
$svg-icon-margin-top: -3px;
3 changes: 3 additions & 0 deletions src/assets/sass/components/ae-separator/skin.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.ae-separator::after {
border-right-color: $separator-color;
}
13 changes: 7 additions & 6 deletions src/assets/sass/components/ae-separator/structure.scss
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
.ae-separator {
height: 24px;
margin-right: 10px;
height: $separator-height;
margin-right: $separator-margin-right;
position: relative;

&::after {
border-right: 1px solid white;
border-right-style: solid;
border-right-width: $separator-line-border-width;
content: '';
height: 12px;
height: $separator-line-height;
position: absolute;
top: 50%;
transform: translateY(-50%);
top: $separator-line-top;
transform: $separator-line-translateY;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$separator-color: white;
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$separator-height: 24px;
$separator-margin-right: 10px;
$separator-line-border-width: 1px;
$separator-line-height: 12px;
$separator-line-top: 50%;
$separator-line-translateY: translateY(-50%);
5 changes: 4 additions & 1 deletion src/assets/sass/skin/atlas/variables/structure.scss
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,7 @@ $dropdown-listbox-item-padding: 8px 12px;
/** TOOLBAR **/
$toolbar-add-border-width: 2px;
$toolbar-add-height: 44px;
$toolbar-add-width: 44px;
$toolbar-add-width: 44px;

/** SEPARATOR **/
$separator-height: 40px;
2 changes: 2 additions & 0 deletions src/assets/sass/skin/default/skin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
@import "components/ae-placeholder/skin";
@import "components/ae-sr-only/skin";
@import "components/ae-twitter-link/skin";
@import "components/ae-icon/skin";
@import "components/ae-separator/skin";

.ae-ui {
@import "components/ae-arrow-box/skin";
Expand Down
2 changes: 2 additions & 0 deletions src/assets/sass/skin/default/structure.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
@import "components/ae-placeholder/structure";
@import "components/ae-twitter-link/structure";
@import "components/ae-sr-only/structure";
@import "components/ae-icon/structure";
@import "components/ae-separator/structure";

.ae-ui {
@import "components/ae-toolbar/structure";
Expand Down
4 changes: 3 additions & 1 deletion src/assets/sass/skin/default/variables/skin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@
@import "components/ae-button-bridge/variables/skin";
@import "components/ae-dropdown/variables/skin";
@import "components/ae-toolbar/variables/skin";
@import "components/ae-twitter-link/variables/skin";
@import "components/ae-twitter-link/variables/skin";
@import "components/ae-icon/variables/skin";
@import "components/ae-separator/variables/skin";
4 changes: 3 additions & 1 deletion src/assets/sass/skin/default/variables/structure.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@
@import "components/ae-button-bridge/variables/structure";
@import "components/ae-dropdown/variables/structure";
@import "components/ae-toolbar/variables/structure";
@import "components/ae-twitter-link/variables/structure";
@import "components/ae-twitter-link/variables/structure";
@import "components/ae-icon/variables/structure";
@import "components/ae-separator/variables/structure";
5 changes: 4 additions & 1 deletion src/assets/sass/skin/moono/variables/skin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,7 @@ $toolbar-font-color: $CKEDITOR_font_base_color;
$toolbar-add-bg-color: $CKEDITOR_base_color;
$toolbar-add-border-radius: 0;
$toolbar-add-font-color: $CKEDITOR_font_base_color;
$toolbar-add-icon-size: 22px;
$toolbar-add-icon-size: 22px;

/** SEPARATOR **/
$separator-color: #393939;
5 changes: 4 additions & 1 deletion src/assets/sass/skin/moono/variables/structure.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,7 @@ $toolbar-add-height: $base-height;
$toolbar-add-width: $base-width;

/** TOOLBAR-ADD **/
$toolbar-add-border-width: 0;
$toolbar-add-border-width: 0;

/** SEPARATOR **/
$separator-height: 28px;
2 changes: 1 addition & 1 deletion src/components/base/widget-dropdown.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import ReactDOM from 'react-dom';
import Lang from '../../oop/lang.js';
import ReactDOM from 'react-dom';

/**
* Provides functionality for managing different dropdowns inside a widget.
Expand Down
Loading