yeet
This commit is contained in:
106
node_modules/react-native-web/dist/cjs/exports/AccessibilityInfo/index.js
generated
vendored
Normal file
106
node_modules/react-native-web/dist/cjs/exports/AccessibilityInfo/index.js
generated
vendored
Normal file
@ -0,0 +1,106 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _ExecutionEnvironment = require("fbjs/lib/ExecutionEnvironment");
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
function isScreenReaderEnabled() {
|
||||
return new Promise(function (resolve, reject) {
|
||||
resolve(true);
|
||||
});
|
||||
}
|
||||
|
||||
var prefersReducedMotionMedia = _ExecutionEnvironment.canUseDOM ? window.matchMedia('(prefers-reduced-motion: reduce)') : null;
|
||||
|
||||
function isReduceMotionEnabled() {
|
||||
return new Promise(function (resolve, reject) {
|
||||
resolve(prefersReducedMotionMedia ? prefersReducedMotionMedia.matches : true);
|
||||
});
|
||||
}
|
||||
|
||||
var handlers = {};
|
||||
var AccessibilityInfo = {
|
||||
/**
|
||||
* Query whether a screen reader is currently enabled.
|
||||
*
|
||||
* Returns a promise which resolves to a boolean.
|
||||
* The result is `true` when a screen reader is enabled and `false` otherwise.
|
||||
*/
|
||||
isScreenReaderEnabled: isScreenReaderEnabled,
|
||||
|
||||
/**
|
||||
* Query whether the user prefers reduced motion.
|
||||
*
|
||||
* Returns a promise which resolves to a boolean.
|
||||
* The result is `true` when a screen reader is enabled and `false` otherwise.
|
||||
*/
|
||||
isReduceMotionEnabled: isReduceMotionEnabled,
|
||||
|
||||
/**
|
||||
* Deprecated
|
||||
*/
|
||||
fetch: isScreenReaderEnabled,
|
||||
|
||||
/**
|
||||
* Add an event handler. Supported events: reduceMotionChanged
|
||||
*/
|
||||
addEventListener: function addEventListener(eventName, handler) {
|
||||
if (eventName === 'reduceMotionChanged') {
|
||||
if (!prefersReducedMotionMedia) {
|
||||
return;
|
||||
}
|
||||
|
||||
var listener = function listener(event) {
|
||||
handler(event.matches);
|
||||
};
|
||||
|
||||
prefersReducedMotionMedia.addEventListener('change', listener);
|
||||
handlers[handler] = listener;
|
||||
}
|
||||
|
||||
return {
|
||||
remove: function remove() {
|
||||
return AccessibilityInfo.removeEventListener(eventName, handler);
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
/**
|
||||
* Set accessibility focus to a react component.
|
||||
*/
|
||||
setAccessibilityFocus: function setAccessibilityFocus(reactTag) {},
|
||||
|
||||
/**
|
||||
* Post a string to be announced by the screen reader.
|
||||
*/
|
||||
announceForAccessibility: function announceForAccessibility(announcement) {},
|
||||
|
||||
/**
|
||||
* Remove an event handler.
|
||||
*/
|
||||
removeEventListener: function removeEventListener(eventName, handler) {
|
||||
if (eventName === 'reduceMotionChanged') {
|
||||
var listener = handlers[handler];
|
||||
|
||||
if (!listener || !prefersReducedMotionMedia) {
|
||||
return;
|
||||
}
|
||||
|
||||
prefersReducedMotionMedia.removeEventListener('change', listener);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
};
|
||||
var _default = AccessibilityInfo;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
121
node_modules/react-native-web/dist/cjs/exports/ActivityIndicator/index.js
generated
vendored
Normal file
121
node_modules/react-native-web/dist/cjs/exports/ActivityIndicator/index.js
generated
vendored
Normal file
@ -0,0 +1,121 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _StyleSheet = _interopRequireDefault(require("../StyleSheet"));
|
||||
|
||||
var _View = _interopRequireDefault(require("../View"));
|
||||
|
||||
var _react = _interopRequireWildcard(require("react"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
||||
|
||||
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
||||
|
||||
var accessibilityValue = {
|
||||
max: 1,
|
||||
min: 0
|
||||
};
|
||||
|
||||
var createSvgCircle = function createSvgCircle(style) {
|
||||
return _react.default.createElement("circle", {
|
||||
cx: "16",
|
||||
cy: "16",
|
||||
fill: "none",
|
||||
r: "14",
|
||||
strokeWidth: "4",
|
||||
style: style
|
||||
});
|
||||
};
|
||||
|
||||
var ActivityIndicator = (0, _react.forwardRef)(function (props, forwardedRef) {
|
||||
var _props$animating = props.animating,
|
||||
animating = _props$animating === void 0 ? true : _props$animating,
|
||||
_props$color = props.color,
|
||||
color = _props$color === void 0 ? '#1976D2' : _props$color,
|
||||
_props$hidesWhenStopp = props.hidesWhenStopped,
|
||||
hidesWhenStopped = _props$hidesWhenStopp === void 0 ? true : _props$hidesWhenStopp,
|
||||
_props$size = props.size,
|
||||
size = _props$size === void 0 ? 'small' : _props$size,
|
||||
style = props.style,
|
||||
other = _objectWithoutPropertiesLoose(props, ["animating", "color", "hidesWhenStopped", "size", "style"]);
|
||||
|
||||
var svg = _react.default.createElement("svg", {
|
||||
height: "100%",
|
||||
viewBox: "0 0 32 32",
|
||||
width: "100%"
|
||||
}, createSvgCircle({
|
||||
stroke: color,
|
||||
opacity: 0.2
|
||||
}), createSvgCircle({
|
||||
stroke: color,
|
||||
strokeDasharray: 80,
|
||||
strokeDashoffset: 60
|
||||
}));
|
||||
|
||||
return _react.default.createElement(_View.default, _extends({}, other, {
|
||||
accessibilityRole: "progressbar",
|
||||
accessibilityValue: accessibilityValue,
|
||||
ref: forwardedRef,
|
||||
style: [styles.container, style]
|
||||
}), _react.default.createElement(_View.default, {
|
||||
children: svg,
|
||||
style: [typeof size === 'number' ? {
|
||||
height: size,
|
||||
width: size
|
||||
} : indicatorSizes[size], styles.animation, !animating && styles.animationPause, !animating && hidesWhenStopped && styles.hidesWhenStopped]
|
||||
}));
|
||||
});
|
||||
ActivityIndicator.displayName = 'ActivityIndicator';
|
||||
|
||||
var styles = _StyleSheet.default.create({
|
||||
container: {
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center'
|
||||
},
|
||||
hidesWhenStopped: {
|
||||
visibility: 'hidden'
|
||||
},
|
||||
animation: {
|
||||
animationDuration: '0.75s',
|
||||
animationKeyframes: [{
|
||||
'0%': {
|
||||
transform: [{
|
||||
rotate: '0deg'
|
||||
}]
|
||||
},
|
||||
'100%': {
|
||||
transform: [{
|
||||
rotate: '360deg'
|
||||
}]
|
||||
}
|
||||
}],
|
||||
animationTimingFunction: 'linear',
|
||||
animationIterationCount: 'infinite'
|
||||
},
|
||||
animationPause: {
|
||||
animationPlayState: 'paused'
|
||||
}
|
||||
});
|
||||
|
||||
var indicatorSizes = _StyleSheet.default.create({
|
||||
small: {
|
||||
width: 20,
|
||||
height: 20
|
||||
},
|
||||
large: {
|
||||
width: 36,
|
||||
height: 36
|
||||
}
|
||||
});
|
||||
|
||||
var _default = ActivityIndicator;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
26
node_modules/react-native-web/dist/cjs/exports/Alert/index.js
generated
vendored
Normal file
26
node_modules/react-native-web/dist/cjs/exports/Alert/index.js
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
var Alert =
|
||||
/*#__PURE__*/
|
||||
function () {
|
||||
function Alert() {}
|
||||
|
||||
Alert.alert = function alert() {};
|
||||
|
||||
return Alert;
|
||||
}();
|
||||
|
||||
var _default = Alert;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
45
node_modules/react-native-web/dist/cjs/exports/Animated/index.js
generated
vendored
Normal file
45
node_modules/react-native-web/dist/cjs/exports/Animated/index.js
generated
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _AnimatedImplementation = _interopRequireDefault(require("../../vendor/react-native/Animated/AnimatedImplementation"));
|
||||
|
||||
var _FlatList = _interopRequireDefault(require("../FlatList"));
|
||||
|
||||
var _Image = _interopRequireDefault(require("../Image"));
|
||||
|
||||
var _SectionList = _interopRequireDefault(require("../SectionList"));
|
||||
|
||||
var _ScrollView = _interopRequireDefault(require("../ScrollView"));
|
||||
|
||||
var _Text = _interopRequireDefault(require("../Text"));
|
||||
|
||||
var _View = _interopRequireDefault(require("../View"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
||||
|
||||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
var Animated = _objectSpread({}, _AnimatedImplementation.default, {
|
||||
FlatList: _AnimatedImplementation.default.createAnimatedComponent(_FlatList.default, {
|
||||
scrollEventThrottle: 0.0001
|
||||
}),
|
||||
Image: _AnimatedImplementation.default.createAnimatedComponent(_Image.default),
|
||||
ScrollView: _AnimatedImplementation.default.createAnimatedComponent(_ScrollView.default, {
|
||||
scrollEventThrottle: 0.0001
|
||||
}),
|
||||
SectionList: _AnimatedImplementation.default.createAnimatedComponent(_SectionList.default, {
|
||||
scrollEventThrottle: 0.0001
|
||||
}),
|
||||
View: _AnimatedImplementation.default.createAnimatedComponent(_View.default),
|
||||
Text: _AnimatedImplementation.default.createAnimatedComponent(_Text.default)
|
||||
});
|
||||
|
||||
var _default = Animated;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
58
node_modules/react-native-web/dist/cjs/exports/AppRegistry/AppContainer.js
generated
vendored
Normal file
58
node_modules/react-native-web/dist/cjs/exports/AppRegistry/AppContainer.js
generated
vendored
Normal file
@ -0,0 +1,58 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = AppContainer;
|
||||
|
||||
var _StyleSheet = _interopRequireDefault(require("../StyleSheet"));
|
||||
|
||||
var _View = _interopRequireDefault(require("../View"));
|
||||
|
||||
var _react = _interopRequireWildcard(require("react"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
var RootTagContext = (0, _react.createContext)(null);
|
||||
|
||||
function AppContainer(props) {
|
||||
var children = props.children,
|
||||
WrapperComponent = props.WrapperComponent;
|
||||
|
||||
var innerView = _react.default.createElement(_View.default, {
|
||||
children: children,
|
||||
key: 1,
|
||||
pointerEvents: "box-none",
|
||||
style: styles.appContainer
|
||||
});
|
||||
|
||||
if (WrapperComponent) {
|
||||
innerView = _react.default.createElement(WrapperComponent, null, innerView);
|
||||
}
|
||||
|
||||
return _react.default.createElement(RootTagContext.Provider, {
|
||||
value: props.rootTag
|
||||
}, _react.default.createElement(_View.default, {
|
||||
pointerEvents: "box-none",
|
||||
style: styles.appContainer
|
||||
}, innerView));
|
||||
}
|
||||
|
||||
var styles = _StyleSheet.default.create({
|
||||
appContainer: {
|
||||
flex: 1
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = exports.default;
|
119
node_modules/react-native-web/dist/cjs/exports/AppRegistry/index.js
generated
vendored
Normal file
119
node_modules/react-native-web/dist/cjs/exports/AppRegistry/index.js
generated
vendored
Normal file
@ -0,0 +1,119 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _invariant = _interopRequireDefault(require("fbjs/lib/invariant"));
|
||||
|
||||
var _unmountComponentAtNode = _interopRequireDefault(require("../unmountComponentAtNode"));
|
||||
|
||||
var _renderApplication = _interopRequireWildcard(require("./renderApplication"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
||||
|
||||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
var emptyObject = {};
|
||||
var runnables = {};
|
||||
|
||||
var componentProviderInstrumentationHook = function componentProviderInstrumentationHook(component) {
|
||||
return component();
|
||||
};
|
||||
|
||||
var wrapperComponentProvider;
|
||||
|
||||
/**
|
||||
* `AppRegistry` is the JS entry point to running all React Native apps.
|
||||
*/
|
||||
var AppRegistry =
|
||||
/*#__PURE__*/
|
||||
function () {
|
||||
function AppRegistry() {}
|
||||
|
||||
AppRegistry.getAppKeys = function getAppKeys() {
|
||||
return Object.keys(runnables);
|
||||
};
|
||||
|
||||
AppRegistry.getApplication = function getApplication(appKey, appParameters) {
|
||||
(0, _invariant.default)(runnables[appKey] && runnables[appKey].getApplication, "Application " + appKey + " has not been registered. " + 'This is either due to an import error during initialization or failure to call AppRegistry.registerComponent.');
|
||||
return runnables[appKey].getApplication(appParameters);
|
||||
};
|
||||
|
||||
AppRegistry.registerComponent = function registerComponent(appKey, componentProvider) {
|
||||
runnables[appKey] = {
|
||||
getApplication: function getApplication(appParameters) {
|
||||
return (0, _renderApplication.getApplication)(componentProviderInstrumentationHook(componentProvider), appParameters ? appParameters.initialProps : emptyObject, wrapperComponentProvider && wrapperComponentProvider(appParameters));
|
||||
},
|
||||
run: function run(appParameters) {
|
||||
return (0, _renderApplication.default)(componentProviderInstrumentationHook(componentProvider), wrapperComponentProvider && wrapperComponentProvider(appParameters), appParameters.callback, {
|
||||
hydrate: appParameters.hydrate || false,
|
||||
initialProps: appParameters.initialProps || emptyObject,
|
||||
rootTag: appParameters.rootTag
|
||||
});
|
||||
}
|
||||
};
|
||||
return appKey;
|
||||
};
|
||||
|
||||
AppRegistry.registerConfig = function registerConfig(config) {
|
||||
config.forEach(function (_ref) {
|
||||
var appKey = _ref.appKey,
|
||||
component = _ref.component,
|
||||
run = _ref.run;
|
||||
|
||||
if (run) {
|
||||
AppRegistry.registerRunnable(appKey, run);
|
||||
} else {
|
||||
(0, _invariant.default)(component, 'No component provider passed in');
|
||||
AppRegistry.registerComponent(appKey, component);
|
||||
}
|
||||
});
|
||||
} // TODO: fix style sheet creation when using this method
|
||||
;
|
||||
|
||||
AppRegistry.registerRunnable = function registerRunnable(appKey, run) {
|
||||
runnables[appKey] = {
|
||||
run: run
|
||||
};
|
||||
return appKey;
|
||||
};
|
||||
|
||||
AppRegistry.runApplication = function runApplication(appKey, appParameters) {
|
||||
var isDevelopment = process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'test';
|
||||
|
||||
if (isDevelopment) {
|
||||
var params = _objectSpread({}, appParameters);
|
||||
|
||||
params.rootTag = "#" + params.rootTag.id;
|
||||
console.log("Running application \"" + appKey + "\" with appParams:\n", params, "\nDevelopment-level warnings: " + (isDevelopment ? 'ON' : 'OFF') + "." + ("\nPerformance optimizations: " + (isDevelopment ? 'OFF' : 'ON') + "."));
|
||||
}
|
||||
|
||||
(0, _invariant.default)(runnables[appKey] && runnables[appKey].run, "Application \"" + appKey + "\" has not been registered. " + 'This is either due to an import error during initialization or failure to call AppRegistry.registerComponent.');
|
||||
runnables[appKey].run(appParameters);
|
||||
};
|
||||
|
||||
AppRegistry.setComponentProviderInstrumentationHook = function setComponentProviderInstrumentationHook(hook) {
|
||||
componentProviderInstrumentationHook = hook;
|
||||
};
|
||||
|
||||
AppRegistry.setWrapperComponentProvider = function setWrapperComponentProvider(provider) {
|
||||
wrapperComponentProvider = provider;
|
||||
};
|
||||
|
||||
AppRegistry.unmountApplicationComponentAtRootTag = function unmountApplicationComponentAtRootTag(rootTag) {
|
||||
(0, _unmountComponentAtNode.default)(rootTag);
|
||||
};
|
||||
|
||||
return AppRegistry;
|
||||
}();
|
||||
|
||||
exports.default = AppRegistry;
|
||||
module.exports = exports.default;
|
59
node_modules/react-native-web/dist/cjs/exports/AppRegistry/renderApplication.js
generated
vendored
Normal file
59
node_modules/react-native-web/dist/cjs/exports/AppRegistry/renderApplication.js
generated
vendored
Normal file
@ -0,0 +1,59 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = renderApplication;
|
||||
exports.getApplication = getApplication;
|
||||
|
||||
var _AppContainer = _interopRequireDefault(require("./AppContainer"));
|
||||
|
||||
var _invariant = _interopRequireDefault(require("fbjs/lib/invariant"));
|
||||
|
||||
var _render = _interopRequireWildcard(require("../render"));
|
||||
|
||||
var _styleResolver = _interopRequireDefault(require("../StyleSheet/styleResolver"));
|
||||
|
||||
var _react = _interopRequireDefault(require("react"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
||||
|
||||
function renderApplication(RootComponent, WrapperComponent, callback, options) {
|
||||
var shouldHydrate = options.hydrate,
|
||||
initialProps = options.initialProps,
|
||||
rootTag = options.rootTag;
|
||||
var renderFn = shouldHydrate ? _render.hydrate : _render.default;
|
||||
(0, _invariant.default)(rootTag, 'Expect to have a valid rootTag, instead got ', rootTag);
|
||||
renderFn(_react.default.createElement(_AppContainer.default, {
|
||||
rootTag: rootTag,
|
||||
WrapperComponent: WrapperComponent
|
||||
}, _react.default.createElement(RootComponent, initialProps)), rootTag, callback);
|
||||
}
|
||||
|
||||
function getApplication(RootComponent, initialProps, WrapperComponent) {
|
||||
var element = _react.default.createElement(_AppContainer.default, {
|
||||
rootTag: {},
|
||||
WrapperComponent: WrapperComponent
|
||||
}, _react.default.createElement(RootComponent, initialProps)); // Don't escape CSS text
|
||||
|
||||
|
||||
var getStyleElement = function getStyleElement(props) {
|
||||
var sheet = _styleResolver.default.getStyleSheet();
|
||||
|
||||
return _react.default.createElement("style", _extends({}, props, {
|
||||
dangerouslySetInnerHTML: {
|
||||
__html: sheet.textContent
|
||||
},
|
||||
id: sheet.id
|
||||
}));
|
||||
};
|
||||
|
||||
return {
|
||||
element: element,
|
||||
getStyleElement: getStyleElement
|
||||
};
|
||||
}
|
89
node_modules/react-native-web/dist/cjs/exports/AppState/index.js
generated
vendored
Normal file
89
node_modules/react-native-web/dist/cjs/exports/AppState/index.js
generated
vendored
Normal file
@ -0,0 +1,89 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _ExecutionEnvironment = require("fbjs/lib/ExecutionEnvironment");
|
||||
|
||||
var _arrayFindIndex = _interopRequireDefault(require("array-find-index"));
|
||||
|
||||
var _invariant = _interopRequireDefault(require("fbjs/lib/invariant"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
// Android 4.4 browser
|
||||
var isPrefixed = _ExecutionEnvironment.canUseDOM && !document.hasOwnProperty('hidden') && document.hasOwnProperty('webkitHidden');
|
||||
var EVENT_TYPES = ['change', 'memoryWarning'];
|
||||
var VISIBILITY_CHANGE_EVENT = isPrefixed ? 'webkitvisibilitychange' : 'visibilitychange';
|
||||
var VISIBILITY_STATE_PROPERTY = isPrefixed ? 'webkitVisibilityState' : 'visibilityState';
|
||||
var AppStates = {
|
||||
BACKGROUND: 'background',
|
||||
ACTIVE: 'active'
|
||||
};
|
||||
var listeners = [];
|
||||
|
||||
var AppState =
|
||||
/*#__PURE__*/
|
||||
function () {
|
||||
function AppState() {}
|
||||
|
||||
AppState.addEventListener = function addEventListener(type, handler) {
|
||||
if (AppState.isAvailable) {
|
||||
(0, _invariant.default)(EVENT_TYPES.indexOf(type) !== -1, 'Trying to subscribe to unknown event: "%s"', type);
|
||||
|
||||
if (type === 'change') {
|
||||
var callback = function callback() {
|
||||
return handler(AppState.currentState);
|
||||
};
|
||||
|
||||
listeners.push([handler, callback]);
|
||||
document.addEventListener(VISIBILITY_CHANGE_EVENT, callback, false);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
AppState.removeEventListener = function removeEventListener(type, handler) {
|
||||
if (AppState.isAvailable) {
|
||||
(0, _invariant.default)(EVENT_TYPES.indexOf(type) !== -1, 'Trying to remove listener for unknown event: "%s"', type);
|
||||
|
||||
if (type === 'change') {
|
||||
var listenerIndex = (0, _arrayFindIndex.default)(listeners, function (pair) {
|
||||
return pair[0] === handler;
|
||||
});
|
||||
(0, _invariant.default)(listenerIndex !== -1, 'Trying to remove AppState listener for unregistered handler');
|
||||
var callback = listeners[listenerIndex][1];
|
||||
document.removeEventListener(VISIBILITY_CHANGE_EVENT, callback, false);
|
||||
listeners.splice(listenerIndex, 1);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
_createClass(AppState, null, [{
|
||||
key: "currentState",
|
||||
get: function get() {
|
||||
if (!AppState.isAvailable) {
|
||||
return AppStates.ACTIVE;
|
||||
}
|
||||
|
||||
switch (document[VISIBILITY_STATE_PROPERTY]) {
|
||||
case 'hidden':
|
||||
case 'prerender':
|
||||
case 'unloaded':
|
||||
return AppStates.BACKGROUND;
|
||||
|
||||
default:
|
||||
return AppStates.ACTIVE;
|
||||
}
|
||||
}
|
||||
}]);
|
||||
|
||||
return AppState;
|
||||
}();
|
||||
|
||||
exports.default = AppState;
|
||||
AppState.isAvailable = _ExecutionEnvironment.canUseDOM && document[VISIBILITY_STATE_PROPERTY];
|
||||
module.exports = exports.default;
|
59
node_modules/react-native-web/dist/cjs/exports/Appearance/index.js
generated
vendored
Normal file
59
node_modules/react-native-web/dist/cjs/exports/Appearance/index.js
generated
vendored
Normal file
@ -0,0 +1,59 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _ExecutionEnvironment = require("fbjs/lib/ExecutionEnvironment");
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
function getQuery() {
|
||||
return _ExecutionEnvironment.canUseDOM && window.matchMedia != null ? window.matchMedia('(prefers-color-scheme: dark)') : null;
|
||||
}
|
||||
|
||||
var query = getQuery();
|
||||
var listenerMapping = new WeakMap();
|
||||
var Appearance = {
|
||||
getColorScheme: function getColorScheme() {
|
||||
return query && query.matches ? 'dark' : 'light';
|
||||
},
|
||||
addChangeListener: function addChangeListener(listener) {
|
||||
var mappedListener = listenerMapping.get(listener);
|
||||
|
||||
if (!mappedListener) {
|
||||
mappedListener = function mappedListener(_ref) {
|
||||
var matches = _ref.matches;
|
||||
listener({
|
||||
colorScheme: matches ? 'dark' : 'light'
|
||||
});
|
||||
};
|
||||
|
||||
listenerMapping.set(listener, mappedListener);
|
||||
}
|
||||
|
||||
if (query) {
|
||||
query.addListener(mappedListener);
|
||||
}
|
||||
},
|
||||
removeChangeListener: function removeChangeListener(listener) {
|
||||
var mappedListener = listenerMapping.get(listener);
|
||||
|
||||
if (mappedListener) {
|
||||
if (query) {
|
||||
query.removeListener(mappedListener);
|
||||
}
|
||||
|
||||
listenerMapping.delete(listener);
|
||||
}
|
||||
}
|
||||
};
|
||||
var _default = Appearance;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
28
node_modules/react-native-web/dist/cjs/exports/BackHandler/index.js
generated
vendored
Normal file
28
node_modules/react-native-web/dist/cjs/exports/BackHandler/index.js
generated
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
function emptyFunction() {}
|
||||
|
||||
var BackHandler = {
|
||||
exitApp: emptyFunction,
|
||||
addEventListener: function addEventListener() {
|
||||
return {
|
||||
remove: emptyFunction
|
||||
};
|
||||
},
|
||||
removeEventListener: emptyFunction
|
||||
};
|
||||
var _default = BackHandler;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
74
node_modules/react-native-web/dist/cjs/exports/Button/index.js
generated
vendored
Normal file
74
node_modules/react-native-web/dist/cjs/exports/Button/index.js
generated
vendored
Normal file
@ -0,0 +1,74 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var React = _interopRequireWildcard(require("react"));
|
||||
|
||||
var _StyleSheet = _interopRequireDefault(require("../StyleSheet"));
|
||||
|
||||
var _TouchableOpacity = _interopRequireDefault(require("../TouchableOpacity"));
|
||||
|
||||
var _Text = _interopRequireDefault(require("../Text"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
var Button = React.forwardRef(function (props, forwardedRef) {
|
||||
var accessibilityLabel = props.accessibilityLabel,
|
||||
color = props.color,
|
||||
disabled = props.disabled,
|
||||
onPress = props.onPress,
|
||||
testID = props.testID,
|
||||
title = props.title;
|
||||
return React.createElement(_TouchableOpacity.default, {
|
||||
accessibilityLabel: accessibilityLabel,
|
||||
accessibilityRole: "button",
|
||||
disabled: disabled,
|
||||
onPress: onPress,
|
||||
ref: forwardedRef,
|
||||
style: [styles.button, color && {
|
||||
backgroundColor: color
|
||||
}, disabled && styles.buttonDisabled],
|
||||
testID: testID
|
||||
}, React.createElement(_Text.default, {
|
||||
style: [styles.text, disabled && styles.textDisabled]
|
||||
}, title));
|
||||
});
|
||||
Button.displayName = 'Button';
|
||||
|
||||
var styles = _StyleSheet.default.create({
|
||||
button: {
|
||||
backgroundColor: '#2196F3',
|
||||
borderRadius: 2
|
||||
},
|
||||
text: {
|
||||
color: '#fff',
|
||||
fontWeight: '500',
|
||||
padding: 8,
|
||||
textAlign: 'center',
|
||||
textTransform: 'uppercase'
|
||||
},
|
||||
buttonDisabled: {
|
||||
backgroundColor: '#dfdfdf'
|
||||
},
|
||||
textDisabled: {
|
||||
color: '#a1a1a1'
|
||||
}
|
||||
});
|
||||
|
||||
var _default = Button;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
115
node_modules/react-native-web/dist/cjs/exports/CheckBox/index.js
generated
vendored
Normal file
115
node_modules/react-native-web/dist/cjs/exports/CheckBox/index.js
generated
vendored
Normal file
@ -0,0 +1,115 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var React = _interopRequireWildcard(require("react"));
|
||||
|
||||
var _createElement = _interopRequireDefault(require("../createElement"));
|
||||
|
||||
var _StyleSheet = _interopRequireDefault(require("../StyleSheet"));
|
||||
|
||||
var _View = _interopRequireDefault(require("../View"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
||||
|
||||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
||||
|
||||
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
||||
|
||||
var CheckBox = (0, React.forwardRef)(function (props, forwardedRef) {
|
||||
var color = props.color,
|
||||
disabled = props.disabled,
|
||||
onChange = props.onChange,
|
||||
onValueChange = props.onValueChange,
|
||||
style = props.style,
|
||||
value = props.value,
|
||||
other = _objectWithoutPropertiesLoose(props, ["color", "disabled", "onChange", "onValueChange", "style", "value"]);
|
||||
|
||||
function handleChange(event) {
|
||||
var value = event.nativeEvent.target.checked;
|
||||
event.nativeEvent.value = value;
|
||||
onChange && onChange(event);
|
||||
onValueChange && onValueChange(value);
|
||||
}
|
||||
|
||||
var fakeControl = React.createElement(_View.default, {
|
||||
style: [styles.fakeControl, value && styles.fakeControlChecked, // custom color
|
||||
value && color && {
|
||||
backgroundColor: color,
|
||||
borderColor: color
|
||||
}, disabled && styles.fakeControlDisabled, value && disabled && styles.fakeControlCheckedAndDisabled]
|
||||
});
|
||||
var nativeControl = (0, _createElement.default)('input', {
|
||||
checked: value,
|
||||
disabled: disabled,
|
||||
onChange: handleChange,
|
||||
ref: forwardedRef,
|
||||
style: [styles.nativeControl, styles.cursorInherit],
|
||||
type: 'checkbox'
|
||||
});
|
||||
return React.createElement(_View.default, _extends({}, other, {
|
||||
style: [styles.root, style, disabled && styles.cursorDefault]
|
||||
}), fakeControl, nativeControl);
|
||||
});
|
||||
CheckBox.displayName = 'CheckBox';
|
||||
|
||||
var styles = _StyleSheet.default.create({
|
||||
root: {
|
||||
cursor: 'pointer',
|
||||
height: 16,
|
||||
userSelect: 'none',
|
||||
width: 16
|
||||
},
|
||||
cursorDefault: {
|
||||
cursor: 'default'
|
||||
},
|
||||
cursorInherit: {
|
||||
cursor: 'inherit'
|
||||
},
|
||||
fakeControl: {
|
||||
alignItems: 'center',
|
||||
backgroundColor: '#fff',
|
||||
borderColor: '#657786',
|
||||
borderRadius: 2,
|
||||
borderStyle: 'solid',
|
||||
borderWidth: 2,
|
||||
height: '100%',
|
||||
justifyContent: 'center',
|
||||
width: '100%'
|
||||
},
|
||||
fakeControlChecked: {
|
||||
backgroundColor: '#009688',
|
||||
backgroundImage: 'url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgdmVyc2lvbj0iMS4xIgogICB2aWV3Qm94PSIwIDAgMSAxIgogICBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWluWU1pbiBtZWV0Ij4KICA8cGF0aAogICAgIGQ9Ik0gMC4wNDAzODA1OSwwLjYyNjc3NjcgMC4xNDY0NDY2MSwwLjUyMDcxMDY4IDAuNDI5Mjg5MzIsMC44MDM1NTMzOSAwLjMyMzIyMzMsMC45MDk2MTk0MSB6IE0gMC4yMTcxNTcyOSwwLjgwMzU1MzM5IDAuODUzNTUzMzksMC4xNjcxNTcyOSAwLjk1OTYxOTQxLDAuMjczMjIzMyAwLjMyMzIyMzMsMC45MDk2MTk0MSB6IgogICAgIGlkPSJyZWN0Mzc4MCIKICAgICBzdHlsZT0iZmlsbDojZmZmZmZmO2ZpbGwtb3BhY2l0eToxO3N0cm9rZTpub25lIiAvPgo8L3N2Zz4K")',
|
||||
backgroundRepeat: 'no-repeat',
|
||||
borderColor: '#009688'
|
||||
},
|
||||
fakeControlDisabled: {
|
||||
borderColor: '#CCD6DD'
|
||||
},
|
||||
fakeControlCheckedAndDisabled: {
|
||||
backgroundColor: '#AAB8C2',
|
||||
borderColor: '#AAB8C2'
|
||||
},
|
||||
nativeControl: _objectSpread({}, _StyleSheet.default.absoluteFillObject, {
|
||||
height: '100%',
|
||||
margin: 0,
|
||||
opacity: 0,
|
||||
padding: 0,
|
||||
width: '100%'
|
||||
})
|
||||
});
|
||||
|
||||
var _default = CheckBox;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
71
node_modules/react-native-web/dist/cjs/exports/Clipboard/index.js
generated
vendored
Normal file
71
node_modules/react-native-web/dist/cjs/exports/Clipboard/index.js
generated
vendored
Normal file
@ -0,0 +1,71 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
var clipboardAvailable;
|
||||
|
||||
var Clipboard =
|
||||
/*#__PURE__*/
|
||||
function () {
|
||||
function Clipboard() {}
|
||||
|
||||
Clipboard.isAvailable = function isAvailable() {
|
||||
if (clipboardAvailable === undefined) {
|
||||
clipboardAvailable = typeof document.queryCommandSupported === 'function' && document.queryCommandSupported('copy');
|
||||
}
|
||||
|
||||
return clipboardAvailable;
|
||||
};
|
||||
|
||||
Clipboard.getString = function getString() {
|
||||
return Promise.resolve('');
|
||||
};
|
||||
|
||||
Clipboard.setString = function setString(text) {
|
||||
var success = false;
|
||||
var body = document.body;
|
||||
|
||||
if (body) {
|
||||
// add the text to a hidden node
|
||||
var node = document.createElement('span');
|
||||
node.textContent = text;
|
||||
node.style.opacity = '0';
|
||||
node.style.position = 'absolute';
|
||||
node.style.whiteSpace = 'pre-wrap';
|
||||
node.style.userSelect = 'auto';
|
||||
body.appendChild(node); // select the text
|
||||
|
||||
var selection = window.getSelection();
|
||||
selection.removeAllRanges();
|
||||
var range = document.createRange();
|
||||
range.selectNodeContents(node);
|
||||
selection.addRange(range); // attempt to copy
|
||||
|
||||
try {
|
||||
document.execCommand('copy');
|
||||
success = true;
|
||||
} catch (e) {} // remove selection and node
|
||||
|
||||
|
||||
selection.removeAllRanges();
|
||||
body.removeChild(node);
|
||||
}
|
||||
|
||||
return success;
|
||||
};
|
||||
|
||||
return Clipboard;
|
||||
}();
|
||||
|
||||
exports.default = Clipboard;
|
||||
module.exports = exports.default;
|
12
node_modules/react-native-web/dist/cjs/exports/DeviceEventEmitter/index.js
generated
vendored
Normal file
12
node_modules/react-native-web/dist/cjs/exports/DeviceEventEmitter/index.js
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _RCTDeviceEventEmitter = _interopRequireDefault(require("../../vendor/react-native/NativeEventEmitter/RCTDeviceEventEmitter"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var _default = _RCTDeviceEventEmitter.default;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
75
node_modules/react-native-web/dist/cjs/exports/DeviceInfo/index.js
generated
vendored
Normal file
75
node_modules/react-native-web/dist/cjs/exports/DeviceInfo/index.js
generated
vendored
Normal file
@ -0,0 +1,75 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _ExecutionEnvironment = require("fbjs/lib/ExecutionEnvironment");
|
||||
|
||||
var _Dimensions = _interopRequireDefault(require("../Dimensions"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
var DeviceInfo = {
|
||||
Dimensions: {
|
||||
get windowPhysicalPixels() {
|
||||
var _Dimensions$get = _Dimensions.default.get('window'),
|
||||
width = _Dimensions$get.width,
|
||||
height = _Dimensions$get.height,
|
||||
fontScale = _Dimensions$get.fontScale,
|
||||
scale = _Dimensions$get.scale;
|
||||
|
||||
return {
|
||||
width: width * scale,
|
||||
height: height * scale,
|
||||
scale: scale,
|
||||
fontScale: fontScale
|
||||
};
|
||||
},
|
||||
|
||||
get screenPhysicalPixels() {
|
||||
var _Dimensions$get2 = _Dimensions.default.get('screen'),
|
||||
width = _Dimensions$get2.width,
|
||||
height = _Dimensions$get2.height,
|
||||
fontScale = _Dimensions$get2.fontScale,
|
||||
scale = _Dimensions$get2.scale;
|
||||
|
||||
return {
|
||||
width: width * scale,
|
||||
height: height * scale,
|
||||
scale: scale,
|
||||
fontScale: fontScale
|
||||
};
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
get locale() {
|
||||
if (_ExecutionEnvironment.canUseDOM) {
|
||||
if (window.navigator.languages) {
|
||||
return window.navigator.languages[0];
|
||||
} else {
|
||||
return window.navigator.language;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
get totalMemory() {
|
||||
return _ExecutionEnvironment.canUseDOM ? window.navigator.deviceMemory : undefined;
|
||||
},
|
||||
|
||||
get userAgent() {
|
||||
return _ExecutionEnvironment.canUseDOM ? window.navigator.userAgent : '';
|
||||
}
|
||||
|
||||
};
|
||||
var _default = DeviceInfo;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
99
node_modules/react-native-web/dist/cjs/exports/Dimensions/index.js
generated
vendored
Normal file
99
node_modules/react-native-web/dist/cjs/exports/Dimensions/index.js
generated
vendored
Normal file
@ -0,0 +1,99 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _ExecutionEnvironment = require("fbjs/lib/ExecutionEnvironment");
|
||||
|
||||
var _invariant = _interopRequireDefault(require("fbjs/lib/invariant"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
var win = _ExecutionEnvironment.canUseDOM ? window : {
|
||||
devicePixelRatio: undefined,
|
||||
innerHeight: undefined,
|
||||
innerWidth: undefined,
|
||||
screen: {
|
||||
height: undefined,
|
||||
width: undefined
|
||||
}
|
||||
};
|
||||
var dimensions = {};
|
||||
var listeners = {};
|
||||
|
||||
var Dimensions =
|
||||
/*#__PURE__*/
|
||||
function () {
|
||||
function Dimensions() {}
|
||||
|
||||
Dimensions.get = function get(dimension) {
|
||||
(0, _invariant.default)(dimensions[dimension], "No dimension set for key " + dimension);
|
||||
return dimensions[dimension];
|
||||
};
|
||||
|
||||
Dimensions.set = function set(initialDimensions) {
|
||||
if (initialDimensions) {
|
||||
if (_ExecutionEnvironment.canUseDOM) {
|
||||
(0, _invariant.default)(false, 'Dimensions cannot be set in the browser');
|
||||
} else {
|
||||
dimensions.screen = initialDimensions.screen;
|
||||
dimensions.window = initialDimensions.window;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Dimensions._update = function _update() {
|
||||
dimensions.window = {
|
||||
fontScale: 1,
|
||||
height: win.innerHeight,
|
||||
scale: win.devicePixelRatio || 1,
|
||||
width: win.innerWidth
|
||||
};
|
||||
dimensions.screen = {
|
||||
fontScale: 1,
|
||||
height: win.screen.height,
|
||||
scale: win.devicePixelRatio || 1,
|
||||
width: win.screen.width
|
||||
};
|
||||
|
||||
if (Array.isArray(listeners['change'])) {
|
||||
listeners['change'].forEach(function (handler) {
|
||||
return handler(dimensions);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Dimensions.addEventListener = function addEventListener(type, handler) {
|
||||
listeners[type] = listeners[type] || [];
|
||||
listeners[type].push(handler);
|
||||
};
|
||||
|
||||
Dimensions.removeEventListener = function removeEventListener(type, handler) {
|
||||
if (Array.isArray(listeners[type])) {
|
||||
listeners[type] = listeners[type].filter(function (_handler) {
|
||||
return _handler !== handler;
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
return Dimensions;
|
||||
}();
|
||||
|
||||
exports.default = Dimensions;
|
||||
|
||||
Dimensions._update();
|
||||
|
||||
if (_ExecutionEnvironment.canUseDOM) {
|
||||
window.addEventListener('resize', Dimensions._update, false);
|
||||
}
|
||||
|
||||
module.exports = exports.default;
|
12
node_modules/react-native-web/dist/cjs/exports/DrawerLayoutAndroid/index.js
generated
vendored
Normal file
12
node_modules/react-native-web/dist/cjs/exports/DrawerLayoutAndroid/index.js
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _UnimplementedView = _interopRequireDefault(require("../../modules/UnimplementedView"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var _default = _UnimplementedView.default;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
20
node_modules/react-native-web/dist/cjs/exports/Easing/index.js
generated
vendored
Normal file
20
node_modules/react-native-web/dist/cjs/exports/Easing/index.js
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _Easing = _interopRequireDefault(require("../../vendor/react-native/Animated/Easing"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
var _default = _Easing.default;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
21
node_modules/react-native-web/dist/cjs/exports/FlatList/index.js
generated
vendored
Normal file
21
node_modules/react-native-web/dist/cjs/exports/FlatList/index.js
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _FlatList = _interopRequireDefault(require("../../vendor/react-native/FlatList"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
var _default = _FlatList.default;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
68
node_modules/react-native-web/dist/cjs/exports/I18nManager/index.js
generated
vendored
Normal file
68
node_modules/react-native-web/dist/cjs/exports/I18nManager/index.js
generated
vendored
Normal file
@ -0,0 +1,68 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _ExecutionEnvironment = _interopRequireDefault(require("fbjs/lib/ExecutionEnvironment"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
var doLeftAndRightSwapInRTL = true;
|
||||
var isPreferredLanguageRTL = false;
|
||||
var isRTLAllowed = true;
|
||||
var isRTLForced = false;
|
||||
|
||||
var isRTL = function isRTL() {
|
||||
if (isRTLForced) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return isRTLAllowed && isPreferredLanguageRTL;
|
||||
};
|
||||
|
||||
var onDirectionChange = function onDirectionChange() {
|
||||
if (_ExecutionEnvironment.default.canUseDOM) {
|
||||
if (document.documentElement && document.documentElement.setAttribute) {
|
||||
document.documentElement.setAttribute('dir', isRTL() ? 'rtl' : 'ltr');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var I18nManager = {
|
||||
allowRTL: function allowRTL(bool) {
|
||||
isRTLAllowed = bool;
|
||||
onDirectionChange();
|
||||
},
|
||||
forceRTL: function forceRTL(bool) {
|
||||
isRTLForced = bool;
|
||||
onDirectionChange();
|
||||
},
|
||||
setPreferredLanguageRTL: function setPreferredLanguageRTL(bool) {
|
||||
isPreferredLanguageRTL = bool;
|
||||
onDirectionChange();
|
||||
},
|
||||
swapLeftAndRightInRTL: function swapLeftAndRightInRTL(bool) {
|
||||
doLeftAndRightSwapInRTL = bool;
|
||||
},
|
||||
|
||||
get doLeftAndRightSwapInRTL() {
|
||||
return doLeftAndRightSwapInRTL;
|
||||
},
|
||||
|
||||
get isRTL() {
|
||||
return isRTL();
|
||||
}
|
||||
|
||||
};
|
||||
var _default = I18nManager;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
407
node_modules/react-native-web/dist/cjs/exports/Image/index.js
generated
vendored
Normal file
407
node_modules/react-native-web/dist/cjs/exports/Image/index.js
generated
vendored
Normal file
@ -0,0 +1,407 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _createElement = _interopRequireDefault(require("../createElement"));
|
||||
|
||||
var _css = _interopRequireDefault(require("../StyleSheet/css"));
|
||||
|
||||
var _AssetRegistry = require("../../modules/AssetRegistry");
|
||||
|
||||
var _resolveShadowValue = _interopRequireDefault(require("../StyleSheet/resolveShadowValue"));
|
||||
|
||||
var _ImageLoader = _interopRequireDefault(require("../../modules/ImageLoader"));
|
||||
|
||||
var _PixelRatio = _interopRequireDefault(require("../PixelRatio"));
|
||||
|
||||
var _StyleSheet = _interopRequireDefault(require("../StyleSheet"));
|
||||
|
||||
var _TextAncestorContext = _interopRequireDefault(require("../Text/TextAncestorContext"));
|
||||
|
||||
var _View = _interopRequireDefault(require("../View"));
|
||||
|
||||
var _react = _interopRequireWildcard(require("react"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
||||
|
||||
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
||||
|
||||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
||||
|
||||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
var ERRORED = 'ERRORED';
|
||||
var LOADED = 'LOADED';
|
||||
var LOADING = 'LOADING';
|
||||
var IDLE = 'IDLE';
|
||||
var _filterId = 0;
|
||||
var svgDataUriPattern = /^(data:image\/svg\+xml;utf8,)(.*)/;
|
||||
|
||||
function createTintColorSVG(tintColor, id) {
|
||||
return tintColor && id != null ? _react.default.createElement("svg", {
|
||||
style: {
|
||||
position: 'absolute',
|
||||
height: 0,
|
||||
visibility: 'hidden',
|
||||
width: 0
|
||||
}
|
||||
}, _react.default.createElement("defs", null, _react.default.createElement("filter", {
|
||||
id: "tint-" + id,
|
||||
suppressHydrationWarning: true
|
||||
}, _react.default.createElement("feFlood", {
|
||||
floodColor: "" + tintColor,
|
||||
key: tintColor
|
||||
}), _react.default.createElement("feComposite", {
|
||||
in2: "SourceAlpha",
|
||||
operator: "atop"
|
||||
})))) : null;
|
||||
}
|
||||
|
||||
function getFlatStyle(style, blurRadius, filterId) {
|
||||
var flatStyle = _objectSpread({}, _StyleSheet.default.flatten(style));
|
||||
|
||||
var filter = flatStyle.filter,
|
||||
resizeMode = flatStyle.resizeMode,
|
||||
shadowOffset = flatStyle.shadowOffset,
|
||||
tintColor = flatStyle.tintColor; // Add CSS filters
|
||||
// React Native exposes these features as props and proprietary styles
|
||||
|
||||
var filters = [];
|
||||
var _filter = null;
|
||||
|
||||
if (filter) {
|
||||
filters.push(filter);
|
||||
} //
|
||||
|
||||
|
||||
if (blurRadius) {
|
||||
filters.push("blur(" + blurRadius + "px)");
|
||||
}
|
||||
|
||||
if (shadowOffset) {
|
||||
var shadowString = (0, _resolveShadowValue.default)(flatStyle);
|
||||
|
||||
if (shadowString) {
|
||||
filters.push("drop-shadow(" + shadowString + ")");
|
||||
}
|
||||
}
|
||||
|
||||
if (tintColor && filterId != null) {
|
||||
filters.push("url(#tint-" + filterId + ")");
|
||||
}
|
||||
|
||||
if (filters.length > 0) {
|
||||
_filter = filters.join(' ');
|
||||
} // These styles are converted to CSS filters applied to the
|
||||
// element displaying the background image.
|
||||
|
||||
|
||||
delete flatStyle.shadowColor;
|
||||
delete flatStyle.shadowOpacity;
|
||||
delete flatStyle.shadowOffset;
|
||||
delete flatStyle.shadowRadius;
|
||||
delete flatStyle.tintColor; // These styles are not supported on View
|
||||
|
||||
delete flatStyle.overlayColor;
|
||||
delete flatStyle.resizeMode;
|
||||
return [flatStyle, resizeMode, _filter, tintColor];
|
||||
}
|
||||
|
||||
function resolveAssetDimensions(source) {
|
||||
if (typeof source === 'number') {
|
||||
var _getAssetByID = (0, _AssetRegistry.getAssetByID)(source),
|
||||
height = _getAssetByID.height,
|
||||
width = _getAssetByID.width;
|
||||
|
||||
return {
|
||||
height: height,
|
||||
width: width
|
||||
};
|
||||
} else if (source != null && !Array.isArray(source) && typeof source === 'object') {
|
||||
var _height = source.height,
|
||||
_width = source.width;
|
||||
return {
|
||||
height: _height,
|
||||
width: _width
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
function resolveAssetUri(source) {
|
||||
var uri = null;
|
||||
|
||||
if (typeof source === 'number') {
|
||||
// get the URI from the packager
|
||||
var asset = (0, _AssetRegistry.getAssetByID)(source);
|
||||
var scale = asset.scales[0];
|
||||
|
||||
if (asset.scales.length > 1) {
|
||||
var preferredScale = _PixelRatio.default.get(); // Get the scale which is closest to the preferred scale
|
||||
|
||||
|
||||
scale = asset.scales.reduce(function (prev, curr) {
|
||||
return Math.abs(curr - preferredScale) < Math.abs(prev - preferredScale) ? curr : prev;
|
||||
});
|
||||
}
|
||||
|
||||
var scaleSuffix = scale !== 1 ? "@" + scale + "x" : '';
|
||||
uri = asset ? asset.httpServerLocation + "/" + asset.name + scaleSuffix + "." + asset.type : '';
|
||||
} else if (typeof source === 'string') {
|
||||
uri = source;
|
||||
} else if (source && typeof source.uri === 'string') {
|
||||
uri = source.uri;
|
||||
}
|
||||
|
||||
if (uri) {
|
||||
var match = uri.match(svgDataUriPattern); // inline SVG markup may contain characters (e.g., #, ") that need to be escaped
|
||||
|
||||
if (match) {
|
||||
var prefix = match[1],
|
||||
svg = match[2];
|
||||
var encodedSvg = encodeURIComponent(svg);
|
||||
return "" + prefix + encodedSvg;
|
||||
}
|
||||
}
|
||||
|
||||
return uri;
|
||||
}
|
||||
|
||||
var Image = (0, _react.forwardRef)(function (props, ref) {
|
||||
var accessibilityLabel = props.accessibilityLabel,
|
||||
blurRadius = props.blurRadius,
|
||||
defaultSource = props.defaultSource,
|
||||
draggable = props.draggable,
|
||||
onError = props.onError,
|
||||
onLayout = props.onLayout,
|
||||
onLoad = props.onLoad,
|
||||
onLoadEnd = props.onLoadEnd,
|
||||
onLoadStart = props.onLoadStart,
|
||||
pointerEvents = props.pointerEvents,
|
||||
source = props.source,
|
||||
style = props.style,
|
||||
rest = _objectWithoutPropertiesLoose(props, ["accessibilityLabel", "blurRadius", "defaultSource", "draggable", "onError", "onLayout", "onLoad", "onLoadEnd", "onLoadStart", "pointerEvents", "source", "style"]);
|
||||
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
if (props.children) {
|
||||
throw new Error('The <Image> component cannot contain children. If you want to render content on top of the image, consider using the <ImageBackground> component or absolute positioning.');
|
||||
}
|
||||
}
|
||||
|
||||
var _useState = (0, _react.useState)(function () {
|
||||
var uri = resolveAssetUri(source);
|
||||
|
||||
if (uri != null) {
|
||||
var isLoaded = _ImageLoader.default.has(uri);
|
||||
|
||||
if (isLoaded) {
|
||||
return LOADED;
|
||||
}
|
||||
}
|
||||
|
||||
return IDLE;
|
||||
}),
|
||||
state = _useState[0],
|
||||
updateState = _useState[1];
|
||||
|
||||
var _useState2 = (0, _react.useState)({}),
|
||||
layout = _useState2[0],
|
||||
updateLayout = _useState2[1];
|
||||
|
||||
var hasTextAncestor = (0, _react.useContext)(_TextAncestorContext.default);
|
||||
var hiddenImageRef = (0, _react.useRef)(null);
|
||||
var filterRef = (0, _react.useRef)(_filterId++);
|
||||
var requestRef = (0, _react.useRef)(null);
|
||||
var shouldDisplaySource = state === LOADED || state === LOADING && defaultSource == null;
|
||||
|
||||
var _getFlatStyle = getFlatStyle(style, blurRadius, filterRef.current),
|
||||
flatStyle = _getFlatStyle[0],
|
||||
_resizeMode = _getFlatStyle[1],
|
||||
filter = _getFlatStyle[2],
|
||||
tintColor = _getFlatStyle[3];
|
||||
|
||||
var resizeMode = props.resizeMode || _resizeMode || 'cover';
|
||||
var selectedSource = shouldDisplaySource ? source : defaultSource;
|
||||
var displayImageUri = resolveAssetUri(selectedSource);
|
||||
var imageSizeStyle = resolveAssetDimensions(selectedSource);
|
||||
var backgroundImage = displayImageUri ? "url(\"" + displayImageUri + "\")" : null;
|
||||
var backgroundSize = getBackgroundSize(); // Accessibility image allows users to trigger the browser's image context menu
|
||||
|
||||
var hiddenImage = displayImageUri ? (0, _createElement.default)('img', {
|
||||
alt: accessibilityLabel || '',
|
||||
classList: [classes.accessibilityImage],
|
||||
draggable: draggable || false,
|
||||
ref: hiddenImageRef,
|
||||
src: displayImageUri
|
||||
}) : null;
|
||||
|
||||
function getBackgroundSize() {
|
||||
if (hiddenImageRef.current != null && (resizeMode === 'center' || resizeMode === 'repeat')) {
|
||||
var _hiddenImageRef$curre = hiddenImageRef.current,
|
||||
naturalHeight = _hiddenImageRef$curre.naturalHeight,
|
||||
naturalWidth = _hiddenImageRef$curre.naturalWidth;
|
||||
var height = layout.height,
|
||||
width = layout.width;
|
||||
|
||||
if (naturalHeight && naturalWidth && height && width) {
|
||||
var scaleFactor = Math.min(1, width / naturalWidth, height / naturalHeight);
|
||||
var x = Math.ceil(scaleFactor * naturalWidth);
|
||||
var y = Math.ceil(scaleFactor * naturalHeight);
|
||||
return x + "px " + y + "px";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function handleLayout(e) {
|
||||
if (resizeMode === 'center' || resizeMode === 'repeat' || onLayout) {
|
||||
var _layout = e.nativeEvent.layout;
|
||||
onLayout && onLayout(e);
|
||||
updateLayout(_layout);
|
||||
}
|
||||
} // Image loading
|
||||
|
||||
|
||||
(0, _react.useEffect)(function () {
|
||||
abortPendingRequest();
|
||||
var uri = resolveAssetUri(source);
|
||||
|
||||
if (uri != null) {
|
||||
updateState(LOADING);
|
||||
|
||||
if (onLoadStart) {
|
||||
onLoadStart();
|
||||
}
|
||||
|
||||
requestRef.current = _ImageLoader.default.load(uri, function load(e) {
|
||||
updateState(LOADED);
|
||||
|
||||
if (onLoad) {
|
||||
onLoad(e);
|
||||
}
|
||||
|
||||
if (onLoadEnd) {
|
||||
onLoadEnd();
|
||||
}
|
||||
}, function error() {
|
||||
updateState(ERRORED);
|
||||
|
||||
if (onError) {
|
||||
onError({
|
||||
nativeEvent: {
|
||||
error: "Failed to load resource " + uri + " (404)"
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (onLoadEnd) {
|
||||
onLoadEnd();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function abortPendingRequest() {
|
||||
if (requestRef.current != null) {
|
||||
_ImageLoader.default.abort(requestRef.current);
|
||||
|
||||
requestRef.current = null;
|
||||
}
|
||||
}
|
||||
|
||||
return abortPendingRequest;
|
||||
}, [source, requestRef, updateState, onError, onLoad, onLoadEnd, onLoadStart]);
|
||||
return _react.default.createElement(_View.default, _extends({}, rest, {
|
||||
accessibilityLabel: accessibilityLabel,
|
||||
onLayout: handleLayout,
|
||||
pointerEvents: pointerEvents,
|
||||
ref: ref,
|
||||
style: [styles.root, hasTextAncestor && styles.inline, imageSizeStyle, flatStyle]
|
||||
}), _react.default.createElement(_View.default, {
|
||||
style: [styles.image, resizeModeStyles[resizeMode], {
|
||||
backgroundImage: backgroundImage,
|
||||
filter: filter
|
||||
}, backgroundSize != null && {
|
||||
backgroundSize: backgroundSize
|
||||
}],
|
||||
suppressHydrationWarning: true
|
||||
}), hiddenImage, createTintColorSVG(tintColor, filterRef.current));
|
||||
});
|
||||
Image.displayName = 'Image'; // $FlowFixMe
|
||||
|
||||
Image.getSize = function (uri, success, failure) {
|
||||
_ImageLoader.default.getSize(uri, success, failure);
|
||||
}; // $FlowFixMe
|
||||
|
||||
|
||||
Image.prefetch = function (uri) {
|
||||
return _ImageLoader.default.prefetch(uri);
|
||||
}; // $FlowFixMe
|
||||
|
||||
|
||||
Image.queryCache = function (uris) {
|
||||
return _ImageLoader.default.queryCache(uris);
|
||||
};
|
||||
|
||||
var classes = _css.default.create({
|
||||
accessibilityImage: _objectSpread({}, _StyleSheet.default.absoluteFillObject, {
|
||||
height: '100%',
|
||||
opacity: 0,
|
||||
width: '100%',
|
||||
zIndex: -1
|
||||
})
|
||||
});
|
||||
|
||||
var styles = _StyleSheet.default.create({
|
||||
root: {
|
||||
flexBasis: 'auto',
|
||||
overflow: 'hidden',
|
||||
zIndex: 0
|
||||
},
|
||||
inline: {
|
||||
display: 'inline-flex'
|
||||
},
|
||||
image: _objectSpread({}, _StyleSheet.default.absoluteFillObject, {
|
||||
backgroundColor: 'transparent',
|
||||
backgroundPosition: 'center',
|
||||
backgroundRepeat: 'no-repeat',
|
||||
backgroundSize: 'cover',
|
||||
height: '100%',
|
||||
width: '100%',
|
||||
zIndex: -1
|
||||
})
|
||||
});
|
||||
|
||||
var resizeModeStyles = _StyleSheet.default.create({
|
||||
center: {
|
||||
backgroundSize: 'auto'
|
||||
},
|
||||
contain: {
|
||||
backgroundSize: 'contain'
|
||||
},
|
||||
cover: {
|
||||
backgroundSize: 'cover'
|
||||
},
|
||||
none: {
|
||||
backgroundPosition: '0 0',
|
||||
backgroundSize: 'auto'
|
||||
},
|
||||
repeat: {
|
||||
backgroundPosition: '0 0',
|
||||
backgroundRepeat: 'repeat',
|
||||
backgroundSize: 'auto'
|
||||
},
|
||||
stretch: {
|
||||
backgroundSize: '100% 100%'
|
||||
}
|
||||
});
|
||||
|
||||
var _default = Image;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
1
node_modules/react-native-web/dist/cjs/exports/Image/types.js
generated
vendored
Normal file
1
node_modules/react-native-web/dist/cjs/exports/Image/types.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
"use strict";
|
63
node_modules/react-native-web/dist/cjs/exports/ImageBackground/index.js
generated
vendored
Normal file
63
node_modules/react-native-web/dist/cjs/exports/ImageBackground/index.js
generated
vendored
Normal file
@ -0,0 +1,63 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var React = _interopRequireWildcard(require("react"));
|
||||
|
||||
var _Image = _interopRequireDefault(require("../Image"));
|
||||
|
||||
var _StyleSheet = _interopRequireDefault(require("../StyleSheet"));
|
||||
|
||||
var _View = _interopRequireDefault(require("../View"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
||||
|
||||
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
||||
|
||||
var emptyObject = {};
|
||||
/**
|
||||
* Very simple drop-in replacement for <Image> which supports nesting views.
|
||||
*/
|
||||
|
||||
var ImageBackground = (0, React.forwardRef)(function (props, forwardedRef) {
|
||||
var children = props.children,
|
||||
_props$style = props.style,
|
||||
style = _props$style === void 0 ? emptyObject : _props$style,
|
||||
imageStyle = props.imageStyle,
|
||||
imageRef = props.imageRef,
|
||||
rest = _objectWithoutPropertiesLoose(props, ["children", "style", "imageStyle", "imageRef"]);
|
||||
|
||||
var _StyleSheet$flatten = _StyleSheet.default.flatten(style),
|
||||
height = _StyleSheet$flatten.height,
|
||||
width = _StyleSheet$flatten.width;
|
||||
|
||||
return React.createElement(_View.default, {
|
||||
ref: forwardedRef,
|
||||
style: style
|
||||
}, React.createElement(_Image.default, _extends({}, rest, {
|
||||
ref: imageRef,
|
||||
style: [_StyleSheet.default.absoluteFill, {
|
||||
// Temporary Workaround:
|
||||
// Current (imperfect yet) implementation of <Image> overwrites width and height styles
|
||||
// (which is not quite correct), and these styles conflict with explicitly set styles
|
||||
// of <ImageBackground> and with our internal layout model here.
|
||||
// So, we have to proxy/reapply these styles explicitly for actual <Image> component.
|
||||
// This workaround should be removed after implementing proper support of
|
||||
// intrinsic content size of the <Image>.
|
||||
width: width,
|
||||
height: height,
|
||||
zIndex: -1
|
||||
}, imageStyle]
|
||||
})), children);
|
||||
});
|
||||
ImageBackground.displayName = 'ImageBackground';
|
||||
var _default = ImageBackground;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
12
node_modules/react-native-web/dist/cjs/exports/InputAccessoryView/index.js
generated
vendored
Normal file
12
node_modules/react-native-web/dist/cjs/exports/InputAccessoryView/index.js
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _UnimplementedView = _interopRequireDefault(require("../../modules/UnimplementedView"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var _default = _UnimplementedView.default;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
71
node_modules/react-native-web/dist/cjs/exports/InteractionManager/index.js
generated
vendored
Normal file
71
node_modules/react-native-web/dist/cjs/exports/InteractionManager/index.js
generated
vendored
Normal file
@ -0,0 +1,71 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _invariant = _interopRequireDefault(require("fbjs/lib/invariant"));
|
||||
|
||||
var _requestIdleCallback = _interopRequireWildcard(require("../../modules/requestIdleCallback"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
var InteractionManager = {
|
||||
Events: {
|
||||
interactionStart: 'interactionStart',
|
||||
interactionComplete: 'interactionComplete'
|
||||
},
|
||||
|
||||
/**
|
||||
* Schedule a function to run after all interactions have completed.
|
||||
*/
|
||||
runAfterInteractions: function runAfterInteractions(task) {
|
||||
var handle;
|
||||
var promise = new Promise(function (resolve) {
|
||||
handle = (0, _requestIdleCallback.default)(function () {
|
||||
if (task) {
|
||||
resolve(task());
|
||||
} else {
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
});
|
||||
return {
|
||||
then: promise.then.bind(promise),
|
||||
done: promise.then.bind(promise),
|
||||
cancel: function cancel() {
|
||||
(0, _requestIdleCallback.cancelIdleCallback)(handle);
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
/**
|
||||
* Notify manager that an interaction has started.
|
||||
*/
|
||||
createInteractionHandle: function createInteractionHandle() {
|
||||
return 1;
|
||||
},
|
||||
|
||||
/**
|
||||
* Notify manager that an interaction has completed.
|
||||
*/
|
||||
clearInteractionHandle: function clearInteractionHandle(handle) {
|
||||
(0, _invariant.default)(!!handle, 'Must provide a handle to clear.');
|
||||
},
|
||||
addListener: function addListener() {}
|
||||
};
|
||||
var _default = InteractionManager;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
33
node_modules/react-native-web/dist/cjs/exports/Keyboard/index.js
generated
vendored
Normal file
33
node_modules/react-native-web/dist/cjs/exports/Keyboard/index.js
generated
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _dismissKeyboard = _interopRequireDefault(require("../../modules/dismissKeyboard"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
var Keyboard = {
|
||||
addListener: function addListener() {
|
||||
return {
|
||||
remove: function remove() {}
|
||||
};
|
||||
},
|
||||
dismiss: function dismiss() {
|
||||
(0, _dismissKeyboard.default)();
|
||||
},
|
||||
removeAllListeners: function removeAllListeners() {},
|
||||
removeListener: function removeListener() {}
|
||||
};
|
||||
var _default = Keyboard;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
72
node_modules/react-native-web/dist/cjs/exports/KeyboardAvoidingView/index.js
generated
vendored
Normal file
72
node_modules/react-native-web/dist/cjs/exports/KeyboardAvoidingView/index.js
generated
vendored
Normal file
@ -0,0 +1,72 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _View = _interopRequireDefault(require("../View"));
|
||||
|
||||
var _react = _interopRequireDefault(require("react"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
||||
|
||||
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
||||
|
||||
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
||||
|
||||
var KeyboardAvoidingView =
|
||||
/*#__PURE__*/
|
||||
function (_React$Component) {
|
||||
_inheritsLoose(KeyboardAvoidingView, _React$Component);
|
||||
|
||||
function KeyboardAvoidingView() {
|
||||
var _this;
|
||||
|
||||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
|
||||
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
|
||||
_this.frame = null;
|
||||
|
||||
_this.onLayout = function (event) {
|
||||
_this.frame = event.nativeEvent.layout;
|
||||
};
|
||||
|
||||
return _this;
|
||||
}
|
||||
|
||||
var _proto = KeyboardAvoidingView.prototype;
|
||||
|
||||
_proto.relativeKeyboardHeight = function relativeKeyboardHeight(keyboardFrame) {
|
||||
var frame = this.frame;
|
||||
|
||||
if (!frame || !keyboardFrame) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
var keyboardY = keyboardFrame.screenY - (this.props.keyboardVerticalOffset || 0);
|
||||
return Math.max(frame.y + frame.height - keyboardY, 0);
|
||||
};
|
||||
|
||||
_proto.onKeyboardChange = function onKeyboardChange(event) {};
|
||||
|
||||
_proto.render = function render() {
|
||||
var _this$props = this.props,
|
||||
behavior = _this$props.behavior,
|
||||
contentContainerStyle = _this$props.contentContainerStyle,
|
||||
keyboardVerticalOffset = _this$props.keyboardVerticalOffset,
|
||||
rest = _objectWithoutPropertiesLoose(_this$props, ["behavior", "contentContainerStyle", "keyboardVerticalOffset"]);
|
||||
|
||||
return _react.default.createElement(_View.default, _extends({
|
||||
onLayout: this.onLayout
|
||||
}, rest));
|
||||
};
|
||||
|
||||
return KeyboardAvoidingView;
|
||||
}(_react.default.Component);
|
||||
|
||||
var _default = KeyboardAvoidingView;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
21
node_modules/react-native-web/dist/cjs/exports/LayoutAnimation/index.js
generated
vendored
Normal file
21
node_modules/react-native-web/dist/cjs/exports/LayoutAnimation/index.js
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _LayoutAnimation = _interopRequireDefault(require("../../vendor/react-native/LayoutAnimation"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
var _default = _LayoutAnimation.default;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
53
node_modules/react-native-web/dist/cjs/exports/Linking/index.js
generated
vendored
Normal file
53
node_modules/react-native-web/dist/cjs/exports/Linking/index.js
generated
vendored
Normal file
@ -0,0 +1,53 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _ExecutionEnvironment = require("fbjs/lib/ExecutionEnvironment");
|
||||
|
||||
var _invariant = _interopRequireDefault(require("fbjs/lib/invariant"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
var initialURL = _ExecutionEnvironment.canUseDOM ? window.location.href : '';
|
||||
var Linking = {
|
||||
addEventListener: function addEventListener() {},
|
||||
removeEventListener: function removeEventListener() {},
|
||||
canOpenURL: function canOpenURL() {
|
||||
return Promise.resolve(true);
|
||||
},
|
||||
getInitialURL: function getInitialURL() {
|
||||
return Promise.resolve(initialURL);
|
||||
},
|
||||
openURL: function openURL(url) {
|
||||
try {
|
||||
open(url);
|
||||
return Promise.resolve();
|
||||
} catch (e) {
|
||||
return Promise.reject(e);
|
||||
}
|
||||
},
|
||||
_validateURL: function _validateURL(url) {
|
||||
(0, _invariant.default)(typeof url === 'string', 'Invalid URL: should be a string. Was: ' + url);
|
||||
(0, _invariant.default)(url, 'Invalid URL: cannot be empty');
|
||||
}
|
||||
};
|
||||
|
||||
var open = function open(url) {
|
||||
if (_ExecutionEnvironment.canUseDOM) {
|
||||
window.location = new URL(url, window.location).toString();
|
||||
}
|
||||
};
|
||||
|
||||
var _default = Linking;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
12
node_modules/react-native-web/dist/cjs/exports/Modal/index.js
generated
vendored
Normal file
12
node_modules/react-native-web/dist/cjs/exports/Modal/index.js
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _UnimplementedView = _interopRequireDefault(require("../../modules/UnimplementedView"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var _default = _UnimplementedView.default;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
20
node_modules/react-native-web/dist/cjs/exports/NativeEventEmitter/index.js
generated
vendored
Normal file
20
node_modules/react-native-web/dist/cjs/exports/NativeEventEmitter/index.js
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _NativeEventEmitter = _interopRequireDefault(require("../../vendor/react-native/NativeEventEmitter"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
var _default = _NativeEventEmitter.default;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
24
node_modules/react-native-web/dist/cjs/exports/NativeModules/index.js
generated
vendored
Normal file
24
node_modules/react-native-web/dist/cjs/exports/NativeModules/index.js
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _UIManager = _interopRequireDefault(require("../UIManager"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
// NativeModules shim
|
||||
var NativeModules = {
|
||||
UIManager: _UIManager.default
|
||||
};
|
||||
var _default = NativeModules;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
292
node_modules/react-native-web/dist/cjs/exports/PanResponder/Alternative.js
generated
vendored
Normal file
292
node_modules/react-native-web/dist/cjs/exports/PanResponder/Alternative.js
generated
vendored
Normal file
@ -0,0 +1,292 @@
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
/**
|
||||
* PAN RESPONDER
|
||||
*
|
||||
* `PanResponder` uses the Responder System to reconcile several touches into
|
||||
* a single gesture. It makes single-touch gestures resilient to extra touches,
|
||||
* and can be used to recognize simple multi-touch gestures. For each handler,
|
||||
* it provides a `gestureState` object alongside the ResponderEvent object.
|
||||
*
|
||||
* By default, `PanResponder` holds an `InteractionManager` handle to block
|
||||
* long-running JS events from interrupting active gestures.
|
||||
*
|
||||
* A graphical explanation of the touch data flow:
|
||||
*
|
||||
* +----------------------------+ +--------------------------------+
|
||||
* | ResponderTouchHistoryStore | |TouchHistoryMath |
|
||||
* +----------------------------+ +----------+---------------------+
|
||||
* |Global store of touchHistory| |Allocation-less math util |
|
||||
* |including activeness, start | |on touch history (centroids |
|
||||
* |position, prev/cur position.| |and multitouch movement etc) |
|
||||
* | | | |
|
||||
* +----^-----------------------+ +----^---------------------------+
|
||||
* | |
|
||||
* | (records relevant history |
|
||||
* | of touches relevant for |
|
||||
* | implementing higher level |
|
||||
* | gestures) |
|
||||
* | |
|
||||
* +----+-----------------------+ +----|---------------------------+
|
||||
* | ResponderEventPlugin | | | Your App/Component |
|
||||
* +----------------------------+ +----|---------------------------+
|
||||
* |Negotiates which view gets | Low level | | High level |
|
||||
* |onResponderMove events. | events w/ | +-+-------+ events w/ |
|
||||
* |Also records history into | touchHistory| | Pan | multitouch + |
|
||||
* |ResponderTouchHistoryStore. +---------------->Responder+-----> accumulative|
|
||||
* +----------------------------+ attached to | | | distance and |
|
||||
* each event | +---------+ velocity. |
|
||||
* | |
|
||||
* | |
|
||||
* +--------------------------------+
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _InteractionManager = _interopRequireDefault(require("../InteractionManager"));
|
||||
|
||||
var _TouchHistoryMath = _interopRequireDefault(require("../../vendor/react-native/TouchHistoryMath"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var currentCentroidX = _TouchHistoryMath.default.currentCentroidX,
|
||||
currentCentroidY = _TouchHistoryMath.default.currentCentroidY,
|
||||
currentCentroidXOfTouchesChangedAfter = _TouchHistoryMath.default.currentCentroidXOfTouchesChangedAfter,
|
||||
currentCentroidYOfTouchesChangedAfter = _TouchHistoryMath.default.currentCentroidYOfTouchesChangedAfter,
|
||||
previousCentroidXOfTouchesChangedAfter = _TouchHistoryMath.default.previousCentroidXOfTouchesChangedAfter,
|
||||
previousCentroidYOfTouchesChangedAfter = _TouchHistoryMath.default.previousCentroidYOfTouchesChangedAfter;
|
||||
var PanResponder = {
|
||||
_initializeGestureState: function _initializeGestureState(gestureState) {
|
||||
gestureState.x = 0;
|
||||
gestureState.y = 0;
|
||||
gestureState.initialX = 0;
|
||||
gestureState.initialY = 0;
|
||||
gestureState.deltaX = 0;
|
||||
gestureState.deltaY = 0;
|
||||
gestureState.velocityX = 0;
|
||||
gestureState.velocityY = 0;
|
||||
gestureState.numberActiveTouches = 0; // All `gestureState` accounts for timeStamps up until:
|
||||
|
||||
gestureState._accountsForMovesUpTo = 0;
|
||||
},
|
||||
|
||||
/**
|
||||
* Take all recently moved touches, calculate how the centroid has changed just for those
|
||||
* recently moved touches, and append that change to an accumulator. This is
|
||||
* to (at least) handle the case where the user is moving three fingers, and
|
||||
* then one of the fingers stops but the other two continue.
|
||||
*
|
||||
* This is very different than taking all of the recently moved touches and
|
||||
* storing their centroid as `dx/dy`. For correctness, we must *accumulate
|
||||
* changes* in the centroid of recently moved touches.
|
||||
*
|
||||
* There is also some nuance with how we handle multiple moved touches in a
|
||||
* single event. Multiple touches generate two 'move' events, each of
|
||||
* them triggering `onResponderMove`. But with the way `PanResponder` works,
|
||||
* all of the gesture inference is performed on the first dispatch, since it
|
||||
* looks at all of the touches. Therefore, `PanResponder` does not call
|
||||
* `onResponderMove` passed the first dispatch. This diverges from the
|
||||
* typical responder callback pattern (without using `PanResponder`), but
|
||||
* avoids more dispatches than necessary.
|
||||
*
|
||||
* When moving two touches in opposite directions, the cumulative
|
||||
* distance is zero in each dimension. When two touches move in parallel five
|
||||
* pixels in the same direction, the cumulative distance is five, not ten. If
|
||||
* two touches start, one moves five in a direction, then stops and the other
|
||||
* touch moves fives in the same direction, the cumulative distance is ten.
|
||||
*
|
||||
* This logic requires a kind of processing of time "clusters" of touch events
|
||||
* so that two touch moves that essentially occur in parallel but move every
|
||||
* other frame respectively, are considered part of the same movement.
|
||||
*
|
||||
* x/y: If a move event has been observed, `(x, y)` is the centroid of the most
|
||||
* recently moved "cluster" of active touches.
|
||||
* deltaX/deltaY: Cumulative touch distance. Accounts for touch moves that are
|
||||
* clustered together in time, moving the same direction. Only valid when
|
||||
* currently responder (otherwise, it only represents the drag distance below
|
||||
* the threshold).
|
||||
*/
|
||||
_updateGestureStateOnMove: function _updateGestureStateOnMove(gestureState, touchHistory) {
|
||||
var movedAfter = gestureState._accountsForMovesUpTo;
|
||||
var prevX = previousCentroidXOfTouchesChangedAfter(touchHistory, movedAfter);
|
||||
var prevY = previousCentroidYOfTouchesChangedAfter(touchHistory, movedAfter);
|
||||
var prevDeltaX = gestureState.deltaX;
|
||||
var prevDeltaY = gestureState.deltaY;
|
||||
var x = currentCentroidXOfTouchesChangedAfter(touchHistory, movedAfter);
|
||||
var y = currentCentroidYOfTouchesChangedAfter(touchHistory, movedAfter);
|
||||
var deltaX = prevDeltaX + (x - prevX);
|
||||
var deltaY = prevDeltaY + (y - prevY); // TODO: This must be filtered intelligently.
|
||||
|
||||
var dt = touchHistory.mostRecentTimeStamp - gestureState._accountsForMovesUpTo;
|
||||
gestureState.deltaX = deltaX;
|
||||
gestureState.deltaY = deltaY;
|
||||
gestureState.numberActiveTouches = touchHistory.numberActiveTouches;
|
||||
gestureState.velocityX = (deltaX - prevDeltaX) / dt;
|
||||
gestureState.velocityY = (deltaY - prevDeltaY) / dt;
|
||||
gestureState.x = x;
|
||||
gestureState.y = y;
|
||||
gestureState._accountsForMovesUpTo = touchHistory.mostRecentTimeStamp;
|
||||
},
|
||||
|
||||
/**
|
||||
* Enhanced versions of all of the responder callbacks that provide not only
|
||||
* the `ResponderEvent`, but also the `PanResponder` gesture state.
|
||||
*
|
||||
* In general, for events that have capture equivalents, we update the
|
||||
* gestureState once in the capture phase and can use it in the bubble phase
|
||||
* as well.
|
||||
*/
|
||||
create: function create(config) {
|
||||
var interactionState = {
|
||||
handle: null
|
||||
};
|
||||
var gestureState = {
|
||||
// Useful for debugging
|
||||
stateID: Math.random(),
|
||||
x: 0,
|
||||
y: 0,
|
||||
initialX: 0,
|
||||
initialY: 0,
|
||||
deltaX: 0,
|
||||
deltaY: 0,
|
||||
velocityX: 0,
|
||||
velocityY: 0,
|
||||
numberActiveTouches: 0,
|
||||
_accountsForMovesUpTo: 0
|
||||
};
|
||||
var _onStartShouldSetResponder = config.onStartShouldSetResponder,
|
||||
_onStartShouldSetResponderCapture = config.onStartShouldSetResponderCapture,
|
||||
_onMoveShouldSetResponder = config.onMoveShouldSetResponder,
|
||||
_onMoveShouldSetResponderCapture = config.onMoveShouldSetResponderCapture,
|
||||
onPanGrant = config.onPanGrant,
|
||||
onPanStart = config.onPanStart,
|
||||
onPanMove = config.onPanMove,
|
||||
onPanEnd = config.onPanEnd,
|
||||
onPanRelease = config.onPanRelease,
|
||||
onPanReject = config.onPanReject,
|
||||
onPanTerminate = config.onPanTerminate,
|
||||
onPanTerminationRequest = config.onPanTerminationRequest;
|
||||
var panHandlers = {
|
||||
onStartShouldSetResponder: function onStartShouldSetResponder(event) {
|
||||
return _onStartShouldSetResponder != null ? _onStartShouldSetResponder(event, gestureState) : false;
|
||||
},
|
||||
onMoveShouldSetResponder: function onMoveShouldSetResponder(event) {
|
||||
return _onMoveShouldSetResponder != null ? _onMoveShouldSetResponder(event, gestureState) : false;
|
||||
},
|
||||
onStartShouldSetResponderCapture: function onStartShouldSetResponderCapture(event) {
|
||||
// TODO: Actually, we should reinitialize the state any time
|
||||
// touches.length increases from 0 active to > 0 active.
|
||||
if (event.nativeEvent.touches.length === 1) {
|
||||
PanResponder._initializeGestureState(gestureState);
|
||||
}
|
||||
|
||||
gestureState.numberActiveTouches = event.touchHistory.numberActiveTouches;
|
||||
return _onStartShouldSetResponderCapture != null ? _onStartShouldSetResponderCapture(event, gestureState) : false;
|
||||
},
|
||||
onMoveShouldSetResponderCapture: function onMoveShouldSetResponderCapture(event) {
|
||||
var touchHistory = event.touchHistory; // Responder system incorrectly dispatches should* to current responder
|
||||
// Filter out any touch moves past the first one - we would have
|
||||
// already processed multi-touch geometry during the first event.
|
||||
// NOTE: commented out because new responder system should get it right.
|
||||
//if (gestureState._accountsForMovesUpTo === touchHistory.mostRecentTimeStamp) {
|
||||
// return false;
|
||||
//}
|
||||
|
||||
PanResponder._updateGestureStateOnMove(gestureState, touchHistory);
|
||||
|
||||
return _onMoveShouldSetResponderCapture != null ? _onMoveShouldSetResponderCapture(event, gestureState) : false;
|
||||
},
|
||||
onResponderGrant: function onResponderGrant(event) {
|
||||
if (!interactionState.handle) {
|
||||
interactionState.handle = _InteractionManager.default.createInteractionHandle();
|
||||
}
|
||||
|
||||
gestureState.initialX = currentCentroidX(event.touchHistory);
|
||||
gestureState.initialY = currentCentroidY(event.touchHistory);
|
||||
gestureState.deltaX = 0;
|
||||
gestureState.deltaY = 0;
|
||||
|
||||
if (onPanGrant != null) {
|
||||
onPanGrant(event, gestureState);
|
||||
}
|
||||
},
|
||||
onResponderReject: function onResponderReject(event) {
|
||||
clearInteractionHandle(interactionState, onPanReject, event, gestureState);
|
||||
},
|
||||
onResponderStart: function onResponderStart(event) {
|
||||
var numberActiveTouches = event.touchHistory.numberActiveTouches;
|
||||
gestureState.numberActiveTouches = numberActiveTouches;
|
||||
|
||||
if (onPanStart != null) {
|
||||
onPanStart(event, gestureState);
|
||||
}
|
||||
},
|
||||
onResponderMove: function onResponderMove(event) {
|
||||
var touchHistory = event.touchHistory; // Guard against the dispatch of two touch moves when there are two
|
||||
// simultaneously changed touches.
|
||||
|
||||
if (gestureState._accountsForMovesUpTo === touchHistory.mostRecentTimeStamp) {
|
||||
return;
|
||||
} // Filter out any touch moves past the first one - we would have
|
||||
// already processed multi-touch geometry during the first event.
|
||||
|
||||
|
||||
PanResponder._updateGestureStateOnMove(gestureState, touchHistory);
|
||||
|
||||
if (onPanMove != null) {
|
||||
onPanMove(event, gestureState);
|
||||
}
|
||||
},
|
||||
onResponderEnd: function onResponderEnd(event) {
|
||||
var numberActiveTouches = event.touchHistory.numberActiveTouches;
|
||||
gestureState.numberActiveTouches = numberActiveTouches;
|
||||
clearInteractionHandle(interactionState, onPanEnd, event, gestureState);
|
||||
},
|
||||
onResponderRelease: function onResponderRelease(event) {
|
||||
clearInteractionHandle(interactionState, onPanRelease, event, gestureState);
|
||||
|
||||
PanResponder._initializeGestureState(gestureState);
|
||||
},
|
||||
onResponderTerminate: function onResponderTerminate(event) {
|
||||
clearInteractionHandle(interactionState, onPanTerminate, event, gestureState);
|
||||
|
||||
PanResponder._initializeGestureState(gestureState);
|
||||
},
|
||||
onResponderTerminationRequest: function onResponderTerminationRequest(event) {
|
||||
return onPanTerminationRequest != null ? onPanTerminationRequest(event, gestureState) : true;
|
||||
}
|
||||
};
|
||||
return {
|
||||
panHandlers: panHandlers,
|
||||
getInteractionHandle: function getInteractionHandle() {
|
||||
return interactionState.handle;
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
function clearInteractionHandle(interactionState, callback, event, gestureState) {
|
||||
if (interactionState.handle) {
|
||||
_InteractionManager.default.clearInteractionHandle(interactionState.handle);
|
||||
|
||||
interactionState.handle = null;
|
||||
}
|
||||
|
||||
if (callback) {
|
||||
callback(event, gestureState);
|
||||
}
|
||||
}
|
||||
|
||||
var _default = PanResponder;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
12
node_modules/react-native-web/dist/cjs/exports/PanResponder/index.js
generated
vendored
Normal file
12
node_modules/react-native-web/dist/cjs/exports/PanResponder/index.js
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _PanResponder = _interopRequireDefault(require("../../vendor/react-native/PanResponder"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var _default = _PanResponder.default;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
7
node_modules/react-native-web/dist/cjs/exports/PermissionsAndroid/index.js
generated
vendored
Normal file
7
node_modules/react-native-web/dist/cjs/exports/PermissionsAndroid/index.js
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
var _default = {};
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
34
node_modules/react-native-web/dist/cjs/exports/Picker/PickerItem.js
generated
vendored
Normal file
34
node_modules/react-native-web/dist/cjs/exports/Picker/PickerItem.js
generated
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = PickerItem;
|
||||
|
||||
var _createElement = _interopRequireDefault(require("../createElement"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
function PickerItem(props) {
|
||||
var color = props.color,
|
||||
label = props.label,
|
||||
testID = props.testID,
|
||||
value = props.value;
|
||||
var style = {
|
||||
color: color
|
||||
};
|
||||
return (0, _createElement.default)('option', {
|
||||
style: style,
|
||||
testID: testID,
|
||||
value: value
|
||||
}, label);
|
||||
}
|
||||
|
||||
module.exports = exports.default;
|
79
node_modules/react-native-web/dist/cjs/exports/Picker/index.js
generated
vendored
Normal file
79
node_modules/react-native-web/dist/cjs/exports/Picker/index.js
generated
vendored
Normal file
@ -0,0 +1,79 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _createElement = _interopRequireDefault(require("../createElement"));
|
||||
|
||||
var _useMergeRefs = _interopRequireDefault(require("../../modules/useMergeRefs"));
|
||||
|
||||
var _usePlatformMethods = _interopRequireDefault(require("../../hooks/usePlatformMethods"));
|
||||
|
||||
var _PickerItem = _interopRequireDefault(require("./PickerItem"));
|
||||
|
||||
var _StyleSheet = _interopRequireDefault(require("../StyleSheet"));
|
||||
|
||||
var _react = require("react");
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
||||
|
||||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
||||
|
||||
var Picker = (0, _react.forwardRef)(function (props, forwardedRef) {
|
||||
var children = props.children,
|
||||
enabled = props.enabled,
|
||||
onValueChange = props.onValueChange,
|
||||
selectedValue = props.selectedValue,
|
||||
style = props.style,
|
||||
testID = props.testID,
|
||||
itemStyle = props.itemStyle,
|
||||
mode = props.mode,
|
||||
prompt = props.prompt,
|
||||
other = _objectWithoutPropertiesLoose(props, ["children", "enabled", "onValueChange", "selectedValue", "style", "testID", "itemStyle", "mode", "prompt"]);
|
||||
|
||||
var hostRef = (0, _react.useRef)(null);
|
||||
|
||||
function handleChange(e) {
|
||||
var _e$target = e.target,
|
||||
selectedIndex = _e$target.selectedIndex,
|
||||
value = _e$target.value;
|
||||
|
||||
if (onValueChange) {
|
||||
onValueChange(value, selectedIndex);
|
||||
}
|
||||
}
|
||||
|
||||
var supportedProps = _objectSpread({
|
||||
children: children,
|
||||
disabled: enabled === false ? true : undefined,
|
||||
onChange: handleChange,
|
||||
style: [styles.initial, style],
|
||||
testID: testID,
|
||||
value: selectedValue
|
||||
}, other);
|
||||
|
||||
var platformMethodsRef = (0, _usePlatformMethods.default)(supportedProps);
|
||||
var setRef = (0, _useMergeRefs.default)(hostRef, platformMethodsRef, forwardedRef);
|
||||
supportedProps.ref = setRef;
|
||||
return (0, _createElement.default)('select', supportedProps);
|
||||
}); // $FlowFixMe
|
||||
|
||||
Picker.Item = _PickerItem.default;
|
||||
|
||||
var styles = _StyleSheet.default.create({
|
||||
initial: {
|
||||
fontFamily: 'System',
|
||||
fontSize: 'inherit',
|
||||
margin: 0
|
||||
}
|
||||
});
|
||||
|
||||
var _default = Picker;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
68
node_modules/react-native-web/dist/cjs/exports/PixelRatio/index.js
generated
vendored
Normal file
68
node_modules/react-native-web/dist/cjs/exports/PixelRatio/index.js
generated
vendored
Normal file
@ -0,0 +1,68 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _Dimensions = _interopRequireDefault(require("../Dimensions"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* PixelRatio gives access to the device pixel density.
|
||||
*/
|
||||
var PixelRatio =
|
||||
/*#__PURE__*/
|
||||
function () {
|
||||
function PixelRatio() {}
|
||||
|
||||
/**
|
||||
* Returns the device pixel density.
|
||||
*/
|
||||
PixelRatio.get = function get() {
|
||||
return _Dimensions.default.get('window').scale;
|
||||
}
|
||||
/**
|
||||
* No equivalent for Web
|
||||
*/
|
||||
;
|
||||
|
||||
PixelRatio.getFontScale = function getFontScale() {
|
||||
return _Dimensions.default.get('window').fontScale || PixelRatio.get();
|
||||
}
|
||||
/**
|
||||
* Converts a layout size (dp) to pixel size (px).
|
||||
* Guaranteed to return an integer number.
|
||||
*/
|
||||
;
|
||||
|
||||
PixelRatio.getPixelSizeForLayoutSize = function getPixelSizeForLayoutSize(layoutSize) {
|
||||
return Math.round(layoutSize * PixelRatio.get());
|
||||
}
|
||||
/**
|
||||
* Rounds a layout size (dp) to the nearest layout size that corresponds to
|
||||
* an integer number of pixels. For example, on a device with a PixelRatio
|
||||
* of 3, `PixelRatio.roundToNearestPixel(8.4) = 8.33`, which corresponds to
|
||||
* exactly (8.33 * 3) = 25 pixels.
|
||||
*/
|
||||
;
|
||||
|
||||
PixelRatio.roundToNearestPixel = function roundToNearestPixel(layoutSize) {
|
||||
var ratio = PixelRatio.get();
|
||||
return Math.round(layoutSize * ratio) / ratio;
|
||||
};
|
||||
|
||||
return PixelRatio;
|
||||
}();
|
||||
|
||||
exports.default = PixelRatio;
|
||||
module.exports = exports.default;
|
32
node_modules/react-native-web/dist/cjs/exports/Platform/index.js
generated
vendored
Normal file
32
node_modules/react-native-web/dist/cjs/exports/Platform/index.js
generated
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
var Platform = {
|
||||
OS: 'web',
|
||||
select: function select(obj) {
|
||||
return 'web' in obj ? obj.web : obj.default;
|
||||
},
|
||||
|
||||
get isTesting() {
|
||||
if (process.env.NODE_DEV === 'test') {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
};
|
||||
var _default = Platform;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
132
node_modules/react-native-web/dist/cjs/exports/Pressable/index.js
generated
vendored
Normal file
132
node_modules/react-native-web/dist/cjs/exports/Pressable/index.js
generated
vendored
Normal file
@ -0,0 +1,132 @@
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var React = _interopRequireWildcard(require("react"));
|
||||
|
||||
var _useMergeRefs = _interopRequireDefault(require("../../modules/useMergeRefs"));
|
||||
|
||||
var _usePressEvents = _interopRequireDefault(require("../../hooks/usePressEvents"));
|
||||
|
||||
var _View = _interopRequireDefault(require("../View"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
||||
|
||||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
||||
|
||||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
||||
|
||||
/**
|
||||
* Component used to build display components that should respond to whether the
|
||||
* component is currently pressed or not.
|
||||
*/
|
||||
function Pressable(props, forwardedRef) {
|
||||
var accessible = props.accessible,
|
||||
children = props.children,
|
||||
delayLongPress = props.delayLongPress,
|
||||
delayPressIn = props.delayPressIn,
|
||||
delayPressOut = props.delayPressOut,
|
||||
disabled = props.disabled,
|
||||
focusable = props.focusable,
|
||||
onBlur = props.onBlur,
|
||||
onFocus = props.onFocus,
|
||||
onLongPress = props.onLongPress,
|
||||
onPress = props.onPress,
|
||||
onPressMove = props.onPressMove,
|
||||
onPressIn = props.onPressIn,
|
||||
onPressOut = props.onPressOut,
|
||||
style = props.style,
|
||||
testOnly_pressed = props.testOnly_pressed,
|
||||
rest = _objectWithoutPropertiesLoose(props, ["accessible", "children", "delayLongPress", "delayPressIn", "delayPressOut", "disabled", "focusable", "onBlur", "onFocus", "onLongPress", "onPress", "onPressMove", "onPressIn", "onPressOut", "style", "testOnly_pressed"]);
|
||||
|
||||
var _useForceableState = useForceableState(false),
|
||||
focused = _useForceableState[0],
|
||||
setFocused = _useForceableState[1];
|
||||
|
||||
var _useForceableState2 = useForceableState(testOnly_pressed === true),
|
||||
pressed = _useForceableState2[0],
|
||||
setPressed = _useForceableState2[1];
|
||||
|
||||
var hostRef = (0, React.useRef)(null);
|
||||
var setRef = (0, _useMergeRefs.default)(forwardedRef, hostRef);
|
||||
var pressConfig = (0, React.useMemo)(function () {
|
||||
return {
|
||||
delayLongPress: delayLongPress,
|
||||
delayPressStart: delayPressIn,
|
||||
delayPressEnd: delayPressOut,
|
||||
disabled: disabled,
|
||||
onLongPress: onLongPress,
|
||||
onPress: onPress,
|
||||
onPressChange: setPressed,
|
||||
onPressStart: onPressIn,
|
||||
onPressMove: onPressMove,
|
||||
onPressEnd: onPressOut
|
||||
};
|
||||
}, [delayLongPress, delayPressIn, delayPressOut, disabled, onLongPress, onPress, onPressIn, onPressMove, onPressOut, setPressed]);
|
||||
var pressEventHandlers = (0, _usePressEvents.default)(hostRef, pressConfig);
|
||||
|
||||
var accessibilityState = _objectSpread({
|
||||
disabled: disabled
|
||||
}, props.accessibilityState);
|
||||
|
||||
var interactionState = {
|
||||
focused: focused,
|
||||
pressed: pressed
|
||||
};
|
||||
|
||||
function createFocusHandler(callback, value) {
|
||||
return function (event) {
|
||||
if (event.nativeEvent.target === hostRef.current) {
|
||||
setFocused(value);
|
||||
|
||||
if (callback != null) {
|
||||
callback(event);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return React.createElement(_View.default, _extends({}, rest, pressEventHandlers, {
|
||||
accessibilityState: accessibilityState,
|
||||
accessible: accessible !== false,
|
||||
focusable: focusable !== false,
|
||||
onBlur: createFocusHandler(onBlur, false),
|
||||
onFocus: createFocusHandler(onFocus, true),
|
||||
ref: setRef,
|
||||
style: typeof style === 'function' ? style(interactionState) : style
|
||||
}), typeof children === 'function' ? children(interactionState) : children);
|
||||
}
|
||||
|
||||
function useForceableState(forced) {
|
||||
var _useState = (0, React.useState)(false),
|
||||
pressed = _useState[0],
|
||||
setPressed = _useState[1];
|
||||
|
||||
return [pressed || forced, setPressed];
|
||||
}
|
||||
|
||||
var MemoedPressable = (0, React.memo)((0, React.forwardRef)(Pressable));
|
||||
MemoedPressable.displayName = 'Pressable';
|
||||
var _default = MemoedPressable;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
99
node_modules/react-native-web/dist/cjs/exports/ProgressBar/index.js
generated
vendored
Normal file
99
node_modules/react-native-web/dist/cjs/exports/ProgressBar/index.js
generated
vendored
Normal file
@ -0,0 +1,99 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _StyleSheet = _interopRequireDefault(require("../StyleSheet"));
|
||||
|
||||
var _View = _interopRequireDefault(require("../View"));
|
||||
|
||||
var _react = _interopRequireWildcard(require("react"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
||||
|
||||
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
||||
|
||||
var ProgressBar = (0, _react.forwardRef)(function (props, ref) {
|
||||
var _props$color = props.color,
|
||||
color = _props$color === void 0 ? '#1976D2' : _props$color,
|
||||
_props$indeterminate = props.indeterminate,
|
||||
indeterminate = _props$indeterminate === void 0 ? false : _props$indeterminate,
|
||||
_props$progress = props.progress,
|
||||
progress = _props$progress === void 0 ? 0 : _props$progress,
|
||||
_props$trackColor = props.trackColor,
|
||||
trackColor = _props$trackColor === void 0 ? 'transparent' : _props$trackColor,
|
||||
style = props.style,
|
||||
other = _objectWithoutPropertiesLoose(props, ["color", "indeterminate", "progress", "trackColor", "style"]);
|
||||
|
||||
var percentageProgress = progress * 100;
|
||||
var progressRef = (0, _react.useRef)(null);
|
||||
(0, _react.useEffect)(function () {
|
||||
var width = indeterminate ? '25%' : percentageProgress + "%";
|
||||
|
||||
if (progressRef.current != null) {
|
||||
progressRef.current.setNativeProps({
|
||||
style: {
|
||||
width: width
|
||||
}
|
||||
});
|
||||
}
|
||||
}, [indeterminate, percentageProgress, progressRef]);
|
||||
return _react.default.createElement(_View.default, _extends({}, other, {
|
||||
accessibilityRole: "progressbar",
|
||||
accessibilityValue: {
|
||||
max: 100,
|
||||
min: 0,
|
||||
now: indeterminate ? null : percentageProgress
|
||||
},
|
||||
ref: ref,
|
||||
style: [styles.track, style, {
|
||||
backgroundColor: trackColor
|
||||
}]
|
||||
}), _react.default.createElement(_View.default, {
|
||||
ref: progressRef,
|
||||
style: [styles.progress, indeterminate && styles.animation, {
|
||||
backgroundColor: color
|
||||
}]
|
||||
}));
|
||||
});
|
||||
ProgressBar.displayName = 'ProgressBar';
|
||||
|
||||
var styles = _StyleSheet.default.create({
|
||||
track: {
|
||||
height: 5,
|
||||
overflow: 'hidden',
|
||||
userSelect: 'none',
|
||||
zIndex: 0
|
||||
},
|
||||
progress: {
|
||||
height: '100%',
|
||||
zIndex: -1
|
||||
},
|
||||
animation: {
|
||||
animationDuration: '1s',
|
||||
animationKeyframes: [{
|
||||
'0%': {
|
||||
transform: [{
|
||||
translateX: '-100%'
|
||||
}]
|
||||
},
|
||||
'100%': {
|
||||
transform: [{
|
||||
translateX: '400%'
|
||||
}]
|
||||
}
|
||||
}],
|
||||
animationTimingFunction: 'linear',
|
||||
animationIterationCount: 'infinite'
|
||||
}
|
||||
});
|
||||
|
||||
var _default = ProgressBar;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
32
node_modules/react-native-web/dist/cjs/exports/RefreshControl/index.js
generated
vendored
Normal file
32
node_modules/react-native-web/dist/cjs/exports/RefreshControl/index.js
generated
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _View = _interopRequireDefault(require("../View"));
|
||||
|
||||
var _react = _interopRequireDefault(require("react"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
||||
|
||||
function RefreshControl(props) {
|
||||
var colors = props.colors,
|
||||
enabled = props.enabled,
|
||||
onRefresh = props.onRefresh,
|
||||
progressBackgroundColor = props.progressBackgroundColor,
|
||||
progressViewOffset = props.progressViewOffset,
|
||||
refreshing = props.refreshing,
|
||||
size = props.size,
|
||||
tintColor = props.tintColor,
|
||||
title = props.title,
|
||||
titleColor = props.titleColor,
|
||||
rest = _objectWithoutPropertiesLoose(props, ["colors", "enabled", "onRefresh", "progressBackgroundColor", "progressViewOffset", "refreshing", "size", "tintColor", "title", "titleColor"]);
|
||||
|
||||
return _react.default.createElement(_View.default, rest);
|
||||
}
|
||||
|
||||
var _default = RefreshControl;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
54
node_modules/react-native-web/dist/cjs/exports/SafeAreaView/index.js
generated
vendored
Normal file
54
node_modules/react-native-web/dist/cjs/exports/SafeAreaView/index.js
generated
vendored
Normal file
@ -0,0 +1,54 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _ExecutionEnvironment = require("fbjs/lib/ExecutionEnvironment");
|
||||
|
||||
var _StyleSheet = _interopRequireDefault(require("../StyleSheet"));
|
||||
|
||||
var _View = _interopRequireDefault(require("../View"));
|
||||
|
||||
var _react = _interopRequireWildcard(require("react"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
||||
|
||||
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
||||
|
||||
var cssFunction = function () {
|
||||
if (_ExecutionEnvironment.canUseDOM && window.CSS && window.CSS.supports && window.CSS.supports('top: constant(safe-area-inset-top)')) {
|
||||
return 'constant';
|
||||
}
|
||||
|
||||
return 'env';
|
||||
}();
|
||||
|
||||
var SafeAreaView = (0, _react.forwardRef)(function (props, ref) {
|
||||
var style = props.style,
|
||||
rest = _objectWithoutPropertiesLoose(props, ["style"]);
|
||||
|
||||
return _react.default.createElement(_View.default, _extends({}, rest, {
|
||||
ref: ref,
|
||||
style: _StyleSheet.default.compose(styles.root, style)
|
||||
}));
|
||||
});
|
||||
SafeAreaView.displayName = 'SafeAreaView';
|
||||
|
||||
var styles = _StyleSheet.default.create({
|
||||
root: {
|
||||
paddingTop: cssFunction + "(safe-area-inset-top)",
|
||||
paddingRight: cssFunction + "(safe-area-inset-right)",
|
||||
paddingBottom: cssFunction + "(safe-area-inset-bottom)",
|
||||
paddingLeft: cssFunction + "(safe-area-inset-left)"
|
||||
}
|
||||
});
|
||||
|
||||
var _default = SafeAreaView;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
189
node_modules/react-native-web/dist/cjs/exports/ScrollView/ScrollViewBase.js
generated
vendored
Normal file
189
node_modules/react-native-web/dist/cjs/exports/ScrollView/ScrollViewBase.js
generated
vendored
Normal file
@ -0,0 +1,189 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var React = _interopRequireWildcard(require("react"));
|
||||
|
||||
var _StyleSheet = _interopRequireDefault(require("../StyleSheet"));
|
||||
|
||||
var _View = _interopRequireDefault(require("../View"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
function normalizeScrollEvent(e) {
|
||||
return {
|
||||
nativeEvent: {
|
||||
contentOffset: {
|
||||
get x() {
|
||||
return e.target.scrollLeft;
|
||||
},
|
||||
|
||||
get y() {
|
||||
return e.target.scrollTop;
|
||||
}
|
||||
|
||||
},
|
||||
contentSize: {
|
||||
get height() {
|
||||
return e.target.scrollHeight;
|
||||
},
|
||||
|
||||
get width() {
|
||||
return e.target.scrollWidth;
|
||||
}
|
||||
|
||||
},
|
||||
layoutMeasurement: {
|
||||
get height() {
|
||||
return e.target.offsetHeight;
|
||||
},
|
||||
|
||||
get width() {
|
||||
return e.target.offsetWidth;
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
timeStamp: Date.now()
|
||||
};
|
||||
}
|
||||
|
||||
function shouldEmitScrollEvent(lastTick, eventThrottle) {
|
||||
var timeSinceLastTick = Date.now() - lastTick;
|
||||
return eventThrottle > 0 && timeSinceLastTick >= eventThrottle;
|
||||
}
|
||||
/**
|
||||
* Encapsulates the Web-specific scroll throttling and disabling logic
|
||||
*/
|
||||
|
||||
|
||||
var ScrollViewBase = (0, React.forwardRef)(function (props, forwardedRef) {
|
||||
var accessibilityLabel = props.accessibilityLabel,
|
||||
accessibilityRole = props.accessibilityRole,
|
||||
accessibilityState = props.accessibilityState,
|
||||
children = props.children,
|
||||
importantForAccessibility = props.importantForAccessibility,
|
||||
nativeID = props.nativeID,
|
||||
onLayout = props.onLayout,
|
||||
onScroll = props.onScroll,
|
||||
onTouchMove = props.onTouchMove,
|
||||
onWheel = props.onWheel,
|
||||
pointerEvents = props.pointerEvents,
|
||||
_props$scrollEnabled = props.scrollEnabled,
|
||||
scrollEnabled = _props$scrollEnabled === void 0 ? true : _props$scrollEnabled,
|
||||
_props$scrollEventThr = props.scrollEventThrottle,
|
||||
scrollEventThrottle = _props$scrollEventThr === void 0 ? 0 : _props$scrollEventThr,
|
||||
showsHorizontalScrollIndicator = props.showsHorizontalScrollIndicator,
|
||||
showsVerticalScrollIndicator = props.showsVerticalScrollIndicator,
|
||||
style = props.style,
|
||||
dataSet = props.dataSet,
|
||||
testID = props.testID;
|
||||
var scrollState = (0, React.useRef)({
|
||||
isScrolling: false,
|
||||
scrollLastTick: 0
|
||||
});
|
||||
var scrollTimeout = (0, React.useRef)(null);
|
||||
|
||||
function createPreventableScrollHandler(handler) {
|
||||
return function (e) {
|
||||
if (scrollEnabled) {
|
||||
if (handler) {
|
||||
handler(e);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function handleScroll(e) {
|
||||
e.persist();
|
||||
e.stopPropagation(); // A scroll happened, so the scroll resets the scrollend timeout.
|
||||
|
||||
if (scrollTimeout.current != null) {
|
||||
clearTimeout(scrollTimeout.current);
|
||||
}
|
||||
|
||||
scrollTimeout.current = setTimeout(function () {
|
||||
handleScrollEnd(e);
|
||||
}, 100);
|
||||
|
||||
if (scrollState.current.isScrolling) {
|
||||
// Scroll last tick may have changed, check if we need to notify
|
||||
if (shouldEmitScrollEvent(scrollState.current.scrollLastTick, scrollEventThrottle)) {
|
||||
handleScrollTick(e);
|
||||
}
|
||||
} else {
|
||||
// Weren't scrolling, so we must have just started
|
||||
handleScrollStart(e);
|
||||
}
|
||||
}
|
||||
|
||||
function handleScrollStart(e) {
|
||||
scrollState.current.isScrolling = true;
|
||||
scrollState.current.scrollLastTick = Date.now();
|
||||
}
|
||||
|
||||
function handleScrollTick(e) {
|
||||
scrollState.current.scrollLastTick = Date.now();
|
||||
|
||||
if (onScroll) {
|
||||
onScroll(normalizeScrollEvent(e));
|
||||
}
|
||||
}
|
||||
|
||||
function handleScrollEnd(e) {
|
||||
scrollState.current.isScrolling = false;
|
||||
|
||||
if (onScroll) {
|
||||
onScroll(normalizeScrollEvent(e));
|
||||
}
|
||||
}
|
||||
|
||||
var hideScrollbar = showsHorizontalScrollIndicator === false || showsVerticalScrollIndicator === false;
|
||||
return React.createElement(_View.default, {
|
||||
accessibilityLabel: accessibilityLabel,
|
||||
accessibilityRole: accessibilityRole,
|
||||
accessibilityState: accessibilityState,
|
||||
children: children,
|
||||
dataSet: dataSet,
|
||||
importantForAccessibility: importantForAccessibility,
|
||||
nativeID: nativeID,
|
||||
onLayout: onLayout,
|
||||
onScroll: handleScroll,
|
||||
onTouchMove: createPreventableScrollHandler(onTouchMove),
|
||||
onWheel: createPreventableScrollHandler(onWheel),
|
||||
pointerEvents: pointerEvents,
|
||||
ref: forwardedRef,
|
||||
style: [style, !scrollEnabled && styles.scrollDisabled, hideScrollbar && styles.hideScrollbar],
|
||||
testID: testID
|
||||
});
|
||||
}); // Chrome doesn't support e.preventDefault in this case; touch-action must be
|
||||
// used to disable scrolling.
|
||||
// https://developers.google.com/web/updates/2017/01/scrolling-intervention
|
||||
|
||||
var styles = _StyleSheet.default.create({
|
||||
scrollDisabled: {
|
||||
overflowX: 'hidden',
|
||||
overflowY: 'hidden',
|
||||
touchAction: 'none'
|
||||
},
|
||||
hideScrollbar: {
|
||||
scrollbarWidth: 'none'
|
||||
}
|
||||
});
|
||||
|
||||
var _default = ScrollViewBase;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
277
node_modules/react-native-web/dist/cjs/exports/ScrollView/index.js
generated
vendored
Normal file
277
node_modules/react-native-web/dist/cjs/exports/ScrollView/index.js
generated
vendored
Normal file
@ -0,0 +1,277 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _createReactClass = _interopRequireDefault(require("create-react-class"));
|
||||
|
||||
var _dismissKeyboard = _interopRequireDefault(require("../../modules/dismissKeyboard"));
|
||||
|
||||
var _invariant = _interopRequireDefault(require("fbjs/lib/invariant"));
|
||||
|
||||
var _ScrollResponder = _interopRequireDefault(require("../../modules/ScrollResponder"));
|
||||
|
||||
var _ScrollViewBase = _interopRequireDefault(require("./ScrollViewBase"));
|
||||
|
||||
var _StyleSheet = _interopRequireDefault(require("../StyleSheet"));
|
||||
|
||||
var _View = _interopRequireDefault(require("../View"));
|
||||
|
||||
var _react = _interopRequireDefault(require("react"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
||||
|
||||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
||||
|
||||
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
||||
|
||||
var emptyObject = {};
|
||||
/* eslint-disable react/prefer-es6-class */
|
||||
|
||||
var ScrollView = (0, _createReactClass.default)({
|
||||
displayName: "ScrollView",
|
||||
mixins: [_ScrollResponder.default.Mixin],
|
||||
getInitialState: function getInitialState() {
|
||||
return this.scrollResponderMixinGetInitialState();
|
||||
},
|
||||
flashScrollIndicators: function flashScrollIndicators() {
|
||||
this.scrollResponderFlashScrollIndicators();
|
||||
},
|
||||
setNativeProps: function setNativeProps(props) {
|
||||
if (this._scrollNodeRef) {
|
||||
this._scrollNodeRef.setNativeProps(props);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns a reference to the underlying scroll responder, which supports
|
||||
* operations like `scrollTo`. All ScrollView-like components should
|
||||
* implement this method so that they can be composed while providing access
|
||||
* to the underlying scroll responder's methods.
|
||||
*/
|
||||
getScrollResponder: function getScrollResponder() {
|
||||
return this;
|
||||
},
|
||||
getScrollableNode: function getScrollableNode() {
|
||||
return this._scrollNodeRef;
|
||||
},
|
||||
getInnerViewNode: function getInnerViewNode() {
|
||||
return this._innerViewRef;
|
||||
},
|
||||
|
||||
/**
|
||||
* Scrolls to a given x, y offset, either immediately or with a smooth animation.
|
||||
* Syntax:
|
||||
*
|
||||
* scrollTo(options: {x: number = 0; y: number = 0; animated: boolean = true})
|
||||
*
|
||||
* Note: The weird argument signature is due to the fact that, for historical reasons,
|
||||
* the function also accepts separate arguments as as alternative to the options object.
|
||||
* This is deprecated due to ambiguity (y before x), and SHOULD NOT BE USED.
|
||||
*/
|
||||
scrollTo: function scrollTo(y, x, animated) {
|
||||
if (typeof y === 'number') {
|
||||
console.warn('`scrollTo(y, x, animated)` is deprecated. Use `scrollTo({x: 5, y: 5, animated: true})` instead.');
|
||||
} else {
|
||||
var _ref = y || emptyObject;
|
||||
|
||||
x = _ref.x;
|
||||
y = _ref.y;
|
||||
animated = _ref.animated;
|
||||
}
|
||||
|
||||
this.getScrollResponder().scrollResponderScrollTo({
|
||||
x: x || 0,
|
||||
y: y || 0,
|
||||
animated: animated !== false
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* If this is a vertical ScrollView scrolls to the bottom.
|
||||
* If this is a horizontal ScrollView scrolls to the right.
|
||||
*
|
||||
* Use `scrollToEnd({ animated: true })` for smooth animated scrolling,
|
||||
* `scrollToEnd({ animated: false })` for immediate scrolling.
|
||||
* If no options are passed, `animated` defaults to true.
|
||||
*/
|
||||
scrollToEnd: function scrollToEnd(options) {
|
||||
// Default to true
|
||||
var animated = (options && options.animated) !== false;
|
||||
var horizontal = this.props.horizontal;
|
||||
var scrollResponder = this.getScrollResponder();
|
||||
var scrollResponderNode = scrollResponder.scrollResponderGetScrollableNode();
|
||||
var x = horizontal ? scrollResponderNode.scrollWidth : 0;
|
||||
var y = horizontal ? 0 : scrollResponderNode.scrollHeight;
|
||||
scrollResponder.scrollResponderScrollTo({
|
||||
x: x,
|
||||
y: y,
|
||||
animated: animated
|
||||
});
|
||||
},
|
||||
render: function render() {
|
||||
var _this$props = this.props,
|
||||
contentContainerStyle = _this$props.contentContainerStyle,
|
||||
horizontal = _this$props.horizontal,
|
||||
onContentSizeChange = _this$props.onContentSizeChange,
|
||||
refreshControl = _this$props.refreshControl,
|
||||
stickyHeaderIndices = _this$props.stickyHeaderIndices,
|
||||
pagingEnabled = _this$props.pagingEnabled,
|
||||
keyboardDismissMode = _this$props.keyboardDismissMode,
|
||||
onScroll = _this$props.onScroll,
|
||||
other = _objectWithoutPropertiesLoose(_this$props, ["contentContainerStyle", "horizontal", "onContentSizeChange", "refreshControl", "stickyHeaderIndices", "pagingEnabled", "keyboardDismissMode", "onScroll"]);
|
||||
|
||||
if (process.env.NODE_ENV !== 'production' && this.props.style) {
|
||||
var style = _StyleSheet.default.flatten(this.props.style);
|
||||
|
||||
var childLayoutProps = ['alignItems', 'justifyContent'].filter(function (prop) {
|
||||
return style && style[prop] !== undefined;
|
||||
});
|
||||
(0, _invariant.default)(childLayoutProps.length === 0, "ScrollView child layout (" + JSON.stringify(childLayoutProps) + ") " + 'must be applied through the contentContainerStyle prop.');
|
||||
}
|
||||
|
||||
var contentSizeChangeProps = {};
|
||||
|
||||
if (onContentSizeChange) {
|
||||
contentSizeChangeProps = {
|
||||
onLayout: this._handleContentOnLayout
|
||||
};
|
||||
}
|
||||
|
||||
var hasStickyHeaderIndices = !horizontal && Array.isArray(stickyHeaderIndices);
|
||||
var children = hasStickyHeaderIndices || pagingEnabled ? _react.default.Children.map(this.props.children, function (child, i) {
|
||||
var isSticky = hasStickyHeaderIndices && stickyHeaderIndices.indexOf(i) > -1;
|
||||
|
||||
if (child != null && (isSticky || pagingEnabled)) {
|
||||
return _react.default.createElement(_View.default, {
|
||||
style: _StyleSheet.default.compose(isSticky && styles.stickyHeader, pagingEnabled && styles.pagingEnabledChild)
|
||||
}, child);
|
||||
} else {
|
||||
return child;
|
||||
}
|
||||
}) : this.props.children;
|
||||
|
||||
var contentContainer = _react.default.createElement(_View.default, _extends({}, contentSizeChangeProps, {
|
||||
children: children,
|
||||
collapsable: false,
|
||||
ref: this._setInnerViewRef,
|
||||
style: _StyleSheet.default.compose(horizontal && styles.contentContainerHorizontal, contentContainerStyle)
|
||||
}));
|
||||
|
||||
var baseStyle = horizontal ? styles.baseHorizontal : styles.baseVertical;
|
||||
var pagingEnabledStyle = horizontal ? styles.pagingEnabledHorizontal : styles.pagingEnabledVertical;
|
||||
|
||||
var props = _objectSpread({}, other, {
|
||||
style: [baseStyle, pagingEnabled && pagingEnabledStyle, this.props.style],
|
||||
onTouchStart: this.scrollResponderHandleTouchStart,
|
||||
onTouchMove: this.scrollResponderHandleTouchMove,
|
||||
onTouchEnd: this.scrollResponderHandleTouchEnd,
|
||||
onScrollBeginDrag: this.scrollResponderHandleScrollBeginDrag,
|
||||
onScrollEndDrag: this.scrollResponderHandleScrollEndDrag,
|
||||
onMomentumScrollBegin: this.scrollResponderHandleMomentumScrollBegin,
|
||||
onMomentumScrollEnd: this.scrollResponderHandleMomentumScrollEnd,
|
||||
onStartShouldSetResponder: this.scrollResponderHandleStartShouldSetResponder,
|
||||
onStartShouldSetResponderCapture: this.scrollResponderHandleStartShouldSetResponderCapture,
|
||||
onScrollShouldSetResponder: this.scrollResponderHandleScrollShouldSetResponder,
|
||||
onScroll: this._handleScroll,
|
||||
onResponderGrant: this.scrollResponderHandleResponderGrant,
|
||||
onResponderTerminationRequest: this.scrollResponderHandleTerminationRequest,
|
||||
onResponderTerminate: this.scrollResponderHandleTerminate,
|
||||
onResponderRelease: this.scrollResponderHandleResponderRelease,
|
||||
onResponderReject: this.scrollResponderHandleResponderReject
|
||||
});
|
||||
|
||||
var ScrollViewClass = _ScrollViewBase.default;
|
||||
(0, _invariant.default)(ScrollViewClass !== undefined, 'ScrollViewClass must not be undefined');
|
||||
|
||||
if (refreshControl) {
|
||||
return _react.default.cloneElement(refreshControl, {
|
||||
style: props.style
|
||||
}, _react.default.createElement(ScrollViewClass, _extends({}, props, {
|
||||
ref: this._setScrollNodeRef,
|
||||
style: baseStyle
|
||||
}), contentContainer));
|
||||
}
|
||||
|
||||
return _react.default.createElement(ScrollViewClass, _extends({}, props, {
|
||||
ref: this._setScrollNodeRef
|
||||
}), contentContainer);
|
||||
},
|
||||
_handleContentOnLayout: function _handleContentOnLayout(e) {
|
||||
var _e$nativeEvent$layout = e.nativeEvent.layout,
|
||||
width = _e$nativeEvent$layout.width,
|
||||
height = _e$nativeEvent$layout.height;
|
||||
this.props.onContentSizeChange(width, height);
|
||||
},
|
||||
_handleScroll: function _handleScroll(e) {
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
if (this.props.onScroll && this.props.scrollEventThrottle == null) {
|
||||
console.log('You specified `onScroll` on a <ScrollView> but not ' + '`scrollEventThrottle`. You will only receive one event. ' + 'Using `16` you get all the events but be aware that it may ' + "cause frame drops, use a bigger number if you don't need as " + 'much precision.');
|
||||
}
|
||||
}
|
||||
|
||||
if (this.props.keyboardDismissMode === 'on-drag') {
|
||||
(0, _dismissKeyboard.default)();
|
||||
}
|
||||
|
||||
this.scrollResponderHandleScroll(e);
|
||||
},
|
||||
_setInnerViewRef: function _setInnerViewRef(component) {
|
||||
this._innerViewRef = component;
|
||||
},
|
||||
_setScrollNodeRef: function _setScrollNodeRef(component) {
|
||||
this._scrollNodeRef = component;
|
||||
}
|
||||
});
|
||||
var commonStyle = {
|
||||
flexGrow: 1,
|
||||
flexShrink: 1,
|
||||
// Enable hardware compositing in modern browsers.
|
||||
// Creates a new layer with its own backing surface that can significantly
|
||||
// improve scroll performance.
|
||||
transform: [{
|
||||
translateZ: 0
|
||||
}],
|
||||
// iOS native scrolling
|
||||
WebkitOverflowScrolling: 'touch'
|
||||
};
|
||||
|
||||
var styles = _StyleSheet.default.create({
|
||||
baseVertical: _objectSpread({}, commonStyle, {
|
||||
flexDirection: 'column',
|
||||
overflowX: 'hidden',
|
||||
overflowY: 'auto'
|
||||
}),
|
||||
baseHorizontal: _objectSpread({}, commonStyle, {
|
||||
flexDirection: 'row',
|
||||
overflowX: 'auto',
|
||||
overflowY: 'hidden'
|
||||
}),
|
||||
contentContainerHorizontal: {
|
||||
flexDirection: 'row'
|
||||
},
|
||||
stickyHeader: {
|
||||
position: 'sticky',
|
||||
top: 0,
|
||||
zIndex: 10
|
||||
},
|
||||
pagingEnabledHorizontal: {
|
||||
scrollSnapType: 'x mandatory'
|
||||
},
|
||||
pagingEnabledVertical: {
|
||||
scrollSnapType: 'y mandatory'
|
||||
},
|
||||
pagingEnabledChild: {
|
||||
scrollSnapAlign: 'start'
|
||||
}
|
||||
});
|
||||
|
||||
var _default = ScrollView;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
20
node_modules/react-native-web/dist/cjs/exports/SectionList/index.js
generated
vendored
Normal file
20
node_modules/react-native-web/dist/cjs/exports/SectionList/index.js
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _SectionList = _interopRequireDefault(require("../../vendor/react-native/SectionList"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
var _default = _SectionList.default;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
7
node_modules/react-native-web/dist/cjs/exports/Settings/index.js
generated
vendored
Normal file
7
node_modules/react-native-web/dist/cjs/exports/Settings/index.js
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
var _default = {};
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
66
node_modules/react-native-web/dist/cjs/exports/Share/index.js
generated
vendored
Normal file
66
node_modules/react-native-web/dist/cjs/exports/Share/index.js
generated
vendored
Normal file
@ -0,0 +1,66 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _invariant = _interopRequireDefault(require("fbjs/lib/invariant"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
var Share =
|
||||
/*#__PURE__*/
|
||||
function () {
|
||||
function Share() {}
|
||||
|
||||
Share.share = function share(content, options) {
|
||||
if (options === void 0) {
|
||||
options = {};
|
||||
}
|
||||
|
||||
(0, _invariant.default)(typeof content === 'object' && content !== null, 'Content to share must be a valid object');
|
||||
(0, _invariant.default)(typeof content.url === 'string' || typeof content.message === 'string', 'At least one of URL and message is required');
|
||||
(0, _invariant.default)(typeof options === 'object' && options !== null, 'Options must be a valid object');
|
||||
(0, _invariant.default)(!content.title || typeof content.title === 'string', 'Invalid title: title should be a string.');
|
||||
|
||||
if (window.navigator.share !== undefined) {
|
||||
return window.navigator.share({
|
||||
title: content.title,
|
||||
text: content.message,
|
||||
url: content.url
|
||||
});
|
||||
} else {
|
||||
return Promise.reject(new Error('Share is not supported in this browser'));
|
||||
}
|
||||
}
|
||||
/**
|
||||
* The content was successfully shared.
|
||||
*/
|
||||
;
|
||||
|
||||
_createClass(Share, null, [{
|
||||
key: "sharedAction",
|
||||
get: function get() {
|
||||
return 'sharedAction';
|
||||
}
|
||||
/**
|
||||
* The dialog has been dismissed.
|
||||
* @platform ios
|
||||
*/
|
||||
|
||||
}, {
|
||||
key: "dismissedAction",
|
||||
get: function get() {
|
||||
return 'dismissedAction';
|
||||
}
|
||||
}]);
|
||||
|
||||
return Share;
|
||||
}();
|
||||
|
||||
var _default = Share;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
27
node_modules/react-native-web/dist/cjs/exports/StatusBar/index.js
generated
vendored
Normal file
27
node_modules/react-native-web/dist/cjs/exports/StatusBar/index.js
generated
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
var emptyFunction = function emptyFunction() {};
|
||||
|
||||
function StatusBar() {
|
||||
return null;
|
||||
}
|
||||
|
||||
StatusBar.setBackgroundColor = emptyFunction;
|
||||
StatusBar.setBarStyle = emptyFunction;
|
||||
StatusBar.setHidden = emptyFunction;
|
||||
StatusBar.setNetworkActivityIndicatorVisible = emptyFunction;
|
||||
StatusBar.setTranslucent = emptyFunction;
|
||||
var _default = StatusBar;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
63
node_modules/react-native-web/dist/cjs/exports/StyleSheet/ReactNativePropRegistry.js
generated
vendored
Normal file
63
node_modules/react-native-web/dist/cjs/exports/StyleSheet/ReactNativePropRegistry.js
generated
vendored
Normal file
@ -0,0 +1,63 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
var emptyObject = {};
|
||||
var objects = {};
|
||||
var prefix = 'r';
|
||||
var uniqueID = 1;
|
||||
|
||||
var createKey = function createKey(id) {
|
||||
return prefix + "-" + id;
|
||||
};
|
||||
|
||||
var ReactNativePropRegistry =
|
||||
/*#__PURE__*/
|
||||
function () {
|
||||
function ReactNativePropRegistry() {}
|
||||
|
||||
ReactNativePropRegistry.register = function register(object) {
|
||||
var id = uniqueID++;
|
||||
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
Object.freeze(object);
|
||||
}
|
||||
|
||||
var key = createKey(id);
|
||||
objects[key] = object;
|
||||
return id;
|
||||
};
|
||||
|
||||
ReactNativePropRegistry.getByID = function getByID(id) {
|
||||
if (!id) {
|
||||
// Used in the style={[condition && id]} pattern,
|
||||
// we want it to be a no-op when the value is false or null
|
||||
return emptyObject;
|
||||
}
|
||||
|
||||
var key = createKey(id);
|
||||
var object = objects[key];
|
||||
|
||||
if (!object) {
|
||||
console.warn('Invalid style with id `' + id + '`. Skipping ...');
|
||||
return emptyObject;
|
||||
}
|
||||
|
||||
return object;
|
||||
};
|
||||
|
||||
return ReactNativePropRegistry;
|
||||
}();
|
||||
|
||||
exports.default = ReactNativePropRegistry;
|
||||
module.exports = exports.default;
|
77
node_modules/react-native-web/dist/cjs/exports/StyleSheet/StyleSheet.js
generated
vendored
Normal file
77
node_modules/react-native-web/dist/cjs/exports/StyleSheet/StyleSheet.js
generated
vendored
Normal file
@ -0,0 +1,77 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _ReactNativePropRegistry = _interopRequireDefault(require("./ReactNativePropRegistry"));
|
||||
|
||||
var _flattenStyle = _interopRequireDefault(require("./flattenStyle"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
var absoluteFillObject = {
|
||||
position: 'absolute',
|
||||
left: 0,
|
||||
right: 0,
|
||||
top: 0,
|
||||
bottom: 0
|
||||
};
|
||||
|
||||
var absoluteFill = _ReactNativePropRegistry.default.register(absoluteFillObject);
|
||||
|
||||
var StyleSheet = {
|
||||
absoluteFill: absoluteFill,
|
||||
absoluteFillObject: absoluteFillObject,
|
||||
compose: function compose(style1, style2) {
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
/* eslint-disable prefer-rest-params */
|
||||
var len = arguments.length;
|
||||
|
||||
if (len > 2) {
|
||||
var readableStyles = Array.prototype.slice.call(arguments).map(function (a) {
|
||||
return (0, _flattenStyle.default)(a);
|
||||
});
|
||||
throw new Error("StyleSheet.compose() only accepts 2 arguments, received " + len + ": " + JSON.stringify(readableStyles));
|
||||
}
|
||||
/* eslint-enable prefer-rest-params */
|
||||
|
||||
}
|
||||
|
||||
if (style1 && style2) {
|
||||
return [style1, style2];
|
||||
} else {
|
||||
return style1 || style2;
|
||||
}
|
||||
},
|
||||
create: function create(styles) {
|
||||
var result = {};
|
||||
Object.keys(styles).forEach(function (key) {
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
var validate = require('./validate');
|
||||
|
||||
var interopValidate = validate.default ? validate.default : validate;
|
||||
interopValidate(key, styles);
|
||||
}
|
||||
|
||||
var id = styles[key] && _ReactNativePropRegistry.default.register(styles[key]);
|
||||
|
||||
result[key] = id;
|
||||
});
|
||||
return result;
|
||||
},
|
||||
flatten: _flattenStyle.default,
|
||||
// `hairlineWidth` is not implemented using screen density as browsers may
|
||||
// round sub-pixel values down to `0`, causing the line not to be rendered.
|
||||
hairlineWidth: 1
|
||||
};
|
||||
var _default = StyleSheet;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
326
node_modules/react-native-web/dist/cjs/exports/StyleSheet/compile.js
generated
vendored
Normal file
326
node_modules/react-native-web/dist/cjs/exports/StyleSheet/compile.js
generated
vendored
Normal file
@ -0,0 +1,326 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.atomic = atomic;
|
||||
exports.classic = classic;
|
||||
exports.inline = inline;
|
||||
exports.stringifyValueWithProperty = stringifyValueWithProperty;
|
||||
|
||||
var _createReactDOMStyle = _interopRequireDefault(require("./createReactDOMStyle"));
|
||||
|
||||
var _hash = _interopRequireDefault(require("../../vendor/hash"));
|
||||
|
||||
var _hyphenateStyleName = _interopRequireDefault(require("hyphenate-style-name"));
|
||||
|
||||
var _normalizeValueWithProperty = _interopRequireDefault(require("./normalizeValueWithProperty"));
|
||||
|
||||
var _prefixStyles = _interopRequireWildcard(require("../../modules/prefixStyles"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
||||
|
||||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
||||
|
||||
var cache = {
|
||||
get: function get(property, value) {
|
||||
if (cache[property] != null && cache[property].hasOwnProperty(value) && cache[property][value] != null) {
|
||||
return cache[property][value];
|
||||
}
|
||||
},
|
||||
set: function set(property, value, object) {
|
||||
if (cache[property] == null) {
|
||||
cache[property] = {};
|
||||
}
|
||||
|
||||
return cache[property][value] = object;
|
||||
}
|
||||
};
|
||||
/**
|
||||
* Compile style to atomic CSS rules.
|
||||
*/
|
||||
|
||||
function atomic(style) {
|
||||
return Object.keys(style).sort().reduce(function (acc, property) {
|
||||
var value = style[property];
|
||||
|
||||
if (value != null) {
|
||||
var valueString = stringifyValueWithProperty(value, property);
|
||||
var cachedResult = cache.get(property, valueString);
|
||||
|
||||
if (cachedResult != null) {
|
||||
var identifier = cachedResult.identifier;
|
||||
acc[identifier] = cachedResult;
|
||||
} else {
|
||||
var _identifier = createIdentifier('r', property, value);
|
||||
|
||||
var rules = createAtomicRules(_identifier, property, value);
|
||||
|
||||
var _cachedResult = cache.set(property, valueString, {
|
||||
property: property,
|
||||
value: stringifyValueWithProperty(value, property),
|
||||
identifier: _identifier,
|
||||
rules: rules
|
||||
});
|
||||
|
||||
acc[_identifier] = _cachedResult;
|
||||
}
|
||||
}
|
||||
|
||||
return acc;
|
||||
}, {});
|
||||
}
|
||||
/**
|
||||
* Compile simple style object to classic CSS rules.
|
||||
* No support for 'placeholderTextColor', 'scrollbarWidth', or 'pointerEvents'.
|
||||
*/
|
||||
|
||||
|
||||
function classic(style, name) {
|
||||
var _ref;
|
||||
|
||||
var identifier = createIdentifier('css', name, style);
|
||||
|
||||
var animationKeyframes = style.animationKeyframes,
|
||||
rest = _objectWithoutPropertiesLoose(style, ["animationKeyframes"]);
|
||||
|
||||
var rules = [];
|
||||
var selector = "." + identifier;
|
||||
var animationName;
|
||||
|
||||
if (animationKeyframes != null) {
|
||||
var _processKeyframesValu = processKeyframesValue(animationKeyframes),
|
||||
animationNames = _processKeyframesValu.animationNames,
|
||||
keyframesRules = _processKeyframesValu.rules;
|
||||
|
||||
animationName = animationNames.join(',');
|
||||
rules.push.apply(rules, keyframesRules);
|
||||
}
|
||||
|
||||
var block = createDeclarationBlock(_objectSpread({}, rest, {
|
||||
animationName: animationName
|
||||
}));
|
||||
rules.push("" + selector + block);
|
||||
return _ref = {}, _ref[identifier] = {
|
||||
identifier: identifier,
|
||||
rules: rules
|
||||
}, _ref;
|
||||
}
|
||||
/**
|
||||
* Compile simple style object to inline DOM styles.
|
||||
* No support for 'animationKeyframes', 'placeholderTextColor', 'scrollbarWidth', or 'pointerEvents'.
|
||||
*/
|
||||
|
||||
|
||||
function inline(style) {
|
||||
return (0, _prefixStyles.prefixInlineStyles)((0, _createReactDOMStyle.default)(style));
|
||||
}
|
||||
/**
|
||||
* Create a value string that normalizes different input values with a common
|
||||
* output.
|
||||
*/
|
||||
|
||||
|
||||
function stringifyValueWithProperty(value, property) {
|
||||
// e.g., 0 => '0px', 'black' => 'rgba(0,0,0,1)'
|
||||
var normalizedValue = (0, _normalizeValueWithProperty.default)(value, property);
|
||||
return typeof normalizedValue !== 'string' ? JSON.stringify(normalizedValue || '') : normalizedValue;
|
||||
}
|
||||
/**
|
||||
* Create the Atomic CSS rules needed for a given StyleSheet rule.
|
||||
* Translates StyleSheet declarations to CSS.
|
||||
*/
|
||||
|
||||
|
||||
function createAtomicRules(identifier, property, value) {
|
||||
var rules = [];
|
||||
var selector = "." + identifier; // Handle non-standard properties and object values that require multiple
|
||||
// CSS rules to be created.
|
||||
|
||||
switch (property) {
|
||||
case 'animationKeyframes':
|
||||
{
|
||||
var _processKeyframesValu2 = processKeyframesValue(value),
|
||||
animationNames = _processKeyframesValu2.animationNames,
|
||||
keyframesRules = _processKeyframesValu2.rules;
|
||||
|
||||
var block = createDeclarationBlock({
|
||||
animationName: animationNames.join(',')
|
||||
});
|
||||
rules.push.apply(rules, ["" + selector + block].concat(keyframesRules));
|
||||
break;
|
||||
}
|
||||
// Equivalent to using '::placeholder'
|
||||
|
||||
case 'placeholderTextColor':
|
||||
{
|
||||
var _block = createDeclarationBlock({
|
||||
color: value,
|
||||
opacity: 1
|
||||
});
|
||||
|
||||
rules.push(selector + "::-webkit-input-placeholder" + _block, selector + "::-moz-placeholder" + _block, selector + ":-ms-input-placeholder" + _block, selector + "::placeholder" + _block);
|
||||
break;
|
||||
}
|
||||
// Polyfill for additional 'pointer-events' values
|
||||
// See d13f78622b233a0afc0c7a200c0a0792c8ca9e58
|
||||
|
||||
case 'pointerEvents':
|
||||
{
|
||||
var _createDeclarationBlo3;
|
||||
|
||||
var finalValue = value;
|
||||
|
||||
if (value === 'auto' || value === 'box-only') {
|
||||
finalValue = 'auto!important';
|
||||
|
||||
if (value === 'box-only') {
|
||||
var _createDeclarationBlo;
|
||||
|
||||
var _block3 = createDeclarationBlock((_createDeclarationBlo = {}, _createDeclarationBlo[property] = 'none', _createDeclarationBlo));
|
||||
|
||||
rules.push(selector + ">*" + _block3);
|
||||
}
|
||||
} else if (value === 'none' || value === 'box-none') {
|
||||
finalValue = 'none!important';
|
||||
|
||||
if (value === 'box-none') {
|
||||
var _createDeclarationBlo2;
|
||||
|
||||
var _block4 = createDeclarationBlock((_createDeclarationBlo2 = {}, _createDeclarationBlo2[property] = 'auto', _createDeclarationBlo2));
|
||||
|
||||
rules.push(selector + ">*" + _block4);
|
||||
}
|
||||
}
|
||||
|
||||
var _block2 = createDeclarationBlock((_createDeclarationBlo3 = {}, _createDeclarationBlo3[property] = finalValue, _createDeclarationBlo3));
|
||||
|
||||
rules.push("" + selector + _block2);
|
||||
break;
|
||||
}
|
||||
// Polyfill for draft spec
|
||||
// https://drafts.csswg.org/css-scrollbars-1/
|
||||
|
||||
case 'scrollbarWidth':
|
||||
{
|
||||
var _createDeclarationBlo4;
|
||||
|
||||
if (value === 'none') {
|
||||
rules.push(selector + "::-webkit-scrollbar{display:none}");
|
||||
}
|
||||
|
||||
var _block5 = createDeclarationBlock((_createDeclarationBlo4 = {}, _createDeclarationBlo4[property] = value, _createDeclarationBlo4));
|
||||
|
||||
rules.push("" + selector + _block5);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
var _createDeclarationBlo5;
|
||||
|
||||
var _block6 = createDeclarationBlock((_createDeclarationBlo5 = {}, _createDeclarationBlo5[property] = value, _createDeclarationBlo5));
|
||||
|
||||
rules.push("" + selector + _block6);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return rules;
|
||||
}
|
||||
/**
|
||||
* Creates a CSS declaration block from a StyleSheet object.
|
||||
*/
|
||||
|
||||
|
||||
function createDeclarationBlock(style) {
|
||||
var domStyle = (0, _prefixStyles.default)((0, _createReactDOMStyle.default)(style));
|
||||
var declarationsString = Object.keys(domStyle).map(function (property) {
|
||||
var value = domStyle[property];
|
||||
var prop = (0, _hyphenateStyleName.default)(property); // The prefixer may return an array of values:
|
||||
// { display: [ '-webkit-flex', 'flex' ] }
|
||||
// to represent "fallback" declarations
|
||||
// { display: -webkit-flex; display: flex; }
|
||||
|
||||
if (Array.isArray(value)) {
|
||||
return value.map(function (v) {
|
||||
return prop + ":" + v;
|
||||
}).join(';');
|
||||
} else {
|
||||
return prop + ":" + value;
|
||||
}
|
||||
}) // Once properties are hyphenated, this will put the vendor
|
||||
// prefixed and short-form properties first in the list.
|
||||
.sort().join(';');
|
||||
return "{" + declarationsString + ";}";
|
||||
}
|
||||
/**
|
||||
* An identifier is associated with a unique set of styles.
|
||||
*/
|
||||
|
||||
|
||||
function createIdentifier(prefix, name, value) {
|
||||
var hashedString = (0, _hash.default)(name + stringifyValueWithProperty(value, name));
|
||||
return process.env.NODE_ENV !== 'production' ? prefix + "-" + name + "-" + hashedString : prefix + "-" + hashedString;
|
||||
}
|
||||
/**
|
||||
* Create individual CSS keyframes rules.
|
||||
*/
|
||||
|
||||
|
||||
function createKeyframes(keyframes) {
|
||||
var prefixes = ['-webkit-', ''];
|
||||
var identifier = createIdentifier('r', 'animation', keyframes);
|
||||
var steps = '{' + Object.keys(keyframes).map(function (stepName) {
|
||||
var rule = keyframes[stepName];
|
||||
var block = createDeclarationBlock(rule);
|
||||
return "" + stepName + block;
|
||||
}).join('') + '}';
|
||||
var rules = prefixes.map(function (prefix) {
|
||||
return "@" + prefix + "keyframes " + identifier + steps;
|
||||
});
|
||||
return {
|
||||
identifier: identifier,
|
||||
rules: rules
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Create CSS keyframes rules and names from a StyleSheet keyframes object.
|
||||
*/
|
||||
|
||||
|
||||
function processKeyframesValue(keyframesValue) {
|
||||
if (typeof keyframesValue === 'number') {
|
||||
throw new Error("Invalid CSS keyframes type: " + typeof keyframesValue);
|
||||
}
|
||||
|
||||
var animationNames = [];
|
||||
var rules = [];
|
||||
var value = Array.isArray(keyframesValue) ? keyframesValue : [keyframesValue];
|
||||
value.forEach(function (keyframes) {
|
||||
if (typeof keyframes === 'string') {
|
||||
// Support external animation libraries (identifiers only)
|
||||
animationNames.push(keyframes);
|
||||
} else {
|
||||
// Create rules for each of the keyframes
|
||||
var _createKeyframes = createKeyframes(keyframes),
|
||||
identifier = _createKeyframes.identifier,
|
||||
keyframesRules = _createKeyframes.rules;
|
||||
|
||||
animationNames.push(identifier);
|
||||
rules.push.apply(rules, keyframesRules);
|
||||
}
|
||||
});
|
||||
return {
|
||||
animationNames: animationNames,
|
||||
rules: rules
|
||||
};
|
||||
}
|
58
node_modules/react-native-web/dist/cjs/exports/StyleSheet/constants.js
generated
vendored
Normal file
58
node_modules/react-native-web/dist/cjs/exports/StyleSheet/constants.js
generated
vendored
Normal file
@ -0,0 +1,58 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.SYSTEM_FONT_STACK = exports.MONOSPACE_FONT_STACK = exports.STYLE_SHORT_FORM_EXPANSIONS = exports.STYLE_GROUPS = exports.STYLE_ELEMENT_ID = void 0;
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
var STYLE_ELEMENT_ID = 'react-native-stylesheet';
|
||||
exports.STYLE_ELEMENT_ID = STYLE_ELEMENT_ID;
|
||||
var STYLE_GROUPS = {
|
||||
reset: 0,
|
||||
modality: 0.1,
|
||||
classicReset: 0.5,
|
||||
classic: 1,
|
||||
atomic: 2.2,
|
||||
custom: {
|
||||
borderColor: 2,
|
||||
borderRadius: 2,
|
||||
borderStyle: 2,
|
||||
borderWidth: 2,
|
||||
display: 2,
|
||||
flex: 2,
|
||||
margin: 2,
|
||||
overflow: 2,
|
||||
overscrollBehavior: 2,
|
||||
padding: 2,
|
||||
marginHorizontal: 2.1,
|
||||
marginVertical: 2.1,
|
||||
paddingHorizontal: 2.1,
|
||||
paddingVertical: 2.1
|
||||
}
|
||||
};
|
||||
exports.STYLE_GROUPS = STYLE_GROUPS;
|
||||
var STYLE_SHORT_FORM_EXPANSIONS = {
|
||||
borderColor: ['borderTopColor', 'borderRightColor', 'borderBottomColor', 'borderLeftColor'],
|
||||
borderRadius: ['borderTopLeftRadius', 'borderTopRightRadius', 'borderBottomRightRadius', 'borderBottomLeftRadius'],
|
||||
borderStyle: ['borderTopStyle', 'borderRightStyle', 'borderBottomStyle', 'borderLeftStyle'],
|
||||
borderWidth: ['borderTopWidth', 'borderRightWidth', 'borderBottomWidth', 'borderLeftWidth'],
|
||||
margin: ['marginTop', 'marginRight', 'marginBottom', 'marginLeft'],
|
||||
marginHorizontal: ['marginRight', 'marginLeft'],
|
||||
marginVertical: ['marginTop', 'marginBottom'],
|
||||
overflow: ['overflowX', 'overflowY'],
|
||||
overscrollBehavior: ['overscrollBehaviorX', 'overscrollBehaviorY'],
|
||||
padding: ['paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft'],
|
||||
paddingHorizontal: ['paddingRight', 'paddingLeft'],
|
||||
paddingVertical: ['paddingTop', 'paddingBottom']
|
||||
};
|
||||
exports.STYLE_SHORT_FORM_EXPANSIONS = STYLE_SHORT_FORM_EXPANSIONS;
|
||||
var MONOSPACE_FONT_STACK = 'monospace,monospace';
|
||||
exports.MONOSPACE_FONT_STACK = MONOSPACE_FONT_STACK;
|
||||
var SYSTEM_FONT_STACK = '-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif';
|
||||
exports.SYSTEM_FONT_STACK = SYSTEM_FONT_STACK;
|
42
node_modules/react-native-web/dist/cjs/exports/StyleSheet/createCSSStyleSheet.js
generated
vendored
Normal file
42
node_modules/react-native-web/dist/cjs/exports/StyleSheet/createCSSStyleSheet.js
generated
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = createCSSStyleSheet;
|
||||
|
||||
var _ExecutionEnvironment = require("fbjs/lib/ExecutionEnvironment");
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
// $FlowFixMe: HTMLStyleElement is incorrectly typed - https://github.com/facebook/flow/issues/2696
|
||||
function createCSSStyleSheet(id) {
|
||||
if (_ExecutionEnvironment.canUseDOM) {
|
||||
var element = document.getElementById(id);
|
||||
|
||||
if (element != null) {
|
||||
// $FlowFixMe: HTMLElement is incorrectly typed
|
||||
return element.sheet;
|
||||
} else {
|
||||
var _element = document.createElement('style');
|
||||
|
||||
_element.setAttribute('id', id);
|
||||
|
||||
var head = document.head;
|
||||
|
||||
if (head) {
|
||||
head.insertBefore(_element, head.firstChild);
|
||||
}
|
||||
|
||||
return _element.sheet;
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = exports.default;
|
71
node_modules/react-native-web/dist/cjs/exports/StyleSheet/createCompileableStyle.js
generated
vendored
Normal file
71
node_modules/react-native-web/dist/cjs/exports/StyleSheet/createCompileableStyle.js
generated
vendored
Normal file
@ -0,0 +1,71 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _normalizeValueWithProperty = _interopRequireDefault(require("./normalizeValueWithProperty"));
|
||||
|
||||
var _resolveShadowValue = _interopRequireDefault(require("./resolveShadowValue"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
||||
|
||||
var defaultOffset = {
|
||||
height: 0,
|
||||
width: 0
|
||||
};
|
||||
|
||||
function boxShadowReducer(resolvedStyle, style) {
|
||||
var boxShadow = style.boxShadow;
|
||||
var shadow = (0, _resolveShadowValue.default)(style);
|
||||
|
||||
if (shadow != null) {
|
||||
resolvedStyle.boxShadow = boxShadow ? boxShadow + ", " + shadow : shadow;
|
||||
}
|
||||
}
|
||||
|
||||
function textShadowReducer(resolvedStyle, style) {
|
||||
var textShadowColor = style.textShadowColor,
|
||||
textShadowOffset = style.textShadowOffset,
|
||||
textShadowRadius = style.textShadowRadius;
|
||||
|
||||
var _ref = textShadowOffset || defaultOffset,
|
||||
height = _ref.height,
|
||||
width = _ref.width;
|
||||
|
||||
var radius = textShadowRadius || 0;
|
||||
var offsetX = (0, _normalizeValueWithProperty.default)(width);
|
||||
var offsetY = (0, _normalizeValueWithProperty.default)(height);
|
||||
var blurRadius = (0, _normalizeValueWithProperty.default)(radius);
|
||||
var color = (0, _normalizeValueWithProperty.default)(textShadowColor, 'textShadowColor');
|
||||
|
||||
if (color && (height !== 0 || width !== 0 || radius !== 0) && offsetX != null && offsetY != null && blurRadius != null) {
|
||||
resolvedStyle.textShadow = offsetX + " " + offsetY + " " + blurRadius + " " + color;
|
||||
}
|
||||
}
|
||||
|
||||
var createCompileableStyle = function createCompileableStyle(styles) {
|
||||
var shadowColor = styles.shadowColor,
|
||||
shadowOffset = styles.shadowOffset,
|
||||
shadowOpacity = styles.shadowOpacity,
|
||||
shadowRadius = styles.shadowRadius,
|
||||
textShadowColor = styles.textShadowColor,
|
||||
textShadowOffset = styles.textShadowOffset,
|
||||
textShadowRadius = styles.textShadowRadius,
|
||||
nextStyles = _objectWithoutPropertiesLoose(styles, ["shadowColor", "shadowOffset", "shadowOpacity", "shadowRadius", "textShadowColor", "textShadowOffset", "textShadowRadius"]);
|
||||
|
||||
if (shadowColor != null || shadowOffset != null || shadowOpacity != null || shadowRadius != null) {
|
||||
boxShadowReducer(nextStyles, styles);
|
||||
}
|
||||
|
||||
if (textShadowColor != null || textShadowOffset != null || textShadowRadius != null) {
|
||||
textShadowReducer(nextStyles, styles);
|
||||
}
|
||||
|
||||
return nextStyles;
|
||||
};
|
||||
|
||||
var _default = createCompileableStyle;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
178
node_modules/react-native-web/dist/cjs/exports/StyleSheet/createOrderedCSSStyleSheet.js
generated
vendored
Normal file
178
node_modules/react-native-web/dist/cjs/exports/StyleSheet/createOrderedCSSStyleSheet.js
generated
vendored
Normal file
@ -0,0 +1,178 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = createOrderedCSSStyleSheet;
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
var slice = Array.prototype.slice;
|
||||
/**
|
||||
* Order-based insertion of CSS.
|
||||
*
|
||||
* Each rule is associated with a numerically defined group.
|
||||
* Groups are ordered within the style sheet according to their number, with the
|
||||
* lowest first.
|
||||
*
|
||||
* Groups are implemented using marker rules. The selector of the first rule of
|
||||
* each group is used only to encode the group number for hydration. An
|
||||
* alternative implementation could rely on CSSMediaRule, allowing groups to be
|
||||
* treated as a sub-sheet, but the Edge implementation of CSSMediaRule is
|
||||
* broken.
|
||||
* https://developer.mozilla.org/en-US/docs/Web/API/CSSMediaRule
|
||||
* https://gist.github.com/necolas/aa0c37846ad6bd3b05b727b959e82674
|
||||
*/
|
||||
|
||||
function createOrderedCSSStyleSheet(sheet) {
|
||||
var groups = {};
|
||||
var selectors = {};
|
||||
/**
|
||||
* Hydrate approximate record from any existing rules in the sheet.
|
||||
*/
|
||||
|
||||
if (sheet != null) {
|
||||
var group;
|
||||
slice.call(sheet.cssRules).forEach(function (cssRule, i) {
|
||||
var cssText = cssRule.cssText; // Create record of existing selectors and rules
|
||||
|
||||
if (cssText.indexOf('stylesheet-group') > -1) {
|
||||
group = decodeGroupRule(cssRule);
|
||||
groups[group] = {
|
||||
start: i,
|
||||
rules: [cssText]
|
||||
};
|
||||
} else {
|
||||
var selectorText = getSelectorText(cssText);
|
||||
|
||||
if (selectorText != null) {
|
||||
selectors[selectorText] = true;
|
||||
groups[group].rules.push(cssText);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function sheetInsert(sheet, group, text) {
|
||||
var orderedGroups = getOrderedGroups(groups);
|
||||
var groupIndex = orderedGroups.indexOf(group);
|
||||
var nextGroupIndex = groupIndex + 1;
|
||||
var nextGroup = orderedGroups[nextGroupIndex]; // Insert rule before the next group, or at the end of the stylesheet
|
||||
|
||||
var position = nextGroup != null && groups[nextGroup].start != null ? groups[nextGroup].start : sheet.cssRules.length;
|
||||
var isInserted = insertRuleAt(sheet, text, position);
|
||||
|
||||
if (isInserted) {
|
||||
// Set the starting index of the new group
|
||||
if (groups[group].start == null) {
|
||||
groups[group].start = position;
|
||||
} // Increment the starting index of all subsequent groups
|
||||
|
||||
|
||||
for (var i = nextGroupIndex; i < orderedGroups.length; i += 1) {
|
||||
var groupNumber = orderedGroups[i];
|
||||
var previousStart = groups[groupNumber].start;
|
||||
groups[groupNumber].start = previousStart + 1;
|
||||
}
|
||||
}
|
||||
|
||||
return isInserted;
|
||||
}
|
||||
|
||||
var OrderedCSSStyleSheet = {
|
||||
/**
|
||||
* The textContent of the style sheet.
|
||||
*/
|
||||
getTextContent: function getTextContent() {
|
||||
return getOrderedGroups(groups).map(function (group) {
|
||||
var rules = groups[group].rules;
|
||||
return rules.join('\n');
|
||||
}).join('\n');
|
||||
},
|
||||
|
||||
/**
|
||||
* Insert a rule into the style sheet
|
||||
*/
|
||||
insert: function insert(cssText, groupValue) {
|
||||
var group = Number(groupValue); // Create a new group.
|
||||
|
||||
if (groups[group] == null) {
|
||||
var markerRule = encodeGroupRule(group); // Create the internal record.
|
||||
|
||||
groups[group] = {
|
||||
start: null,
|
||||
rules: [markerRule]
|
||||
}; // Update CSSOM.
|
||||
|
||||
if (sheet != null) {
|
||||
sheetInsert(sheet, group, markerRule);
|
||||
}
|
||||
} // selectorText is more reliable than cssText for insertion checks. The
|
||||
// browser excludes vendor-prefixed properties and rewrites certain values
|
||||
// making cssText more likely to be different from what was inserted.
|
||||
|
||||
|
||||
var selectorText = getSelectorText(cssText);
|
||||
|
||||
if (selectorText != null && selectors[selectorText] == null) {
|
||||
// Update the internal records.
|
||||
selectors[selectorText] = true;
|
||||
groups[group].rules.push(cssText); // Update CSSOM.
|
||||
|
||||
if (sheet != null) {
|
||||
var isInserted = sheetInsert(sheet, group, cssText);
|
||||
|
||||
if (!isInserted) {
|
||||
// Revert internal record change if a rule was rejected (e.g.,
|
||||
// unrecognized pseudo-selector)
|
||||
groups[group].rules.pop();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
return OrderedCSSStyleSheet;
|
||||
}
|
||||
/**
|
||||
* Helper functions
|
||||
*/
|
||||
|
||||
|
||||
function encodeGroupRule(group) {
|
||||
return "[stylesheet-group=\"" + group + "\"]{}";
|
||||
}
|
||||
|
||||
function decodeGroupRule(cssRule) {
|
||||
return Number(cssRule.selectorText.split(/["']/)[1]);
|
||||
}
|
||||
|
||||
function getOrderedGroups(obj) {
|
||||
return Object.keys(obj).map(Number).sort(function (a, b) {
|
||||
return a > b ? 1 : -1;
|
||||
});
|
||||
}
|
||||
|
||||
var pattern = /\s*([,])\s*/g;
|
||||
|
||||
function getSelectorText(cssText) {
|
||||
var selector = cssText.split('{')[0].trim();
|
||||
return selector !== '' ? selector.replace(pattern, '$1') : null;
|
||||
}
|
||||
|
||||
function insertRuleAt(root, cssText, position) {
|
||||
try {
|
||||
// $FlowFixMe: Flow is missing CSSOM types needed to type 'root'.
|
||||
root.insertRule(cssText, position);
|
||||
return true;
|
||||
} catch (e) {
|
||||
// JSDOM doesn't support `CSSSMediaRule#insertRule`.
|
||||
// Also ignore errors that occur from attempting to insert vendor-prefixed selectors.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = exports.default;
|
211
node_modules/react-native-web/dist/cjs/exports/StyleSheet/createReactDOMStyle.js
generated
vendored
Normal file
211
node_modules/react-native-web/dist/cjs/exports/StyleSheet/createReactDOMStyle.js
generated
vendored
Normal file
@ -0,0 +1,211 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _ExecutionEnvironment = require("fbjs/lib/ExecutionEnvironment");
|
||||
|
||||
var _constants = require("./constants");
|
||||
|
||||
var _normalizeValueWithProperty = _interopRequireDefault(require("./normalizeValueWithProperty"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* The browser implements the CSS cascade, where the order of properties is a
|
||||
* factor in determining which styles to paint. React Native is different. It
|
||||
* gives giving precedence to the more specific style property. For example,
|
||||
* the value of `paddingTop` takes precedence over that of `padding`.
|
||||
*
|
||||
* This module creates mutally exclusive style declarations by expanding all of
|
||||
* React Native's supported shortform properties (e.g. `padding`) to their
|
||||
* longfrom equivalents.
|
||||
*/
|
||||
var emptyObject = {};
|
||||
var supportsCSS3TextDecoration = !_ExecutionEnvironment.canUseDOM || window.CSS != null && window.CSS.supports != null && (window.CSS.supports('text-decoration-line', 'none') || window.CSS.supports('-webkit-text-decoration-line', 'none'));
|
||||
/**
|
||||
* Transform
|
||||
*/
|
||||
// { scale: 2 } => 'scale(2)'
|
||||
// { translateX: 20 } => 'translateX(20px)'
|
||||
|
||||
var mapTransform = function mapTransform(transform) {
|
||||
var type = Object.keys(transform)[0];
|
||||
var value = (0, _normalizeValueWithProperty.default)(transform[type], type);
|
||||
return type + "(" + value + ")";
|
||||
}; // [1,2,3,4,5,6] => 'matrix3d(1,2,3,4,5,6)'
|
||||
|
||||
|
||||
var convertTransformMatrix = function convertTransformMatrix(transformMatrix) {
|
||||
var matrix = transformMatrix.join(',');
|
||||
return "matrix3d(" + matrix + ")";
|
||||
};
|
||||
|
||||
var resolveTransform = function resolveTransform(resolvedStyle, style) {
|
||||
var transform = style.transform;
|
||||
|
||||
if (Array.isArray(style.transform)) {
|
||||
transform = style.transform.map(mapTransform).join(' ');
|
||||
} else if (style.transformMatrix) {
|
||||
transform = convertTransformMatrix(style.transformMatrix);
|
||||
}
|
||||
|
||||
resolvedStyle.transform = transform;
|
||||
};
|
||||
/**
|
||||
* Reducer
|
||||
*/
|
||||
|
||||
|
||||
var createReactDOMStyle = function createReactDOMStyle(style) {
|
||||
if (!style) {
|
||||
return emptyObject;
|
||||
}
|
||||
|
||||
var resolvedStyle = {};
|
||||
Object.keys(style).sort().forEach(function (prop) {
|
||||
var value = (0, _normalizeValueWithProperty.default)(style[prop], prop); // Ignore everything else with a null value
|
||||
|
||||
if (value == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (prop) {
|
||||
// Ignore some React Native styles
|
||||
case 'aspectRatio':
|
||||
case 'elevation':
|
||||
case 'overlayColor':
|
||||
case 'resizeMode':
|
||||
case 'tintColor':
|
||||
{
|
||||
break;
|
||||
}
|
||||
// TODO: remove once this issue is fixed
|
||||
// https://github.com/rofrischmann/inline-style-prefixer/issues/159
|
||||
|
||||
case 'backgroundClip':
|
||||
{
|
||||
if (value === 'text') {
|
||||
resolvedStyle.backgroundClip = value;
|
||||
resolvedStyle.WebkitBackgroundClip = value;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
// The 'flex' property value in React Native must be a positive integer,
|
||||
// 0, or -1.
|
||||
|
||||
case 'flex':
|
||||
{
|
||||
if (value > 0) {
|
||||
resolvedStyle.flexGrow = value;
|
||||
resolvedStyle.flexShrink = 1;
|
||||
resolvedStyle.flexBasis = '0%';
|
||||
} else if (value === 0) {
|
||||
resolvedStyle.flexGrow = 0;
|
||||
resolvedStyle.flexShrink = 0;
|
||||
resolvedStyle.flexBasis = '0%';
|
||||
} else if (value === -1) {
|
||||
resolvedStyle.flexGrow = 0;
|
||||
resolvedStyle.flexShrink = 1;
|
||||
resolvedStyle.flexBasis = 'auto';
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case 'font':
|
||||
{
|
||||
resolvedStyle[prop] = value.replace('System', _constants.SYSTEM_FONT_STACK);
|
||||
break;
|
||||
}
|
||||
|
||||
case 'fontFamily':
|
||||
{
|
||||
if (value.indexOf('System') > -1) {
|
||||
var stack = value.split(/,\s*/);
|
||||
stack[stack.indexOf('System')] = _constants.SYSTEM_FONT_STACK;
|
||||
resolvedStyle[prop] = stack.join(',');
|
||||
} else if (value === 'monospace') {
|
||||
resolvedStyle[prop] = _constants.MONOSPACE_FONT_STACK;
|
||||
} else {
|
||||
resolvedStyle[prop] = value;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case 'fontVariant':
|
||||
{
|
||||
if (Array.isArray(value) && value.length > 0) {
|
||||
resolvedStyle.fontVariant = value.join(' ');
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case 'textAlignVertical':
|
||||
{
|
||||
resolvedStyle.verticalAlign = value === 'center' ? 'middle' : value;
|
||||
break;
|
||||
}
|
||||
|
||||
case 'textDecorationLine':
|
||||
{
|
||||
// use 'text-decoration' for browsers that only support CSS2
|
||||
// text-decoration (e.g., IE, Edge)
|
||||
if (!supportsCSS3TextDecoration) {
|
||||
resolvedStyle.textDecoration = value;
|
||||
} else {
|
||||
resolvedStyle.textDecorationLine = value;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case 'transform':
|
||||
case 'transformMatrix':
|
||||
{
|
||||
resolveTransform(resolvedStyle, style);
|
||||
break;
|
||||
}
|
||||
|
||||
case 'writingDirection':
|
||||
{
|
||||
resolvedStyle.direction = value;
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
var longFormProperties = _constants.STYLE_SHORT_FORM_EXPANSIONS[prop];
|
||||
|
||||
if (longFormProperties) {
|
||||
longFormProperties.forEach(function (longForm, i) {
|
||||
// The value of any longform property in the original styles takes
|
||||
// precedence over the shortform's value.
|
||||
if (typeof style[longForm] === 'undefined') {
|
||||
resolvedStyle[longForm] = value;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
resolvedStyle[prop] = Array.isArray(value) ? value.join(',') : value;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
return resolvedStyle;
|
||||
};
|
||||
|
||||
var _default = createReactDOMStyle;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
305
node_modules/react-native-web/dist/cjs/exports/StyleSheet/createStyleResolver.js
generated
vendored
Normal file
305
node_modules/react-native-web/dist/cjs/exports/StyleSheet/createStyleResolver.js
generated
vendored
Normal file
@ -0,0 +1,305 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = createStyleResolver;
|
||||
|
||||
var _ExecutionEnvironment = require("fbjs/lib/ExecutionEnvironment");
|
||||
|
||||
var _createCSSStyleSheet = _interopRequireDefault(require("./createCSSStyleSheet"));
|
||||
|
||||
var _createCompileableStyle = _interopRequireDefault(require("./createCompileableStyle"));
|
||||
|
||||
var _createOrderedCSSStyleSheet = _interopRequireDefault(require("./createOrderedCSSStyleSheet"));
|
||||
|
||||
var _flattenArray = _interopRequireDefault(require("../../modules/flattenArray"));
|
||||
|
||||
var _flattenStyle = _interopRequireDefault(require("./flattenStyle"));
|
||||
|
||||
var _I18nManager = _interopRequireDefault(require("../I18nManager"));
|
||||
|
||||
var _i18nStyle = _interopRequireDefault(require("./i18nStyle"));
|
||||
|
||||
var _compile = require("./compile");
|
||||
|
||||
var _initialRules = _interopRequireDefault(require("./initialRules"));
|
||||
|
||||
var _modality = _interopRequireDefault(require("./modality"));
|
||||
|
||||
var _constants = require("./constants");
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* WARNING: changes to this file in particular can cause significant changes to
|
||||
* the results of render performance benchmarks.
|
||||
*/
|
||||
function createStyleResolver() {
|
||||
var inserted, sheet, cache;
|
||||
var resolved = {
|
||||
css: {},
|
||||
ltr: {},
|
||||
rtl: {},
|
||||
rtlNoSwap: {}
|
||||
};
|
||||
|
||||
var init = function init() {
|
||||
inserted = {
|
||||
css: {},
|
||||
ltr: {},
|
||||
rtl: {},
|
||||
rtlNoSwap: {}
|
||||
};
|
||||
sheet = (0, _createOrderedCSSStyleSheet.default)((0, _createCSSStyleSheet.default)(_constants.STYLE_ELEMENT_ID));
|
||||
cache = {};
|
||||
(0, _modality.default)(function (rule) {
|
||||
return sheet.insert(rule, _constants.STYLE_GROUPS.modality);
|
||||
});
|
||||
|
||||
_initialRules.default.forEach(function (rule) {
|
||||
sheet.insert(rule, _constants.STYLE_GROUPS.reset);
|
||||
});
|
||||
};
|
||||
|
||||
init();
|
||||
|
||||
function addToCache(className, prop, value) {
|
||||
if (!cache[prop]) {
|
||||
cache[prop] = {};
|
||||
}
|
||||
|
||||
cache[prop][value] = className;
|
||||
}
|
||||
|
||||
function getClassName(prop, value) {
|
||||
var val = (0, _compile.stringifyValueWithProperty)(value, prop);
|
||||
return cache[prop] && cache[prop].hasOwnProperty(val) && cache[prop][val];
|
||||
}
|
||||
|
||||
function _injectRegisteredStyle(id) {
|
||||
var doLeftAndRightSwapInRTL = _I18nManager.default.doLeftAndRightSwapInRTL,
|
||||
isRTL = _I18nManager.default.isRTL;
|
||||
var dir = isRTL ? doLeftAndRightSwapInRTL ? 'rtl' : 'rtlNoSwap' : 'ltr';
|
||||
|
||||
if (!inserted[dir][id]) {
|
||||
var style = (0, _createCompileableStyle.default)((0, _i18nStyle.default)((0, _flattenStyle.default)(id)));
|
||||
var results = (0, _compile.atomic)(style);
|
||||
Object.keys(results).forEach(function (key) {
|
||||
var _results$key = results[key],
|
||||
identifier = _results$key.identifier,
|
||||
property = _results$key.property,
|
||||
rules = _results$key.rules,
|
||||
value = _results$key.value;
|
||||
addToCache(identifier, property, value);
|
||||
rules.forEach(function (rule) {
|
||||
var group = _constants.STYLE_GROUPS.custom[property] || _constants.STYLE_GROUPS.atomic;
|
||||
sheet.insert(rule, group);
|
||||
});
|
||||
});
|
||||
inserted[dir][id] = true;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Resolves a React Native style object to DOM attributes
|
||||
*/
|
||||
|
||||
|
||||
function resolve(style, classList) {
|
||||
var nextClassList = [];
|
||||
var props = {};
|
||||
|
||||
if (!style && !classList) {
|
||||
return props;
|
||||
}
|
||||
|
||||
if (Array.isArray(classList)) {
|
||||
(0, _flattenArray.default)(classList).forEach(function (identifier) {
|
||||
if (identifier) {
|
||||
if (inserted.css[identifier] == null && resolved.css[identifier] != null) {
|
||||
var item = resolved.css[identifier];
|
||||
item.rules.forEach(function (rule) {
|
||||
sheet.insert(rule, item.group);
|
||||
});
|
||||
inserted.css[identifier] = true;
|
||||
}
|
||||
|
||||
nextClassList.push(identifier);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (typeof style === 'number') {
|
||||
// fast and cachable
|
||||
_injectRegisteredStyle(style);
|
||||
|
||||
var key = createCacheKey(style);
|
||||
props = _resolveStyle(style, key);
|
||||
} else if (!Array.isArray(style)) {
|
||||
// resolve a plain RN style object
|
||||
props = _resolveStyle(style);
|
||||
} else {
|
||||
// flatten the style array
|
||||
// cache resolved props when all styles are registered
|
||||
// otherwise fallback to resolving
|
||||
var flatArray = (0, _flattenArray.default)(style);
|
||||
var isArrayOfNumbers = true;
|
||||
var cacheKey = '';
|
||||
|
||||
for (var i = 0; i < flatArray.length; i++) {
|
||||
var id = flatArray[i];
|
||||
|
||||
if (typeof id !== 'number') {
|
||||
isArrayOfNumbers = false;
|
||||
} else {
|
||||
if (isArrayOfNumbers) {
|
||||
cacheKey += id + '-';
|
||||
}
|
||||
|
||||
_injectRegisteredStyle(id);
|
||||
}
|
||||
}
|
||||
|
||||
var _key = isArrayOfNumbers ? createCacheKey(cacheKey) : null;
|
||||
|
||||
props = _resolveStyle(flatArray, _key);
|
||||
}
|
||||
|
||||
nextClassList.push.apply(nextClassList, props.classList);
|
||||
var finalProps = {
|
||||
className: classListToString(nextClassList),
|
||||
classList: nextClassList
|
||||
};
|
||||
|
||||
if (props.style) {
|
||||
finalProps.style = props.style;
|
||||
}
|
||||
|
||||
return finalProps;
|
||||
}
|
||||
/**
|
||||
* Resolves a React Native style object
|
||||
*/
|
||||
|
||||
|
||||
function _resolveStyle(style, key) {
|
||||
var doLeftAndRightSwapInRTL = _I18nManager.default.doLeftAndRightSwapInRTL,
|
||||
isRTL = _I18nManager.default.isRTL;
|
||||
var dir = isRTL ? doLeftAndRightSwapInRTL ? 'rtl' : 'rtlNoSwap' : 'ltr'; // faster: memoized
|
||||
|
||||
if (key != null && resolved[dir][key] != null) {
|
||||
return resolved[dir][key];
|
||||
}
|
||||
|
||||
var flatStyle = (0, _flattenStyle.default)(style);
|
||||
var localizedStyle = (0, _createCompileableStyle.default)((0, _i18nStyle.default)(flatStyle)); // slower: convert style object to props and cache
|
||||
|
||||
var props = Object.keys(localizedStyle).sort().reduce(function (props, styleProp) {
|
||||
var value = localizedStyle[styleProp];
|
||||
|
||||
if (value != null) {
|
||||
var className = getClassName(styleProp, value);
|
||||
|
||||
if (className) {
|
||||
props.classList.push(className);
|
||||
} else {
|
||||
// Certain properties and values are not transformed by 'createReactDOMStyle' as they
|
||||
// require more complex transforms into multiple CSS rules. Here we assume that StyleManager
|
||||
// can bind these styles to a className, and prevent them becoming invalid inline-styles.
|
||||
if (styleProp === 'animationKeyframes' || styleProp === 'placeholderTextColor' || styleProp === 'pointerEvents' || styleProp === 'scrollbarWidth') {
|
||||
var _atomic;
|
||||
|
||||
var a = (0, _compile.atomic)((_atomic = {}, _atomic[styleProp] = value, _atomic));
|
||||
Object.keys(a).forEach(function (key) {
|
||||
var _a$key = a[key],
|
||||
identifier = _a$key.identifier,
|
||||
rules = _a$key.rules;
|
||||
props.classList.push(identifier);
|
||||
rules.forEach(function (rule) {
|
||||
sheet.insert(rule, _constants.STYLE_GROUPS.atomic);
|
||||
});
|
||||
});
|
||||
} else {
|
||||
if (!props.style) {
|
||||
props.style = {};
|
||||
} // 4x slower render
|
||||
|
||||
|
||||
props.style[styleProp] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return props;
|
||||
}, {
|
||||
classList: []
|
||||
});
|
||||
|
||||
if (props.style) {
|
||||
props.style = (0, _compile.inline)(props.style);
|
||||
}
|
||||
|
||||
if (key != null) {
|
||||
resolved[dir][key] = props;
|
||||
}
|
||||
|
||||
return props;
|
||||
}
|
||||
|
||||
return {
|
||||
getStyleSheet: function getStyleSheet() {
|
||||
var textContent = sheet.getTextContent(); // Reset state on the server so critical css is always the result
|
||||
|
||||
if (!_ExecutionEnvironment.canUseDOM) {
|
||||
init();
|
||||
}
|
||||
|
||||
return {
|
||||
id: _constants.STYLE_ELEMENT_ID,
|
||||
textContent: textContent
|
||||
};
|
||||
},
|
||||
createCSS: function createCSS(rules, group) {
|
||||
var result = {};
|
||||
Object.keys(rules).forEach(function (name) {
|
||||
var style = rules[name];
|
||||
var compiled = (0, _compile.classic)(style, name);
|
||||
Object.keys(compiled).forEach(function (key) {
|
||||
var _compiled$key = compiled[key],
|
||||
identifier = _compiled$key.identifier,
|
||||
rules = _compiled$key.rules;
|
||||
resolved.css[identifier] = {
|
||||
group: group || _constants.STYLE_GROUPS.classic,
|
||||
rules: rules
|
||||
};
|
||||
result[name] = identifier;
|
||||
});
|
||||
});
|
||||
return result;
|
||||
},
|
||||
resolve: resolve,
|
||||
sheet: sheet
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Misc helpers
|
||||
*/
|
||||
|
||||
|
||||
var createCacheKey = function createCacheKey(id) {
|
||||
var prefix = 'rn';
|
||||
return prefix + "-" + id;
|
||||
};
|
||||
|
||||
var classListToString = function classListToString(list) {
|
||||
return list.join(' ').trim();
|
||||
};
|
||||
|
||||
module.exports = exports.default;
|
34
node_modules/react-native-web/dist/cjs/exports/StyleSheet/css.js
generated
vendored
Normal file
34
node_modules/react-native-web/dist/cjs/exports/StyleSheet/css.js
generated
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _styleResolver = _interopRequireDefault(require("./styleResolver"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* A simple (and dangerous) CSS system.
|
||||
* The order of CSS rule insertion is not guaranteed.
|
||||
* Avoiding combining 2 or more classes that modify the same property.
|
||||
*/
|
||||
var css = {
|
||||
/**
|
||||
* const classes = css.create({ base: {}, extra: {} })
|
||||
*/
|
||||
create: function create(rules, group) {
|
||||
return _styleResolver.default.createCSS(rules, group);
|
||||
}
|
||||
};
|
||||
var _default = css;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
60
node_modules/react-native-web/dist/cjs/exports/StyleSheet/flattenStyle.js
generated
vendored
Normal file
60
node_modules/react-native-web/dist/cjs/exports/StyleSheet/flattenStyle.js
generated
vendored
Normal file
@ -0,0 +1,60 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _ReactNativePropRegistry = _interopRequireDefault(require("./ReactNativePropRegistry"));
|
||||
|
||||
var _invariant = _interopRequireDefault(require("fbjs/lib/invariant"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
function getStyle(style) {
|
||||
if (typeof style === 'number') {
|
||||
return _ReactNativePropRegistry.default.getByID(style);
|
||||
}
|
||||
|
||||
return style;
|
||||
}
|
||||
|
||||
function flattenStyle(style) {
|
||||
if (!style) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
(0, _invariant.default)(style !== true, 'style may be false but not true');
|
||||
}
|
||||
|
||||
if (!Array.isArray(style)) {
|
||||
return getStyle(style);
|
||||
}
|
||||
|
||||
var result = {};
|
||||
|
||||
for (var i = 0, styleLength = style.length; i < styleLength; ++i) {
|
||||
var computedStyle = flattenStyle(style[i]);
|
||||
|
||||
if (computedStyle) {
|
||||
for (var key in computedStyle) {
|
||||
var value = computedStyle[key];
|
||||
result[key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
var _default = flattenStyle;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
154
node_modules/react-native-web/dist/cjs/exports/StyleSheet/i18nStyle.js
generated
vendored
Normal file
154
node_modules/react-native-web/dist/cjs/exports/StyleSheet/i18nStyle.js
generated
vendored
Normal file
@ -0,0 +1,154 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _I18nManager = _interopRequireDefault(require("../I18nManager"));
|
||||
|
||||
var _multiplyStyleLengthValue = _interopRequireDefault(require("../../modules/multiplyStyleLengthValue"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
var emptyObject = {};
|
||||
var borderTopLeftRadius = 'borderTopLeftRadius';
|
||||
var borderTopRightRadius = 'borderTopRightRadius';
|
||||
var borderBottomLeftRadius = 'borderBottomLeftRadius';
|
||||
var borderBottomRightRadius = 'borderBottomRightRadius';
|
||||
var borderLeftColor = 'borderLeftColor';
|
||||
var borderLeftStyle = 'borderLeftStyle';
|
||||
var borderLeftWidth = 'borderLeftWidth';
|
||||
var borderRightColor = 'borderRightColor';
|
||||
var borderRightStyle = 'borderRightStyle';
|
||||
var borderRightWidth = 'borderRightWidth';
|
||||
var right = 'right';
|
||||
var marginLeft = 'marginLeft';
|
||||
var marginRight = 'marginRight';
|
||||
var paddingLeft = 'paddingLeft';
|
||||
var paddingRight = 'paddingRight';
|
||||
var left = 'left'; // Map of LTR property names to their BiDi equivalent.
|
||||
|
||||
var PROPERTIES_FLIP = {
|
||||
borderTopLeftRadius: borderTopRightRadius,
|
||||
borderTopRightRadius: borderTopLeftRadius,
|
||||
borderBottomLeftRadius: borderBottomRightRadius,
|
||||
borderBottomRightRadius: borderBottomLeftRadius,
|
||||
borderLeftColor: borderRightColor,
|
||||
borderLeftStyle: borderRightStyle,
|
||||
borderLeftWidth: borderRightWidth,
|
||||
borderRightColor: borderLeftColor,
|
||||
borderRightStyle: borderLeftStyle,
|
||||
borderRightWidth: borderLeftWidth,
|
||||
left: right,
|
||||
marginLeft: marginRight,
|
||||
marginRight: marginLeft,
|
||||
paddingLeft: paddingRight,
|
||||
paddingRight: paddingLeft,
|
||||
right: left
|
||||
}; // Map of I18N property names to their LTR equivalent.
|
||||
|
||||
var PROPERTIES_I18N = {
|
||||
borderTopStartRadius: borderTopLeftRadius,
|
||||
borderTopEndRadius: borderTopRightRadius,
|
||||
borderBottomStartRadius: borderBottomLeftRadius,
|
||||
borderBottomEndRadius: borderBottomRightRadius,
|
||||
borderStartColor: borderLeftColor,
|
||||
borderStartStyle: borderLeftStyle,
|
||||
borderStartWidth: borderLeftWidth,
|
||||
borderEndColor: borderRightColor,
|
||||
borderEndStyle: borderRightStyle,
|
||||
borderEndWidth: borderRightWidth,
|
||||
end: right,
|
||||
marginStart: marginLeft,
|
||||
marginEnd: marginRight,
|
||||
paddingStart: paddingLeft,
|
||||
paddingEnd: paddingRight,
|
||||
start: left
|
||||
};
|
||||
var PROPERTIES_VALUE = {
|
||||
clear: true,
|
||||
float: true,
|
||||
textAlign: true
|
||||
}; // Invert the sign of a numeric-like value
|
||||
|
||||
var additiveInverse = function additiveInverse(value) {
|
||||
return (0, _multiplyStyleLengthValue.default)(value, -1);
|
||||
};
|
||||
|
||||
var i18nStyle = function i18nStyle(originalStyle) {
|
||||
var doLeftAndRightSwapInRTL = _I18nManager.default.doLeftAndRightSwapInRTL,
|
||||
isRTL = _I18nManager.default.isRTL;
|
||||
var style = originalStyle || emptyObject;
|
||||
var frozenProps = {};
|
||||
var nextStyle = {};
|
||||
|
||||
for (var originalProp in style) {
|
||||
if (!Object.prototype.hasOwnProperty.call(style, originalProp)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
var originalValue = style[originalProp];
|
||||
var prop = originalProp;
|
||||
var value = originalValue; // BiDi flip properties
|
||||
|
||||
if (PROPERTIES_I18N.hasOwnProperty(originalProp)) {
|
||||
// convert start/end
|
||||
var convertedProp = PROPERTIES_I18N[originalProp];
|
||||
prop = isRTL ? PROPERTIES_FLIP[convertedProp] : convertedProp;
|
||||
} else if (isRTL && doLeftAndRightSwapInRTL && PROPERTIES_FLIP[originalProp]) {
|
||||
prop = PROPERTIES_FLIP[originalProp];
|
||||
} // BiDi flip values
|
||||
|
||||
|
||||
if (PROPERTIES_VALUE.hasOwnProperty(originalProp)) {
|
||||
if (originalValue === 'start') {
|
||||
value = isRTL ? 'right' : 'left';
|
||||
} else if (originalValue === 'end') {
|
||||
value = isRTL ? 'left' : 'right';
|
||||
} else if (isRTL && doLeftAndRightSwapInRTL) {
|
||||
if (originalValue === 'left') {
|
||||
value = 'right';
|
||||
} else if (originalValue === 'right') {
|
||||
value = 'left';
|
||||
}
|
||||
}
|
||||
} // BiDi flip transitionProperty value
|
||||
|
||||
|
||||
if (prop === 'transitionProperty') {
|
||||
// BiDi flip properties
|
||||
if (PROPERTIES_I18N.hasOwnProperty(value)) {
|
||||
// convert start/end
|
||||
var convertedValue = PROPERTIES_I18N[originalValue];
|
||||
value = isRTL ? PROPERTIES_FLIP[convertedValue] : convertedValue;
|
||||
} else if (isRTL && doLeftAndRightSwapInRTL && PROPERTIES_FLIP[originalValue]) {
|
||||
value = PROPERTIES_FLIP[originalValue];
|
||||
}
|
||||
} // Create finalized style
|
||||
|
||||
|
||||
if (isRTL && prop === 'textShadowOffset') {
|
||||
nextStyle[prop] = value;
|
||||
nextStyle[prop].width = additiveInverse(value.width);
|
||||
} else if (!frozenProps[prop]) {
|
||||
nextStyle[prop] = value;
|
||||
}
|
||||
|
||||
if (PROPERTIES_I18N[originalProp]) {
|
||||
frozenProps[prop] = true;
|
||||
}
|
||||
}
|
||||
|
||||
return nextStyle;
|
||||
};
|
||||
|
||||
var _default = i18nStyle;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
27
node_modules/react-native-web/dist/cjs/exports/StyleSheet/index.js
generated
vendored
Normal file
27
node_modules/react-native-web/dist/cjs/exports/StyleSheet/index.js
generated
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _ExecutionEnvironment = require("fbjs/lib/ExecutionEnvironment");
|
||||
|
||||
var _StyleSheet = _interopRequireDefault(require("./StyleSheet"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
// allow original component styles to be inspected in React Dev Tools
|
||||
if (_ExecutionEnvironment.canUseDOM && window.__REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
window.__REACT_DEVTOOLS_GLOBAL_HOOK__.resolveRNStyle = _StyleSheet.default.flatten;
|
||||
}
|
||||
|
||||
var _default = _StyleSheet.default;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
19
node_modules/react-native-web/dist/cjs/exports/StyleSheet/initialRules.js
generated
vendored
Normal file
19
node_modules/react-native-web/dist/cjs/exports/StyleSheet/initialRules.js
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
var resets = [// minimal top-level reset
|
||||
'html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);}', 'body{margin:0;}', // minimal form pseudo-element reset
|
||||
'button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;}', 'input::-webkit-inner-spin-button,input::-webkit-outer-spin-button,' + 'input::-webkit-search-cancel-button,input::-webkit-search-decoration,' + 'input::-webkit-search-results-button,input::-webkit-search-results-decoration{display:none;}'];
|
||||
var _default = resets;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
288
node_modules/react-native-web/dist/cjs/exports/StyleSheet/modality.js
generated
vendored
Normal file
288
node_modules/react-native-web/dist/cjs/exports/StyleSheet/modality.js
generated
vendored
Normal file
@ -0,0 +1,288 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _ExecutionEnvironment = require("fbjs/lib/ExecutionEnvironment");
|
||||
|
||||
/**
|
||||
* Adapts focus styles based on the user's active input modality (i.e., how
|
||||
* they are interacting with the UI right now).
|
||||
*
|
||||
* Focus styles are only relevant when using the keyboard to interact with the
|
||||
* page. If we only show the focus ring when relevant, we can avoid user
|
||||
* confusion without compromising accessibility.
|
||||
*
|
||||
* The script uses two heuristics to determine whether the keyboard is being used:
|
||||
*
|
||||
* 1. a keydown event occurred immediately before a focus event;
|
||||
* 2. a focus event happened on an element which requires keyboard interaction (e.g., a text field);
|
||||
*
|
||||
* This software or document includes material copied from or derived from https://github.com/WICG/focus-visible.
|
||||
* Copyright © 2018 W3C® (MIT, ERCIM, Keio, Beihang).
|
||||
* W3C Software Notice and License: https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
|
||||
*
|
||||
*
|
||||
*/
|
||||
var focusVisibleAttributeName = 'data-focusvisible-polyfill';
|
||||
var rule = ":focus:not([" + focusVisibleAttributeName + "]){outline: none;}";
|
||||
|
||||
var modality = function modality(insertRule) {
|
||||
insertRule(rule);
|
||||
|
||||
if (!_ExecutionEnvironment.canUseDOM) {
|
||||
return;
|
||||
}
|
||||
|
||||
var hadKeyboardEvent = true;
|
||||
var hadFocusVisibleRecently = false;
|
||||
var hadFocusVisibleRecentlyTimeout = null;
|
||||
var inputTypesWhitelist = {
|
||||
text: true,
|
||||
search: true,
|
||||
url: true,
|
||||
tel: true,
|
||||
email: true,
|
||||
password: true,
|
||||
number: true,
|
||||
date: true,
|
||||
month: true,
|
||||
week: true,
|
||||
time: true,
|
||||
datetime: true,
|
||||
'datetime-local': true
|
||||
};
|
||||
/**
|
||||
* Helper function for legacy browsers and iframes which sometimes focus
|
||||
* elements like document, body, and non-interactive SVG.
|
||||
*/
|
||||
|
||||
function isValidFocusTarget(el) {
|
||||
if (el && el !== document && el.nodeName !== 'HTML' && el.nodeName !== 'BODY' && 'classList' in el && 'contains' in el.classList) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
* Computes whether the given element should automatically trigger the
|
||||
* `focus-visible` attribute being added, i.e. whether it should always match
|
||||
* `:focus-visible` when focused.
|
||||
*/
|
||||
|
||||
|
||||
function focusTriggersKeyboardModality(el) {
|
||||
var type = el.type;
|
||||
var tagName = el.tagName;
|
||||
var isReadOnly = el.readOnly;
|
||||
|
||||
if (tagName === 'INPUT' && inputTypesWhitelist[type] && !isReadOnly) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (tagName === 'TEXTAREA' && !isReadOnly) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (el.isContentEditable) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
* Add the `focus-visible` attribute to the given element if it was not added by
|
||||
* the author.
|
||||
*/
|
||||
|
||||
|
||||
function addFocusVisibleAttribute(el) {
|
||||
if (el.hasAttribute(focusVisibleAttributeName)) {
|
||||
return;
|
||||
}
|
||||
|
||||
el.setAttribute(focusVisibleAttributeName, true);
|
||||
}
|
||||
/**
|
||||
* Remove the `focus-visible` attribute from the given element if it was not
|
||||
* originally added by the author.
|
||||
*/
|
||||
|
||||
|
||||
function removeFocusVisibleAttribute(el) {
|
||||
el.removeAttribute(focusVisibleAttributeName);
|
||||
}
|
||||
/**
|
||||
* Remove the `focus-visible` attribute from all elements in the document.
|
||||
*/
|
||||
|
||||
|
||||
function removeAllFocusVisibleAttributes() {
|
||||
var list = document.querySelectorAll("[" + focusVisibleAttributeName + "]");
|
||||
|
||||
for (var i = 0; i < list.length; i += 1) {
|
||||
removeFocusVisibleAttribute(list[i]);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Treat `keydown` as a signal that the user is in keyboard modality.
|
||||
* Apply `focus-visible` to any current active element and keep track
|
||||
* of our keyboard modality state with `hadKeyboardEvent`.
|
||||
*/
|
||||
|
||||
|
||||
function onKeyDown(e) {
|
||||
if (e.key !== 'Tab' && (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (isValidFocusTarget(document.activeElement)) {
|
||||
addFocusVisibleAttribute(document.activeElement);
|
||||
}
|
||||
|
||||
hadKeyboardEvent = true;
|
||||
}
|
||||
/**
|
||||
* If at any point a user clicks with a pointing device, ensure that we change
|
||||
* the modality away from keyboard.
|
||||
* This avoids the situation where a user presses a key on an already focused
|
||||
* element, and then clicks on a different element, focusing it with a
|
||||
* pointing device, while we still think we're in keyboard modality.
|
||||
* It also avoids the situation where a user presses on an element within a
|
||||
* previously keyboard-focused element (i.e., `e.target` is not the previously
|
||||
* focused element, but one of its descendants) and we need to remove the
|
||||
* focus ring because a `blur` event doesn't occur.
|
||||
*/
|
||||
|
||||
|
||||
function onPointerDown(e) {
|
||||
if (hadKeyboardEvent === true) {
|
||||
removeAllFocusVisibleAttributes();
|
||||
}
|
||||
|
||||
hadKeyboardEvent = false;
|
||||
}
|
||||
/**
|
||||
* On `focus`, add the `focus-visible` attribute to the target if:
|
||||
* - the target received focus as a result of keyboard navigation, or
|
||||
* - the event target is an element that will likely require interaction
|
||||
* via the keyboard (e.g. a text box)
|
||||
*/
|
||||
|
||||
|
||||
function onFocus(e) {
|
||||
// Prevent IE from focusing the document or HTML element.
|
||||
if (!isValidFocusTarget(e.target)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (hadKeyboardEvent || focusTriggersKeyboardModality(e.target)) {
|
||||
addFocusVisibleAttribute(e.target);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* On `blur`, remove the `focus-visible` attribute from the target.
|
||||
*/
|
||||
|
||||
|
||||
function onBlur(e) {
|
||||
if (!isValidFocusTarget(e.target)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (e.target.hasAttribute(focusVisibleAttributeName)) {
|
||||
// To detect a tab/window switch, we look for a blur event followed
|
||||
// rapidly by a visibility change.
|
||||
// If we don't see a visibility change within 100ms, it's probably a
|
||||
// regular focus change.
|
||||
hadFocusVisibleRecently = true;
|
||||
window.clearTimeout(hadFocusVisibleRecentlyTimeout);
|
||||
hadFocusVisibleRecentlyTimeout = window.setTimeout(function () {
|
||||
hadFocusVisibleRecently = false;
|
||||
window.clearTimeout(hadFocusVisibleRecentlyTimeout);
|
||||
}, 100);
|
||||
removeFocusVisibleAttribute(e.target);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* If the user changes tabs, keep track of whether or not the previously
|
||||
* focused element had the focus-visible attribute.
|
||||
*/
|
||||
|
||||
|
||||
function onVisibilityChange(e) {
|
||||
if (document.visibilityState === 'hidden') {
|
||||
// If the tab becomes active again, the browser will handle calling focus
|
||||
// on the element (Safari actually calls it twice).
|
||||
// If this tab change caused a blur on an element with focus-visible,
|
||||
// re-apply the attribute when the user switches back to the tab.
|
||||
if (hadFocusVisibleRecently) {
|
||||
hadKeyboardEvent = true;
|
||||
}
|
||||
|
||||
addInitialPointerMoveListeners();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Add a group of listeners to detect usage of any pointing devices.
|
||||
* These listeners will be added when the polyfill first loads, and anytime
|
||||
* the window is blurred, so that they are active when the window regains
|
||||
* focus.
|
||||
*/
|
||||
|
||||
|
||||
function addInitialPointerMoveListeners() {
|
||||
document.addEventListener('mousemove', onInitialPointerMove);
|
||||
document.addEventListener('mousedown', onInitialPointerMove);
|
||||
document.addEventListener('mouseup', onInitialPointerMove);
|
||||
document.addEventListener('pointermove', onInitialPointerMove);
|
||||
document.addEventListener('pointerdown', onInitialPointerMove);
|
||||
document.addEventListener('pointerup', onInitialPointerMove);
|
||||
document.addEventListener('touchmove', onInitialPointerMove);
|
||||
document.addEventListener('touchstart', onInitialPointerMove);
|
||||
document.addEventListener('touchend', onInitialPointerMove);
|
||||
}
|
||||
|
||||
function removeInitialPointerMoveListeners() {
|
||||
document.removeEventListener('mousemove', onInitialPointerMove);
|
||||
document.removeEventListener('mousedown', onInitialPointerMove);
|
||||
document.removeEventListener('mouseup', onInitialPointerMove);
|
||||
document.removeEventListener('pointermove', onInitialPointerMove);
|
||||
document.removeEventListener('pointerdown', onInitialPointerMove);
|
||||
document.removeEventListener('pointerup', onInitialPointerMove);
|
||||
document.removeEventListener('touchmove', onInitialPointerMove);
|
||||
document.removeEventListener('touchstart', onInitialPointerMove);
|
||||
document.removeEventListener('touchend', onInitialPointerMove);
|
||||
}
|
||||
/**
|
||||
* When the polfyill first loads, assume the user is in keyboard modality.
|
||||
* If any event is received from a pointing device (e.g. mouse, pointer,
|
||||
* touch), turn off keyboard modality.
|
||||
* This accounts for situations where focus enters the page from the URL bar.
|
||||
*/
|
||||
|
||||
|
||||
function onInitialPointerMove(e) {
|
||||
// Work around a Safari quirk that fires a mousemove on <html> whenever the
|
||||
// window blurs, even if you're tabbing out of the page. ¯\_(ツ)_/¯
|
||||
if (e.target.nodeName === 'HTML') {
|
||||
return;
|
||||
}
|
||||
|
||||
hadKeyboardEvent = false;
|
||||
removeInitialPointerMoveListeners();
|
||||
}
|
||||
|
||||
document.addEventListener('keydown', onKeyDown, true);
|
||||
document.addEventListener('mousedown', onPointerDown, true);
|
||||
document.addEventListener('pointerdown', onPointerDown, true);
|
||||
document.addEventListener('touchstart', onPointerDown, true);
|
||||
document.addEventListener('focus', onFocus, true);
|
||||
document.addEventListener('blur', onBlur, true);
|
||||
document.addEventListener('visibilitychange', onVisibilityChange, true);
|
||||
addInitialPointerMoveListeners();
|
||||
};
|
||||
|
||||
var _default = modality;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
45
node_modules/react-native-web/dist/cjs/exports/StyleSheet/normalizeValueWithProperty.js
generated
vendored
Normal file
45
node_modules/react-native-web/dist/cjs/exports/StyleSheet/normalizeValueWithProperty.js
generated
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = normalizeValueWithProperty;
|
||||
|
||||
var _unitlessNumbers = _interopRequireDefault(require("../../modules/unitlessNumbers"));
|
||||
|
||||
var _normalizeColor = _interopRequireDefault(require("../../modules/normalizeColor"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
var colorProps = {
|
||||
backgroundColor: true,
|
||||
borderColor: true,
|
||||
borderTopColor: true,
|
||||
borderRightColor: true,
|
||||
borderBottomColor: true,
|
||||
borderLeftColor: true,
|
||||
color: true,
|
||||
shadowColor: true,
|
||||
textDecorationColor: true,
|
||||
textShadowColor: true
|
||||
};
|
||||
|
||||
function normalizeValueWithProperty(value, property) {
|
||||
var returnValue = value;
|
||||
|
||||
if ((property == null || !_unitlessNumbers.default[property]) && typeof value === 'number') {
|
||||
returnValue = value + "px";
|
||||
} else if (property != null && colorProps[property]) {
|
||||
returnValue = (0, _normalizeColor.default)(value);
|
||||
}
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
module.exports = exports.default;
|
47
node_modules/react-native-web/dist/cjs/exports/StyleSheet/resolveShadowValue.js
generated
vendored
Normal file
47
node_modules/react-native-web/dist/cjs/exports/StyleSheet/resolveShadowValue.js
generated
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _normalizeColor = _interopRequireDefault(require("../../modules/normalizeColor"));
|
||||
|
||||
var _normalizeValueWithProperty = _interopRequireDefault(require("./normalizeValueWithProperty"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
var defaultOffset = {
|
||||
height: 0,
|
||||
width: 0
|
||||
};
|
||||
|
||||
var resolveShadowValue = function resolveShadowValue(style) {
|
||||
var shadowColor = style.shadowColor,
|
||||
shadowOffset = style.shadowOffset,
|
||||
shadowOpacity = style.shadowOpacity,
|
||||
shadowRadius = style.shadowRadius;
|
||||
|
||||
var _ref = shadowOffset || defaultOffset,
|
||||
height = _ref.height,
|
||||
width = _ref.width;
|
||||
|
||||
var offsetX = (0, _normalizeValueWithProperty.default)(width);
|
||||
var offsetY = (0, _normalizeValueWithProperty.default)(height);
|
||||
var blurRadius = (0, _normalizeValueWithProperty.default)(shadowRadius || 0);
|
||||
var color = (0, _normalizeColor.default)(shadowColor || 'black', shadowOpacity);
|
||||
|
||||
if (color != null && offsetX != null && offsetY != null && blurRadius != null) {
|
||||
return offsetX + " " + offsetY + " " + blurRadius + " " + color;
|
||||
}
|
||||
};
|
||||
|
||||
var _default = resolveShadowValue;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
21
node_modules/react-native-web/dist/cjs/exports/StyleSheet/styleResolver.js
generated
vendored
Normal file
21
node_modules/react-native-web/dist/cjs/exports/StyleSheet/styleResolver.js
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _createStyleResolver = _interopRequireDefault(require("./createStyleResolver"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
var styleResolver = (0, _createStyleResolver.default)();
|
||||
var _default = styleResolver;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
79
node_modules/react-native-web/dist/cjs/exports/StyleSheet/validate.js
generated
vendored
Normal file
79
node_modules/react-native-web/dist/cjs/exports/StyleSheet/validate.js
generated
vendored
Normal file
@ -0,0 +1,79 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = validate;
|
||||
|
||||
var _warning = _interopRequireDefault(require("fbjs/lib/warning"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
var invalidShortforms = {
|
||||
background: true,
|
||||
borderBottom: true,
|
||||
borderLeft: true,
|
||||
borderRight: true,
|
||||
borderTop: true,
|
||||
font: true,
|
||||
grid: true,
|
||||
outline: true,
|
||||
textDecoration: true
|
||||
};
|
||||
|
||||
function error(message) {
|
||||
(0, _warning.default)(false, message);
|
||||
}
|
||||
|
||||
function validate(key, styles) {
|
||||
var obj = styles[key];
|
||||
|
||||
for (var k in obj) {
|
||||
var prop = k.trim();
|
||||
var value = obj[prop];
|
||||
var isInvalid = false;
|
||||
|
||||
if (value === null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (typeof value === 'string' && value.indexOf('!important') > -1) {
|
||||
error("Invalid style declaration \"" + prop + ":" + value + "\". Values cannot include \"!important\"");
|
||||
isInvalid = true;
|
||||
} else {
|
||||
var suggestion = '';
|
||||
|
||||
if (prop === 'animation' || prop === 'animationName') {
|
||||
suggestion = 'Did you mean "animationKeyframes"?'; // } else if (prop === 'boxShadow') {
|
||||
// suggestion = 'Did you mean "shadow{Color,Offset,Opacity,Radius}"?';
|
||||
|
||||
isInvalid = true;
|
||||
} else if (prop === 'direction') {
|
||||
suggestion = 'Did you mean "writingDirection"?';
|
||||
isInvalid = true;
|
||||
} else if (prop === 'verticalAlign') {
|
||||
suggestion = 'Did you mean "textAlignVertical"?';
|
||||
isInvalid = true;
|
||||
} else if (invalidShortforms[prop]) {
|
||||
suggestion = 'Please use long-form properties.';
|
||||
isInvalid = true;
|
||||
}
|
||||
|
||||
if (suggestion !== '') {
|
||||
error("Invalid style property of \"" + prop + "\". " + suggestion);
|
||||
}
|
||||
}
|
||||
|
||||
if (isInvalid) {
|
||||
delete obj[k];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = exports.default;
|
176
node_modules/react-native-web/dist/cjs/exports/Switch/index.js
generated
vendored
Normal file
176
node_modules/react-native-web/dist/cjs/exports/Switch/index.js
generated
vendored
Normal file
@ -0,0 +1,176 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var React = _interopRequireWildcard(require("react"));
|
||||
|
||||
var _createElement = _interopRequireDefault(require("../createElement"));
|
||||
|
||||
var _multiplyStyleLengthValue = _interopRequireDefault(require("../../modules/multiplyStyleLengthValue"));
|
||||
|
||||
var _StyleSheet = _interopRequireDefault(require("../StyleSheet"));
|
||||
|
||||
var _View = _interopRequireDefault(require("../View"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
||||
|
||||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
||||
|
||||
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
||||
|
||||
var emptyObject = {};
|
||||
var thumbDefaultBoxShadow = '0px 1px 3px rgba(0,0,0,0.5)';
|
||||
var thumbFocusedBoxShadow = thumbDefaultBoxShadow + ", 0 0 0 10px rgba(0,0,0,0.1)";
|
||||
var Switch = (0, React.forwardRef)(function (props, forwardedRef) {
|
||||
var accessibilityLabel = props.accessibilityLabel,
|
||||
_props$activeThumbCol = props.activeThumbColor,
|
||||
activeThumbColor = _props$activeThumbCol === void 0 ? '#009688' : _props$activeThumbCol,
|
||||
_props$activeTrackCol = props.activeTrackColor,
|
||||
activeTrackColor = _props$activeTrackCol === void 0 ? '#A3D3CF' : _props$activeTrackCol,
|
||||
_props$disabled = props.disabled,
|
||||
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
||||
onValueChange = props.onValueChange,
|
||||
_props$style = props.style,
|
||||
style = _props$style === void 0 ? emptyObject : _props$style,
|
||||
_props$thumbColor = props.thumbColor,
|
||||
thumbColor = _props$thumbColor === void 0 ? '#FAFAFA' : _props$thumbColor,
|
||||
_props$trackColor = props.trackColor,
|
||||
trackColor = _props$trackColor === void 0 ? '#939393' : _props$trackColor,
|
||||
_props$value = props.value,
|
||||
value = _props$value === void 0 ? false : _props$value,
|
||||
other = _objectWithoutPropertiesLoose(props, ["accessibilityLabel", "activeThumbColor", "activeTrackColor", "disabled", "onValueChange", "style", "thumbColor", "trackColor", "value"]);
|
||||
|
||||
var thumbRef = (0, React.useRef)(null);
|
||||
|
||||
function handleChange(event) {
|
||||
if (onValueChange != null) {
|
||||
onValueChange(event.nativeEvent.target.checked);
|
||||
}
|
||||
}
|
||||
|
||||
function handleFocusState(event) {
|
||||
var isFocused = event.nativeEvent.type === 'focus';
|
||||
var boxShadow = isFocused ? thumbFocusedBoxShadow : thumbDefaultBoxShadow;
|
||||
|
||||
if (thumbRef.current != null) {
|
||||
thumbRef.current.style.boxShadow = boxShadow;
|
||||
}
|
||||
}
|
||||
|
||||
var _StyleSheet$flatten = _StyleSheet.default.flatten(style),
|
||||
styleHeight = _StyleSheet$flatten.height,
|
||||
styleWidth = _StyleSheet$flatten.width;
|
||||
|
||||
var height = styleHeight || 20;
|
||||
var minWidth = (0, _multiplyStyleLengthValue.default)(height, 2);
|
||||
var width = styleWidth > minWidth ? styleWidth : minWidth;
|
||||
var trackBorderRadius = (0, _multiplyStyleLengthValue.default)(height, 0.5);
|
||||
|
||||
var trackCurrentColor = function () {
|
||||
if (value === true) {
|
||||
if (trackColor != null && typeof trackColor === 'object') {
|
||||
return trackColor.true;
|
||||
} else {
|
||||
return activeTrackColor;
|
||||
}
|
||||
} else {
|
||||
if (trackColor != null && typeof trackColor === 'object') {
|
||||
return trackColor.false;
|
||||
} else {
|
||||
return trackColor;
|
||||
}
|
||||
}
|
||||
}();
|
||||
|
||||
var thumbCurrentColor = value ? activeThumbColor : thumbColor;
|
||||
var thumbHeight = height;
|
||||
var thumbWidth = thumbHeight;
|
||||
var rootStyle = [styles.root, style, disabled && styles.cursorDefault, {
|
||||
height: height,
|
||||
width: width
|
||||
}];
|
||||
var trackStyle = [styles.track, {
|
||||
backgroundColor: disabled ? '#D5D5D5' : trackCurrentColor,
|
||||
borderRadius: trackBorderRadius
|
||||
}];
|
||||
var thumbStyle = [styles.thumb, value && styles.thumbActive, {
|
||||
backgroundColor: disabled ? '#BDBDBD' : thumbCurrentColor,
|
||||
height: thumbHeight,
|
||||
marginStart: value ? (0, _multiplyStyleLengthValue.default)(thumbWidth, -1) : 0,
|
||||
width: thumbWidth
|
||||
}];
|
||||
var nativeControl = (0, _createElement.default)('input', {
|
||||
accessibilityLabel: accessibilityLabel,
|
||||
checked: value,
|
||||
disabled: disabled,
|
||||
onBlur: handleFocusState,
|
||||
onChange: handleChange,
|
||||
onFocus: handleFocusState,
|
||||
ref: forwardedRef,
|
||||
style: [styles.nativeControl, styles.cursorInherit],
|
||||
type: 'checkbox'
|
||||
});
|
||||
return React.createElement(_View.default, _extends({}, other, {
|
||||
style: rootStyle
|
||||
}), React.createElement(_View.default, {
|
||||
style: trackStyle
|
||||
}), React.createElement(_View.default, {
|
||||
ref: thumbRef,
|
||||
style: thumbStyle
|
||||
}), nativeControl);
|
||||
});
|
||||
Switch.displayName = 'Switch';
|
||||
|
||||
var styles = _StyleSheet.default.create({
|
||||
root: {
|
||||
cursor: 'pointer',
|
||||
userSelect: 'none'
|
||||
},
|
||||
cursorDefault: {
|
||||
cursor: 'default'
|
||||
},
|
||||
cursorInherit: {
|
||||
cursor: 'inherit'
|
||||
},
|
||||
track: _objectSpread({}, _StyleSheet.default.absoluteFillObject, {
|
||||
height: '70%',
|
||||
margin: 'auto',
|
||||
transitionDuration: '0.1s',
|
||||
width: '100%'
|
||||
}),
|
||||
thumb: {
|
||||
alignSelf: 'flex-start',
|
||||
borderRadius: '100%',
|
||||
boxShadow: thumbDefaultBoxShadow,
|
||||
start: '0%',
|
||||
transform: [{
|
||||
translateZ: 0
|
||||
}],
|
||||
transitionDuration: '0.1s'
|
||||
},
|
||||
thumbActive: {
|
||||
start: '100%'
|
||||
},
|
||||
nativeControl: _objectSpread({}, _StyleSheet.default.absoluteFillObject, {
|
||||
height: '100%',
|
||||
margin: 0,
|
||||
opacity: 0,
|
||||
padding: 0,
|
||||
width: '100%'
|
||||
})
|
||||
});
|
||||
|
||||
var _default = Switch;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
7
node_modules/react-native-web/dist/cjs/exports/Systrace/index.js
generated
vendored
Normal file
7
node_modules/react-native-web/dist/cjs/exports/Systrace/index.js
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
var _default = {};
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
7
node_modules/react-native-web/dist/cjs/exports/TVEventHandler/index.js
generated
vendored
Normal file
7
node_modules/react-native-web/dist/cjs/exports/TVEventHandler/index.js
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
var _default = {};
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
19
node_modules/react-native-web/dist/cjs/exports/Text/TextAncestorContext.js
generated
vendored
Normal file
19
node_modules/react-native-web/dist/cjs/exports/Text/TextAncestorContext.js
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _react = require("react");
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
var TextAncestorContext = (0, _react.createContext)(false);
|
||||
var _default = TextAncestorContext;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
221
node_modules/react-native-web/dist/cjs/exports/Text/index.js
generated
vendored
Normal file
221
node_modules/react-native-web/dist/cjs/exports/Text/index.js
generated
vendored
Normal file
@ -0,0 +1,221 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var React = _interopRequireWildcard(require("react"));
|
||||
|
||||
var _createElement = _interopRequireDefault(require("../createElement"));
|
||||
|
||||
var _css = _interopRequireDefault(require("../StyleSheet/css"));
|
||||
|
||||
var _pick = _interopRequireDefault(require("../../modules/pick"));
|
||||
|
||||
var _useElementLayout = _interopRequireDefault(require("../../hooks/useElementLayout"));
|
||||
|
||||
var _useMergeRefs = _interopRequireDefault(require("../../modules/useMergeRefs"));
|
||||
|
||||
var _usePlatformMethods = _interopRequireDefault(require("../../hooks/usePlatformMethods"));
|
||||
|
||||
var _useResponderEvents = _interopRequireDefault(require("../../hooks/useResponderEvents"));
|
||||
|
||||
var _StyleSheet = _interopRequireDefault(require("../StyleSheet"));
|
||||
|
||||
var _TextAncestorContext = _interopRequireDefault(require("./TextAncestorContext"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
var forwardPropsList = {
|
||||
accessibilityLabel: true,
|
||||
accessibilityLiveRegion: true,
|
||||
accessibilityRole: true,
|
||||
accessibilityState: true,
|
||||
accessibilityValue: true,
|
||||
accessible: true,
|
||||
children: true,
|
||||
classList: true,
|
||||
dir: true,
|
||||
importantForAccessibility: true,
|
||||
lang: true,
|
||||
nativeID: true,
|
||||
onBlur: true,
|
||||
onClick: true,
|
||||
onClickCapture: true,
|
||||
onContextMenu: true,
|
||||
onFocus: true,
|
||||
onKeyDown: true,
|
||||
onKeyUp: true,
|
||||
onTouchCancel: true,
|
||||
onTouchCancelCapture: true,
|
||||
onTouchEnd: true,
|
||||
onTouchEndCapture: true,
|
||||
onTouchMove: true,
|
||||
onTouchMoveCapture: true,
|
||||
onTouchStart: true,
|
||||
onTouchStartCapture: true,
|
||||
pointerEvents: true,
|
||||
ref: true,
|
||||
style: true,
|
||||
testID: true,
|
||||
// unstable
|
||||
dataSet: true,
|
||||
onMouseDown: true,
|
||||
onMouseEnter: true,
|
||||
onMouseLeave: true,
|
||||
onMouseMove: true,
|
||||
onMouseOver: true,
|
||||
onMouseOut: true,
|
||||
onMouseUp: true,
|
||||
onScroll: true,
|
||||
onWheel: true,
|
||||
href: true,
|
||||
rel: true,
|
||||
target: true
|
||||
};
|
||||
|
||||
var pickProps = function pickProps(props) {
|
||||
return (0, _pick.default)(props, forwardPropsList);
|
||||
};
|
||||
|
||||
var Text = (0, React.forwardRef)(function (props, forwardedRef) {
|
||||
var dir = props.dir,
|
||||
numberOfLines = props.numberOfLines,
|
||||
onClick = props.onClick,
|
||||
onLayout = props.onLayout,
|
||||
onPress = props.onPress,
|
||||
onMoveShouldSetResponder = props.onMoveShouldSetResponder,
|
||||
onMoveShouldSetResponderCapture = props.onMoveShouldSetResponderCapture,
|
||||
onResponderEnd = props.onResponderEnd,
|
||||
onResponderGrant = props.onResponderGrant,
|
||||
onResponderMove = props.onResponderMove,
|
||||
onResponderReject = props.onResponderReject,
|
||||
onResponderRelease = props.onResponderRelease,
|
||||
onResponderStart = props.onResponderStart,
|
||||
onResponderTerminate = props.onResponderTerminate,
|
||||
onResponderTerminationRequest = props.onResponderTerminationRequest,
|
||||
onScrollShouldSetResponder = props.onScrollShouldSetResponder,
|
||||
onScrollShouldSetResponderCapture = props.onScrollShouldSetResponderCapture,
|
||||
onSelectionChangeShouldSetResponder = props.onSelectionChangeShouldSetResponder,
|
||||
onSelectionChangeShouldSetResponderCapture = props.onSelectionChangeShouldSetResponderCapture,
|
||||
onStartShouldSetResponder = props.onStartShouldSetResponder,
|
||||
onStartShouldSetResponderCapture = props.onStartShouldSetResponderCapture,
|
||||
selectable = props.selectable;
|
||||
var hasTextAncestor = (0, React.useContext)(_TextAncestorContext.default);
|
||||
var hostRef = (0, React.useRef)(null);
|
||||
var classList = [classes.text, hasTextAncestor === true && classes.textHasAncestor, numberOfLines === 1 && classes.textOneLine, numberOfLines != null && numberOfLines > 1 && classes.textMultiLine];
|
||||
var style = [props.style, numberOfLines != null && numberOfLines > 1 && {
|
||||
WebkitLineClamp: numberOfLines
|
||||
}, selectable === true && styles.selectable, selectable === false && styles.notSelectable, onPress && styles.pressable];
|
||||
(0, _useElementLayout.default)(hostRef, onLayout);
|
||||
(0, _useResponderEvents.default)(hostRef, {
|
||||
onMoveShouldSetResponder: onMoveShouldSetResponder,
|
||||
onMoveShouldSetResponderCapture: onMoveShouldSetResponderCapture,
|
||||
onResponderEnd: onResponderEnd,
|
||||
onResponderGrant: onResponderGrant,
|
||||
onResponderMove: onResponderMove,
|
||||
onResponderReject: onResponderReject,
|
||||
onResponderRelease: onResponderRelease,
|
||||
onResponderStart: onResponderStart,
|
||||
onResponderTerminate: onResponderTerminate,
|
||||
onResponderTerminationRequest: onResponderTerminationRequest,
|
||||
onScrollShouldSetResponder: onScrollShouldSetResponder,
|
||||
onScrollShouldSetResponderCapture: onScrollShouldSetResponderCapture,
|
||||
onSelectionChangeShouldSetResponder: onSelectionChangeShouldSetResponder,
|
||||
onSelectionChangeShouldSetResponderCapture: onSelectionChangeShouldSetResponderCapture,
|
||||
onStartShouldSetResponder: onStartShouldSetResponder,
|
||||
onStartShouldSetResponderCapture: onStartShouldSetResponderCapture
|
||||
});
|
||||
|
||||
function handleClick(e) {
|
||||
if (onClick != null) {
|
||||
onClick(e);
|
||||
}
|
||||
|
||||
if (onClick == null && onPress != null) {
|
||||
e.stopPropagation();
|
||||
onPress(e);
|
||||
}
|
||||
}
|
||||
|
||||
var component = hasTextAncestor ? 'span' : 'div';
|
||||
var supportedProps = pickProps(props);
|
||||
supportedProps.classList = classList;
|
||||
supportedProps.dir = dir; // 'auto' by default allows browsers to infer writing direction (root elements only)
|
||||
|
||||
if (!hasTextAncestor) {
|
||||
supportedProps.dir = dir != null ? dir : 'auto';
|
||||
}
|
||||
|
||||
supportedProps.onClick = handleClick;
|
||||
supportedProps.style = style;
|
||||
var platformMethodsRef = (0, _usePlatformMethods.default)(supportedProps);
|
||||
var setRef = (0, _useMergeRefs.default)(hostRef, platformMethodsRef, forwardedRef);
|
||||
supportedProps.ref = setRef;
|
||||
var element = (0, _createElement.default)(component, supportedProps);
|
||||
return hasTextAncestor ? element : React.createElement(_TextAncestorContext.default.Provider, {
|
||||
value: true
|
||||
}, element);
|
||||
});
|
||||
Text.displayName = 'Text';
|
||||
|
||||
var classes = _css.default.create({
|
||||
text: {
|
||||
border: '0 solid black',
|
||||
boxSizing: 'border-box',
|
||||
color: 'black',
|
||||
display: 'inline',
|
||||
font: '14px System',
|
||||
margin: 0,
|
||||
padding: 0,
|
||||
whiteSpace: 'pre-wrap',
|
||||
wordWrap: 'break-word'
|
||||
},
|
||||
textHasAncestor: {
|
||||
color: 'inherit',
|
||||
font: 'inherit',
|
||||
whiteSpace: 'inherit'
|
||||
},
|
||||
textOneLine: {
|
||||
maxWidth: '100%',
|
||||
overflow: 'hidden',
|
||||
textOverflow: 'ellipsis',
|
||||
whiteSpace: 'nowrap'
|
||||
},
|
||||
// See #13
|
||||
textMultiLine: {
|
||||
display: '-webkit-box',
|
||||
maxWidth: '100%',
|
||||
overflow: 'hidden',
|
||||
textOverflow: 'ellipsis',
|
||||
WebkitBoxOrient: 'vertical'
|
||||
}
|
||||
});
|
||||
|
||||
var styles = _StyleSheet.default.create({
|
||||
notSelectable: {
|
||||
userSelect: 'none'
|
||||
},
|
||||
selectable: {
|
||||
userSelect: 'text'
|
||||
},
|
||||
pressable: {
|
||||
cursor: 'pointer'
|
||||
}
|
||||
});
|
||||
|
||||
var _default = Text;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
1
node_modules/react-native-web/dist/cjs/exports/Text/types.js
generated
vendored
Normal file
1
node_modules/react-native-web/dist/cjs/exports/Text/types.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
"use strict";
|
437
node_modules/react-native-web/dist/cjs/exports/TextInput/index.js
generated
vendored
Normal file
437
node_modules/react-native-web/dist/cjs/exports/TextInput/index.js
generated
vendored
Normal file
@ -0,0 +1,437 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _react = require("react");
|
||||
|
||||
var _createElement = _interopRequireDefault(require("../createElement"));
|
||||
|
||||
var _css = _interopRequireDefault(require("../StyleSheet/css"));
|
||||
|
||||
var _pick = _interopRequireDefault(require("../../modules/pick"));
|
||||
|
||||
var _useElementLayout = _interopRequireDefault(require("../../hooks/useElementLayout"));
|
||||
|
||||
var _useLayoutEffect = _interopRequireDefault(require("../../hooks/useLayoutEffect"));
|
||||
|
||||
var _useMergeRefs = _interopRequireDefault(require("../../modules/useMergeRefs"));
|
||||
|
||||
var _usePlatformMethods = _interopRequireDefault(require("../../hooks/usePlatformMethods"));
|
||||
|
||||
var _useResponderEvents = _interopRequireDefault(require("../../hooks/useResponderEvents"));
|
||||
|
||||
var _StyleSheet = _interopRequireDefault(require("../StyleSheet"));
|
||||
|
||||
var _TextInputState = _interopRequireDefault(require("../../modules/TextInputState"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Determines whether a 'selection' prop differs from a node's existing
|
||||
* selection state.
|
||||
*/
|
||||
var isSelectionStale = function isSelectionStale(node, selection) {
|
||||
var selectionEnd = node.selectionEnd,
|
||||
selectionStart = node.selectionStart;
|
||||
var start = selection.start,
|
||||
end = selection.end;
|
||||
return start !== selectionStart || end !== selectionEnd;
|
||||
};
|
||||
/**
|
||||
* Certain input types do no support 'selectSelectionRange' and will throw an
|
||||
* error.
|
||||
*/
|
||||
|
||||
|
||||
var setSelection = function setSelection(node, selection) {
|
||||
if (isSelectionStale(node, selection)) {
|
||||
var start = selection.start,
|
||||
end = selection.end;
|
||||
|
||||
try {
|
||||
node.setSelectionRange(start, end || start);
|
||||
} catch (e) {}
|
||||
}
|
||||
};
|
||||
|
||||
var forwardPropsList = {
|
||||
accessibilityLabel: true,
|
||||
accessibilityLiveRegion: true,
|
||||
accessibilityRole: true,
|
||||
accessibilityState: true,
|
||||
accessibilityValue: true,
|
||||
accessible: true,
|
||||
autoCapitalize: true,
|
||||
autoComplete: true,
|
||||
autoCorrect: true,
|
||||
autoFocus: true,
|
||||
children: true,
|
||||
classList: true,
|
||||
defaultValue: true,
|
||||
dir: true,
|
||||
disabled: true,
|
||||
importantForAccessibility: true,
|
||||
maxLength: true,
|
||||
nativeID: true,
|
||||
onBlur: true,
|
||||
onChange: true,
|
||||
onClick: true,
|
||||
onClickCapture: true,
|
||||
onContextMenu: true,
|
||||
onFocus: true,
|
||||
onScroll: true,
|
||||
onTouchCancel: true,
|
||||
onTouchCancelCapture: true,
|
||||
onTouchEnd: true,
|
||||
onTouchEndCapture: true,
|
||||
onTouchMove: true,
|
||||
onTouchMoveCapture: true,
|
||||
onTouchStart: true,
|
||||
onTouchStartCapture: true,
|
||||
placeholder: true,
|
||||
pointerEvents: true,
|
||||
readOnly: true,
|
||||
ref: true,
|
||||
rows: true,
|
||||
spellCheck: true,
|
||||
style: true,
|
||||
value: true,
|
||||
testID: true,
|
||||
type: true,
|
||||
// unstable
|
||||
dataSet: true,
|
||||
onMouseDown: true,
|
||||
onMouseEnter: true,
|
||||
onMouseLeave: true,
|
||||
onMouseMove: true,
|
||||
onMouseOver: true,
|
||||
onMouseOut: true,
|
||||
onMouseUp: true
|
||||
};
|
||||
|
||||
var pickProps = function pickProps(props) {
|
||||
return (0, _pick.default)(props, forwardPropsList);
|
||||
}; // If an Input Method Editor is processing key input, the 'keyCode' is 229.
|
||||
// https://www.w3.org/TR/uievents/#determine-keydown-keyup-keyCode
|
||||
|
||||
|
||||
function isEventComposing(nativeEvent) {
|
||||
return nativeEvent.isComposing || nativeEvent.keyCode === 229;
|
||||
}
|
||||
|
||||
var TextInput = (0, _react.forwardRef)(function (props, forwardedRef) {
|
||||
var _props$autoCapitalize = props.autoCapitalize,
|
||||
autoCapitalize = _props$autoCapitalize === void 0 ? 'sentences' : _props$autoCapitalize,
|
||||
autoComplete = props.autoComplete,
|
||||
autoCompleteType = props.autoCompleteType,
|
||||
_props$autoCorrect = props.autoCorrect,
|
||||
autoCorrect = _props$autoCorrect === void 0 ? true : _props$autoCorrect,
|
||||
blurOnSubmit = props.blurOnSubmit,
|
||||
clearTextOnFocus = props.clearTextOnFocus,
|
||||
dir = props.dir,
|
||||
_props$editable = props.editable,
|
||||
editable = _props$editable === void 0 ? true : _props$editable,
|
||||
_props$keyboardType = props.keyboardType,
|
||||
keyboardType = _props$keyboardType === void 0 ? 'default' : _props$keyboardType,
|
||||
_props$multiline = props.multiline,
|
||||
multiline = _props$multiline === void 0 ? false : _props$multiline,
|
||||
_props$numberOfLines = props.numberOfLines,
|
||||
numberOfLines = _props$numberOfLines === void 0 ? 1 : _props$numberOfLines,
|
||||
onBlur = props.onBlur,
|
||||
onChange = props.onChange,
|
||||
onChangeText = props.onChangeText,
|
||||
onContentSizeChange = props.onContentSizeChange,
|
||||
onFocus = props.onFocus,
|
||||
onKeyPress = props.onKeyPress,
|
||||
onLayout = props.onLayout,
|
||||
onMoveShouldSetResponder = props.onMoveShouldSetResponder,
|
||||
onMoveShouldSetResponderCapture = props.onMoveShouldSetResponderCapture,
|
||||
onResponderEnd = props.onResponderEnd,
|
||||
onResponderGrant = props.onResponderGrant,
|
||||
onResponderMove = props.onResponderMove,
|
||||
onResponderReject = props.onResponderReject,
|
||||
onResponderRelease = props.onResponderRelease,
|
||||
onResponderStart = props.onResponderStart,
|
||||
onResponderTerminate = props.onResponderTerminate,
|
||||
onResponderTerminationRequest = props.onResponderTerminationRequest,
|
||||
onScrollShouldSetResponder = props.onScrollShouldSetResponder,
|
||||
onScrollShouldSetResponderCapture = props.onScrollShouldSetResponderCapture,
|
||||
onSelectionChange = props.onSelectionChange,
|
||||
onSelectionChangeShouldSetResponder = props.onSelectionChangeShouldSetResponder,
|
||||
onSelectionChangeShouldSetResponderCapture = props.onSelectionChangeShouldSetResponderCapture,
|
||||
onStartShouldSetResponder = props.onStartShouldSetResponder,
|
||||
onStartShouldSetResponderCapture = props.onStartShouldSetResponderCapture,
|
||||
onSubmitEditing = props.onSubmitEditing,
|
||||
placeholderTextColor = props.placeholderTextColor,
|
||||
returnKeyType = props.returnKeyType,
|
||||
_props$secureTextEntr = props.secureTextEntry,
|
||||
secureTextEntry = _props$secureTextEntr === void 0 ? false : _props$secureTextEntr,
|
||||
selection = props.selection,
|
||||
selectTextOnFocus = props.selectTextOnFocus,
|
||||
spellCheck = props.spellCheck;
|
||||
var type;
|
||||
var inputMode;
|
||||
|
||||
switch (keyboardType) {
|
||||
case 'email-address':
|
||||
type = 'email';
|
||||
break;
|
||||
|
||||
case 'number-pad':
|
||||
case 'numeric':
|
||||
inputMode = 'numeric';
|
||||
break;
|
||||
|
||||
case 'decimal-pad':
|
||||
inputMode = 'decimal';
|
||||
break;
|
||||
|
||||
case 'phone-pad':
|
||||
type = 'tel';
|
||||
break;
|
||||
|
||||
case 'search':
|
||||
case 'web-search':
|
||||
type = 'search';
|
||||
break;
|
||||
|
||||
case 'url':
|
||||
type = 'url';
|
||||
break;
|
||||
|
||||
default:
|
||||
type = 'text';
|
||||
}
|
||||
|
||||
if (secureTextEntry) {
|
||||
type = 'password';
|
||||
}
|
||||
|
||||
var dimensions = (0, _react.useRef)({
|
||||
height: null,
|
||||
width: null
|
||||
});
|
||||
var hostRef = (0, _react.useRef)(null);
|
||||
var handleContentSizeChange = (0, _react.useCallback)(function () {
|
||||
var node = hostRef.current;
|
||||
|
||||
if (multiline && onContentSizeChange && node != null) {
|
||||
var newHeight = node.scrollHeight;
|
||||
var newWidth = node.scrollWidth;
|
||||
|
||||
if (newHeight !== dimensions.current.height || newWidth !== dimensions.current.width) {
|
||||
dimensions.current.height = newHeight;
|
||||
dimensions.current.width = newWidth;
|
||||
onContentSizeChange({
|
||||
nativeEvent: {
|
||||
contentSize: {
|
||||
height: dimensions.current.height,
|
||||
width: dimensions.current.width
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}, [hostRef, multiline, onContentSizeChange]);
|
||||
var imperativeRef = (0, _react.useMemo)(function () {
|
||||
return function (hostNode) {
|
||||
// TextInput needs to add more methods to the hostNode in addition to those
|
||||
// added by `usePlatformMethods`. This is temporarily until an API like
|
||||
// `TextInput.clear(hostRef)` is added to React Native.
|
||||
if (hostNode != null) {
|
||||
hostNode.clear = function () {
|
||||
if (hostNode != null) {
|
||||
hostNode.value = '';
|
||||
}
|
||||
};
|
||||
|
||||
hostNode.isFocused = function () {
|
||||
return hostNode != null && _TextInputState.default.currentlyFocusedField() === hostNode;
|
||||
};
|
||||
|
||||
handleContentSizeChange();
|
||||
}
|
||||
};
|
||||
}, [handleContentSizeChange]);
|
||||
|
||||
function handleBlur(e) {
|
||||
_TextInputState.default._currentlyFocusedNode = null;
|
||||
|
||||
if (onBlur) {
|
||||
e.nativeEvent.text = e.target.value;
|
||||
onBlur(e);
|
||||
}
|
||||
}
|
||||
|
||||
function handleChange(e) {
|
||||
var text = e.target.value;
|
||||
e.nativeEvent.text = text;
|
||||
handleContentSizeChange();
|
||||
|
||||
if (onChange) {
|
||||
onChange(e);
|
||||
}
|
||||
|
||||
if (onChangeText) {
|
||||
onChangeText(text);
|
||||
}
|
||||
}
|
||||
|
||||
function handleFocus(e) {
|
||||
var node = hostRef.current;
|
||||
|
||||
if (node != null) {
|
||||
_TextInputState.default._currentlyFocusedNode = node;
|
||||
|
||||
if (onFocus) {
|
||||
e.nativeEvent.text = e.target.value;
|
||||
onFocus(e);
|
||||
}
|
||||
|
||||
if (clearTextOnFocus) {
|
||||
node.value = '';
|
||||
}
|
||||
|
||||
if (selectTextOnFocus) {
|
||||
node.select();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function handleKeyDown(e) {
|
||||
// Prevent key events bubbling (see #612)
|
||||
e.stopPropagation();
|
||||
var blurOnSubmitDefault = !multiline;
|
||||
var shouldBlurOnSubmit = blurOnSubmit == null ? blurOnSubmitDefault : blurOnSubmit;
|
||||
var nativeEvent = e.nativeEvent;
|
||||
var isComposing = isEventComposing(nativeEvent);
|
||||
|
||||
if (onKeyPress) {
|
||||
onKeyPress(e);
|
||||
}
|
||||
|
||||
if (e.key === 'Enter' && !e.shiftKey && // Do not call submit if composition is occuring.
|
||||
!isComposing && !e.isDefaultPrevented()) {
|
||||
if ((blurOnSubmit || !multiline) && onSubmitEditing) {
|
||||
// prevent "Enter" from inserting a newline or submitting a form
|
||||
e.preventDefault();
|
||||
nativeEvent.text = e.target.value;
|
||||
onSubmitEditing(e);
|
||||
}
|
||||
|
||||
if (shouldBlurOnSubmit && hostRef.current != null) {
|
||||
hostRef.current.blur();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function handleSelectionChange(e) {
|
||||
if (onSelectionChange) {
|
||||
try {
|
||||
var node = e.target;
|
||||
var selectionStart = node.selectionStart,
|
||||
selectionEnd = node.selectionEnd;
|
||||
e.nativeEvent.selection = {
|
||||
start: selectionStart,
|
||||
end: selectionEnd
|
||||
};
|
||||
e.nativeEvent.text = e.target.value;
|
||||
onSelectionChange(e);
|
||||
} catch (e) {}
|
||||
}
|
||||
}
|
||||
|
||||
(0, _useLayoutEffect.default)(function () {
|
||||
var node = hostRef.current;
|
||||
|
||||
if (node != null && selection != null) {
|
||||
setSelection(node, selection);
|
||||
}
|
||||
|
||||
if (document.activeElement === node) {
|
||||
_TextInputState.default._currentlyFocusedNode = node;
|
||||
}
|
||||
}, [hostRef, selection]);
|
||||
var component = multiline ? 'textarea' : 'input';
|
||||
var classList = [classes.textinput];
|
||||
|
||||
var style = _StyleSheet.default.compose(props.style, placeholderTextColor && {
|
||||
placeholderTextColor: placeholderTextColor
|
||||
});
|
||||
|
||||
(0, _useElementLayout.default)(hostRef, onLayout);
|
||||
(0, _useResponderEvents.default)(hostRef, {
|
||||
onMoveShouldSetResponder: onMoveShouldSetResponder,
|
||||
onMoveShouldSetResponderCapture: onMoveShouldSetResponderCapture,
|
||||
onResponderEnd: onResponderEnd,
|
||||
onResponderGrant: onResponderGrant,
|
||||
onResponderMove: onResponderMove,
|
||||
onResponderReject: onResponderReject,
|
||||
onResponderRelease: onResponderRelease,
|
||||
onResponderStart: onResponderStart,
|
||||
onResponderTerminate: onResponderTerminate,
|
||||
onResponderTerminationRequest: onResponderTerminationRequest,
|
||||
onScrollShouldSetResponder: onScrollShouldSetResponder,
|
||||
onScrollShouldSetResponderCapture: onScrollShouldSetResponderCapture,
|
||||
onSelectionChangeShouldSetResponder: onSelectionChangeShouldSetResponder,
|
||||
onSelectionChangeShouldSetResponderCapture: onSelectionChangeShouldSetResponderCapture,
|
||||
onStartShouldSetResponder: onStartShouldSetResponder,
|
||||
onStartShouldSetResponderCapture: onStartShouldSetResponderCapture
|
||||
});
|
||||
var supportedProps = pickProps(props);
|
||||
supportedProps.autoCapitalize = autoCapitalize;
|
||||
supportedProps.autoComplete = autoComplete || autoCompleteType || 'on';
|
||||
supportedProps.autoCorrect = autoCorrect ? 'on' : 'off';
|
||||
supportedProps.classList = classList; // 'auto' by default allows browsers to infer writing direction
|
||||
|
||||
supportedProps.dir = dir !== undefined ? dir : 'auto';
|
||||
supportedProps.enterkeyhint = returnKeyType;
|
||||
supportedProps.onBlur = handleBlur;
|
||||
supportedProps.onChange = handleChange;
|
||||
supportedProps.onFocus = handleFocus;
|
||||
supportedProps.onKeyDown = handleKeyDown;
|
||||
supportedProps.onSelect = handleSelectionChange;
|
||||
supportedProps.readOnly = !editable;
|
||||
supportedProps.rows = multiline ? numberOfLines : undefined;
|
||||
supportedProps.spellCheck = spellCheck != null ? spellCheck : autoCorrect;
|
||||
supportedProps.style = style;
|
||||
supportedProps.type = multiline ? undefined : type;
|
||||
supportedProps.inputMode = inputMode;
|
||||
var platformMethodsRef = (0, _usePlatformMethods.default)(supportedProps);
|
||||
var setRef = (0, _useMergeRefs.default)(hostRef, platformMethodsRef, imperativeRef, forwardedRef);
|
||||
supportedProps.ref = setRef;
|
||||
return (0, _createElement.default)(component, supportedProps);
|
||||
});
|
||||
TextInput.displayName = 'TextInput'; // $FlowFixMe
|
||||
|
||||
TextInput.State = _TextInputState.default;
|
||||
|
||||
var classes = _css.default.create({
|
||||
textinput: {
|
||||
MozAppearance: 'textfield',
|
||||
WebkitAppearance: 'none',
|
||||
backgroundColor: 'transparent',
|
||||
border: '0 solid black',
|
||||
borderRadius: 0,
|
||||
boxSizing: 'border-box',
|
||||
font: '14px System',
|
||||
margin: 0,
|
||||
padding: 0,
|
||||
resize: 'none'
|
||||
}
|
||||
});
|
||||
|
||||
var _default = TextInput;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
1
node_modules/react-native-web/dist/cjs/exports/TextInput/types.js
generated
vendored
Normal file
1
node_modules/react-native-web/dist/cjs/exports/TextInput/types.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
"use strict";
|
12
node_modules/react-native-web/dist/cjs/exports/ToastAndroid/index.js
generated
vendored
Normal file
12
node_modules/react-native-web/dist/cjs/exports/ToastAndroid/index.js
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _UnimplementedView = _interopRequireDefault(require("../../modules/UnimplementedView"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var _default = _UnimplementedView.default;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
42
node_modules/react-native-web/dist/cjs/exports/Touchable/BoundingDimensions.js
generated
vendored
Normal file
42
node_modules/react-native-web/dist/cjs/exports/Touchable/BoundingDimensions.js
generated
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _PooledClass = _interopRequireDefault(require("../../vendor/react-native/PooledClass"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
var twoArgumentPooler = _PooledClass.default.twoArgumentPooler;
|
||||
/**
|
||||
* PooledClass representing the bounding rectangle of a region.
|
||||
*/
|
||||
|
||||
function BoundingDimensions(width, height) {
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
}
|
||||
|
||||
BoundingDimensions.prototype.destructor = function () {
|
||||
this.width = null;
|
||||
this.height = null;
|
||||
};
|
||||
|
||||
BoundingDimensions.getPooledFromElement = function (element) {
|
||||
return BoundingDimensions.getPooled(element.offsetWidth, element.offsetHeight);
|
||||
};
|
||||
|
||||
_PooledClass.default.addPoolingTo(BoundingDimensions, twoArgumentPooler);
|
||||
|
||||
var _default = BoundingDimensions;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
34
node_modules/react-native-web/dist/cjs/exports/Touchable/Position.js
generated
vendored
Normal file
34
node_modules/react-native-web/dist/cjs/exports/Touchable/Position.js
generated
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _PooledClass = _interopRequireDefault(require("../../vendor/react-native/PooledClass"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
var twoArgumentPooler = _PooledClass.default.twoArgumentPooler;
|
||||
|
||||
function Position(left, top) {
|
||||
this.left = left;
|
||||
this.top = top;
|
||||
}
|
||||
|
||||
Position.prototype.destructor = function () {
|
||||
this.left = null;
|
||||
this.top = null;
|
||||
};
|
||||
|
||||
_PooledClass.default.addPoolingTo(Position, twoArgumentPooler);
|
||||
|
||||
var _default = Position;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
24
node_modules/react-native-web/dist/cjs/exports/Touchable/ensurePositiveDelayProps.js
generated
vendored
Normal file
24
node_modules/react-native-web/dist/cjs/exports/Touchable/ensurePositiveDelayProps.js
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _invariant = _interopRequireDefault(require("fbjs/lib/invariant"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
var ensurePositiveDelayProps = function ensurePositiveDelayProps(props) {
|
||||
(0, _invariant.default)(!(props.delayPressIn < 0 || props.delayPressOut < 0 || props.delayLongPress < 0), 'Touchable components cannot have negative delay properties');
|
||||
};
|
||||
|
||||
var _default = ensurePositiveDelayProps;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
916
node_modules/react-native-web/dist/cjs/exports/Touchable/index.js
generated
vendored
Normal file
916
node_modules/react-native-web/dist/cjs/exports/Touchable/index.js
generated
vendored
Normal file
@ -0,0 +1,916 @@
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _AccessibilityUtil = _interopRequireDefault(require("../../modules/AccessibilityUtil"));
|
||||
|
||||
var _BoundingDimensions = _interopRequireDefault(require("./BoundingDimensions"));
|
||||
|
||||
var _findNodeHandle = _interopRequireDefault(require("../findNodeHandle"));
|
||||
|
||||
var _normalizeCssColor = _interopRequireDefault(require("normalize-css-color"));
|
||||
|
||||
var _Position = _interopRequireDefault(require("./Position"));
|
||||
|
||||
var _react = _interopRequireDefault(require("react"));
|
||||
|
||||
var _UIManager = _interopRequireDefault(require("../UIManager"));
|
||||
|
||||
var _View = _interopRequireDefault(require("../View"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
||||
|
||||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
||||
|
||||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
var extractSingleTouch = function extractSingleTouch(nativeEvent) {
|
||||
var touches = nativeEvent.touches;
|
||||
var changedTouches = nativeEvent.changedTouches;
|
||||
var hasTouches = touches && touches.length > 0;
|
||||
var hasChangedTouches = changedTouches && changedTouches.length > 0;
|
||||
return !hasTouches && hasChangedTouches ? changedTouches[0] : hasTouches ? touches[0] : nativeEvent;
|
||||
};
|
||||
/**
|
||||
* `Touchable`: Taps done right.
|
||||
*
|
||||
* You hook your `ResponderEventPlugin` events into `Touchable`. `Touchable`
|
||||
* will measure time/geometry and tells you when to give feedback to the user.
|
||||
*
|
||||
* ====================== Touchable Tutorial ===============================
|
||||
* The `Touchable` mixin helps you handle the "press" interaction. It analyzes
|
||||
* the geometry of elements, and observes when another responder (scroll view
|
||||
* etc) has stolen the touch lock. It notifies your component when it should
|
||||
* give feedback to the user. (bouncing/highlighting/unhighlighting).
|
||||
*
|
||||
* - When a touch was activated (typically you highlight)
|
||||
* - When a touch was deactivated (typically you unhighlight)
|
||||
* - When a touch was "pressed" - a touch ended while still within the geometry
|
||||
* of the element, and no other element (like scroller) has "stolen" touch
|
||||
* lock ("responder") (Typically you bounce the element).
|
||||
*
|
||||
* A good tap interaction isn't as simple as you might think. There should be a
|
||||
* slight delay before showing a highlight when starting a touch. If a
|
||||
* subsequent touch move exceeds the boundary of the element, it should
|
||||
* unhighlight, but if that same touch is brought back within the boundary, it
|
||||
* should rehighlight again. A touch can move in and out of that boundary
|
||||
* several times, each time toggling highlighting, but a "press" is only
|
||||
* triggered if that touch ends while within the element's boundary and no
|
||||
* scroller (or anything else) has stolen the lock on touches.
|
||||
*
|
||||
* To create a new type of component that handles interaction using the
|
||||
* `Touchable` mixin, do the following:
|
||||
*
|
||||
* - Initialize the `Touchable` state.
|
||||
*
|
||||
* getInitialState: function() {
|
||||
* return merge(this.touchableGetInitialState(), yourComponentState);
|
||||
* }
|
||||
*
|
||||
* - Choose the rendered component who's touches should start the interactive
|
||||
* sequence. On that rendered node, forward all `Touchable` responder
|
||||
* handlers. You can choose any rendered node you like. Choose a node whose
|
||||
* hit target you'd like to instigate the interaction sequence:
|
||||
*
|
||||
* // In render function:
|
||||
* return (
|
||||
* <View
|
||||
* onStartShouldSetResponder={this.touchableHandleStartShouldSetResponder}
|
||||
* onResponderTerminationRequest={this.touchableHandleResponderTerminationRequest}
|
||||
* onResponderGrant={this.touchableHandleResponderGrant}
|
||||
* onResponderMove={this.touchableHandleResponderMove}
|
||||
* onResponderRelease={this.touchableHandleResponderRelease}
|
||||
* onResponderTerminate={this.touchableHandleResponderTerminate}>
|
||||
* <View>
|
||||
* Even though the hit detection/interactions are triggered by the
|
||||
* wrapping (typically larger) node, we usually end up implementing
|
||||
* custom logic that highlights this inner one.
|
||||
* </View>
|
||||
* </View>
|
||||
* );
|
||||
*
|
||||
* - You may set up your own handlers for each of these events, so long as you
|
||||
* also invoke the `touchable*` handlers inside of your custom handler.
|
||||
*
|
||||
* - Implement the handlers on your component class in order to provide
|
||||
* feedback to the user. See documentation for each of these class methods
|
||||
* that you should implement.
|
||||
*
|
||||
* touchableHandlePress: function() {
|
||||
* this.performBounceAnimation(); // or whatever you want to do.
|
||||
* },
|
||||
* touchableHandleActivePressIn: function() {
|
||||
* this.beginHighlighting(...); // Whatever you like to convey activation
|
||||
* },
|
||||
* touchableHandleActivePressOut: function() {
|
||||
* this.endHighlighting(...); // Whatever you like to convey deactivation
|
||||
* },
|
||||
*
|
||||
* - There are more advanced methods you can implement (see documentation below):
|
||||
* touchableGetHighlightDelayMS: function() {
|
||||
* return 20;
|
||||
* }
|
||||
* // In practice, *always* use a predeclared constant (conserve memory).
|
||||
* touchableGetPressRectOffset: function() {
|
||||
* return {top: 20, left: 20, right: 20, bottom: 100};
|
||||
* }
|
||||
*/
|
||||
|
||||
/**
|
||||
* Touchable states.
|
||||
*/
|
||||
|
||||
|
||||
var States = {
|
||||
NOT_RESPONDER: 'NOT_RESPONDER',
|
||||
// Not the responder
|
||||
RESPONDER_INACTIVE_PRESS_IN: 'RESPONDER_INACTIVE_PRESS_IN',
|
||||
// Responder, inactive, in the `PressRect`
|
||||
RESPONDER_INACTIVE_PRESS_OUT: 'RESPONDER_INACTIVE_PRESS_OUT',
|
||||
// Responder, inactive, out of `PressRect`
|
||||
RESPONDER_ACTIVE_PRESS_IN: 'RESPONDER_ACTIVE_PRESS_IN',
|
||||
// Responder, active, in the `PressRect`
|
||||
RESPONDER_ACTIVE_PRESS_OUT: 'RESPONDER_ACTIVE_PRESS_OUT',
|
||||
// Responder, active, out of `PressRect`
|
||||
RESPONDER_ACTIVE_LONG_PRESS_IN: 'RESPONDER_ACTIVE_LONG_PRESS_IN',
|
||||
// Responder, active, in the `PressRect`, after long press threshold
|
||||
RESPONDER_ACTIVE_LONG_PRESS_OUT: 'RESPONDER_ACTIVE_LONG_PRESS_OUT',
|
||||
// Responder, active, out of `PressRect`, after long press threshold
|
||||
ERROR: 'ERROR'
|
||||
};
|
||||
|
||||
/*
|
||||
* Quick lookup map for states that are considered to be "active"
|
||||
*/
|
||||
var baseStatesConditions = {
|
||||
NOT_RESPONDER: false,
|
||||
RESPONDER_INACTIVE_PRESS_IN: false,
|
||||
RESPONDER_INACTIVE_PRESS_OUT: false,
|
||||
RESPONDER_ACTIVE_PRESS_IN: false,
|
||||
RESPONDER_ACTIVE_PRESS_OUT: false,
|
||||
RESPONDER_ACTIVE_LONG_PRESS_IN: false,
|
||||
RESPONDER_ACTIVE_LONG_PRESS_OUT: false,
|
||||
ERROR: false
|
||||
};
|
||||
|
||||
var IsActive = _objectSpread({}, baseStatesConditions, {
|
||||
RESPONDER_ACTIVE_PRESS_OUT: true,
|
||||
RESPONDER_ACTIVE_PRESS_IN: true
|
||||
});
|
||||
/**
|
||||
* Quick lookup for states that are considered to be "pressing" and are
|
||||
* therefore eligible to result in a "selection" if the press stops.
|
||||
*/
|
||||
|
||||
|
||||
var IsPressingIn = _objectSpread({}, baseStatesConditions, {
|
||||
RESPONDER_INACTIVE_PRESS_IN: true,
|
||||
RESPONDER_ACTIVE_PRESS_IN: true,
|
||||
RESPONDER_ACTIVE_LONG_PRESS_IN: true
|
||||
});
|
||||
|
||||
var IsLongPressingIn = _objectSpread({}, baseStatesConditions, {
|
||||
RESPONDER_ACTIVE_LONG_PRESS_IN: true
|
||||
});
|
||||
/**
|
||||
* Inputs to the state machine.
|
||||
*/
|
||||
|
||||
|
||||
var Signals = {
|
||||
DELAY: 'DELAY',
|
||||
RESPONDER_GRANT: 'RESPONDER_GRANT',
|
||||
RESPONDER_RELEASE: 'RESPONDER_RELEASE',
|
||||
RESPONDER_TERMINATED: 'RESPONDER_TERMINATED',
|
||||
ENTER_PRESS_RECT: 'ENTER_PRESS_RECT',
|
||||
LEAVE_PRESS_RECT: 'LEAVE_PRESS_RECT',
|
||||
LONG_PRESS_DETECTED: 'LONG_PRESS_DETECTED'
|
||||
};
|
||||
|
||||
/**
|
||||
* Mapping from States x Signals => States
|
||||
*/
|
||||
var Transitions = {
|
||||
NOT_RESPONDER: {
|
||||
DELAY: States.ERROR,
|
||||
RESPONDER_GRANT: States.RESPONDER_INACTIVE_PRESS_IN,
|
||||
RESPONDER_RELEASE: States.ERROR,
|
||||
RESPONDER_TERMINATED: States.ERROR,
|
||||
ENTER_PRESS_RECT: States.ERROR,
|
||||
LEAVE_PRESS_RECT: States.ERROR,
|
||||
LONG_PRESS_DETECTED: States.ERROR
|
||||
},
|
||||
RESPONDER_INACTIVE_PRESS_IN: {
|
||||
DELAY: States.RESPONDER_ACTIVE_PRESS_IN,
|
||||
RESPONDER_GRANT: States.ERROR,
|
||||
RESPONDER_RELEASE: States.NOT_RESPONDER,
|
||||
RESPONDER_TERMINATED: States.NOT_RESPONDER,
|
||||
ENTER_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_IN,
|
||||
LEAVE_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_OUT,
|
||||
LONG_PRESS_DETECTED: States.ERROR
|
||||
},
|
||||
RESPONDER_INACTIVE_PRESS_OUT: {
|
||||
DELAY: States.RESPONDER_ACTIVE_PRESS_OUT,
|
||||
RESPONDER_GRANT: States.ERROR,
|
||||
RESPONDER_RELEASE: States.NOT_RESPONDER,
|
||||
RESPONDER_TERMINATED: States.NOT_RESPONDER,
|
||||
ENTER_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_IN,
|
||||
LEAVE_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_OUT,
|
||||
LONG_PRESS_DETECTED: States.ERROR
|
||||
},
|
||||
RESPONDER_ACTIVE_PRESS_IN: {
|
||||
DELAY: States.ERROR,
|
||||
RESPONDER_GRANT: States.ERROR,
|
||||
RESPONDER_RELEASE: States.NOT_RESPONDER,
|
||||
RESPONDER_TERMINATED: States.NOT_RESPONDER,
|
||||
ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_IN,
|
||||
LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_OUT,
|
||||
LONG_PRESS_DETECTED: States.RESPONDER_ACTIVE_LONG_PRESS_IN
|
||||
},
|
||||
RESPONDER_ACTIVE_PRESS_OUT: {
|
||||
DELAY: States.ERROR,
|
||||
RESPONDER_GRANT: States.ERROR,
|
||||
RESPONDER_RELEASE: States.NOT_RESPONDER,
|
||||
RESPONDER_TERMINATED: States.NOT_RESPONDER,
|
||||
ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_IN,
|
||||
LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_OUT,
|
||||
LONG_PRESS_DETECTED: States.ERROR
|
||||
},
|
||||
RESPONDER_ACTIVE_LONG_PRESS_IN: {
|
||||
DELAY: States.ERROR,
|
||||
RESPONDER_GRANT: States.ERROR,
|
||||
RESPONDER_RELEASE: States.NOT_RESPONDER,
|
||||
RESPONDER_TERMINATED: States.NOT_RESPONDER,
|
||||
ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_IN,
|
||||
LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_OUT,
|
||||
LONG_PRESS_DETECTED: States.RESPONDER_ACTIVE_LONG_PRESS_IN
|
||||
},
|
||||
RESPONDER_ACTIVE_LONG_PRESS_OUT: {
|
||||
DELAY: States.ERROR,
|
||||
RESPONDER_GRANT: States.ERROR,
|
||||
RESPONDER_RELEASE: States.NOT_RESPONDER,
|
||||
RESPONDER_TERMINATED: States.NOT_RESPONDER,
|
||||
ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_IN,
|
||||
LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_OUT,
|
||||
LONG_PRESS_DETECTED: States.ERROR
|
||||
},
|
||||
error: {
|
||||
DELAY: States.NOT_RESPONDER,
|
||||
RESPONDER_GRANT: States.RESPONDER_INACTIVE_PRESS_IN,
|
||||
RESPONDER_RELEASE: States.NOT_RESPONDER,
|
||||
RESPONDER_TERMINATED: States.NOT_RESPONDER,
|
||||
ENTER_PRESS_RECT: States.NOT_RESPONDER,
|
||||
LEAVE_PRESS_RECT: States.NOT_RESPONDER,
|
||||
LONG_PRESS_DETECTED: States.NOT_RESPONDER
|
||||
}
|
||||
}; // ==== Typical Constants for integrating into UI components ====
|
||||
// var HIT_EXPAND_PX = 20;
|
||||
// var HIT_VERT_OFFSET_PX = 10;
|
||||
|
||||
var HIGHLIGHT_DELAY_MS = 130;
|
||||
var PRESS_EXPAND_PX = 20;
|
||||
var LONG_PRESS_THRESHOLD = 500;
|
||||
var LONG_PRESS_DELAY_MS = LONG_PRESS_THRESHOLD - HIGHLIGHT_DELAY_MS;
|
||||
var LONG_PRESS_ALLOWED_MOVEMENT = 10; // Default amount "active" region protrudes beyond box
|
||||
|
||||
/**
|
||||
* By convention, methods prefixed with underscores are meant to be @private,
|
||||
* and not @protected. Mixers shouldn't access them - not even to provide them
|
||||
* as callback handlers.
|
||||
*
|
||||
*
|
||||
* ========== Geometry =========
|
||||
* `Touchable` only assumes that there exists a `HitRect` node. The `PressRect`
|
||||
* is an abstract box that is extended beyond the `HitRect`.
|
||||
*
|
||||
* +--------------------------+
|
||||
* | | - "Start" events in `HitRect` cause `HitRect`
|
||||
* | +--------------------+ | to become the responder.
|
||||
* | | +--------------+ | | - `HitRect` is typically expanded around
|
||||
* | | | | | | the `VisualRect`, but shifted downward.
|
||||
* | | | VisualRect | | | - After pressing down, after some delay,
|
||||
* | | | | | | and before letting up, the Visual React
|
||||
* | | +--------------+ | | will become "active". This makes it eligible
|
||||
* | | HitRect | | for being highlighted (so long as the
|
||||
* | +--------------------+ | press remains in the `PressRect`).
|
||||
* | PressRect o |
|
||||
* +----------------------|---+
|
||||
* Out Region |
|
||||
* +-----+ This gap between the `HitRect` and
|
||||
* `PressRect` allows a touch to move far away
|
||||
* from the original hit rect, and remain
|
||||
* highlighted, and eligible for a "Press".
|
||||
* Customize this via
|
||||
* `touchableGetPressRectOffset()`.
|
||||
*
|
||||
*
|
||||
*
|
||||
* ======= State Machine =======
|
||||
*
|
||||
* +-------------+ <---+ RESPONDER_RELEASE
|
||||
* |NOT_RESPONDER|
|
||||
* +-------------+ <---+ RESPONDER_TERMINATED
|
||||
* +
|
||||
* | RESPONDER_GRANT (HitRect)
|
||||
* v
|
||||
* +---------------------------+ DELAY +-------------------------+ T + DELAY +------------------------------+
|
||||
* |RESPONDER_INACTIVE_PRESS_IN|+-------->|RESPONDER_ACTIVE_PRESS_IN| +------------> |RESPONDER_ACTIVE_LONG_PRESS_IN|
|
||||
* +---------------------------+ +-------------------------+ +------------------------------+
|
||||
* + ^ + ^ + ^
|
||||
* |LEAVE_ |ENTER_ |LEAVE_ |ENTER_ |LEAVE_ |ENTER_
|
||||
* |PRESS_RECT |PRESS_RECT |PRESS_RECT |PRESS_RECT |PRESS_RECT |PRESS_RECT
|
||||
* | | | | | |
|
||||
* v + v + v +
|
||||
* +----------------------------+ DELAY +--------------------------+ +-------------------------------+
|
||||
* |RESPONDER_INACTIVE_PRESS_OUT|+------->|RESPONDER_ACTIVE_PRESS_OUT| |RESPONDER_ACTIVE_LONG_PRESS_OUT|
|
||||
* +----------------------------+ +--------------------------+ +-------------------------------+
|
||||
*
|
||||
* T + DELAY => LONG_PRESS_DELAY_MS + DELAY
|
||||
*
|
||||
* Not drawn are the side effects of each transition. The most important side
|
||||
* effect is the `touchableHandlePress` abstract method invocation that occurs
|
||||
* when a responder is released while in either of the "Press" states.
|
||||
*
|
||||
* The other important side effects are the highlight abstract method
|
||||
* invocations (internal callbacks) to be implemented by the mixer.
|
||||
*
|
||||
*
|
||||
* @lends Touchable.prototype
|
||||
*/
|
||||
|
||||
var TouchableMixin = {
|
||||
// HACK (part 1): basic support for touchable interactions using a keyboard
|
||||
componentDidMount: function componentDidMount() {
|
||||
var _this = this;
|
||||
|
||||
this._touchableNode = (0, _findNodeHandle.default)(this);
|
||||
|
||||
if (this._touchableNode && this._touchableNode.addEventListener) {
|
||||
this._touchableBlurListener = function (e) {
|
||||
if (_this._isTouchableKeyboardActive) {
|
||||
if (_this.state.touchable.touchState && _this.state.touchable.touchState !== States.NOT_RESPONDER) {
|
||||
_this.touchableHandleResponderTerminate({
|
||||
nativeEvent: e
|
||||
});
|
||||
}
|
||||
|
||||
_this._isTouchableKeyboardActive = false;
|
||||
}
|
||||
};
|
||||
|
||||
this._touchableNode.addEventListener('blur', this._touchableBlurListener);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Clear all timeouts on unmount
|
||||
*/
|
||||
componentWillUnmount: function componentWillUnmount() {
|
||||
if (this._touchableNode && this._touchableNode.addEventListener) {
|
||||
this._touchableNode.removeEventListener('blur', this._touchableBlurListener);
|
||||
}
|
||||
|
||||
this.touchableDelayTimeout && clearTimeout(this.touchableDelayTimeout);
|
||||
this.longPressDelayTimeout && clearTimeout(this.longPressDelayTimeout);
|
||||
this.pressOutDelayTimeout && clearTimeout(this.pressOutDelayTimeout);
|
||||
},
|
||||
|
||||
/**
|
||||
* It's prefer that mixins determine state in this way, having the class
|
||||
* explicitly mix the state in the one and only `getInitialState` method.
|
||||
*
|
||||
* @return {object} State object to be placed inside of
|
||||
* `this.state.touchable`.
|
||||
*/
|
||||
touchableGetInitialState: function touchableGetInitialState() {
|
||||
return {
|
||||
touchable: {
|
||||
touchState: undefined,
|
||||
responderID: null
|
||||
}
|
||||
};
|
||||
},
|
||||
// ==== Hooks to Gesture Responder system ====
|
||||
|
||||
/**
|
||||
* Must return true if embedded in a native platform scroll view.
|
||||
*/
|
||||
touchableHandleResponderTerminationRequest: function touchableHandleResponderTerminationRequest() {
|
||||
return !this.props.rejectResponderTermination;
|
||||
},
|
||||
|
||||
/**
|
||||
* Must return true to start the process of `Touchable`.
|
||||
*/
|
||||
touchableHandleStartShouldSetResponder: function touchableHandleStartShouldSetResponder() {
|
||||
return !this.props.disabled;
|
||||
},
|
||||
|
||||
/**
|
||||
* Return true to cancel press on long press.
|
||||
*/
|
||||
touchableLongPressCancelsPress: function touchableLongPressCancelsPress() {
|
||||
return true;
|
||||
},
|
||||
|
||||
/**
|
||||
* Place as callback for a DOM element's `onResponderGrant` event.
|
||||
* @param {SyntheticEvent} e Synthetic event from event system.
|
||||
*
|
||||
*/
|
||||
touchableHandleResponderGrant: function touchableHandleResponderGrant(e) {
|
||||
var dispatchID = e.currentTarget; // Since e is used in a callback invoked on another event loop
|
||||
// (as in setTimeout etc), we need to call e.persist() on the
|
||||
// event to make sure it doesn't get reused in the event object pool.
|
||||
|
||||
e.persist();
|
||||
this.pressOutDelayTimeout && clearTimeout(this.pressOutDelayTimeout);
|
||||
this.pressOutDelayTimeout = null;
|
||||
this.state.touchable.touchState = States.NOT_RESPONDER;
|
||||
this.state.touchable.responderID = dispatchID;
|
||||
|
||||
this._receiveSignal(Signals.RESPONDER_GRANT, e);
|
||||
|
||||
var delayMS = this.touchableGetHighlightDelayMS !== undefined ? Math.max(this.touchableGetHighlightDelayMS(), 0) : HIGHLIGHT_DELAY_MS;
|
||||
delayMS = isNaN(delayMS) ? HIGHLIGHT_DELAY_MS : delayMS;
|
||||
|
||||
if (delayMS !== 0) {
|
||||
this.touchableDelayTimeout = setTimeout(this._handleDelay.bind(this, e), delayMS);
|
||||
} else {
|
||||
this._handleDelay(e);
|
||||
}
|
||||
|
||||
var longDelayMS = this.touchableGetLongPressDelayMS !== undefined ? Math.max(this.touchableGetLongPressDelayMS(), 10) : LONG_PRESS_DELAY_MS;
|
||||
longDelayMS = isNaN(longDelayMS) ? LONG_PRESS_DELAY_MS : longDelayMS;
|
||||
this.longPressDelayTimeout = setTimeout(this._handleLongDelay.bind(this, e), longDelayMS + delayMS);
|
||||
},
|
||||
|
||||
/**
|
||||
* Place as callback for a DOM element's `onResponderRelease` event.
|
||||
*/
|
||||
touchableHandleResponderRelease: function touchableHandleResponderRelease(e) {
|
||||
this.pressInLocation = null;
|
||||
|
||||
this._receiveSignal(Signals.RESPONDER_RELEASE, e);
|
||||
},
|
||||
|
||||
/**
|
||||
* Place as callback for a DOM element's `onResponderTerminate` event.
|
||||
*/
|
||||
touchableHandleResponderTerminate: function touchableHandleResponderTerminate(e) {
|
||||
this.pressInLocation = null;
|
||||
|
||||
this._receiveSignal(Signals.RESPONDER_TERMINATED, e);
|
||||
},
|
||||
|
||||
/**
|
||||
* Place as callback for a DOM element's `onResponderMove` event.
|
||||
*/
|
||||
touchableHandleResponderMove: function touchableHandleResponderMove(e) {
|
||||
// Measurement may not have returned yet.
|
||||
if (!this.state.touchable.positionOnActivate) {
|
||||
return;
|
||||
}
|
||||
|
||||
var positionOnActivate = this.state.touchable.positionOnActivate;
|
||||
var dimensionsOnActivate = this.state.touchable.dimensionsOnActivate;
|
||||
var pressRectOffset = this.touchableGetPressRectOffset ? this.touchableGetPressRectOffset() : {
|
||||
left: PRESS_EXPAND_PX,
|
||||
right: PRESS_EXPAND_PX,
|
||||
top: PRESS_EXPAND_PX,
|
||||
bottom: PRESS_EXPAND_PX
|
||||
};
|
||||
var pressExpandLeft = pressRectOffset.left;
|
||||
var pressExpandTop = pressRectOffset.top;
|
||||
var pressExpandRight = pressRectOffset.right;
|
||||
var pressExpandBottom = pressRectOffset.bottom;
|
||||
var hitSlop = this.touchableGetHitSlop ? this.touchableGetHitSlop() : null;
|
||||
|
||||
if (hitSlop) {
|
||||
pressExpandLeft += hitSlop.left || 0;
|
||||
pressExpandTop += hitSlop.top || 0;
|
||||
pressExpandRight += hitSlop.right || 0;
|
||||
pressExpandBottom += hitSlop.bottom || 0;
|
||||
}
|
||||
|
||||
var touch = extractSingleTouch(e.nativeEvent);
|
||||
var pageX = touch && touch.pageX;
|
||||
var pageY = touch && touch.pageY;
|
||||
|
||||
if (this.pressInLocation) {
|
||||
var movedDistance = this._getDistanceBetweenPoints(pageX, pageY, this.pressInLocation.pageX, this.pressInLocation.pageY);
|
||||
|
||||
if (movedDistance > LONG_PRESS_ALLOWED_MOVEMENT) {
|
||||
this._cancelLongPressDelayTimeout();
|
||||
}
|
||||
}
|
||||
|
||||
var isTouchWithinActive = pageX > positionOnActivate.left - pressExpandLeft && pageY > positionOnActivate.top - pressExpandTop && pageX < positionOnActivate.left + dimensionsOnActivate.width + pressExpandRight && pageY < positionOnActivate.top + dimensionsOnActivate.height + pressExpandBottom;
|
||||
|
||||
if (isTouchWithinActive) {
|
||||
var prevState = this.state.touchable.touchState;
|
||||
|
||||
this._receiveSignal(Signals.ENTER_PRESS_RECT, e);
|
||||
|
||||
var curState = this.state.touchable.touchState;
|
||||
|
||||
if (curState === States.RESPONDER_INACTIVE_PRESS_IN && prevState !== States.RESPONDER_INACTIVE_PRESS_IN) {
|
||||
// fix for t7967420
|
||||
this._cancelLongPressDelayTimeout();
|
||||
}
|
||||
} else {
|
||||
this._cancelLongPressDelayTimeout();
|
||||
|
||||
this._receiveSignal(Signals.LEAVE_PRESS_RECT, e);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Invoked when the item receives focus. Mixers might override this to
|
||||
* visually distinguish the `VisualRect` so that the user knows that it
|
||||
* currently has the focus. Most platforms only support a single element being
|
||||
* focused at a time, in which case there may have been a previously focused
|
||||
* element that was blurred just prior to this. This can be overridden when
|
||||
* using `Touchable.Mixin.withoutDefaultFocusAndBlur`.
|
||||
*/
|
||||
touchableHandleFocus: function touchableHandleFocus(e) {
|
||||
this.props.onFocus && this.props.onFocus(e);
|
||||
},
|
||||
|
||||
/**
|
||||
* Invoked when the item loses focus. Mixers might override this to
|
||||
* visually distinguish the `VisualRect` so that the user knows that it
|
||||
* no longer has focus. Most platforms only support a single element being
|
||||
* focused at a time, in which case the focus may have moved to another.
|
||||
* This can be overridden when using
|
||||
* `Touchable.Mixin.withoutDefaultFocusAndBlur`.
|
||||
*/
|
||||
touchableHandleBlur: function touchableHandleBlur(e) {
|
||||
this.props.onBlur && this.props.onBlur(e);
|
||||
},
|
||||
// ==== Abstract Application Callbacks ====
|
||||
|
||||
/**
|
||||
* Invoked when the item should be highlighted. Mixers should implement this
|
||||
* to visually distinguish the `VisualRect` so that the user knows that
|
||||
* releasing a touch will result in a "selection" (analog to click).
|
||||
*
|
||||
* @abstract
|
||||
* touchableHandleActivePressIn: function,
|
||||
*/
|
||||
|
||||
/**
|
||||
* Invoked when the item is "active" (in that it is still eligible to become
|
||||
* a "select") but the touch has left the `PressRect`. Usually the mixer will
|
||||
* want to unhighlight the `VisualRect`. If the user (while pressing) moves
|
||||
* back into the `PressRect` `touchableHandleActivePressIn` will be invoked
|
||||
* again and the mixer should probably highlight the `VisualRect` again. This
|
||||
* event will not fire on an `touchEnd/mouseUp` event, only move events while
|
||||
* the user is depressing the mouse/touch.
|
||||
*
|
||||
* @abstract
|
||||
* touchableHandleActivePressOut: function
|
||||
*/
|
||||
|
||||
/**
|
||||
* Invoked when the item is "selected" - meaning the interaction ended by
|
||||
* letting up while the item was either in the state
|
||||
* `RESPONDER_ACTIVE_PRESS_IN` or `RESPONDER_INACTIVE_PRESS_IN`.
|
||||
*
|
||||
* @abstract
|
||||
* touchableHandlePress: function
|
||||
*/
|
||||
|
||||
/**
|
||||
* Invoked when the item is long pressed - meaning the interaction ended by
|
||||
* letting up while the item was in `RESPONDER_ACTIVE_LONG_PRESS_IN`. If
|
||||
* `touchableHandleLongPress` is *not* provided, `touchableHandlePress` will
|
||||
* be called as it normally is. If `touchableHandleLongPress` is provided, by
|
||||
* default any `touchableHandlePress` callback will not be invoked. To
|
||||
* override this default behavior, override `touchableLongPressCancelsPress`
|
||||
* to return false. As a result, `touchableHandlePress` will be called when
|
||||
* lifting up, even if `touchableHandleLongPress` has also been called.
|
||||
*
|
||||
* @abstract
|
||||
* touchableHandleLongPress: function
|
||||
*/
|
||||
|
||||
/**
|
||||
* Returns the number of millis to wait before triggering a highlight.
|
||||
*
|
||||
* @abstract
|
||||
* touchableGetHighlightDelayMS: function
|
||||
*/
|
||||
|
||||
/**
|
||||
* Returns the amount to extend the `HitRect` into the `PressRect`. Positive
|
||||
* numbers mean the size expands outwards.
|
||||
*
|
||||
* @abstract
|
||||
* touchableGetPressRectOffset: function
|
||||
*/
|
||||
// ==== Internal Logic ====
|
||||
|
||||
/**
|
||||
* Measures the `HitRect` node on activation. The Bounding rectangle is with
|
||||
* respect to viewport - not page, so adding the `pageXOffset/pageYOffset`
|
||||
* should result in points that are in the same coordinate system as an
|
||||
* event's `globalX/globalY` data values.
|
||||
*
|
||||
* - Consider caching this for the lifetime of the component, or possibly
|
||||
* being able to share this cache between any `ScrollMap` view.
|
||||
*
|
||||
* @sideeffects
|
||||
* @private
|
||||
*/
|
||||
_remeasureMetricsOnActivation: function _remeasureMetricsOnActivation() {
|
||||
var tag = this.state.touchable.responderID;
|
||||
|
||||
if (tag == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
_UIManager.default.measure(tag, this._handleQueryLayout);
|
||||
},
|
||||
_handleQueryLayout: function _handleQueryLayout(l, t, w, h, globalX, globalY) {
|
||||
//don't do anything UIManager failed to measure node
|
||||
if (!l && !t && !w && !h && !globalX && !globalY) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.state.touchable.positionOnActivate && _Position.default.release(this.state.touchable.positionOnActivate);
|
||||
this.state.touchable.dimensionsOnActivate && // $FlowFixMe
|
||||
_BoundingDimensions.default.release(this.state.touchable.dimensionsOnActivate);
|
||||
this.state.touchable.positionOnActivate = _Position.default.getPooled(globalX, globalY); // $FlowFixMe
|
||||
|
||||
this.state.touchable.dimensionsOnActivate = _BoundingDimensions.default.getPooled(w, h);
|
||||
},
|
||||
_handleDelay: function _handleDelay(e) {
|
||||
this.touchableDelayTimeout = null;
|
||||
|
||||
this._receiveSignal(Signals.DELAY, e);
|
||||
},
|
||||
_handleLongDelay: function _handleLongDelay(e) {
|
||||
this.longPressDelayTimeout = null;
|
||||
var curState = this.state.touchable.touchState;
|
||||
|
||||
if (curState !== States.RESPONDER_ACTIVE_PRESS_IN && curState !== States.RESPONDER_ACTIVE_LONG_PRESS_IN) {
|
||||
console.error('Attempted to transition from state `' + curState + '` to `' + States.RESPONDER_ACTIVE_LONG_PRESS_IN + '`, which is not supported. This is ' + 'most likely due to `Touchable.longPressDelayTimeout` not being cancelled.');
|
||||
} else {
|
||||
this._receiveSignal(Signals.LONG_PRESS_DETECTED, e);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Receives a state machine signal, performs side effects of the transition
|
||||
* and stores the new state. Validates the transition as well.
|
||||
*
|
||||
* @param {Signals} signal State machine signal.
|
||||
* @throws Error if invalid state transition or unrecognized signal.
|
||||
* @sideeffects
|
||||
*/
|
||||
_receiveSignal: function _receiveSignal(signal, e) {
|
||||
var responderID = this.state.touchable.responderID;
|
||||
var curState = this.state.touchable.touchState;
|
||||
var nextState = Transitions[curState] && Transitions[curState][signal];
|
||||
|
||||
if (!responderID && signal === Signals.RESPONDER_RELEASE) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!nextState) {
|
||||
throw new Error('Unrecognized signal `' + signal + '` or state `' + curState + '` for Touchable responder `' + responderID + '`');
|
||||
}
|
||||
|
||||
if (nextState === States.ERROR) {
|
||||
throw new Error('Touchable cannot transition from `' + curState + '` to `' + signal + '` for responder `' + responderID + '`');
|
||||
}
|
||||
|
||||
if (curState !== nextState) {
|
||||
this._performSideEffectsForTransition(curState, nextState, signal, e);
|
||||
|
||||
this.state.touchable.touchState = nextState;
|
||||
}
|
||||
},
|
||||
_cancelLongPressDelayTimeout: function _cancelLongPressDelayTimeout() {
|
||||
this.longPressDelayTimeout && clearTimeout(this.longPressDelayTimeout);
|
||||
this.longPressDelayTimeout = null;
|
||||
},
|
||||
_isHighlight: function _isHighlight(state) {
|
||||
return state === States.RESPONDER_ACTIVE_PRESS_IN || state === States.RESPONDER_ACTIVE_LONG_PRESS_IN;
|
||||
},
|
||||
_savePressInLocation: function _savePressInLocation(e) {
|
||||
var touch = extractSingleTouch(e.nativeEvent);
|
||||
var pageX = touch && touch.pageX;
|
||||
var pageY = touch && touch.pageY;
|
||||
var locationX = touch && touch.locationX;
|
||||
var locationY = touch && touch.locationY;
|
||||
this.pressInLocation = {
|
||||
pageX: pageX,
|
||||
pageY: pageY,
|
||||
locationX: locationX,
|
||||
locationY: locationY
|
||||
};
|
||||
},
|
||||
_getDistanceBetweenPoints: function _getDistanceBetweenPoints(aX, aY, bX, bY) {
|
||||
var deltaX = aX - bX;
|
||||
var deltaY = aY - bY;
|
||||
return Math.sqrt(deltaX * deltaX + deltaY * deltaY);
|
||||
},
|
||||
|
||||
/**
|
||||
* Will perform a transition between touchable states, and identify any
|
||||
* highlighting or unhighlighting that must be performed for this particular
|
||||
* transition.
|
||||
*
|
||||
* @param {States} curState Current Touchable state.
|
||||
* @param {States} nextState Next Touchable state.
|
||||
* @param {Signal} signal Signal that triggered the transition.
|
||||
* @param {Event} e Native event.
|
||||
* @sideeffects
|
||||
*/
|
||||
_performSideEffectsForTransition: function _performSideEffectsForTransition(curState, nextState, signal, e) {
|
||||
var curIsHighlight = this._isHighlight(curState);
|
||||
|
||||
var newIsHighlight = this._isHighlight(nextState);
|
||||
|
||||
var isFinalSignal = signal === Signals.RESPONDER_TERMINATED || signal === Signals.RESPONDER_RELEASE;
|
||||
|
||||
if (isFinalSignal) {
|
||||
this._cancelLongPressDelayTimeout();
|
||||
}
|
||||
|
||||
var isInitialTransition = curState === States.NOT_RESPONDER && nextState === States.RESPONDER_INACTIVE_PRESS_IN;
|
||||
var isActiveTransition = !IsActive[curState] && IsActive[nextState];
|
||||
|
||||
if (isInitialTransition || isActiveTransition) {
|
||||
this._remeasureMetricsOnActivation();
|
||||
}
|
||||
|
||||
if (IsPressingIn[curState] && signal === Signals.LONG_PRESS_DETECTED) {
|
||||
this.touchableHandleLongPress && this.touchableHandleLongPress(e);
|
||||
}
|
||||
|
||||
if (newIsHighlight && !curIsHighlight) {
|
||||
this._startHighlight(e);
|
||||
} else if (!newIsHighlight && curIsHighlight) {
|
||||
this._endHighlight(e);
|
||||
}
|
||||
|
||||
if (IsPressingIn[curState] && signal === Signals.RESPONDER_RELEASE) {
|
||||
var hasLongPressHandler = !!this.props.onLongPress;
|
||||
var pressIsLongButStillCallOnPress = IsLongPressingIn[curState] && ( // We *are* long pressing.. // But either has no long handler
|
||||
!hasLongPressHandler || !this.touchableLongPressCancelsPress()); // or we're told to ignore it.
|
||||
|
||||
var shouldInvokePress = !IsLongPressingIn[curState] || pressIsLongButStillCallOnPress;
|
||||
|
||||
if (shouldInvokePress && this.touchableHandlePress) {
|
||||
if (!newIsHighlight && !curIsHighlight) {
|
||||
// we never highlighted because of delay, but we should highlight now
|
||||
this._startHighlight(e);
|
||||
|
||||
this._endHighlight(e);
|
||||
}
|
||||
|
||||
this.touchableHandlePress(e);
|
||||
}
|
||||
}
|
||||
|
||||
this.touchableDelayTimeout && clearTimeout(this.touchableDelayTimeout);
|
||||
this.touchableDelayTimeout = null;
|
||||
},
|
||||
_playTouchSound: function _playTouchSound() {
|
||||
_UIManager.default.playTouchSound();
|
||||
},
|
||||
_startHighlight: function _startHighlight(e) {
|
||||
this._savePressInLocation(e);
|
||||
|
||||
this.touchableHandleActivePressIn && this.touchableHandleActivePressIn(e);
|
||||
},
|
||||
_endHighlight: function _endHighlight(e) {
|
||||
var _this2 = this;
|
||||
|
||||
if (this.touchableHandleActivePressOut) {
|
||||
if (this.touchableGetPressOutDelayMS && this.touchableGetPressOutDelayMS()) {
|
||||
this.pressOutDelayTimeout = setTimeout(function () {
|
||||
_this2.touchableHandleActivePressOut(e);
|
||||
}, this.touchableGetPressOutDelayMS());
|
||||
} else {
|
||||
this.touchableHandleActivePressOut(e);
|
||||
}
|
||||
}
|
||||
},
|
||||
// HACK (part 2): basic support for touchable interactions using a keyboard (including
|
||||
// delays and longPress)
|
||||
touchableHandleKeyEvent: function touchableHandleKeyEvent(e) {
|
||||
var type = e.type,
|
||||
key = e.key;
|
||||
|
||||
if (key === 'Enter' || key === ' ') {
|
||||
if (type === 'keydown') {
|
||||
if (!this._isTouchableKeyboardActive) {
|
||||
if (!this.state.touchable.touchState || this.state.touchable.touchState === States.NOT_RESPONDER) {
|
||||
this.touchableHandleResponderGrant(e);
|
||||
this._isTouchableKeyboardActive = true;
|
||||
}
|
||||
}
|
||||
} else if (type === 'keyup') {
|
||||
if (this._isTouchableKeyboardActive) {
|
||||
if (this.state.touchable.touchState && this.state.touchable.touchState !== States.NOT_RESPONDER) {
|
||||
this.touchableHandleResponderRelease(e);
|
||||
this._isTouchableKeyboardActive = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
e.stopPropagation(); // prevent the default behaviour unless the Touchable functions as a link
|
||||
// and Enter is pressed
|
||||
|
||||
if (!(key === 'Enter' && _AccessibilityUtil.default.propsToAriaRole(this.props) === 'link')) {
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
},
|
||||
withoutDefaultFocusAndBlur: {}
|
||||
};
|
||||
/**
|
||||
* Provide an optional version of the mixin where `touchableHandleFocus` and
|
||||
* `touchableHandleBlur` can be overridden. This allows appropriate defaults to
|
||||
* be set on TV platforms, without breaking existing implementations of
|
||||
* `Touchable`.
|
||||
*/
|
||||
|
||||
var touchableHandleFocus = TouchableMixin.touchableHandleFocus,
|
||||
touchableHandleBlur = TouchableMixin.touchableHandleBlur,
|
||||
TouchableMixinWithoutDefaultFocusAndBlur = _objectWithoutPropertiesLoose(TouchableMixin, ["touchableHandleFocus", "touchableHandleBlur"]);
|
||||
|
||||
TouchableMixin.withoutDefaultFocusAndBlur = TouchableMixinWithoutDefaultFocusAndBlur;
|
||||
var Touchable = {
|
||||
Mixin: TouchableMixin,
|
||||
TOUCH_TARGET_DEBUG: false,
|
||||
// Highlights all touchable targets. Toggle with Inspector.
|
||||
|
||||
/**
|
||||
* Renders a debugging overlay to visualize touch target with hitSlop (might not work on Android).
|
||||
*/
|
||||
renderDebugView: function renderDebugView(_ref) {
|
||||
var color = _ref.color,
|
||||
hitSlop = _ref.hitSlop;
|
||||
|
||||
if (!Touchable.TOUCH_TARGET_DEBUG) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
throw Error('Touchable.TOUCH_TARGET_DEBUG should not be enabled in prod!');
|
||||
}
|
||||
|
||||
var debugHitSlopStyle = {};
|
||||
hitSlop = hitSlop || {
|
||||
top: 0,
|
||||
bottom: 0,
|
||||
left: 0,
|
||||
right: 0
|
||||
};
|
||||
|
||||
for (var key in hitSlop) {
|
||||
debugHitSlopStyle[key] = -hitSlop[key];
|
||||
}
|
||||
|
||||
var normalizedColor = (0, _normalizeCssColor.default)(color);
|
||||
|
||||
if (typeof normalizedColor !== 'number') {
|
||||
return null;
|
||||
}
|
||||
|
||||
var hexColor = '#' + ('00000000' + normalizedColor.toString(16)).substr(-8);
|
||||
return _react.default.createElement(_View.default, {
|
||||
pointerEvents: "none",
|
||||
style: _objectSpread({
|
||||
position: 'absolute',
|
||||
borderColor: hexColor.slice(0, -2) + '55',
|
||||
// More opaque
|
||||
borderWidth: 1,
|
||||
borderStyle: 'dashed',
|
||||
backgroundColor: hexColor.slice(0, -2) + '0F'
|
||||
}, debugHitSlopStyle)
|
||||
});
|
||||
}
|
||||
};
|
||||
var _default = Touchable;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
176
node_modules/react-native-web/dist/cjs/exports/TouchableHighlight/index.js
generated
vendored
Normal file
176
node_modules/react-native-web/dist/cjs/exports/TouchableHighlight/index.js
generated
vendored
Normal file
@ -0,0 +1,176 @@
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var React = _interopRequireWildcard(require("react"));
|
||||
|
||||
var _useMergeRefs = _interopRequireDefault(require("../../modules/useMergeRefs"));
|
||||
|
||||
var _usePressEvents = _interopRequireDefault(require("../../hooks/usePressEvents"));
|
||||
|
||||
var _StyleSheet = _interopRequireDefault(require("../StyleSheet"));
|
||||
|
||||
var _View = _interopRequireDefault(require("../View"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
||||
|
||||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
||||
|
||||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
||||
|
||||
function createExtraStyles(activeOpacity, underlayColor) {
|
||||
return {
|
||||
child: {
|
||||
opacity: activeOpacity !== null && activeOpacity !== void 0 ? activeOpacity : 0.85
|
||||
},
|
||||
underlay: {
|
||||
backgroundColor: underlayColor === undefined ? 'black' : underlayColor
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function hasPressHandler(props) {
|
||||
return props.onPress != null || props.onPressIn != null || props.onPressOut != null || props.onLongPress != null;
|
||||
}
|
||||
/**
|
||||
* A wrapper for making views respond properly to touches.
|
||||
* On press down, the opacity of the wrapped view is decreased, which allows
|
||||
* the underlay color to show through, darkening or tinting the view.
|
||||
*
|
||||
* The underlay comes from wrapping the child in a new View, which can affect
|
||||
* layout, and sometimes cause unwanted visual artifacts if not used correctly,
|
||||
* for example if the backgroundColor of the wrapped view isn't explicitly set
|
||||
* to an opaque color.
|
||||
*
|
||||
* TouchableHighlight must have one child (not zero or more than one).
|
||||
* If you wish to have several child components, wrap them in a View.
|
||||
*/
|
||||
|
||||
|
||||
function TouchableHighlight(props, forwardedRef) {
|
||||
var accessible = props.accessible,
|
||||
activeOpacity = props.activeOpacity,
|
||||
children = props.children,
|
||||
delayPressIn = props.delayPressIn,
|
||||
delayPressOut = props.delayPressOut,
|
||||
delayLongPress = props.delayLongPress,
|
||||
disabled = props.disabled,
|
||||
focusable = props.focusable,
|
||||
onHideUnderlay = props.onHideUnderlay,
|
||||
onLongPress = props.onLongPress,
|
||||
onPress = props.onPress,
|
||||
onPressIn = props.onPressIn,
|
||||
onPressOut = props.onPressOut,
|
||||
onShowUnderlay = props.onShowUnderlay,
|
||||
rejectResponderTermination = props.rejectResponderTermination,
|
||||
style = props.style,
|
||||
testOnly_pressed = props.testOnly_pressed,
|
||||
underlayColor = props.underlayColor,
|
||||
rest = _objectWithoutPropertiesLoose(props, ["accessible", "activeOpacity", "children", "delayPressIn", "delayPressOut", "delayLongPress", "disabled", "focusable", "onHideUnderlay", "onLongPress", "onPress", "onPressIn", "onPressOut", "onShowUnderlay", "rejectResponderTermination", "style", "testOnly_pressed", "underlayColor"]);
|
||||
|
||||
var hostRef = (0, React.useRef)(null);
|
||||
var setRef = (0, _useMergeRefs.default)(forwardedRef, hostRef);
|
||||
|
||||
var _useState = (0, React.useState)(testOnly_pressed === true ? createExtraStyles(activeOpacity, underlayColor) : null),
|
||||
extraStyles = _useState[0],
|
||||
setExtraStyles = _useState[1];
|
||||
|
||||
var showUnderlay = (0, React.useCallback)(function () {
|
||||
if (!hasPressHandler(props)) {
|
||||
return;
|
||||
}
|
||||
|
||||
setExtraStyles(createExtraStyles(activeOpacity, underlayColor));
|
||||
|
||||
if (onShowUnderlay != null) {
|
||||
onShowUnderlay();
|
||||
}
|
||||
}, [activeOpacity, onShowUnderlay, props, underlayColor]);
|
||||
var hideUnderlay = (0, React.useCallback)(function () {
|
||||
if (testOnly_pressed === true) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (hasPressHandler(props)) {
|
||||
setExtraStyles(null);
|
||||
|
||||
if (onHideUnderlay != null) {
|
||||
onHideUnderlay();
|
||||
}
|
||||
}
|
||||
}, [onHideUnderlay, props, testOnly_pressed]);
|
||||
var pressConfig = (0, React.useMemo)(function () {
|
||||
return {
|
||||
cancelable: !rejectResponderTermination,
|
||||
disabled: disabled,
|
||||
delayLongPress: delayLongPress,
|
||||
delayPressStart: delayPressIn,
|
||||
delayPressEnd: delayPressOut,
|
||||
onLongPress: onLongPress,
|
||||
onPress: onPress,
|
||||
onPressStart: function onPressStart(event) {
|
||||
showUnderlay();
|
||||
|
||||
if (onPressIn != null) {
|
||||
onPressIn(event);
|
||||
}
|
||||
},
|
||||
onPressEnd: function onPressEnd(event) {
|
||||
hideUnderlay();
|
||||
|
||||
if (onPressOut != null) {
|
||||
onPressOut(event);
|
||||
}
|
||||
}
|
||||
};
|
||||
}, [delayLongPress, delayPressIn, delayPressOut, disabled, onLongPress, onPress, onPressIn, onPressOut, rejectResponderTermination, showUnderlay, hideUnderlay]);
|
||||
var pressEventHandlers = (0, _usePressEvents.default)(hostRef, pressConfig);
|
||||
var child = React.Children.only(children);
|
||||
return React.createElement(_View.default, _extends({}, rest, pressEventHandlers, {
|
||||
accessibilityState: _objectSpread({
|
||||
disabled: disabled
|
||||
}, props.accessibilityState),
|
||||
accessible: accessible !== false,
|
||||
focusable: focusable !== false && onPress !== undefined,
|
||||
ref: setRef,
|
||||
style: [styles.root, style, !disabled && styles.actionable, extraStyles && extraStyles.underlay]
|
||||
}), React.cloneElement(child, {
|
||||
style: _StyleSheet.default.compose(child.props.style, extraStyles && extraStyles.child)
|
||||
}));
|
||||
}
|
||||
|
||||
var styles = _StyleSheet.default.create({
|
||||
root: {
|
||||
userSelect: 'none'
|
||||
},
|
||||
actionable: {
|
||||
cursor: 'pointer',
|
||||
touchAction: 'manipulation'
|
||||
}
|
||||
});
|
||||
|
||||
var MemoedTouchableHighlight = React.memo(React.forwardRef(TouchableHighlight));
|
||||
MemoedTouchableHighlight.displayName = 'TouchableHighlight';
|
||||
var _default = MemoedTouchableHighlight;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
20
node_modules/react-native-web/dist/cjs/exports/TouchableNativeFeedback/index.js
generated
vendored
Normal file
20
node_modules/react-native-web/dist/cjs/exports/TouchableNativeFeedback/index.js
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _UnimplementedView = _interopRequireDefault(require("../../modules/UnimplementedView"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
var _default = _UnimplementedView.default;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
139
node_modules/react-native-web/dist/cjs/exports/TouchableOpacity/index.js
generated
vendored
Normal file
139
node_modules/react-native-web/dist/cjs/exports/TouchableOpacity/index.js
generated
vendored
Normal file
@ -0,0 +1,139 @@
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var React = _interopRequireWildcard(require("react"));
|
||||
|
||||
var _useMergeRefs = _interopRequireDefault(require("../../modules/useMergeRefs"));
|
||||
|
||||
var _usePressEvents = _interopRequireDefault(require("../../hooks/usePressEvents"));
|
||||
|
||||
var _StyleSheet = _interopRequireDefault(require("../StyleSheet"));
|
||||
|
||||
var _View = _interopRequireDefault(require("../View"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
||||
|
||||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
||||
|
||||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
||||
|
||||
/**
|
||||
* A wrapper for making views respond properly to touches.
|
||||
* On press down, the opacity of the wrapped view is decreased, dimming it.
|
||||
*/
|
||||
function TouchableOpacity(props, forwardedRef) {
|
||||
var accessible = props.accessible,
|
||||
activeOpacity = props.activeOpacity,
|
||||
delayPressIn = props.delayPressIn,
|
||||
delayPressOut = props.delayPressOut,
|
||||
delayLongPress = props.delayLongPress,
|
||||
disabled = props.disabled,
|
||||
focusable = props.focusable,
|
||||
onLongPress = props.onLongPress,
|
||||
onPress = props.onPress,
|
||||
onPressIn = props.onPressIn,
|
||||
onPressOut = props.onPressOut,
|
||||
rejectResponderTermination = props.rejectResponderTermination,
|
||||
style = props.style,
|
||||
rest = _objectWithoutPropertiesLoose(props, ["accessible", "activeOpacity", "delayPressIn", "delayPressOut", "delayLongPress", "disabled", "focusable", "onLongPress", "onPress", "onPressIn", "onPressOut", "rejectResponderTermination", "style"]);
|
||||
|
||||
var hostRef = (0, React.useRef)(null);
|
||||
var setRef = (0, _useMergeRefs.default)(forwardedRef, hostRef);
|
||||
|
||||
var _useState = (0, React.useState)('0s'),
|
||||
duration = _useState[0],
|
||||
setDuration = _useState[1];
|
||||
|
||||
var _useState2 = (0, React.useState)(null),
|
||||
opacityOverride = _useState2[0],
|
||||
setOpacityOverride = _useState2[1];
|
||||
|
||||
var setOpacityTo = (0, React.useCallback)(function (value, duration) {
|
||||
setOpacityOverride(value);
|
||||
setDuration(duration ? duration / 1000 + "s" : '0s');
|
||||
}, [setOpacityOverride, setDuration]);
|
||||
var setOpacityActive = (0, React.useCallback)(function (duration) {
|
||||
setOpacityTo(activeOpacity !== null && activeOpacity !== void 0 ? activeOpacity : 0.2, duration);
|
||||
}, [activeOpacity, setOpacityTo]);
|
||||
var setOpacityInactive = (0, React.useCallback)(function (duration) {
|
||||
setOpacityTo(null, duration);
|
||||
}, [setOpacityTo]);
|
||||
var pressConfig = (0, React.useMemo)(function () {
|
||||
return {
|
||||
cancelable: !rejectResponderTermination,
|
||||
disabled: disabled,
|
||||
delayLongPress: delayLongPress,
|
||||
delayPressStart: delayPressIn,
|
||||
delayPressEnd: delayPressOut,
|
||||
onLongPress: onLongPress,
|
||||
onPress: onPress,
|
||||
onPressStart: function onPressStart(event) {
|
||||
setOpacityActive(event.dispatchConfig.registrationName === 'onResponderGrant' ? 0 : 150);
|
||||
|
||||
if (onPressIn != null) {
|
||||
onPressIn(event);
|
||||
}
|
||||
},
|
||||
onPressEnd: function onPressEnd(event) {
|
||||
setOpacityInactive(250);
|
||||
|
||||
if (onPressOut != null) {
|
||||
onPressOut(event);
|
||||
}
|
||||
}
|
||||
};
|
||||
}, [delayLongPress, delayPressIn, delayPressOut, disabled, onLongPress, onPress, onPressIn, onPressOut, rejectResponderTermination, setOpacityActive, setOpacityInactive]);
|
||||
var pressEventHandlers = (0, _usePressEvents.default)(hostRef, pressConfig);
|
||||
return React.createElement(_View.default, _extends({}, rest, pressEventHandlers, {
|
||||
accessibilityState: _objectSpread({
|
||||
disabled: disabled
|
||||
}, props.accessibilityState),
|
||||
accessible: accessible !== false,
|
||||
focusable: focusable !== false && onPress !== undefined,
|
||||
ref: setRef,
|
||||
style: [styles.root, !disabled && styles.actionable, style, opacityOverride != null && {
|
||||
opacity: opacityOverride
|
||||
}, {
|
||||
transitionDuration: duration
|
||||
}]
|
||||
}));
|
||||
}
|
||||
|
||||
var styles = _StyleSheet.default.create({
|
||||
root: {
|
||||
transitionProperty: 'opacity',
|
||||
transitionDuration: '0.15s',
|
||||
userSelect: 'none'
|
||||
},
|
||||
actionable: {
|
||||
cursor: 'pointer',
|
||||
touchAction: 'manipulation'
|
||||
}
|
||||
});
|
||||
|
||||
var MemoedTouchableOpacity = React.memo(React.forwardRef(TouchableOpacity));
|
||||
MemoedTouchableOpacity.displayName = 'TouchableOpacity';
|
||||
var _default = MemoedTouchableOpacity;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
101
node_modules/react-native-web/dist/cjs/exports/TouchableWithoutFeedback/index.js
generated
vendored
Normal file
101
node_modules/react-native-web/dist/cjs/exports/TouchableWithoutFeedback/index.js
generated
vendored
Normal file
@ -0,0 +1,101 @@
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var React = _interopRequireWildcard(require("react"));
|
||||
|
||||
var _pick = _interopRequireDefault(require("../../modules/pick"));
|
||||
|
||||
var _useMergeRefs = _interopRequireDefault(require("../../modules/useMergeRefs"));
|
||||
|
||||
var _usePressEvents = _interopRequireDefault(require("../../hooks/usePressEvents"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
||||
|
||||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
var forwardPropsList = {
|
||||
accessibilityLabel: true,
|
||||
accessibilityLiveRegion: true,
|
||||
accessibilityRole: true,
|
||||
accessibilityState: true,
|
||||
accessibilityValue: true,
|
||||
accessible: true,
|
||||
children: true,
|
||||
disabled: true,
|
||||
focusable: true,
|
||||
importantForAccessibility: true,
|
||||
nativeID: true,
|
||||
onBlur: true,
|
||||
onFocus: true,
|
||||
onLayout: true,
|
||||
testID: true
|
||||
};
|
||||
|
||||
var pickProps = function pickProps(props) {
|
||||
return (0, _pick.default)(props, forwardPropsList);
|
||||
};
|
||||
|
||||
function TouchableWithoutFeedback(props, forwardedRef) {
|
||||
var accessible = props.accessible,
|
||||
delayPressIn = props.delayPressIn,
|
||||
delayPressOut = props.delayPressOut,
|
||||
delayLongPress = props.delayLongPress,
|
||||
disabled = props.disabled,
|
||||
focusable = props.focusable,
|
||||
onLongPress = props.onLongPress,
|
||||
onPress = props.onPress,
|
||||
onPressIn = props.onPressIn,
|
||||
onPressOut = props.onPressOut,
|
||||
rejectResponderTermination = props.rejectResponderTermination;
|
||||
var hostRef = (0, React.useRef)(null);
|
||||
var pressConfig = (0, React.useMemo)(function () {
|
||||
return {
|
||||
cancelable: !rejectResponderTermination,
|
||||
disabled: disabled,
|
||||
delayLongPress: delayLongPress,
|
||||
delayPressStart: delayPressIn,
|
||||
delayPressEnd: delayPressOut,
|
||||
onLongPress: onLongPress,
|
||||
onPress: onPress,
|
||||
onPressStart: onPressIn,
|
||||
onPressEnd: onPressOut
|
||||
};
|
||||
}, [disabled, delayPressIn, delayPressOut, delayLongPress, onLongPress, onPress, onPressIn, onPressOut, rejectResponderTermination]);
|
||||
var pressEventHandlers = (0, _usePressEvents.default)(hostRef, pressConfig);
|
||||
var element = React.Children.only(props.children);
|
||||
var children = [element.props.children];
|
||||
var supportedProps = pickProps(props);
|
||||
supportedProps.accessible = accessible !== false;
|
||||
supportedProps.accessibilityState = _objectSpread({
|
||||
disabled: disabled
|
||||
}, props.accessibilityState);
|
||||
supportedProps.focusable = focusable !== false && onPress !== undefined;
|
||||
supportedProps.ref = (0, _useMergeRefs.default)(forwardedRef, hostRef, element.ref);
|
||||
var elementProps = Object.assign(supportedProps, pressEventHandlers);
|
||||
return React.cloneElement.apply(React, [element, elementProps].concat(children));
|
||||
}
|
||||
|
||||
var MemoedTouchableWithoutFeedback = React.memo(React.forwardRef(TouchableWithoutFeedback));
|
||||
MemoedTouchableWithoutFeedback.displayName = 'TouchableWithoutFeedback';
|
||||
var _default = MemoedTouchableWithoutFeedback;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
147
node_modules/react-native-web/dist/cjs/exports/UIManager/index.js
generated
vendored
Normal file
147
node_modules/react-native-web/dist/cjs/exports/UIManager/index.js
generated
vendored
Normal file
@ -0,0 +1,147 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _getBoundingClientRect = _interopRequireDefault(require("../../modules/getBoundingClientRect"));
|
||||
|
||||
var _setValueForStyles = _interopRequireDefault(require("../../vendor/react-dom/setValueForStyles"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
var getRect = function getRect(node) {
|
||||
// Unlike the DOM's getBoundingClientRect, React Native layout measurements
|
||||
// for "height" and "width" ignore scale transforms.
|
||||
// https://developer.mozilla.org/en-US/docs/Web/API/CSS_Object_Model/Determining_the_dimensions_of_elements
|
||||
var _getBoundingClientRec = (0, _getBoundingClientRect.default)(node),
|
||||
x = _getBoundingClientRec.x,
|
||||
y = _getBoundingClientRec.y,
|
||||
top = _getBoundingClientRec.top,
|
||||
left = _getBoundingClientRec.left;
|
||||
|
||||
var width = node.offsetWidth;
|
||||
var height = node.offsetHeight;
|
||||
return {
|
||||
x: x,
|
||||
y: y,
|
||||
width: width,
|
||||
height: height,
|
||||
top: top,
|
||||
left: left
|
||||
};
|
||||
};
|
||||
|
||||
var _measureLayout = function measureLayout(node, relativeToNativeNode, callback) {
|
||||
var relativeNode = relativeToNativeNode || node && node.parentNode;
|
||||
|
||||
if (node && relativeNode) {
|
||||
setTimeout(function () {
|
||||
var relativeRect = (0, _getBoundingClientRect.default)(relativeNode);
|
||||
|
||||
var _getRect = getRect(node),
|
||||
height = _getRect.height,
|
||||
left = _getRect.left,
|
||||
top = _getRect.top,
|
||||
width = _getRect.width;
|
||||
|
||||
var x = left - relativeRect.left;
|
||||
var y = top - relativeRect.top;
|
||||
callback(x, y, width, height, left, top);
|
||||
}, 0);
|
||||
}
|
||||
};
|
||||
|
||||
var focusableElements = {
|
||||
A: true,
|
||||
INPUT: true,
|
||||
SELECT: true,
|
||||
TEXTAREA: true
|
||||
};
|
||||
var UIManager = {
|
||||
blur: function blur(node) {
|
||||
try {
|
||||
node.blur();
|
||||
} catch (err) {}
|
||||
},
|
||||
focus: function focus(node) {
|
||||
try {
|
||||
var name = node.nodeName; // A tabIndex of -1 allows element to be programmatically focused but
|
||||
// prevents keyboard focus, so we don't want to set the value on elements
|
||||
// that support keyboard focus by default.
|
||||
|
||||
if (node.getAttribute('tabIndex') == null && focusableElements[name] == null) {
|
||||
node.setAttribute('tabIndex', '-1');
|
||||
}
|
||||
|
||||
node.focus();
|
||||
} catch (err) {}
|
||||
},
|
||||
measure: function measure(node, callback) {
|
||||
_measureLayout(node, null, callback);
|
||||
},
|
||||
measureInWindow: function measureInWindow(node, callback) {
|
||||
if (node) {
|
||||
setTimeout(function () {
|
||||
var _getRect2 = getRect(node),
|
||||
height = _getRect2.height,
|
||||
left = _getRect2.left,
|
||||
top = _getRect2.top,
|
||||
width = _getRect2.width;
|
||||
|
||||
callback(left, top, width, height);
|
||||
}, 0);
|
||||
}
|
||||
},
|
||||
measureLayout: function measureLayout(node, relativeToNativeNode, onFail, onSuccess) {
|
||||
_measureLayout(node, relativeToNativeNode, onSuccess);
|
||||
},
|
||||
updateView: function updateView(node, props) {
|
||||
for (var prop in props) {
|
||||
if (!Object.prototype.hasOwnProperty.call(props, prop)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
var value = props[prop];
|
||||
|
||||
switch (prop) {
|
||||
case 'style':
|
||||
{
|
||||
(0, _setValueForStyles.default)(node, value);
|
||||
break;
|
||||
}
|
||||
|
||||
case 'class':
|
||||
case 'className':
|
||||
{
|
||||
node.setAttribute('class', value);
|
||||
break;
|
||||
}
|
||||
|
||||
case 'text':
|
||||
case 'value':
|
||||
// native platforms use `text` prop to replace text input value
|
||||
node.value = value;
|
||||
break;
|
||||
|
||||
default:
|
||||
node.setAttribute(prop, value);
|
||||
}
|
||||
}
|
||||
},
|
||||
configureNextLayoutAnimation: function configureNextLayoutAnimation(config, onAnimationDidEnd) {
|
||||
onAnimationDidEnd();
|
||||
},
|
||||
// mocks
|
||||
setLayoutAnimationEnabledExperimental: function setLayoutAnimationEnabledExperimental() {}
|
||||
};
|
||||
var _default = UIManager;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
35
node_modules/react-native-web/dist/cjs/exports/Vibration/index.js
generated
vendored
Normal file
35
node_modules/react-native-web/dist/cjs/exports/Vibration/index.js
generated
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
var _vibrate = function vibrate(pattern) {
|
||||
if ('vibrate' in window.navigator) {
|
||||
window.navigator.vibrate(pattern);
|
||||
}
|
||||
};
|
||||
|
||||
var Vibration = {
|
||||
cancel: function cancel() {
|
||||
_vibrate(0);
|
||||
},
|
||||
vibrate: function vibrate(pattern) {
|
||||
if (pattern === void 0) {
|
||||
pattern = 400;
|
||||
}
|
||||
|
||||
_vibrate(pattern);
|
||||
}
|
||||
};
|
||||
var _default = Vibration;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
180
node_modules/react-native-web/dist/cjs/exports/View/index.js
generated
vendored
Normal file
180
node_modules/react-native-web/dist/cjs/exports/View/index.js
generated
vendored
Normal file
@ -0,0 +1,180 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var React = _interopRequireWildcard(require("react"));
|
||||
|
||||
var _createElement = _interopRequireDefault(require("../createElement"));
|
||||
|
||||
var _css = _interopRequireDefault(require("../StyleSheet/css"));
|
||||
|
||||
var _pick = _interopRequireDefault(require("../../modules/pick"));
|
||||
|
||||
var _useElementLayout = _interopRequireDefault(require("../../hooks/useElementLayout"));
|
||||
|
||||
var _useMergeRefs = _interopRequireDefault(require("../../modules/useMergeRefs"));
|
||||
|
||||
var _usePlatformMethods = _interopRequireDefault(require("../../hooks/usePlatformMethods"));
|
||||
|
||||
var _useResponderEvents = _interopRequireDefault(require("../../hooks/useResponderEvents"));
|
||||
|
||||
var _StyleSheet = _interopRequireDefault(require("../StyleSheet"));
|
||||
|
||||
var _TextAncestorContext = _interopRequireDefault(require("../Text/TextAncestorContext"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
var forwardPropsList = {
|
||||
accessibilityLabel: true,
|
||||
accessibilityLiveRegion: true,
|
||||
accessibilityRole: true,
|
||||
accessibilityState: true,
|
||||
accessibilityValue: true,
|
||||
accessible: true,
|
||||
children: true,
|
||||
classList: true,
|
||||
disabled: true,
|
||||
importantForAccessibility: true,
|
||||
nativeID: true,
|
||||
onBlur: true,
|
||||
onClick: true,
|
||||
onClickCapture: true,
|
||||
onContextMenu: true,
|
||||
onFocus: true,
|
||||
onKeyDown: true,
|
||||
onKeyUp: true,
|
||||
onTouchCancel: true,
|
||||
onTouchCancelCapture: true,
|
||||
onTouchEnd: true,
|
||||
onTouchEndCapture: true,
|
||||
onTouchMove: true,
|
||||
onTouchMoveCapture: true,
|
||||
onTouchStart: true,
|
||||
onTouchStartCapture: true,
|
||||
pointerEvents: true,
|
||||
ref: true,
|
||||
style: true,
|
||||
testID: true,
|
||||
// unstable
|
||||
dataSet: true,
|
||||
onMouseDown: true,
|
||||
onMouseEnter: true,
|
||||
onMouseLeave: true,
|
||||
onMouseMove: true,
|
||||
onMouseOver: true,
|
||||
onMouseOut: true,
|
||||
onMouseUp: true,
|
||||
onScroll: true,
|
||||
onWheel: true,
|
||||
href: true,
|
||||
rel: true,
|
||||
target: true
|
||||
};
|
||||
|
||||
var pickProps = function pickProps(props) {
|
||||
return (0, _pick.default)(props, forwardPropsList);
|
||||
};
|
||||
|
||||
var View = (0, React.forwardRef)(function (props, forwardedRef) {
|
||||
var onLayout = props.onLayout,
|
||||
onMoveShouldSetResponder = props.onMoveShouldSetResponder,
|
||||
onMoveShouldSetResponderCapture = props.onMoveShouldSetResponderCapture,
|
||||
onResponderEnd = props.onResponderEnd,
|
||||
onResponderGrant = props.onResponderGrant,
|
||||
onResponderMove = props.onResponderMove,
|
||||
onResponderReject = props.onResponderReject,
|
||||
onResponderRelease = props.onResponderRelease,
|
||||
onResponderStart = props.onResponderStart,
|
||||
onResponderTerminate = props.onResponderTerminate,
|
||||
onResponderTerminationRequest = props.onResponderTerminationRequest,
|
||||
onScrollShouldSetResponder = props.onScrollShouldSetResponder,
|
||||
onScrollShouldSetResponderCapture = props.onScrollShouldSetResponderCapture,
|
||||
onSelectionChangeShouldSetResponder = props.onSelectionChangeShouldSetResponder,
|
||||
onSelectionChangeShouldSetResponderCapture = props.onSelectionChangeShouldSetResponderCapture,
|
||||
onStartShouldSetResponder = props.onStartShouldSetResponder,
|
||||
onStartShouldSetResponderCapture = props.onStartShouldSetResponderCapture;
|
||||
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
React.Children.toArray(props.children).forEach(function (item) {
|
||||
if (typeof item === 'string') {
|
||||
console.error("Unexpected text node: " + item + ". A text node cannot be a child of a <View>.");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var hasTextAncestor = (0, React.useContext)(_TextAncestorContext.default);
|
||||
var hostRef = (0, React.useRef)(null);
|
||||
var classList = [classes.view];
|
||||
|
||||
var style = _StyleSheet.default.compose(hasTextAncestor && styles.inline, props.style);
|
||||
|
||||
(0, _useElementLayout.default)(hostRef, onLayout);
|
||||
(0, _useResponderEvents.default)(hostRef, {
|
||||
onMoveShouldSetResponder: onMoveShouldSetResponder,
|
||||
onMoveShouldSetResponderCapture: onMoveShouldSetResponderCapture,
|
||||
onResponderEnd: onResponderEnd,
|
||||
onResponderGrant: onResponderGrant,
|
||||
onResponderMove: onResponderMove,
|
||||
onResponderReject: onResponderReject,
|
||||
onResponderRelease: onResponderRelease,
|
||||
onResponderStart: onResponderStart,
|
||||
onResponderTerminate: onResponderTerminate,
|
||||
onResponderTerminationRequest: onResponderTerminationRequest,
|
||||
onScrollShouldSetResponder: onScrollShouldSetResponder,
|
||||
onScrollShouldSetResponderCapture: onScrollShouldSetResponderCapture,
|
||||
onSelectionChangeShouldSetResponder: onSelectionChangeShouldSetResponder,
|
||||
onSelectionChangeShouldSetResponderCapture: onSelectionChangeShouldSetResponderCapture,
|
||||
onStartShouldSetResponder: onStartShouldSetResponder,
|
||||
onStartShouldSetResponderCapture: onStartShouldSetResponderCapture
|
||||
});
|
||||
var supportedProps = pickProps(props);
|
||||
supportedProps.classList = classList;
|
||||
supportedProps.style = style;
|
||||
var platformMethodsRef = (0, _usePlatformMethods.default)(supportedProps);
|
||||
var setRef = (0, _useMergeRefs.default)(hostRef, platformMethodsRef, forwardedRef);
|
||||
supportedProps.ref = setRef;
|
||||
return (0, _createElement.default)('div', supportedProps);
|
||||
});
|
||||
View.displayName = 'View';
|
||||
|
||||
var classes = _css.default.create({
|
||||
view: {
|
||||
alignItems: 'stretch',
|
||||
border: '0 solid black',
|
||||
boxSizing: 'border-box',
|
||||
display: 'flex',
|
||||
flexBasis: 'auto',
|
||||
flexDirection: 'column',
|
||||
flexShrink: 0,
|
||||
margin: 0,
|
||||
minHeight: 0,
|
||||
minWidth: 0,
|
||||
padding: 0,
|
||||
position: 'relative',
|
||||
zIndex: 0
|
||||
}
|
||||
});
|
||||
|
||||
var styles = _StyleSheet.default.create({
|
||||
inline: {
|
||||
display: 'inline-flex'
|
||||
}
|
||||
});
|
||||
|
||||
var _default = View;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
1
node_modules/react-native-web/dist/cjs/exports/View/types.js
generated
vendored
Normal file
1
node_modules/react-native-web/dist/cjs/exports/View/types.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
"use strict";
|
20
node_modules/react-native-web/dist/cjs/exports/VirtualizedList/index.js
generated
vendored
Normal file
20
node_modules/react-native-web/dist/cjs/exports/VirtualizedList/index.js
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _VirtualizedList = _interopRequireDefault(require("../../vendor/react-native/VirtualizedList"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
var _default = _VirtualizedList.default;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
29
node_modules/react-native-web/dist/cjs/exports/YellowBox/index.js
generated
vendored
Normal file
29
node_modules/react-native-web/dist/cjs/exports/YellowBox/index.js
generated
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _react = _interopRequireDefault(require("react"));
|
||||
|
||||
var _UnimplementedView = _interopRequireDefault(require("../../modules/UnimplementedView"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
function YellowBox(props) {
|
||||
return _react.default.createElement(_UnimplementedView.default, props);
|
||||
}
|
||||
|
||||
YellowBox.ignoreWarnings = function () {};
|
||||
|
||||
var _default = YellowBox;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
42
node_modules/react-native-web/dist/cjs/exports/createElement/index.js
generated
vendored
Normal file
42
node_modules/react-native-web/dist/cjs/exports/createElement/index.js
generated
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _AccessibilityUtil = _interopRequireDefault(require("../../modules/AccessibilityUtil"));
|
||||
|
||||
var _createDOMProps = _interopRequireDefault(require("../../modules/createDOMProps"));
|
||||
|
||||
var _react = _interopRequireDefault(require("react"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
var createElement = function createElement(component, props) {
|
||||
// Use equivalent platform elements where possible.
|
||||
var accessibilityComponent;
|
||||
|
||||
if (component && component.constructor === String) {
|
||||
accessibilityComponent = _AccessibilityUtil.default.propsToAccessibilityComponent(props);
|
||||
}
|
||||
|
||||
var Component = accessibilityComponent || component;
|
||||
var domProps = (0, _createDOMProps.default)(Component, props);
|
||||
|
||||
for (var _len = arguments.length, children = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
||||
children[_key - 2] = arguments[_key];
|
||||
}
|
||||
|
||||
return _react.default.createElement.apply(_react.default, [Component, domProps].concat(children));
|
||||
};
|
||||
|
||||
var _default = createElement;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
29
node_modules/react-native-web/dist/cjs/exports/findNodeHandle/index.js
generated
vendored
Normal file
29
node_modules/react-native-web/dist/cjs/exports/findNodeHandle/index.js
generated
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _reactDom = require("react-dom");
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
var findNodeHandle = function findNodeHandle(component) {
|
||||
var node;
|
||||
|
||||
try {
|
||||
node = (0, _reactDom.findDOMNode)(component);
|
||||
} catch (e) {}
|
||||
|
||||
return node;
|
||||
};
|
||||
|
||||
var _default = findNodeHandle;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
37
node_modules/react-native-web/dist/cjs/exports/processColor/index.js
generated
vendored
Normal file
37
node_modules/react-native-web/dist/cjs/exports/processColor/index.js
generated
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _normalizeCssColor = _interopRequireDefault(require("normalize-css-color"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
var processColor = function processColor(color) {
|
||||
if (color === undefined || color === null) {
|
||||
return color;
|
||||
} // convert number and hex
|
||||
|
||||
|
||||
var int32Color = (0, _normalizeCssColor.default)(color);
|
||||
|
||||
if (int32Color === undefined || int32Color === null) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
int32Color = (int32Color << 24 | int32Color >>> 8) >>> 0;
|
||||
return int32Color;
|
||||
};
|
||||
|
||||
var _default = processColor;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
19
node_modules/react-native-web/dist/cjs/exports/render/index.js
generated
vendored
Normal file
19
node_modules/react-native-web/dist/cjs/exports/render/index.js
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _reactDom = require("react-dom");
|
||||
|
||||
exports.hydrate = _reactDom.hydrate;
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
var _default = _reactDom.render;
|
||||
exports.default = _default;
|
18
node_modules/react-native-web/dist/cjs/exports/unmountComponentAtNode/index.js
generated
vendored
Normal file
18
node_modules/react-native-web/dist/cjs/exports/unmountComponentAtNode/index.js
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _reactDom = require("react-dom");
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
var _default = _reactDom.unmountComponentAtNode;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
44
node_modules/react-native-web/dist/cjs/exports/useColorScheme/index.js
generated
vendored
Normal file
44
node_modules/react-native-web/dist/cjs/exports/useColorScheme/index.js
generated
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = useColorScheme;
|
||||
|
||||
var React = _interopRequireWildcard(require("react"));
|
||||
|
||||
var _Appearance = _interopRequireDefault(require("../Appearance"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
function useColorScheme() {
|
||||
var _React$useState = React.useState(_Appearance.default.getColorScheme()),
|
||||
colorScheme = _React$useState[0],
|
||||
setColorScheme = _React$useState[1];
|
||||
|
||||
React.useEffect(function () {
|
||||
function listener(appearance) {
|
||||
setColorScheme(appearance.colorScheme);
|
||||
}
|
||||
|
||||
_Appearance.default.addChangeListener(listener);
|
||||
|
||||
return function () {
|
||||
return _Appearance.default.removeChangeListener(listener);
|
||||
};
|
||||
});
|
||||
return colorScheme;
|
||||
}
|
||||
|
||||
module.exports = exports.default;
|
48
node_modules/react-native-web/dist/cjs/exports/useWindowDimensions/index.js
generated
vendored
Normal file
48
node_modules/react-native-web/dist/cjs/exports/useWindowDimensions/index.js
generated
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = useWindowDimensions;
|
||||
|
||||
var _Dimensions = _interopRequireDefault(require("../Dimensions"));
|
||||
|
||||
var _react = require("react");
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function useWindowDimensions() {
|
||||
var _useState = (0, _react.useState)(function () {
|
||||
return _Dimensions.default.get('window');
|
||||
}),
|
||||
dims = _useState[0],
|
||||
setDims = _useState[1];
|
||||
|
||||
(0, _react.useEffect)(function () {
|
||||
function handleChange(_ref) {
|
||||
var window = _ref.window;
|
||||
// $FlowFixMe
|
||||
setDims(window);
|
||||
}
|
||||
|
||||
_Dimensions.default.addEventListener('change', handleChange); // We might have missed an update between calling `get` in render and
|
||||
// `addEventListener` in this handler, so we set it here. If there was
|
||||
// no change, React will filter out this update as a no-op.
|
||||
|
||||
|
||||
setDims(_Dimensions.default.get('window'));
|
||||
return function () {
|
||||
_Dimensions.default.removeEventListener('change', handleChange);
|
||||
};
|
||||
}, []);
|
||||
return dims;
|
||||
}
|
||||
|
||||
module.exports = exports.default;
|
104
node_modules/react-native-web/dist/cjs/hooks/useElementLayout.js
generated
vendored
Normal file
104
node_modules/react-native-web/dist/cjs/hooks/useElementLayout.js
generated
vendored
Normal file
@ -0,0 +1,104 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = useElementLayout;
|
||||
|
||||
var _ExecutionEnvironment = require("fbjs/lib/ExecutionEnvironment");
|
||||
|
||||
var _useLayoutEffect = _interopRequireDefault(require("./useLayoutEffect"));
|
||||
|
||||
var _UIManager = _interopRequireDefault(require("../exports/UIManager"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
var DOM_LAYOUT_HANDLER_NAME = '__reactLayoutHandler';
|
||||
var didWarn = !_ExecutionEnvironment.canUseDOM;
|
||||
var resizeObserver = null;
|
||||
|
||||
function getResizeObserver() {
|
||||
if (_ExecutionEnvironment.canUseDOM && typeof window.ResizeObserver !== 'undefined') {
|
||||
if (resizeObserver == null) {
|
||||
resizeObserver = new window.ResizeObserver(function (entries) {
|
||||
entries.forEach(function (entry) {
|
||||
var node = entry.target;
|
||||
var onLayout = node[DOM_LAYOUT_HANDLER_NAME];
|
||||
|
||||
if (typeof onLayout === 'function') {
|
||||
// We still need to measure the view because browsers don't yet provide
|
||||
// border-box dimensions in the entry
|
||||
_UIManager.default.measure(node, function (x, y, width, height, left, top) {
|
||||
var event = {
|
||||
// $FlowFixMe
|
||||
nativeEvent: {
|
||||
layout: {
|
||||
x: x,
|
||||
y: y,
|
||||
width: width,
|
||||
height: height,
|
||||
left: left,
|
||||
top: top
|
||||
}
|
||||
},
|
||||
timeStamp: Date.now()
|
||||
};
|
||||
Object.defineProperty(event.nativeEvent, 'target', {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return entry.target;
|
||||
}
|
||||
});
|
||||
onLayout(event);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
} else if (!didWarn) {
|
||||
if (process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'test') {
|
||||
console.warn('onLayout relies on ResizeObserver which is not supported by your browser. ' + 'Please include a polyfill, e.g., https://github.com/que-etc/resize-observer-polyfill.');
|
||||
didWarn = true;
|
||||
}
|
||||
}
|
||||
|
||||
return resizeObserver;
|
||||
}
|
||||
|
||||
function useElementLayout(ref, onLayout) {
|
||||
var observer = getResizeObserver();
|
||||
(0, _useLayoutEffect.default)(function () {
|
||||
var node = ref.current;
|
||||
|
||||
if (node != null) {
|
||||
node[DOM_LAYOUT_HANDLER_NAME] = onLayout;
|
||||
}
|
||||
}, [ref, onLayout]); // Observing is done in a separate effect to avoid this effect running
|
||||
// when 'onLayout' changes.
|
||||
|
||||
(0, _useLayoutEffect.default)(function () {
|
||||
var node = ref.current;
|
||||
|
||||
if (node != null && observer != null) {
|
||||
if (typeof node[DOM_LAYOUT_HANDLER_NAME] === 'function') {
|
||||
observer.observe(node);
|
||||
} else {
|
||||
observer.unobserve(node);
|
||||
}
|
||||
}
|
||||
|
||||
return function () {
|
||||
if (node != null && observer != null) {
|
||||
observer.unobserve(node);
|
||||
}
|
||||
};
|
||||
}, [ref, observer]);
|
||||
}
|
||||
|
||||
module.exports = exports.default;
|
24
node_modules/react-native-web/dist/cjs/hooks/useLayoutEffect.js
generated
vendored
Normal file
24
node_modules/react-native-web/dist/cjs/hooks/useLayoutEffect.js
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _ExecutionEnvironment = require("fbjs/lib/ExecutionEnvironment");
|
||||
|
||||
var _react = require("react");
|
||||
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* useLayoutEffect throws an error on the server. On the few occasions where is
|
||||
* problematic, use this hook.
|
||||
*
|
||||
*
|
||||
*/
|
||||
var useLayoutEffectImpl = _ExecutionEnvironment.canUseDOM ? _react.useLayoutEffect : _react.useEffect;
|
||||
var _default = useLayoutEffectImpl;
|
||||
exports.default = _default;
|
||||
module.exports = exports.default;
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user