planning
All checks were successful
Publish To Prod / deploy_and_publish (push) Successful in 35s

This commit is contained in:
2024-10-14 09:15:30 +02:00
parent bcba00a730
commit 6e64e138e2
21059 changed files with 2317811 additions and 1 deletions

21
node_modules/react-frame-component/LICENSE.md generated vendored Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2018 Ryan Seddon
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

164
node_modules/react-frame-component/README.md generated vendored Normal file
View File

@@ -0,0 +1,164 @@
# React <Frame /> component
[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][depstat-image]][depstat-url]
This component allows you to encapsulate your entire React application or per component in an iFrame.
```bash
npm install --save react-frame-component
```
## How to use:
```js
import Frame from 'react-frame-component';
```
Go check out the [demo][demo-url].
```html
const Header = ({ children }) => (
<Frame>
<h1>{children}</h1>
</Frame>
);
ReactDOM.render(<Header>Hello</Header>, document.body);
```
Or you can wrap it at the `render` call.
```html
ReactDOM.render(
<Frame>
<Header>Hello</Header>
</Frame>,
document.body
);
```
##### Props:
###### head
`head: PropTypes.node`
The `head` prop is a dom node that gets inserted before the children of the frame. Note that this is injected into the body of frame (see the blog post for why). This has the benefit of being able to update and works for stylesheets.
###### initialContent
`initialContent: PropTypes.string`
Defaults to `'<!DOCTYPE html><html><head></head><body><div></div></body></html>'`
The `initialContent` props is the initial html injected into frame. It is only injected once, but allows you to insert any html into the frame (e.g. a head tag, script tags, etc). Note that it does *not* update if you change the prop. Also at least one div is required in the body of the html, which we use to render the react dom into.
###### mountTarget
`mountTarget: PropTypes.string`
The `mountTarget` props is a css selector (#target/.target) that specifies where in the `initialContent` of the iframe, children will be mounted.
```html
<Frame
initialContent='<!DOCTYPE html><html><head></head><body><h1>i wont be changed</h1><div id="mountHere"></div></body></html>'
mountTarget='#mountHere'
>
</Frame>
```
###### contentDidMount and contentDidUpdate
`contentDidMount: PropTypes.func`
`contentDidUpdate: PropTypes.func`
`contentDidMount` and `contentDidUpdate` are conceptually equivalent to
`componentDidMount` and `componentDidUpdate`, respectively. The reason these are
needed is because internally we call `ReactDOM.render` which starts a new set of
lifecycle calls. This set of lifecycle calls are sometimes triggered after the
lifecycle of the parent component, so these callbacks provide a hook to know
when the frame contents are mounted and updated.
###### ref
`ref: PropTypes.oneOfType([ PropTypes.func, PropTypes.shape({ current: PropTypes.instanceOf(Element) }) ])`
The `ref` prop provides a way to access inner iframe DOM node. To utilitize this prop use, for example, one of the React's built-in methods to create a ref: [`React.createRef()`](https://reactjs.org/docs/refs-and-the-dom.html#creating-refs) or [`React.useRef()`](https://reactjs.org/docs/hooks-reference.html#useref).
```js
const MyComponent = (props) => {
const iframeRef = React.useRef();
React.useEffect(() => {
// Use iframeRef for:
// - focus managing
// - triggering imperative animations
// - integrating with third-party DOM libraries
iframeRef.current.focus()
}, [])
return (
<Frame ref={iframeRef}>
<InnerComponent />
</Frame>
);
}
```
##### Accessing the iframe's window and document
The iframe's `window` and `document` may be accessed via the `FrameContextConsumer` or the `useFrame` hook.
The example with `FrameContextConsumer`:
```js
import Frame, { FrameContextConsumer } from 'react-frame-component'
const MyComponent = (props, context) => (
<Frame>
<FrameContextConsumer>
{
// Callback is invoked with iframe's window and document instances
({document, window}) => {
// Render Children
}
}
</FrameContextConsumer>
</Frame>
);
```
The example with `useFrame` hook:
```js
import Frame, { useFrame } from 'react-frame-component';
const InnerComponent = () => {
// Hook returns iframe's window and document instances from Frame context
const { document, window } = useFrame();
return null;
};
const OuterComponent = () => (
<Frame>
<InnerComponent />
</Frame>
);
```
## More info
I wrote a [blog post][blog-url] about building this component.
## License
Copyright 2014, Ryan Seddon.
This content is released under the MIT license http://ryanseddon.mit-license.org
[npm-url]: https://npmjs.org/package/react-frame-component
[npm-image]: https://badge.fury.io/js/react-frame-component.png
[travis-url]: http://travis-ci.org/ryanseddon/react-frame-component
[travis-image]: https://secure.travis-ci.org/ryanseddon/react-frame-component.png?branch=master
[depstat-url]: https://david-dm.org/ryanseddon/react-frame-component
[depstat-image]: https://david-dm.org/ryanseddon/react-frame-component.png
[demo-url]: http://ryanseddon.github.io/react-frame-component/
[blog-url]: https://medium.com/@ryanseddon/rendering-to-iframes-in-react-d1cb92274f86

30
node_modules/react-frame-component/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,30 @@
declare module 'react-frame-component' {
import * as React from 'react';
export interface FrameComponentProps
extends React.IframeHTMLAttributes<HTMLIFrameElement>,
React.RefAttributes<HTMLIFrameElement> {
head?: React.ReactNode | undefined;
mountTarget?: string | undefined;
initialContent?: string | undefined;
contentDidMount?: (() => void) | undefined;
contentDidUpdate?: (() => void) | undefined;
children: React.ReactNode;
}
const FrameComponent: React.ForwardRefExoticComponent<FrameComponentProps>;
export default FrameComponent;
export interface FrameContextProps {
document?: Document;
window?: Window;
}
export const FrameContext: React.Context<FrameContextProps>;
export const FrameContextProvider: React.Provider<FrameContextProps>;
export const FrameContextConsumer: React.Consumer<FrameContextProps>;
export function useFrame(): FrameContextProps;
}

60
node_modules/react-frame-component/lib/Content.js generated vendored Normal file
View File

@@ -0,0 +1,60 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () { 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // eslint-disable-line no-unused-vars
var Content = function (_Component) {
_inherits(Content, _Component);
function Content() {
_classCallCheck(this, Content);
return _possibleConstructorReturn(this, (Content.__proto__ || Object.getPrototypeOf(Content)).apply(this, arguments));
}
_createClass(Content, [{
key: 'componentDidMount',
value: function componentDidMount() {
this.props.contentDidMount();
}
}, {
key: 'componentDidUpdate',
value: function componentDidUpdate() {
this.props.contentDidUpdate();
}
}, {
key: 'render',
value: function render() {
return _react.Children.only(this.props.children);
}
}]);
return Content;
}(_react.Component);
Content.propTypes = {
children: _propTypes2.default.element.isRequired,
contentDidMount: _propTypes2.default.func.isRequired,
contentDidUpdate: _propTypes2.default.func.isRequired
};
exports.default = Content;

32
node_modules/react-frame-component/lib/Context.js generated vendored Normal file
View File

@@ -0,0 +1,32 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.FrameContextConsumer = exports.FrameContextProvider = exports.useFrame = exports.FrameContext = undefined;
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var doc = void 0;
var win = void 0;
if (typeof document !== 'undefined') {
doc = document;
}
if (typeof window !== 'undefined') {
win = window;
}
var FrameContext = exports.FrameContext = _react2.default.createContext({ document: doc, window: win });
var useFrame = exports.useFrame = function useFrame() {
return _react2.default.useContext(FrameContext);
};
var FrameContextProvider = FrameContext.Provider,
FrameContextConsumer = FrameContext.Consumer;
exports.FrameContextProvider = FrameContextProvider;
exports.FrameContextConsumer = FrameContextConsumer;

205
node_modules/react-frame-component/lib/Frame.js generated vendored Normal file
View File

@@ -0,0 +1,205 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Frame = undefined;
var _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; };
var _createClass = function () { 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _reactDom = require('react-dom');
var _reactDom2 = _interopRequireDefault(_reactDom);
var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _Context = require('./Context');
var _Content = require('./Content');
var _Content2 = _interopRequireDefault(_Content);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var Frame = exports.Frame = function (_Component) {
_inherits(Frame, _Component);
// React warns when you render directly into the body since browser extensions
// also inject into the body and can mess up React. For this reason
// initialContent is expected to have a div inside of the body
// element that we render react into.
function Frame(props, context) {
_classCallCheck(this, Frame);
var _this = _possibleConstructorReturn(this, (Frame.__proto__ || Object.getPrototypeOf(Frame)).call(this, props, context));
_this.setRef = function (node) {
_this.nodeRef.current = node;
var forwardedRef = _this.props.forwardedRef; // eslint-disable-line react/prop-types
if (typeof forwardedRef === 'function') {
forwardedRef(node);
} else if (forwardedRef) {
forwardedRef.current = node;
}
};
_this.handleLoad = function () {
clearInterval(_this.loadCheck);
// Bail update as some browsers will trigger on both DOMContentLoaded & onLoad ala firefox
if (!_this.state.iframeLoaded) {
_this.setState({ iframeLoaded: true });
}
};
_this.loadCheck = function () {
return setInterval(function () {
_this.handleLoad();
}, 500);
};
_this._isMounted = false;
_this.nodeRef = _react2.default.createRef();
_this.state = { iframeLoaded: false };
return _this;
}
_createClass(Frame, [{
key: 'componentDidMount',
value: function componentDidMount() {
this._isMounted = true;
var doc = this.getDoc();
if (doc) {
this.nodeRef.current.contentWindow.addEventListener('DOMContentLoaded', this.handleLoad);
}
}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {
this._isMounted = false;
this.nodeRef.current.removeEventListener('DOMContentLoaded', this.handleLoad);
}
}, {
key: 'getDoc',
value: function getDoc() {
return this.nodeRef.current ? this.nodeRef.current.contentDocument : null; // eslint-disable-line
}
}, {
key: 'getMountTarget',
value: function getMountTarget() {
var doc = this.getDoc();
if (this.props.mountTarget) {
return doc.querySelector(this.props.mountTarget);
}
return doc.body.children[0];
}
// In certain situations on a cold cache DOMContentLoaded never gets called
// fallback to an interval to check if that's the case
}, {
key: 'renderFrameContents',
value: function renderFrameContents() {
if (!this._isMounted) {
return null;
}
var doc = this.getDoc();
if (!doc) {
return null;
}
var contentDidMount = this.props.contentDidMount;
var contentDidUpdate = this.props.contentDidUpdate;
var win = doc.defaultView || doc.parentView;
var contents = _react2.default.createElement(
_Content2.default,
{
contentDidMount: contentDidMount,
contentDidUpdate: contentDidUpdate
},
_react2.default.createElement(
_Context.FrameContextProvider,
{ value: { document: doc, window: win } },
_react2.default.createElement(
'div',
{ className: 'frame-content' },
this.props.children
)
)
);
var mountTarget = this.getMountTarget();
if (!mountTarget) {
return null;
}
return [_reactDom2.default.createPortal(this.props.head, this.getDoc().head), _reactDom2.default.createPortal(contents, mountTarget)];
}
}, {
key: 'render',
value: function render() {
var props = _extends({}, this.props, {
srcDoc: this.props.initialContent,
children: undefined // The iframe isn't ready so we drop children from props here. #12, #17
});
delete props.head;
delete props.initialContent;
delete props.mountTarget;
delete props.contentDidMount;
delete props.contentDidUpdate;
delete props.forwardedRef;
return _react2.default.createElement(
'iframe',
_extends({}, props, { ref: this.setRef, onLoad: this.handleLoad }),
this.state.iframeLoaded && this.renderFrameContents()
);
}
}]);
return Frame;
}(_react.Component);
Frame.propTypes = {
style: _propTypes2.default.object, // eslint-disable-line
head: _propTypes2.default.node,
initialContent: _propTypes2.default.string,
mountTarget: _propTypes2.default.string,
contentDidMount: _propTypes2.default.func,
contentDidUpdate: _propTypes2.default.func,
children: _propTypes2.default.oneOfType([_propTypes2.default.element, _propTypes2.default.arrayOf(_propTypes2.default.element)])
};
Frame.defaultProps = {
style: {},
head: null,
children: undefined,
mountTarget: undefined,
contentDidMount: function contentDidMount() {},
contentDidUpdate: function contentDidUpdate() {},
initialContent: '<!DOCTYPE html><html><head></head><body><div class="frame-root"></div></body></html>'
};
exports.default = _react2.default.forwardRef(function (props, ref) {
return _react2.default.createElement(Frame, _extends({}, props, { forwardedRef: ref }));
});

37
node_modules/react-frame-component/lib/index.js generated vendored Normal file
View File

@@ -0,0 +1,37 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _Frame = require('./Frame');
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Frame).default;
}
});
var _Context = require('./Context');
Object.defineProperty(exports, 'FrameContext', {
enumerable: true,
get: function get() {
return _Context.FrameContext;
}
});
Object.defineProperty(exports, 'FrameContextConsumer', {
enumerable: true,
get: function get() {
return _Context.FrameContextConsumer;
}
});
Object.defineProperty(exports, 'useFrame', {
enumerable: true,
get: function get() {
return _Context.useFrame;
}
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

104
node_modules/react-frame-component/package.json generated vendored Normal file
View File

@@ -0,0 +1,104 @@
{
"name": "react-frame-component",
"version": "5.2.7",
"description": "React component to wrap your application or component in an iFrame for encapsulation purposes",
"main": "lib/index.js",
"files": [
"lib",
"index.d.ts"
],
"scripts": {
"precommit": "lint-staged",
"clean": "rimraf lib",
"test": "npm-run-all --parallel lint karma:once --sequential build",
"serve": "webpack-dev-server --host 0.0.0.0 --hot --inline --history-api-fallback",
"start": "npm-run-all --parallel karma:dev serve",
"karma:once": "karma start --single-run",
"karma:dev": "karma start --browsers Chrome",
"babel": "babel src -d lib",
"build": "npm-run-all clean babel",
"lint": "eslint '*.js' '{src,test}/**/*.js*'",
"prepublish": "npm run build",
"predeploy": "webpack",
"deploy": "gh-pages -d dist",
"publish": "npm run deploy"
},
"repository": {
"type": "git",
"url": "git://github.com/ryanseddon/react-frame-component.git"
},
"keywords": [
"React",
"component",
"iFrame",
"browser"
],
"author": "Ryan Seddon",
"contributors": [
"Chris Trevino <darthtrevino@gmail.com>"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/ryanseddon/react-frame-component/issues"
},
"homepage": "https://github.com/ryanseddon/react-frame-component",
"devDependencies": {
"babel-cli": "^6.18.0",
"babel-core": "^6.21.0",
"babel-eslint": "^7.1.1",
"babel-loader": "^6.3.2",
"babel-plugin-transform-class-properties": "^6.19.0",
"babel-preset-latest": "^6.16.0",
"babel-preset-react": "^6.16.0",
"babel-preset-stage-2": "^6.18.0",
"babel-register": "^6.18.0",
"chai": "^3.5.0",
"eslint": "^3.13.1",
"eslint-config-airbnb": "^14.0.0",
"eslint-config-prettier": "^2.9.0",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-jsx-a11y": "^3.0.2",
"eslint-plugin-react": "^6.9.0",
"gh-pages": "^1.1.0",
"html-webpack-plugin": "^2.28.0",
"husky": "^0.14.3",
"karma": "^6.3.16",
"karma-chrome-launcher": "^2.0.0",
"karma-mocha": "^1.3.0",
"karma-osx-reporter": "^0.2.1",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^2.0.2",
"lint-staged": "^7.1.3",
"mocha": "^3.2.0",
"mocha-junit-reporter": "^1.13.0",
"mocha-multi": "^0.10.0",
"mocha-osx-reporter": "^0.1.2",
"npm-run-all": "^4.0.1",
"prettier": "^1.13.4",
"prop-types": "^15.5.9",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"rimraf": "^2.5.4",
"sinon": "2.0.0-pre",
"wallaby-webpack": "^3.9.16",
"webpack": "1.x",
"webpack-dev-server": "^1.16.3"
},
"dependencies": {},
"lint-staged": {
"**/*.{js,jsx}": [
"eslint --fix",
"prettier --write",
"git add"
]
},
"peerDependencies": {
"prop-types": "^15.5.9",
"react": ">= 16.3",
"react-dom": ">= 16.3"
},
"prettier": {
"singleQuote": true,
"trailingComma": "none"
}
}