New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

scribe-editor

Package Overview
Dependencies
Maintainers
9
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

scribe-editor - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

2

bower.json

@@ -5,3 +5,3 @@ {

"lodash-amd": "2.4.1",
"immutable" : "3.2.1"
"immutable" : "3.6.2"
},

@@ -8,0 +8,0 @@ "devDependencies": {

@@ -0,1 +1,5 @@

# 1.2.0
Allows the default command patches to be over-ridden in the options. This will allow users to customise what gets loaded to address issues like [the behaviour of the bold patch](https://github.com/guardian/scribe/pull/250) where the default behaviour is not what is required.
# 1.1.0

@@ -2,0 +6,0 @@

@@ -11,37 +11,5 @@ # Contributing

## Testing Locally
```
# Mac only
brew install chromedriver
```
Please see the [wiki](https://github.com/guardian/scribe/wiki/Testing) for details of how to run the scribe test suite.
```
./setup.sh
# Defaults: TEST_SERVER_PORT=8080
TEST_SERVER_PORT=8080 \
BROWSER_NAME='chrome' \
npm test
```
## Testing via Sauce Labs
You will need to [download Sauce Connect](https://saucelabs.com/docs/connect).
TODO: Add steps for downloading Sauce Connect, i.e. https://github.com/angular/angular.js/blob/master/lib/sauce/sauce_connect_setup.sh
```
./setup.sh
export SAUCE_USERNAME='scribe-ci' SAUCE_ACCESS_KEY='4be9eeed-61de-4948-b18d-f7f655e9e4b0'
# Sauce Connect v3
java -jar ~/Downloads/Sauce-Connect-latest/Sauce-Connect.jar $SAUCE_USERNAME $SAUCE_ACCESS_KEY
# Sauce Connect v4
~/Downloads/sc-4.1-osx/bin/sc -u $SAUCE_USERNAME -k $SAUCE_ACCESS_KEY
# Defaults: TEST_SERVER_PORT=8080
TEST_SERVER_PORT=8080 \
RUN_IN_SAUCE_LABS=true \
BROWSER_NAME='chrome' \
BROWSER_VERSION='32' \
PLATFORM='WINDOWS' \
npm test
```
## Releasing

@@ -48,0 +16,0 @@

{
"name": "scribe-editor",
"version": "1.1.0",
"version": "1.2.0",
"main": "src/scribe.js",
"dependencies": {
"lodash-amd": "~2.4.1",
"immutable" : "~3.2.1"
"immutable" : "~3.6.2"
},

@@ -26,3 +26,3 @@ "devDependencies": {

"selenium-webdriver": "~2.41.0",
"scribe-test-harness": "~0.0.7"
"scribe-test-harness": "~0.0.14"
},

@@ -29,0 +29,0 @@ "scripts": {

@@ -51,2 +51,4 @@ Scribe [![Build Status](https://travis-ci.org/guardian/scribe.svg?branch=master)](https://travis-ci.org/guardian/scribe)

<dd>Enable/disable block element mode (enabled by default)</dd>
<dt><pre>defaultCommandPatches</pre></dt>
<dd>Defines which command patches should be loaded by default</dd>
</dl>

@@ -53,0 +55,0 @@

@@ -9,2 +9,5 @@ define([

return function (scribe) {
/**
* Wrapper for object holding currently selected text.
*/
function Selection() {

@@ -17,3 +20,6 @@ this.selection = window.getSelection();

}
/**
* @returns Closest ancestor Node satisfying nodeFilter. Undefined if none exist before reaching Scribe container.
*/
Selection.prototype.getContaining = function (nodeFilter) {

@@ -20,0 +26,0 @@ var range = this.range;

@@ -5,5 +5,7 @@ define(['lodash-amd/modern/collections/contains'], function (contains) {

// TODO: not exhaustive?
var blockElementNames = ['P', 'LI', 'DIV', 'BLOCKQUOTE', 'UL', 'OL', 'H1',
'H2', 'H3', 'H4', 'H5', 'H6', 'TABLE', 'TH', 'TD'];
var blockElementNames = ['ADDRESS', 'ARTICLE', 'ASIDE', 'AUDIO', 'BLOCKQUOTE', 'CANVAS', 'DD',
'DIV', 'FIELDSET', 'FIGCAPTION', 'FIGURE', 'FOOTER', 'FORM', 'H1',
'H2', 'H3', 'H4', 'H5', 'H6', 'HEADER', 'HGROUP', 'HR', 'LI',
'NOSCRIPT', 'OL', 'OUTPUT', 'P', 'PRE', 'SECTION', 'TABLE', 'TD',
'TH', 'TFOOT', 'UL', 'VIDEO'];
function isBlockElement(node) {

@@ -10,0 +12,0 @@ return contains(blockElementNames, node.nodeName);

@@ -46,6 +46,16 @@ define([

this.commands = {};
this.options = defaults(options || {}, {
allowBlockElements: true,
debug: false
debug: false,
defaultCommandPatches: [
'bold',
'indent',
'insertHTML',
'insertList',
'outdent',
'createLink'
]
});
this.commandPatches = {};

@@ -99,4 +109,6 @@ this._plainTextFormatterFactory = new FormatterFactory();

// Formatters
this.use(escapeHtmlCharactersFormatter());
this.use(replaceNbspCharsFormatter());
var defaultFormatters = Immutable.List.of(
escapeHtmlCharactersFormatter,
replaceNbspCharsFormatter
);

@@ -106,24 +118,24 @@

var mandatoryPatches = [
patches.commands.bold,
patches.commands.indent,
patches.commands.insertHTML,
patches.commands.insertList,
patches.commands.outdent,
patches.commands.createLink,
var defaultPatches = Immutable.List.of(
patches.events
];
);
var mandatoryCommands = [
commands.indent,
commands.insertList,
commands.outdent,
commands.redo,
commands.subscript,
commands.superscript,
commands.undo,
];
var defaultCommandPatches = Immutable.List(options.defaultCommandPatches).map(function(patch) { return patches.commands[patch]; });
var allPlugins = [].concat(mandatoryPatches, mandatoryCommands);
var defaultCommands = Immutable.List.of(
'indent',
'insertList',
'outdent',
'redo',
'subscript',
'superscript',
'undo'
).map(function(command) { return commands[command]; });
var allPlugins = Immutable.List().concat(
defaultFormatters,
defaultPatches,
defaultCommandPatches,
defaultCommands);
allPlugins.forEach(function(plugin) {

@@ -130,0 +142,0 @@ this.use(plugin());

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc