-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test remains...
- Loading branch information
Dragos Cirjan
committed
Feb 10, 2019
1 parent
01499af
commit cc7fef0
Showing
47 changed files
with
3,731 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,49 @@ | ||
let gulp = require('gulp'); | ||
let runSequence = require('run-sequence'); | ||
let to5 = require('gulp-babel'); | ||
let paths = require('../paths'); | ||
let compilerOptions = require('../babel-options'); | ||
let assign = Object.assign || require('object.assign'); | ||
const assign = Object.assign || require('object.assign'); | ||
const { clean } = require('./clean'); | ||
const compilerOptions = require('../babel-options'); | ||
const to5 = require('gulp-babel'); | ||
const paths = require('../paths'); | ||
const { dest, series, src } = require('gulp'); | ||
|
||
gulp.task('build-html', function() { | ||
return gulp.src(paths.html) | ||
.pipe(gulp.dest(paths.output + 'es2015')) | ||
.pipe(gulp.dest(paths.output + 'commonjs')) | ||
.pipe(gulp.dest(paths.output + 'amd')) | ||
.pipe(gulp.dest(paths.output + 'system')); | ||
}); | ||
const buildHtml = function() { | ||
return src(paths.html) | ||
.pipe(dest(paths.output + 'es2015/')) | ||
.pipe(dest(paths.output + 'commonjs/')) | ||
.pipe(dest(paths.output + 'amd/')) | ||
.pipe(dest(paths.output + 'system/')); | ||
}; | ||
|
||
gulp.task('build-css', function() { | ||
return gulp.src(paths.css) | ||
.pipe(gulp.dest(paths.output + 'es2015')) | ||
.pipe(gulp.dest(paths.output + 'commonjs')) | ||
.pipe(gulp.dest(paths.output + 'amd')) | ||
.pipe(gulp.dest(paths.output + 'system')); | ||
}); | ||
const buildCss = function() { | ||
return src(paths.css) | ||
.pipe(dest(paths.output + 'es2015/')) | ||
.pipe(dest(paths.output + 'commonjs/')) | ||
.pipe(dest(paths.output + 'amd/')) | ||
.pipe(dest(paths.output + 'system/')); | ||
}; | ||
|
||
gulp.task('build-es2015', function() { | ||
return gulp.src(paths.source) | ||
const buildEs2015 = function() { | ||
return src(paths.source) | ||
.pipe(to5(assign({}, compilerOptions.es2015()))) | ||
.pipe(gulp.dest(paths.output + 'es2015')); | ||
}); | ||
.pipe(dest(paths.output + 'es2015/')); | ||
}; | ||
|
||
gulp.task('build-commonjs', function() { | ||
return gulp.src(paths.source) | ||
const buildCommonjs = function() { | ||
return src(paths.source) | ||
.pipe(to5(assign({}, compilerOptions.commonjs()))) | ||
.pipe(gulp.dest(paths.output + 'commonjs')); | ||
}); | ||
.pipe(dest(paths.output + 'commonjs/')); | ||
}; | ||
|
||
gulp.task('build-amd', function() { | ||
return gulp.src(paths.source) | ||
const buildAmd = function() { | ||
return src(paths.source) | ||
.pipe(to5(assign({}, compilerOptions.amd()))) | ||
.pipe(gulp.dest(paths.output + 'amd')); | ||
}); | ||
.pipe(dest(paths.output + 'amd/')); | ||
}; | ||
|
||
gulp.task('build-system', function() { | ||
return gulp.src(paths.source) | ||
const buildSystem = function() { | ||
return src(paths.source) | ||
.pipe(to5(assign({}, compilerOptions.system()))) | ||
.pipe(gulp.dest(paths.output + 'system')); | ||
}); | ||
.pipe(dest(paths.output + 'system/')); | ||
}; | ||
|
||
gulp.task('build', function(callback) { | ||
return runSequence( | ||
'clean', | ||
['build-html', 'build-css', 'build-es2015', 'build-commonjs', 'build-amd', 'build-system'], | ||
callback | ||
); | ||
}); | ||
exports.build = buildEs2015; | ||
exports.build = series(clean, buildHtml, buildCss, buildEs2015, buildCommonjs, buildAmd, buildSystem); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,19 @@ | ||
var gulp = require('gulp'); | ||
var tools = require('aurelia-tools'); | ||
var paths = require('../paths'); | ||
var yuidoc = require('gulp-yuidoc'); | ||
const { dest, series, src } = require('gulp'); | ||
const tools = require('aurelia-tools'); | ||
const paths = require('../paths'); | ||
const yuidoc = require('gulp-yuidoc'); | ||
|
||
gulp.task('doc-generate', function(){ | ||
return gulp.src(paths.source) | ||
const docGenerate = function() { | ||
return src(paths.source) | ||
.pipe(yuidoc.parser(null, 'api.json')) | ||
.pipe(gulp.dest(paths.doc)); | ||
}); | ||
.pipe(yuidoc.reporter()) | ||
.pipe(yuidoc.generator()) | ||
.pipe(dest(paths.doc)); | ||
}; | ||
|
||
gulp.task('doc', ['doc-generate'], function(){ | ||
const doc = function() { | ||
tools.transformAPIModel(paths.doc); | ||
}); | ||
}; | ||
|
||
exports['docGenerate'] = docGenerate; | ||
exports.doc = series(docGenerate, doc); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
var gulp = require('gulp'); | ||
var paths = require('../paths'); | ||
var eslint = require('gulp-eslint'); | ||
const gulp = require('gulp'); | ||
const paths = require('../paths'); | ||
const eslint = require('gulp-eslint'); | ||
|
||
// runs eslint on all .js files | ||
gulp.task('lint', function() { | ||
exports.lint = function() { | ||
return gulp.src(paths.source) | ||
.pipe(eslint()) | ||
.pipe(eslint.format()) | ||
.pipe(eslint.failOnError()); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
define(["exports", "aurelia-templating", "./content-loader", "./template"], function (_exports, _aureliaTemplating, _contentLoader, _template) { | ||
"use strict"; | ||
|
||
Object.defineProperty(_exports, "__esModule", { | ||
value: true | ||
}); | ||
_exports.SvgCodeLoader = void 0; | ||
|
||
var _dec, _dec2, _class, _class2, _descriptor, _temp; | ||
|
||
function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); } | ||
|
||
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } | ||
|
||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
|
||
function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object['ke' + 'ys'](descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object['define' + 'Property'](target, property, desc); desc = null; } return desc; } | ||
|
||
function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and set to use loose mode. ' + 'To use proposal-class-properties in spec mode with decorators, wait for ' + 'the next major version of decorators in stage 2.'); } | ||
|
||
var divTemplate = ''; | ||
var svgTemplate = "<rect repeat.for=\"codeRange of codeRanges()\" x=\"0\" y.bind=\"lineY($index)\" rx.bind=\"cornerRadius\" ry.bind=\"cornerRadius\" width.bind=\"width\" height.bind=\"lineHeight\">\n <rect repeat.for=\"range of codeRange\" x.bind=\"range.start\" y.bind=\"lineY($parent.$index)\" rx.bind=\"cornerRadius\" ry.bind=\"cornerRadius\" width.bind=\"range.length\" height.bind=\"lineHeight\"/>\n</rect>"; | ||
var SvgCodeLoader = (_dec = (0, _aureliaTemplating.customElement)('svg-code-loader'), _dec2 = (0, _aureliaTemplating.inlineView)((0, _template.template)(divTemplate, svgTemplate)), (0, _aureliaTemplating.containerless)(_class = _dec(_class = _dec2(_class = (_class2 = (_temp = function (_SvgContentLoader) { | ||
_inheritsLoose(SvgCodeLoader, _SvgContentLoader); | ||
|
||
function SvgCodeLoader() { | ||
var _this; | ||
|
||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
|
||
_this = _SvgContentLoader.call.apply(_SvgContentLoader, [this].concat(args)) || this; | ||
|
||
_initializerDefineProperty(_this, "maxCodeChunks", _descriptor, _assertThisInitialized(_assertThisInitialized(_this))); | ||
|
||
return _this; | ||
} | ||
|
||
var _proto = SvgCodeLoader.prototype; | ||
|
||
_proto.attached = function attached() { | ||
var _SvgContentLoader$pro; | ||
|
||
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { | ||
args[_key2] = arguments[_key2]; | ||
} | ||
|
||
_SvgContentLoader.prototype.attached && (_SvgContentLoader$pro = _SvgContentLoader.prototype.attached).call.apply(_SvgContentLoader$pro, [this].concat(args)); | ||
var clipPath = this.element.querySelector('clipPath'); | ||
var rects = Array.prototype.slice.call(this.element.querySelectorAll('clipPath > rect')); | ||
clipPath.innerHTML = rects.map(function (rect) { | ||
return rect.innerHTML; | ||
}).join(''); | ||
this.addClass('svg-loader__inner--code'); | ||
}; | ||
|
||
_proto.codeRanges = function codeRanges() { | ||
var _this2 = this; | ||
|
||
return this.lineRange.map(function () { | ||
var chunkNr = Math.ceil(Math.random() * 5); | ||
|
||
var chunkRange = _this2.arrayRangeFromNumber(chunkNr).map(function () { | ||
return Math.ceil(Math.random() * _this2.width); | ||
}).sort(function (a, b) { | ||
return a - b; | ||
}); | ||
|
||
return chunkRange.map(function (value, i) { | ||
if (i > 0) { | ||
var length = value - chunkRange[i - 1] - _this2.lineHeight; | ||
return { | ||
start: chunkRange[i - 1] + _this2.lineHeight, | ||
length: length > 0 ? length : 0 | ||
}; | ||
} | ||
|
||
return { | ||
start: 0, | ||
length: value | ||
}; | ||
}); | ||
}); | ||
}; | ||
|
||
return SvgCodeLoader; | ||
}(_contentLoader.SvgContentLoader), _temp), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "maxCodeChunks", [_aureliaTemplating.bindable], { | ||
configurable: true, | ||
enumerable: true, | ||
writable: true, | ||
initializer: function initializer() { | ||
return 3; | ||
} | ||
})), _class2)) || _class) || _class) || _class); | ||
_exports.SvgCodeLoader = SvgCodeLoader; | ||
}); |
Oops, something went wrong.