From 37f9fab7dfd367fd88826fbd25af33e88475e25c Mon Sep 17 00:00:00 2001 From: Cheton Wu Date: Wed, 19 Apr 2017 10:56:52 +0800 Subject: [PATCH] Replaces React.PropTypes references with prop-types --- dist/react-breadcrumbs.css | 2 +- dist/react-breadcrumbs.min.css | 2 +- docs/bundle.js | 6481 ++++++++++++++++++++++---------- docs/bundle.js.map | 2 +- docs/index.html | 4 +- package.json | 41 +- src/Breadcrumbs.jsx | 3 +- src/BreadcrumbsItem.jsx | 3 +- 8 files changed, 4584 insertions(+), 1954 deletions(-) diff --git a/dist/react-breadcrumbs.css b/dist/react-breadcrumbs.css index 4cb8e5c..6dcad3d 100644 --- a/dist/react-breadcrumbs.css +++ b/dist/react-breadcrumbs.css @@ -1,4 +1,4 @@ -/*! react-breadcrumbs v0.5.1 | (c) 2017 Trend Micro Inc. | MIT | https://github.com/trendmicro-frontend/react-breadcrumbs */ +/*! react-breadcrumbs v0.5.2 | (c) 2017 Trend Micro Inc. | MIT | https://github.com/trendmicro-frontend/react-breadcrumbs */ .breadcrumbs---breadcrumbs---3kWUN { padding: 12px 0; margin-bottom: 0; diff --git a/dist/react-breadcrumbs.min.css b/dist/react-breadcrumbs.min.css index 96e6041..a703803 100644 --- a/dist/react-breadcrumbs.min.css +++ b/dist/react-breadcrumbs.min.css @@ -1 +1 @@ -/*! react-breadcrumbs v0.5.1 | (c) 2017 Trend Micro Inc. | MIT | https://github.com/trendmicro-frontend/react-breadcrumbs */.breadcrumbs---breadcrumbs---3kWUN{padding:12px 0;margin-bottom:0;list-style:none;background-color:transparent}.breadcrumbs---breadcrumbs---3kWUN.breadcrumbs---line-separator---3SKoW{margin-bottom:16px;border-bottom:1px #e6e6e6 solid}.breadcrumbs---breadcrumbs---3kWUN>li{display:inline-block;font-size:16px;line-height:24px;color:#888}.breadcrumbs---breadcrumbs---3kWUN>li.breadcrumbs---active---2-a32{color:#222}.breadcrumbs---breadcrumbs---3kWUN>li>a{color:#888;text-decoration:none}.breadcrumbs---breadcrumbs---3kWUN>li>a:focus,.breadcrumbs---breadcrumbs---3kWUN>li>a:hover{color:#0096cc}.breadcrumbs---breadcrumbs---3kWUN>li+li:before{padding:0 5px;color:#888;content:"\203A"} \ No newline at end of file +/*! react-breadcrumbs v0.5.2 | (c) 2017 Trend Micro Inc. | MIT | https://github.com/trendmicro-frontend/react-breadcrumbs */.breadcrumbs---breadcrumbs---3kWUN{padding:12px 0;margin-bottom:0;list-style:none;background-color:transparent}.breadcrumbs---breadcrumbs---3kWUN.breadcrumbs---line-separator---3SKoW{margin-bottom:16px;border-bottom:1px #e6e6e6 solid}.breadcrumbs---breadcrumbs---3kWUN>li{display:inline-block;font-size:16px;line-height:24px;color:#888}.breadcrumbs---breadcrumbs---3kWUN>li.breadcrumbs---active---2-a32{color:#222}.breadcrumbs---breadcrumbs---3kWUN>li>a{color:#888;text-decoration:none}.breadcrumbs---breadcrumbs---3kWUN>li>a:focus,.breadcrumbs---breadcrumbs---3kWUN>li>a:hover{color:#0096cc}.breadcrumbs---breadcrumbs---3kWUN>li+li:before{padding:0 5px;color:#888;content:"\203A"} \ No newline at end of file diff --git a/docs/bundle.js b/docs/bundle.js index 2841d64..29628bf 100644 --- a/docs/bundle.js +++ b/docs/bundle.js @@ -6,9 +6,9 @@ /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) +/******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; -/******/ +/******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, @@ -84,6 +84,10 @@ var _createClass = function () { function defineProperties(target, props) { for var _class, _temp2; +var _propTypes = __webpack_require__("../node_modules/prop-types/index.js"); + +var _propTypes2 = _interopRequireDefault(_propTypes); + var _react = __webpack_require__("../node_modules/react/react.js"); var _react2 = _interopRequireDefault(_react); @@ -186,13 +190,13 @@ var Anchor = (_temp2 = _class = function (_Component) { return Anchor; }(_react.Component), _class.propTypes = { - href: _react.PropTypes.string, - style: _react.PropTypes.object, - onClick: _react.PropTypes.func, - disabled: _react.PropTypes.bool, - role: _react.PropTypes.string, - tabIndex: _react.PropTypes.oneOfType([_react.PropTypes.number, _react.PropTypes.string]), - componentClass: _react.PropTypes.oneOfType([_react.PropTypes.node, _react.PropTypes.string]) + href: _propTypes2.default.string, + style: _propTypes2.default.object, + onClick: _propTypes2.default.func, + disabled: _propTypes2.default.bool, + role: _propTypes2.default.string, + tabIndex: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.string]), + componentClass: _propTypes2.default.oneOfType([_propTypes2.default.func, _propTypes2.default.string]) }, _temp2); exports.default = Anchor; @@ -214,1681 +218,4442 @@ module.exports = _Anchor2.default; /***/ }), -/***/ "../node_modules/classnames/index.js": +/***/ "../node_modules/base64-js/index.js": /***/ (function(module, exports, __webpack_require__) { -var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! - Copyright (c) 2016 Jed Watson. - Licensed under the MIT License (MIT), see - http://jedwatson.github.io/classnames -*/ -/* global define */ +"use strict"; -(function () { - 'use strict'; - var hasOwn = {}.hasOwnProperty; +exports.byteLength = byteLength +exports.toByteArray = toByteArray +exports.fromByteArray = fromByteArray - function classNames () { - var classes = []; +var lookup = [] +var revLookup = [] +var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array - for (var i = 0; i < arguments.length; i++) { - var arg = arguments[i]; - if (!arg) continue; +var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' +for (var i = 0, len = code.length; i < len; ++i) { + lookup[i] = code[i] + revLookup[code.charCodeAt(i)] = i +} - var argType = typeof arg; +revLookup['-'.charCodeAt(0)] = 62 +revLookup['_'.charCodeAt(0)] = 63 - if (argType === 'string' || argType === 'number') { - classes.push(arg); - } else if (Array.isArray(arg)) { - classes.push(classNames.apply(null, arg)); - } else if (argType === 'object') { - for (var key in arg) { - if (hasOwn.call(arg, key) && arg[key]) { - classes.push(key); - } - } - } - } +function placeHoldersCount (b64) { + var len = b64.length + if (len % 4 > 0) { + throw new Error('Invalid string. Length must be a multiple of 4') + } - return classes.join(' '); - } + // the number of equal signs (place holders) + // if there are two placeholders, than the two characters before it + // represent one byte + // if there is only one, then the three characters before it represent 2 bytes + // this is just a cheap hack to not do indexOf twice + return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0 +} - if (typeof module !== 'undefined' && module.exports) { - module.exports = classNames; - } else if (true) { - // register as 'classnames', consistent with npm package name - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function () { - return classNames; - }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { - window.classNames = classNames; - } -}()); +function byteLength (b64) { + // base64 is 4/3 + up to two characters of the original data + return b64.length * 3 / 4 - placeHoldersCount(b64) +} +function toByteArray (b64) { + var i, j, l, tmp, placeHolders, arr + var len = b64.length + placeHolders = placeHoldersCount(b64) -/***/ }), + arr = new Arr(len * 3 / 4 - placeHolders) -/***/ "../node_modules/css-loader/index.js?camelCase&modules&importLoaders=1&localIdentName=[local]---[hash:base64:5]!../node_modules/stylus-loader/index.js!../node_modules/stylint-loader/index.js!../src/index.styl": -/***/ (function(module, exports, __webpack_require__) { + // if there are placeholders, only get up to the last complete 4 chars + l = placeHolders > 0 ? len - 4 : len -exports = module.exports = __webpack_require__("../node_modules/css-loader/lib/css-base.js")(); -// imports + var L = 0 + for (i = 0, j = 0; i < l; i += 4, j += 3) { + tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)] + arr[L++] = (tmp >> 16) & 0xFF + arr[L++] = (tmp >> 8) & 0xFF + arr[L++] = tmp & 0xFF + } -// module -exports.push([module.i, ".breadcrumbs---37XIE {\n padding: 12px 0;\n margin-bottom: 0;\n list-style: none;\n background-color: transparent;\n}\n.breadcrumbs---37XIE.line-separator---3S2Mk {\n margin-bottom: 16px;\n border-bottom: 1px #e6e6e6 solid;\n}\n.breadcrumbs---37XIE > li {\n display: inline-block;\n font-size: 16px;\n line-height: 24px;\n color: #888;\n}\n.breadcrumbs---37XIE > li.active---3WkHr {\n color: #222;\n}\n.breadcrumbs---37XIE > li > a {\n color: #888;\n text-decoration: none;\n}\n.breadcrumbs---37XIE > li > a:hover,\n.breadcrumbs---37XIE > li > a:focus {\n color: #0096cc;\n}\n.breadcrumbs---37XIE > li + li:before {\n padding: 0 5px;\n color: #888;\n content: \"\\203A\";\n}\n", ""]); + if (placeHolders === 2) { + tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4) + arr[L++] = tmp & 0xFF + } else if (placeHolders === 1) { + tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2) + arr[L++] = (tmp >> 8) & 0xFF + arr[L++] = tmp & 0xFF + } -// exports -exports.locals = { - "breadcrumbs": "breadcrumbs---37XIE", - "breadcrumbs": "breadcrumbs---37XIE", - "line-separator": "line-separator---3S2Mk", - "lineSeparator": "line-separator---3S2Mk", - "active": "active---3WkHr", - "active": "active---3WkHr" -}; + return arr +} -/***/ }), +function tripletToBase64 (num) { + return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F] +} -/***/ "../node_modules/css-loader/index.js?camelCase&modules&importLoaders=1&localIdentName=[local]---[hash:base64:5]!../node_modules/stylus-loader/index.js!../node_modules/stylint-loader/index.js!./index.styl": -/***/ (function(module, exports, __webpack_require__) { +function encodeChunk (uint8, start, end) { + var tmp + var output = [] + for (var i = start; i < end; i += 3) { + tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2]) + output.push(tripletToBase64(tmp)) + } + return output.join('') +} -exports = module.exports = __webpack_require__("../node_modules/css-loader/lib/css-base.js")(); -// imports +function fromByteArray (uint8) { + var tmp + var len = uint8.length + var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes + var output = '' + var parts = [] + var maxChunkLength = 16383 // must be multiple of 3 + // go through the array every three bytes, we'll deal with trailing stuff later + for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { + parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength))) + } -// module -exports.push([module.i, ".icon-help---3kkES {\n float: right;\n width: 22px;\n height: 22px;\n margin-top: -1px;\n cursor: pointer;\n background: url(" + __webpack_require__("./icon-help.png") + ") no-repeat center top;\n}\n.icon-help---3kkES:hover {\n background-position: center bottom;\n}\n.icon-help---3kkES:before {\n display: none;\n}\n", ""]); + // pad the end with zeros, but make sure to not forget the extra bytes + if (extraBytes === 1) { + tmp = uint8[len - 1] + output += lookup[tmp >> 2] + output += lookup[(tmp << 4) & 0x3F] + output += '==' + } else if (extraBytes === 2) { + tmp = (uint8[len - 2] << 8) + (uint8[len - 1]) + output += lookup[tmp >> 10] + output += lookup[(tmp >> 4) & 0x3F] + output += lookup[(tmp << 2) & 0x3F] + output += '=' + } -// exports -exports.locals = { - "icon-help": "icon-help---3kkES", - "iconHelp": "icon-help---3kkES" -}; + parts.push(output) -/***/ }), + return parts.join('') +} -/***/ "../node_modules/css-loader/lib/css-base.js": -/***/ (function(module, exports) { -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ -// css base code, injected by the css-loader -module.exports = function() { - var list = []; +/***/ }), - // return the list of modules as css string - list.toString = function toString() { - var result = []; - for(var i = 0; i < this.length; i++) { - var item = this[i]; - if(item[2]) { - result.push("@media " + item[2] + "{" + item[1] + "}"); - } else { - result.push(item[1]); - } - } - return result.join(""); - }; +/***/ "../node_modules/buffer/index.js": +/***/ (function(module, exports, __webpack_require__) { - // import a list of modules into the list - list.i = function(modules, mediaQuery) { - if(typeof modules === "string") - modules = [[null, modules, ""]]; - var alreadyImportedModules = {}; - for(var i = 0; i < this.length; i++) { - var id = this[i][0]; - if(typeof id === "number") - alreadyImportedModules[id] = true; - } - for(i = 0; i < modules.length; i++) { - var item = modules[i]; - // skip already imported module - // this implementation is not 100% perfect for weird media query combinations - // when a module is imported multiple times with different media queries. - // I hope this will never occur (Hey this way we have smaller bundles) - if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) { - if(mediaQuery && !item[2]) { - item[2] = mediaQuery; - } else if(mediaQuery) { - item[2] = "(" + item[2] + ") and (" + mediaQuery + ")"; - } - list.push(item); - } - } - }; - return list; -}; +"use strict"; +/* WEBPACK VAR INJECTION */(function(global) {/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ +/* eslint-disable no-proto */ -/***/ }), -/***/ "../node_modules/fbjs/lib/EventListener.js": -/***/ (function(module, exports, __webpack_require__) { +var base64 = __webpack_require__("../node_modules/base64-js/index.js") +var ieee754 = __webpack_require__("../node_modules/ieee754/index.js") +var isArray = __webpack_require__("../node_modules/isarray/index.js") -"use strict"; -/* WEBPACK VAR INJECTION */(function(process) { +exports.Buffer = Buffer +exports.SlowBuffer = SlowBuffer +exports.INSPECT_MAX_BYTES = 50 /** - * Copyright (c) 2013-present, Facebook, Inc. + * If `Buffer.TYPED_ARRAY_SUPPORT`: + * === true Use Uint8Array implementation (fastest) + * === false Use Object implementation (most compatible, even IE6) * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, + * Opera 11.6+, iOS 4.2+. * - * http://www.apache.org/licenses/LICENSE-2.0 + * Due to various browser bugs, sometimes the Object implementation will be used even + * when the browser supports typed arrays. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Note: * - * @typechecks - */ - -var emptyFunction = __webpack_require__("../node_modules/fbjs/lib/emptyFunction.js"); + * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances, + * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438. + * + * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function. + * + * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of + * incorrect length in some situations. -/** - * Upstream version of event listener. Does not take into account specific - * nature of platform. + * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they + * get the Object implementation, which is slower but behaves correctly. */ -var EventListener = { - /** - * Listen to DOM events during the bubble phase. - * - * @param {DOMEventTarget} target DOM element to register listener on. - * @param {string} eventType Event type, e.g. 'click' or 'mouseover'. - * @param {function} callback Callback function. - * @return {object} Object with a `remove` method. - */ - listen: function listen(target, eventType, callback) { - if (target.addEventListener) { - target.addEventListener(eventType, callback, false); - return { - remove: function remove() { - target.removeEventListener(eventType, callback, false); - } - }; - } else if (target.attachEvent) { - target.attachEvent('on' + eventType, callback); - return { - remove: function remove() { - target.detachEvent('on' + eventType, callback); - } - }; - } - }, +Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined + ? global.TYPED_ARRAY_SUPPORT + : typedArraySupport() - /** - * Listen to DOM events during the capture phase. - * - * @param {DOMEventTarget} target DOM element to register listener on. - * @param {string} eventType Event type, e.g. 'click' or 'mouseover'. - * @param {function} callback Callback function. - * @return {object} Object with a `remove` method. - */ - capture: function capture(target, eventType, callback) { - if (target.addEventListener) { - target.addEventListener(eventType, callback, true); - return { - remove: function remove() { - target.removeEventListener(eventType, callback, true); - } - }; - } else { - if (process.env.NODE_ENV !== 'production') { - console.error('Attempted to listen to events during the capture phase on a ' + 'browser that does not support the capture phase. Your application ' + 'will not receive some events.'); - } - return { - remove: emptyFunction - }; - } - }, +/* + * Export kMaxLength after typed array support is determined. + */ +exports.kMaxLength = kMaxLength() - registerDefault: function registerDefault() {} -}; +function typedArraySupport () { + try { + var arr = new Uint8Array(1) + arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }} + return arr.foo() === 42 && // typed array instances can be augmented + typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray` + arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray` + } catch (e) { + return false + } +} -module.exports = EventListener; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__("../node_modules/process/browser.js"))) +function kMaxLength () { + return Buffer.TYPED_ARRAY_SUPPORT + ? 0x7fffffff + : 0x3fffffff +} -/***/ }), +function createBuffer (that, length) { + if (kMaxLength() < length) { + throw new RangeError('Invalid typed array length') + } + if (Buffer.TYPED_ARRAY_SUPPORT) { + // Return an augmented `Uint8Array` instance, for best performance + that = new Uint8Array(length) + that.__proto__ = Buffer.prototype + } else { + // Fallback: Return an object instance of the Buffer class + if (that === null) { + that = new Buffer(length) + } + that.length = length + } -/***/ "../node_modules/fbjs/lib/ExecutionEnvironment.js": -/***/ (function(module, exports, __webpack_require__) { + return that +} -"use strict"; /** - * Copyright (c) 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * The Buffer constructor returns instances of `Uint8Array` that have their + * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of + * `Uint8Array`, so the returned instances will have all the node `Buffer` methods + * and the `Uint8Array` methods. Square bracket notation works as expected -- it + * returns a single octet. * + * The `Uint8Array` prototype remains unmodified. */ +function Buffer (arg, encodingOrOffset, length) { + if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) { + return new Buffer(arg, encodingOrOffset, length) + } + // Common case. + if (typeof arg === 'number') { + if (typeof encodingOrOffset === 'string') { + throw new Error( + 'If encoding is specified then the first argument must be a string' + ) + } + return allocUnsafe(this, arg) + } + return from(this, arg, encodingOrOffset, length) +} -var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement); - -/** - * Simple, lightweight module assisting with the detection and context of - * Worker. Helps avoid circular dependencies and allows code to reason about - * whether or not they are in a Worker, even if they never include the main - * `ReactWorker` dependency. - */ -var ExecutionEnvironment = { +Buffer.poolSize = 8192 // not used by this implementation - canUseDOM: canUseDOM, +// TODO: Legacy, not needed anymore. Remove in next major version. +Buffer._augment = function (arr) { + arr.__proto__ = Buffer.prototype + return arr +} - canUseWorkers: typeof Worker !== 'undefined', +function from (that, value, encodingOrOffset, length) { + if (typeof value === 'number') { + throw new TypeError('"value" argument must not be a number') + } - canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent), + if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) { + return fromArrayBuffer(that, value, encodingOrOffset, length) + } - canUseViewport: canUseDOM && !!window.screen, + if (typeof value === 'string') { + return fromString(that, value, encodingOrOffset) + } - isInWorker: !canUseDOM // For now, this is true - might change in the future. + return fromObject(that, value) +} -}; +/** + * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError + * if value is a number. + * Buffer.from(str[, encoding]) + * Buffer.from(array) + * Buffer.from(buffer) + * Buffer.from(arrayBuffer[, byteOffset[, length]]) + **/ +Buffer.from = function (value, encodingOrOffset, length) { + return from(null, value, encodingOrOffset, length) +} -module.exports = ExecutionEnvironment; +if (Buffer.TYPED_ARRAY_SUPPORT) { + Buffer.prototype.__proto__ = Uint8Array.prototype + Buffer.__proto__ = Uint8Array + if (typeof Symbol !== 'undefined' && Symbol.species && + Buffer[Symbol.species] === Buffer) { + // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97 + Object.defineProperty(Buffer, Symbol.species, { + value: null, + configurable: true + }) + } +} -/***/ }), +function assertSize (size) { + if (typeof size !== 'number') { + throw new TypeError('"size" argument must be a number') + } else if (size < 0) { + throw new RangeError('"size" argument must not be negative') + } +} -/***/ "../node_modules/fbjs/lib/camelize.js": -/***/ (function(module, exports, __webpack_require__) { +function alloc (that, size, fill, encoding) { + assertSize(size) + if (size <= 0) { + return createBuffer(that, size) + } + if (fill !== undefined) { + // Only pay attention to encoding if it's a string. This + // prevents accidentally sending in a number that would + // be interpretted as a start offset. + return typeof encoding === 'string' + ? createBuffer(that, size).fill(fill, encoding) + : createBuffer(that, size).fill(fill) + } + return createBuffer(that, size) +} -"use strict"; +/** + * Creates a new filled Buffer instance. + * alloc(size[, fill[, encoding]]) + **/ +Buffer.alloc = function (size, fill, encoding) { + return alloc(null, size, fill, encoding) +} +function allocUnsafe (that, size) { + assertSize(size) + that = createBuffer(that, size < 0 ? 0 : checked(size) | 0) + if (!Buffer.TYPED_ARRAY_SUPPORT) { + for (var i = 0; i < size; ++i) { + that[i] = 0 + } + } + return that +} /** - * Copyright (c) 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @typechecks + * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. + * */ +Buffer.allocUnsafe = function (size) { + return allocUnsafe(null, size) +} +/** + * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. */ +Buffer.allocUnsafeSlow = function (size) { + return allocUnsafe(null, size) +} -var _hyphenPattern = /-(.)/g; +function fromString (that, string, encoding) { + if (typeof encoding !== 'string' || encoding === '') { + encoding = 'utf8' + } -/** - * Camelcases a hyphenated string, for example: - * - * > camelize('background-color') - * < "backgroundColor" - * - * @param {string} string - * @return {string} - */ -function camelize(string) { - return string.replace(_hyphenPattern, function (_, character) { - return character.toUpperCase(); - }); + if (!Buffer.isEncoding(encoding)) { + throw new TypeError('"encoding" must be a valid string encoding') + } + + var length = byteLength(string, encoding) | 0 + that = createBuffer(that, length) + + var actual = that.write(string, encoding) + + if (actual !== length) { + // Writing a hex string, for example, that contains invalid characters will + // cause everything after the first invalid character to be ignored. (e.g. + // 'abxxcd' will be treated as 'ab') + that = that.slice(0, actual) + } + + return that } -module.exports = camelize; +function fromArrayLike (that, array) { + var length = array.length < 0 ? 0 : checked(array.length) | 0 + that = createBuffer(that, length) + for (var i = 0; i < length; i += 1) { + that[i] = array[i] & 255 + } + return that +} -/***/ }), +function fromArrayBuffer (that, array, byteOffset, length) { + array.byteLength // this throws if `array` is not a valid ArrayBuffer -/***/ "../node_modules/fbjs/lib/camelizeStyleName.js": -/***/ (function(module, exports, __webpack_require__) { + if (byteOffset < 0 || array.byteLength < byteOffset) { + throw new RangeError('\'offset\' is out of bounds') + } -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @typechecks - */ + if (array.byteLength < byteOffset + (length || 0)) { + throw new RangeError('\'length\' is out of bounds') + } + if (byteOffset === undefined && length === undefined) { + array = new Uint8Array(array) + } else if (length === undefined) { + array = new Uint8Array(array, byteOffset) + } else { + array = new Uint8Array(array, byteOffset, length) + } + if (Buffer.TYPED_ARRAY_SUPPORT) { + // Return an augmented `Uint8Array` instance, for best performance + that = array + that.__proto__ = Buffer.prototype + } else { + // Fallback: Return an object instance of the Buffer class + that = fromArrayLike(that, array) + } + return that +} -var camelize = __webpack_require__("../node_modules/fbjs/lib/camelize.js"); +function fromObject (that, obj) { + if (Buffer.isBuffer(obj)) { + var len = checked(obj.length) | 0 + that = createBuffer(that, len) -var msPattern = /^-ms-/; + if (that.length === 0) { + return that + } -/** - * Camelcases a hyphenated CSS property name, for example: - * - * > camelizeStyleName('background-color') - * < "backgroundColor" - * > camelizeStyleName('-moz-transition') - * < "MozTransition" - * > camelizeStyleName('-ms-transition') - * < "msTransition" - * - * As Andi Smith suggests - * (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix - * is converted to lowercase `ms`. - * - * @param {string} string - * @return {string} - */ -function camelizeStyleName(string) { - return camelize(string.replace(msPattern, 'ms-')); + obj.copy(that, 0, 0, len) + return that + } + + if (obj) { + if ((typeof ArrayBuffer !== 'undefined' && + obj.buffer instanceof ArrayBuffer) || 'length' in obj) { + if (typeof obj.length !== 'number' || isnan(obj.length)) { + return createBuffer(that, 0) + } + return fromArrayLike(that, obj) + } + + if (obj.type === 'Buffer' && isArray(obj.data)) { + return fromArrayLike(that, obj.data) + } + } + + throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.') } -module.exports = camelizeStyleName; +function checked (length) { + // Note: cannot use `length < kMaxLength()` here because that fails when + // length is NaN (which is otherwise coerced to zero.) + if (length >= kMaxLength()) { + throw new RangeError('Attempt to allocate Buffer larger than maximum ' + + 'size: 0x' + kMaxLength().toString(16) + ' bytes') + } + return length | 0 +} -/***/ }), +function SlowBuffer (length) { + if (+length != length) { // eslint-disable-line eqeqeq + length = 0 + } + return Buffer.alloc(+length) +} -/***/ "../node_modules/fbjs/lib/containsNode.js": -/***/ (function(module, exports, __webpack_require__) { +Buffer.isBuffer = function isBuffer (b) { + return !!(b != null && b._isBuffer) +} -"use strict"; +Buffer.compare = function compare (a, b) { + if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { + throw new TypeError('Arguments must be Buffers') + } + if (a === b) return 0 -/** - * Copyright (c) 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * - */ + var x = a.length + var y = b.length -var isTextNode = __webpack_require__("../node_modules/fbjs/lib/isTextNode.js"); + for (var i = 0, len = Math.min(x, y); i < len; ++i) { + if (a[i] !== b[i]) { + x = a[i] + y = b[i] + break + } + } -/*eslint-disable no-bitwise */ + if (x < y) return -1 + if (y < x) return 1 + return 0 +} -/** - * Checks if a given DOM node contains or is another DOM node. - */ -function containsNode(outerNode, innerNode) { - if (!outerNode || !innerNode) { - return false; - } else if (outerNode === innerNode) { - return true; - } else if (isTextNode(outerNode)) { - return false; - } else if (isTextNode(innerNode)) { - return containsNode(outerNode, innerNode.parentNode); - } else if ('contains' in outerNode) { - return outerNode.contains(innerNode); - } else if (outerNode.compareDocumentPosition) { - return !!(outerNode.compareDocumentPosition(innerNode) & 16); - } else { - return false; +Buffer.isEncoding = function isEncoding (encoding) { + switch (String(encoding).toLowerCase()) { + case 'hex': + case 'utf8': + case 'utf-8': + case 'ascii': + case 'latin1': + case 'binary': + case 'base64': + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return true + default: + return false } } -module.exports = containsNode; +Buffer.concat = function concat (list, length) { + if (!isArray(list)) { + throw new TypeError('"list" argument must be an Array of Buffers') + } -/***/ }), + if (list.length === 0) { + return Buffer.alloc(0) + } -/***/ "../node_modules/fbjs/lib/createArrayFromMixed.js": -/***/ (function(module, exports, __webpack_require__) { + var i + if (length === undefined) { + length = 0 + for (i = 0; i < list.length; ++i) { + length += list[i].length + } + } -"use strict"; -/* WEBPACK VAR INJECTION */(function(process) { + var buffer = Buffer.allocUnsafe(length) + var pos = 0 + for (i = 0; i < list.length; ++i) { + var buf = list[i] + if (!Buffer.isBuffer(buf)) { + throw new TypeError('"list" argument must be an Array of Buffers') + } + buf.copy(buffer, pos) + pos += buf.length + } + return buffer +} -/** - * Copyright (c) 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @typechecks - */ +function byteLength (string, encoding) { + if (Buffer.isBuffer(string)) { + return string.length + } + if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' && + (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) { + return string.byteLength + } + if (typeof string !== 'string') { + string = '' + string + } -var invariant = __webpack_require__("../node_modules/fbjs/lib/invariant.js"); + var len = string.length + if (len === 0) return 0 -/** - * Convert array-like objects to arrays. - * - * This API assumes the caller knows the contents of the data type. For less - * well defined inputs use createArrayFromMixed. - * - * @param {object|function|filelist} obj - * @return {array} - */ -function toArray(obj) { - var length = obj.length; + // Use a for loop to avoid recursion + var loweredCase = false + for (;;) { + switch (encoding) { + case 'ascii': + case 'latin1': + case 'binary': + return len + case 'utf8': + case 'utf-8': + case undefined: + return utf8ToBytes(string).length + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return len * 2 + case 'hex': + return len >>> 1 + case 'base64': + return base64ToBytes(string).length + default: + if (loweredCase) return utf8ToBytes(string).length // assume utf8 + encoding = ('' + encoding).toLowerCase() + loweredCase = true + } + } +} +Buffer.byteLength = byteLength - // Some browsers builtin objects can report typeof 'function' (e.g. NodeList - // in old versions of Safari). - !(!Array.isArray(obj) && (typeof obj === 'object' || typeof obj === 'function')) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Array-like object expected') : invariant(false) : void 0; +function slowToString (encoding, start, end) { + var loweredCase = false - !(typeof length === 'number') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Object needs a length property') : invariant(false) : void 0; + // No need to verify that "this.length <= MAX_UINT32" since it's a read-only + // property of a typed array. - !(length === 0 || length - 1 in obj) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Object should have keys for indices') : invariant(false) : void 0; + // This behaves neither like String nor Uint8Array in that we set start/end + // to their upper/lower bounds if the value passed is out of range. + // undefined is handled specially as per ECMA-262 6th Edition, + // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. + if (start === undefined || start < 0) { + start = 0 + } + // Return early if start > this.length. Done here to prevent potential uint32 + // coercion fail below. + if (start > this.length) { + return '' + } - !(typeof obj.callee !== 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Object can\'t be `arguments`. Use rest params ' + '(function(...args) {}) or Array.from() instead.') : invariant(false) : void 0; + if (end === undefined || end > this.length) { + end = this.length + } - // Old IE doesn't give collections access to hasOwnProperty. Assume inputs - // without method will throw during the slice call and skip straight to the - // fallback. - if (obj.hasOwnProperty) { - try { - return Array.prototype.slice.call(obj); - } catch (e) { - // IE < 9 does not support Array#slice on collections objects + if (end <= 0) { + return '' + } + + // Force coersion to uint32. This will also coerce falsey/NaN values to 0. + end >>>= 0 + start >>>= 0 + + if (end <= start) { + return '' + } + + if (!encoding) encoding = 'utf8' + + while (true) { + switch (encoding) { + case 'hex': + return hexSlice(this, start, end) + + case 'utf8': + case 'utf-8': + return utf8Slice(this, start, end) + + case 'ascii': + return asciiSlice(this, start, end) + + case 'latin1': + case 'binary': + return latin1Slice(this, start, end) + + case 'base64': + return base64Slice(this, start, end) + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return utf16leSlice(this, start, end) + + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) + encoding = (encoding + '').toLowerCase() + loweredCase = true } } +} - // Fall back to copying key by key. This assumes all keys have a value, - // so will not preserve sparsely populated inputs. - var ret = Array(length); - for (var ii = 0; ii < length; ii++) { - ret[ii] = obj[ii]; +// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect +// Buffer instances. +Buffer.prototype._isBuffer = true + +function swap (b, n, m) { + var i = b[n] + b[n] = b[m] + b[m] = i +} + +Buffer.prototype.swap16 = function swap16 () { + var len = this.length + if (len % 2 !== 0) { + throw new RangeError('Buffer size must be a multiple of 16-bits') } - return ret; + for (var i = 0; i < len; i += 2) { + swap(this, i, i + 1) + } + return this } -/** - * Perform a heuristic test to determine if an object is "array-like". - * - * A monk asked Joshu, a Zen master, "Has a dog Buddha nature?" - * Joshu replied: "Mu." - * - * This function determines if its argument has "array nature": it returns - * true if the argument is an actual array, an `arguments' object, or an - * HTMLCollection (e.g. node.childNodes or node.getElementsByTagName()). - * - * It will return false for other array-like objects like Filelist. - * - * @param {*} obj - * @return {boolean} - */ -function hasArrayNature(obj) { - return ( - // not null/false - !!obj && ( - // arrays are objects, NodeLists are functions in Safari - typeof obj == 'object' || typeof obj == 'function') && - // quacks like an array - 'length' in obj && - // not window - !('setInterval' in obj) && - // no DOM node should be considered an array-like - // a 'select' element has 'length' and 'item' properties on IE8 - typeof obj.nodeType != 'number' && ( - // a real array - Array.isArray(obj) || - // arguments - 'callee' in obj || - // HTMLCollection/NodeList - 'item' in obj) - ); +Buffer.prototype.swap32 = function swap32 () { + var len = this.length + if (len % 4 !== 0) { + throw new RangeError('Buffer size must be a multiple of 32-bits') + } + for (var i = 0; i < len; i += 4) { + swap(this, i, i + 3) + swap(this, i + 1, i + 2) + } + return this } -/** - * Ensure that the argument is an array by wrapping it in an array if it is not. - * Creates a copy of the argument if it is already an array. - * - * This is mostly useful idiomatically: - * - * var createArrayFromMixed = require('createArrayFromMixed'); - * - * function takesOneOrMoreThings(things) { - * things = createArrayFromMixed(things); - * ... - * } - * - * This allows you to treat `things' as an array, but accept scalars in the API. - * - * If you need to convert an array-like object, like `arguments`, into an array - * use toArray instead. - * - * @param {*} obj - * @return {array} - */ -function createArrayFromMixed(obj) { - if (!hasArrayNature(obj)) { - return [obj]; - } else if (Array.isArray(obj)) { - return obj.slice(); - } else { - return toArray(obj); +Buffer.prototype.swap64 = function swap64 () { + var len = this.length + if (len % 8 !== 0) { + throw new RangeError('Buffer size must be a multiple of 64-bits') + } + for (var i = 0; i < len; i += 8) { + swap(this, i, i + 7) + swap(this, i + 1, i + 6) + swap(this, i + 2, i + 5) + swap(this, i + 3, i + 4) } + return this } -module.exports = createArrayFromMixed; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__("../node_modules/process/browser.js"))) +Buffer.prototype.toString = function toString () { + var length = this.length | 0 + if (length === 0) return '' + if (arguments.length === 0) return utf8Slice(this, 0, length) + return slowToString.apply(this, arguments) +} -/***/ }), +Buffer.prototype.equals = function equals (b) { + if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') + if (this === b) return true + return Buffer.compare(this, b) === 0 +} -/***/ "../node_modules/fbjs/lib/createNodesFromMarkup.js": -/***/ (function(module, exports, __webpack_require__) { +Buffer.prototype.inspect = function inspect () { + var str = '' + var max = exports.INSPECT_MAX_BYTES + if (this.length > 0) { + str = this.toString('hex', 0, max).match(/.{2}/g).join(' ') + if (this.length > max) str += ' ... ' + } + return '' +} -"use strict"; -/* WEBPACK VAR INJECTION */(function(process) { +Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) { + if (!Buffer.isBuffer(target)) { + throw new TypeError('Argument must be a Buffer') + } -/** - * Copyright (c) 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @typechecks - */ + if (start === undefined) { + start = 0 + } + if (end === undefined) { + end = target ? target.length : 0 + } + if (thisStart === undefined) { + thisStart = 0 + } + if (thisEnd === undefined) { + thisEnd = this.length + } -/*eslint-disable fb-www/unsafe-html*/ + if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { + throw new RangeError('out of range index') + } -var ExecutionEnvironment = __webpack_require__("../node_modules/fbjs/lib/ExecutionEnvironment.js"); + if (thisStart >= thisEnd && start >= end) { + return 0 + } + if (thisStart >= thisEnd) { + return -1 + } + if (start >= end) { + return 1 + } -var createArrayFromMixed = __webpack_require__("../node_modules/fbjs/lib/createArrayFromMixed.js"); -var getMarkupWrap = __webpack_require__("../node_modules/fbjs/lib/getMarkupWrap.js"); -var invariant = __webpack_require__("../node_modules/fbjs/lib/invariant.js"); + start >>>= 0 + end >>>= 0 + thisStart >>>= 0 + thisEnd >>>= 0 -/** - * Dummy container used to render all markup. - */ -var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null; + if (this === target) return 0 -/** - * Pattern used by `getNodeName`. - */ -var nodeNamePattern = /^\s*<(\w+)/; + var x = thisEnd - thisStart + var y = end - start + var len = Math.min(x, y) -/** - * Extracts the `nodeName` of the first element in a string of markup. - * - * @param {string} markup String of markup. - * @return {?string} Node name of the supplied markup. - */ -function getNodeName(markup) { - var nodeNameMatch = markup.match(nodeNamePattern); - return nodeNameMatch && nodeNameMatch[1].toLowerCase(); + var thisCopy = this.slice(thisStart, thisEnd) + var targetCopy = target.slice(start, end) + + for (var i = 0; i < len; ++i) { + if (thisCopy[i] !== targetCopy[i]) { + x = thisCopy[i] + y = targetCopy[i] + break + } + } + + if (x < y) return -1 + if (y < x) return 1 + return 0 } -/** - * Creates an array containing the nodes rendered from the supplied markup. The - * optionally supplied `handleScript` function will be invoked once for each - * + diff --git a/package.json b/package.json index 5171594..cd42cc3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@trendmicro/react-breadcrumbs", - "version": "0.5.1", + "version": "0.5.2", "description": "Trend Micro Components: React Breadcrumbs", "main": "lib/index.js", "files": [ @@ -49,45 +49,46 @@ }, "dependencies": { "classnames": "^2.2.5", + "prop-types": "^15.5.8", "react-addons-shallow-compare": "^0.14.0 || ^15.0.0" }, "devDependencies": { - "@trendmicro/react-anchor": "~0.5.2", - "@trendmicro/react-buttons": "~1.0.0", - "babel-cli": "~6.23.0", - "babel-core": "~6.23.1", - "babel-eslint": "~7.1.1", - "babel-loader": "~6.3.2", + "@trendmicro/react-anchor": "~0.5.4", + "@trendmicro/react-buttons": "~1.0.3", + "babel-cli": "~6.24.1", + "babel-core": "~6.24.1", + "babel-eslint": "~7.2.2", + "babel-loader": "~6.4.1", "babel-plugin-transform-decorators-legacy": "~1.3.4", - "babel-preset-es2015": "~6.22.0", - "babel-preset-react": "~6.23.0", - "babel-preset-stage-0": "~6.22.0", + "babel-preset-es2015": "~6.24.1", + "babel-preset-react": "~6.24.1", + "babel-preset-stage-0": "~6.24.1", "clean-css": "~4.0.8", "clean-css-cli": "~4.0.8", - "coveralls": "~2.11.16", - "css-loader": "~0.26.2", - "eslint": "~3.16.1", + "coveralls": "~2.13.0", + "css-loader": "~0.28.0", + "eslint": "~3.19.0", "eslint-config-trendmicro": "~0.5.1", - "eslint-loader": "~1.6.3", + "eslint-loader": "~1.7.1", "eslint-plugin-import": "~2.2.0", "eslint-plugin-jsx-a11y": "~2.2.3", "eslint-plugin-react": "~6.10.0", - "extract-text-webpack-plugin": "~2.0.0", - "file-loader": "~0.10.1", + "extract-text-webpack-plugin": "~2.1.0", + "file-loader": "~0.11.1", "find-imports": "~0.5.1", "html-webpack-plugin": "~2.28.0", "http-server": "~0.9.0", "nib": "~1.1.2", "react": "^0.14.0 || ^15.0.0", "react-dom": "^0.14.0 || ^15.0.0", - "style-loader": "~0.13.2", + "style-loader": "~0.16.1", "stylint": "~1.5.9", "stylint-loader": "~1.0.0", - "stylus-loader": "~2.5.0", + "stylus-loader": "~3.0.1", "tap": "~10.3.0", - "trendmicro-ui": "~0.3.0", + "trendmicro-ui": "~0.4.0", "url-loader": "~0.5.8", - "webpack": "~2.2.1", + "webpack": "~2.4.1", "webpack-dev-server": "~2.4.1", "which": "~1.2.12" } diff --git a/src/Breadcrumbs.jsx b/src/Breadcrumbs.jsx index 5a7410d..d6876ad 100644 --- a/src/Breadcrumbs.jsx +++ b/src/Breadcrumbs.jsx @@ -1,5 +1,6 @@ import classNames from 'classnames'; -import React, { Component, cloneElement, PropTypes } from 'react'; +import PropTypes from 'prop-types'; +import React, { Component, cloneElement } from 'react'; import shallowCompare from 'react-addons-shallow-compare'; import styles from './index.styl'; diff --git a/src/BreadcrumbsItem.jsx b/src/BreadcrumbsItem.jsx index 2e0e194..161f844 100644 --- a/src/BreadcrumbsItem.jsx +++ b/src/BreadcrumbsItem.jsx @@ -1,5 +1,6 @@ import classNames from 'classnames'; -import React, { Component, PropTypes } from 'react'; +import PropTypes from 'prop-types'; +import React, { Component } from 'react'; import shallowCompare from 'react-addons-shallow-compare'; import styles from './index.styl';