From ba55bd74053a736f58c4ba7537607181b504a2c2 Mon Sep 17 00:00:00 2001 From: austin-roy <69032762+austin-roy@users.noreply.github.com> Date: Thu, 5 Nov 2020 17:31:17 +0530 Subject: [PATCH 01/14] Update react-emojione.js --- src/react-emojione.js | 291 ++++++++++++++++++++++++++++++------------ 1 file changed, 209 insertions(+), 82 deletions(-) diff --git a/src/react-emojione.js b/src/react-emojione.js index 2ca0681..b04db2c 100644 --- a/src/react-emojione.js +++ b/src/react-emojione.js @@ -1,16 +1,44 @@ -/*! - * react-emojione - * Copyright(c) 2017 Pedro Ladaria - * MIT Licensed - * - * Emoji provided free by http://emojione.com - */ -import React from 'react'; -import ASCII_DATA from './data/ascii-to-unicode'; -import getRenderer from './renderers/renderer-factory'; -import {unicodes, shortToCodepoint, unicodeToCodepoint} from './utils/emoji-format-conversion'; - -const DEFAULT_OPTIONS = { +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.emojify = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); /*! + * react-emojione + * Copyright(c) 2017 Pedro Ladaria + * MIT Licensed + * + * Emoji provided free by http://emojione.com + */ + + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _asciiToUnicode = require('./data/ascii-to-unicode'); + +var _asciiToUnicode2 = _interopRequireDefault(_asciiToUnicode); + +var _rendererFactory = require('./renderers/renderer-factory'); + +var _rendererFactory2 = _interopRequireDefault(_rendererFactory); + +var _emojiFormatConversion = require('./utils/emoji-format-conversion'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var DEFAULT_OPTIONS = { convertShortnames: true, convertUnicode: true, convertAscii: true, @@ -21,58 +49,95 @@ const DEFAULT_OPTIONS = { output: 'emoji' // valid options: 'emoji', 'unicode' }; -const asciiToUnicodeCache = new Map(); -const asciiRegExpToUnicode = new Map(); +var asciiToUnicodeCache = new Map(); +var asciiRegExpToUnicode = new Map(); -ASCII_DATA.forEach(([reStr, unicode]) => asciiRegExpToUnicode.set(RegExp(reStr), unicode)); +_asciiToUnicode2.default.forEach(function (_ref) { + var _ref2 = _slicedToArray(_ref, 2), + reStr = _ref2[0], + unicode = _ref2[1]; -// Escape RegExp code borrowed from lodash -const reRegExpChar = /[\\^$.*+?()[\]{}|]/g; -const reHasRegExpChar = RegExp(reRegExpChar.source); -const escapeRegExp = s => - (s && reHasRegExpChar.test(s)) ? s.replace(reRegExpChar, '\\$&') : s; + return asciiRegExpToUnicode.set(RegExp(reStr), unicode); +}); +// Escape RegExp code borrowed from lodash +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; +var reHasRegExpChar = RegExp(reRegExpChar.source); +var escapeRegExp = function escapeRegExp(s) { + return s && reHasRegExpChar.test(s) ? s.replace(reRegExpChar, '\\$&') : s; +}; -const convertAsciiToUnicodeOrNull = text => { +var convertAsciiToUnicodeOrNull = function convertAsciiToUnicodeOrNull(text) { if (!text) { return ''; } - const str = String(text); + var str = String(text); if (asciiToUnicodeCache.has(str)) { return asciiToUnicodeCache.get(str); } - for (const [regExp, unicode] of asciiRegExpToUnicode.entries()) { - if (str.replace(regExp, unicode) === unicode) { - asciiToUnicodeCache.set(str, unicode); - return unicode; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = asciiRegExpToUnicode.entries()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var _step$value = _slicedToArray(_step.value, 2), + regExp = _step$value[0], + unicode = _step$value[1]; + + if (str.replace(regExp, unicode) === unicode) { + asciiToUnicodeCache.set(str, unicode); + return unicode; + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } } } + return null; }; -const asciiRegexStr = ASCII_DATA.map(([reStr, ]) => reStr).join('|'); -const unicodesRegexStr = unicodes.map(escapeRegExp).join('|'); -const shortnamesRegexStr = ':[+-\\d\\w]+:'; +var asciiRegexStr = _asciiToUnicode2.default.map(function (_ref3) { + var _ref4 = _slicedToArray(_ref3, 1), + reStr = _ref4[0]; + + return reStr; +}).join('|'); +var unicodesRegexStr = _emojiFormatConversion.unicodes.map(escapeRegExp).join('|'); +var shortnamesRegexStr = ':[+-\\d\\w]+:'; -const REGEX_CACHE = []; +var REGEX_CACHE = []; -const getRegex = (withUnicode, withAscii, withShortnames) => { - const index = (withUnicode ? 1 : 0) + (withAscii ? 2 : 0) + (withShortnames ? 4 : 0); +var getRegex = function getRegex(withUnicode, withAscii, withShortnames) { + var index = (withUnicode ? 1 : 0) + (withAscii ? 2 : 0) + (withShortnames ? 4 : 0); if (!REGEX_CACHE[index]) { - const parts = [ - withShortnames ? shortnamesRegexStr : '', - withUnicode ? unicodesRegexStr : '', - withAscii ? asciiRegexStr : '', - ].filter(Boolean); - REGEX_CACHE[index] = RegExp(`(${parts.join('|')})`); + var parts = [withShortnames ? shortnamesRegexStr : '', withUnicode ? unicodesRegexStr : '', withAscii ? asciiRegexStr : ''].filter(Boolean); + REGEX_CACHE[index] = RegExp('(' + parts.join('|') + ')'); } return REGEX_CACHE[index]; }; -const startsWithSpace = str => (/^\s/).test(str); -const endsWithSpace = str => (/\s$/).test(str); +var startsWithSpace = function startsWithSpace(str) { + return (/^\s/.test(str) + ); +}; +var endsWithSpace = function endsWithSpace(str) { + return (/\s$/.test(str) + ); +}; -const shouldConvertAscii = (parts, index) => { +var shouldConvertAscii = function shouldConvertAscii(parts, index) { if (parts.length === 1) { return true; } @@ -85,55 +150,117 @@ const shouldConvertAscii = (parts, index) => { return endsWithSpace(parts[index - 1]) && startsWithSpace(parts[index + 1]); }; -export const emojify = (str, options = {}) => { +var emojify = exports.emojify = function emojify(str) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - const mergedOptions = Object.assign({}, DEFAULT_OPTIONS, options); - const {convertShortnames, convertUnicode, convertAscii} = mergedOptions; + var mergedOptions = Object.assign({}, DEFAULT_OPTIONS, options); - const regExp = getRegex(convertUnicode, convertAscii, convertShortnames); + var convertShortnames = mergedOptions.convertShortnames, + convertUnicode = mergedOptions.convertUnicode, + convertAscii = mergedOptions.convertAscii; - const renderCodepoint = getRenderer(mergedOptions); - const convertedParts = str.split(regExp).filter(Boolean).map((part, index, parts) => { - if (convertAscii && shouldConvertAscii(parts, index)) { - const unicode = convertAsciiToUnicodeOrNull(part); - if (unicode) { - return renderCodepoint(unicodeToCodepoint.get(unicode), `a-${index}`); - } - } - if (convertShortnames && shortToCodepoint.has(part)) { - return renderCodepoint(shortToCodepoint.get(part), `s-${index}`); - } - if (convertUnicode && unicodeToCodepoint.has(part)) { - return renderCodepoint(unicodeToCodepoint.get(part), `u-${index}`); - } - return part; - }); + var regExp = getRegex(convertUnicode, convertAscii, convertShortnames); + + var renderCodepoint = (0, _rendererFactory2.default)(mergedOptions); + if(mergedOptions.output === 'unicode'){ + var convertedParts = str.split(regExp).filter(Boolean).map(function (part, index, parts) { + if (convertAscii && shouldConvertAscii(parts, index)) { + var unicode = convertAsciiToUnicodeOrNull(part); + if (unicode) { + return renderCodepoint(_emojiFormatConversion.unicodeToCodepoint.get(unicode), 'a-' + index); + } + } + if (convertShortnames && _emojiFormatConversion.shortToCodepoint.has(part)) { + return renderCodepoint(_emojiFormatConversion.shortToCodepoint.get(part), 's-' + index); + } + if (convertUnicode && _emojiFormatConversion.unicodeToCodepoint.has(part)) { + return renderCodepoint(_emojiFormatConversion.unicodeToCodepoint.get(part), 'u-' + index); + } + return part; + }); + } + else if(mergedOptions.output === 'emojiShortName'){ + var convertedParts = str.split(regExp).filter(Boolean).map(function (part, index, parts) { + if (convertAscii && shouldConvertAscii(parts, index)) { + var unicode = convertAsciiToUnicodeOrNull(part); + if (unicode) { + var codepoint = _emojiFormatConversion.unicodeToCodepoint.get(unicode); + var shortName = _emojiFormatConversion.codepointToShort.get(codepoint); + return shortName; + } + } + if (convertShortnames && _emojiFormatConversion.shortToCodepoint.has(part)) { + var codepoint = _emojiFormatConversion.shortToCodepoint.get(part); + var shortName = _emojiFormatConversion.codepointToShort.get(codepoint); + return shortName; + + } + if (convertUnicode && _emojiFormatConversion.unicodeToCodepoint.has(part)) { + var codepoint = _emojiFormatConversion.unicodeToCodepoint.get(part); + var shortName = _emojiFormatConversion.codepointToShort.get(codepoint); + return shortName; + } + + return part; + }); + + } + else{ + var convertedParts = str.split(regExp).filter(Boolean).map(function (part, index, parts) { + if (convertAscii && shouldConvertAscii(parts, index)) { + var unicode = convertAsciiToUnicodeOrNull(part); + if (unicode) { + return renderCodepoint(_emojiFormatConversion.unicodeToCodepoint.get(unicode), 'a-' + index); + } + } + if (convertShortnames && _emojiFormatConversion.shortToCodepoint.has(part)) { + return renderCodepoint(_emojiFormatConversion.shortToCodepoint.get(part), 's-' + index); + } + if (convertUnicode && _emojiFormatConversion.unicodeToCodepoint.has(part)) { + return renderCodepoint(_emojiFormatConversion.unicodeToCodepoint.get(part), 'u-' + index); + } + return part; + }); + } - return mergedOptions.output === 'unicode' ? convertedParts.join('') : convertedParts; + return mergedOptions.output === 'unicode'|| mergedOptions.output === 'emojiShortName' ? convertedParts.join('') : convertedParts; }; -class Emojify extends React.Component { +var Emojify = function (_React$Component) { + _inherits(Emojify, _React$Component); - traverse(children, options) { - return React.Children.map(children, child => { - if (React.isValidElement(child)) { - return React.cloneElement(child, {}, this.traverse(child.props.children, options)); - } - if (typeof child === 'string') { - return emojify(child, options); - } - return child; - }); - } + function Emojify() { + _classCallCheck(this, Emojify); - render() { - const children = this.props.children; - return React.Children.count(children) - ? this.traverse(children, this.props) - : null; + return _possibleConstructorReturn(this, (Emojify.__proto__ || Object.getPrototypeOf(Emojify)).apply(this, arguments)); } -} -export default Emojify; + _createClass(Emojify, [{ + key: 'traverse', + value: function traverse(children, options) { + var _this2 = this; + + return _react2.default.Children.map(children, function (child) { + if (_react2.default.isValidElement(child)) { + return _react2.default.cloneElement(child, {}, _this2.traverse(child.props.children, options)); + } + if (typeof child === 'string') { + return emojify(child, options); + } + return child; + }); + } + }, { + key: 'render', + value: function render() { + var children = this.props.children; + return _react2.default.Children.count(children) ? this.traverse(children, this.props) : null; + } + }]); + + return Emojify; +}(_react2.default.Component); + +exports.default = Emojify; From 862abf2f3c21228bbf48dbfce84b6528ccd1ba53 Mon Sep 17 00:00:00 2001 From: austin-roy <69032762+austin-roy@users.noreply.github.com> Date: Thu, 5 Nov 2020 18:54:55 +0530 Subject: [PATCH 02/14] Update .gitignore --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index b9b9660..eba5823 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,3 @@ node_modules npm-debug.log yarn-error.log .yarnclean -/lib From 1ee6b654ddbe4e5290d8e005427ff60a4fa39869 Mon Sep 17 00:00:00 2001 From: austin-roy <69032762+austin-roy@users.noreply.github.com> Date: Thu, 5 Nov 2020 19:09:20 +0530 Subject: [PATCH 03/14] Update .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index eba5823..d3c874c 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ node_modules npm-debug.log yarn-error.log .yarnclean +lib/ From 7dba33857b51e70f7a7e0429f2e903a2ecb00bbc Mon Sep 17 00:00:00 2001 From: austin-roy <69032762+austin-roy@users.noreply.github.com> Date: Thu, 5 Nov 2020 19:10:39 +0530 Subject: [PATCH 04/14] Update .gitignore --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index d3c874c..b9b9660 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,4 @@ node_modules npm-debug.log yarn-error.log .yarnclean -lib/ +/lib From 89e521dc1ea341ea624b1df79022ef8190870ed9 Mon Sep 17 00:00:00 2001 From: austin-roy <69032762+austin-roy@users.noreply.github.com> Date: Thu, 5 Nov 2020 19:15:55 +0530 Subject: [PATCH 05/14] Update react-emojione.js --- src/react-emojione.js | 291 ++++++++++++------------------------------ 1 file changed, 82 insertions(+), 209 deletions(-) diff --git a/src/react-emojione.js b/src/react-emojione.js index b04db2c..2ca0681 100644 --- a/src/react-emojione.js +++ b/src/react-emojione.js @@ -1,44 +1,16 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.emojify = undefined; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); /*! - * react-emojione - * Copyright(c) 2017 Pedro Ladaria - * MIT Licensed - * - * Emoji provided free by http://emojione.com - */ - - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _asciiToUnicode = require('./data/ascii-to-unicode'); - -var _asciiToUnicode2 = _interopRequireDefault(_asciiToUnicode); - -var _rendererFactory = require('./renderers/renderer-factory'); - -var _rendererFactory2 = _interopRequireDefault(_rendererFactory); - -var _emojiFormatConversion = require('./utils/emoji-format-conversion'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var DEFAULT_OPTIONS = { +/*! + * react-emojione + * Copyright(c) 2017 Pedro Ladaria + * MIT Licensed + * + * Emoji provided free by http://emojione.com + */ +import React from 'react'; +import ASCII_DATA from './data/ascii-to-unicode'; +import getRenderer from './renderers/renderer-factory'; +import {unicodes, shortToCodepoint, unicodeToCodepoint} from './utils/emoji-format-conversion'; + +const DEFAULT_OPTIONS = { convertShortnames: true, convertUnicode: true, convertAscii: true, @@ -49,95 +21,58 @@ var DEFAULT_OPTIONS = { output: 'emoji' // valid options: 'emoji', 'unicode' }; -var asciiToUnicodeCache = new Map(); -var asciiRegExpToUnicode = new Map(); +const asciiToUnicodeCache = new Map(); +const asciiRegExpToUnicode = new Map(); -_asciiToUnicode2.default.forEach(function (_ref) { - var _ref2 = _slicedToArray(_ref, 2), - reStr = _ref2[0], - unicode = _ref2[1]; - - return asciiRegExpToUnicode.set(RegExp(reStr), unicode); -}); +ASCII_DATA.forEach(([reStr, unicode]) => asciiRegExpToUnicode.set(RegExp(reStr), unicode)); // Escape RegExp code borrowed from lodash -var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; -var reHasRegExpChar = RegExp(reRegExpChar.source); -var escapeRegExp = function escapeRegExp(s) { - return s && reHasRegExpChar.test(s) ? s.replace(reRegExpChar, '\\$&') : s; -}; +const reRegExpChar = /[\\^$.*+?()[\]{}|]/g; +const reHasRegExpChar = RegExp(reRegExpChar.source); +const escapeRegExp = s => + (s && reHasRegExpChar.test(s)) ? s.replace(reRegExpChar, '\\$&') : s; + -var convertAsciiToUnicodeOrNull = function convertAsciiToUnicodeOrNull(text) { +const convertAsciiToUnicodeOrNull = text => { if (!text) { return ''; } - var str = String(text); + const str = String(text); if (asciiToUnicodeCache.has(str)) { return asciiToUnicodeCache.get(str); } - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = asciiRegExpToUnicode.entries()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var _step$value = _slicedToArray(_step.value, 2), - regExp = _step$value[0], - unicode = _step$value[1]; - - if (str.replace(regExp, unicode) === unicode) { - asciiToUnicodeCache.set(str, unicode); - return unicode; - } - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } + for (const [regExp, unicode] of asciiRegExpToUnicode.entries()) { + if (str.replace(regExp, unicode) === unicode) { + asciiToUnicodeCache.set(str, unicode); + return unicode; } } - return null; }; -var asciiRegexStr = _asciiToUnicode2.default.map(function (_ref3) { - var _ref4 = _slicedToArray(_ref3, 1), - reStr = _ref4[0]; - - return reStr; -}).join('|'); -var unicodesRegexStr = _emojiFormatConversion.unicodes.map(escapeRegExp).join('|'); -var shortnamesRegexStr = ':[+-\\d\\w]+:'; +const asciiRegexStr = ASCII_DATA.map(([reStr, ]) => reStr).join('|'); +const unicodesRegexStr = unicodes.map(escapeRegExp).join('|'); +const shortnamesRegexStr = ':[+-\\d\\w]+:'; -var REGEX_CACHE = []; +const REGEX_CACHE = []; -var getRegex = function getRegex(withUnicode, withAscii, withShortnames) { - var index = (withUnicode ? 1 : 0) + (withAscii ? 2 : 0) + (withShortnames ? 4 : 0); +const getRegex = (withUnicode, withAscii, withShortnames) => { + const index = (withUnicode ? 1 : 0) + (withAscii ? 2 : 0) + (withShortnames ? 4 : 0); if (!REGEX_CACHE[index]) { - var parts = [withShortnames ? shortnamesRegexStr : '', withUnicode ? unicodesRegexStr : '', withAscii ? asciiRegexStr : ''].filter(Boolean); - REGEX_CACHE[index] = RegExp('(' + parts.join('|') + ')'); + const parts = [ + withShortnames ? shortnamesRegexStr : '', + withUnicode ? unicodesRegexStr : '', + withAscii ? asciiRegexStr : '', + ].filter(Boolean); + REGEX_CACHE[index] = RegExp(`(${parts.join('|')})`); } return REGEX_CACHE[index]; }; -var startsWithSpace = function startsWithSpace(str) { - return (/^\s/.test(str) - ); -}; -var endsWithSpace = function endsWithSpace(str) { - return (/\s$/.test(str) - ); -}; +const startsWithSpace = str => (/^\s/).test(str); +const endsWithSpace = str => (/\s$/).test(str); -var shouldConvertAscii = function shouldConvertAscii(parts, index) { +const shouldConvertAscii = (parts, index) => { if (parts.length === 1) { return true; } @@ -150,117 +85,55 @@ var shouldConvertAscii = function shouldConvertAscii(parts, index) { return endsWithSpace(parts[index - 1]) && startsWithSpace(parts[index + 1]); }; -var emojify = exports.emojify = function emojify(str) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - +export const emojify = (str, options = {}) => { - var mergedOptions = Object.assign({}, DEFAULT_OPTIONS, options); + const mergedOptions = Object.assign({}, DEFAULT_OPTIONS, options); - var convertShortnames = mergedOptions.convertShortnames, - convertUnicode = mergedOptions.convertUnicode, - convertAscii = mergedOptions.convertAscii; + const {convertShortnames, convertUnicode, convertAscii} = mergedOptions; + const regExp = getRegex(convertUnicode, convertAscii, convertShortnames); - var regExp = getRegex(convertUnicode, convertAscii, convertShortnames); + const renderCodepoint = getRenderer(mergedOptions); - var renderCodepoint = (0, _rendererFactory2.default)(mergedOptions); - if(mergedOptions.output === 'unicode'){ - var convertedParts = str.split(regExp).filter(Boolean).map(function (part, index, parts) { - if (convertAscii && shouldConvertAscii(parts, index)) { - var unicode = convertAsciiToUnicodeOrNull(part); - if (unicode) { - return renderCodepoint(_emojiFormatConversion.unicodeToCodepoint.get(unicode), 'a-' + index); - } - } - if (convertShortnames && _emojiFormatConversion.shortToCodepoint.has(part)) { - return renderCodepoint(_emojiFormatConversion.shortToCodepoint.get(part), 's-' + index); - } - if (convertUnicode && _emojiFormatConversion.unicodeToCodepoint.has(part)) { - return renderCodepoint(_emojiFormatConversion.unicodeToCodepoint.get(part), 'u-' + index); - } - return part; - }); - } - else if(mergedOptions.output === 'emojiShortName'){ - var convertedParts = str.split(regExp).filter(Boolean).map(function (part, index, parts) { - if (convertAscii && shouldConvertAscii(parts, index)) { - var unicode = convertAsciiToUnicodeOrNull(part); - if (unicode) { - var codepoint = _emojiFormatConversion.unicodeToCodepoint.get(unicode); - var shortName = _emojiFormatConversion.codepointToShort.get(codepoint); - return shortName; - } - } - if (convertShortnames && _emojiFormatConversion.shortToCodepoint.has(part)) { - var codepoint = _emojiFormatConversion.shortToCodepoint.get(part); - var shortName = _emojiFormatConversion.codepointToShort.get(codepoint); - return shortName; - - } - if (convertUnicode && _emojiFormatConversion.unicodeToCodepoint.has(part)) { - var codepoint = _emojiFormatConversion.unicodeToCodepoint.get(part); - var shortName = _emojiFormatConversion.codepointToShort.get(codepoint); - return shortName; - } - - return part; - }); - - } - else{ - var convertedParts = str.split(regExp).filter(Boolean).map(function (part, index, parts) { - if (convertAscii && shouldConvertAscii(parts, index)) { - var unicode = convertAsciiToUnicodeOrNull(part); - if (unicode) { - return renderCodepoint(_emojiFormatConversion.unicodeToCodepoint.get(unicode), 'a-' + index); - } - } - if (convertShortnames && _emojiFormatConversion.shortToCodepoint.has(part)) { - return renderCodepoint(_emojiFormatConversion.shortToCodepoint.get(part), 's-' + index); - } - if (convertUnicode && _emojiFormatConversion.unicodeToCodepoint.has(part)) { - return renderCodepoint(_emojiFormatConversion.unicodeToCodepoint.get(part), 'u-' + index); - } - return part; - }); - } + const convertedParts = str.split(regExp).filter(Boolean).map((part, index, parts) => { + if (convertAscii && shouldConvertAscii(parts, index)) { + const unicode = convertAsciiToUnicodeOrNull(part); + if (unicode) { + return renderCodepoint(unicodeToCodepoint.get(unicode), `a-${index}`); + } + } + if (convertShortnames && shortToCodepoint.has(part)) { + return renderCodepoint(shortToCodepoint.get(part), `s-${index}`); + } + if (convertUnicode && unicodeToCodepoint.has(part)) { + return renderCodepoint(unicodeToCodepoint.get(part), `u-${index}`); + } + return part; + }); - return mergedOptions.output === 'unicode'|| mergedOptions.output === 'emojiShortName' ? convertedParts.join('') : convertedParts; + return mergedOptions.output === 'unicode' ? convertedParts.join('') : convertedParts; }; -var Emojify = function (_React$Component) { - _inherits(Emojify, _React$Component); - - function Emojify() { - _classCallCheck(this, Emojify); +class Emojify extends React.Component { - return _possibleConstructorReturn(this, (Emojify.__proto__ || Object.getPrototypeOf(Emojify)).apply(this, arguments)); + traverse(children, options) { + return React.Children.map(children, child => { + if (React.isValidElement(child)) { + return React.cloneElement(child, {}, this.traverse(child.props.children, options)); + } + if (typeof child === 'string') { + return emojify(child, options); + } + return child; + }); } - _createClass(Emojify, [{ - key: 'traverse', - value: function traverse(children, options) { - var _this2 = this; - - return _react2.default.Children.map(children, function (child) { - if (_react2.default.isValidElement(child)) { - return _react2.default.cloneElement(child, {}, _this2.traverse(child.props.children, options)); - } - if (typeof child === 'string') { - return emojify(child, options); - } - return child; - }); - } - }, { - key: 'render', - value: function render() { - var children = this.props.children; - return _react2.default.Children.count(children) ? this.traverse(children, this.props) : null; - } - }]); - - return Emojify; -}(_react2.default.Component); + render() { + const children = this.props.children; + return React.Children.count(children) + ? this.traverse(children, this.props) + : null; + } +} -exports.default = Emojify; +export default Emojify; From 414ecc79cff65f244e96e67ce28a8d67054e9387 Mon Sep 17 00:00:00 2001 From: austin-roy <69032762+austin-roy@users.noreply.github.com> Date: Thu, 5 Nov 2020 19:33:12 +0530 Subject: [PATCH 06/14] Update react-emojione.js --- src/react-emojione.js | 291 ++++++++++++++++++++++++++++++------------ 1 file changed, 209 insertions(+), 82 deletions(-) diff --git a/src/react-emojione.js b/src/react-emojione.js index 2ca0681..b04db2c 100644 --- a/src/react-emojione.js +++ b/src/react-emojione.js @@ -1,16 +1,44 @@ -/*! - * react-emojione - * Copyright(c) 2017 Pedro Ladaria - * MIT Licensed - * - * Emoji provided free by http://emojione.com - */ -import React from 'react'; -import ASCII_DATA from './data/ascii-to-unicode'; -import getRenderer from './renderers/renderer-factory'; -import {unicodes, shortToCodepoint, unicodeToCodepoint} from './utils/emoji-format-conversion'; - -const DEFAULT_OPTIONS = { +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.emojify = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); /*! + * react-emojione + * Copyright(c) 2017 Pedro Ladaria + * MIT Licensed + * + * Emoji provided free by http://emojione.com + */ + + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _asciiToUnicode = require('./data/ascii-to-unicode'); + +var _asciiToUnicode2 = _interopRequireDefault(_asciiToUnicode); + +var _rendererFactory = require('./renderers/renderer-factory'); + +var _rendererFactory2 = _interopRequireDefault(_rendererFactory); + +var _emojiFormatConversion = require('./utils/emoji-format-conversion'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var DEFAULT_OPTIONS = { convertShortnames: true, convertUnicode: true, convertAscii: true, @@ -21,58 +49,95 @@ const DEFAULT_OPTIONS = { output: 'emoji' // valid options: 'emoji', 'unicode' }; -const asciiToUnicodeCache = new Map(); -const asciiRegExpToUnicode = new Map(); +var asciiToUnicodeCache = new Map(); +var asciiRegExpToUnicode = new Map(); -ASCII_DATA.forEach(([reStr, unicode]) => asciiRegExpToUnicode.set(RegExp(reStr), unicode)); +_asciiToUnicode2.default.forEach(function (_ref) { + var _ref2 = _slicedToArray(_ref, 2), + reStr = _ref2[0], + unicode = _ref2[1]; -// Escape RegExp code borrowed from lodash -const reRegExpChar = /[\\^$.*+?()[\]{}|]/g; -const reHasRegExpChar = RegExp(reRegExpChar.source); -const escapeRegExp = s => - (s && reHasRegExpChar.test(s)) ? s.replace(reRegExpChar, '\\$&') : s; + return asciiRegExpToUnicode.set(RegExp(reStr), unicode); +}); +// Escape RegExp code borrowed from lodash +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; +var reHasRegExpChar = RegExp(reRegExpChar.source); +var escapeRegExp = function escapeRegExp(s) { + return s && reHasRegExpChar.test(s) ? s.replace(reRegExpChar, '\\$&') : s; +}; -const convertAsciiToUnicodeOrNull = text => { +var convertAsciiToUnicodeOrNull = function convertAsciiToUnicodeOrNull(text) { if (!text) { return ''; } - const str = String(text); + var str = String(text); if (asciiToUnicodeCache.has(str)) { return asciiToUnicodeCache.get(str); } - for (const [regExp, unicode] of asciiRegExpToUnicode.entries()) { - if (str.replace(regExp, unicode) === unicode) { - asciiToUnicodeCache.set(str, unicode); - return unicode; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = asciiRegExpToUnicode.entries()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var _step$value = _slicedToArray(_step.value, 2), + regExp = _step$value[0], + unicode = _step$value[1]; + + if (str.replace(regExp, unicode) === unicode) { + asciiToUnicodeCache.set(str, unicode); + return unicode; + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } } } + return null; }; -const asciiRegexStr = ASCII_DATA.map(([reStr, ]) => reStr).join('|'); -const unicodesRegexStr = unicodes.map(escapeRegExp).join('|'); -const shortnamesRegexStr = ':[+-\\d\\w]+:'; +var asciiRegexStr = _asciiToUnicode2.default.map(function (_ref3) { + var _ref4 = _slicedToArray(_ref3, 1), + reStr = _ref4[0]; + + return reStr; +}).join('|'); +var unicodesRegexStr = _emojiFormatConversion.unicodes.map(escapeRegExp).join('|'); +var shortnamesRegexStr = ':[+-\\d\\w]+:'; -const REGEX_CACHE = []; +var REGEX_CACHE = []; -const getRegex = (withUnicode, withAscii, withShortnames) => { - const index = (withUnicode ? 1 : 0) + (withAscii ? 2 : 0) + (withShortnames ? 4 : 0); +var getRegex = function getRegex(withUnicode, withAscii, withShortnames) { + var index = (withUnicode ? 1 : 0) + (withAscii ? 2 : 0) + (withShortnames ? 4 : 0); if (!REGEX_CACHE[index]) { - const parts = [ - withShortnames ? shortnamesRegexStr : '', - withUnicode ? unicodesRegexStr : '', - withAscii ? asciiRegexStr : '', - ].filter(Boolean); - REGEX_CACHE[index] = RegExp(`(${parts.join('|')})`); + var parts = [withShortnames ? shortnamesRegexStr : '', withUnicode ? unicodesRegexStr : '', withAscii ? asciiRegexStr : ''].filter(Boolean); + REGEX_CACHE[index] = RegExp('(' + parts.join('|') + ')'); } return REGEX_CACHE[index]; }; -const startsWithSpace = str => (/^\s/).test(str); -const endsWithSpace = str => (/\s$/).test(str); +var startsWithSpace = function startsWithSpace(str) { + return (/^\s/.test(str) + ); +}; +var endsWithSpace = function endsWithSpace(str) { + return (/\s$/.test(str) + ); +}; -const shouldConvertAscii = (parts, index) => { +var shouldConvertAscii = function shouldConvertAscii(parts, index) { if (parts.length === 1) { return true; } @@ -85,55 +150,117 @@ const shouldConvertAscii = (parts, index) => { return endsWithSpace(parts[index - 1]) && startsWithSpace(parts[index + 1]); }; -export const emojify = (str, options = {}) => { +var emojify = exports.emojify = function emojify(str) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - const mergedOptions = Object.assign({}, DEFAULT_OPTIONS, options); - const {convertShortnames, convertUnicode, convertAscii} = mergedOptions; + var mergedOptions = Object.assign({}, DEFAULT_OPTIONS, options); - const regExp = getRegex(convertUnicode, convertAscii, convertShortnames); + var convertShortnames = mergedOptions.convertShortnames, + convertUnicode = mergedOptions.convertUnicode, + convertAscii = mergedOptions.convertAscii; - const renderCodepoint = getRenderer(mergedOptions); - const convertedParts = str.split(regExp).filter(Boolean).map((part, index, parts) => { - if (convertAscii && shouldConvertAscii(parts, index)) { - const unicode = convertAsciiToUnicodeOrNull(part); - if (unicode) { - return renderCodepoint(unicodeToCodepoint.get(unicode), `a-${index}`); - } - } - if (convertShortnames && shortToCodepoint.has(part)) { - return renderCodepoint(shortToCodepoint.get(part), `s-${index}`); - } - if (convertUnicode && unicodeToCodepoint.has(part)) { - return renderCodepoint(unicodeToCodepoint.get(part), `u-${index}`); - } - return part; - }); + var regExp = getRegex(convertUnicode, convertAscii, convertShortnames); + + var renderCodepoint = (0, _rendererFactory2.default)(mergedOptions); + if(mergedOptions.output === 'unicode'){ + var convertedParts = str.split(regExp).filter(Boolean).map(function (part, index, parts) { + if (convertAscii && shouldConvertAscii(parts, index)) { + var unicode = convertAsciiToUnicodeOrNull(part); + if (unicode) { + return renderCodepoint(_emojiFormatConversion.unicodeToCodepoint.get(unicode), 'a-' + index); + } + } + if (convertShortnames && _emojiFormatConversion.shortToCodepoint.has(part)) { + return renderCodepoint(_emojiFormatConversion.shortToCodepoint.get(part), 's-' + index); + } + if (convertUnicode && _emojiFormatConversion.unicodeToCodepoint.has(part)) { + return renderCodepoint(_emojiFormatConversion.unicodeToCodepoint.get(part), 'u-' + index); + } + return part; + }); + } + else if(mergedOptions.output === 'emojiShortName'){ + var convertedParts = str.split(regExp).filter(Boolean).map(function (part, index, parts) { + if (convertAscii && shouldConvertAscii(parts, index)) { + var unicode = convertAsciiToUnicodeOrNull(part); + if (unicode) { + var codepoint = _emojiFormatConversion.unicodeToCodepoint.get(unicode); + var shortName = _emojiFormatConversion.codepointToShort.get(codepoint); + return shortName; + } + } + if (convertShortnames && _emojiFormatConversion.shortToCodepoint.has(part)) { + var codepoint = _emojiFormatConversion.shortToCodepoint.get(part); + var shortName = _emojiFormatConversion.codepointToShort.get(codepoint); + return shortName; + + } + if (convertUnicode && _emojiFormatConversion.unicodeToCodepoint.has(part)) { + var codepoint = _emojiFormatConversion.unicodeToCodepoint.get(part); + var shortName = _emojiFormatConversion.codepointToShort.get(codepoint); + return shortName; + } + + return part; + }); + + } + else{ + var convertedParts = str.split(regExp).filter(Boolean).map(function (part, index, parts) { + if (convertAscii && shouldConvertAscii(parts, index)) { + var unicode = convertAsciiToUnicodeOrNull(part); + if (unicode) { + return renderCodepoint(_emojiFormatConversion.unicodeToCodepoint.get(unicode), 'a-' + index); + } + } + if (convertShortnames && _emojiFormatConversion.shortToCodepoint.has(part)) { + return renderCodepoint(_emojiFormatConversion.shortToCodepoint.get(part), 's-' + index); + } + if (convertUnicode && _emojiFormatConversion.unicodeToCodepoint.has(part)) { + return renderCodepoint(_emojiFormatConversion.unicodeToCodepoint.get(part), 'u-' + index); + } + return part; + }); + } - return mergedOptions.output === 'unicode' ? convertedParts.join('') : convertedParts; + return mergedOptions.output === 'unicode'|| mergedOptions.output === 'emojiShortName' ? convertedParts.join('') : convertedParts; }; -class Emojify extends React.Component { +var Emojify = function (_React$Component) { + _inherits(Emojify, _React$Component); - traverse(children, options) { - return React.Children.map(children, child => { - if (React.isValidElement(child)) { - return React.cloneElement(child, {}, this.traverse(child.props.children, options)); - } - if (typeof child === 'string') { - return emojify(child, options); - } - return child; - }); - } + function Emojify() { + _classCallCheck(this, Emojify); - render() { - const children = this.props.children; - return React.Children.count(children) - ? this.traverse(children, this.props) - : null; + return _possibleConstructorReturn(this, (Emojify.__proto__ || Object.getPrototypeOf(Emojify)).apply(this, arguments)); } -} -export default Emojify; + _createClass(Emojify, [{ + key: 'traverse', + value: function traverse(children, options) { + var _this2 = this; + + return _react2.default.Children.map(children, function (child) { + if (_react2.default.isValidElement(child)) { + return _react2.default.cloneElement(child, {}, _this2.traverse(child.props.children, options)); + } + if (typeof child === 'string') { + return emojify(child, options); + } + return child; + }); + } + }, { + key: 'render', + value: function render() { + var children = this.props.children; + return _react2.default.Children.count(children) ? this.traverse(children, this.props) : null; + } + }]); + + return Emojify; +}(_react2.default.Component); + +exports.default = Emojify; From d8769a4e665621697f31afccad1b2410ae07afd4 Mon Sep 17 00:00:00 2001 From: austin-roy <69032762+austin-roy@users.noreply.github.com> Date: Thu, 5 Nov 2020 19:33:37 +0530 Subject: [PATCH 07/14] Update .npmignore --- .npmignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.npmignore b/.npmignore index cda2691..50f8ec2 100644 --- a/.npmignore +++ b/.npmignore @@ -1,5 +1,4 @@ assets -src scripts demo npm-debug.log From 996303b499139c07d10898654e47a02bd7f10fa2 Mon Sep 17 00:00:00 2001 From: austin-roy <69032762+austin-roy@users.noreply.github.com> Date: Thu, 5 Nov 2020 19:41:19 +0530 Subject: [PATCH 08/14] Update .npmignore --- .npmignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.npmignore b/.npmignore index 50f8ec2..cda2691 100644 --- a/.npmignore +++ b/.npmignore @@ -1,4 +1,5 @@ assets +src scripts demo npm-debug.log From 7a4c1485bac593bb44873a8054d4fca048fdca93 Mon Sep 17 00:00:00 2001 From: austin-roy <69032762+austin-roy@users.noreply.github.com> Date: Thu, 5 Nov 2020 20:37:09 +0530 Subject: [PATCH 09/14] Update .npmignore --- .npmignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.npmignore b/.npmignore index cda2691..50f8ec2 100644 --- a/.npmignore +++ b/.npmignore @@ -1,5 +1,4 @@ assets -src scripts demo npm-debug.log From e52ea5452589ec6b7a1ad6a696558c7c8a25dd8e Mon Sep 17 00:00:00 2001 From: austin-roy <69032762+austin-roy@users.noreply.github.com> Date: Thu, 5 Nov 2020 21:22:19 +0530 Subject: [PATCH 10/14] Update .npmignore --- .npmignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.npmignore b/.npmignore index 50f8ec2..cda2691 100644 --- a/.npmignore +++ b/.npmignore @@ -1,4 +1,5 @@ assets +src scripts demo npm-debug.log From 7ca422025bb217052c874365c0d581ccad85151f Mon Sep 17 00:00:00 2001 From: austin-roy <69032762+austin-roy@users.noreply.github.com> Date: Fri, 6 Nov 2020 00:08:41 +0530 Subject: [PATCH 11/14] Update .gitignore --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index b9b9660..eba5823 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,3 @@ node_modules npm-debug.log yarn-error.log .yarnclean -/lib From 35c790df0d2f4530799cde215c7954f9a3c973ab Mon Sep 17 00:00:00 2001 From: austin-roy <69032762+austin-roy@users.noreply.github.com> Date: Fri, 6 Nov 2020 00:17:42 +0530 Subject: [PATCH 12/14] Update .npmignore --- .npmignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.npmignore b/.npmignore index cda2691..50f8ec2 100644 --- a/.npmignore +++ b/.npmignore @@ -1,5 +1,4 @@ assets -src scripts demo npm-debug.log From e61f1487b1930436977f0585cea2827692b9b3f4 Mon Sep 17 00:00:00 2001 From: austin-roy <69032762+austin-roy@users.noreply.github.com> Date: Fri, 6 Nov 2020 00:21:24 +0530 Subject: [PATCH 13/14] Update .npmignore --- .npmignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.npmignore b/.npmignore index 50f8ec2..cda2691 100644 --- a/.npmignore +++ b/.npmignore @@ -1,4 +1,5 @@ assets +src scripts demo npm-debug.log From 9524bd1d506a04fd90081c232660a2326f1e03d5 Mon Sep 17 00:00:00 2001 From: austin-roy <69032762+austin-roy@users.noreply.github.com> Date: Fri, 6 Nov 2020 00:30:21 +0530 Subject: [PATCH 14/14] Update .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index eba5823..b9b9660 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ node_modules npm-debug.log yarn-error.log .yarnclean +/lib