react 0.14.10 → 15.0.0
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.
- package/LICENSE +1 -1
- package/dist/react-with-addons.js +4900 -4627
- package/dist/react-with-addons.min.js +7 -7
- package/dist/react.js +4556 -4059
- package/dist/react.min.js +7 -7
- package/lib/AutoFocusUtils.js +3 -15
- package/lib/BeforeInputEventPlugin.js +8 -25
- package/lib/CSSProperty.js +10 -1
- package/lib/CSSPropertyOperations.js +49 -19
- package/lib/CallbackQueue.js +16 -4
- package/lib/ChangeEventPlugin.js +58 -54
- package/lib/DOMChildrenOperations.js +91 -61
- package/lib/DOMLazyTree.js +105 -0
- package/lib/{ClientReactRootIndex.js → DOMNamespaces.js} +7 -10
- package/lib/DOMProperty.js +18 -39
- package/lib/DOMPropertyOperations.js +42 -53
- package/lib/Danger.js +13 -14
- package/lib/DefaultEventPluginOrder.js +1 -1
- package/lib/EnterLeaveEventPlugin.js +24 -43
- package/lib/EventConstants.js +6 -1
- package/lib/EventPluginHub.js +22 -66
- package/lib/EventPluginRegistry.js +30 -9
- package/lib/EventPluginUtils.js +61 -36
- package/lib/EventPropagators.js +19 -17
- package/lib/FallbackCompositionState.js +4 -4
- package/lib/HTMLDOMPropertyConfig.js +131 -152
- package/lib/LinkedStateMixin.js +1 -2
- package/lib/LinkedValueUtils.js +6 -7
- package/lib/MetaMatchers.js +2 -2
- package/lib/OrderedMap.js +17 -16
- package/lib/PooledClass.js +2 -2
- package/lib/React.js +50 -20
- package/lib/ReactBrowserEventEmitter.js +19 -26
- package/lib/ReactCSSTransitionGroup.js +4 -5
- package/lib/ReactCSSTransitionGroupChild.js +1 -6
- package/lib/ReactChildReconciler.js +15 -13
- package/lib/ReactChildren.js +5 -4
- package/lib/ReactClass.js +44 -92
- package/lib/ReactComponent.js +9 -10
- package/lib/ReactComponentBrowserEnvironment.js +9 -6
- package/lib/ReactComponentEnvironment.js +4 -4
- package/lib/ReactComponentWithPureRenderMixin.js +2 -2
- package/lib/ReactCompositeComponent.js +166 -74
- package/lib/ReactCurrentOwner.js +2 -1
- package/lib/ReactDOM.js +27 -15
- package/lib/ReactDOMButton.js +2 -2
- package/lib/ReactDOMComponent.js +186 -250
- package/lib/ReactDOMComponentFlags.js +18 -0
- package/lib/ReactDOMComponentTree.js +186 -0
- package/lib/ReactDOMContainerInfo.js +32 -0
- package/lib/ReactDOMDebugTool.js +61 -0
- package/lib/ReactDOMEmptyComponent.js +60 -0
- package/lib/ReactDOMFactories.js +1 -2
- package/lib/ReactDOMFeatureFlags.js +2 -2
- package/lib/ReactDOMIDOperations.js +5 -60
- package/lib/ReactDOMInput.js +73 -23
- package/lib/ReactDOMInstrumentation.js +16 -0
- package/lib/ReactDOMOption.js +14 -12
- package/lib/ReactDOMSelect.js +43 -19
- package/lib/ReactDOMSelection.js +4 -4
- package/lib/ReactDOMServer.js +1 -1
- package/lib/ReactDOMTextComponent.js +87 -45
- package/lib/ReactDOMTextarea.js +39 -11
- package/lib/ReactDOMTreeTraversal.js +134 -0
- package/lib/ReactDOMUnknownPropertyDevtool.js +64 -0
- package/lib/ReactDebugInstanceMap.js +102 -0
- package/lib/ReactDebugTool.js +72 -0
- package/lib/ReactDefaultBatchingStrategy.js +4 -3
- package/lib/ReactDefaultInjection.js +11 -15
- package/lib/ReactDefaultPerf.js +105 -26
- package/lib/ReactDefaultPerfAnalysis.js +23 -15
- package/lib/ReactElement.js +63 -23
- package/lib/ReactElementValidator.js +9 -9
- package/lib/ReactEmptyComponent.js +8 -33
- package/lib/ReactErrorUtils.js +1 -2
- package/lib/ReactEventEmitterMixin.js +3 -8
- package/lib/ReactEventListener.js +23 -77
- package/lib/ReactFeatureFlags.js +21 -0
- package/lib/ReactFragment.js +6 -6
- package/lib/ReactInjection.js +3 -3
- package/lib/ReactInputSelection.js +4 -4
- package/lib/ReactInstanceHandles.js +10 -12
- package/lib/ReactInstanceMap.js +2 -1
- package/lib/ReactInstrumentation.js +16 -0
- package/lib/ReactInvalidSetStateWarningDevTool.js +36 -0
- package/lib/ReactLink.js +2 -3
- package/lib/ReactMarkupChecksum.js +8 -3
- package/lib/ReactMount.js +88 -460
- package/lib/ReactMultiChild.js +106 -200
- package/lib/ReactMultiChildUpdateTypes.js +1 -1
- package/lib/ReactNativeComponent.js +6 -5
- package/lib/ReactNodeTypes.js +37 -0
- package/lib/ReactNoopUpdateQueue.js +2 -25
- package/lib/ReactOwner.js +7 -6
- package/lib/ReactPerf.js +2 -2
- package/lib/ReactPropTransferer.js +5 -4
- package/lib/ReactPropTypeLocationNames.js +1 -1
- package/lib/ReactPropTypeLocations.js +1 -1
- package/lib/ReactPropTypes.js +31 -7
- package/lib/ReactReconcileTransaction.js +20 -9
- package/lib/ReactReconciler.js +29 -6
- package/lib/ReactRef.js +1 -1
- package/lib/ReactServerBatchingStrategy.js +1 -2
- package/lib/ReactServerRendering.js +17 -35
- package/lib/ReactServerRenderingTransaction.js +11 -29
- package/lib/ReactSimpleEmptyComponent.js +36 -0
- package/lib/ReactStateSetters.js +1 -1
- package/lib/ReactTestUtils.js +47 -28
- package/lib/ReactTransitionChildMapping.js +1 -2
- package/lib/ReactTransitionEvents.js +8 -44
- package/lib/ReactTransitionGroup.js +4 -3
- package/lib/ReactUMDEntry.js +26 -0
- package/lib/ReactUpdateQueue.js +24 -66
- package/lib/ReactUpdates.js +29 -11
- package/lib/ReactVersion.js +2 -2
- package/lib/ReactWithAddons.js +1 -21
- package/lib/ReactWithAddonsUMDEntry.js +26 -0
- package/lib/ResponderEventPlugin.js +54 -66
- package/lib/ResponderSyntheticEvent.js +2 -3
- package/lib/ResponderTouchHistoryStore.js +5 -5
- package/lib/SVGDOMPropertyConfig.js +267 -94
- package/lib/SelectEventPlugin.js +13 -18
- package/lib/SimpleEventPlugin.js +57 -17
- package/lib/SyntheticAnimationEvent.js +39 -0
- package/lib/SyntheticClipboardEvent.js +2 -3
- package/lib/SyntheticCompositionEvent.js +2 -3
- package/lib/SyntheticDragEvent.js +2 -3
- package/lib/SyntheticEvent.js +102 -21
- package/lib/SyntheticFocusEvent.js +2 -3
- package/lib/SyntheticInputEvent.js +2 -3
- package/lib/SyntheticKeyboardEvent.js +2 -3
- package/lib/SyntheticMouseEvent.js +2 -3
- package/lib/SyntheticTouchEvent.js +2 -3
- package/lib/SyntheticTransitionEvent.js +39 -0
- package/lib/SyntheticUIEvent.js +2 -3
- package/lib/SyntheticWheelEvent.js +2 -3
- package/lib/TapEventPlugin.js +3 -12
- package/lib/Transaction.js +3 -3
- package/lib/ViewportMetrics.js +1 -1
- package/lib/accumulate.js +2 -2
- package/lib/accumulateInto.js +2 -2
- package/lib/adler32.js +3 -2
- package/lib/canDefineProperty.js +1 -1
- package/lib/createHierarchyRenderer.js +1 -1
- package/lib/createMicrosoftUnsafeLocalFunction.js +32 -0
- package/lib/dangerousStyleValue.js +25 -3
- package/lib/deprecated.js +7 -4
- package/lib/escapeTextContentForBrowser.js +1 -1
- package/lib/findDOMNode.js +15 -8
- package/lib/flattenChildren.js +2 -2
- package/lib/forEachAccumulated.js +2 -1
- package/lib/getEventCharCode.js +2 -2
- package/lib/getEventKey.js +1 -2
- package/lib/getEventModifierState.js +1 -2
- package/lib/getEventTarget.js +8 -2
- package/lib/getIteratorFn.js +2 -2
- package/lib/getNativeComponentFromComposite.js +30 -0
- package/lib/getNodeForCharacterOffset.js +2 -1
- package/lib/getTestDocument.js +1 -1
- package/lib/getTextContentAccessor.js +1 -1
- package/lib/getVendorPrefixedEventName.js +101 -0
- package/lib/instantiateReactComponent.js +12 -13
- package/lib/isEventSupported.js +2 -2
- package/lib/isTextInputElement.js +2 -1
- package/lib/onlyChild.js +2 -2
- package/lib/quoteAttributeValueForBrowser.js +1 -1
- package/lib/reactComponentExpect.js +5 -4
- package/lib/renderSubtreeIntoContainer.js +1 -1
- package/lib/setInnerHTML.js +6 -14
- package/lib/setTextContent.js +1 -1
- package/lib/shallowCompare.js +1 -1
- package/lib/shouldUpdateReactComponent.js +2 -3
- package/lib/sliceChildren.js +1 -1
- package/lib/traverseAllChildren.js +8 -8
- package/lib/update.js +16 -15
- package/lib/validateDOMNesting.js +18 -13
- package/package.json +23 -32
- package/addons.js +0 -13
- package/cjs/react-jsx-dev-runtime.development.js +0 -861
- package/cjs/react-jsx-dev-runtime.production.min.js +0 -9
- package/cjs/react-jsx-runtime.development.js +0 -883
- package/cjs/react-jsx-runtime.production.min.js +0 -10
- package/jsx-dev-runtime.js +0 -7
- package/jsx-runtime.js +0 -7
- package/lib/Object.assign.js +0 -47
- package/lib/React.native.js +0 -5
- package/lib/ReactBrowserComponentMixin.js +0 -36
- package/lib/ReactEmptyComponentRegistry.js +0 -48
- package/lib/ReactIsomorphic.js +0 -74
- package/lib/ReactRootIndex.js +0 -29
- package/lib/ServerReactRootIndex.js +0 -29
- package/lib/cloneWithProps.js +0 -54
- package/lib/webcomponents.js +0 -6379
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the BSD-style license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
|
+
*
|
|
9
|
+
* @providesModule ReactWithAddonsUMDEntry
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
'use strict';
|
|
13
|
+
|
|
14
|
+
var _assign = require('object-assign');
|
|
15
|
+
|
|
16
|
+
var ReactDOM = require('./ReactDOM');
|
|
17
|
+
var ReactDOMServer = require('./ReactDOMServer');
|
|
18
|
+
var ReactWithAddons = require('./ReactWithAddons');
|
|
19
|
+
|
|
20
|
+
// `version` will be added here by ReactIsomorphic.
|
|
21
|
+
var ReactWithAddonsUMDEntry = _assign({
|
|
22
|
+
__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ReactDOM,
|
|
23
|
+
__SECRET_DOM_SERVER_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ReactDOMServer
|
|
24
|
+
}, ReactWithAddons);
|
|
25
|
+
|
|
26
|
+
module.exports = ReactWithAddonsUMDEntry;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
var EventConstants = require('./EventConstants');
|
|
15
15
|
var EventPluginUtils = require('./EventPluginUtils');
|
|
16
16
|
var EventPropagators = require('./EventPropagators');
|
|
17
|
-
var ReactInstanceHandles = require('./ReactInstanceHandles');
|
|
18
17
|
var ResponderSyntheticEvent = require('./ResponderSyntheticEvent');
|
|
19
18
|
var ResponderTouchHistoryStore = require('./ResponderTouchHistoryStore');
|
|
20
19
|
|
|
@@ -30,14 +29,14 @@ var hasDispatches = EventPluginUtils.hasDispatches;
|
|
|
30
29
|
var executeDispatchesInOrderStopAtTrue = EventPluginUtils.executeDispatchesInOrderStopAtTrue;
|
|
31
30
|
|
|
32
31
|
/**
|
|
33
|
-
*
|
|
34
|
-
* indicated explicitly by relevant callbacks.
|
|
32
|
+
* Instance of element that should respond to touch/move types of interactions,
|
|
33
|
+
* as indicated explicitly by relevant callbacks.
|
|
35
34
|
*/
|
|
36
|
-
var
|
|
35
|
+
var responderInst = null;
|
|
37
36
|
|
|
38
37
|
/**
|
|
39
38
|
* Count of current touches. A textInput should become responder iff the
|
|
40
|
-
*
|
|
39
|
+
* selection changes while there is a touch on the screen.
|
|
41
40
|
*/
|
|
42
41
|
var trackedTouchCount = 0;
|
|
43
42
|
|
|
@@ -46,11 +45,11 @@ var trackedTouchCount = 0;
|
|
|
46
45
|
*/
|
|
47
46
|
var previousActiveTouches = 0;
|
|
48
47
|
|
|
49
|
-
var changeResponder = function (
|
|
50
|
-
var
|
|
51
|
-
|
|
48
|
+
var changeResponder = function (nextResponderInst, blockNativeResponder) {
|
|
49
|
+
var oldResponderInst = responderInst;
|
|
50
|
+
responderInst = nextResponderInst;
|
|
52
51
|
if (ResponderEventPlugin.GlobalResponderHandler !== null) {
|
|
53
|
-
ResponderEventPlugin.GlobalResponderHandler.onChange(
|
|
52
|
+
ResponderEventPlugin.GlobalResponderHandler.onChange(oldResponderInst, nextResponderInst, blockNativeResponder);
|
|
54
53
|
}
|
|
55
54
|
};
|
|
56
55
|
|
|
@@ -69,7 +68,7 @@ var eventTypes = {
|
|
|
69
68
|
/**
|
|
70
69
|
* On a `scroll`, is it desired that this element become the responder? This
|
|
71
70
|
* is usually not needed, but should be used to retroactively infer that a
|
|
72
|
-
* `touchStart` had
|
|
71
|
+
* `touchStart` had occurred during momentum scroll. During a momentum scroll,
|
|
73
72
|
* a touch start will be immediately followed by a scroll event if the view is
|
|
74
73
|
* currently scrolling.
|
|
75
74
|
*
|
|
@@ -132,7 +131,7 @@ var eventTypes = {
|
|
|
132
131
|
* immediately to indicate so, either by highlighting or moving accordingly.
|
|
133
132
|
* - To be the responder means, that touches are exclusively important to that
|
|
134
133
|
* responder view, and no other view.
|
|
135
|
-
* - While touches are still
|
|
134
|
+
* - While touches are still occurring, the responder lock can be transferred to
|
|
136
135
|
* a new view, but only to increasingly "higher" views (meaning ancestors of
|
|
137
136
|
* the current responder).
|
|
138
137
|
*
|
|
@@ -145,7 +144,7 @@ var eventTypes = {
|
|
|
145
144
|
* - If nothing is currently the responder, the "appropriate place" is the
|
|
146
145
|
* initiating event's `targetID`.
|
|
147
146
|
* - If something *is* already the responder, the "appropriate place" is the
|
|
148
|
-
* first common ancestor of the event target and the current `
|
|
147
|
+
* first common ancestor of the event target and the current `responderInst`.
|
|
149
148
|
* - Some negotiation happens: See the timing diagram below.
|
|
150
149
|
* - Scrolled views automatically become responder. The reasoning is that a
|
|
151
150
|
* platform scroll view that isn't built on top of the responder system has
|
|
@@ -153,8 +152,8 @@ var eventTypes = {
|
|
|
153
152
|
* interaction is no longer locked to it - the system has taken over.
|
|
154
153
|
*
|
|
155
154
|
* - Responder being released:
|
|
156
|
-
* As soon as no more touches that *started* inside of
|
|
157
|
-
* *current*
|
|
155
|
+
* As soon as no more touches that *started* inside of descendants of the
|
|
156
|
+
* *current* responderInst, an `onResponderRelease` event is dispatched to the
|
|
158
157
|
* current responder, and the responder lock is released.
|
|
159
158
|
*
|
|
160
159
|
* TODO:
|
|
@@ -310,23 +309,19 @@ to return true:wantsResponderID| |
|
|
|
310
309
|
* - `touchStartCapture` (`EventPluginHub` dispatches as usual)
|
|
311
310
|
* - `touchStart` (`EventPluginHub` dispatches as usual)
|
|
312
311
|
* - `responderGrant/Reject` (`EventPluginHub` dispatches as usual)
|
|
313
|
-
*
|
|
314
|
-
* @param {string} topLevelType Record from `EventConstants`.
|
|
315
|
-
* @param {string} topLevelTargetID ID of deepest React rendered element.
|
|
316
|
-
* @param {object} nativeEvent Native browser event.
|
|
317
|
-
* @return {*} An accumulation of synthetic events.
|
|
318
312
|
*/
|
|
319
|
-
|
|
313
|
+
|
|
314
|
+
function setResponderAndExtractTransfer(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
|
|
320
315
|
var shouldSetEventType = isStartish(topLevelType) ? eventTypes.startShouldSetResponder : isMoveish(topLevelType) ? eventTypes.moveShouldSetResponder : topLevelType === EventConstants.topLevelTypes.topSelectionChange ? eventTypes.selectionChangeShouldSetResponder : eventTypes.scrollShouldSetResponder;
|
|
321
316
|
|
|
322
|
-
// TODO: stop one short of the
|
|
323
|
-
var bubbleShouldSetFrom = !
|
|
317
|
+
// TODO: stop one short of the current responder.
|
|
318
|
+
var bubbleShouldSetFrom = !responderInst ? targetInst : EventPluginUtils.getLowestCommonAncestor(responderInst, targetInst);
|
|
324
319
|
|
|
325
320
|
// When capturing/bubbling the "shouldSet" event, we want to skip the target
|
|
326
321
|
// (deepest ID) if it happens to be the current responder. The reasoning:
|
|
327
322
|
// It's strange to get an `onMoveShouldSetResponder` when you're *already*
|
|
328
323
|
// the responder.
|
|
329
|
-
var skipOverBubbleShouldSetFrom = bubbleShouldSetFrom ===
|
|
324
|
+
var skipOverBubbleShouldSetFrom = bubbleShouldSetFrom === responderInst;
|
|
330
325
|
var shouldSetEvent = ResponderSyntheticEvent.getPooled(shouldSetEventType, bubbleShouldSetFrom, nativeEvent, nativeEventTarget);
|
|
331
326
|
shouldSetEvent.touchHistory = ResponderTouchHistoryStore.touchHistory;
|
|
332
327
|
if (skipOverBubbleShouldSetFrom) {
|
|
@@ -334,23 +329,23 @@ function setResponderAndExtractTransfer(topLevelType, topLevelTargetID, nativeEv
|
|
|
334
329
|
} else {
|
|
335
330
|
EventPropagators.accumulateTwoPhaseDispatches(shouldSetEvent);
|
|
336
331
|
}
|
|
337
|
-
var
|
|
332
|
+
var wantsResponderInst = executeDispatchesInOrderStopAtTrue(shouldSetEvent);
|
|
338
333
|
if (!shouldSetEvent.isPersistent()) {
|
|
339
334
|
shouldSetEvent.constructor.release(shouldSetEvent);
|
|
340
335
|
}
|
|
341
336
|
|
|
342
|
-
if (!
|
|
337
|
+
if (!wantsResponderInst || wantsResponderInst === responderInst) {
|
|
343
338
|
return null;
|
|
344
339
|
}
|
|
345
340
|
var extracted;
|
|
346
|
-
var grantEvent = ResponderSyntheticEvent.getPooled(eventTypes.responderGrant,
|
|
341
|
+
var grantEvent = ResponderSyntheticEvent.getPooled(eventTypes.responderGrant, wantsResponderInst, nativeEvent, nativeEventTarget);
|
|
347
342
|
grantEvent.touchHistory = ResponderTouchHistoryStore.touchHistory;
|
|
348
343
|
|
|
349
344
|
EventPropagators.accumulateDirectDispatches(grantEvent);
|
|
350
345
|
var blockNativeResponder = executeDirectDispatch(grantEvent) === true;
|
|
351
|
-
if (
|
|
346
|
+
if (responderInst) {
|
|
352
347
|
|
|
353
|
-
var terminationRequestEvent = ResponderSyntheticEvent.getPooled(eventTypes.responderTerminationRequest,
|
|
348
|
+
var terminationRequestEvent = ResponderSyntheticEvent.getPooled(eventTypes.responderTerminationRequest, responderInst, nativeEvent, nativeEventTarget);
|
|
354
349
|
terminationRequestEvent.touchHistory = ResponderTouchHistoryStore.touchHistory;
|
|
355
350
|
EventPropagators.accumulateDirectDispatches(terminationRequestEvent);
|
|
356
351
|
var shouldSwitch = !hasDispatches(terminationRequestEvent) || executeDirectDispatch(terminationRequestEvent);
|
|
@@ -359,21 +354,20 @@ function setResponderAndExtractTransfer(topLevelType, topLevelTargetID, nativeEv
|
|
|
359
354
|
}
|
|
360
355
|
|
|
361
356
|
if (shouldSwitch) {
|
|
362
|
-
var
|
|
363
|
-
var terminateEvent = ResponderSyntheticEvent.getPooled(terminateType, responderID, nativeEvent, nativeEventTarget);
|
|
357
|
+
var terminateEvent = ResponderSyntheticEvent.getPooled(eventTypes.responderTerminate, responderInst, nativeEvent, nativeEventTarget);
|
|
364
358
|
terminateEvent.touchHistory = ResponderTouchHistoryStore.touchHistory;
|
|
365
359
|
EventPropagators.accumulateDirectDispatches(terminateEvent);
|
|
366
360
|
extracted = accumulate(extracted, [grantEvent, terminateEvent]);
|
|
367
|
-
changeResponder(
|
|
361
|
+
changeResponder(wantsResponderInst, blockNativeResponder);
|
|
368
362
|
} else {
|
|
369
|
-
var rejectEvent = ResponderSyntheticEvent.getPooled(eventTypes.responderReject,
|
|
363
|
+
var rejectEvent = ResponderSyntheticEvent.getPooled(eventTypes.responderReject, wantsResponderInst, nativeEvent, nativeEventTarget);
|
|
370
364
|
rejectEvent.touchHistory = ResponderTouchHistoryStore.touchHistory;
|
|
371
365
|
EventPropagators.accumulateDirectDispatches(rejectEvent);
|
|
372
366
|
extracted = accumulate(extracted, rejectEvent);
|
|
373
367
|
}
|
|
374
368
|
} else {
|
|
375
369
|
extracted = accumulate(extracted, grantEvent);
|
|
376
|
-
changeResponder(
|
|
370
|
+
changeResponder(wantsResponderInst, blockNativeResponder);
|
|
377
371
|
}
|
|
378
372
|
return extracted;
|
|
379
373
|
}
|
|
@@ -381,22 +375,22 @@ function setResponderAndExtractTransfer(topLevelType, topLevelTargetID, nativeEv
|
|
|
381
375
|
/**
|
|
382
376
|
* A transfer is a negotiation between a currently set responder and the next
|
|
383
377
|
* element to claim responder status. Any start event could trigger a transfer
|
|
384
|
-
* of
|
|
378
|
+
* of responderInst. Any move event could trigger a transfer.
|
|
385
379
|
*
|
|
386
380
|
* @param {string} topLevelType Record from `EventConstants`.
|
|
387
381
|
* @return {boolean} True if a transfer of responder could possibly occur.
|
|
388
382
|
*/
|
|
389
|
-
function canTriggerTransfer(topLevelType,
|
|
390
|
-
return
|
|
391
|
-
// responderIgnoreScroll: We are trying to migrate away from specifically
|
|
392
|
-
// events here and responderIgnoreScroll indicates we
|
|
393
|
-
// canceling touch events instead
|
|
383
|
+
function canTriggerTransfer(topLevelType, topLevelInst, nativeEvent) {
|
|
384
|
+
return topLevelInst && (
|
|
385
|
+
// responderIgnoreScroll: We are trying to migrate away from specifically
|
|
386
|
+
// tracking native scroll events here and responderIgnoreScroll indicates we
|
|
387
|
+
// will send topTouchCancel to handle canceling touch events instead
|
|
394
388
|
topLevelType === EventConstants.topLevelTypes.topScroll && !nativeEvent.responderIgnoreScroll || trackedTouchCount > 0 && topLevelType === EventConstants.topLevelTypes.topSelectionChange || isStartish(topLevelType) || isMoveish(topLevelType));
|
|
395
389
|
}
|
|
396
390
|
|
|
397
391
|
/**
|
|
398
392
|
* Returns whether or not this touch end event makes it such that there are no
|
|
399
|
-
* longer any touches that started inside of the current `
|
|
393
|
+
* longer any touches that started inside of the current `responderInst`.
|
|
400
394
|
*
|
|
401
395
|
* @param {NativeEvent} nativeEvent Native touch end event.
|
|
402
396
|
* @return {boolean} Whether or not this touch end event ends the responder.
|
|
@@ -411,8 +405,8 @@ function noResponderTouches(nativeEvent) {
|
|
|
411
405
|
var target = activeTouch.target;
|
|
412
406
|
if (target !== null && target !== undefined && target !== 0) {
|
|
413
407
|
// Is the original touch location inside of the current responder?
|
|
414
|
-
var
|
|
415
|
-
if (isAncestor) {
|
|
408
|
+
var targetInst = EventPluginUtils.getInstanceFromNode(target);
|
|
409
|
+
if (EventPluginUtils.isAncestor(responderInst, targetInst)) {
|
|
416
410
|
return false;
|
|
417
411
|
}
|
|
418
412
|
}
|
|
@@ -422,36 +416,30 @@ function noResponderTouches(nativeEvent) {
|
|
|
422
416
|
|
|
423
417
|
var ResponderEventPlugin = {
|
|
424
418
|
|
|
425
|
-
|
|
426
|
-
|
|
419
|
+
/* For unit testing only */
|
|
420
|
+
_getResponderID: function () {
|
|
421
|
+
return responderInst ? responderInst._rootNodeID : null;
|
|
427
422
|
},
|
|
428
423
|
|
|
429
424
|
eventTypes: eventTypes,
|
|
430
425
|
|
|
431
426
|
/**
|
|
432
|
-
* We must be resilient to `
|
|
433
|
-
* `
|
|
434
|
-
*
|
|
435
|
-
*
|
|
436
|
-
* @param {string} topLevelType Record from `EventConstants`.
|
|
437
|
-
* @param {DOMEventTarget} topLevelTarget The listening component root node.
|
|
438
|
-
* @param {string} topLevelTargetID ID of `topLevelTarget`.
|
|
439
|
-
* @param {object} nativeEvent Native browser event.
|
|
440
|
-
* @return {*} An accumulation of synthetic events.
|
|
441
|
-
* @see {EventPluginHub.extractEvents}
|
|
427
|
+
* We must be resilient to `targetInst` being `null` on `touchMove` or
|
|
428
|
+
* `touchEnd`. On certain platforms, this means that a native scroll has
|
|
429
|
+
* assumed control and the original touch targets are destroyed.
|
|
442
430
|
*/
|
|
443
|
-
extractEvents: function (topLevelType,
|
|
431
|
+
extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
|
|
444
432
|
if (isStartish(topLevelType)) {
|
|
445
433
|
trackedTouchCount += 1;
|
|
446
434
|
} else if (isEndish(topLevelType)) {
|
|
447
435
|
trackedTouchCount -= 1;
|
|
448
|
-
!(trackedTouchCount >= 0) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Ended a touch event which was not counted in trackedTouchCount.') : invariant(false) :
|
|
436
|
+
!(trackedTouchCount >= 0) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Ended a touch event which was not counted in trackedTouchCount.') : invariant(false) : void 0;
|
|
449
437
|
}
|
|
450
438
|
|
|
451
439
|
ResponderTouchHistoryStore.recordTouchTrack(topLevelType, nativeEvent, nativeEventTarget);
|
|
452
440
|
|
|
453
|
-
var extracted = canTriggerTransfer(topLevelType,
|
|
454
|
-
// Responder may or may not have
|
|
441
|
+
var extracted = canTriggerTransfer(topLevelType, targetInst, nativeEvent) ? setResponderAndExtractTransfer(topLevelType, targetInst, nativeEvent, nativeEventTarget) : null;
|
|
442
|
+
// Responder may or may not have transferred on a new touch start/move.
|
|
455
443
|
// Regardless, whoever is the responder after any potential transfer, we
|
|
456
444
|
// direct all touch start/move/ends to them in the form of
|
|
457
445
|
// `onResponderMove/Start/End`. These will be called for *every* additional
|
|
@@ -461,23 +449,23 @@ var ResponderEventPlugin = {
|
|
|
461
449
|
// These multiple individual change touch events are are always bookended
|
|
462
450
|
// by `onResponderGrant`, and one of
|
|
463
451
|
// (`onResponderRelease/onResponderTerminate`).
|
|
464
|
-
var isResponderTouchStart =
|
|
465
|
-
var isResponderTouchMove =
|
|
466
|
-
var isResponderTouchEnd =
|
|
452
|
+
var isResponderTouchStart = responderInst && isStartish(topLevelType);
|
|
453
|
+
var isResponderTouchMove = responderInst && isMoveish(topLevelType);
|
|
454
|
+
var isResponderTouchEnd = responderInst && isEndish(topLevelType);
|
|
467
455
|
var incrementalTouch = isResponderTouchStart ? eventTypes.responderStart : isResponderTouchMove ? eventTypes.responderMove : isResponderTouchEnd ? eventTypes.responderEnd : null;
|
|
468
456
|
|
|
469
457
|
if (incrementalTouch) {
|
|
470
|
-
var gesture = ResponderSyntheticEvent.getPooled(incrementalTouch,
|
|
458
|
+
var gesture = ResponderSyntheticEvent.getPooled(incrementalTouch, responderInst, nativeEvent, nativeEventTarget);
|
|
471
459
|
gesture.touchHistory = ResponderTouchHistoryStore.touchHistory;
|
|
472
460
|
EventPropagators.accumulateDirectDispatches(gesture);
|
|
473
461
|
extracted = accumulate(extracted, gesture);
|
|
474
462
|
}
|
|
475
463
|
|
|
476
|
-
var isResponderTerminate =
|
|
477
|
-
var isResponderRelease =
|
|
464
|
+
var isResponderTerminate = responderInst && topLevelType === EventConstants.topLevelTypes.topTouchCancel;
|
|
465
|
+
var isResponderRelease = responderInst && !isResponderTerminate && isEndish(topLevelType) && noResponderTouches(nativeEvent);
|
|
478
466
|
var finalTouch = isResponderTerminate ? eventTypes.responderTerminate : isResponderRelease ? eventTypes.responderRelease : null;
|
|
479
467
|
if (finalTouch) {
|
|
480
|
-
var finalEvent = ResponderSyntheticEvent.getPooled(finalTouch,
|
|
468
|
+
var finalEvent = ResponderSyntheticEvent.getPooled(finalTouch, responderInst, nativeEvent, nativeEventTarget);
|
|
481
469
|
finalEvent.touchHistory = ResponderTouchHistoryStore.touchHistory;
|
|
482
470
|
EventPropagators.accumulateDirectDispatches(finalEvent);
|
|
483
471
|
extracted = accumulate(extracted, finalEvent);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
8
|
*
|
|
9
9
|
* @providesModule ResponderSyntheticEvent
|
|
10
|
-
* @typechecks static-only
|
|
11
10
|
*/
|
|
12
11
|
|
|
13
12
|
'use strict';
|
|
@@ -32,7 +31,7 @@ var ResponderEventInterface = {
|
|
|
32
31
|
* @extends {SyntheticEvent}
|
|
33
32
|
*/
|
|
34
33
|
function ResponderSyntheticEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
|
|
35
|
-
SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
|
34
|
+
return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
|
|
36
35
|
}
|
|
37
36
|
|
|
38
37
|
SyntheticEvent.augmentClass(ResponderSyntheticEvent, ResponderEventInterface);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -88,7 +88,7 @@ var reinitializeTouchTrack = function (touchTrack, touch) {
|
|
|
88
88
|
|
|
89
89
|
var validateTouch = function (touch) {
|
|
90
90
|
var identifier = touch.identifier;
|
|
91
|
-
!(identifier != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Touch object is missing identifier') : invariant(false) :
|
|
91
|
+
!(identifier != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Touch object is missing identifier') : invariant(false) : void 0;
|
|
92
92
|
if (identifier > MAX_TOUCH_BANK) {
|
|
93
93
|
console.warn('Touch identifier ' + identifier + ' is greater than maximum ' + 'supported ' + MAX_TOUCH_BANK + ' which causes performance issues ' + 'backfilling array locations for all of the indices.');
|
|
94
94
|
}
|
|
@@ -114,7 +114,7 @@ var recordMoveTouchData = function (touch) {
|
|
|
114
114
|
var touchTrack = touchBank[touch.identifier];
|
|
115
115
|
if (process.env.NODE_ENV !== 'production') {
|
|
116
116
|
validateTouch(touch);
|
|
117
|
-
!touchTrack ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Touch data should have been recorded on start') : invariant(false) :
|
|
117
|
+
!touchTrack ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Touch data should have been recorded on start') : invariant(false) : void 0;
|
|
118
118
|
}
|
|
119
119
|
touchTrack.touchActive = true;
|
|
120
120
|
touchTrack.previousPageX = touchTrack.currentPageX;
|
|
@@ -131,7 +131,7 @@ var recordEndTouchData = function (touch) {
|
|
|
131
131
|
var touchTrack = touchBank[touch.identifier];
|
|
132
132
|
if (process.env.NODE_ENV !== 'production') {
|
|
133
133
|
validateTouch(touch);
|
|
134
|
-
!touchTrack ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Touch data should have been recorded on start') : invariant(false) :
|
|
134
|
+
!touchTrack ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Touch data should have been recorded on start') : invariant(false) : void 0;
|
|
135
135
|
}
|
|
136
136
|
touchTrack.previousPageX = touchTrack.currentPageX;
|
|
137
137
|
touchTrack.previousPageY = touchTrack.currentPageY;
|
|
@@ -168,7 +168,7 @@ var ResponderTouchHistoryStore = {
|
|
|
168
168
|
if (process.env.NODE_ENV !== 'production') {
|
|
169
169
|
var activeTouchData = touchBank[touchHistory.indexOfSingleActiveTouch];
|
|
170
170
|
var foundActive = activeTouchData != null && !!activeTouchData.touchActive;
|
|
171
|
-
!foundActive ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot find single active touch') : invariant(false) :
|
|
171
|
+
!foundActive ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot find single active touch') : invariant(false) : void 0;
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
174
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -11,72 +11,270 @@
|
|
|
11
11
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
|
-
var DOMProperty = require('./DOMProperty');
|
|
15
|
-
|
|
16
|
-
var MUST_USE_ATTRIBUTE = DOMProperty.injection.MUST_USE_ATTRIBUTE;
|
|
17
|
-
|
|
18
14
|
var NS = {
|
|
19
15
|
xlink: 'http://www.w3.org/1999/xlink',
|
|
20
16
|
xml: 'http://www.w3.org/XML/1998/namespace'
|
|
21
17
|
};
|
|
22
18
|
|
|
19
|
+
// We use attributes for everything SVG so let's avoid some duplication and run
|
|
20
|
+
// code instead.
|
|
21
|
+
// The following are all specified in the HTML config already so we exclude here.
|
|
22
|
+
// - class (as className)
|
|
23
|
+
// - color
|
|
24
|
+
// - height
|
|
25
|
+
// - id
|
|
26
|
+
// - lang
|
|
27
|
+
// - max
|
|
28
|
+
// - media
|
|
29
|
+
// - method
|
|
30
|
+
// - min
|
|
31
|
+
// - name
|
|
32
|
+
// - style
|
|
33
|
+
// - target
|
|
34
|
+
// - type
|
|
35
|
+
// - width
|
|
36
|
+
var ATTRS = {
|
|
37
|
+
accentHeight: 'accent-height',
|
|
38
|
+
accumulate: 0,
|
|
39
|
+
additive: 0,
|
|
40
|
+
alignmentBaseline: 'alignment-baseline',
|
|
41
|
+
allowReorder: 'allowReorder',
|
|
42
|
+
alphabetic: 0,
|
|
43
|
+
amplitude: 0,
|
|
44
|
+
arabicForm: 'arabic-form',
|
|
45
|
+
ascent: 0,
|
|
46
|
+
attributeName: 'attributeName',
|
|
47
|
+
attributeType: 'attributeType',
|
|
48
|
+
autoReverse: 'autoReverse',
|
|
49
|
+
azimuth: 0,
|
|
50
|
+
baseFrequency: 'baseFrequency',
|
|
51
|
+
baseProfile: 'baseProfile',
|
|
52
|
+
baselineShift: 'baseline-shift',
|
|
53
|
+
bbox: 0,
|
|
54
|
+
begin: 0,
|
|
55
|
+
bias: 0,
|
|
56
|
+
by: 0,
|
|
57
|
+
calcMode: 'calcMode',
|
|
58
|
+
capHeight: 'cap-height',
|
|
59
|
+
clip: 0,
|
|
60
|
+
clipPath: 'clip-path',
|
|
61
|
+
clipRule: 'clip-rule',
|
|
62
|
+
clipPathUnits: 'clipPathUnits',
|
|
63
|
+
colorInterpolation: 'color-interpolation',
|
|
64
|
+
colorInterpolationFilters: 'color-interpolation-filters',
|
|
65
|
+
colorProfile: 'color-profile',
|
|
66
|
+
colorRendering: 'color-rendering',
|
|
67
|
+
contentScriptType: 'contentScriptType',
|
|
68
|
+
contentStyleType: 'contentStyleType',
|
|
69
|
+
cursor: 0,
|
|
70
|
+
cx: 0,
|
|
71
|
+
cy: 0,
|
|
72
|
+
d: 0,
|
|
73
|
+
decelerate: 0,
|
|
74
|
+
descent: 0,
|
|
75
|
+
diffuseConstant: 'diffuseConstant',
|
|
76
|
+
direction: 0,
|
|
77
|
+
display: 0,
|
|
78
|
+
divisor: 0,
|
|
79
|
+
dominantBaseline: 'dominant-baseline',
|
|
80
|
+
dur: 0,
|
|
81
|
+
dx: 0,
|
|
82
|
+
dy: 0,
|
|
83
|
+
edgeMode: 'edgeMode',
|
|
84
|
+
elevation: 0,
|
|
85
|
+
enableBackground: 'enable-background',
|
|
86
|
+
end: 0,
|
|
87
|
+
exponent: 0,
|
|
88
|
+
externalResourcesRequired: 'externalResourcesRequired',
|
|
89
|
+
fill: 0,
|
|
90
|
+
fillOpacity: 'fill-opacity',
|
|
91
|
+
fillRule: 'fill-rule',
|
|
92
|
+
filter: 0,
|
|
93
|
+
filterRes: 'filterRes',
|
|
94
|
+
filterUnits: 'filterUnits',
|
|
95
|
+
floodColor: 'flood-color',
|
|
96
|
+
floodOpacity: 'flood-opacity',
|
|
97
|
+
focusable: 0,
|
|
98
|
+
fontFamily: 'font-family',
|
|
99
|
+
fontSize: 'font-size',
|
|
100
|
+
fontSizeAdjust: 'font-size-adjust',
|
|
101
|
+
fontStretch: 'font-stretch',
|
|
102
|
+
fontStyle: 'font-style',
|
|
103
|
+
fontVariant: 'font-variant',
|
|
104
|
+
fontWeight: 'font-weight',
|
|
105
|
+
format: 0,
|
|
106
|
+
from: 0,
|
|
107
|
+
fx: 0,
|
|
108
|
+
fy: 0,
|
|
109
|
+
g1: 0,
|
|
110
|
+
g2: 0,
|
|
111
|
+
glyphName: 'glyph-name',
|
|
112
|
+
glyphOrientationHorizontal: 'glyph-orientation-horizontal',
|
|
113
|
+
glyphOrientationVertical: 'glyph-orientation-vertical',
|
|
114
|
+
glyphRef: 'glyphRef',
|
|
115
|
+
gradientTransform: 'gradientTransform',
|
|
116
|
+
gradientUnits: 'gradientUnits',
|
|
117
|
+
hanging: 0,
|
|
118
|
+
horizAdvX: 'horiz-adv-x',
|
|
119
|
+
horizOriginX: 'horiz-origin-x',
|
|
120
|
+
ideographic: 0,
|
|
121
|
+
imageRendering: 'image-rendering',
|
|
122
|
+
'in': 0,
|
|
123
|
+
in2: 0,
|
|
124
|
+
intercept: 0,
|
|
125
|
+
k: 0,
|
|
126
|
+
k1: 0,
|
|
127
|
+
k2: 0,
|
|
128
|
+
k3: 0,
|
|
129
|
+
k4: 0,
|
|
130
|
+
kernelMatrix: 'kernelMatrix',
|
|
131
|
+
kernelUnitLength: 'kernelUnitLength',
|
|
132
|
+
kerning: 0,
|
|
133
|
+
keyPoints: 'keyPoints',
|
|
134
|
+
keySplines: 'keySplines',
|
|
135
|
+
keyTimes: 'keyTimes',
|
|
136
|
+
lengthAdjust: 'lengthAdjust',
|
|
137
|
+
letterSpacing: 'letter-spacing',
|
|
138
|
+
lightingColor: 'lighting-color',
|
|
139
|
+
limitingConeAngle: 'limitingConeAngle',
|
|
140
|
+
local: 0,
|
|
141
|
+
markerEnd: 'marker-end',
|
|
142
|
+
markerMid: 'marker-mid',
|
|
143
|
+
markerStart: 'marker-start',
|
|
144
|
+
markerHeight: 'markerHeight',
|
|
145
|
+
markerUnits: 'markerUnits',
|
|
146
|
+
markerWidth: 'markerWidth',
|
|
147
|
+
mask: 0,
|
|
148
|
+
maskContentUnits: 'maskContentUnits',
|
|
149
|
+
maskUnits: 'maskUnits',
|
|
150
|
+
mathematical: 0,
|
|
151
|
+
mode: 0,
|
|
152
|
+
numOctaves: 'numOctaves',
|
|
153
|
+
offset: 0,
|
|
154
|
+
opacity: 0,
|
|
155
|
+
operator: 0,
|
|
156
|
+
order: 0,
|
|
157
|
+
orient: 0,
|
|
158
|
+
orientation: 0,
|
|
159
|
+
origin: 0,
|
|
160
|
+
overflow: 0,
|
|
161
|
+
overlinePosition: 'overline-position',
|
|
162
|
+
overlineThickness: 'overline-thickness',
|
|
163
|
+
paintOrder: 'paint-order',
|
|
164
|
+
panose1: 'panose-1',
|
|
165
|
+
pathLength: 'pathLength',
|
|
166
|
+
patternContentUnits: 'patternContentUnits',
|
|
167
|
+
patternTransform: 'patternTransform',
|
|
168
|
+
patternUnits: 'patternUnits',
|
|
169
|
+
pointerEvents: 'pointer-events',
|
|
170
|
+
points: 0,
|
|
171
|
+
pointsAtX: 'pointsAtX',
|
|
172
|
+
pointsAtY: 'pointsAtY',
|
|
173
|
+
pointsAtZ: 'pointsAtZ',
|
|
174
|
+
preserveAlpha: 'preserveAlpha',
|
|
175
|
+
preserveAspectRatio: 'preserveAspectRatio',
|
|
176
|
+
primitiveUnits: 'primitiveUnits',
|
|
177
|
+
r: 0,
|
|
178
|
+
radius: 0,
|
|
179
|
+
refX: 'refX',
|
|
180
|
+
refY: 'refY',
|
|
181
|
+
renderingIntent: 'rendering-intent',
|
|
182
|
+
repeatCount: 'repeatCount',
|
|
183
|
+
repeatDur: 'repeatDur',
|
|
184
|
+
requiredExtensions: 'requiredExtensions',
|
|
185
|
+
requiredFeatures: 'requiredFeatures',
|
|
186
|
+
restart: 0,
|
|
187
|
+
result: 0,
|
|
188
|
+
rotate: 0,
|
|
189
|
+
rx: 0,
|
|
190
|
+
ry: 0,
|
|
191
|
+
scale: 0,
|
|
192
|
+
seed: 0,
|
|
193
|
+
shapeRendering: 'shape-rendering',
|
|
194
|
+
slope: 0,
|
|
195
|
+
spacing: 0,
|
|
196
|
+
specularConstant: 'specularConstant',
|
|
197
|
+
specularExponent: 'specularExponent',
|
|
198
|
+
speed: 0,
|
|
199
|
+
spreadMethod: 'spreadMethod',
|
|
200
|
+
startOffset: 'startOffset',
|
|
201
|
+
stdDeviation: 'stdDeviation',
|
|
202
|
+
stemh: 0,
|
|
203
|
+
stemv: 0,
|
|
204
|
+
stitchTiles: 'stitchTiles',
|
|
205
|
+
stopColor: 'stop-color',
|
|
206
|
+
stopOpacity: 'stop-opacity',
|
|
207
|
+
strikethroughPosition: 'strikethrough-position',
|
|
208
|
+
strikethroughThickness: 'strikethrough-thickness',
|
|
209
|
+
string: 0,
|
|
210
|
+
stroke: 0,
|
|
211
|
+
strokeDasharray: 'stroke-dasharray',
|
|
212
|
+
strokeDashoffset: 'stroke-dashoffset',
|
|
213
|
+
strokeLinecap: 'stroke-linecap',
|
|
214
|
+
strokeLinejoin: 'stroke-linejoin',
|
|
215
|
+
strokeMiterlimit: 'stroke-miterlimit',
|
|
216
|
+
strokeOpacity: 'stroke-opacity',
|
|
217
|
+
strokeWidth: 'stroke-width',
|
|
218
|
+
surfaceScale: 'surfaceScale',
|
|
219
|
+
systemLanguage: 'systemLanguage',
|
|
220
|
+
tableValues: 'tableValues',
|
|
221
|
+
targetX: 'targetX',
|
|
222
|
+
targetY: 'targetY',
|
|
223
|
+
textAnchor: 'text-anchor',
|
|
224
|
+
textDecoration: 'text-decoration',
|
|
225
|
+
textRendering: 'text-rendering',
|
|
226
|
+
textLength: 'textLength',
|
|
227
|
+
to: 0,
|
|
228
|
+
transform: 0,
|
|
229
|
+
u1: 0,
|
|
230
|
+
u2: 0,
|
|
231
|
+
underlinePosition: 'underline-position',
|
|
232
|
+
underlineThickness: 'underline-thickness',
|
|
233
|
+
unicode: 0,
|
|
234
|
+
unicodeBidi: 'unicode-bidi',
|
|
235
|
+
unicodeRange: 'unicode-range',
|
|
236
|
+
unitsPerEm: 'units-per-em',
|
|
237
|
+
vAlphabetic: 'v-alphabetic',
|
|
238
|
+
vHanging: 'v-hanging',
|
|
239
|
+
vIdeographic: 'v-ideographic',
|
|
240
|
+
vMathematical: 'v-mathematical',
|
|
241
|
+
values: 0,
|
|
242
|
+
vectorEffect: 'vector-effect',
|
|
243
|
+
version: 0,
|
|
244
|
+
vertAdvY: 'vert-adv-y',
|
|
245
|
+
vertOriginX: 'vert-origin-x',
|
|
246
|
+
vertOriginY: 'vert-origin-y',
|
|
247
|
+
viewBox: 'viewBox',
|
|
248
|
+
viewTarget: 'viewTarget',
|
|
249
|
+
visibility: 0,
|
|
250
|
+
widths: 0,
|
|
251
|
+
wordSpacing: 'word-spacing',
|
|
252
|
+
writingMode: 'writing-mode',
|
|
253
|
+
x: 0,
|
|
254
|
+
xHeight: 'x-height',
|
|
255
|
+
x1: 0,
|
|
256
|
+
x2: 0,
|
|
257
|
+
xChannelSelector: 'xChannelSelector',
|
|
258
|
+
xlinkActuate: 'xlink:actuate',
|
|
259
|
+
xlinkArcrole: 'xlink:arcrole',
|
|
260
|
+
xlinkHref: 'xlink:href',
|
|
261
|
+
xlinkRole: 'xlink:role',
|
|
262
|
+
xlinkShow: 'xlink:show',
|
|
263
|
+
xlinkTitle: 'xlink:title',
|
|
264
|
+
xlinkType: 'xlink:type',
|
|
265
|
+
xmlBase: 'xml:base',
|
|
266
|
+
xmlLang: 'xml:lang',
|
|
267
|
+
xmlSpace: 'xml:space',
|
|
268
|
+
y: 0,
|
|
269
|
+
y1: 0,
|
|
270
|
+
y2: 0,
|
|
271
|
+
yChannelSelector: 'yChannelSelector',
|
|
272
|
+
z: 0,
|
|
273
|
+
zoomAndPan: 'zoomAndPan'
|
|
274
|
+
};
|
|
275
|
+
|
|
23
276
|
var SVGDOMPropertyConfig = {
|
|
24
|
-
Properties: {
|
|
25
|
-
clipPath: MUST_USE_ATTRIBUTE,
|
|
26
|
-
cx: MUST_USE_ATTRIBUTE,
|
|
27
|
-
cy: MUST_USE_ATTRIBUTE,
|
|
28
|
-
d: MUST_USE_ATTRIBUTE,
|
|
29
|
-
dx: MUST_USE_ATTRIBUTE,
|
|
30
|
-
dy: MUST_USE_ATTRIBUTE,
|
|
31
|
-
fill: MUST_USE_ATTRIBUTE,
|
|
32
|
-
fillOpacity: MUST_USE_ATTRIBUTE,
|
|
33
|
-
fontFamily: MUST_USE_ATTRIBUTE,
|
|
34
|
-
fontSize: MUST_USE_ATTRIBUTE,
|
|
35
|
-
fx: MUST_USE_ATTRIBUTE,
|
|
36
|
-
fy: MUST_USE_ATTRIBUTE,
|
|
37
|
-
gradientTransform: MUST_USE_ATTRIBUTE,
|
|
38
|
-
gradientUnits: MUST_USE_ATTRIBUTE,
|
|
39
|
-
markerEnd: MUST_USE_ATTRIBUTE,
|
|
40
|
-
markerMid: MUST_USE_ATTRIBUTE,
|
|
41
|
-
markerStart: MUST_USE_ATTRIBUTE,
|
|
42
|
-
offset: MUST_USE_ATTRIBUTE,
|
|
43
|
-
opacity: MUST_USE_ATTRIBUTE,
|
|
44
|
-
patternContentUnits: MUST_USE_ATTRIBUTE,
|
|
45
|
-
patternUnits: MUST_USE_ATTRIBUTE,
|
|
46
|
-
points: MUST_USE_ATTRIBUTE,
|
|
47
|
-
preserveAspectRatio: MUST_USE_ATTRIBUTE,
|
|
48
|
-
r: MUST_USE_ATTRIBUTE,
|
|
49
|
-
rx: MUST_USE_ATTRIBUTE,
|
|
50
|
-
ry: MUST_USE_ATTRIBUTE,
|
|
51
|
-
spreadMethod: MUST_USE_ATTRIBUTE,
|
|
52
|
-
stopColor: MUST_USE_ATTRIBUTE,
|
|
53
|
-
stopOpacity: MUST_USE_ATTRIBUTE,
|
|
54
|
-
stroke: MUST_USE_ATTRIBUTE,
|
|
55
|
-
strokeDasharray: MUST_USE_ATTRIBUTE,
|
|
56
|
-
strokeLinecap: MUST_USE_ATTRIBUTE,
|
|
57
|
-
strokeOpacity: MUST_USE_ATTRIBUTE,
|
|
58
|
-
strokeWidth: MUST_USE_ATTRIBUTE,
|
|
59
|
-
textAnchor: MUST_USE_ATTRIBUTE,
|
|
60
|
-
transform: MUST_USE_ATTRIBUTE,
|
|
61
|
-
version: MUST_USE_ATTRIBUTE,
|
|
62
|
-
viewBox: MUST_USE_ATTRIBUTE,
|
|
63
|
-
x1: MUST_USE_ATTRIBUTE,
|
|
64
|
-
x2: MUST_USE_ATTRIBUTE,
|
|
65
|
-
x: MUST_USE_ATTRIBUTE,
|
|
66
|
-
xlinkActuate: MUST_USE_ATTRIBUTE,
|
|
67
|
-
xlinkArcrole: MUST_USE_ATTRIBUTE,
|
|
68
|
-
xlinkHref: MUST_USE_ATTRIBUTE,
|
|
69
|
-
xlinkRole: MUST_USE_ATTRIBUTE,
|
|
70
|
-
xlinkShow: MUST_USE_ATTRIBUTE,
|
|
71
|
-
xlinkTitle: MUST_USE_ATTRIBUTE,
|
|
72
|
-
xlinkType: MUST_USE_ATTRIBUTE,
|
|
73
|
-
xmlBase: MUST_USE_ATTRIBUTE,
|
|
74
|
-
xmlLang: MUST_USE_ATTRIBUTE,
|
|
75
|
-
xmlSpace: MUST_USE_ATTRIBUTE,
|
|
76
|
-
y1: MUST_USE_ATTRIBUTE,
|
|
77
|
-
y2: MUST_USE_ATTRIBUTE,
|
|
78
|
-
y: MUST_USE_ATTRIBUTE
|
|
79
|
-
},
|
|
277
|
+
Properties: {},
|
|
80
278
|
DOMAttributeNamespaces: {
|
|
81
279
|
xlinkActuate: NS.xlink,
|
|
82
280
|
xlinkArcrole: NS.xlink,
|
|
@@ -89,39 +287,14 @@ var SVGDOMPropertyConfig = {
|
|
|
89
287
|
xmlLang: NS.xml,
|
|
90
288
|
xmlSpace: NS.xml
|
|
91
289
|
},
|
|
92
|
-
DOMAttributeNames: {
|
|
93
|
-
clipPath: 'clip-path',
|
|
94
|
-
fillOpacity: 'fill-opacity',
|
|
95
|
-
fontFamily: 'font-family',
|
|
96
|
-
fontSize: 'font-size',
|
|
97
|
-
gradientTransform: 'gradientTransform',
|
|
98
|
-
gradientUnits: 'gradientUnits',
|
|
99
|
-
markerEnd: 'marker-end',
|
|
100
|
-
markerMid: 'marker-mid',
|
|
101
|
-
markerStart: 'marker-start',
|
|
102
|
-
patternContentUnits: 'patternContentUnits',
|
|
103
|
-
patternUnits: 'patternUnits',
|
|
104
|
-
preserveAspectRatio: 'preserveAspectRatio',
|
|
105
|
-
spreadMethod: 'spreadMethod',
|
|
106
|
-
stopColor: 'stop-color',
|
|
107
|
-
stopOpacity: 'stop-opacity',
|
|
108
|
-
strokeDasharray: 'stroke-dasharray',
|
|
109
|
-
strokeLinecap: 'stroke-linecap',
|
|
110
|
-
strokeOpacity: 'stroke-opacity',
|
|
111
|
-
strokeWidth: 'stroke-width',
|
|
112
|
-
textAnchor: 'text-anchor',
|
|
113
|
-
viewBox: 'viewBox',
|
|
114
|
-
xlinkActuate: 'xlink:actuate',
|
|
115
|
-
xlinkArcrole: 'xlink:arcrole',
|
|
116
|
-
xlinkHref: 'xlink:href',
|
|
117
|
-
xlinkRole: 'xlink:role',
|
|
118
|
-
xlinkShow: 'xlink:show',
|
|
119
|
-
xlinkTitle: 'xlink:title',
|
|
120
|
-
xlinkType: 'xlink:type',
|
|
121
|
-
xmlBase: 'xml:base',
|
|
122
|
-
xmlLang: 'xml:lang',
|
|
123
|
-
xmlSpace: 'xml:space'
|
|
124
|
-
}
|
|
290
|
+
DOMAttributeNames: {}
|
|
125
291
|
};
|
|
126
292
|
|
|
293
|
+
Object.keys(ATTRS).map(function (key) {
|
|
294
|
+
SVGDOMPropertyConfig.Properties[key] = 0;
|
|
295
|
+
if (ATTRS[key]) {
|
|
296
|
+
SVGDOMPropertyConfig.DOMAttributeNames[key] = ATTRS[key];
|
|
297
|
+
}
|
|
298
|
+
});
|
|
299
|
+
|
|
127
300
|
module.exports = SVGDOMPropertyConfig;
|