Skip to content

Commit

Permalink
Some babel changes
Browse files Browse the repository at this point in the history
  • Loading branch information
rakeshgunduka committed Oct 30, 2018
1 parent 6ced05c commit a422167
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"presets": ["es2015", "react"]
"presets": ["@babel/preset-env", "@babel/preset-react"]
}
27 changes: 9 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"name": "kattappa",
"version": "0.8.1",
"version": "0.8.2",
"description": "A block based rich text editor with support of Images, embeds( Youtube, Instagram, Vine, Vimeo etc)",
"main": "./lib/index.js",
"scripts": {
"prepublish": "npm run npm",
"test": "echo \"Error: no test specified\" && exit 1",
"build": "NODE_ENV=production ./node_modules/.bin/webpack",
"npm": "./node_modules/.bin/babel ./src -d lib --ignore 'demo.js'",
"npm": "babel ./src -d lib --ignore 'demo.js'",
"dev": "mkdir -p lib && cp index.template.html lib/index.html && ./node_modules/.bin/webpack-dev-server --host 0.0.0.0 --port 8080 --devtool eval --content-base lib/ --progress --colors --hot"
},
"repository": {
"type": "git",
"url": "https://github.com/brijeshb42/kattappa.git"
"url": "https://github.com/scrolltech/kattappa.git"
},
"keywords": [
"kattappa",
Expand All @@ -22,12 +22,16 @@
"rich-text"
],
"author": "Brijesh Bittu <[email protected]>",
"contributors": "Rakesh Gunduka <[email protected]>",
"license": "MIT",
"bugs": {
"url": "https://github.com/brijeshb42/kattappa/issues"
"url": "https://github.com/scrolltech/kattappa/issues"
},
"homepage": "https://github.com/brijeshb42/kattappa",
"homepage": "https://github.com/scrolltech/kattappa",
"dependencies": {
"@babel/core": "^7.1.2",
"@babel/preset-env": "^7.1.0",
"@babel/preset-react": "^7.0.0",
"html-janitor": "^2.0.2",
"react": "^0.14.6",
"react-dom": "^0.14.6",
Expand All @@ -40,12 +44,9 @@
"scribe-plugin-smart-lists": "^0.1.8"
},
"devDependencies": {
"babel-cli": "^6.11.4",
"babel-core": "^6.9.0",
"babel-loader": "^6.2.4",
"babel-plugin-react-transform": "^2.0.2",
"babel-preset-es2015": "^6.9.0",
"babel-preset-react": "^6.5.0",
"css-loader": "^0.23.1",
"extract-text-webpack-plugin": "^1.0.1",
"imports-loader": "^0.6.5",
Expand All @@ -55,15 +56,5 @@
"style-loader": "^0.13.1",
"webpack": "^1.13.1",
"webpack-dev-server": "^1.14.1"
},
"babel": {
"env": {
"production": {
"plugins": [
"transform-react-constant-elements",
"transform-react-inline-elements"
]
}
}
}
}
25 changes: 12 additions & 13 deletions src/utils/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
export default {
uuid: function() {
function s4() {
return Math.floor((1 + Math.random()) * 0x10000)
.toString(16)
.substring(1);
}
return s4() + '-' + s4();
// return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
// s4() + '-' + s4() + s4() + s4();
},
UrlRegex: /^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]+-?)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]+-?)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/i
};
export function uuid() {
function s4() {
return Math.floor((1 + Math.random()) * 0x10000)
.toString(16)
.substring(1);
}
return s4() + '-' + s4();
// return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
// s4() + '-' + s4() + s4() + s4();
}

export const UrlRegex = /^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]+-?)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]+-?)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/i

0 comments on commit a422167

Please sign in to comment.