@tap-payments/os-micro-frontend-shared 0.0.14 → 0.0.16

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.
Files changed (64) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +12 -12
  3. package/build/components/CountBadge/style.d.ts +1 -1
  4. package/build/components/Dialog/style.d.ts +1 -1
  5. package/build/components/FlippingCard/style.d.ts +1 -1
  6. package/build/components/ImageWrapper/ImageWrapper.d.ts +1 -1
  7. package/build/components/JSONViewer/JSONViewer.d.ts +2 -2
  8. package/build/components/JSONViewer/JSONViewer.js +19 -42
  9. package/build/components/JSONViewer/JSONViewerList.d.ts +9 -0
  10. package/build/components/JSONViewer/JSONViewerList.js +10 -0
  11. package/build/components/JSONViewer/components/JSONTitleBar/JSONTitleBar.js +1 -2
  12. package/build/components/JSONViewer/context/Provider.d.ts +6 -0
  13. package/build/components/JSONViewer/context/Provider.js +37 -0
  14. package/build/components/JSONViewer/context/context.d.ts +3 -0
  15. package/build/components/JSONViewer/context/context.js +7 -0
  16. package/build/components/JSONViewer/context/index.d.ts +2 -0
  17. package/build/components/JSONViewer/context/index.js +2 -0
  18. package/build/components/JSONViewer/hooks/index.d.ts +1 -0
  19. package/build/components/JSONViewer/hooks/index.js +1 -0
  20. package/build/components/JSONViewer/hooks/useJsonViewerContext.d.ts +8 -0
  21. package/build/components/JSONViewer/hooks/useJsonViewerContext.js +18 -0
  22. package/build/components/JSONViewer/index.d.ts +4 -1
  23. package/build/components/JSONViewer/index.js +4 -1
  24. package/build/components/JSONViewer/style.d.ts +2 -2
  25. package/build/components/JSONViewer/type.d.ts +18 -10
  26. package/build/components/SearchButton/styles.d.ts +2 -2
  27. package/build/components/StatusIcons/AuthIcons/style.d.ts +2 -2
  28. package/build/components/StatusIcons/AuthorizationAutoIcons/style.d.ts +1 -1
  29. package/build/components/StatusIcons/ChargeStatusIcon/style.d.ts +6 -6
  30. package/build/components/StatusIcons/SourceIcons/style.d.ts +1 -1
  31. package/build/components/TableCells/CustomCells/ActionCell/style.d.ts +1 -1
  32. package/build/components/TableCells/CustomCells/AmountCell/index.d.ts +1 -0
  33. package/build/components/TableCells/CustomCells/AmountCell/index.js +1 -0
  34. package/build/components/TableCells/CustomCells/AuthenticationCell/style.d.ts +2 -2
  35. package/build/components/TableCells/CustomCells/AuthenticationStatusCell/style.d.ts +5 -5
  36. package/build/components/TableCells/CustomCells/AuthenticationTypeCell/style.d.ts +5 -5
  37. package/build/components/TableCells/CustomCells/BalanceCell/style.d.ts +1 -1
  38. package/build/components/TableCells/CustomCells/ChannelsCell/style.d.ts +1 -1
  39. package/build/components/TableCells/CustomCells/CheckoutStatusCell/style.d.ts +1 -1
  40. package/build/components/TableCells/CustomCells/DestinationStatusCell/style.d.ts +5 -5
  41. package/build/components/TableCells/CustomCells/DueDateCell/style.d.ts +1 -1
  42. package/build/components/TableCells/CustomCells/IDButton/style.d.ts +2 -2
  43. package/build/components/TableCells/CustomCells/IntentsStatusCell/style.d.ts +1 -1
  44. package/build/components/TableCells/CustomCells/InvoiceStatusCell/style.d.ts +1 -1
  45. package/build/components/TableCells/CustomCells/PayoutStatusCell/style.d.ts +5 -5
  46. package/build/components/TableCells/CustomCells/ProductsCell/style.d.ts +1 -1
  47. package/build/components/TableCells/CustomCells/ReferenceCell/style.d.ts +1 -1
  48. package/build/components/TableCells/CustomCells/RefundChargeCell/style.d.ts +2 -2
  49. package/build/components/TableCells/CustomCells/RefundStatusCell/style.d.ts +1 -1
  50. package/build/components/TableCells/CustomCells/SegmentsCell/style.d.ts +1 -1
  51. package/build/components/TableCells/CustomCells/SourceCell/style.d.ts +1 -1
  52. package/build/components/TableCells/CustomCells/SourceMergedCell/style.d.ts +6 -6
  53. package/build/components/TableCells/CustomCells/StatusCell/style.d.ts +6 -6
  54. package/build/components/TableCells/CustomCells/TokenStatusCell/style.d.ts +5 -5
  55. package/build/components/TableCells/CustomCells/index.d.ts +1 -0
  56. package/build/components/TableCells/CustomCells/index.js +1 -0
  57. package/build/components/TableCells/CustomCells/style.d.ts +1 -1
  58. package/build/components/Toolbar/index.d.ts +1 -0
  59. package/build/components/Toolbar/index.js +1 -0
  60. package/build/components/VirtualTable/style.d.ts +1 -1
  61. package/build/components/Window/style.d.ts +2 -2
  62. package/build/components/index.d.ts +2 -1
  63. package/build/components/index.js +2 -1
  64. package/package.json +89 -89
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Tap Payments
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Tap Payments
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,12 +1,12 @@
1
- # os-micro-frontend-shared
2
-
3
- ## Publishing Workflow
4
-
5
- 1. Update version in package.json
6
- 2. Commit changes
7
- 3. Create and push a tag:
8
-
9
- ```bash
10
- npm version patch # or minor, major
11
- git push origin main --tags
12
- ```
1
+ # os-micro-frontend-shared
2
+
3
+ ## Publishing Workflow
4
+
5
+ 1. Update version in package.json
6
+ 2. Commit changes
7
+ 3. Create and push a tag:
8
+
9
+ ```bash
10
+ npm version patch # or minor, major
11
+ git push origin main --tags
12
+ ```
@@ -124,7 +124,7 @@ export declare const AgreementImageWrapper: import("@emotion/styled").StyledComp
124
124
  onBlurCapture?: import("react").FocusEventHandler<HTMLSpanElement> | undefined;
125
125
  onChange?: import("react").FormEventHandler<HTMLSpanElement> | undefined;
126
126
  onChangeCapture?: import("react").FormEventHandler<HTMLSpanElement> | undefined;
127
- onBeforeInput?: import("react").FormEventHandler<HTMLSpanElement> | undefined;
127
+ onBeforeInput?: import("react").InputEventHandler<HTMLSpanElement> | undefined;
128
128
  onBeforeInputCapture?: import("react").FormEventHandler<HTMLSpanElement> | undefined;
129
129
  onInput?: import("react").FormEventHandler<HTMLSpanElement> | undefined;
130
130
  onInputCapture?: import("react").FormEventHandler<HTMLSpanElement> | undefined;
@@ -124,7 +124,7 @@ export declare const DialogWrapper: import("@emotion/styled").StyledComponent<{
124
124
  onBlurCapture?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
125
125
  onChange?: import("react").FormEventHandler<HTMLDivElement> | undefined;
126
126
  onChangeCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
127
- onBeforeInput?: import("react").FormEventHandler<HTMLDivElement> | undefined;
127
+ onBeforeInput?: import("react").InputEventHandler<HTMLDivElement> | undefined;
128
128
  onBeforeInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
129
129
  onInput?: import("react").FormEventHandler<HTMLDivElement> | undefined;
130
130
  onInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
@@ -124,7 +124,7 @@ export declare const Wrapper: import("@emotion/styled").StyledComponent<{
124
124
  onBlurCapture?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
125
125
  onChange?: import("react").FormEventHandler<HTMLDivElement> | undefined;
126
126
  onChangeCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
127
- onBeforeInput?: import("react").FormEventHandler<HTMLDivElement> | undefined;
127
+ onBeforeInput?: import("react").InputEventHandler<HTMLDivElement> | undefined;
128
128
  onBeforeInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
129
129
  onInput?: import("react").FormEventHandler<HTMLDivElement> | undefined;
130
130
  onInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
@@ -124,7 +124,7 @@ declare const ImageWrapper: import("@emotion/styled").StyledComponent<{
124
124
  onBlurCapture?: import("react").FocusEventHandler<HTMLSpanElement> | undefined;
125
125
  onChange?: import("react").FormEventHandler<HTMLSpanElement> | undefined;
126
126
  onChangeCapture?: import("react").FormEventHandler<HTMLSpanElement> | undefined;
127
- onBeforeInput?: import("react").FormEventHandler<HTMLSpanElement> | undefined;
127
+ onBeforeInput?: import("react").InputEventHandler<HTMLSpanElement> | undefined;
128
128
  onBeforeInputCapture?: import("react").FormEventHandler<HTMLSpanElement> | undefined;
129
129
  onInput?: import("react").FormEventHandler<HTMLSpanElement> | undefined;
130
130
  onInputCapture?: import("react").FormEventHandler<HTMLSpanElement> | undefined;
@@ -1,2 +1,2 @@
1
- import { JSONViewerProps } from './type';
2
- export default function JSONViewer({ anchorEl, onClose, json, isAppMinimized, windowOrder, requestJson }: JSONViewerProps): import("react/jsx-runtime").JSX.Element;
1
+ import { JsonViewerProps } from './type';
2
+ export default function JSONViewer({ index, json, requestJson, isWindowMinimized, windowOrder, onClose }: JsonViewerProps): import("react/jsx-runtime").JSX.Element;
@@ -14,7 +14,7 @@ import { ButtonsWrapper, FooterWrapper, JSONContainer, JSONViewerWrapper, Sectio
14
14
  import TableFooter from '../VirtualTable/components/TableFooter';
15
15
  const VIEWER_WIDTH = 400;
16
16
  const animationDuration = 0.5;
17
- export default function JSONViewer({ anchorEl, onClose, json, isAppMinimized, windowOrder, requestJson }) {
17
+ export default function JSONViewer({ index, json, requestJson = {}, isWindowMinimized, windowOrder, onClose }) {
18
18
  var _a, _b, _c, _d;
19
19
  const [isMaximized, setIsMaximized] = useState(false);
20
20
  const [isResized, setIsResized] = useState(false);
@@ -29,25 +29,15 @@ export default function JSONViewer({ anchorEl, onClose, json, isAppMinimized, wi
29
29
  const requestTimerRef = useRef();
30
30
  const { onMouseEnter, onMouseLeave, isHovered } = useMouseState();
31
31
  const { height, width } = useWindowDimensions();
32
- const [position, setPosition] = useState({ x: width / 2 - VIEWER_WIDTH / 4, y: height / 2 - VIEWER_HEIGHT / 2 });
32
+ const [position, setPosition] = useState({
33
+ x: width / 2 + VIEWER_WIDTH / 4 - index * 20,
34
+ y: height / 2 - VIEWER_HEIGHT / 2 + index * 30,
35
+ });
33
36
  const resizableRef = useRef();
34
- const isOpen = Boolean(anchorEl);
35
- const jsonBody = useMemo(() => {
36
- try {
37
- const parsedJson = JSON.parse(json || '');
38
- if (requestJson) {
39
- parsedJson === null || parsedJson === void 0 ? true : delete parsedJson.request_body;
40
- }
41
- return parsedJson;
42
- }
43
- catch (error) {
44
- return {};
45
- }
46
- }, [json, requestJson]);
47
37
  const objectPropertiesCount = useMemo(() => {
48
38
  var _a;
49
- return (_a = Object.keys(jsonBody)) === null || _a === void 0 ? void 0 : _a.length;
50
- }, [jsonBody]);
39
+ return (_a = Object.keys(json)) === null || _a === void 0 ? void 0 : _a.length;
40
+ }, [json]);
51
41
  const isSafari = isSafariBrowser();
52
42
  const currentRequestWidth = Number((_b = (_a = resizableRef.current) === null || _a === void 0 ? void 0 : _a.state) === null || _b === void 0 ? void 0 : _b.width) || VIEWER_WIDTH;
53
43
  const onCopied = (text) => {
@@ -55,21 +45,10 @@ export default function JSONViewer({ anchorEl, onClose, json, isAppMinimized, wi
55
45
  navigator.clipboard.writeText(text || '').then(() => { });
56
46
  }, 10);
57
47
  };
58
- const requestJsonBody = useMemo(() => {
59
- try {
60
- if (!requestJson) {
61
- return {};
62
- }
63
- return JSON.parse(requestJson);
64
- }
65
- catch (error) {
66
- return {};
67
- }
68
- }, [requestJson]);
69
48
  const requestObjectPropertiesCount = useMemo(() => {
70
49
  var _a;
71
- return (_a = Object.keys(requestJsonBody)) === null || _a === void 0 ? void 0 : _a.length;
72
- }, [requestJsonBody]);
50
+ return (_a = Object.keys(requestJson)) === null || _a === void 0 ? void 0 : _a.length;
51
+ }, [requestJson]);
73
52
  useEffect(() => {
74
53
  if (requestTimerRef.current) {
75
54
  clearTimeout(requestTimerRef.current);
@@ -95,7 +74,7 @@ export default function JSONViewer({ anchorEl, onClose, json, isAppMinimized, wi
95
74
  });
96
75
  }, bounds: {
97
76
  top: 10,
98
- } }, { children: _jsx(Dialog, Object.assign({ disableEnforceFocus: true, sx: Object.assign(Object.assign(Object.assign(Object.assign({ backgroundColor: 'transparent', zIndex: (windowOrder || 0) + APP_WINDOW_Z_INDEX }, (isAppMinimized && {
77
+ } }, { children: _jsx(Dialog, Object.assign({ disableEnforceFocus: true, sx: Object.assign(Object.assign(Object.assign(Object.assign({ backgroundColor: 'transparent', zIndex: (windowOrder || 0) + APP_WINDOW_Z_INDEX + (isMaximized ? 1 : 0) }, (isWindowMinimized && {
99
78
  display: 'none',
100
79
  })), { transform: 'translate(180px, 14px)' }), (!isMaximized && {
101
80
  width: isSafari ? (newDimensions === null || newDimensions === void 0 ? void 0 : newDimensions.width) || viewerWidth : 'fit-content',
@@ -113,7 +92,7 @@ export default function JSONViewer({ anchorEl, onClose, json, isAppMinimized, wi
113
92
  setTimeout(() => {
114
93
  setIsToolbarAnimationDisabled(false);
115
94
  }, animationDuration * 1000);
116
- }, open: isOpen, hideBackdrop: true, fullScreen: isMaximized, "aria-labelledby": "draggable-dialog-title" }, { children: _jsx(Resizable, Object.assign({ enable: {
95
+ }, open: true, hideBackdrop: true, fullScreen: isMaximized, "aria-labelledby": "draggable-dialog-title" }, { children: _jsx(Resizable, Object.assign({ enable: {
117
96
  left: false,
118
97
  right: true,
119
98
  bottomRight: true,
@@ -149,9 +128,7 @@ export default function JSONViewer({ anchorEl, onClose, json, isAppMinimized, wi
149
128
  transform: `translateX(${isRequestShown ? -currentRequestWidth : 0}px)`,
150
129
  })), transition: Object.assign({ duration: animationDuration }, (isToolbarAnimationDisabled && {
151
130
  duration: 0,
152
- })) }, { children: _jsx(JSONTitleBar, { title: isRequestShown ? 'JSON Request & Response' : 'JSON Response', onClose: (e) => {
153
- onClose === null || onClose === void 0 ? void 0 : onClose(e);
154
- }, onMaximize: () => {
131
+ })) }, { children: _jsx(JSONTitleBar, { title: isRequestShown ? 'JSON Request & Response' : 'JSON Response', onClose: () => onClose(), onMaximize: () => {
155
132
  setIsMaximized((prev) => !prev);
156
133
  setIsToolbarAnimationDisabled(true);
157
134
  setTimeout(() => {
@@ -167,7 +144,7 @@ export default function JSONViewer({ anchorEl, onClose, json, isAppMinimized, wi
167
144
  height: VIEWER_HEIGHT,
168
145
  });
169
146
  }
170
- }, isRequestExpanded: isRequestShown, showRequestIcon: Boolean(requestJson) }) })), _jsxs(Box, Object.assign({ sx: {
147
+ }, isRequestExpanded: isRequestShown, showRequestIcon: Boolean(requestObjectPropertiesCount) }) })), _jsxs(Box, Object.assign({ sx: {
171
148
  display: 'flex',
172
149
  flexDirection: 'row',
173
150
  justifyContent: 'space-between',
@@ -213,10 +190,10 @@ export default function JSONViewer({ anchorEl, onClose, json, isAppMinimized, wi
213
190
  }, isRequestShown: isRequestShown }, { children: [_jsx(StyledHeaderWrapper, { children: _jsx(StyledTitle, Object.assign({ variant: "subtitle1" }, { children: "API Request" })) }), _jsxs(ButtonsWrapper, { children: [_jsx(AnimatedButton, { disableAnimation: true, onClick: () => {
214
191
  setIsRequestCollapsed((prev) => !prev);
215
192
  }, icon: !isRequestCollapsed ? collapseArrowsIcon : expandArrowsIcon }), _jsx(AnimatedButton, { onClick: () => {
216
- navigator.clipboard.writeText(json || '').then(() => { });
193
+ navigator.clipboard.writeText(JSON.stringify(json)).then(() => { });
217
194
  }, icon: codeIcon }), _jsx(AnimatedButton, { onClick: () => {
218
- navigator.clipboard.writeText((jsonBody === null || jsonBody === void 0 ? void 0 : jsonBody.id) || '').then(() => { });
219
- }, icon: idIcon })] })] })), _jsxs(JsonView, Object.assign({ value: requestJsonBody, style: requestJsonTheme, displayDataTypes: false, collapsed: isRequestCollapsed ? 1 : undefined, onCopied: (_, value) => {
195
+ navigator.clipboard.writeText((json === null || json === void 0 ? void 0 : json.id) || '').then(() => { });
196
+ }, icon: idIcon })] })] })), _jsxs(JsonView, Object.assign({ value: requestJson, style: requestJsonTheme, displayDataTypes: false, collapsed: isRequestCollapsed ? 1 : undefined, onCopied: (_, value) => {
220
197
  if (typeof value === 'string') {
221
198
  onCopied(value);
222
199
  }
@@ -265,10 +242,10 @@ export default function JSONViewer({ anchorEl, onClose, json, isAppMinimized, wi
265
242
  } }, { children: [_jsxs(SectionWrapper, Object.assign({ isMaximized: isMaximized, isScrollingRequest: isScrollingResponse, isRequestShown: isRequestShown }, { children: [_jsx(StyledHeaderWrapper, { children: _jsx(StyledTitle, Object.assign({ variant: "subtitle1" }, { children: "API Response" })) }), _jsxs(ButtonsWrapper, { children: [_jsx(AnimatedButton, { disableAnimation: true, onClick: () => {
266
243
  setIsResponseCollapsed((prev) => !prev);
267
244
  }, icon: !isResponseCollapsed ? collapseArrowsIcon : expandArrowsIcon }), _jsx(AnimatedButton, { onClick: () => {
268
- navigator.clipboard.writeText(json || '').then(() => { });
245
+ navigator.clipboard.writeText(JSON.stringify(json, null, 2)).then(() => { });
269
246
  }, icon: codeIcon }), _jsx(AnimatedButton, { onClick: () => {
270
- navigator.clipboard.writeText((jsonBody === null || jsonBody === void 0 ? void 0 : jsonBody.id) || '').then(() => { });
271
- }, icon: idIcon })] })] })), _jsxs(JsonView, Object.assign({ value: jsonBody, style: jsonTheme, displayDataTypes: false, collapsed: isResponseCollapsed ? 1 : undefined, onCopied: (_, value) => {
247
+ navigator.clipboard.writeText((json === null || json === void 0 ? void 0 : json.id) || '').then(() => { });
248
+ }, icon: idIcon })] })] })), _jsxs(JsonView, Object.assign({ value: json, style: jsonTheme, displayDataTypes: false, collapsed: isResponseCollapsed ? 1 : undefined, onCopied: (_, value) => {
272
249
  if (typeof value === 'string') {
273
250
  onCopied(value);
274
251
  }
@@ -0,0 +1,9 @@
1
+ import { JsonViewer } from './type';
2
+ type Props = {
3
+ list: JsonViewer[];
4
+ onClose: (index: number) => void;
5
+ isWindowMinimized: boolean;
6
+ windowOrder: number;
7
+ };
8
+ export declare const JSONViewerList: ({ list, onClose, isWindowMinimized, windowOrder }: Props) => import("react/jsx-runtime").JSX.Element | null;
9
+ export {};
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import JSONViewer from './JSONViewer';
3
+ export const JSONViewerList = ({ list, onClose, isWindowMinimized, windowOrder }) => {
4
+ if (!(list === null || list === void 0 ? void 0 : list.length)) {
5
+ return null;
6
+ }
7
+ return (_jsx(_Fragment, { children: list.map((item, index) => (_jsx(JSONViewer, { index: index, json: item.json, requestJson: item === null || item === void 0 ? void 0 : item.requestJson, onClose: () => {
8
+ onClose(index);
9
+ }, isWindowMinimized: isWindowMinimized, windowOrder: windowOrder }, item.json.id))) }));
10
+ };
@@ -1,7 +1,6 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { memo } from 'react';
3
- import Toolbar from '../../../Toolbar';
4
- import { StyledHeaderWrapperStyled } from '../../../Toolbar/style';
3
+ import Toolbar, { StyledHeaderWrapperStyled } from '../../../Toolbar';
5
4
  import { CloseIcon, ExpandButton, MaximizeIcon } from '../../../ToolbarIcon';
6
5
  import { jsonIcon } from '../../../../constants/index.js';
7
6
  function JSONTitleBar({ title, onClose, onMaximize, maximized = false, id, onMouseHover, onMouseLeave, onRequestClick, isRequestExpanded = false, showRequestIcon = false, isHovered = false, }) {
@@ -0,0 +1,6 @@
1
+ import { ReactNode } from 'react';
2
+ type JsonViewerDialogProviderProps = {
3
+ children: ReactNode;
4
+ };
5
+ export declare const JsonViewerDialogContextProvider: ({ children }: JsonViewerDialogProviderProps) => import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,37 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useCallback, useMemo, useState } from 'react';
3
+ import { JSONViewerList } from '../JSONViewerList';
4
+ import { JsonViewerDialogContext } from './context';
5
+ export const JsonViewerDialogContextProvider = ({ children }) => {
6
+ const [jsonViewerList, setJsonViewerList] = useState([]);
7
+ const [isWindowMinimized, setIsWindowMinimized] = useState(false);
8
+ const [windowOrder, setWindowOrder] = useState(1);
9
+ const handleJsonViewerDialogOpen = useCallback((jsonViewer) => {
10
+ var _a;
11
+ if (jsonViewerList.length === 7) {
12
+ alert('Maximum allowed active Json Viewer is 7 per table.');
13
+ return;
14
+ }
15
+ if (jsonViewerList.some((item) => item.json.id === jsonViewer.json.id)) {
16
+ return;
17
+ }
18
+ (_a = jsonViewer === null || jsonViewer === void 0 ? void 0 : jsonViewer.json) === null || _a === void 0 ? true : delete _a.request_body;
19
+ setJsonViewerList((prev) => [...prev, jsonViewer]);
20
+ }, [jsonViewerList]);
21
+ const handleJsonViewerDialogClose = (index) => {
22
+ setJsonViewerList((prev) => prev.filter((_, idx) => index !== idx));
23
+ };
24
+ const handleWindowMinimize = (value) => {
25
+ setIsWindowMinimized(value);
26
+ };
27
+ const handleWindowOrder = (value) => {
28
+ setWindowOrder(value);
29
+ };
30
+ const contextValue = useMemo(() => ({
31
+ jsonViewerList,
32
+ handleJsonViewerDialogOpen,
33
+ handleWindowMinimize,
34
+ handleWindowOrder,
35
+ }), [jsonViewerList, handleJsonViewerDialogOpen]);
36
+ return (_jsxs(JsonViewerDialogContext.Provider, Object.assign({ value: contextValue }, { children: [children, _jsx(JSONViewerList, { list: jsonViewerList, onClose: handleJsonViewerDialogClose, isWindowMinimized: isWindowMinimized, windowOrder: windowOrder })] })));
37
+ };
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { JsonViewerContext } from '../type';
3
+ export declare const JsonViewerDialogContext: import("react").Context<JsonViewerContext>;
@@ -0,0 +1,7 @@
1
+ import { createContext } from 'react';
2
+ export const JsonViewerDialogContext = createContext({
3
+ jsonViewerList: [],
4
+ handleJsonViewerDialogOpen: () => { },
5
+ handleWindowMinimize: () => { },
6
+ handleWindowOrder: () => { },
7
+ });
@@ -0,0 +1,2 @@
1
+ export * from './context';
2
+ export { JsonViewerDialogContextProvider } from './Provider';
@@ -0,0 +1,2 @@
1
+ export * from './context';
2
+ export { JsonViewerDialogContextProvider } from './Provider';
@@ -0,0 +1 @@
1
+ export { useJsonViewerContext } from './useJsonViewerContext';
@@ -0,0 +1 @@
1
+ export { useJsonViewerContext } from './useJsonViewerContext';
@@ -0,0 +1,8 @@
1
+ type Props = {
2
+ isWindowMinimized: boolean;
3
+ windowOrder: number;
4
+ };
5
+ export declare const useJsonViewerContext: ({ isWindowMinimized, windowOrder }: Props) => {
6
+ handleJsonViewerDialogOpen: (jsonViewer: import("..").JsonViewer) => void;
7
+ };
8
+ export {};
@@ -0,0 +1,18 @@
1
+ import { useContext, useEffect, useCallback } from 'react';
2
+ import { JsonViewerDialogContext } from '../context';
3
+ export const useJsonViewerContext = ({ isWindowMinimized, windowOrder }) => {
4
+ const { handleJsonViewerDialogOpen, handleWindowMinimize, handleWindowOrder } = useContext(JsonViewerDialogContext);
5
+ const onWindowMinimize = useCallback(() => {
6
+ handleWindowMinimize(isWindowMinimized);
7
+ }, [handleWindowMinimize, isWindowMinimized]);
8
+ const onWindowOrder = useCallback(() => {
9
+ handleWindowOrder(windowOrder);
10
+ }, [handleWindowOrder, windowOrder]);
11
+ useEffect(() => {
12
+ onWindowOrder();
13
+ }, [onWindowOrder]);
14
+ useEffect(() => {
15
+ onWindowMinimize();
16
+ }, [onWindowMinimize]);
17
+ return { handleJsonViewerDialogOpen };
18
+ };
@@ -1,4 +1,7 @@
1
1
  import JSONViewer from './JSONViewer';
2
- export * from './components';
2
+ export * from './context';
3
3
  export * from './type';
4
+ export * from './hooks';
5
+ export * from './JSONViewerList';
6
+ export * from './components';
4
7
  export default JSONViewer;
@@ -1,4 +1,7 @@
1
1
  import JSONViewer from './JSONViewer';
2
- export * from './components';
2
+ export * from './context';
3
3
  export * from './type';
4
+ export * from './hooks';
5
+ export * from './JSONViewerList';
6
+ export * from './components';
4
7
  export default JSONViewer;
@@ -215,7 +215,7 @@ export declare const JSONViewerWrapper: import("@emotion/styled").StyledComponen
215
215
  onBlurCapture?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
216
216
  onChange?: import("react").FormEventHandler<HTMLDivElement> | undefined;
217
217
  onChangeCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
218
- onBeforeInput?: import("react").FormEventHandler<HTMLDivElement> | undefined;
218
+ onBeforeInput?: import("react").InputEventHandler<HTMLDivElement> | undefined;
219
219
  onBeforeInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
220
220
  onInput?: import("react").FormEventHandler<HTMLDivElement> | undefined;
221
221
  onInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
@@ -480,7 +480,7 @@ export declare const JSONViewerWrapperRequest: import("@emotion/styled").StyledC
480
480
  onBlurCapture?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
481
481
  onChange?: import("react").FormEventHandler<HTMLDivElement> | undefined;
482
482
  onChangeCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
483
- onBeforeInput?: import("react").FormEventHandler<HTMLDivElement> | undefined;
483
+ onBeforeInput?: import("react").InputEventHandler<HTMLDivElement> | undefined;
484
484
  onBeforeInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
485
485
  onInput?: import("react").FormEventHandler<HTMLDivElement> | undefined;
486
486
  onInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
@@ -1,14 +1,22 @@
1
- import React, { SyntheticEvent } from 'react';
2
- export interface JSONViewerProps {
3
- json?: string;
4
- anchorEl: null | HTMLElement;
5
- onClose?: (e?: SyntheticEvent) => void;
6
- requestJson?: string;
7
- isAppMinimized?: boolean;
1
+ import type { HTMLAttributes, ReactNode } from 'react';
2
+ export type JsonViewerProps = JsonViewer & {
3
+ index: number;
4
+ onClose: () => void;
5
+ isWindowMinimized?: boolean;
8
6
  windowOrder?: number;
9
- }
10
- export interface AnimatedButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
11
- label?: React.ReactNode;
7
+ };
8
+ export interface AnimatedButtonProps extends HTMLAttributes<HTMLButtonElement> {
9
+ label?: ReactNode;
12
10
  icon?: string;
13
11
  disableAnimation?: boolean;
14
12
  }
13
+ export type JsonViewer = {
14
+ json: Record<string, any>;
15
+ requestJson?: Record<string, any>;
16
+ };
17
+ export type JsonViewerContext = {
18
+ jsonViewerList: JsonViewer[];
19
+ handleJsonViewerDialogOpen: (jsonViewer: JsonViewer) => void;
20
+ handleWindowMinimize: (value: boolean) => void;
21
+ handleWindowOrder: (value: number) => void;
22
+ };
@@ -130,7 +130,7 @@ export declare const StyledInput: import("@emotion/styled").StyledComponent<{
130
130
  onBlurCapture?: import("react").FocusEventHandler<HTMLInputElement> | undefined;
131
131
  onChange?: import("react").ChangeEventHandler<HTMLInputElement> | undefined;
132
132
  onChangeCapture?: import("react").FormEventHandler<HTMLInputElement> | undefined;
133
- onBeforeInput?: import("react").FormEventHandler<HTMLInputElement> | undefined;
133
+ onBeforeInput?: import("react").InputEventHandler<HTMLInputElement> | undefined;
134
134
  onBeforeInputCapture?: import("react").FormEventHandler<HTMLInputElement> | undefined;
135
135
  onInput?: import("react").FormEventHandler<HTMLInputElement> | undefined;
136
136
  onInputCapture?: import("react").FormEventHandler<HTMLInputElement> | undefined;
@@ -418,7 +418,7 @@ export declare const Icon: import("@emotion/styled").StyledComponent<{
418
418
  onBlurCapture?: import("react").FocusEventHandler<HTMLImageElement> | undefined;
419
419
  onChange?: import("react").FormEventHandler<HTMLImageElement> | undefined;
420
420
  onChangeCapture?: import("react").FormEventHandler<HTMLImageElement> | undefined;
421
- onBeforeInput?: import("react").FormEventHandler<HTMLImageElement> | undefined;
421
+ onBeforeInput?: import("react").InputEventHandler<HTMLImageElement> | undefined;
422
422
  onBeforeInputCapture?: import("react").FormEventHandler<HTMLImageElement> | undefined;
423
423
  onInput?: import("react").FormEventHandler<HTMLImageElement> | undefined;
424
424
  onInputCapture?: import("react").FormEventHandler<HTMLImageElement> | undefined;
@@ -126,7 +126,7 @@ export declare const PaymentSourcesContainer: import("@emotion/styled").StyledCo
126
126
  onBlurCapture?: import("react").FocusEventHandler<HTMLSpanElement> | undefined;
127
127
  onChange?: import("react").FormEventHandler<HTMLSpanElement> | undefined;
128
128
  onChangeCapture?: import("react").FormEventHandler<HTMLSpanElement> | undefined;
129
- onBeforeInput?: import("react").FormEventHandler<HTMLSpanElement> | undefined;
129
+ onBeforeInput?: import("react").InputEventHandler<HTMLSpanElement> | undefined;
130
130
  onBeforeInputCapture?: import("react").FormEventHandler<HTMLSpanElement> | undefined;
131
131
  onInput?: import("react").FormEventHandler<HTMLSpanElement> | undefined;
132
132
  onInputCapture?: import("react").FormEventHandler<HTMLSpanElement> | undefined;
@@ -393,7 +393,7 @@ export declare const AuthCellContainer: import("@emotion/styled").StyledComponen
393
393
  onBlurCapture?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
394
394
  onChange?: import("react").FormEventHandler<HTMLDivElement> | undefined;
395
395
  onChangeCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
396
- onBeforeInput?: import("react").FormEventHandler<HTMLDivElement> | undefined;
396
+ onBeforeInput?: import("react").InputEventHandler<HTMLDivElement> | undefined;
397
397
  onBeforeInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
398
398
  onInput?: import("react").FormEventHandler<HTMLDivElement> | undefined;
399
399
  onInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
@@ -124,7 +124,7 @@ export declare const BalanceCellContainer: import("@emotion/styled").StyledCompo
124
124
  onBlurCapture?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
125
125
  onChange?: import("react").FormEventHandler<HTMLDivElement> | undefined;
126
126
  onChangeCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
127
- onBeforeInput?: import("react").FormEventHandler<HTMLDivElement> | undefined;
127
+ onBeforeInput?: import("react").InputEventHandler<HTMLDivElement> | undefined;
128
128
  onBeforeInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
129
129
  onInput?: import("react").FormEventHandler<HTMLDivElement> | undefined;
130
130
  onInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
@@ -124,7 +124,7 @@ export declare const ErrorCodeLabel: import("@emotion/styled").StyledComponent<{
124
124
  onBlurCapture?: import("react").FocusEventHandler<HTMLSpanElement> | undefined;
125
125
  onChange?: import("react").FormEventHandler<HTMLSpanElement> | undefined;
126
126
  onChangeCapture?: import("react").FormEventHandler<HTMLSpanElement> | undefined;
127
- onBeforeInput?: import("react").FormEventHandler<HTMLSpanElement> | undefined;
127
+ onBeforeInput?: import("react").InputEventHandler<HTMLSpanElement> | undefined;
128
128
  onBeforeInputCapture?: import("react").FormEventHandler<HTMLSpanElement> | undefined;
129
129
  onInput?: import("react").FormEventHandler<HTMLSpanElement> | undefined;
130
130
  onInputCapture?: import("react").FormEventHandler<HTMLSpanElement> | undefined;
@@ -386,7 +386,7 @@ export declare const ErrorCodeWrapper: import("@emotion/styled").StyledComponent
386
386
  onBlurCapture?: import("react").FocusEventHandler<HTMLSpanElement> | undefined;
387
387
  onChange?: import("react").FormEventHandler<HTMLSpanElement> | undefined;
388
388
  onChangeCapture?: import("react").FormEventHandler<HTMLSpanElement> | undefined;
389
- onBeforeInput?: import("react").FormEventHandler<HTMLSpanElement> | undefined;
389
+ onBeforeInput?: import("react").InputEventHandler<HTMLSpanElement> | undefined;
390
390
  onBeforeInputCapture?: import("react").FormEventHandler<HTMLSpanElement> | undefined;
391
391
  onInput?: import("react").FormEventHandler<HTMLSpanElement> | undefined;
392
392
  onInputCapture?: import("react").FormEventHandler<HTMLSpanElement> | undefined;
@@ -649,7 +649,7 @@ export declare const GatewayIconWrapper: import("@emotion/styled").StyledCompone
649
649
  onBlurCapture?: import("react").FocusEventHandler<HTMLSpanElement> | undefined;
650
650
  onChange?: import("react").FormEventHandler<HTMLSpanElement> | undefined;
651
651
  onChangeCapture?: import("react").FormEventHandler<HTMLSpanElement> | undefined;
652
- onBeforeInput?: import("react").FormEventHandler<HTMLSpanElement> | undefined;
652
+ onBeforeInput?: import("react").InputEventHandler<HTMLSpanElement> | undefined;
653
653
  onBeforeInputCapture?: import("react").FormEventHandler<HTMLSpanElement> | undefined;
654
654
  onInput?: import("react").FormEventHandler<HTMLSpanElement> | undefined;
655
655
  onInputCapture?: import("react").FormEventHandler<HTMLSpanElement> | undefined;
@@ -911,7 +911,7 @@ export declare const GatewaysContainer: import("@emotion/styled").StyledComponen
911
911
  onBlurCapture?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
912
912
  onChange?: import("react").FormEventHandler<HTMLDivElement> | undefined;
913
913
  onChangeCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
914
- onBeforeInput?: import("react").FormEventHandler<HTMLDivElement> | undefined;
914
+ onBeforeInput?: import("react").InputEventHandler<HTMLDivElement> | undefined;
915
915
  onBeforeInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
916
916
  onInput?: import("react").FormEventHandler<HTMLDivElement> | undefined;
917
917
  onInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
@@ -1175,7 +1175,7 @@ export declare const UnCapturedBadge: import("@emotion/styled").StyledComponent<
1175
1175
  onBlurCapture?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
1176
1176
  onChange?: import("react").FormEventHandler<HTMLDivElement> | undefined;
1177
1177
  onChangeCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
1178
- onBeforeInput?: import("react").FormEventHandler<HTMLDivElement> | undefined;
1178
+ onBeforeInput?: import("react").InputEventHandler<HTMLDivElement> | undefined;
1179
1179
  onBeforeInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
1180
1180
  onInput?: import("react").FormEventHandler<HTMLDivElement> | undefined;
1181
1181
  onInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
@@ -1437,7 +1437,7 @@ export declare const UnCapturedContainer: import("@emotion/styled").StyledCompon
1437
1437
  onBlurCapture?: import("react").FocusEventHandler<HTMLSpanElement> | undefined;
1438
1438
  onChange?: import("react").FormEventHandler<HTMLSpanElement> | undefined;
1439
1439
  onChangeCapture?: import("react").FormEventHandler<HTMLSpanElement> | undefined;
1440
- onBeforeInput?: import("react").FormEventHandler<HTMLSpanElement> | undefined;
1440
+ onBeforeInput?: import("react").InputEventHandler<HTMLSpanElement> | undefined;
1441
1441
  onBeforeInputCapture?: import("react").FormEventHandler<HTMLSpanElement> | undefined;
1442
1442
  onInput?: import("react").FormEventHandler<HTMLSpanElement> | undefined;
1443
1443
  onInputCapture?: import("react").FormEventHandler<HTMLSpanElement> | undefined;
@@ -126,7 +126,7 @@ export declare const PaymentSourcesContainer: import("@emotion/styled").StyledCo
126
126
  onBlurCapture?: import("react").FocusEventHandler<HTMLSpanElement> | undefined;
127
127
  onChange?: import("react").FormEventHandler<HTMLSpanElement> | undefined;
128
128
  onChangeCapture?: import("react").FormEventHandler<HTMLSpanElement> | undefined;
129
- onBeforeInput?: import("react").FormEventHandler<HTMLSpanElement> | undefined;
129
+ onBeforeInput?: import("react").InputEventHandler<HTMLSpanElement> | undefined;
130
130
  onBeforeInputCapture?: import("react").FormEventHandler<HTMLSpanElement> | undefined;
131
131
  onInput?: import("react").FormEventHandler<HTMLSpanElement> | undefined;
132
132
  onInputCapture?: import("react").FormEventHandler<HTMLSpanElement> | undefined;
@@ -133,7 +133,7 @@ export declare const ActionIcon: import("@emotion/styled").StyledComponent<{
133
133
  onBlurCapture?: import("react").FocusEventHandler<HTMLImageElement> | undefined;
134
134
  onChange?: import("react").FormEventHandler<HTMLImageElement> | undefined;
135
135
  onChangeCapture?: import("react").FormEventHandler<HTMLImageElement> | undefined;
136
- onBeforeInput?: import("react").FormEventHandler<HTMLImageElement> | undefined;
136
+ onBeforeInput?: import("react").InputEventHandler<HTMLImageElement> | undefined;
137
137
  onBeforeInputCapture?: import("react").FormEventHandler<HTMLImageElement> | undefined;
138
138
  onInput?: import("react").FormEventHandler<HTMLImageElement> | undefined;
139
139
  onInputCapture?: import("react").FormEventHandler<HTMLImageElement> | undefined;
@@ -1,2 +1,3 @@
1
1
  export { default as AmountCell } from './AmountCell';
2
2
  export { AmountConversionTooltipLabel } from './AmountConversionTooltipLabel';
3
+ export * from './style';
@@ -1,2 +1,3 @@
1
1
  export { default as AmountCell } from './AmountCell';
2
2
  export { AmountConversionTooltipLabel } from './AmountConversionTooltipLabel';
3
+ export * from './style';