Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

anchor-ui

Package Overview
Dependencies
Maintainers
2
Versions
203
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

anchor-ui - npm Package Compare versions

Comparing version 1.9.4 to 1.9.5

dist/url-regex.js

51

dist/components/message.js

@@ -49,2 +49,6 @@ 'use strict';

var _urlRegex = require('../url-regex');
var _urlRegex2 = _interopRequireDefault(_urlRegex);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -63,13 +67,2 @@

_createClass(Message, null, [{
key: 'createMarkup',
value: function createMarkup(text) {
var escapedText = (0, _escapeHtml2.default)(text);
return {
__html: _emojione2.default.toImage(escapedText)
};
}
}]);
function Message(props) {

@@ -102,2 +95,30 @@ _classCallCheck(this, Message);

_createClass(Message, [{
key: 'createMarkup',
value: function createMarkup(text) {
var enableLinks = this.props.enableLinks;
var escapedText = (0, _escapeHtml2.default)(text);
var parsedText = escapedText;
if (enableLinks) {
(function () {
var urlSchemeRegex = /^(?:https?:\/\/)/;
parsedText = escapedText.replace(_urlRegex2.default, function (url) {
if (!urlSchemeRegex.test(url)) {
// Add default http:// scheme for urls like example.com
return '<a href="http://' + url + '" target="_blank">' + url + '</a>';
}
return '<a href="' + url + '" target="_blank">' + url + '</a>';
});
})();
}
return {
__html: _emojione2.default.toImage(parsedText)
};
}
}, {
key: 'render',

@@ -158,3 +179,3 @@ value: function render() {

{ className: messageBodyClassName },
emoji ? _react2.default.createElement('span', { dangerouslySetInnerHTML: Message.createMarkup(message.body) }) : message.body
emoji ? _react2.default.createElement('span', { dangerouslySetInnerHTML: this.createMarkup(message.body) }) : message.body
),

@@ -197,3 +218,4 @@ _react2.default.createElement(

myMessage: _react.PropTypes.bool,
emoji: _react.PropTypes.bool
emoji: _react.PropTypes.bool,
enableLinks: _react.PropTypes.bool
};

@@ -208,3 +230,4 @@ Message.defaultProps = {

myMessage: false,
emoji: false
emoji: false,
enableLinks: false
};

@@ -211,0 +234,0 @@ Message.contextTypes = {

@@ -53,7 +53,10 @@ 'use strict';

backgroundColor: _colors2.default.theme,
color: 'white',
color: _colors2.default.white,
marginLeft: '0',
marginRight: '16px',
'& $messageBody': {
color: _colors2.default.white
color: _colors2.default.white,
'& a': {
color: _colors2.default.white
}
},

@@ -92,3 +95,6 @@ '& $messageHeader': {

lineHeight: '18px',
margin: '0'
margin: '0',
'& a': {
color: _colors2.default.primaryText
}
},

@@ -95,0 +101,0 @@ messageTime: {

{
"name": "anchor-ui",
"version": "1.9.4",
"version": "1.9.5",
"description": "React Component UI Kit",

@@ -69,4 +69,5 @@ "main": "dist/index.js",

"dependencies": {
"escape-html": "^1.0.3"
"escape-html": "^1.0.3",
"tlds": "^1.182.0"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc