WIP - add extractor, generate snippet_data
This commit is contained in:
31
node_modules/exenv/LICENSE
generated
vendored
Normal file
31
node_modules/exenv/LICENSE
generated
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
BSD License
|
||||
|
||||
For React software
|
||||
|
||||
Copyright (c) 2013-2015, Facebook, Inc.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
* Neither the name Facebook nor the names of its contributors may be used to
|
||||
endorse or promote products derived from this software without specific
|
||||
prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
35
node_modules/exenv/README.md
generated
vendored
Normal file
35
node_modules/exenv/README.md
generated
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
# exenv
|
||||
|
||||
React's ExecutionEnvironment module extracted for use in other packages & components.
|
||||
|
||||
## Usage
|
||||
|
||||
```
|
||||
npm install exenv --save
|
||||
```
|
||||
|
||||
```js
|
||||
var ExecutionEnvironment = require('exenv');
|
||||
|
||||
// You now have...
|
||||
ExecutionEnvironment.canUseDOM // is the DOM available? i.e window document etc.
|
||||
ExecutionEnvironment.canUseWorkers // are Web Workers available?
|
||||
ExecutionEnvironment.canUseEventListeners // are Events available? i.e addEventListener etc.
|
||||
ExecutionEnvironment.canUseViewport // is there a viewport? i.e window.screen
|
||||
```
|
||||
|
||||
### Differences from React's ExecutionEnvironment
|
||||
|
||||
The `ExecutionEnvironment` lib in React 0.13 includes an `isInWorker` property, which is `!canUseDOM`. This is highly specific to React internals and probably (a) hacky and (b) not useful to other packages, so it has been left out. Please open an issue with your thoughts if you disagree or have a better idea.
|
||||
|
||||
## Why?
|
||||
|
||||
A number of packages and components use React's private ExecutionEnvironment lib to detect available features, particularly to detect server-side rendering, e.g
|
||||
|
||||
```
|
||||
canUseDOM = require('react/lib/ExecutionEnvironment').canUseDOM; // BAD
|
||||
```
|
||||
|
||||
**It is bad practice to use React internals** and this is likely to be broken / disabled in the future.
|
||||
|
||||
Use this package instead!
|
||||
40
node_modules/exenv/index.js
generated
vendored
Normal file
40
node_modules/exenv/index.js
generated
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
/*!
|
||||
Copyright (c) 2015 Jed Watson.
|
||||
Based on code that is Copyright 2013-2015, Facebook, Inc.
|
||||
All rights reserved.
|
||||
*/
|
||||
/* global define */
|
||||
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
var canUseDOM = !!(
|
||||
typeof window !== 'undefined' &&
|
||||
window.document &&
|
||||
window.document.createElement
|
||||
);
|
||||
|
||||
var ExecutionEnvironment = {
|
||||
|
||||
canUseDOM: canUseDOM,
|
||||
|
||||
canUseWorkers: typeof Worker !== 'undefined',
|
||||
|
||||
canUseEventListeners:
|
||||
canUseDOM && !!(window.addEventListener || window.attachEvent),
|
||||
|
||||
canUseViewport: canUseDOM && !!window.screen
|
||||
|
||||
};
|
||||
|
||||
if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {
|
||||
define(function () {
|
||||
return ExecutionEnvironment;
|
||||
});
|
||||
} else if (typeof module !== 'undefined' && module.exports) {
|
||||
module.exports = ExecutionEnvironment;
|
||||
} else {
|
||||
window.ExecutionEnvironment = ExecutionEnvironment;
|
||||
}
|
||||
|
||||
}());
|
||||
55
node_modules/exenv/package.json
generated
vendored
Normal file
55
node_modules/exenv/package.json
generated
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
{
|
||||
"_from": "exenv@^1.2.1",
|
||||
"_id": "exenv@1.2.2",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-KueOhdmJQVhnCwPUe+wfA72Ru50=",
|
||||
"_location": "/exenv",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "exenv@^1.2.1",
|
||||
"name": "exenv",
|
||||
"escapedName": "exenv",
|
||||
"rawSpec": "^1.2.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.2.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/react-side-effect"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/exenv/-/exenv-1.2.2.tgz",
|
||||
"_shasum": "2ae78e85d9894158670b03d47bec1f03bd91bb9d",
|
||||
"_spec": "exenv@^1.2.1",
|
||||
"_where": "/Users/stefanfejes/Projects/30-seconds-of-python-code/node_modules/react-side-effect",
|
||||
"author": {
|
||||
"name": "Jed Watson"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/JedWatson/exenv/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "React's ExecutionEnvironment module extracted for use in other packages & components",
|
||||
"homepage": "https://github.com/JedWatson/exenv",
|
||||
"keywords": [
|
||||
"react",
|
||||
"browser",
|
||||
"server",
|
||||
"environment",
|
||||
"env",
|
||||
"execution",
|
||||
"executionenvironment"
|
||||
],
|
||||
"license": "BSD-3-Clause",
|
||||
"main": "index.js",
|
||||
"name": "exenv",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/JedWatson/exenv.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"See React tests\" && exit 0"
|
||||
},
|
||||
"version": "1.2.2"
|
||||
}
|
||||
Reference in New Issue
Block a user