Commit 0cc6fe37 authored by Wikiki's avatar Wikiki

Merge branch 'hotfix/BulmaImportAtTopOfSass'

parents eb987035 5bb6c9cd
var bulmaTagsinput = (function () {
'use strict';
if (typeof Object.assign != 'function') {
// Must be writable: true, enumerable: false, configurable: true
Object.defineProperty(Object, "assign", {
......@@ -30,15 +33,15 @@ if (typeof Object.assign != 'function') {
const MOUSE_EVENTS = ['click', 'touchstart'];
const KEY_BACKSPACE = 8,
KEY_TAB = 9,
KEY_ENTER = 13,
KEY_LEFT = 37,
KEY_RIGHT = 39,
KEY_DELETE = 46,
KEY_COMMA = 188;
const KEY_BACKSPACE = 8;
const KEY_TAB = 9;
const KEY_ENTER = 13;
const KEY_LEFT = 37;
const KEY_RIGHT = 39;
const KEY_DELETE = 46;
const KEY_COMMA = 188;
export default class Tagify {
class Tagify {
constructor(element, options = {}) {
let defaultOptions = {
disabled: false,
......@@ -47,7 +50,7 @@ export default class Tagify {
lowercase: false,
uppercase: false,
duplicates: true
}
};
this.element = element;
this.options = Object.assign({}, defaultOptions, options);
......@@ -211,7 +214,7 @@ export default class Tagify {
}
if (Array.isArray(text)) {
return text.forEach((text) => {
this.addTag(text)
this.addTag(text);
});
}
......@@ -357,3 +360,7 @@ document.addEventListener( 'DOMContentLoaded', function () {
new Tagify(tagInput);
});
});
return Tagify;
}());
This diff is collapsed.
......@@ -5,6 +5,7 @@ var gulp = require('gulp');
var autoprefixer = require('autoprefixer');
var babel = require('gulp-babel');
var bump = require('gulp-bump');
var camelCase = require('camelcase');
var cleancss = require('gulp-clean-css');
var concat = require('gulp-concat');
var conventionalChangelog = require('gulp-conventional-changelog');
......@@ -14,10 +15,12 @@ var fs = require('fs');
var git = require('gulp-git');
var gutil = require('gulp-util');
var postcss = require('gulp-postcss');
var rollup = require('gulp-better-rollup');
var runSequence = require('run-sequence');
var sass = require('gulp-sass');
var sourcemaps = require('gulp-sourcemaps');
var spawn = require('child_process').spawn;
var uglify = require('gulp-uglify');
var minify = require('gulp-babel-minify');
/**
* ----------------------------------------
......@@ -44,27 +47,27 @@ var distJsFile = package.name + '.min.js';
* ----------------------------------------
*/
// Uses Sass compiler to process styles, adds vendor prefixes, minifies, then
// outputs file to the appropriate location.
gulp.task('build:styles', ['build:styles:copy'], function() {
return gulp.src([paths.bulma + bulmaSassFile, paths.src + mainSassFile])
.pipe(concat(globalSassFile))
.pipe(sass({
style: 'compressed',
includePaths: [paths.bulma]
}))
.pipe(concat(distCssFile))
.pipe(postcss([autoprefixer({browsers: ['last 2 versions']})]))
.pipe(cleancss())
.pipe(gulp.dest(paths.dest));
});
// Copy original sass file to dist
gulp.task('build:styles:copy', function() {
return gulp.src(paths.src + mainSassFile)
.pipe(concat(globalSassFile))
.pipe(gulp.dest(paths.dest));
});
// Uses Sass compiler to process styles, adds vendor prefixes, minifies, then
// outputs file to the appropriate location.
gulp.task('build:styles', ['build:styles:copy'], function() {
return gulp.src([paths.bulma + bulmaSassFile, paths.src + mainSassFile])
.pipe(concat(globalSassFile))
.pipe(sass({
style: 'compressed',
includePaths: [paths.bulma]
}))
.pipe(concat(distCssFile))
.pipe(postcss([autoprefixer({browsers: ['last 2 versions']})]))
.pipe(cleancss())
.pipe(gulp.dest(paths.dest));
});
// Copy original sass file to dist
gulp.task('build:styles:copy', function() {
return gulp.src(paths.src + mainSassFile)
.pipe(concat(globalSassFile))
.pipe(gulp.dest(paths.dest));
});
gulp.task('clean:styles', function(callback) {
del([
......@@ -82,28 +85,38 @@ gulp.task('clean:styles', function(callback) {
// Concatenates and uglifies global JS files and outputs result to the
// appropriate location.
gulp.task('build:scripts', ['build:scripts:copy'], function() {
gulp.task('build:scripts', function() {
return gulp
.src([paths.src + paths.jsPattern])
.pipe(concat(distJsFile))
.pipe(babel({
"presets": [
["@babel/preset-env", {
"modules": "umd",
"targets": {
"browsers": ["last 2 versions"]
}
}]
]
.pipe(sourcemaps.init({
loadMaps: true
}))
.pipe(uglify())
.pipe(gulp.dest(paths.dest));
});
// Copy original sripts file to dist
gulp.task('build:scripts:copy', function() {
return gulp.src(paths.src + mainJsFile)
.pipe(rollup({
plugins: [babel({
babelrc: false,
sourceMaps: true,
exclude: 'node_modules/**',
presets: [
["@babel/preset-env", {
"modules": false,
"targets": {
"browsers": gutil.env.babelTarget ? gutil.env.babelTarget : ["last 2 versions"]
}
}]
]
})]
}, {
format: gutil.env.jsFormat ? gutil.env.jsFormat : 'iife',
name: camelCase(package.name)
}
))
.pipe(concat(globalJsFile))
.pipe(gulp.dest(paths.dest))
.pipe(concat(distJsFile))
.pipe(minify().on('error', function(err) {
gutil.log(gutil.colors.red('[Error]'), err.toString())
}))
.pipe(sourcemaps.write())
.pipe(gulp.dest(paths.dest));
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment