@seamlessdocs/payment-modals 2.0.0-beta.7 → 2.0.0-beta.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seamlessdocs/payment-modals",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.9",
|
|
4
4
|
"description": "Payment modals for SeamlessDocs",
|
|
5
5
|
"main": "build/payment-modals.js",
|
|
6
6
|
"repository": {
|
|
@@ -30,21 +30,23 @@
|
|
|
30
30
|
"eslint-config-prettier": "^9.1.0",
|
|
31
31
|
"eslint-plugin-import": "^2.29.1",
|
|
32
32
|
"eslint-plugin-jsx-a11y": "^6.8.0",
|
|
33
|
-
"eslint-plugin-prettier": "^5.
|
|
33
|
+
"eslint-plugin-prettier": "^5.2.0",
|
|
34
34
|
"eslint-plugin-react": "^7.33.2",
|
|
35
|
-
"
|
|
35
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
36
|
+
"file-loader": "^6.2.0",
|
|
36
37
|
"html-loader": "^4.2.0",
|
|
37
38
|
"html-webpack-plugin": "^5.6.0",
|
|
38
39
|
"image-webpack-loader": "^6.0.0",
|
|
39
40
|
"mini-css-extract-plugin": "^2.7.6",
|
|
40
|
-
"
|
|
41
|
+
"postcss": "^8.4.35",
|
|
42
|
+
"prettier": "^3.2.5",
|
|
41
43
|
"react": "^18.2.0",
|
|
42
44
|
"react-dom": "^18.2.0",
|
|
43
45
|
"sass": "^1.69.0",
|
|
44
46
|
"sass-loader": "^13.3.0",
|
|
45
47
|
"style-loader": "^3.3.3",
|
|
46
48
|
"svg-inline-loader": "^0.8.0",
|
|
47
|
-
"url-loader": "^1.1
|
|
49
|
+
"url-loader": "^4.1.1",
|
|
48
50
|
"webpack": "^5.89.0",
|
|
49
51
|
"webpack-cli": "^5.1.4",
|
|
50
52
|
"webpack-dev-server": "^5.0.0"
|
|
@@ -55,6 +57,7 @@
|
|
|
55
57
|
},
|
|
56
58
|
"dependencies": {
|
|
57
59
|
"@kofile/platform-react-payrix": "1.7.47",
|
|
60
|
+
"@tippyjs/react": "^4.2.6",
|
|
58
61
|
"babel-plugin-import": "^1.11.0",
|
|
59
62
|
"base64-image-loader": "^1.2.1",
|
|
60
63
|
"classnames": "^2.2.6",
|
|
@@ -63,8 +66,7 @@
|
|
|
63
66
|
"postcss-loader": "^7.3.4",
|
|
64
67
|
"postcss-nested": "^4.1.2",
|
|
65
68
|
"prop-types": "^15.7.2",
|
|
66
|
-
"react-inlinesvg": "^
|
|
67
|
-
"react-select": "^
|
|
68
|
-
"react-tippy": "^1.4.0"
|
|
69
|
+
"react-inlinesvg": "^4.2.0",
|
|
70
|
+
"react-select": "^5.8.0"
|
|
69
71
|
}
|
|
70
72
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
|
-
import
|
|
4
|
+
import Tippy from '@tippyjs/react';
|
|
5
5
|
|
|
6
6
|
import { Field } from 'formik';
|
|
7
7
|
|
|
@@ -10,7 +10,7 @@ import validIcon from '../../../../assets/img/valid-icon.svg';
|
|
|
10
10
|
|
|
11
11
|
import styles from './FieldContainer.module.css';
|
|
12
12
|
|
|
13
|
-
import '
|
|
13
|
+
import 'tippy.js/dist/tippy.css';
|
|
14
14
|
|
|
15
15
|
const FieldContainer = ({ name, label, children }) => {
|
|
16
16
|
return (
|
|
@@ -24,9 +24,9 @@ const FieldContainer = ({ name, label, children }) => {
|
|
|
24
24
|
<div className={styles.fieldHeader}>
|
|
25
25
|
<div className={styles.fieldName}>{label}</div>
|
|
26
26
|
{meta.touched && meta.error && (
|
|
27
|
-
<
|
|
27
|
+
<Tippy content={meta.error} arrow>
|
|
28
28
|
<img src={errorIcon} alt="error" />
|
|
29
|
-
</
|
|
29
|
+
</Tippy>
|
|
30
30
|
)}
|
|
31
31
|
{meta.touched && !meta.error && (
|
|
32
32
|
<img className={styles.validationIcon} src={validIcon} alt="valid" />
|
package/src/index.jsx
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
// In production: will be external and resolved to ReactDOM global
|
|
4
|
-
import * as ReactDOMClient from 'react-dom/client';
|
|
5
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ReactDOM from 'react-dom/client';
|
|
6
3
|
import ChooseModal from './Components/ChooseModal';
|
|
7
4
|
import ProcessingModal from './Components/ProcessingModal';
|
|
8
5
|
import ErrorModal from './Components/ErrorModal';
|
|
@@ -19,44 +16,42 @@ import { restoreNativeEventConstructor, loadJQuery } from './shims';
|
|
|
19
16
|
import '../index.css';
|
|
20
17
|
import './OpenViewStyles.css';
|
|
21
18
|
|
|
19
|
+
// Expose React and ReactDOM globally for compatibility
|
|
20
|
+
// In development, these are bundled and need to be exposed
|
|
21
|
+
// In production, these should already be available externally
|
|
22
|
+
if (typeof window !== 'undefined') {
|
|
23
|
+
if (!window.React) {
|
|
24
|
+
window.React = React;
|
|
25
|
+
}
|
|
26
|
+
if (!window.ReactDOM) {
|
|
27
|
+
window.ReactDOM = ReactDOM;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
22
31
|
// Store root instances to manage React 18 roots
|
|
23
32
|
const rootInstances = new Map();
|
|
24
33
|
|
|
25
34
|
// Helper function to get createRoot - works in both development and production
|
|
35
|
+
// In development, ReactDOM is imported and exposed globally
|
|
36
|
+
// In production, ReactDOM is external and should be available globally
|
|
26
37
|
const getCreateRoot = () => {
|
|
27
|
-
//
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
if (ReactDOMClient) {
|
|
32
|
-
// Try direct access
|
|
33
|
-
if (typeof ReactDOMClient.createRoot === 'function') {
|
|
34
|
-
createRootFn = ReactDOMClient.createRoot;
|
|
35
|
-
}
|
|
36
|
-
// Try as default export property
|
|
37
|
-
else if (ReactDOMClient.default && typeof ReactDOMClient.default.createRoot === 'function') {
|
|
38
|
-
createRootFn = ReactDOMClient.default.createRoot;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
if (createRootFn) {
|
|
43
|
-
return createRootFn;
|
|
38
|
+
// First try to use the imported ReactDOM (development)
|
|
39
|
+
if (ReactDOM && typeof ReactDOM.createRoot === 'function') {
|
|
40
|
+
return ReactDOM.createRoot;
|
|
44
41
|
}
|
|
45
42
|
|
|
46
|
-
//
|
|
47
|
-
|
|
48
|
-
const ReactDOM = (typeof window !== 'undefined' && window.ReactDOM)
|
|
43
|
+
// Fallback to global ReactDOM (production or if imported version not available)
|
|
44
|
+
const globalReactDOM = (typeof window !== 'undefined' && window.ReactDOM)
|
|
49
45
|
|| (typeof global !== 'undefined' && global.ReactDOM)
|
|
50
46
|
|| (typeof self !== 'undefined' && self.ReactDOM);
|
|
51
47
|
|
|
52
|
-
if (
|
|
53
|
-
return
|
|
48
|
+
if (globalReactDOM && typeof globalReactDOM.createRoot === 'function') {
|
|
49
|
+
return globalReactDOM.createRoot;
|
|
54
50
|
}
|
|
55
51
|
|
|
56
52
|
throw new Error(
|
|
57
|
-
'createRoot is not available. Make sure React 18 is loaded. ' +
|
|
58
|
-
'
|
|
59
|
-
'In production, ReactDOM should be available globally as window.ReactDOM.'
|
|
53
|
+
'createRoot is not available. Make sure React 18 is loaded and ReactDOM is available. ' +
|
|
54
|
+
'ReactDOM should be accessible as window.ReactDOM or imported from react-dom/client.'
|
|
60
55
|
);
|
|
61
56
|
};
|
|
62
57
|
|
package/webpack.config.js
CHANGED
|
@@ -21,25 +21,26 @@ module.exports = (_env, argv) => {
|
|
|
21
21
|
},
|
|
22
22
|
// Solo aplicar externals en producción
|
|
23
23
|
// En desarrollo, React debe estar incluido en el bundle
|
|
24
|
-
externals: isProduction ? {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
root: 'ReactDOM'
|
|
24
|
+
externals: isProduction ? function({ context, request }, callback) {
|
|
25
|
+
// Handle react and react-dom as externals
|
|
26
|
+
if (/^react$/.test(request)) {
|
|
27
|
+
return callback(null, {
|
|
28
|
+
commonjs: 'react',
|
|
29
|
+
commonjs2: 'react',
|
|
30
|
+
amd: 'react',
|
|
31
|
+
root: 'React'
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
if (/^react-dom$/.test(request) || /^react-dom\/client$/.test(request)) {
|
|
35
|
+
return callback(null, {
|
|
36
|
+
commonjs: 'react-dom',
|
|
37
|
+
commonjs2: 'react-dom',
|
|
38
|
+
amd: 'react-dom',
|
|
39
|
+
root: 'ReactDOM'
|
|
40
|
+
});
|
|
42
41
|
}
|
|
42
|
+
// Don't externalize anything else
|
|
43
|
+
callback();
|
|
43
44
|
} : {},
|
|
44
45
|
module: {
|
|
45
46
|
rules: [
|