react 0.12.1 → 0.13.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (153) hide show
  1. package/dist/JSXTransformer.js +352 -251
  2. package/dist/react-with-addons.js +5409 -4242
  3. package/dist/react-with-addons.min.js +5 -6
  4. package/dist/react.js +5012 -4136
  5. package/dist/react.min.js +5 -6
  6. package/lib/AutoFocusMixin.js +1 -1
  7. package/lib/BeforeInputEventPlugin.js +389 -112
  8. package/lib/CSSProperty.js +6 -3
  9. package/lib/CSSPropertyOperations.js +57 -10
  10. package/lib/CallbackQueue.js +2 -2
  11. package/lib/ChangeEventPlugin.js +3 -3
  12. package/lib/ClientReactRootIndex.js +1 -1
  13. package/lib/DOMChildrenOperations.js +6 -4
  14. package/lib/DOMProperty.js +1 -1
  15. package/lib/DOMPropertyOperations.js +4 -2
  16. package/lib/Danger.js +7 -6
  17. package/lib/DefaultEventPluginOrder.js +1 -2
  18. package/lib/EnterLeaveEventPlugin.js +1 -1
  19. package/lib/EventConstants.js +1 -1
  20. package/lib/EventPluginHub.js +9 -7
  21. package/lib/EventPluginRegistry.js +1 -1
  22. package/lib/EventPluginUtils.js +1 -1
  23. package/lib/EventPropagators.js +1 -1
  24. package/lib/ExecutionEnvironment.js +2 -3
  25. package/lib/FallbackCompositionState.js +89 -0
  26. package/lib/HTMLDOMPropertyConfig.js +19 -7
  27. package/lib/LinkedStateMixin.js +1 -1
  28. package/lib/LinkedValueUtils.js +3 -3
  29. package/lib/LocalEventTrapMixin.js +9 -2
  30. package/lib/MobileSafariClickEventPlugin.js +1 -1
  31. package/lib/Object.assign.js +3 -1
  32. package/lib/PooledClass.js +1 -1
  33. package/lib/React.js +17 -51
  34. package/lib/ReactBrowserComponentMixin.js +3 -13
  35. package/lib/ReactBrowserEventEmitter.js +4 -6
  36. package/lib/ReactCSSTransitionGroup.js +4 -1
  37. package/lib/ReactCSSTransitionGroupChild.js +12 -2
  38. package/lib/ReactChildReconciler.js +125 -0
  39. package/lib/ReactChildren.js +10 -8
  40. package/lib/ReactClass.js +916 -0
  41. package/lib/ReactComponent.js +81 -404
  42. package/lib/ReactComponentBrowserEnvironment.js +10 -83
  43. package/lib/ReactComponentEnvironment.js +57 -0
  44. package/lib/ReactComponentWithPureRenderMixin.js +1 -1
  45. package/lib/ReactCompositeComponent.js +533 -1132
  46. package/lib/ReactContext.js +6 -2
  47. package/lib/ReactCurrentOwner.js +1 -1
  48. package/lib/ReactDOM.js +3 -8
  49. package/lib/ReactDOMButton.js +5 -6
  50. package/lib/ReactDOMComponent.js +110 -92
  51. package/lib/ReactDOMForm.js +5 -6
  52. package/lib/ReactDOMIDOperations.js +56 -74
  53. package/lib/ReactDOMImg.js +4 -6
  54. package/lib/ReactDOMInput.js +5 -6
  55. package/lib/ReactDOMOption.js +5 -6
  56. package/lib/ReactDOMSelect.js +57 -65
  57. package/lib/ReactDOMSelection.js +6 -2
  58. package/lib/{ReactTextComponent.js → ReactDOMTextComponent.js} +48 -35
  59. package/lib/ReactDOMTextarea.js +5 -6
  60. package/lib/ReactDefaultBatchingStrategy.js +4 -4
  61. package/lib/ReactDefaultInjection.js +14 -8
  62. package/lib/ReactDefaultPerf.js +16 -7
  63. package/lib/ReactDefaultPerfAnalysis.js +1 -1
  64. package/lib/ReactElement.js +23 -15
  65. package/lib/ReactElementValidator.js +209 -57
  66. package/lib/ReactEmptyComponent.js +29 -11
  67. package/lib/ReactEventEmitterMixin.js +1 -1
  68. package/lib/ReactEventListener.js +3 -4
  69. package/lib/ReactInjection.js +7 -5
  70. package/lib/ReactInputSelection.js +3 -4
  71. package/lib/ReactInstanceHandles.js +3 -2
  72. package/lib/ReactInstanceMap.js +47 -0
  73. package/lib/ReactLifeCycle.js +35 -0
  74. package/lib/ReactLink.js +1 -1
  75. package/lib/ReactMarkupChecksum.js +1 -1
  76. package/lib/ReactMount.js +239 -68
  77. package/lib/ReactMultiChild.js +49 -47
  78. package/lib/ReactMultiChildUpdateTypes.js +1 -1
  79. package/lib/ReactNativeComponent.js +72 -25
  80. package/lib/ReactOwner.js +4 -48
  81. package/lib/ReactPerf.js +21 -1
  82. package/lib/ReactPropTransferer.js +2 -57
  83. package/lib/ReactPropTypeLocationNames.js +1 -1
  84. package/lib/ReactPropTypeLocations.js +1 -1
  85. package/lib/ReactPropTypes.js +14 -22
  86. package/lib/ReactPutListenerQueue.js +1 -1
  87. package/lib/ReactReconcileTransaction.js +1 -1
  88. package/lib/ReactReconciler.js +107 -0
  89. package/lib/ReactRef.js +70 -0
  90. package/lib/ReactRootIndex.js +1 -1
  91. package/lib/ReactServerRendering.js +5 -3
  92. package/lib/ReactServerRenderingTransaction.js +1 -1
  93. package/lib/ReactStateSetters.js +1 -1
  94. package/lib/ReactTestUtils.js +112 -26
  95. package/lib/ReactTransitionChildMapping.js +1 -1
  96. package/lib/ReactTransitionEvents.js +1 -1
  97. package/lib/ReactTransitionGroup.js +48 -7
  98. package/lib/ReactUpdateQueue.js +264 -0
  99. package/lib/ReactUpdates.js +48 -61
  100. package/lib/ReactWithAddons.js +1 -1
  101. package/lib/SVGDOMPropertyConfig.js +1 -1
  102. package/lib/SelectEventPlugin.js +3 -3
  103. package/lib/ServerReactRootIndex.js +1 -1
  104. package/lib/SimpleEventPlugin.js +1 -1
  105. package/lib/SyntheticClipboardEvent.js +1 -2
  106. package/lib/SyntheticCompositionEvent.js +1 -2
  107. package/lib/SyntheticDragEvent.js +1 -1
  108. package/lib/SyntheticEvent.js +11 -3
  109. package/lib/SyntheticFocusEvent.js +1 -1
  110. package/lib/SyntheticInputEvent.js +1 -2
  111. package/lib/SyntheticKeyboardEvent.js +1 -1
  112. package/lib/SyntheticMouseEvent.js +2 -4
  113. package/lib/SyntheticTouchEvent.js +1 -1
  114. package/lib/SyntheticUIEvent.js +1 -1
  115. package/lib/SyntheticWheelEvent.js +1 -1
  116. package/lib/Transaction.js +3 -3
  117. package/lib/ViewportMetrics.js +2 -5
  118. package/lib/accumulateInto.js +1 -1
  119. package/lib/adler32.js +1 -1
  120. package/lib/cloneWithProps.js +3 -3
  121. package/lib/copyProperties.js +2 -0
  122. package/lib/createFullPageComponent.js +3 -3
  123. package/lib/dangerousStyleValue.js +1 -1
  124. package/lib/escapeTextForBrowser.js +6 -6
  125. package/lib/findDOMNode.js +51 -0
  126. package/lib/flattenChildren.js +11 -22
  127. package/lib/forEachAccumulated.js +1 -1
  128. package/lib/getEventCharCode.js +1 -1
  129. package/lib/getEventKey.js +1 -1
  130. package/lib/getEventModifierState.js +1 -1
  131. package/lib/getEventTarget.js +1 -1
  132. package/lib/getIteratorFn.js +42 -0
  133. package/lib/getNodeForCharacterOffset.js +2 -2
  134. package/lib/getReactRootElementInContainer.js +1 -1
  135. package/lib/getTextContentAccessor.js +1 -1
  136. package/lib/instantiateReactComponent.js +85 -67
  137. package/lib/isEventSupported.js +1 -1
  138. package/lib/isNode.js +3 -4
  139. package/lib/isTextInputElement.js +2 -3
  140. package/lib/joinClasses.js +1 -1
  141. package/lib/keyMirror.js +1 -1
  142. package/lib/memoizeStringOnly.js +4 -5
  143. package/lib/onlyChild.js +1 -1
  144. package/lib/setInnerHTML.js +12 -1
  145. package/lib/shallowEqual.js +1 -1
  146. package/lib/shouldUpdateReactComponent.js +48 -6
  147. package/lib/traverseAllChildren.js +111 -55
  148. package/lib/update.js +1 -1
  149. package/lib/warning.js +12 -1
  150. package/package.json +1 -1
  151. package/lib/CompositionEventPlugin.js +0 -257
  152. package/lib/ReactLegacyElement.js +0 -243
  153. package/lib/deprecated.js +0 -47
@@ -1,5 +1,5 @@
1
1
  /**
2
- * JSXTransformer v0.12.1
2
+ * JSXTransformer v0.13.0-beta.1
3
3
  */
4
4
  !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.JSXTransformer=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
5
5
  /**
@@ -86,6 +86,13 @@ function exec(source, options) {
86
86
  */
87
87
  function createSourceCodeErrorMessage(code, e) {
88
88
  var sourceLines = code.split('\n');
89
+ // e.lineNumber is non-standard so we can't depend on its availability. If
90
+ // we're in a browser where it isn't supported, don't even bother trying to
91
+ // format anything. We may also hit a case where the line number is reported
92
+ // incorrectly and is outside the bounds of the actual code. Handle that too.
93
+ if (!e.lineNumber || e.lineNumber > sourceLines.length) {
94
+ return '';
95
+ }
89
96
  var erroneousLine = sourceLines[e.lineNumber - 1];
90
97
 
91
98
  // Removes any leading indenting spaces and gets the number of
@@ -134,7 +141,7 @@ function transformCode(code, url, options) {
134
141
  // The error will correctly point to `url` in Firefox.
135
142
  e.fileName = url;
136
143
  }
137
- e.message += url + ':' + e.lineNumber + ':' + e.column;
144
+ e.message += url + ':' + e.lineNumber + ':' + e.columnNumber;
138
145
  } else {
139
146
  e.message += location.href;
140
147
  }
@@ -251,7 +258,7 @@ function loadScripts(scripts) {
251
258
  sourceMap: true
252
259
  };
253
260
  if (/;harmony=true(;|$)/.test(script.type)) {
254
- options.harmony = true
261
+ options.harmony = true;
255
262
  }
256
263
  if (/;stripTypes=true(;|$)/.test(script.type)) {
257
264
  options.stripTypes = true;
@@ -355,11 +362,12 @@ var ieee754 = _dereq_('ieee754')
355
362
  var isArray = _dereq_('is-array')
356
363
 
357
364
  exports.Buffer = Buffer
358
- exports.SlowBuffer = Buffer
365
+ exports.SlowBuffer = SlowBuffer
359
366
  exports.INSPECT_MAX_BYTES = 50
360
367
  Buffer.poolSize = 8192 // not used by this implementation
361
368
 
362
369
  var kMaxLength = 0x3fffffff
370
+ var rootParent = {}
363
371
 
364
372
  /**
365
373
  * If `Buffer.TYPED_ARRAY_SUPPORT`:
@@ -419,8 +427,6 @@ function Buffer (subject, encoding, noZero) {
419
427
  if (type === 'number')
420
428
  length = subject > 0 ? subject >>> 0 : 0
421
429
  else if (type === 'string') {
422
- if (encoding === 'base64')
423
- subject = base64clean(subject)
424
430
  length = Buffer.byteLength(subject, encoding)
425
431
  } else if (type === 'object' && subject !== null) { // assume object is array-like
426
432
  if (subject.type === 'Buffer' && isArray(subject.data))
@@ -429,7 +435,7 @@ function Buffer (subject, encoding, noZero) {
429
435
  } else
430
436
  throw new TypeError('must start with number, buffer, array or string')
431
437
 
432
- if (this.length > kMaxLength)
438
+ if (length > kMaxLength)
433
439
  throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
434
440
  'size: 0x' + kMaxLength.toString(16) + ' bytes')
435
441
 
@@ -465,6 +471,18 @@ function Buffer (subject, encoding, noZero) {
465
471
  }
466
472
  }
467
473
 
474
+ if (length > 0 && length <= Buffer.poolSize)
475
+ buf.parent = rootParent
476
+
477
+ return buf
478
+ }
479
+
480
+ function SlowBuffer(subject, encoding, noZero) {
481
+ if (!(this instanceof SlowBuffer))
482
+ return new SlowBuffer(subject, encoding, noZero)
483
+
484
+ var buf = new Buffer(subject, encoding, noZero)
485
+ delete buf.parent
468
486
  return buf
469
487
  }
470
488
 
@@ -615,7 +633,7 @@ Buffer.prototype.toString = function (encoding, start, end) {
615
633
  }
616
634
 
617
635
  Buffer.prototype.equals = function (b) {
618
- if(!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
636
+ if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
619
637
  return Buffer.compare(this, b) === 0
620
638
  }
621
639
 
@@ -675,7 +693,7 @@ function hexWrite (buf, string, offset, length) {
675
693
  }
676
694
 
677
695
  function utf8Write (buf, string, offset, length) {
678
- var charsWritten = blitBuffer(utf8ToBytes(string), buf, offset, length)
696
+ var charsWritten = blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
679
697
  return charsWritten
680
698
  }
681
699
 
@@ -694,7 +712,7 @@ function base64Write (buf, string, offset, length) {
694
712
  }
695
713
 
696
714
  function utf16leWrite (buf, string, offset, length) {
697
- var charsWritten = blitBuffer(utf16leToBytes(string), buf, offset, length)
715
+ var charsWritten = blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length, 2)
698
716
  return charsWritten
699
717
  }
700
718
 
@@ -714,6 +732,10 @@ Buffer.prototype.write = function (string, offset, length, encoding) {
714
732
  }
715
733
 
716
734
  offset = Number(offset) || 0
735
+
736
+ if (length < 0 || offset < 0 || offset > this.length)
737
+ throw new RangeError('attempt to write outside buffer bounds');
738
+
717
739
  var remaining = this.length - offset
718
740
  if (!length) {
719
741
  length = remaining
@@ -792,13 +814,19 @@ function asciiSlice (buf, start, end) {
792
814
  end = Math.min(buf.length, end)
793
815
 
794
816
  for (var i = start; i < end; i++) {
795
- ret += String.fromCharCode(buf[i])
817
+ ret += String.fromCharCode(buf[i] & 0x7F)
796
818
  }
797
819
  return ret
798
820
  }
799
821
 
800
822
  function binarySlice (buf, start, end) {
801
- return asciiSlice(buf, start, end)
823
+ var ret = ''
824
+ end = Math.min(buf.length, end)
825
+
826
+ for (var i = start; i < end; i++) {
827
+ ret += String.fromCharCode(buf[i])
828
+ }
829
+ return ret
802
830
  }
803
831
 
804
832
  function hexSlice (buf, start, end) {
@@ -847,16 +875,21 @@ Buffer.prototype.slice = function (start, end) {
847
875
  if (end < start)
848
876
  end = start
849
877
 
878
+ var newBuf
850
879
  if (Buffer.TYPED_ARRAY_SUPPORT) {
851
- return Buffer._augment(this.subarray(start, end))
880
+ newBuf = Buffer._augment(this.subarray(start, end))
852
881
  } else {
853
882
  var sliceLen = end - start
854
- var newBuf = new Buffer(sliceLen, undefined, true)
883
+ newBuf = new Buffer(sliceLen, undefined, true)
855
884
  for (var i = 0; i < sliceLen; i++) {
856
885
  newBuf[i] = this[i + start]
857
886
  }
858
- return newBuf
859
887
  }
888
+
889
+ if (newBuf.length)
890
+ newBuf.parent = this.parent || this
891
+
892
+ return newBuf
860
893
  }
861
894
 
862
895
  /*
@@ -869,6 +902,35 @@ function checkOffset (offset, ext, length) {
869
902
  throw new RangeError('Trying to access beyond buffer length')
870
903
  }
871
904
 
905
+ Buffer.prototype.readUIntLE = function (offset, byteLength, noAssert) {
906
+ offset = offset >>> 0
907
+ byteLength = byteLength >>> 0
908
+ if (!noAssert)
909
+ checkOffset(offset, byteLength, this.length)
910
+
911
+ var val = this[offset]
912
+ var mul = 1
913
+ var i = 0
914
+ while (++i < byteLength && (mul *= 0x100))
915
+ val += this[offset + i] * mul
916
+
917
+ return val
918
+ }
919
+
920
+ Buffer.prototype.readUIntBE = function (offset, byteLength, noAssert) {
921
+ offset = offset >>> 0
922
+ byteLength = byteLength >>> 0
923
+ if (!noAssert)
924
+ checkOffset(offset, byteLength, this.length)
925
+
926
+ var val = this[offset + --byteLength]
927
+ var mul = 1
928
+ while (byteLength > 0 && (mul *= 0x100))
929
+ val += this[offset + --byteLength] * mul;
930
+
931
+ return val
932
+ }
933
+
872
934
  Buffer.prototype.readUInt8 = function (offset, noAssert) {
873
935
  if (!noAssert)
874
936
  checkOffset(offset, 1, this.length)
@@ -907,6 +969,44 @@ Buffer.prototype.readUInt32BE = function (offset, noAssert) {
907
969
  this[offset + 3])
908
970
  }
909
971
 
972
+ Buffer.prototype.readIntLE = function (offset, byteLength, noAssert) {
973
+ offset = offset >>> 0
974
+ byteLength = byteLength >>> 0
975
+ if (!noAssert)
976
+ checkOffset(offset, byteLength, this.length)
977
+
978
+ var val = this[offset]
979
+ var mul = 1
980
+ var i = 0
981
+ while (++i < byteLength && (mul *= 0x100))
982
+ val += this[offset + i] * mul
983
+ mul *= 0x80
984
+
985
+ if (val >= mul)
986
+ val -= Math.pow(2, 8 * byteLength)
987
+
988
+ return val
989
+ }
990
+
991
+ Buffer.prototype.readIntBE = function (offset, byteLength, noAssert) {
992
+ offset = offset >>> 0
993
+ byteLength = byteLength >>> 0
994
+ if (!noAssert)
995
+ checkOffset(offset, byteLength, this.length)
996
+
997
+ var i = byteLength
998
+ var mul = 1
999
+ var val = this[offset + --i]
1000
+ while (i > 0 && (mul *= 0x100))
1001
+ val += this[offset + --i] * mul
1002
+ mul *= 0x80
1003
+
1004
+ if (val >= mul)
1005
+ val -= Math.pow(2, 8 * byteLength)
1006
+
1007
+ return val
1008
+ }
1009
+
910
1010
  Buffer.prototype.readInt8 = function (offset, noAssert) {
911
1011
  if (!noAssert)
912
1012
  checkOffset(offset, 1, this.length)
@@ -975,8 +1075,40 @@ Buffer.prototype.readDoubleBE = function (offset, noAssert) {
975
1075
 
976
1076
  function checkInt (buf, value, offset, ext, max, min) {
977
1077
  if (!Buffer.isBuffer(buf)) throw new TypeError('buffer must be a Buffer instance')
978
- if (value > max || value < min) throw new TypeError('value is out of bounds')
979
- if (offset + ext > buf.length) throw new TypeError('index out of range')
1078
+ if (value > max || value < min) throw new RangeError('value is out of bounds')
1079
+ if (offset + ext > buf.length) throw new RangeError('index out of range')
1080
+ }
1081
+
1082
+ Buffer.prototype.writeUIntLE = function (value, offset, byteLength, noAssert) {
1083
+ value = +value
1084
+ offset = offset >>> 0
1085
+ byteLength = byteLength >>> 0
1086
+ if (!noAssert)
1087
+ checkInt(this, value, offset, byteLength, Math.pow(2, 8 * byteLength), 0)
1088
+
1089
+ var mul = 1
1090
+ var i = 0
1091
+ this[offset] = value & 0xFF
1092
+ while (++i < byteLength && (mul *= 0x100))
1093
+ this[offset + i] = (value / mul) >>> 0 & 0xFF
1094
+
1095
+ return offset + byteLength
1096
+ }
1097
+
1098
+ Buffer.prototype.writeUIntBE = function (value, offset, byteLength, noAssert) {
1099
+ value = +value
1100
+ offset = offset >>> 0
1101
+ byteLength = byteLength >>> 0
1102
+ if (!noAssert)
1103
+ checkInt(this, value, offset, byteLength, Math.pow(2, 8 * byteLength), 0)
1104
+
1105
+ var i = byteLength - 1
1106
+ var mul = 1
1107
+ this[offset + i] = value & 0xFF
1108
+ while (--i >= 0 && (mul *= 0x100))
1109
+ this[offset + i] = (value / mul) >>> 0 & 0xFF
1110
+
1111
+ return offset + byteLength
980
1112
  }
981
1113
 
982
1114
  Buffer.prototype.writeUInt8 = function (value, offset, noAssert) {
@@ -1056,6 +1188,50 @@ Buffer.prototype.writeUInt32BE = function (value, offset, noAssert) {
1056
1188
  return offset + 4
1057
1189
  }
1058
1190
 
1191
+ Buffer.prototype.writeIntLE = function (value, offset, byteLength, noAssert) {
1192
+ value = +value
1193
+ offset = offset >>> 0
1194
+ if (!noAssert) {
1195
+ checkInt(this,
1196
+ value,
1197
+ offset,
1198
+ byteLength,
1199
+ Math.pow(2, 8 * byteLength - 1) - 1,
1200
+ -Math.pow(2, 8 * byteLength - 1))
1201
+ }
1202
+
1203
+ var i = 0
1204
+ var mul = 1
1205
+ var sub = value < 0 ? 1 : 0
1206
+ this[offset] = value & 0xFF
1207
+ while (++i < byteLength && (mul *= 0x100))
1208
+ this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
1209
+
1210
+ return offset + byteLength
1211
+ }
1212
+
1213
+ Buffer.prototype.writeIntBE = function (value, offset, byteLength, noAssert) {
1214
+ value = +value
1215
+ offset = offset >>> 0
1216
+ if (!noAssert) {
1217
+ checkInt(this,
1218
+ value,
1219
+ offset,
1220
+ byteLength,
1221
+ Math.pow(2, 8 * byteLength - 1) - 1,
1222
+ -Math.pow(2, 8 * byteLength - 1))
1223
+ }
1224
+
1225
+ var i = byteLength - 1
1226
+ var mul = 1
1227
+ var sub = value < 0 ? 1 : 0
1228
+ this[offset + i] = value & 0xFF
1229
+ while (--i >= 0 && (mul *= 0x100))
1230
+ this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
1231
+
1232
+ return offset + byteLength
1233
+ }
1234
+
1059
1235
  Buffer.prototype.writeInt8 = function (value, offset, noAssert) {
1060
1236
  value = +value
1061
1237
  offset = offset >>> 0
@@ -1121,8 +1297,9 @@ Buffer.prototype.writeInt32BE = function (value, offset, noAssert) {
1121
1297
  }
1122
1298
 
1123
1299
  function checkIEEE754 (buf, value, offset, ext, max, min) {
1124
- if (value > max || value < min) throw new TypeError('value is out of bounds')
1125
- if (offset + ext > buf.length) throw new TypeError('index out of range')
1300
+ if (value > max || value < min) throw new RangeError('value is out of bounds')
1301
+ if (offset + ext > buf.length) throw new RangeError('index out of range')
1302
+ if (offset < 0) throw new RangeError('index out of range')
1126
1303
  }
1127
1304
 
1128
1305
  function writeFloat (buf, value, offset, littleEndian, noAssert) {
@@ -1161,18 +1338,19 @@ Buffer.prototype.copy = function (target, target_start, start, end) {
1161
1338
 
1162
1339
  if (!start) start = 0
1163
1340
  if (!end && end !== 0) end = this.length
1341
+ if (target_start >= target.length) target_start = target.length
1164
1342
  if (!target_start) target_start = 0
1343
+ if (end > 0 && end < start) end = start
1165
1344
 
1166
1345
  // Copy 0 bytes; we're done
1167
- if (end === start) return
1168
- if (target.length === 0 || source.length === 0) return
1346
+ if (end === start) return 0
1347
+ if (target.length === 0 || source.length === 0) return 0
1169
1348
 
1170
1349
  // Fatal error conditions
1171
- if (end < start) throw new TypeError('sourceEnd < sourceStart')
1172
- if (target_start < 0 || target_start >= target.length)
1173
- throw new TypeError('targetStart out of bounds')
1174
- if (start < 0 || start >= source.length) throw new TypeError('sourceStart out of bounds')
1175
- if (end < 0 || end > source.length) throw new TypeError('sourceEnd out of bounds')
1350
+ if (target_start < 0)
1351
+ throw new RangeError('targetStart out of bounds')
1352
+ if (start < 0 || start >= source.length) throw new RangeError('sourceStart out of bounds')
1353
+ if (end < 0) throw new RangeError('sourceEnd out of bounds')
1176
1354
 
1177
1355
  // Are we oob?
1178
1356
  if (end > this.length)
@@ -1189,6 +1367,8 @@ Buffer.prototype.copy = function (target, target_start, start, end) {
1189
1367
  } else {
1190
1368
  target._set(this.subarray(start, start + len), target_start)
1191
1369
  }
1370
+
1371
+ return len
1192
1372
  }
1193
1373
 
1194
1374
  // fill(value, start=0, end=buffer.length)
@@ -1197,14 +1377,14 @@ Buffer.prototype.fill = function (value, start, end) {
1197
1377
  if (!start) start = 0
1198
1378
  if (!end) end = this.length
1199
1379
 
1200
- if (end < start) throw new TypeError('end < start')
1380
+ if (end < start) throw new RangeError('end < start')
1201
1381
 
1202
1382
  // Fill 0 bytes; we're done
1203
1383
  if (end === start) return
1204
1384
  if (this.length === 0) return
1205
1385
 
1206
- if (start < 0 || start >= this.length) throw new TypeError('start out of bounds')
1207
- if (end < 0 || end > this.length) throw new TypeError('end out of bounds')
1386
+ if (start < 0 || start >= this.length) throw new RangeError('start out of bounds')
1387
+ if (end < 0 || end > this.length) throw new RangeError('end out of bounds')
1208
1388
 
1209
1389
  var i
1210
1390
  if (typeof value === 'number') {
@@ -1270,11 +1450,15 @@ Buffer._augment = function (arr) {
1270
1450
  arr.compare = BP.compare
1271
1451
  arr.copy = BP.copy
1272
1452
  arr.slice = BP.slice
1453
+ arr.readUIntLE = BP.readUIntLE
1454
+ arr.readUIntBE = BP.readUIntBE
1273
1455
  arr.readUInt8 = BP.readUInt8
1274
1456
  arr.readUInt16LE = BP.readUInt16LE
1275
1457
  arr.readUInt16BE = BP.readUInt16BE
1276
1458
  arr.readUInt32LE = BP.readUInt32LE
1277
1459
  arr.readUInt32BE = BP.readUInt32BE
1460
+ arr.readIntLE = BP.readIntLE
1461
+ arr.readIntBE = BP.readIntBE
1278
1462
  arr.readInt8 = BP.readInt8
1279
1463
  arr.readInt16LE = BP.readInt16LE
1280
1464
  arr.readInt16BE = BP.readInt16BE
@@ -1285,10 +1469,14 @@ Buffer._augment = function (arr) {
1285
1469
  arr.readDoubleLE = BP.readDoubleLE
1286
1470
  arr.readDoubleBE = BP.readDoubleBE
1287
1471
  arr.writeUInt8 = BP.writeUInt8
1472
+ arr.writeUIntLE = BP.writeUIntLE
1473
+ arr.writeUIntBE = BP.writeUIntBE
1288
1474
  arr.writeUInt16LE = BP.writeUInt16LE
1289
1475
  arr.writeUInt16BE = BP.writeUInt16BE
1290
1476
  arr.writeUInt32LE = BP.writeUInt32LE
1291
1477
  arr.writeUInt32BE = BP.writeUInt32BE
1478
+ arr.writeIntLE = BP.writeIntLE
1479
+ arr.writeIntBE = BP.writeIntBE
1292
1480
  arr.writeInt8 = BP.writeInt8
1293
1481
  arr.writeInt16LE = BP.writeInt16LE
1294
1482
  arr.writeInt16BE = BP.writeInt16BE
@@ -1305,11 +1493,13 @@ Buffer._augment = function (arr) {
1305
1493
  return arr
1306
1494
  }
1307
1495
 
1308
- var INVALID_BASE64_RE = /[^+\/0-9A-z]/g
1496
+ var INVALID_BASE64_RE = /[^+\/0-9A-z\-]/g
1309
1497
 
1310
1498
  function base64clean (str) {
1311
1499
  // Node strips out invalid characters like \n and \t from the string, base64-js does not
1312
1500
  str = stringtrim(str).replace(INVALID_BASE64_RE, '')
1501
+ // Node converts strings with length < 2 to ''
1502
+ if (str.length < 2) return ''
1313
1503
  // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
1314
1504
  while (str.length % 4 !== 0) {
1315
1505
  str = str + '='
@@ -1333,22 +1523,100 @@ function toHex (n) {
1333
1523
  return n.toString(16)
1334
1524
  }
1335
1525
 
1336
- function utf8ToBytes (str) {
1337
- var byteArray = []
1338
- for (var i = 0; i < str.length; i++) {
1339
- var b = str.charCodeAt(i)
1340
- if (b <= 0x7F) {
1341
- byteArray.push(b)
1342
- } else {
1343
- var start = i
1344
- if (b >= 0xD800 && b <= 0xDFFF) i++
1345
- var h = encodeURIComponent(str.slice(start, i+1)).substr(1).split('%')
1346
- for (var j = 0; j < h.length; j++) {
1347
- byteArray.push(parseInt(h[j], 16))
1526
+ function utf8ToBytes(string, units) {
1527
+ var codePoint, length = string.length
1528
+ var leadSurrogate = null
1529
+ units = units || Infinity
1530
+ var bytes = []
1531
+ var i = 0
1532
+
1533
+ for (; i<length; i++) {
1534
+ codePoint = string.charCodeAt(i)
1535
+
1536
+ // is surrogate component
1537
+ if (codePoint > 0xD7FF && codePoint < 0xE000) {
1538
+
1539
+ // last char was a lead
1540
+ if (leadSurrogate) {
1541
+
1542
+ // 2 leads in a row
1543
+ if (codePoint < 0xDC00) {
1544
+ if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
1545
+ leadSurrogate = codePoint
1546
+ continue
1547
+ }
1548
+
1549
+ // valid surrogate pair
1550
+ else {
1551
+ codePoint = leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00 | 0x10000
1552
+ leadSurrogate = null
1553
+ }
1348
1554
  }
1555
+
1556
+ // no lead yet
1557
+ else {
1558
+
1559
+ // unexpected trail
1560
+ if (codePoint > 0xDBFF) {
1561
+ if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
1562
+ continue
1563
+ }
1564
+
1565
+ // unpaired lead
1566
+ else if (i + 1 === length) {
1567
+ if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
1568
+ continue
1569
+ }
1570
+
1571
+ // valid lead
1572
+ else {
1573
+ leadSurrogate = codePoint
1574
+ continue
1575
+ }
1576
+ }
1577
+ }
1578
+
1579
+ // valid bmp char, but last char was a lead
1580
+ else if (leadSurrogate) {
1581
+ if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
1582
+ leadSurrogate = null
1583
+ }
1584
+
1585
+ // encode utf8
1586
+ if (codePoint < 0x80) {
1587
+ if ((units -= 1) < 0) break
1588
+ bytes.push(codePoint)
1589
+ }
1590
+ else if (codePoint < 0x800) {
1591
+ if ((units -= 2) < 0) break
1592
+ bytes.push(
1593
+ codePoint >> 0x6 | 0xC0,
1594
+ codePoint & 0x3F | 0x80
1595
+ );
1596
+ }
1597
+ else if (codePoint < 0x10000) {
1598
+ if ((units -= 3) < 0) break
1599
+ bytes.push(
1600
+ codePoint >> 0xC | 0xE0,
1601
+ codePoint >> 0x6 & 0x3F | 0x80,
1602
+ codePoint & 0x3F | 0x80
1603
+ );
1604
+ }
1605
+ else if (codePoint < 0x200000) {
1606
+ if ((units -= 4) < 0) break
1607
+ bytes.push(
1608
+ codePoint >> 0x12 | 0xF0,
1609
+ codePoint >> 0xC & 0x3F | 0x80,
1610
+ codePoint >> 0x6 & 0x3F | 0x80,
1611
+ codePoint & 0x3F | 0x80
1612
+ );
1613
+ }
1614
+ else {
1615
+ throw new Error('Invalid code point')
1349
1616
  }
1350
1617
  }
1351
- return byteArray
1618
+
1619
+ return bytes
1352
1620
  }
1353
1621
 
1354
1622
  function asciiToBytes (str) {
@@ -1360,10 +1628,13 @@ function asciiToBytes (str) {
1360
1628
  return byteArray
1361
1629
  }
1362
1630
 
1363
- function utf16leToBytes (str) {
1631
+ function utf16leToBytes (str, units) {
1364
1632
  var c, hi, lo
1365
1633
  var byteArray = []
1366
1634
  for (var i = 0; i < str.length; i++) {
1635
+
1636
+ if ((units -= 2) < 0) break
1637
+
1367
1638
  c = str.charCodeAt(i)
1368
1639
  hi = c >> 8
1369
1640
  lo = c % 256
@@ -1375,10 +1646,11 @@ function utf16leToBytes (str) {
1375
1646
  }
1376
1647
 
1377
1648
  function base64ToBytes (str) {
1378
- return base64.toByteArray(str)
1649
+ return base64.toByteArray(base64clean(str))
1379
1650
  }
1380
1651
 
1381
- function blitBuffer (src, dst, offset, length) {
1652
+ function blitBuffer (src, dst, offset, length, unitSize) {
1653
+ if (unitSize) length -= length % unitSize;
1382
1654
  for (var i = 0; i < length; i++) {
1383
1655
  if ((i + offset >= dst.length) || (i >= src.length))
1384
1656
  break
@@ -1410,12 +1682,16 @@ var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
1410
1682
  var NUMBER = '0'.charCodeAt(0)
1411
1683
  var LOWER = 'a'.charCodeAt(0)
1412
1684
  var UPPER = 'A'.charCodeAt(0)
1685
+ var PLUS_URL_SAFE = '-'.charCodeAt(0)
1686
+ var SLASH_URL_SAFE = '_'.charCodeAt(0)
1413
1687
 
1414
1688
  function decode (elt) {
1415
1689
  var code = elt.charCodeAt(0)
1416
- if (code === PLUS)
1690
+ if (code === PLUS ||
1691
+ code === PLUS_URL_SAFE)
1417
1692
  return 62 // '+'
1418
- if (code === SLASH)
1693
+ if (code === SLASH ||
1694
+ code === SLASH_URL_SAFE)
1419
1695
  return 63 // '/'
1420
1696
  if (code < NUMBER)
1421
1697
  return -1 //no match
@@ -1870,69 +2146,39 @@ var substr = 'ab'.substr(-1) === 'b'
1870
2146
  // shim for using process in browser
1871
2147
 
1872
2148
  var process = module.exports = {};
2149
+ var queue = [];
2150
+ var draining = false;
1873
2151
 
1874
- process.nextTick = (function () {
1875
- var canSetImmediate = typeof window !== 'undefined'
1876
- && window.setImmediate;
1877
- var canMutationObserver = typeof window !== 'undefined'
1878
- && window.MutationObserver;
1879
- var canPost = typeof window !== 'undefined'
1880
- && window.postMessage && window.addEventListener
1881
- ;
1882
-
1883
- if (canSetImmediate) {
1884
- return function (f) { return window.setImmediate(f) };
2152
+ function drainQueue() {
2153
+ if (draining) {
2154
+ return;
1885
2155
  }
1886
-
1887
- var queue = [];
1888
-
1889
- if (canMutationObserver) {
1890
- var hiddenDiv = document.createElement("div");
1891
- var observer = new MutationObserver(function () {
1892
- var queueList = queue.slice();
1893
- queue.length = 0;
1894
- queueList.forEach(function (fn) {
1895
- fn();
1896
- });
1897
- });
1898
-
1899
- observer.observe(hiddenDiv, { attributes: true });
1900
-
1901
- return function nextTick(fn) {
1902
- if (!queue.length) {
1903
- hiddenDiv.setAttribute('yes', 'no');
1904
- }
1905
- queue.push(fn);
1906
- };
2156
+ draining = true;
2157
+ var currentQueue;
2158
+ var len = queue.length;
2159
+ while(len) {
2160
+ currentQueue = queue;
2161
+ queue = [];
2162
+ var i = -1;
2163
+ while (++i < len) {
2164
+ currentQueue[i]();
2165
+ }
2166
+ len = queue.length;
1907
2167
  }
1908
-
1909
- if (canPost) {
1910
- window.addEventListener('message', function (ev) {
1911
- var source = ev.source;
1912
- if ((source === window || source === null) && ev.data === 'process-tick') {
1913
- ev.stopPropagation();
1914
- if (queue.length > 0) {
1915
- var fn = queue.shift();
1916
- fn();
1917
- }
1918
- }
1919
- }, true);
1920
-
1921
- return function nextTick(fn) {
1922
- queue.push(fn);
1923
- window.postMessage('process-tick', '*');
1924
- };
2168
+ draining = false;
2169
+ }
2170
+ process.nextTick = function (fun) {
2171
+ queue.push(fun);
2172
+ if (!draining) {
2173
+ setTimeout(drainQueue, 0);
1925
2174
  }
1926
-
1927
- return function nextTick(fn) {
1928
- setTimeout(fn, 0);
1929
- };
1930
- })();
2175
+ };
1931
2176
 
1932
2177
  process.title = 'browser';
1933
2178
  process.browser = true;
1934
2179
  process.env = {};
1935
2180
  process.argv = [];
2181
+ process.version = ''; // empty string to avoid regexp issues
1936
2182
 
1937
2183
  function noop() {}
1938
2184
 
@@ -1953,6 +2199,7 @@ process.cwd = function () { return '/' };
1953
2199
  process.chdir = function (dir) {
1954
2200
  throw new Error('process.chdir is not supported');
1955
2201
  };
2202
+ process.umask = function() { return 0; };
1956
2203
 
1957
2204
  },{}],8:[function(_dereq_,module,exports){
1958
2205
  var Base62 = (function (my) {
@@ -14503,7 +14750,6 @@ exports.visitorList = [
14503
14750
  var Syntax = _dereq_('jstransform').Syntax;
14504
14751
  var utils = _dereq_('jstransform/src/utils');
14505
14752
 
14506
- var FALLBACK_TAGS = _dereq_('./xjs').knownTags;
14507
14753
  var renderXJSExpressionContainer =
14508
14754
  _dereq_('./xjs').renderXJSExpressionContainer;
14509
14755
  var renderXJSLiteral = _dereq_('./xjs').renderXJSLiteral;
@@ -14549,17 +14795,8 @@ function visitReactTag(traverse, object, path, state) {
14549
14795
  // We assume that the React runtime is already in scope
14550
14796
  utils.append('React.createElement(', state);
14551
14797
 
14552
- // Identifiers with lower case or hypthens are fallback tags (strings).
14553
14798
  // XJSMemberExpressions are not.
14554
14799
  if (nameObject.type === Syntax.XJSIdentifier && isTagName(nameObject.name)) {
14555
- // This is a temporary error message to assist upgrades
14556
- if (!FALLBACK_TAGS.hasOwnProperty(nameObject.name)) {
14557
- throw new Error(
14558
- 'Lower case component names (' + nameObject.name + ') are no longer ' +
14559
- 'supported in JSX: See http://fb.me/react-jsx-lower-case'
14560
- );
14561
- }
14562
-
14563
14800
  utils.append('"' + nameObject.name + '"', state);
14564
14801
  utils.move(nameObject.range[1], state);
14565
14802
  } else {
@@ -14779,7 +15016,7 @@ function addDisplayName(displayName, object, state) {
14779
15016
 
14780
15017
  if (safe) {
14781
15018
  utils.catchup(object['arguments'][0].range[0] + 1, state);
14782
- utils.append("displayName: '" + displayName + "',", state);
15019
+ utils.append('displayName: "' + displayName + '",', state);
14783
15020
  }
14784
15021
  }
14785
15022
  }
@@ -14852,142 +15089,6 @@ exports.visitorList = [
14852
15089
  var Syntax = _dereq_('jstransform').Syntax;
14853
15090
  var utils = _dereq_('jstransform/src/utils');
14854
15091
 
14855
- var knownTags = {
14856
- a: true,
14857
- abbr: true,
14858
- address: true,
14859
- applet: true,
14860
- area: true,
14861
- article: true,
14862
- aside: true,
14863
- audio: true,
14864
- b: true,
14865
- base: true,
14866
- bdi: true,
14867
- bdo: true,
14868
- big: true,
14869
- blockquote: true,
14870
- body: true,
14871
- br: true,
14872
- button: true,
14873
- canvas: true,
14874
- caption: true,
14875
- circle: true,
14876
- cite: true,
14877
- code: true,
14878
- col: true,
14879
- colgroup: true,
14880
- command: true,
14881
- data: true,
14882
- datalist: true,
14883
- dd: true,
14884
- defs: true,
14885
- del: true,
14886
- details: true,
14887
- dfn: true,
14888
- dialog: true,
14889
- div: true,
14890
- dl: true,
14891
- dt: true,
14892
- ellipse: true,
14893
- em: true,
14894
- embed: true,
14895
- fieldset: true,
14896
- figcaption: true,
14897
- figure: true,
14898
- footer: true,
14899
- form: true,
14900
- g: true,
14901
- h1: true,
14902
- h2: true,
14903
- h3: true,
14904
- h4: true,
14905
- h5: true,
14906
- h6: true,
14907
- head: true,
14908
- header: true,
14909
- hgroup: true,
14910
- hr: true,
14911
- html: true,
14912
- i: true,
14913
- iframe: true,
14914
- img: true,
14915
- input: true,
14916
- ins: true,
14917
- kbd: true,
14918
- keygen: true,
14919
- label: true,
14920
- legend: true,
14921
- li: true,
14922
- line: true,
14923
- linearGradient: true,
14924
- link: true,
14925
- main: true,
14926
- map: true,
14927
- mark: true,
14928
- marquee: true,
14929
- mask: false,
14930
- menu: true,
14931
- menuitem: true,
14932
- meta: true,
14933
- meter: true,
14934
- nav: true,
14935
- noscript: true,
14936
- object: true,
14937
- ol: true,
14938
- optgroup: true,
14939
- option: true,
14940
- output: true,
14941
- p: true,
14942
- param: true,
14943
- path: true,
14944
- pattern: false,
14945
- picture: true,
14946
- polygon: true,
14947
- polyline: true,
14948
- pre: true,
14949
- progress: true,
14950
- q: true,
14951
- radialGradient: true,
14952
- rect: true,
14953
- rp: true,
14954
- rt: true,
14955
- ruby: true,
14956
- s: true,
14957
- samp: true,
14958
- script: true,
14959
- section: true,
14960
- select: true,
14961
- small: true,
14962
- source: true,
14963
- span: true,
14964
- stop: true,
14965
- strong: true,
14966
- style: true,
14967
- sub: true,
14968
- summary: true,
14969
- sup: true,
14970
- svg: true,
14971
- table: true,
14972
- tbody: true,
14973
- td: true,
14974
- text: true,
14975
- textarea: true,
14976
- tfoot: true,
14977
- th: true,
14978
- thead: true,
14979
- time: true,
14980
- title: true,
14981
- tr: true,
14982
- track: true,
14983
- tspan: true,
14984
- u: true,
14985
- ul: true,
14986
- 'var': true,
14987
- video: true,
14988
- wbr: true
14989
- };
14990
-
14991
15092
  function renderXJSLiteral(object, isLast, state, start, end) {
14992
15093
  var lines = object.value.split(/\r\n|\n|\r/);
14993
15094
 
@@ -15055,6 +15156,7 @@ function renderXJSLiteral(object, isLast, state, start, end) {
15055
15156
  function renderXJSExpressionContainer(traverse, object, isLast, path, state) {
15056
15157
  // Plus 1 to skip `{`.
15057
15158
  utils.move(object.range[0] + 1, state);
15159
+ utils.catchup(object.expression.range[0], state);
15058
15160
  traverse(object.expression, path, state);
15059
15161
 
15060
15162
  if (!isLast && object.expression.type !== Syntax.XJSEmptyExpression) {
@@ -15072,7 +15174,7 @@ function renderXJSExpressionContainer(traverse, object, isLast, path, state) {
15072
15174
  function quoteAttrName(attr) {
15073
15175
  // Quote invalid JS identifiers.
15074
15176
  if (!/^[a-z_$][a-z\d_$]*$/i.test(attr)) {
15075
- return "'" + attr + "'";
15177
+ return '"' + attr + '"';
15076
15178
  }
15077
15179
  return attr;
15078
15180
  }
@@ -15081,7 +15183,6 @@ function trimLeft(value) {
15081
15183
  return value.replace(/^[ ]+/, '');
15082
15184
  }
15083
15185
 
15084
- exports.knownTags = knownTags;
15085
15186
  exports.renderXJSExpressionContainer = renderXJSExpressionContainer;
15086
15187
  exports.renderXJSLiteral = renderXJSLiteral;
15087
15188
  exports.quoteAttrName = quoteAttrName;