@seamlessdocs/payment-modals 2.0.0-beta.1 → 2.0.0-beta.3
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/build/payment-modals.js +1 -1
- package/index.html +1 -0
- package/package.json +4 -4
- package/src/index.jsx +11 -5
- package/webpack.config.js +1 -6
package/index.html
CHANGED
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.3",
|
|
4
4
|
"description": "Payment modals for SeamlessDocs",
|
|
5
5
|
"main": "build/payment-modals.js",
|
|
6
6
|
"repository": {
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
"html-webpack-plugin": "^5.6.0",
|
|
38
38
|
"image-webpack-loader": "^6.0.0",
|
|
39
39
|
"mini-css-extract-plugin": "^2.7.6",
|
|
40
|
-
"sass": "^1.69.0",
|
|
41
40
|
"prettier": "^1.17.0",
|
|
42
41
|
"react": "^18.2.0",
|
|
43
42
|
"react-dom": "^18.2.0",
|
|
43
|
+
"sass": "^1.69.0",
|
|
44
44
|
"sass-loader": "^13.3.0",
|
|
45
45
|
"style-loader": "^3.3.3",
|
|
46
46
|
"svg-inline-loader": "^0.8.0",
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"webpack-dev-server": "^5.0.0"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
|
-
"react": "
|
|
54
|
-
"react-dom": "
|
|
53
|
+
"react": "^18.0.0",
|
|
54
|
+
"react-dom": "^18.0.0"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"@kofile/platform-react-payrix": "1.7.47",
|
package/src/index.jsx
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { createRoot } from 'react-dom/client';
|
|
3
2
|
|
|
4
3
|
import ChooseModal from './Components/ChooseModal';
|
|
@@ -17,18 +16,25 @@ import { restoreNativeEventConstructor, loadJQuery } from './shims';
|
|
|
17
16
|
import '../index.css';
|
|
18
17
|
import './OpenViewStyles.css';
|
|
19
18
|
|
|
19
|
+
// Store root instances to manage React 18 roots
|
|
20
|
+
const rootInstances = new Map();
|
|
21
|
+
|
|
20
22
|
// Helper function to render with React 18 createRoot
|
|
21
|
-
let rootInstance = null;
|
|
22
23
|
const renderModal = (element, containerId) => {
|
|
23
24
|
const containerElement = document.getElementById(containerId);
|
|
24
25
|
if (!containerElement) {
|
|
25
26
|
console.warn(`Container element with id "${containerId}" not found`);
|
|
26
27
|
return;
|
|
27
28
|
}
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
|
|
30
|
+
// Get or create root instance
|
|
31
|
+
let root = rootInstances.get(containerId);
|
|
32
|
+
if (!root) {
|
|
33
|
+
root = createRoot(containerElement);
|
|
34
|
+
rootInstances.set(containerId, root);
|
|
30
35
|
}
|
|
31
|
-
|
|
36
|
+
|
|
37
|
+
root.render(element);
|
|
32
38
|
};
|
|
33
39
|
|
|
34
40
|
const handlePaymentModal = {};
|
package/webpack.config.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
|
+
const webpack = require('webpack');
|
|
2
3
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
3
4
|
|
|
4
5
|
module.exports = (_env, argv) => {
|
|
@@ -33,12 +34,6 @@ module.exports = (_env, argv) => {
|
|
|
33
34
|
amd: 'react-dom',
|
|
34
35
|
root: 'ReactDOM'
|
|
35
36
|
},
|
|
36
|
-
'react-dom/client': {
|
|
37
|
-
commonjs: 'react-dom/client',
|
|
38
|
-
commonjs2: 'react-dom/client',
|
|
39
|
-
amd: 'react-dom/client',
|
|
40
|
-
root: 'ReactDOM'
|
|
41
|
-
}
|
|
42
37
|
} : {},
|
|
43
38
|
module: {
|
|
44
39
|
rules: [
|