Current Dev State

This commit is contained in:
Tim Lorsbach
2025-06-23 20:13:54 +02:00
parent b4f9bb277d
commit ded50edaa2
22617 changed files with 4345095 additions and 174 deletions

20
static/js/ketcher2/node_modules/accord/contributing.md generated vendored Normal file
View File

@ -0,0 +1,20 @@
Contributing
------------
Anything that people should know before filing issues or opening pull requests should be here. This is a good place to put details on coding conventions, how to build the project, and how to run tests.
### Filing Issues
If you have found an issue with this library, please let us know! Make sure that before you file an issue, you have searched to see if someone else has already opened it. When opening the issue, make sure there's a clear and concise title and description, and that the description contains specific steps that can be followed to reproduce the issue you are experiencing. Following these guidelines will get your issue fixed up the quickest!
If you are making a feature request, that is welcome in the issues section as well. Make sure again that the title and issue summary are clear so that we can understand what you're asking for. Any use cases would also help. And if you are requesting a feature and are able to work with javscript code, please consider submitting a pull request for the feature!
### Pull Requests
When submitting a pull request, make sure that the code follows the general style and structure elsewhere in the library, that your commit messages are [well-formed](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html), and that you have added tests for whatever feature you are adding.
### Running Tests
To run tests, make sure you have `npm install`ed, then just run `mocha` in the root. If you'd like to run tests just for one specific adapter, you can use mocha's grep option, like this `mocha -g jade` - this would run just the jade test suite.
The way tests are set up is fairly simple, a folder in `fixtures` and a `describe` block for each adapter. All tests are currently compared to expected output through an pure javascript AST, to ensure compatibility across systems.

View File

@ -0,0 +1,278 @@
// Generated by CoffeeScript 1.12.1
(function() {
var Adapter, W, clone, fs, partialRight, path, readFile, requireEngine, resolve, resolvePath,
indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
W = require('when');
clone = require('lodash.clone');
partialRight = require('lodash.partialright');
resolve = require('resolve');
path = require('path');
fs = require('fs');
readFile = require('when/node/function').lift(fs.readFile);
Adapter = (function() {
/**
* The names of the npm modules that are supported to be used as engines by
the adapter. Defaults to the name of the adapter.
* @type {String[]}
*/
Adapter.prototype.supportedEngines = void 0;
/**
* The name of the engine in-use. Generally this is the name of the package on
npm.
* @type {String}
*/
Adapter.prototype.engineName = '';
/**
* The actual engine, no adapter wrapper. Defaults to the engine that we
recommend for compiling that particular language (if it is installed).
Otherwise, whatever engine we support that is installed.
*/
Adapter.prototype.engine = void 0;
/**
* Array of all file extensions the compiler should match
* @type {String[]}
*/
Adapter.prototype.extensions = void 0;
/**
* Expected output extension
* @type {String}
*/
Adapter.prototype.output = '';
/**
* Specify if the output of the language is independent of other files or the
evaluation of potentially stateful functions. This means that the only
information passed into the engine is what gets passed to Accord's
compile/render function, and whenever that same input is given, the output
will always be the same.
* @type {Boolean}
* @todo Add detection for when a particular job qualifies as isolated
*/
Adapter.prototype.isolated = false;
/**
* @param {String} [engine=Adapter.supportedEngines[0]] If you need to use a
particular engine to compile/render with, then specify it here. Otherwise
we use whatever engine you have installed.
*/
function Adapter(engineName1, customPath) {
var i, len, ref, ref1;
this.engineName = engineName1;
if (!this.supportedEngines || this.supportedEngines.length === 0) {
this.supportedEngines = [this.name];
}
if (this.engineName != null) {
if (ref = this.engineName, indexOf.call(this.supportedEngines, ref) < 0) {
throw new Error("engine '" + this.engineName + "' not supported");
}
this.engine = requireEngine(this.engineName, customPath);
} else {
ref1 = this.supportedEngines;
for (i = 0, len = ref1.length; i < len; i++) {
this.engineName = ref1[i];
try {
this.engine = requireEngine(this.engineName, customPath);
} catch (error) {
continue;
}
return;
}
throw new Error("'tried to require: " + this.supportedEngines + "'.\nNone found. Make sure one has been installed!");
}
}
/**
* Render a string to a compiled string
* @param {String} str
* @param {Object} [opts = {}]
* @return {Promise}
*/
Adapter.prototype.render = function(str, opts) {
if (opts == null) {
opts = {};
}
if (!this._render) {
return W.reject(new Error('render not supported'));
}
return this._render(str, opts);
};
/**
* Render a file to a compiled string
* @param {String} file The path to the file
* @param {Object} [opts = {}]
* @return {Promise}
*/
Adapter.prototype.renderFile = function(file, opts) {
if (opts == null) {
opts = {};
}
opts = clone(opts, true);
return readFile(file, 'utf8').then(partialRight(this.render, Object.assign({
filename: file
}, opts)).bind(this));
};
/**
* Compile a string to a function
* @param {String} str
* @param {Object} [opts = {}]
* @return {Promise}
*/
Adapter.prototype.compile = function(str, opts) {
if (opts == null) {
opts = {};
}
if (!this._compile) {
return W.reject(new Error('compile not supported'));
}
return this._compile(str, opts);
};
/**
* Compile a file to a function
* @param {String} file The path to the file
* @param {Object} [opts = {}]
* @return {Promise}
*/
Adapter.prototype.compileFile = function(file, opts) {
if (opts == null) {
opts = {};
}
return readFile(file, 'utf8').then(partialRight(this.compile, Object.assign({
filename: file
}, opts)).bind(this));
};
/**
* Compile a string to a client-side-ready function
* @param {String} str
* @param {Object} [opts = {}]
* @return {Promise}
*/
Adapter.prototype.compileClient = function(str, opts) {
if (opts == null) {
opts = {};
}
if (!this._compileClient) {
return W.reject(new Error('client-side compile not supported'));
}
return this._compileClient(str, opts);
};
/**
* Compile a file to a client-side-ready function
* @param {String} file The path to the file
* @param {Object} [opts = {}]
* @return {Promise}
*/
Adapter.prototype.compileFileClient = function(file, opts) {
if (opts == null) {
opts = {};
}
return readFile(file, 'utf8').then(partialRight(this.compileClient, Object.assign(opts, {
filename: file
})).bind(this));
};
/**
* Some adapters that compile for client also need helpers, this method
returns a string of minfied JavaScript with all of them
* @return {Promise} A promise for the client-side helpers.
*/
Adapter.prototype.clientHelpers = void 0;
return Adapter;
})();
requireEngine = function(engineName, customPath) {
var engine, err;
if (customPath != null) {
engine = require(resolve.sync(path.basename(customPath), {
basedir: customPath
}));
engine.__accord_path = customPath;
} else {
try {
engine = require(engineName);
engine.__accord_path = resolvePath(engineName);
} catch (error) {
err = error;
throw new Error("'" + engineName + "' not found. make sure it has been installed!");
}
}
try {
if (!engine.version) {
engine.version = require(engine.__accord_path + '/package.json').version;
}
} catch (error) {
err = error;
}
return engine;
};
/**
* Get the path to the root folder of a node module, given its name.
* @param {String} name The name of the node module you want the path to.
* @return {String} The root folder of node module `name`.
* @private
*/
resolvePath = function(name) {
var filepath;
filepath = require.resolve(name);
while (true) {
if (filepath === '/') {
throw new Error("cannot resolve root of node module " + name);
}
filepath = path.dirname(filepath);
if (fs.existsSync(path.join(filepath, 'package.json'))) {
return filepath;
}
}
};
module.exports = Adapter;
}).call(this);

View File

@ -0,0 +1,55 @@
// Generated by CoffeeScript 1.12.1
(function() {
var Adapter, LiveScript, W,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
Adapter = require('../../adapter_base');
W = require('when');
LiveScript = (function(superClass) {
var compile;
extend(LiveScript, superClass);
function LiveScript() {
return LiveScript.__super__.constructor.apply(this, arguments);
}
LiveScript.prototype.name = 'LiveScript';
LiveScript.prototype.extensions = ['ls'];
LiveScript.prototype.output = 'js';
LiveScript.prototype.isolated = true;
LiveScript.prototype._render = function(str, options) {
return compile((function(_this) {
return function() {
return _this.engine.compile(str, options);
};
})(this));
};
compile = function(fn) {
var err, res;
try {
res = fn();
} catch (error) {
err = error;
return W.reject(err);
}
return W.resolve({
result: res
});
};
return LiveScript;
})(Adapter);
module.exports = LiveScript;
}).call(this);

View File

@ -0,0 +1,5 @@
// Generated by CoffeeScript 1.12.1
(function() {
module.exports = require('./1.x');
}).call(this);

View File

@ -0,0 +1,74 @@
// Generated by CoffeeScript 1.12.1
(function() {
var Adapter, Babel, W, path, sourcemaps,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
Adapter = require('../../adapter_base');
path = require('path');
W = require('when');
sourcemaps = require('../../sourcemaps');
Babel = (function(superClass) {
var compile;
extend(Babel, superClass);
function Babel() {
return Babel.__super__.constructor.apply(this, arguments);
}
Babel.prototype.name = 'babel';
Babel.prototype.extensions = ['jsx', 'js'];
Babel.prototype.output = 'js';
Babel.prototype.isolated = true;
Babel.prototype._render = function(str, options) {
var filename;
filename = options.filename;
if (options.sourcemap === true) {
options.sourceMap = true;
}
options.sourceMapName = filename;
delete options.sourcemap;
return compile((function(_this) {
return function() {
return _this.engine.transform(str, options);
};
})(this));
};
compile = function(fn) {
var data, err, res;
try {
res = fn();
} catch (error) {
err = error;
return W.reject(err);
}
data = {
result: res.code
};
if (res.map) {
return sourcemaps.inline_sources(res.map).then(function(map) {
data.sourcemap = map;
return data;
});
} else {
return W.resolve(data);
}
};
return Babel;
})(Adapter);
module.exports = Babel;
}).call(this);

View File

@ -0,0 +1,86 @@
// Generated by CoffeeScript 1.12.1
(function() {
var Adapter, Babel, W, path, pick, sourcemaps,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
path = require('path');
W = require('when');
pick = require('lodash.pick');
Adapter = require('../../adapter_base');
sourcemaps = require('../../sourcemaps');
Babel = (function(superClass) {
var compile;
extend(Babel, superClass);
function Babel() {
return Babel.__super__.constructor.apply(this, arguments);
}
Babel.prototype.name = 'babel';
Babel.prototype.extensions = ['js', 'jsx'];
Babel.prototype.output = 'js';
Babel.prototype.isolated = true;
Babel.prototype.supportedEngines = ['babel-core'];
Babel.prototype._render = function(str, options) {
var allowed_keys, filename, sanitized_options;
filename = options.filename;
if (options.sourcemap === true) {
options.sourceMaps = true;
}
options.sourceFileName = filename;
delete options.sourcemap;
allowed_keys = ['filename', 'filenameRelative', 'presets', 'plugins', 'highlightCode', 'only', 'ignore', 'auxiliaryCommentBefore', 'auxiliaryCommentAfter', 'sourceMaps', 'inputSourceMap', 'sourceMapTarget', 'sourceRoot', 'moduleRoot', 'moduleIds', 'moduleId', 'getModuleId', 'resolveModuleSource', 'code', 'babelrc', 'ast', 'compact', 'comments', 'shouldPrintComment', 'env', 'retainLines', 'extends'];
sanitized_options = pick(options, allowed_keys);
return compile((function(_this) {
return function() {
return _this.engine.transform(str, sanitized_options);
};
})(this));
};
compile = function(fn) {
var data, dirname, err, res;
try {
res = fn();
} catch (error) {
err = error;
return W.reject(err);
}
data = {
result: res.code
};
if (res.map) {
if (res.map.sources) {
dirname = path.dirname(res.options.filename);
res.map.sources = res.map.sources.map(function(source) {
return path.join(dirname, source);
});
}
return sourcemaps.inline_sources(res.map).then(function(map) {
data.sourcemap = map;
return data;
});
} else {
return W.resolve(data);
}
};
return Babel;
})(Adapter);
module.exports = Babel;
}).call(this);

View File

@ -0,0 +1,5 @@
// Generated by CoffeeScript 1.12.1
(function() {
module.exports = require('./6.x');
}).call(this);

View File

@ -0,0 +1,68 @@
// Generated by CoffeeScript 1.12.1
(function() {
var Adapter, Buble, W, path, sourcemaps,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
Adapter = require('../../adapter_base');
path = require('path');
W = require('when');
sourcemaps = require('../../sourcemaps');
Buble = (function(superClass) {
var compile;
extend(Buble, superClass);
function Buble() {
return Buble.__super__.constructor.apply(this, arguments);
}
Buble.prototype.name = 'buble';
Buble.prototype.extensions = ['js'];
Buble.prototype.output = 'js';
Buble.prototype.isolated = true;
Buble.prototype._render = function(str, options) {
options.source = options.filename;
return compile((function(_this) {
return function() {
return _this.engine.transform(str, options);
};
})(this));
};
compile = function(fn) {
var data, err, res;
try {
res = fn();
} catch (error) {
err = error;
return W.reject(err);
}
data = {
result: res.code
};
if (res.map) {
return sourcemaps.inline_sources(res.map).then(function(map) {
data.sourcemap = map;
return data;
});
} else {
return W.resolve(data);
}
};
return Buble;
})(Adapter);
module.exports = Buble;
}).call(this);

View File

@ -0,0 +1,5 @@
// Generated by CoffeeScript 1.12.1
(function() {
module.exports = require('./0.8.x - 0.14.x');
}).call(this);

View File

@ -0,0 +1,63 @@
// Generated by CoffeeScript 1.12.1
(function() {
var Adapter, CJSX, W, path, sourcemaps,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
Adapter = require('../../adapter_base');
sourcemaps = require('../../sourcemaps');
path = require('path');
W = require('when');
CJSX = (function(superClass) {
var compile;
extend(CJSX, superClass);
function CJSX() {
return CJSX.__super__.constructor.apply(this, arguments);
}
CJSX.prototype.name = 'cjsx';
CJSX.prototype.extensions = ['cjsx'];
CJSX.prototype.output = 'coffee';
CJSX.prototype.supportedEngines = ['coffee-react-transform'];
CJSX.prototype.isolated = true;
CJSX.prototype._render = function(str, options) {
var filename;
filename = options.filename;
return compile((function(_this) {
return function() {
return _this.engine(str);
};
})(this));
};
compile = function(fn) {
var err, res;
try {
res = fn();
} catch (error) {
err = error;
return W.reject(err);
}
return W.resolve({
result: res
});
};
return CJSX;
})(Adapter);
module.exports = CJSX;
}).call(this);

View File

@ -0,0 +1,63 @@
// Generated by CoffeeScript 1.12.1
(function() {
var Adapter, CJSX, W, path, sourcemaps,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
Adapter = require('../../adapter_base');
sourcemaps = require('../../sourcemaps');
path = require('path');
W = require('when');
CJSX = (function(superClass) {
var compile;
extend(CJSX, superClass);
function CJSX() {
return CJSX.__super__.constructor.apply(this, arguments);
}
CJSX.prototype.name = 'cjsx';
CJSX.prototype.extensions = ['cjsx'];
CJSX.prototype.output = 'coffee';
CJSX.prototype.supportedEngines = ['coffee-react-transform'];
CJSX.prototype.isolated = true;
CJSX.prototype._render = function(str, options) {
var filename;
filename = options.filename;
return compile((function(_this) {
return function() {
return _this.engine(str);
};
})(this));
};
compile = function(fn) {
var err, res;
try {
res = fn();
} catch (error) {
err = error;
return W.reject(err);
}
return W.resolve({
result: res
});
};
return CJSX;
})(Adapter);
module.exports = CJSX;
}).call(this);

View File

@ -0,0 +1,5 @@
// Generated by CoffeeScript 1.12.1
(function() {
module.exports = require('./4.x - 5.x');
}).call(this);

View File

@ -0,0 +1,55 @@
// Generated by CoffeeScript 1.12.1
(function() {
var Adapter, Coco, W,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
Adapter = require('../../adapter_base');
W = require('when');
Coco = (function(superClass) {
var compile;
extend(Coco, superClass);
function Coco() {
return Coco.__super__.constructor.apply(this, arguments);
}
Coco.prototype.name = 'coco';
Coco.prototype.extensions = ['co'];
Coco.prototype.output = 'js';
Coco.prototype.isolated = true;
Coco.prototype._render = function(str, options) {
return compile((function(_this) {
return function() {
return _this.engine.compile(str, options);
};
})(this));
};
compile = function(fn) {
var err, res;
try {
res = fn();
} catch (error) {
err = error;
return W.reject(err);
}
return W.resolve({
result: res
});
};
return Coco;
})(Adapter);
module.exports = Coco;
}).call(this);

View File

@ -0,0 +1,5 @@
// Generated by CoffeeScript 1.12.1
(function() {
module.exports = require('./0.9.x');
}).call(this);

View File

@ -0,0 +1,80 @@
// Generated by CoffeeScript 1.12.1
(function() {
var Adapter, CoffeeScript, W, path, sourcemaps,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
Adapter = require('../../adapter_base');
sourcemaps = require('../../sourcemaps');
path = require('path');
W = require('when');
CoffeeScript = (function(superClass) {
var compile;
extend(CoffeeScript, superClass);
function CoffeeScript() {
return CoffeeScript.__super__.constructor.apply(this, arguments);
}
CoffeeScript.prototype.name = 'coffee-script';
CoffeeScript.prototype.extensions = ['coffee'];
CoffeeScript.prototype.output = 'js';
CoffeeScript.prototype.isolated = true;
CoffeeScript.prototype._render = function(str, options) {
var filename;
filename = options.filename;
if (options.sourcemap === true) {
options.sourceMap = true;
}
options.sourceFiles = [filename];
if (options.filename) {
options.generatedFile = path.basename(filename).replace('.coffee', '.js');
}
return compile((function(_this) {
return function() {
return _this.engine.compile(str, options);
};
})(this));
};
compile = function(fn) {
var data, err, res;
try {
res = fn();
} catch (error) {
err = error;
return W.reject(err);
}
if (res.sourceMap) {
data = {
result: res.js,
v2sourcemap: res.sourceMap,
sourcemap: JSON.parse(res.v3SourceMap)
};
return sourcemaps.inline_sources(data.sourcemap).then(function(map) {
data.sourcemap = map;
return data;
});
} else {
return W.resolve({
result: res
});
}
};
return CoffeeScript;
})(Adapter);
module.exports = CoffeeScript;
}).call(this);

View File

@ -0,0 +1,5 @@
// Generated by CoffeeScript 1.12.1
(function() {
module.exports = require('./1.x');
}).call(this);

View File

@ -0,0 +1,58 @@
// Generated by CoffeeScript 1.12.1
(function() {
var Adapter, CSSO, W,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
Adapter = require('../../adapter_base');
W = require('when');
CSSO = (function(superClass) {
var compile;
extend(CSSO, superClass);
function CSSO() {
return CSSO.__super__.constructor.apply(this, arguments);
}
CSSO.prototype.name = 'csso';
CSSO.prototype.extensions = ['css'];
CSSO.prototype.output = 'css';
CSSO.prototype.isolated = true;
CSSO.prototype._render = function(str, options) {
if (options.noRestructure == null) {
options.noRestructure = false;
}
return compile((function(_this) {
return function() {
return _this.engine.justDoIt(str, options.noRestructure);
};
})(this));
};
compile = function(fn) {
var err, res;
try {
res = fn();
} catch (error) {
err = error;
return W.reject(err);
}
return W.resolve({
result: res
});
};
return CSSO;
})(Adapter);
module.exports = CSSO;
}).call(this);

View File

@ -0,0 +1,61 @@
// Generated by CoffeeScript 1.12.1
(function() {
var Adapter, CSSO, W,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
Adapter = require('../../adapter_base');
W = require('when');
CSSO = (function(superClass) {
var compile;
extend(CSSO, superClass);
function CSSO() {
return CSSO.__super__.constructor.apply(this, arguments);
}
CSSO.prototype.name = 'csso';
CSSO.prototype.extensions = ['css'];
CSSO.prototype.output = 'css';
CSSO.prototype.isolated = true;
CSSO.prototype._render = function(str, options) {
if (options.restructuring == null) {
options.restructuring = true;
}
if (options.debug == null) {
options.debug = false;
}
return compile((function(_this) {
return function() {
return _this.engine.minify(str, options).css;
};
})(this));
};
compile = function(fn) {
var err, res;
try {
res = fn();
} catch (error) {
err = error;
return W.reject(err);
}
return W.resolve({
result: res
});
};
return CSSO;
})(Adapter);
module.exports = CSSO;
}).call(this);

View File

@ -0,0 +1,61 @@
// Generated by CoffeeScript 1.12.1
(function() {
var Adapter, CSSO, W,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
Adapter = require('../../adapter_base');
W = require('when');
CSSO = (function(superClass) {
var compile;
extend(CSSO, superClass);
function CSSO() {
return CSSO.__super__.constructor.apply(this, arguments);
}
CSSO.prototype.name = 'csso';
CSSO.prototype.extensions = ['css'];
CSSO.prototype.output = 'css';
CSSO.prototype.isolated = true;
CSSO.prototype._render = function(str, options) {
if (options.restructuring == null) {
options.restructuring = true;
}
if (options.debug == null) {
options.debug = false;
}
return compile((function(_this) {
return function() {
return _this.engine.minify(str, options);
};
})(this));
};
compile = function(fn) {
var err, res;
try {
res = fn();
} catch (error) {
err = error;
return W.reject(err);
}
return W.resolve({
result: res
});
};
return CSSO;
})(Adapter);
module.exports = CSSO;
}).call(this);

View File

@ -0,0 +1,5 @@
// Generated by CoffeeScript 1.12.1
(function() {
module.exports = require('./2.x');
}).call(this);

View File

@ -0,0 +1,38 @@
// Generated by CoffeeScript 1.12.1
(function() {
var Adapter, DogeScript, W,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
Adapter = require('../../adapter_base');
W = require('when');
DogeScript = (function(superClass) {
extend(DogeScript, superClass);
function DogeScript() {
return DogeScript.__super__.constructor.apply(this, arguments);
}
DogeScript.prototype.name = 'dogescript';
DogeScript.prototype.extensions = ['djs'];
DogeScript.prototype.output = 'js';
DogeScript.prototype.isolated = true;
DogeScript.prototype._render = function(str, options) {
return W.resolve({
result: this.engine(str, options.beauty, options.trueDoge)
});
};
return DogeScript;
})(Adapter);
module.exports = DogeScript;
}).call(this);

View File

@ -0,0 +1,5 @@
// Generated by CoffeeScript 1.12.1
(function() {
module.exports = require('./2.x');
}).call(this);

View File

@ -0,0 +1,80 @@
// Generated by CoffeeScript 1.12.1
(function() {
var Adapter, Dot, W, fs, path,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
Adapter = require('../../adapter_base');
path = require('path');
fs = require('fs');
W = require('when');
Dot = (function(superClass) {
var compile;
extend(Dot, superClass);
function Dot() {
return Dot.__super__.constructor.apply(this, arguments);
}
Dot.prototype.name = 'dot';
Dot.prototype.extensions = ['dot'];
Dot.prototype.output = 'html';
Dot.prototype._render = function(str, options) {
return compile((function(_this) {
return function() {
return _this.engine.compile(str)(options);
};
})(this));
};
Dot.prototype._compile = function(str, options) {
return compile((function(_this) {
return function() {
return _this.engine.compile(str, options);
};
})(this));
};
Dot.prototype._compileClient = function(str, options) {
options.client = true;
return compile((function(_this) {
return function() {
return _this.engine.compile(str, options).toString();
};
})(this));
};
Dot.prototype.clientHelpers = function(str, options) {
var runtime_path;
runtime_path = path.join(this.engine.__accord_path, 'doT.min.js');
return fs.readFileSync(runtime_path, 'utf8');
};
compile = function(fn) {
var err, res;
try {
res = fn();
} catch (error) {
err = error;
return W.reject(err);
}
return W.resolve({
result: res
});
};
return Dot;
})(Adapter);
module.exports = Dot;
}).call(this);

View File

@ -0,0 +1,5 @@
// Generated by CoffeeScript 1.12.1
(function() {
module.exports = require('./1.x');
}).call(this);

View File

@ -0,0 +1,76 @@
// Generated by CoffeeScript 1.12.1
(function() {
var Adapter, Eco, W, fs, path,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
Adapter = require('../../adapter_base');
path = require('path');
fs = require('fs');
W = require('when');
Eco = (function(superClass) {
var compile;
extend(Eco, superClass);
function Eco() {
return Eco.__super__.constructor.apply(this, arguments);
}
Eco.prototype.name = 'eco';
Eco.prototype.extensions = ['eco'];
Eco.prototype.output = 'html';
Eco.prototype._render = function(str, options) {
return compile((function(_this) {
return function() {
return _this.engine.render(str, options);
};
})(this));
};
Eco.prototype._compile = function(str, options) {
return compile((function(_this) {
return function() {
return _this.engine.compile(str, options);
};
})(this)).then(function(res) {
res.result = eval(res.result);
return res;
});
};
Eco.prototype._compileClient = function(str, options) {
return compile((function(_this) {
return function() {
return _this.engine.compile(str, options).toString().trim() + '\n';
};
})(this));
};
compile = function(fn) {
var err, res;
try {
res = fn();
} catch (error) {
err = error;
return W.reject(err);
}
return W.resolve({
result: res
});
};
return Eco;
})(Adapter);
module.exports = Eco;
}).call(this);

View File

@ -0,0 +1,73 @@
// Generated by CoffeeScript 1.12.1
(function() {
var Adapter, Eco, W, fs, path,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
Adapter = require('../../adapter_base');
path = require('path');
fs = require('fs');
W = require('when');
Eco = (function(superClass) {
var compile;
extend(Eco, superClass);
function Eco() {
return Eco.__super__.constructor.apply(this, arguments);
}
Eco.prototype.name = 'eco';
Eco.prototype.extensions = ['eco'];
Eco.prototype.output = 'html';
Eco.prototype._render = function(str, options) {
return compile((function(_this) {
return function() {
return _this.engine.render(str, options);
};
})(this));
};
Eco.prototype._compile = function(str, options) {
return compile((function(_this) {
return function() {
return _this.engine.compile(str, options);
};
})(this));
};
Eco.prototype._compileClient = function(str, options) {
return compile((function(_this) {
return function() {
return _this.engine.compile(str, options).toString().trim() + '\n';
};
})(this));
};
compile = function(fn) {
var err, res;
try {
res = fn();
} catch (error) {
err = error;
return W.reject(err);
}
return W.resolve({
result: res
});
};
return Eco;
})(Adapter);
module.exports = Eco;
}).call(this);

View File

@ -0,0 +1,5 @@
// Generated by CoffeeScript 1.12.1
(function() {
module.exports = require('./1.x');
}).call(this);

View File

@ -0,0 +1,80 @@
// Generated by CoffeeScript 1.12.1
(function() {
var Adapter, EJS, W, fs, path,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
Adapter = require('../../adapter_base');
path = require('path');
fs = require('fs');
W = require('when');
EJS = (function(superClass) {
var compile;
extend(EJS, superClass);
function EJS() {
return EJS.__super__.constructor.apply(this, arguments);
}
EJS.prototype.name = 'ejs';
EJS.prototype.extensions = ['ejs'];
EJS.prototype.output = 'html';
EJS.prototype._render = function(str, options) {
return compile((function(_this) {
return function() {
return _this.engine.render(str, options);
};
})(this));
};
EJS.prototype._compile = function(str, options) {
return compile((function(_this) {
return function() {
return _this.engine.compile(str, options);
};
})(this));
};
EJS.prototype._compileClient = function(str, options) {
options.client = true;
return compile((function(_this) {
return function() {
return _this.engine.compile(str, options).toString();
};
})(this));
};
EJS.prototype.clientHelpers = function(str, options) {
var runtime_path;
runtime_path = path.join(this.engine.__accord_path, 'ejs.min.js');
return fs.readFileSync(runtime_path, 'utf8');
};
compile = function(fn) {
var err, res;
try {
res = fn();
} catch (error) {
err = error;
return W.reject(err);
}
return W.resolve({
result: res
});
};
return EJS;
})(Adapter);
module.exports = EJS;
}).call(this);

View File

@ -0,0 +1,5 @@
// Generated by CoffeeScript 1.12.1
(function() {
module.exports = require('./2.x');
}).call(this);

View File

@ -0,0 +1,62 @@
// Generated by CoffeeScript 1.12.1
(function() {
var Adapter, EscapeHTML, W, defaults,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
Adapter = require('../../adapter_base');
W = require('when');
defaults = require('lodash.defaults');
EscapeHTML = (function(superClass) {
var compile;
extend(EscapeHTML, superClass);
function EscapeHTML() {
return EscapeHTML.__super__.constructor.apply(this, arguments);
}
EscapeHTML.prototype.name = 'escape-html';
EscapeHTML.prototype.extensions = ['html'];
EscapeHTML.prototype.output = 'html';
EscapeHTML.prototype.supportedEngines = ['he'];
EscapeHTML.prototype.isolated = true;
EscapeHTML.prototype._render = function(str, options) {
options = defaults(options, {
allowUnsafeSymbols: true
});
return compile((function(_this) {
return function() {
return _this.engine.encode(str, options);
};
})(this));
};
compile = function(fn) {
var err, res;
try {
res = fn();
} catch (error) {
err = error;
return W.reject(err);
}
return W.resolve({
result: res
});
};
return EscapeHTML;
})(Adapter);
module.exports = EscapeHTML;
}).call(this);

View File

@ -0,0 +1,62 @@
// Generated by CoffeeScript 1.12.1
(function() {
var Adapter, EscapeHTML, W, defaults,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
Adapter = require('../../adapter_base');
W = require('when');
defaults = require('lodash.defaults');
EscapeHTML = (function(superClass) {
var compile;
extend(EscapeHTML, superClass);
function EscapeHTML() {
return EscapeHTML.__super__.constructor.apply(this, arguments);
}
EscapeHTML.prototype.name = 'escape-html';
EscapeHTML.prototype.extensions = ['html'];
EscapeHTML.prototype.output = 'html';
EscapeHTML.prototype.supportedEngines = ['he'];
EscapeHTML.prototype.isolated = true;
EscapeHTML.prototype._render = function(str, options) {
options = defaults(options, {
allowUnsafeSymbols: true
});
return compile((function(_this) {
return function() {
return _this.engine.encode(str, options);
};
})(this));
};
compile = function(fn) {
var err, res;
try {
res = fn();
} catch (error) {
err = error;
return W.reject(err);
}
return W.resolve({
result: res
});
};
return EscapeHTML;
})(Adapter);
module.exports = EscapeHTML;
}).call(this);

View File

@ -0,0 +1,5 @@
// Generated by CoffeeScript 1.12.1
(function() {
module.exports = require('./1.x');
}).call(this);

View File

@ -0,0 +1,69 @@
// Generated by CoffeeScript 1.12.1
(function() {
var Adapter, HAML, UglifyJS, W, fs, path,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
Adapter = require('../../adapter_base');
path = require('path');
fs = require('fs');
W = require('when');
UglifyJS = require('uglify-js');
HAML = (function(superClass) {
var compile;
extend(HAML, superClass);
function HAML() {
return HAML.__super__.constructor.apply(this, arguments);
}
HAML.prototype.name = 'haml';
HAML.prototype.extensions = ['haml'];
HAML.prototype.output = 'html';
HAML.prototype.supportedEngines = ['hamljs'];
HAML.prototype._render = function(str, options) {
return compile((function(_this) {
return function() {
return _this.engine.compile(str)(options);
};
})(this));
};
HAML.prototype._compile = function(str, options) {
return compile((function(_this) {
return function() {
return _this.engine.compile(str, options);
};
})(this));
};
compile = function(fn) {
var err, res;
try {
res = fn();
} catch (error) {
err = error;
return W.reject(err);
}
return W.resolve({
result: res
});
};
return HAML;
})(Adapter);
module.exports = HAML;
}).call(this);

View File

@ -0,0 +1,5 @@
// Generated by CoffeeScript 1.12.1
(function() {
module.exports = require('./0.6.x');
}).call(this);

View File

@ -0,0 +1,106 @@
// Generated by CoffeeScript 1.12.1
(function() {
var Adapter, Handlebars, W, clone, fs, merge, path,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
Adapter = require('../../adapter_base');
clone = require('lodash.clone');
merge = require('lodash.merge');
path = require('path');
fs = require('fs');
W = require('when');
Handlebars = (function(superClass) {
var compile, register_helpers;
extend(Handlebars, superClass);
function Handlebars() {
return Handlebars.__super__.constructor.apply(this, arguments);
}
Handlebars.prototype.name = 'handlebars';
Handlebars.prototype.extensions = ['hbs', 'handlebars'];
Handlebars.prototype.output = 'html';
Handlebars.prototype._render = function(str, options) {
var compiler;
compiler = clone(this.engine);
register_helpers(compiler, options);
return compile((function(_this) {
return function() {
return compiler.compile(str)(options);
};
})(this));
};
Handlebars.prototype._compile = function(str, options) {
var compiler;
compiler = clone(this.engine);
register_helpers(compiler, options);
return compile((function(_this) {
return function() {
return compiler.compile(str);
};
})(this));
};
Handlebars.prototype._compileClient = function(str, options) {
var compiler;
compiler = clone(this.engine);
register_helpers(compiler, options);
return compile((function(_this) {
return function() {
return "Handlebars.template(" + (compiler.precompile(str)) + ");";
};
})(this));
};
Handlebars.prototype.clientHelpers = function() {
var runtime_path;
runtime_path = path.join(this.engine.__accord_path, 'dist/handlebars.runtime.min.js');
return fs.readFileSync(runtime_path, 'utf8');
};
/**
* @private
*/
register_helpers = function(compiler, opts) {
if (opts.helpers) {
compiler.helpers = merge(compiler.helpers, opts.helpers);
}
if (opts.partials) {
return compiler.partials = merge(compiler.partials, opts.partials);
}
};
compile = function(fn) {
var err, res;
try {
res = fn();
} catch (error) {
err = error;
return W.reject(err);
}
return W.resolve({
result: res
});
};
return Handlebars;
})(Adapter);
module.exports = Handlebars;
}).call(this);

View File

@ -0,0 +1,5 @@
// Generated by CoffeeScript 1.12.1
(function() {
module.exports = require('./3.x - 4.x');
}).call(this);

View File

@ -0,0 +1,86 @@
// Generated by CoffeeScript 1.12.1
(function() {
var Adapter, Jade, UglifyJS, W, fs, path,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
Adapter = require('../../adapter_base');
path = require('path');
fs = require('fs');
W = require('when');
UglifyJS = require('uglify-js');
Jade = (function(superClass) {
var compile;
extend(Jade, superClass);
function Jade() {
return Jade.__super__.constructor.apply(this, arguments);
}
Jade.prototype.name = 'jade';
Jade.prototype.extensions = ['jade'];
Jade.prototype.output = 'html';
Jade.prototype.supportedEngines = ['jade'];
Jade.prototype._render = function(str, options) {
return compile((function(_this) {
return function() {
return _this.engine.render(str, options);
};
})(this));
};
Jade.prototype._compile = function(str, options) {
return compile((function(_this) {
return function() {
return _this.engine.compile(str, options);
};
})(this));
};
Jade.prototype._compileClient = function(str, options) {
return compile((function(_this) {
return function() {
return _this.engine.compileClient(str, options);
};
})(this));
};
Jade.prototype.clientHelpers = function() {
var runtime, runtime_path;
runtime_path = path.join(this.engine.__accord_path, 'runtime.js');
runtime = fs.readFileSync(runtime_path, 'utf8');
return UglifyJS.minify(runtime, {
fromString: true
}).code;
};
compile = function(fn) {
var err, res;
try {
res = fn();
} catch (error) {
err = error;
return W.reject(err);
}
return W.resolve({
result: res
});
};
return Jade;
})(Adapter);
module.exports = Jade;
}).call(this);

View File

@ -0,0 +1,5 @@
// Generated by CoffeeScript 1.12.1
(function() {
module.exports = require('./1.x');
}).call(this);

View File

@ -0,0 +1,78 @@
// Generated by CoffeeScript 1.12.1
(function() {
var Adapter, JSX, W, path, sourcemaps,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
Adapter = require('../../adapter_base');
sourcemaps = require('../../sourcemaps');
path = require('path');
W = require('when');
JSX = (function(superClass) {
var compile;
extend(JSX, superClass);
function JSX() {
return JSX.__super__.constructor.apply(this, arguments);
}
JSX.prototype.name = 'jsx';
JSX.prototype.extensions = ['jsx'];
JSX.prototype.output = 'js';
JSX.prototype.supportedEngines = ['react-tools'];
JSX.prototype.isolated = true;
JSX.prototype._render = function(str, options) {
if (options.sourcemap === true) {
options.sourceMap = true;
options.sourceFilename = options.filename;
}
return compile(options, (function(_this) {
return function() {
return _this.engine.transformWithDetails(str, options);
};
})(this));
};
compile = function(opts, fn) {
var data, err, res;
try {
res = fn();
} catch (error) {
err = error;
return W.reject(err);
}
if (res.sourceMap) {
data = {
result: res.code,
sourcemap: res.sourceMap
};
data.sourcemap.sources.pop();
data.sourcemap.sources.push(opts.filename);
return sourcemaps.inline_sources(data.sourcemap).then(function(map) {
data.sourcemap = map;
return data;
});
} else {
return W.resolve({
result: res.code
});
}
};
return JSX;
})(Adapter);
module.exports = JSX;
}).call(this);

View File

@ -0,0 +1,5 @@
// Generated by CoffeeScript 1.12.1
(function() {
module.exports = require('./0.13.x');
}).call(this);

View File

@ -0,0 +1,67 @@
// Generated by CoffeeScript 1.12.1
(function() {
var Adapter, Less, W, sourcemaps,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
Adapter = require('../../adapter_base');
sourcemaps = require('../../sourcemaps');
W = require('when');
Less = (function(superClass) {
extend(Less, superClass);
function Less() {
return Less.__super__.constructor.apply(this, arguments);
}
Less.prototype.name = 'less';
Less.prototype.extensions = ['less'];
Less.prototype.output = 'css';
/**
* LESS has import rules for other LESS stylesheets
*/
Less.prototype.isolated = false;
Less.prototype._render = function(str, options) {
var deferred;
deferred = W.defer();
if (options.sourcemap === true) {
options.sourceMap = true;
}
this.engine.render(str, options, function(err, res) {
var obj;
if (err) {
return deferred.reject(err);
}
obj = {
result: res.css,
imports: res.imports
};
if (options.sourceMap && res.map) {
obj.sourcemap = JSON.parse(res.map);
return sourcemaps.inline_sources(obj.sourcemap).then(function(map) {
obj.sourcemap = map;
return deferred.resolve(obj);
});
} else {
return deferred.resolve(obj);
}
});
return deferred.promise;
};
return Less;
})(Adapter);
module.exports = Less;
}).call(this);

View File

@ -0,0 +1,5 @@
// Generated by CoffeeScript 1.12.1
(function() {
module.exports = require('./2.x');
}).call(this);

View File

@ -0,0 +1,57 @@
// Generated by CoffeeScript 1.12.1
(function() {
var Adapter, Marc, W,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
Adapter = require('../../adapter_base');
W = require('when');
Marc = (function(superClass) {
extend(Marc, superClass);
function Marc() {
return Marc.__super__.constructor.apply(this, arguments);
}
Marc.prototype.name = 'marc';
Marc.prototype.extensions = ['md'];
Marc.prototype.output = 'html';
Marc.prototype._render = function(str, options) {
var base, k, ref, ref1, ref2, v;
base = this.engine();
ref = options['data'];
for (k in ref) {
v = ref[k];
base.set(k, v);
}
delete options['data'];
ref1 = options['partial'];
for (k in ref1) {
v = ref1[k];
base.partial(k, v);
}
delete options['partial'];
ref2 = options['filter'];
for (k in ref2) {
v = ref2[k];
base.filter(k, v);
}
delete options['filter'];
base.config(options);
return W.resolve({
result: base(str, true)
});
};
return Marc;
})(Adapter);
module.exports = Marc;
}).call(this);

View File

@ -0,0 +1,5 @@
// Generated by CoffeeScript 1.12.1
(function() {
module.exports = require('./0.1.x');
}).call(this);

View File

@ -0,0 +1,42 @@
// Generated by CoffeeScript 1.12.1
(function() {
var Adapter, Markdown, nodefn,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
Adapter = require('../../adapter_base');
nodefn = require('when/node/function');
Markdown = (function(superClass) {
extend(Markdown, superClass);
function Markdown() {
return Markdown.__super__.constructor.apply(this, arguments);
}
Markdown.prototype.name = 'markdown';
Markdown.prototype.extensions = ['md', 'mdown', 'markdown'];
Markdown.prototype.output = 'html';
Markdown.prototype.supportedEngines = ['marked'];
Markdown.prototype.isolated = true;
Markdown.prototype._render = function(str, options) {
return nodefn.call(this.engine.bind(this.engine), str, options).then(function(res) {
return {
result: res
};
});
};
return Markdown;
})(Adapter);
module.exports = Markdown;
}).call(this);

View File

@ -0,0 +1,5 @@
// Generated by CoffeeScript 1.12.1
(function() {
module.exports = require('./0.3.x');
}).call(this);

View File

@ -0,0 +1,68 @@
// Generated by CoffeeScript 1.12.1
(function() {
var Adapter, MinifyCSS, W,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
Adapter = require('../../adapter_base');
W = require('when');
MinifyCSS = (function(superClass) {
var compile;
extend(MinifyCSS, superClass);
function MinifyCSS() {
return MinifyCSS.__super__.constructor.apply(this, arguments);
}
MinifyCSS.prototype.name = 'minify-css';
MinifyCSS.prototype.extensions = ['css'];
MinifyCSS.prototype.output = 'css';
MinifyCSS.prototype.supportedEngines = ['clean-css'];
/**
* It is sometimes isolated, but not always because you can get it to process
`import` rules with `processImport`
*/
MinifyCSS.prototype.isolated = false;
MinifyCSS.prototype._render = function(str, options) {
return compile((function(_this) {
return function() {
return (new _this.engine(options)).minify(str);
};
})(this));
};
compile = function(fn) {
var err, res;
try {
res = fn();
} catch (error) {
err = error;
return W.reject(err);
}
if (res.errors.length > 0) {
W.reject(res);
}
return W.resolve({
result: res.styles,
warnings: res.warnings,
stats: res.stats
});
};
return MinifyCSS;
})(Adapter);
module.exports = MinifyCSS;
}).call(this);

View File

@ -0,0 +1,5 @@
// Generated by CoffeeScript 1.12.1
(function() {
module.exports = require('./3.x');
}).call(this);

View File

@ -0,0 +1,71 @@
// Generated by CoffeeScript 1.12.1
(function() {
var Adapter, MinifyHTML, W, defaults,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
Adapter = require('../../adapter_base');
W = require('when');
defaults = require('lodash.defaults');
MinifyHTML = (function(superClass) {
var compile;
extend(MinifyHTML, superClass);
function MinifyHTML() {
return MinifyHTML.__super__.constructor.apply(this, arguments);
}
MinifyHTML.prototype.name = 'minify-html';
MinifyHTML.prototype.extensions = ['html'];
MinifyHTML.prototype.output = 'html';
MinifyHTML.prototype.supportedEngines = ['html-minifier'];
/**
* I think that you could cause this to not be isolated by using the minifyCSS
option and then making that import stylesheets, but I'm not even sure if
MinifyHTML would support that...
*/
MinifyHTML.prototype.isolated = true;
MinifyHTML.prototype._render = function(str, options) {
options = defaults(options, {
removeComments: true,
collapseWhitespace: true,
removeEmptyAttributes: true
});
return compile((function(_this) {
return function() {
return _this.engine.minify(str, options);
};
})(this));
};
compile = function(fn) {
var err, res;
try {
res = fn();
} catch (error) {
err = error;
return W.reject(err);
}
return W.resolve({
result: res
});
};
return MinifyHTML;
})(Adapter);
module.exports = MinifyHTML;
}).call(this);

View File

@ -0,0 +1,71 @@
// Generated by CoffeeScript 1.12.1
(function() {
var Adapter, MinifyHTML, W, defaults,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
Adapter = require('../../adapter_base');
W = require('when');
defaults = require('lodash.defaults');
MinifyHTML = (function(superClass) {
var compile;
extend(MinifyHTML, superClass);
function MinifyHTML() {
return MinifyHTML.__super__.constructor.apply(this, arguments);
}
MinifyHTML.prototype.name = 'minify-html';
MinifyHTML.prototype.extensions = ['html'];
MinifyHTML.prototype.output = 'html';
MinifyHTML.prototype.supportedEngines = ['html-minifier'];
/**
* I think that you could cause this to not be isolated by using the minifyCSS
option and then making that import stylesheets, but I'm not even sure if
MinifyHTML would support that...
*/
MinifyHTML.prototype.isolated = true;
MinifyHTML.prototype._render = function(str, options) {
options = defaults(options, {
removeComments: true,
collapseWhitespace: true,
removeEmptyAttributes: true
});
return compile((function(_this) {
return function() {
return _this.engine.minify(str, options);
};
})(this));
};
compile = function(fn) {
var err, res;
try {
res = fn();
} catch (error) {
err = error;
return W.reject(err);
}
return W.resolve({
result: res
});
};
return MinifyHTML;
})(Adapter);
module.exports = MinifyHTML;
}).call(this);

View File

@ -0,0 +1,5 @@
// Generated by CoffeeScript 1.12.1
(function() {
module.exports = require('./2.x - 3.x');
}).call(this);

View File

@ -0,0 +1,83 @@
// Generated by CoffeeScript 1.12.1
(function() {
var Adapter, MinifyJS, W, convert, path, sourcemaps,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
Adapter = require('../../adapter_base');
sourcemaps = require('../../sourcemaps');
W = require('when');
path = require('path');
convert = require('convert-source-map');
MinifyJS = (function(superClass) {
var compile;
extend(MinifyJS, superClass);
function MinifyJS() {
return MinifyJS.__super__.constructor.apply(this, arguments);
}
MinifyJS.prototype.name = 'minify-js';
MinifyJS.prototype.extensions = ['js'];
MinifyJS.prototype.output = 'js';
MinifyJS.prototype.supportedEngines = ['uglify-js'];
MinifyJS.prototype.isolated = true;
MinifyJS.prototype._render = function(str, options) {
if (options.sourcemap === true) {
options.sourceMap = true;
options.outSourceMap = path.basename(options.filename);
}
return compile((function(_this) {
return function() {
var obj, res;
res = _this.engine.minify(str, Object.assign(options, {
fromString: true
}));
obj = {
result: res.code
};
if (options.sourceMap) {
obj.sourcemap = JSON.parse(res.map);
obj.sourcemap.sources.pop();
obj.sourcemap.sources.push(options.filename);
obj.result = convert.removeMapFileComments(obj.result).trim();
return sourcemaps.inline_sources(obj.sourcemap).then(function(map) {
obj.sourcemap = map;
return obj;
});
} else {
return obj;
}
};
})(this));
};
compile = function(fn, map) {
var err, res;
try {
res = fn();
} catch (error) {
err = error;
return W.reject(err);
}
return W.resolve(res);
};
return MinifyJS;
})(Adapter);
module.exports = MinifyJS;
}).call(this);

View File

@ -0,0 +1,5 @@
// Generated by CoffeeScript 1.12.1
(function() {
module.exports = require('./2.x');
}).call(this);

View File

@ -0,0 +1,85 @@
// Generated by CoffeeScript 1.12.1
(function() {
var Adapter, Mustache, W, fs, path, util,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
Adapter = require('../../adapter_base');
W = require('when');
util = require('util');
fs = require('fs');
path = require('path');
Mustache = (function(superClass) {
var compile;
extend(Mustache, superClass);
function Mustache() {
return Mustache.__super__.constructor.apply(this, arguments);
}
Mustache.prototype.name = 'mustache';
Mustache.prototype.extensions = ['mustache', 'hogan'];
Mustache.prototype.output = 'html';
Mustache.prototype.supportedEngines = ['hogan.js'];
Mustache.prototype._render = function(str, options) {
return compile((function(_this) {
return function() {
return _this.engine.compile(str, options).render(options, options.partials);
};
})(this));
};
Mustache.prototype._compile = function(str, options) {
return compile((function(_this) {
return function() {
return _this.engine.compile(str, options);
};
})(this));
};
Mustache.prototype._compileClient = function(str, options) {
options.asString = true;
return this._compile(str, options).then(function(o) {
return {
result: "new Hogan.Template(" + (o.result.toString()) + ");"
};
});
};
Mustache.prototype.clientHelpers = function() {
var runtime_path, version;
version = require(path.join(this.engine.__accord_path, 'package')).version;
runtime_path = path.join(this.engine.__accord_path, "web/builds/" + version + "/hogan-" + version + ".min.js");
return fs.readFileSync(runtime_path, 'utf8');
};
compile = function(fn) {
var err, res;
try {
res = fn();
} catch (error) {
err = error;
return W.reject(err);
}
return W.resolve({
result: res
});
};
return Mustache;
})(Adapter);
module.exports = Mustache;
}).call(this);

View File

@ -0,0 +1,5 @@
// Generated by CoffeeScript 1.12.1
(function() {
module.exports = require('./3.x');
}).call(this);

View File

@ -0,0 +1,66 @@
// Generated by CoffeeScript 1.12.1
(function() {
var Adapter, Myth, W, convert,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
Adapter = require('../../adapter_base');
convert = require('convert-source-map');
W = require('when');
Myth = (function(superClass) {
var compile;
extend(Myth, superClass);
function Myth() {
return Myth.__super__.constructor.apply(this, arguments);
}
Myth.prototype.name = 'myth';
Myth.prototype.extensions = ['myth', 'mcss'];
Myth.prototype.output = 'css';
Myth.prototype._render = function(str, options) {
options.source = options.filename;
delete options.filename;
return compile(options.sourcemap, ((function(_this) {
return function() {
return _this.engine(str, options);
};
})(this)));
};
compile = function(sourcemap, fn) {
var data, err, map, res, src;
try {
res = fn();
} catch (error) {
err = error;
return W.reject(err);
}
data = {
result: res
};
if (sourcemap) {
map = convert.fromSource(res).sourcemap;
src = convert.removeComments(res);
data = {
result: src,
sourcemap: map
};
}
return W.resolve(data);
};
return Myth;
})(Adapter);
module.exports = Myth;
}).call(this);

View File

@ -0,0 +1,5 @@
// Generated by CoffeeScript 1.12.1
(function() {
module.exports = require('./1.x');
}).call(this);

View File

@ -0,0 +1,64 @@
// Generated by CoffeeScript 1.12.1
(function() {
var Adapter, PostCSS, W, convert, path, sourcemaps,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
Adapter = require('../../adapter_base');
sourcemaps = require('../../sourcemaps');
W = require('when');
path = require('path');
convert = require('convert-source-map');
PostCSS = (function(superClass) {
extend(PostCSS, superClass);
function PostCSS() {
return PostCSS.__super__.constructor.apply(this, arguments);
}
PostCSS.prototype.name = 'postcss';
PostCSS.prototype.extensions = ['css', 'pcss', 'sss'];
PostCSS.prototype.output = 'css';
PostCSS.prototype._render = function(str, options) {
var processor, ref, use;
use = (ref = options.use) != null ? ref : [];
processor = this.engine(use);
if (options.map === true) {
options.map = {
inline: false
};
options.from = options.filename;
}
return W(processor.process(str, options)).then(function(res) {
var obj;
obj = {
result: res.css
};
if (options.map) {
obj.sourcemap = JSON.parse(res.map);
obj.result = convert.removeMapFileComments(obj.result).trim();
return sourcemaps.inline_sources(obj.sourcemap).then(function(map) {
obj.sourcemap = map;
return obj;
});
} else {
return obj;
}
});
};
return PostCSS;
})(Adapter);
module.exports = PostCSS;
}).call(this);

View File

@ -0,0 +1,5 @@
// Generated by CoffeeScript 1.12.1
(function() {
module.exports = require('./4.x - 5.x');
}).call(this);

View File

@ -0,0 +1,71 @@
// Generated by CoffeeScript 1.12.1
(function() {
var Adapter, SCSS, W, path,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
Adapter = require('../../adapter_base');
W = require('when');
path = require('path');
SCSS = (function(superClass) {
extend(SCSS, superClass);
function SCSS() {
return SCSS.__super__.constructor.apply(this, arguments);
}
SCSS.prototype.name = 'scss';
SCSS.prototype.extensions = ['scss', 'sass'];
SCSS.prototype.output = 'css';
SCSS.prototype.supportedEngines = ['node-sass'];
SCSS.prototype._render = function(str, options) {
var deferred;
deferred = W.defer();
if (options.sourcemap === true) {
options.sourceMap = true;
options.outFile = path.basename(options.filename).replace('.scss', '.css');
options.omitSourceMapUrl = true;
options.sourceMapContents = true;
}
options.file = options.filename;
options.data = str;
options.error = function(err) {
return deferred.reject(err);
};
options.success = function(res) {
var data;
data = {
result: String(res.css),
imports: res.stats.includedFiles,
meta: {
entry: res.stats.entry,
start: res.stats.start,
end: res.stats.end,
duration: res.stats.duration
}
};
if (res.map && Object.keys(JSON.parse(res.map)).length) {
data.sourcemap = JSON.parse(res.map);
data.sourcemap.sources.pop();
data.sourcemap.sources.push(options.file);
}
return deferred.resolve(data);
};
this.engine.render(options);
return deferred.promise;
};
return SCSS;
})(Adapter);
module.exports = SCSS;
}).call(this);

View File

@ -0,0 +1,72 @@
// Generated by CoffeeScript 1.12.1
(function() {
var Adapter, SCSS, W, path,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
Adapter = require('../../adapter_base');
W = require('when');
path = require('path');
SCSS = (function(superClass) {
extend(SCSS, superClass);
function SCSS() {
return SCSS.__super__.constructor.apply(this, arguments);
}
SCSS.prototype.name = 'scss';
SCSS.prototype.extensions = ['scss', 'sass'];
SCSS.prototype.output = 'css';
SCSS.prototype.supportedEngines = ['node-sass'];
SCSS.prototype._render = function(str, options) {
var deferred;
deferred = W.defer();
if (options.sourcemap === true) {
options.sourceMap = true;
options.outFile = options.filename.replace('.scss', '.css');
options.omitSourceMapUrl = true;
options.sourceMapContents = true;
}
options.file = options.filename;
options.data = str;
this.engine.render(options, function(err, res) {
var basePath, data;
if (err) {
return deferred.reject(err);
}
data = {
result: String(res.css),
imports: res.stats.includedFiles,
meta: {
entry: res.stats.entry,
start: res.stats.start,
end: res.stats.end,
duration: res.stats.duration
}
};
if (res.map) {
data.sourcemap = JSON.parse(res.map.toString('utf8'));
basePath = path.dirname(options.filename);
data.sourcemap.sources = data.sourcemap.sources.map(function(relativePath) {
return path.join(basePath, relativePath);
});
}
return deferred.resolve(data);
});
return deferred.promise;
};
return SCSS;
})(Adapter);
module.exports = SCSS;
}).call(this);

View File

@ -0,0 +1,5 @@
// Generated by CoffeeScript 1.12.1
(function() {
module.exports = require('./3.x - 4.x');
}).call(this);

View File

@ -0,0 +1,127 @@
// Generated by CoffeeScript 1.12.1
(function() {
var Adapter, Stylus, flatten, nodefn, sourcemaps,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
Adapter = require('../../adapter_base');
sourcemaps = require('../../sourcemaps');
nodefn = require('when/node/function');
flatten = require('lodash.flatten');
Stylus = (function(superClass) {
extend(Stylus, superClass);
function Stylus() {
return Stylus.__super__.constructor.apply(this, arguments);
}
Stylus.prototype.name = 'stylus';
Stylus.prototype.extensions = ['styl'];
Stylus.prototype.output = 'css';
Stylus.prototype._render = function(str, options) {
var base, defines, i, imports, includes, j, k, l, len, len1, len2, m, obj, plugins, rawDefines, sets, v;
sets = {};
defines = {};
rawDefines = {};
includes = [];
imports = [];
plugins = [];
if (options.sourcemap === true) {
options.sourcemap = {
comment: false
};
}
for (k in options) {
v = options[k];
switch (k) {
case 'define':
Object.assign(defines, v);
break;
case 'rawDefine':
Object.assign(rawDefines, v);
break;
case 'include':
includes.push(v);
break;
case 'import':
imports.push(v);
break;
case 'use':
plugins.push(v);
break;
case 'url':
if (typeof v === 'string') {
obj = {};
obj[v] = this.engine.url();
Object.assign(defines, obj);
} else {
obj = {};
obj[v.name] = this.engine.url({
limit: v.limit != null ? v.limit : 30000,
paths: v.paths || []
});
Object.assign(defines, obj);
}
break;
default:
sets[k] = v;
}
}
includes = flatten(includes);
imports = flatten(imports);
plugins = flatten(plugins);
base = this.engine(str);
for (k in sets) {
v = sets[k];
base.set(k, v);
}
for (k in defines) {
v = defines[k];
base.define(k, v);
}
for (k in rawDefines) {
v = rawDefines[k];
base.define(k, v, true);
}
for (j = 0, len = includes.length; j < len; j++) {
i = includes[j];
base.include(i);
}
for (l = 0, len1 = imports.length; l < len1; l++) {
i = imports[l];
base["import"](i);
}
for (m = 0, len2 = plugins.length; m < len2; m++) {
i = plugins[m];
base.use(i);
}
return nodefn.call(base.render.bind(base)).then(function(res) {
return obj = {
result: res
};
}).then(function(obj) {
if (base.sourcemap) {
return sourcemaps.inline_sources(base.sourcemap).then(function(map) {
obj.sourcemap = map;
return obj;
});
} else {
return obj;
}
});
};
return Stylus;
})(Adapter);
module.exports = Stylus;
}).call(this);

View File

@ -0,0 +1,5 @@
// Generated by CoffeeScript 1.12.1
(function() {
module.exports = require('./0.x');
}).call(this);

View File

@ -0,0 +1,103 @@
// Generated by CoffeeScript 1.12.1
(function() {
var Adapter, Swig, UglifyJS, W, fs, path,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
Adapter = require('../../adapter_base');
path = require('path');
fs = require('fs');
W = require('when');
UglifyJS = require('uglify-js');
Swig = (function(superClass) {
var compile;
extend(Swig, superClass);
function Swig() {
return Swig.__super__.constructor.apply(this, arguments);
}
Swig.prototype.name = 'swig';
Swig.prototype.extensions = ['swig'];
Swig.prototype.output = 'html';
Swig.prototype._render = function(str, options) {
return compile((function(_this) {
return function() {
return _this.engine.render(str, options);
};
})(this));
};
Swig.prototype._compile = function(str, options) {
return compile((function(_this) {
return function() {
return _this.engine.compile(str, options);
};
})(this));
};
Swig.prototype._compileClient = function(str, options) {
return compile((function(_this) {
return function() {
return _this.engine.precompile(str, options).tpl.toString();
};
})(this));
};
Swig.prototype.renderFile = function(path, options) {
if (options == null) {
options = {};
}
return compile((function(_this) {
return function() {
return _this.engine.renderFile(path, options.locals);
};
})(this));
};
Swig.prototype.compileFile = function(path, options) {
if (options == null) {
options = {};
}
return compile((function(_this) {
return function() {
return _this.engine.compileFile(path, options);
};
})(this));
};
Swig.prototype.clientHelpers = function() {
var runtime_path;
runtime_path = path.join(this.engine.__accord_path, 'dist/swig.min.js');
return fs.readFileSync(runtime_path, 'utf8');
};
compile = function(fn) {
var err, res;
try {
res = fn();
} catch (error) {
err = error;
return W.reject(err);
}
return W.resolve({
result: res
});
};
return Swig;
})(Adapter);
module.exports = Swig;
}).call(this);

View File

@ -0,0 +1,5 @@
// Generated by CoffeeScript 1.12.1
(function() {
module.exports = require('./1.x');
}).call(this);

View File

@ -0,0 +1,79 @@
// Generated by CoffeeScript 1.12.1
(function() {
var Adapter, Toffee, W, fs,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
Adapter = require('../../adapter_base');
W = require('when');
fs = require('fs');
Toffee = (function(superClass) {
var compile;
extend(Toffee, superClass);
function Toffee() {
return Toffee.__super__.constructor.apply(this, arguments);
}
Toffee.prototype.name = 'toffee';
Toffee.prototype.extensions = ['toffee'];
Toffee.prototype.output = 'html';
Toffee.prototype.supportedEngines = ['toffee'];
Toffee.prototype._render = function(str, options) {
return compile((function(_this) {
return function() {
return _this.engine.str_render(str, options, function(err, res) {
if (res.indexOf("<div style=\"font-family:courier new;font-size:12px;color:#900;width:100%;\">") !== -1) {
throw res;
} else {
return res;
}
});
};
})(this));
};
Toffee.prototype._compile = function(str, options) {
return compile((function(_this) {
return function() {
return _this.engine.compileStr(str).toString();
};
})(this));
};
Toffee.prototype._compileClient = function(str, options) {
return compile((function(_this) {
return function() {
return _this.engine.configurable_compile(str, options);
};
})(this));
};
compile = function(fn) {
var err, res;
try {
res = fn();
} catch (error) {
err = error;
return W.reject(err);
}
return W.resolve({
result: res
});
};
return Toffee;
})(Adapter);
module.exports = Toffee;
}).call(this);

View File

@ -0,0 +1,5 @@
// Generated by CoffeeScript 1.12.1
(function() {
module.exports = require('./0.1.x');
}).call(this);

View File

@ -0,0 +1,63 @@
// Generated by CoffeeScript 1.12.1
(function() {
var Adapter, TypeScript, W,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
Adapter = require('../../adapter_base');
W = require('when');
TypeScript = (function(superClass) {
var compile;
extend(TypeScript, superClass);
function TypeScript() {
return TypeScript.__super__.constructor.apply(this, arguments);
}
TypeScript.prototype.name = 'typescript';
TypeScript.prototype.engineName = 'typescript-compiler';
TypeScript.prototype.supportedEngines = ['typescript-compiler'];
TypeScript.prototype.extensions = ['ts'];
TypeScript.prototype.output = 'js';
TypeScript.prototype.isolated = true;
TypeScript.prototype._render = function(str, options) {
var throwOnError;
throwOnError = function(err) {
throw err;
};
return compile((function(_this) {
return function() {
return _this.engine.compileString(str, void 0, options, throwOnError);
};
})(this));
};
compile = function(fn) {
var err, res;
try {
res = fn();
} catch (error) {
err = error;
return W.reject(err);
}
return W.resolve({
result: res
});
};
return TypeScript;
})(Adapter);
module.exports = TypeScript;
}).call(this);

View File

@ -0,0 +1,5 @@
// Generated by CoffeeScript 1.12.1
(function() {
module.exports = require('./1.x');
}).call(this);

98
static/js/ketcher2/node_modules/accord/lib/index.js generated vendored Normal file
View File

@ -0,0 +1,98 @@
// Generated by CoffeeScript 1.12.1
(function() {
var abstract_mapper, adapter_to_name, fs, get_version, glob, indx, match_version_to_adapter, name_to_adapter, path, resolve, resolve_engine_path, semver, supports;
path = require('path');
fs = require('fs');
glob = require('glob');
indx = require('indx');
resolve = require('resolve');
semver = require('semver');
exports.supports = supports = function(name) {
name = adapter_to_name(name);
return !!glob.sync("" + (path.join(__dirname, 'adapters', name))).length;
};
exports.load = function(name, custom_path, engine_name) {
var adapter_name, engine_path, version;
name = adapter_to_name(name);
engine_path = resolve_engine_path(name, custom_path);
version = get_version(engine_path);
adapter_name = match_version_to_adapter(name, version);
if (!adapter_name) {
throw new Error(name + " version " + version + " is not currently supported");
}
return new (require(adapter_name))(engine_name, engine_path);
};
exports.all = function() {
return indx(path.join(__dirname, 'adapters'));
};
exports.abstract_mapper = abstract_mapper = function(name, direction) {
var name_maps, res;
name_maps = [['markdown', 'marked'], ['minify-js', 'uglify-js'], ['minify-css', 'clean-css'], ['minify-html', 'html-minifier'], ['mustache', 'hogan.js'], ['scss', 'node-sass'], ['haml', 'hamljs'], ['escape-html', 'he'], ['jsx', 'react-tools'], ['cjsx', 'coffee-react-transform'], ['babel', 'babel-core'], ['typescript', 'typescript-compiler']];
res = null;
name_maps.forEach(function(n) {
if (direction === 'left' && n[0] === name) {
res = n[1];
}
if (direction === 'right' && n[1] === name) {
return res = n[0];
}
});
return res || name;
};
exports.adapter_to_name = adapter_to_name = function(name) {
return abstract_mapper(name, 'right');
};
exports.name_to_adapter = name_to_adapter = function(name) {
return abstract_mapper(name, 'left');
};
resolve_engine_path = function(name, custom_path) {
var filepath;
filepath = custom_path != null ? resolve.sync(name_to_adapter(name), {
basedir: custom_path
}) : require.resolve(name_to_adapter(name));
while (true) {
if (filepath === '/') {
throw new Error("cannot resolve root of node module " + name);
}
filepath = path.dirname(filepath);
if (fs.existsSync(path.join(filepath, 'package.json'))) {
return filepath;
}
}
};
get_version = function(engine_path) {
var err;
try {
return require(engine_path + '/package.json').version;
} catch (error) {
err = error;
}
};
match_version_to_adapter = function(name, version) {
var adapter, adapters, i, len;
adapters = fs.readdirSync(path.join(__dirname, 'adapters', name));
for (i = 0, len = adapters.length; i < len; i++) {
adapter = adapters[i];
adapter = adapter.replace(/\.(?:js|coffee)$/, '');
if (semver.satisfies(version, adapter)) {
return path.join(__dirname, 'adapters', name, adapter);
}
}
};
}).call(this);

View File

@ -0,0 +1,34 @@
// Generated by CoffeeScript 1.12.1
(function() {
var W, fs, node;
W = require('when');
node = require('when/node');
fs = require('fs');
/**
* Reads a source map's sources and inlines them in the `sourcesContents` key,
* returning the full map.
*
* @param {Object} map - source map v3
* @return {Promise} a promise for the sourcemap updated with contents
*/
exports.inline_sources = function(map) {
if (map.sourcesContent) {
return W.resolve(map);
}
return W.map(map.sources, function(source) {
return node.call(fs.readFile.bind(fs), source, 'utf8');
}).then(function(contents) {
map.sourcesContent = contents;
return map;
})["catch"](function() {
return map;
});
};
}).call(this);

10
static/js/ketcher2/node_modules/accord/license.md generated vendored Normal file
View File

@ -0,0 +1,10 @@
License (MIT)
-------------
Copyright (c) 2013 Jeff Escalante
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -0,0 +1,47 @@
Copyright jQuery Foundation and other contributors <https://jquery.org/>
Based on Underscore.js, copyright Jeremy Ashkenas,
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
This software consists of voluntary contributions made by many
individuals. For exact contribution history, see the revision history
available at https://github.com/lodash/lodash
The following license applies to all parts of this software except as
documented below:
====
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
====
Copyright and related rights for sample code are waived via CC0. Sample
code is defined as all source code displayed within the prose of the
documentation.
CC0: http://creativecommons.org/publicdomain/zero/1.0/
====
Files located in the node_modules and vendor directories are externally
maintained libraries used by this software which have their own
licenses; we recommend you read them, as their terms may differ from the
terms above.

View File

@ -0,0 +1,18 @@
# lodash.defaults v4.2.0
The [lodash](https://lodash.com/) method `_.defaults` exported as a [Node.js](https://nodejs.org/) module.
## Installation
Using npm:
```bash
$ {sudo -H} npm i -g npm
$ npm i --save lodash.defaults
```
In Node.js:
```js
var defaults = require('lodash.defaults');
```
See the [documentation](https://lodash.com/docs#defaults) or [package source](https://github.com/lodash/lodash/blob/4.2.0-npm-packages/lodash.defaults) for more details.

View File

@ -0,0 +1,668 @@
/**
* lodash (Custom Build) <https://lodash.com/>
* Build: `lodash modularize exports="npm" -o ./`
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/
/** Used as references for various `Number` constants. */
var MAX_SAFE_INTEGER = 9007199254740991;
/** `Object#toString` result references. */
var argsTag = '[object Arguments]',
funcTag = '[object Function]',
genTag = '[object GeneratorFunction]';
/** Used to detect unsigned integer values. */
var reIsUint = /^(?:0|[1-9]\d*)$/;
/**
* A faster alternative to `Function#apply`, this function invokes `func`
* with the `this` binding of `thisArg` and the arguments of `args`.
*
* @private
* @param {Function} func The function to invoke.
* @param {*} thisArg The `this` binding of `func`.
* @param {Array} args The arguments to invoke `func` with.
* @returns {*} Returns the result of `func`.
*/
function apply(func, thisArg, args) {
switch (args.length) {
case 0: return func.call(thisArg);
case 1: return func.call(thisArg, args[0]);
case 2: return func.call(thisArg, args[0], args[1]);
case 3: return func.call(thisArg, args[0], args[1], args[2]);
}
return func.apply(thisArg, args);
}
/**
* The base implementation of `_.times` without support for iteratee shorthands
* or max array length checks.
*
* @private
* @param {number} n The number of times to invoke `iteratee`.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns the array of results.
*/
function baseTimes(n, iteratee) {
var index = -1,
result = Array(n);
while (++index < n) {
result[index] = iteratee(index);
}
return result;
}
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var objectToString = objectProto.toString;
/** Built-in value references. */
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max;
/**
* Creates an array of the enumerable property names of the array-like `value`.
*
* @private
* @param {*} value The value to query.
* @param {boolean} inherited Specify returning inherited property names.
* @returns {Array} Returns the array of property names.
*/
function arrayLikeKeys(value, inherited) {
// Safari 8.1 makes `arguments.callee` enumerable in strict mode.
// Safari 9 makes `arguments.length` enumerable in strict mode.
var result = (isArray(value) || isArguments(value))
? baseTimes(value.length, String)
: [];
var length = result.length,
skipIndexes = !!length;
for (var key in value) {
if ((inherited || hasOwnProperty.call(value, key)) &&
!(skipIndexes && (key == 'length' || isIndex(key, length)))) {
result.push(key);
}
}
return result;
}
/**
* Used by `_.defaults` to customize its `_.assignIn` use.
*
* @private
* @param {*} objValue The destination value.
* @param {*} srcValue The source value.
* @param {string} key The key of the property to assign.
* @param {Object} object The parent object of `objValue`.
* @returns {*} Returns the value to assign.
*/
function assignInDefaults(objValue, srcValue, key, object) {
if (objValue === undefined ||
(eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
return srcValue;
}
return objValue;
}
/**
* Assigns `value` to `key` of `object` if the existing value is not equivalent
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons.
*
* @private
* @param {Object} object The object to modify.
* @param {string} key The key of the property to assign.
* @param {*} value The value to assign.
*/
function assignValue(object, key, value) {
var objValue = object[key];
if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
(value === undefined && !(key in object))) {
object[key] = value;
}
}
/**
* The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
*/
function baseKeysIn(object) {
if (!isObject(object)) {
return nativeKeysIn(object);
}
var isProto = isPrototype(object),
result = [];
for (var key in object) {
if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
result.push(key);
}
}
return result;
}
/**
* The base implementation of `_.rest` which doesn't validate or coerce arguments.
*
* @private
* @param {Function} func The function to apply a rest parameter to.
* @param {number} [start=func.length-1] The start position of the rest parameter.
* @returns {Function} Returns the new function.
*/
function baseRest(func, start) {
start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
return function() {
var args = arguments,
index = -1,
length = nativeMax(args.length - start, 0),
array = Array(length);
while (++index < length) {
array[index] = args[start + index];
}
index = -1;
var otherArgs = Array(start + 1);
while (++index < start) {
otherArgs[index] = args[index];
}
otherArgs[start] = array;
return apply(func, this, otherArgs);
};
}
/**
* Copies properties of `source` to `object`.
*
* @private
* @param {Object} source The object to copy properties from.
* @param {Array} props The property identifiers to copy.
* @param {Object} [object={}] The object to copy properties to.
* @param {Function} [customizer] The function to customize copied values.
* @returns {Object} Returns `object`.
*/
function copyObject(source, props, object, customizer) {
object || (object = {});
var index = -1,
length = props.length;
while (++index < length) {
var key = props[index];
var newValue = customizer
? customizer(object[key], source[key], key, object, source)
: undefined;
assignValue(object, key, newValue === undefined ? source[key] : newValue);
}
return object;
}
/**
* Creates a function like `_.assign`.
*
* @private
* @param {Function} assigner The function to assign values.
* @returns {Function} Returns the new assigner function.
*/
function createAssigner(assigner) {
return baseRest(function(object, sources) {
var index = -1,
length = sources.length,
customizer = length > 1 ? sources[length - 1] : undefined,
guard = length > 2 ? sources[2] : undefined;
customizer = (assigner.length > 3 && typeof customizer == 'function')
? (length--, customizer)
: undefined;
if (guard && isIterateeCall(sources[0], sources[1], guard)) {
customizer = length < 3 ? undefined : customizer;
length = 1;
}
object = Object(object);
while (++index < length) {
var source = sources[index];
if (source) {
assigner(object, source, index, customizer);
}
}
return object;
});
}
/**
* Checks if `value` is a valid array-like index.
*
* @private
* @param {*} value The value to check.
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
*/
function isIndex(value, length) {
length = length == null ? MAX_SAFE_INTEGER : length;
return !!length &&
(typeof value == 'number' || reIsUint.test(value)) &&
(value > -1 && value % 1 == 0 && value < length);
}
/**
* Checks if the given arguments are from an iteratee call.
*
* @private
* @param {*} value The potential iteratee value argument.
* @param {*} index The potential iteratee index or key argument.
* @param {*} object The potential iteratee object argument.
* @returns {boolean} Returns `true` if the arguments are from an iteratee call,
* else `false`.
*/
function isIterateeCall(value, index, object) {
if (!isObject(object)) {
return false;
}
var type = typeof index;
if (type == 'number'
? (isArrayLike(object) && isIndex(index, object.length))
: (type == 'string' && index in object)
) {
return eq(object[index], value);
}
return false;
}
/**
* Checks if `value` is likely a prototype object.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
*/
function isPrototype(value) {
var Ctor = value && value.constructor,
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
return value === proto;
}
/**
* This function is like
* [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
* except that it includes inherited enumerable properties.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
*/
function nativeKeysIn(object) {
var result = [];
if (object != null) {
for (var key in Object(object)) {
result.push(key);
}
}
return result;
}
/**
* Performs a
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* comparison between two values to determine if they are equivalent.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
* @example
*
* var object = { 'a': 1 };
* var other = { 'a': 1 };
*
* _.eq(object, object);
* // => true
*
* _.eq(object, other);
* // => false
*
* _.eq('a', 'a');
* // => true
*
* _.eq('a', Object('a'));
* // => false
*
* _.eq(NaN, NaN);
* // => true
*/
function eq(value, other) {
return value === other || (value !== value && other !== other);
}
/**
* Checks if `value` is likely an `arguments` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
* else `false`.
* @example
*
* _.isArguments(function() { return arguments; }());
* // => true
*
* _.isArguments([1, 2, 3]);
* // => false
*/
function isArguments(value) {
// Safari 8.1 makes `arguments.callee` enumerable in strict mode.
return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
(!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
}
/**
* Checks if `value` is classified as an `Array` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
* @example
*
* _.isArray([1, 2, 3]);
* // => true
*
* _.isArray(document.body.children);
* // => false
*
* _.isArray('abc');
* // => false
*
* _.isArray(_.noop);
* // => false
*/
var isArray = Array.isArray;
/**
* Checks if `value` is array-like. A value is considered array-like if it's
* not a function and has a `value.length` that's an integer greater than or
* equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is array-like, else `false`.
* @example
*
* _.isArrayLike([1, 2, 3]);
* // => true
*
* _.isArrayLike(document.body.children);
* // => true
*
* _.isArrayLike('abc');
* // => true
*
* _.isArrayLike(_.noop);
* // => false
*/
function isArrayLike(value) {
return value != null && isLength(value.length) && !isFunction(value);
}
/**
* This method is like `_.isArrayLike` except that it also checks if `value`
* is an object.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an array-like object,
* else `false`.
* @example
*
* _.isArrayLikeObject([1, 2, 3]);
* // => true
*
* _.isArrayLikeObject(document.body.children);
* // => true
*
* _.isArrayLikeObject('abc');
* // => false
*
* _.isArrayLikeObject(_.noop);
* // => false
*/
function isArrayLikeObject(value) {
return isObjectLike(value) && isArrayLike(value);
}
/**
* Checks if `value` is classified as a `Function` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
* @example
*
* _.isFunction(_);
* // => true
*
* _.isFunction(/abc/);
* // => false
*/
function isFunction(value) {
// The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 8-9 which returns 'object' for typed array and other constructors.
var tag = isObject(value) ? objectToString.call(value) : '';
return tag == funcTag || tag == genTag;
}
/**
* Checks if `value` is a valid array-like length.
*
* **Note:** This method is loosely based on
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
* @example
*
* _.isLength(3);
* // => true
*
* _.isLength(Number.MIN_VALUE);
* // => false
*
* _.isLength(Infinity);
* // => false
*
* _.isLength('3');
* // => false
*/
function isLength(value) {
return typeof value == 'number' &&
value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
}
/**
* Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
* @example
*
* _.isObject({});
* // => true
*
* _.isObject([1, 2, 3]);
* // => true
*
* _.isObject(_.noop);
* // => true
*
* _.isObject(null);
* // => false
*/
function isObject(value) {
var type = typeof value;
return !!value && (type == 'object' || type == 'function');
}
/**
* Checks if `value` is object-like. A value is object-like if it's not `null`
* and has a `typeof` result of "object".
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
* @example
*
* _.isObjectLike({});
* // => true
*
* _.isObjectLike([1, 2, 3]);
* // => true
*
* _.isObjectLike(_.noop);
* // => false
*
* _.isObjectLike(null);
* // => false
*/
function isObjectLike(value) {
return !!value && typeof value == 'object';
}
/**
* This method is like `_.assignIn` except that it accepts `customizer`
* which is invoked to produce the assigned values. If `customizer` returns
* `undefined`, assignment is handled by the method instead. The `customizer`
* is invoked with five arguments: (objValue, srcValue, key, object, source).
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @alias extendWith
* @category Object
* @param {Object} object The destination object.
* @param {...Object} sources The source objects.
* @param {Function} [customizer] The function to customize assigned values.
* @returns {Object} Returns `object`.
* @see _.assignWith
* @example
*
* function customizer(objValue, srcValue) {
* return _.isUndefined(objValue) ? srcValue : objValue;
* }
*
* var defaults = _.partialRight(_.assignInWith, customizer);
*
* defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
* // => { 'a': 1, 'b': 2 }
*/
var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
copyObject(source, keysIn(source), object, customizer);
});
/**
* Assigns own and inherited enumerable string keyed properties of source
* objects to the destination object for all destination properties that
* resolve to `undefined`. Source objects are applied from left to right.
* Once a property is set, additional values of the same property are ignored.
*
* **Note:** This method mutates `object`.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The destination object.
* @param {...Object} [sources] The source objects.
* @returns {Object} Returns `object`.
* @see _.defaultsDeep
* @example
*
* _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
* // => { 'a': 1, 'b': 2 }
*/
var defaults = baseRest(function(args) {
args.push(undefined, assignInDefaults);
return apply(assignInWith, undefined, args);
});
/**
* Creates an array of the own and inherited enumerable property names of `object`.
*
* **Note:** Non-object values are coerced to objects.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.keysIn(new Foo);
* // => ['a', 'b', 'c'] (iteration order is not guaranteed)
*/
function keysIn(object) {
return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
}
module.exports = defaults;

View File

@ -0,0 +1,69 @@
{
"_from": "lodash.defaults@^4.0.1",
"_id": "lodash.defaults@4.2.0",
"_inBundle": false,
"_integrity": "sha1-0JF4cW/+pN3p5ft7N/bwgCJ0WAw=",
"_location": "/accord/lodash.defaults",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "lodash.defaults@^4.0.1",
"name": "lodash.defaults",
"escapedName": "lodash.defaults",
"rawSpec": "^4.0.1",
"saveSpec": null,
"fetchSpec": "^4.0.1"
},
"_requiredBy": [
"/accord"
],
"_resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz",
"_shasum": "d09178716ffea4dde9e5fb7b37f6f0802274580c",
"_spec": "lodash.defaults@^4.0.1",
"_where": "/home/manfred/enviPath/ketcher2/ketcher/node_modules/accord",
"author": {
"name": "John-David Dalton",
"email": "john.david.dalton@gmail.com",
"url": "http://allyoucanleet.com/"
},
"bugs": {
"url": "https://github.com/lodash/lodash/issues"
},
"bundleDependencies": false,
"contributors": [
{
"name": "John-David Dalton",
"email": "john.david.dalton@gmail.com",
"url": "http://allyoucanleet.com/"
},
{
"name": "Blaine Bublitz",
"email": "blaine.bublitz@gmail.com",
"url": "https://github.com/phated"
},
{
"name": "Mathias Bynens",
"email": "mathias@qiwi.be",
"url": "https://mathiasbynens.be/"
}
],
"deprecated": false,
"description": "The lodash method `_.defaults` exported as a module.",
"homepage": "https://lodash.com/",
"icon": "https://lodash.com/icon.svg",
"keywords": [
"lodash-modularized",
"defaults"
],
"license": "MIT",
"name": "lodash.defaults",
"repository": {
"type": "git",
"url": "git+https://github.com/lodash/lodash.git"
},
"scripts": {
"test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\""
},
"version": "4.2.0"
}

112
static/js/ketcher2/node_modules/accord/package.json generated vendored Normal file
View File

@ -0,0 +1,112 @@
{
"_from": "accord@^0.26.3",
"_id": "accord@0.26.4",
"_inBundle": false,
"_integrity": "sha1-/EyNPrq0BqB8sogZuFllHESpLoA=",
"_location": "/accord",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "accord@^0.26.3",
"name": "accord",
"escapedName": "accord",
"rawSpec": "^0.26.3",
"saveSpec": null,
"fetchSpec": "^0.26.3"
},
"_requiredBy": [
"/gulp-less"
],
"_resolved": "https://registry.npmjs.org/accord/-/accord-0.26.4.tgz",
"_shasum": "fc4c8d3ebab406a07cb28819b859651c44a92e80",
"_spec": "accord@^0.26.3",
"_where": "/home/manfred/enviPath/ketcher2/ketcher/node_modules/gulp-less",
"author": {
"name": "Jeff Escalante"
},
"bugs": {
"url": "https://github.com/jescalan/accord"
},
"bundleDependencies": false,
"dependencies": {
"convert-source-map": "^1.2.0",
"glob": "^7.0.5",
"indx": "^0.2.3",
"lodash.clone": "^4.3.2",
"lodash.defaults": "^4.0.1",
"lodash.flatten": "^4.2.0",
"lodash.merge": "^4.4.0",
"lodash.partialright": "^4.1.4",
"lodash.pick": "^4.2.1",
"lodash.uniq": "^4.3.0",
"resolve": "^1.1.7",
"semver": "^5.3.0",
"uglify-js": "^2.7.0",
"when": "^3.7.7"
},
"deprecated": false,
"description": "A unified interface for compiled languages and templates in JavaScript",
"devDependencies": {
"LiveScript": "^1.3.1",
"acorn": "^4.0.0",
"babel": "^6.5.2",
"babel-core": "^6.18.1",
"babel-preset-es2015": "^6.18.0",
"buble": "^0.14.2",
"chai": "^3.5.0",
"clean-css": "^3.4.21",
"coco": "^0.9.1",
"coffee-coverage": "^1.0.1",
"coffee-react-transform": "^5.0.0",
"coffee-script": "^1.11.0",
"coveralls": "^2.11.15",
"css-parse": "^2.0.0",
"csso": "^2.2.0",
"dogescript": "^2.3.0",
"dot": "^1.1.1",
"eco": "^1.0.3",
"ejs": "^2.4.2",
"hamljs": "^0.6.2",
"handlebars": "^4.0.6",
"he": "^1.1.0",
"hogan.js": "^3.0.2",
"html-minifier": "^3.2.2",
"istanbul": "^0.4.4",
"jade": "^1.11.0",
"less": "^2.7.1",
"marc": "^0.1.0",
"marked": "^0.3.5",
"mocha": "^3.1.2",
"mocha-lcov-reporter": "^1.2.0",
"myth": "^1.5.0",
"node-sass": "^4.0.0",
"parse5": "^3.0.0",
"polytest": "0.0.1",
"postcss": "^5.2.5",
"postcss-simple-vars": "^3.0.0",
"react-tools": "^0.13.3",
"stylus": "^0.54.5",
"swig": "^1.4.2",
"toffee": "^0.1.12",
"typescript-compiler": "^1.4.1"
},
"homepage": "https://github.com/jescalan/accord",
"keywords": [
"compile"
],
"license": "MIT",
"main": "lib",
"name": "accord",
"repository": {
"type": "git",
"url": "git+https://github.com/jenius/accord.git"
},
"scripts": {
"coverage": "mocha && ./node_modules/.bin/istanbul report && open coverage/lcov-report/index.html",
"coveralls": "istanbul report && cat ./coverage/lcov.info | coveralls",
"legacy": "coffee test/legacy.coffee",
"test": "mocha test/test.coffee"
},
"version": "0.26.4"
}

184
static/js/ketcher2/node_modules/accord/readme.md generated vendored Normal file
View File

@ -0,0 +1,184 @@
accord
======
[![npm](https://img.shields.io/npm/v/accord.svg?style=flat)](http://badge.fury.io/js/accord)
[![tests](https://img.shields.io/travis/jescalan/accord/master.svg?style=flat)](https://travis-ci.org/jescalan/accord)
[![coverage](https://img.shields.io/coveralls/jescalan/accord/master.svg?style=flat)](https://coveralls.io/r/jescalan/accord?branch=master)
[![dependencies](https://img.shields.io/david/jescalan/accord.svg?style=flat)](https://david-dm.org/jescalan/accord)
A unified interface for compiled languages and templates in JavaScript.
> **Note:** This project is in early development, and versioning is a little different. [Read this](http://markup.im/#q4_cRZ1Q) for more details.
### Why should you care?
There are two other libraries that already attempt to provide a common compiler interface: [consolidate.js](https://github.com/tj/consolidate.js) and [JSTransformers](https://github.com/jstransformers/jstransformer). After reviewing & using both of them, we designed accord to provide a more maintainable code base and way of writing adapters.
Accord:
- Uses standard JavaScript inheritance (aka: classes in CoffeeScript) in its adapters
- Supports source maps
- Lets you use any major version of an adapter
### Installation
`npm install accord`
### Usage
Accord itself exposes only a JavaScript API. If you are interested in using this library from the command line, check out the [accord-cli](https://github.com/carrot/accord-cli) project.
Since some templating engines are async and others are not, accord keeps things consistent by returning a promise for any task (using [when.js](https://github.com/cujojs/when)). Here's an example in CoffeeScript:
```coffee
fs = require 'fs'
accord = require 'accord'
jade = accord.load('jade')
# render a string
jade.render('body\n .test')
.done(console.log.bind(console))
# or a file
jade.renderFile('./example.jade')
.done(console.log.bind(console))
# or compile a string to a function
# (only some to-html compilers support this, see below)
jade.compile('body\n .test')
.done(console.log.bind(console))
# or a file
jade.compileFile('./example.jade')
.done(console.log.bind(console))
# compile a client-side js template
jade.compileClient('body\n .test')
.done (res) -> console.log(res.result.toString())
# or a file
jade.compileFileClient('./example.jade')
.done (res) -> console.log(res.result.toString())
```
It's also important to note that accord returns an object rather than a string from each of these methods. You can access the compiled result on the `result` property of this object. If the adapter supports source maps, the source map will also be on this object if you have passed in the correct options. Docs below should explain the methods executed in the example above.
### Accord Methods
- `accord.load(string, object)` - loads the compiler named in the first param, npm package with the name must be installed locally, or the optional second param must be the compiler you are after. The second param allows you to load the compiler from elsewhere or load an alternate version if you want, but be careful.
- `accord.supports(string)` - quick test to see if accord supports a certain compiler. accepts a string, which is the name of language (like markdown) or a compiler (like marked), returns a boolean.
### Accord Adapter Methods
- `adapter.name`
- `adapter.render(string, options)` - render a string to a compiled string
- `adapter.renderFile(path, options)` - render a file to a compiled string
- `adapter.compile(string, options)` - compile a string to a function
- `adapter.compileFile(path, options)` - compile a file to a function
- `adapter.compileClient(string, options)` - compile a string to a client-side-ready function
- `adapter.compileFileClient(string, options)` - compile a file to a client-side-ready function
- `adapter.clientHelpers()` - some adapters that compile for client also need helpers, this method returns a string of minfied JavaScript with all of them
- `adapter.extensions` - array of all file extensions the compiler should match
- `adapter.output` - string, expected output extension
- `adapter.engine` - the actual compiler, no adapter wrapper, if you need it
### Supported Languages
#### HTML
- [jade](http://jade-lang.com/)
- [eco](https://github.com/sstephenson/eco)
- [ejs](https://github.com/tj/ejs)
- [markdown](https://github.com/chjj/marked)
- [mustache/hogan](https://github.com/twitter/hogan.js)
- [handlebars](https://github.com/wycats/handlebars.js)
- [haml](https://github.com/tj/haml.js)
- [swig](http://paularmstrong.github.io/swig)
- [marc](https://github.com/bredele/marc)
- [toffee](https://github.com/malgorithms/toffee)
- [doT.js](https://github.com/olado/doT)
#### CSS
- [stylus](http://learnboost.github.io/stylus/)
- [scss](https://github.com/sass/node-sass)
- [less](https://github.com/less/less.js/)
- [myth](https://github.com/segmentio/myth)
- [postcss](https://github.com/postcss/postcss)
#### JavaScript
- [coffeescript](http://coffeescript.org/)
- [dogescript](https://github.com/dogescript/dogescript)
- [coco](https://github.com/satyr/coco)
- [livescript](https://github.com/gkz/LiveScript)
- [babel](https://github.com/babel/babel)
- [jsx](https://github.com/facebook/react)
- [cjsx](https://github.com/jsdf/coffee-react-transform)
- [typescript](http://www.typescriptlang.org/)
- [buble](https://buble.surge.sh/guide/)
#### Minifiers
- [minify-js](https://github.com/mishoo/UglifyJS2)
- [minify-css](https://github.com/jakubpawlowicz/clean-css)
- [minify-html](https://github.com/kangax/html-minifier)
- [csso](https://github.com/css/csso)
#### Escapers
- [escape-html](https://github.com/mathiasbynens/he)
### Evergreen Version Support
As of version `0.20.0`, accord ships with a system that can be used to offer full support for any engine across any version, so that the interface remains consistent even in the face of breaking changes to the adapter's API. With this feature in place, you can freely upgrade accord without worrying about any breakage in any libraries you are using, ever.
So for example, if you are using sass and they release a breaking version bump, we will release a new adapter for the new version and cut a new release of accord that includes support for this version. However, if you are still using the old version, it will still work as before so you have as much time as you need to upgrade to the new version.
This does not mean that we immediately support every version of every library infinitely into the past. However, going forward, we will support any new updates to libraries from now on to ensure that nothing breaks for users.
This is a feature that is unique to accord and we are beyond excited to make it available to everyone.
### Languages Supporting Compilation
Accord can also compile templates into JavaScript functions, for some languages. This is really useful for client-side rendering. Languages with compile support are listed below. If you try to compile a language without support for it, you will get an error.
- jade
- ejs
- handlebars
- mustache
We are always looking to add compile support for more languages, but it can be difficult, as client-side template support isn't always the first thing on language authors' minds. Any contributions that help to expand this list are greatly appreciated!
When using a language supporting client-side templates, make sure to check the [docs](docs) for that language for more details. In general, you'll get back a stringified function from the `compileClient` or `compileFileClient` methods, and a string of client helpers from the `clientHelpers` methods. You can take these, organize them, and write them to files however you wish. Usually the best way is to write the helpers to a file first, then iterate through each of the client-compiled functions, assigning them a name so they can be accessed later on.
### Adding Languages
Want to add more languages? We have put extra effort into making the adapter pattern structure understandable and easy to add to and test. Rather than requesting that a language be added, please add a pull request and add it yourself! We are quite responsive and will quickly accept if the implementation is well-tested.
Details on running tests and contributing [can be found here](contributing.md)
### Source Maps
Accord now supports source map generation for any language that also supports source maps. At the moment, this includes the following languages:
- stylus
- less
- myth
- scss
- coffeescript
- minify-js
- 6to5
- postcss
Accord returns all source maps as javascript objects, and if available will prefer a [v3 sourcemap](https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit) over any other format. You can find the primary sourcemap on the object returned from accord under the `sourcemap` key. If there are multiple sourcemaps generated, alternate ones will be avaiable under different keys, which you can find on the object returned from accord after a compile.
To generate a sourcemap, you can pass `sourcemap: true` as an option to any compiler and you will get back a sourcemap with the file names, sources, and mappings correctly specified, guaranteed. Each compiler also has it's own way of specifying source map options. If you'd like to dive into those details to customize the output, you are welcome to do so, but it is at your own risk.
If there is a language that now supports sourcemaps and you'd like support for them to be added, get a pull request going and we'll make it happen!
### License
Licensed under [MIT](license.md)