strapi-plugin-payone-provider 5.6.12 → 5.6.13
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.
|
@@ -1,20 +1,65 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { Tabs } from "@strapi/design-system";
|
|
2
|
+
import { Box, Typography, Tabs } from "@strapi/design-system";
|
|
3
3
|
import ConfigurationPanel from "./configuration/ConfigurationPanel";
|
|
4
4
|
import HistoryPanel from "./transaction-history/HistoryPanel";
|
|
5
5
|
import PaymentActionsPanel from "./payment-actions/PaymentActionsPanel";
|
|
6
6
|
import DocsPanel from "./DocsPanel";
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Error boundary to prevent a single tab's error from crashing the entire plugin.
|
|
10
|
+
* Automatically resets when the user switches tabs.
|
|
11
|
+
*/
|
|
12
|
+
class TabErrorBoundary extends React.Component {
|
|
13
|
+
constructor(props) {
|
|
14
|
+
super(props);
|
|
15
|
+
this.state = { hasError: false, error: null };
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
static getDerivedStateFromError(error) {
|
|
19
|
+
return { hasError: true, error };
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
componentDidCatch(error, errorInfo) {
|
|
23
|
+
console.error("Payone Tab Error:", error, errorInfo);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
componentDidUpdate(prevProps) {
|
|
27
|
+
// Auto-reset when the user switches to a different tab
|
|
28
|
+
if (prevProps.activeTab !== this.props.activeTab && this.state.hasError) {
|
|
29
|
+
this.setState({ hasError: false, error: null });
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
render() {
|
|
34
|
+
if (this.state.hasError) {
|
|
35
|
+
return (
|
|
36
|
+
<Box padding={6} style={{ textAlign: "center" }}>
|
|
37
|
+
<Typography variant="beta" textColor="danger600">
|
|
38
|
+
Something went wrong loading this tab.
|
|
39
|
+
</Typography>
|
|
40
|
+
<Typography
|
|
41
|
+
variant="pi"
|
|
42
|
+
textColor="neutral600"
|
|
43
|
+
style={{ marginTop: "8px", display: "block" }}
|
|
44
|
+
>
|
|
45
|
+
Try switching to another tab or reload the page.
|
|
46
|
+
</Typography>
|
|
47
|
+
</Box>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
return this.props.children;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
8
54
|
const AppTabs = ({
|
|
9
55
|
activeTab,
|
|
10
56
|
setActiveTab,
|
|
11
57
|
onNavigateToConfig,
|
|
12
58
|
settings,
|
|
13
|
-
paymentActions
|
|
59
|
+
paymentActions
|
|
14
60
|
}) => {
|
|
15
61
|
return (
|
|
16
62
|
<Tabs.Root
|
|
17
|
-
defaultValue={`tab-${activeTab}`}
|
|
18
63
|
value={`tab-${activeTab}`}
|
|
19
64
|
variant="regular"
|
|
20
65
|
onValueChange={(value) =>
|
|
@@ -28,26 +73,31 @@ const AppTabs = ({
|
|
|
28
73
|
<Tabs.Trigger value="tab-4">Documentation</Tabs.Trigger>
|
|
29
74
|
</Tabs.List>
|
|
30
75
|
<Tabs.Content value="tab-1">
|
|
31
|
-
<
|
|
76
|
+
<TabErrorBoundary activeTab={activeTab}>
|
|
77
|
+
<HistoryPanel />
|
|
78
|
+
</TabErrorBoundary>
|
|
32
79
|
</Tabs.Content>
|
|
33
80
|
<Tabs.Content value="tab-2">
|
|
34
|
-
<
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
81
|
+
<TabErrorBoundary activeTab={activeTab}>
|
|
82
|
+
<ConfigurationPanel
|
|
83
|
+
settings={settings}
|
|
84
|
+
onNavigateToConfig={onNavigateToConfig}
|
|
85
|
+
/>
|
|
86
|
+
</TabErrorBoundary>
|
|
38
87
|
</Tabs.Content>
|
|
39
|
-
|
|
40
|
-
|
|
41
88
|
<Tabs.Content value="tab-3">
|
|
42
|
-
<
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
89
|
+
<TabErrorBoundary activeTab={activeTab}>
|
|
90
|
+
<PaymentActionsPanel
|
|
91
|
+
onNavigateToConfig={onNavigateToConfig}
|
|
92
|
+
settings={settings}
|
|
93
|
+
paymentActions={paymentActions}
|
|
94
|
+
/>
|
|
95
|
+
</TabErrorBoundary>
|
|
47
96
|
</Tabs.Content>
|
|
48
|
-
|
|
49
97
|
<Tabs.Content value="tab-4">
|
|
50
|
-
<
|
|
98
|
+
<TabErrorBoundary activeTab={activeTab}>
|
|
99
|
+
<DocsPanel settings={settings} paymentActions={paymentActions} />
|
|
100
|
+
</TabErrorBoundary>
|
|
51
101
|
</Tabs.Content>
|
|
52
102
|
</Tabs.Root>
|
|
53
103
|
);
|
|
@@ -1,16 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Field,
|
|
3
|
-
Flex,
|
|
4
|
-
DesignSystemProvider,
|
|
5
|
-
Tooltip,
|
|
6
|
-
Typography,
|
|
7
|
-
darkTheme,
|
|
8
|
-
lightTheme,
|
|
9
|
-
} from "@strapi/design-system";
|
|
1
|
+
import { Field, Flex, Tooltip, Typography } from "@strapi/design-system";
|
|
10
2
|
import { Information } from "@strapi/icons";
|
|
11
3
|
import { InputComponent } from "../../utils/getInputComponent";
|
|
12
4
|
import { shouldShowTooltip } from "../../utils/tooltipHelpers";
|
|
13
|
-
import { useSystemTheme } from "../../hooks/use-system-theme";
|
|
14
5
|
|
|
15
6
|
const RenderInput = ({
|
|
16
7
|
hint,
|
|
@@ -32,14 +23,12 @@ const RenderInput = ({
|
|
|
32
23
|
labelDirection = "column",
|
|
33
24
|
...props
|
|
34
25
|
}) => {
|
|
35
|
-
const systemTheme = useSystemTheme();
|
|
36
|
-
const theme = systemTheme === "dark" ? darkTheme : lightTheme;
|
|
37
26
|
const getLabelStyle = () => {
|
|
38
27
|
if (labelDirection === "row") {
|
|
39
28
|
return {
|
|
40
29
|
display: "flex",
|
|
41
30
|
flexDirection: "row",
|
|
42
|
-
justifyContent: "space-between"
|
|
31
|
+
justifyContent: "space-between"
|
|
43
32
|
};
|
|
44
33
|
}
|
|
45
34
|
return { display: "flex", flexDirection: "column" };
|
|
@@ -51,16 +40,13 @@ const RenderInput = ({
|
|
|
51
40
|
<Flex alignItems="center" gap={1} style={{ marginBottom: "5px" }}>
|
|
52
41
|
<Field.Label style={labelStyle}>{label}</Field.Label>
|
|
53
42
|
{shouldShowTooltip(inputType, tooltipContent) && (
|
|
54
|
-
<
|
|
55
|
-
<
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
/>
|
|
62
|
-
</Tooltip>
|
|
63
|
-
</DesignSystemProvider>
|
|
43
|
+
<Tooltip label={tooltipContent}>
|
|
44
|
+
<Information
|
|
45
|
+
style={{
|
|
46
|
+
cursor: "pointer"
|
|
47
|
+
}}
|
|
48
|
+
/>
|
|
49
|
+
</Tooltip>
|
|
64
50
|
)}
|
|
65
51
|
</Flex>
|
|
66
52
|
<InputComponent
|
|
@@ -75,8 +61,6 @@ const RenderInput = ({
|
|
|
75
61
|
placeholder={placeholder}
|
|
76
62
|
onLabel={onLabel}
|
|
77
63
|
offLabel={offLabel}
|
|
78
|
-
systemTheme={systemTheme}
|
|
79
|
-
theme={theme}
|
|
80
64
|
type={type}
|
|
81
65
|
{...props}
|
|
82
66
|
/>
|
|
@@ -24,7 +24,7 @@ const App = () => {
|
|
|
24
24
|
|
|
25
25
|
if (isApplePayConfigPage) {
|
|
26
26
|
return (
|
|
27
|
-
<Layouts.Root>
|
|
27
|
+
<Layouts.Root className="payone-provider-root">
|
|
28
28
|
<AppHeader
|
|
29
29
|
title="Apple Pay Configuration"
|
|
30
30
|
activeTab={null}
|
|
@@ -48,7 +48,7 @@ const App = () => {
|
|
|
48
48
|
|
|
49
49
|
if (isGooglePayConfigPage) {
|
|
50
50
|
return (
|
|
51
|
-
<Layouts.Root>
|
|
51
|
+
<Layouts.Root className="payone-provider-root">
|
|
52
52
|
<AppHeader
|
|
53
53
|
title="Google Pay Configuration"
|
|
54
54
|
activeTab={null}
|
|
@@ -72,7 +72,7 @@ const App = () => {
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
return (
|
|
75
|
-
<Layouts.Root>
|
|
75
|
+
<Layouts.Root className="payone-provider-root">
|
|
76
76
|
<AppHeader
|
|
77
77
|
activeTab={activeTab}
|
|
78
78
|
isSaving={settings.isSaving}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
[data-state="inactive"],
|
|
2
|
-
[data-state="active"] {
|
|
1
|
+
.payone-provider-root [data-state="inactive"],
|
|
2
|
+
.payone-provider-root [data-state="active"] {
|
|
3
3
|
background: transparent !important;
|
|
4
4
|
}
|
|
5
5
|
|
|
@@ -29,7 +29,6 @@
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
@keyframes pulse {
|
|
32
|
-
|
|
33
32
|
0%,
|
|
34
33
|
100% {
|
|
35
34
|
opacity: 1;
|
|
@@ -50,9 +49,8 @@
|
|
|
50
49
|
}
|
|
51
50
|
}
|
|
52
51
|
|
|
53
|
-
|
|
54
52
|
/* Tab Button Base Styles */
|
|
55
|
-
button[role="tab"] {
|
|
53
|
+
.payone-provider-root button[role="tab"] {
|
|
56
54
|
box-shadow: none !important;
|
|
57
55
|
border: none !important;
|
|
58
56
|
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
|
|
@@ -60,44 +58,49 @@ button[role="tab"] {
|
|
|
60
58
|
background: transparent !important;
|
|
61
59
|
outline: none !important;
|
|
62
60
|
transform: scale(1) !important;
|
|
63
|
-
|
|
64
61
|
}
|
|
65
62
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
button[role="tab"]:active {
|
|
63
|
+
.payone-provider-root button[role="tab"]:active {
|
|
69
64
|
transform: scale(1) !important;
|
|
70
65
|
}
|
|
71
66
|
|
|
72
67
|
/* Remove shake animation */
|
|
73
|
-
button[role="tab"]:focus,
|
|
74
|
-
button[role="tab"]:focus-visible {
|
|
68
|
+
.payone-provider-root button[role="tab"]:focus,
|
|
69
|
+
.payone-provider-root button[role="tab"]:focus-visible {
|
|
75
70
|
outline: none !important;
|
|
76
71
|
box-shadow: none !important;
|
|
77
72
|
transform: none !important;
|
|
78
73
|
}
|
|
79
74
|
|
|
80
|
-
button[role="tab"][data-state="active"] {
|
|
81
|
-
background: linear-gradient(
|
|
75
|
+
.payone-provider-root button[role="tab"][data-state="active"] {
|
|
76
|
+
background: linear-gradient(
|
|
77
|
+
180deg,
|
|
78
|
+
rgba(73, 69, 255, 0.05) 0%,
|
|
79
|
+
transparent 100%
|
|
80
|
+
) !important;
|
|
82
81
|
color: #4945ff !important;
|
|
83
82
|
font-weight: 600 !important;
|
|
84
83
|
box-shadow: none !important;
|
|
85
84
|
border: none !important;
|
|
86
85
|
}
|
|
87
86
|
|
|
88
|
-
button[role="tab"][data-state="inactive"] {
|
|
87
|
+
.payone-provider-root button[role="tab"][data-state="inactive"] {
|
|
89
88
|
background: transparent !important;
|
|
90
89
|
color: #6b7280 !important;
|
|
91
90
|
box-shadow: none !important;
|
|
92
91
|
border: none !important;
|
|
93
92
|
}
|
|
94
93
|
|
|
95
|
-
button[role="tab"][data-state="inactive"]::after {
|
|
94
|
+
.payone-provider-root button[role="tab"][data-state="inactive"]::after {
|
|
96
95
|
background: transparent;
|
|
97
96
|
}
|
|
98
97
|
|
|
99
|
-
button[role="tab"][data-state="inactive"]:hover {
|
|
100
|
-
background: linear-gradient(
|
|
98
|
+
.payone-provider-root button[role="tab"][data-state="inactive"]:hover {
|
|
99
|
+
background: linear-gradient(
|
|
100
|
+
180deg,
|
|
101
|
+
rgba(73, 69, 255, 0.02) 0%,
|
|
102
|
+
transparent 100%
|
|
103
|
+
) !important;
|
|
101
104
|
box-shadow: none !important;
|
|
102
105
|
}
|
|
103
106
|
|
|
@@ -144,15 +147,17 @@ button[role="tab"][data-state="inactive"]:hover {
|
|
|
144
147
|
.payment-divider {
|
|
145
148
|
border: none;
|
|
146
149
|
height: 1px;
|
|
147
|
-
background: linear-gradient(
|
|
150
|
+
background: linear-gradient(
|
|
151
|
+
90deg,
|
|
152
|
+
transparent 0%,
|
|
153
|
+
#e8e8ea 20%,
|
|
154
|
+
#e8e8ea 80%,
|
|
155
|
+
transparent 100%
|
|
156
|
+
);
|
|
148
157
|
margin: 32px 0;
|
|
149
158
|
animation: fadeIn 0.4s ease-out;
|
|
150
159
|
}
|
|
151
160
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
161
|
/* ===== Responsive ===== */
|
|
157
162
|
@media (max-width: 768px) {
|
|
158
163
|
.payment-container {
|
|
@@ -168,4 +173,4 @@ button[role="tab"][data-state="inactive"]:hover {
|
|
|
168
173
|
.payment-grid-3 {
|
|
169
174
|
grid-template-columns: 1fr;
|
|
170
175
|
}
|
|
171
|
-
}
|
|
176
|
+
}
|
|
@@ -4,14 +4,27 @@ import {
|
|
|
4
4
|
SingleSelect,
|
|
5
5
|
SingleSelectOption,
|
|
6
6
|
Switch,
|
|
7
|
-
DesignSystemProvider,
|
|
8
7
|
Tooltip,
|
|
9
8
|
Textarea,
|
|
10
9
|
Toggle,
|
|
11
10
|
Checkbox,
|
|
12
|
-
Typography
|
|
11
|
+
Typography
|
|
13
12
|
} from "@strapi/design-system";
|
|
14
13
|
import { Information } from "@strapi/icons";
|
|
14
|
+
|
|
15
|
+
const TooltipIcon = ({ tooltipContent }) => {
|
|
16
|
+
if (!tooltipContent) return null;
|
|
17
|
+
return (
|
|
18
|
+
<Tooltip label={tooltipContent ?? ""}>
|
|
19
|
+
<Information
|
|
20
|
+
style={{
|
|
21
|
+
cursor: "pointer"
|
|
22
|
+
}}
|
|
23
|
+
/>
|
|
24
|
+
</Tooltip>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
|
|
15
28
|
export const InputComponent = ({
|
|
16
29
|
inputType,
|
|
17
30
|
name,
|
|
@@ -23,8 +36,6 @@ export const InputComponent = ({
|
|
|
23
36
|
placeholder = "",
|
|
24
37
|
onLabel = "True",
|
|
25
38
|
offLabel = "False",
|
|
26
|
-
systemTheme,
|
|
27
|
-
theme,
|
|
28
39
|
className = "payment-input",
|
|
29
40
|
type = "text",
|
|
30
41
|
...props
|
|
@@ -43,16 +54,7 @@ export const InputComponent = ({
|
|
|
43
54
|
type={type}
|
|
44
55
|
endAction={
|
|
45
56
|
tooltipContent ? (
|
|
46
|
-
<
|
|
47
|
-
<Tooltip label={tooltipContent ?? ""}>
|
|
48
|
-
<Information
|
|
49
|
-
style={{
|
|
50
|
-
cursor: "pointer",
|
|
51
|
-
color: systemTheme === "dark" ? "#fff" : "#000",
|
|
52
|
-
}}
|
|
53
|
-
/>
|
|
54
|
-
</Tooltip>
|
|
55
|
-
</DesignSystemProvider>
|
|
57
|
+
<TooltipIcon tooltipContent={tooltipContent} />
|
|
56
58
|
) : null
|
|
57
59
|
}
|
|
58
60
|
{...props}
|
|
@@ -71,16 +73,7 @@ export const InputComponent = ({
|
|
|
71
73
|
required={required}
|
|
72
74
|
startAction={
|
|
73
75
|
tooltipContent ? (
|
|
74
|
-
<
|
|
75
|
-
<Tooltip label={tooltipContent ?? ""}>
|
|
76
|
-
<Information
|
|
77
|
-
style={{
|
|
78
|
-
cursor: "pointer",
|
|
79
|
-
color: systemTheme === "dark" ? "#fff" : "#000",
|
|
80
|
-
}}
|
|
81
|
-
/>
|
|
82
|
-
</Tooltip>
|
|
83
|
-
</DesignSystemProvider>
|
|
76
|
+
<TooltipIcon tooltipContent={tooltipContent} />
|
|
84
77
|
) : null
|
|
85
78
|
}
|
|
86
79
|
{...props}
|
|
@@ -143,16 +136,7 @@ export const InputComponent = ({
|
|
|
143
136
|
type="date"
|
|
144
137
|
startAction={
|
|
145
138
|
tooltipContent ? (
|
|
146
|
-
<
|
|
147
|
-
<Tooltip label={tooltipContent ?? ""}>
|
|
148
|
-
<Information
|
|
149
|
-
style={{
|
|
150
|
-
cursor: "pointer",
|
|
151
|
-
color: systemTheme === "dark" ? "#fff" : "#000",
|
|
152
|
-
}}
|
|
153
|
-
/>
|
|
154
|
-
</Tooltip>
|
|
155
|
-
</DesignSystemProvider>
|
|
139
|
+
<TooltipIcon tooltipContent={tooltipContent} />
|
|
156
140
|
) : null
|
|
157
141
|
}
|
|
158
142
|
{...props}
|
|
@@ -179,7 +163,7 @@ export const InputComponent = ({
|
|
|
179
163
|
if (typeof onChange === "function") {
|
|
180
164
|
const syntheticEvent = {
|
|
181
165
|
target: { value: selectedValue },
|
|
182
|
-
currentTarget: { value: selectedValue }
|
|
166
|
+
currentTarget: { value: selectedValue }
|
|
183
167
|
};
|
|
184
168
|
onChange(syntheticEvent);
|
|
185
169
|
}
|
|
@@ -188,16 +172,7 @@ export const InputComponent = ({
|
|
|
188
172
|
placeholder={placeholder}
|
|
189
173
|
startIcon={
|
|
190
174
|
tooltipContent ? (
|
|
191
|
-
<
|
|
192
|
-
<Tooltip label={tooltipContent ?? ""}>
|
|
193
|
-
<Information
|
|
194
|
-
style={{
|
|
195
|
-
cursor: "pointer",
|
|
196
|
-
color: systemTheme === "dark" ? "#fff" : "#000",
|
|
197
|
-
}}
|
|
198
|
-
/>
|
|
199
|
-
</Tooltip>
|
|
200
|
-
</DesignSystemProvider>
|
|
175
|
+
<TooltipIcon tooltipContent={tooltipContent} />
|
|
201
176
|
) : null
|
|
202
177
|
}
|
|
203
178
|
{...props}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "strapi-plugin-payone-provider",
|
|
3
|
-
"version": "5.6.
|
|
3
|
+
"version": "5.6.13",
|
|
4
4
|
"description": "Strapi plugin for Payone payment gateway integration",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"maintainers": [
|
|
@@ -42,4 +42,4 @@
|
|
|
42
42
|
"kind": "plugin",
|
|
43
43
|
"displayName": "Strapi Payone Provider"
|
|
44
44
|
}
|
|
45
|
-
}
|
|
45
|
+
}
|