@veeqo/transfigure 0.0.37 → 1.0.0
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/dist/BusinessLogic/types.d.ts +2 -3
- package/dist/api/deleteCustomView/deleteCustomView.d.ts +1 -1
- package/dist/api/patchCurrentUser/patchCurrentUser.d.ts +1 -1
- package/dist/api/patchCustomView/patchCustomView.d.ts +1 -1
- package/dist/api/types.d.ts +1 -1
- package/dist/axiosWrappers/axiosWrappers.d.ts +13 -13
- package/dist/axiosWrappers/utils/filteringUtils/filteringUtils.d.ts +1 -1
- package/dist/components/Filters/Fields/CheckboxFilter/CheckboxFilter.d.ts +1 -1
- package/dist/components/Filters/Fields/NumberRangeFilter/MuiSlider.d.ts +4 -4
- package/dist/components/Filters/Fields/RadioFilter/RadioFilter.d.ts +1 -1
- package/dist/components/Filters/FilterGroup/mock.d.ts +2 -0
- package/dist/components/RefreshButton/RefreshButton.d.ts +1 -1
- package/dist/components/RefreshButton/styled.d.ts +3 -3
- package/dist/components/SearchBar/SearchBar.d.ts +2 -2
- package/dist/components/TableManagement/TableManagement.d.ts +1 -1
- package/dist/components/TableManagement/TableManagementModal.d.ts +1 -1
- package/dist/components/TableManagement/components/DroppableArea.d.ts +1 -1
- package/dist/components/TableManagement/components/styled.d.ts +312 -8
- package/dist/components/TableManagement/hooks/useCollisionDetectionStrategy/mockUseCollisionDetectionStrategy.d.ts +5 -0
- package/dist/components/TableManagement/hooks/useCollisionDetectionStrategy/useCollisionDetectionStrategy.test.d.ts +1 -0
- package/dist/components/TableManagement/hooks/useDragHandlers/mock.d.ts +13 -0
- package/dist/components/TableManagement/hooks/useDragHandlers/mockUseDragHandlers.d.ts +13 -0
- package/dist/components/TableManagement/hooks/useDragHandlers/useDragHandlers.test.d.ts +1 -0
- package/dist/components/TableManagement/types.d.ts +2 -3
- package/dist/components/TableManagement/utils/filterColumnsBySearch/filterColumnsBySearch.d.ts +1 -1
- package/dist/components/TableManagement/utils/filterColumnsBySearch/filterColumnsBySearch.test.d.ts +1 -0
- package/dist/components/Views/OptionsDropdown/styled.d.ts +2 -2
- package/dist/components/Views/PillNotifications/variants/styled.d.ts +7 -7
- package/dist/components/Views/SortableViews/styled.d.ts +1 -1
- package/dist/constants/constants.d.ts +1 -1
- package/dist/constants/dateConstants.d.ts +2 -2
- package/dist/context/ModalContext/mocks/mockUseModal.d.ts +7 -5
- package/dist/fetchers/withCSRF.d.ts +1 -1
- package/dist/hooks/useCustomViews/useCustomViews.d.ts +1 -1
- package/dist/hooks/usePersistColumns/mockUsePersistColumns.d.ts +7 -0
- package/dist/hooks/usePersistUnsavedChanges/mockUsePersistUnsavedChanges.d.ts +9 -0
- package/dist/hooks/useViewCountsHook/useViewCountsHook.d.ts +1 -1
- package/dist/hooks/useViews/useViews.d.ts +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +15 -13
- package/dist/index100.cjs +18 -11
- package/dist/index100.js +20 -12
- package/dist/index101.cjs +80 -1
- package/dist/index101.js +101 -2
- package/dist/index102.cjs +1 -1
- package/dist/index102.js +2 -36
- package/dist/index103.cjs +1 -1
- package/dist/index103.js +1 -1
- package/dist/index108.cjs +1 -1
- package/dist/index108.js +32 -22
- package/dist/index109.cjs +1 -7
- package/dist/index109.js +26 -10
- package/dist/index11.cjs +1 -1
- package/dist/index11.js +10 -10
- package/dist/index110.cjs +7 -1
- package/dist/index110.js +10 -63
- package/dist/index111.cjs +1 -1
- package/dist/index111.js +58 -42
- package/dist/index112.cjs +1 -1
- package/dist/index112.js +46 -41
- package/dist/index15.cjs +1 -1
- package/dist/index15.js +1 -1
- package/dist/index20.cjs +1 -1
- package/dist/index20.js +1 -1
- package/dist/index24.cjs +1 -1
- package/dist/index24.js +41 -38
- package/dist/index25.cjs +1 -1
- package/dist/index25.js +37 -34
- package/dist/index26.cjs +1 -1
- package/dist/index26.js +28 -27
- package/dist/index29.cjs +1 -1
- package/dist/index29.js +1 -1
- package/dist/index30.cjs +1 -1
- package/dist/index30.js +28 -27
- package/dist/index32.cjs +1 -1
- package/dist/index32.js +1 -1
- package/dist/index33.cjs +1 -1
- package/dist/index33.js +11 -11
- package/dist/index34.cjs +1 -1
- package/dist/index34.js +2 -2
- package/dist/index37.cjs +1 -1
- package/dist/index37.js +1 -1
- package/dist/index38.cjs +1 -1
- package/dist/index38.js +1 -1
- package/dist/index39.cjs +1 -1
- package/dist/index39.js +1 -1
- package/dist/index40.cjs +1 -1
- package/dist/index40.js +1 -1
- package/dist/index42.cjs +1 -1
- package/dist/index42.js +1 -1
- package/dist/index44.cjs +1 -1
- package/dist/index44.js +36 -33
- package/dist/index45.cjs +1 -1
- package/dist/index45.js +3 -3
- package/dist/index6.cjs +1 -1
- package/dist/index6.js +4 -4
- package/dist/index76.js +1 -1
- package/dist/index77.cjs +1 -1
- package/dist/index77.js +7 -2
- package/dist/index78.cjs +1 -1
- package/dist/index78.js +2 -9
- package/dist/index79.cjs +1 -3
- package/dist/index79.js +8 -13
- package/dist/index80.cjs +3 -1
- package/dist/index80.js +13 -8
- package/dist/index81.cjs +1 -11
- package/dist/index81.js +9 -16
- package/dist/index82.cjs +11 -1
- package/dist/index82.js +16 -41
- package/dist/index83.cjs +1 -1
- package/dist/index83.js +40 -8
- package/dist/index84.cjs +1 -1
- package/dist/index84.js +9 -143
- package/dist/index85.cjs +1 -1
- package/dist/index85.js +117 -18
- package/dist/index86.cjs +1 -1
- package/dist/index86.js +18 -23
- package/dist/index94.cjs +1 -1
- package/dist/index94.js +23 -32
- package/dist/index95.cjs +12 -1
- package/dist/index95.js +16 -29
- package/dist/index96.cjs +1 -19
- package/dist/index96.js +33 -24
- package/dist/index97.cjs +1 -1
- package/dist/index97.js +29 -21
- package/dist/index98.cjs +1 -1
- package/dist/index98.js +20 -14
- package/dist/index99.cjs +1 -80
- package/dist/index99.js +14 -100
- package/dist/mobx/Filters/Filters.d.ts +1 -1
- package/dist/mobx/Notifications/Notifications.d.ts +1 -1
- package/dist/mobx/RangeFilter/RangeFilter.d.ts +3 -3
- package/dist/mobx/Table/Table.d.ts +1 -1
- package/dist/mockServiceWorker.js +104 -63
- package/dist/mocks/internal/mockSWRReturn/index.d.ts +1 -0
- package/dist/mocks/internal/mockSWRReturn/mockSWRReturn.d.ts +1 -0
- package/dist/setupTests.d.ts +8 -0
- package/dist/storybookHelpers/constants.d.ts +1 -1
- package/dist/utils/isValidDateRange/isValidDateRange.d.ts +1 -1
- package/package.json +8 -4
package/dist/index99.js
CHANGED
|
@@ -1,103 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}))
|
|
12
|
-
|
|
13
|
-
position: fixed;
|
|
14
|
-
width: 100vw;
|
|
15
|
-
left: 0;
|
|
16
|
-
bottom: 24px;
|
|
17
|
-
z-index: 1001;
|
|
18
|
-
|
|
19
|
-
&.notification-enter {
|
|
20
|
-
opacity: 0;
|
|
21
|
-
transform: translateY(-16px);
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { StyledSortableViews as i } from "./index107.js";
|
|
3
|
+
const h = (e) => /* @__PURE__ */ o(
|
|
4
|
+
i,
|
|
5
|
+
{
|
|
6
|
+
...e,
|
|
7
|
+
onChange: (t) => {
|
|
8
|
+
t.filter((n) => {
|
|
9
|
+
var r;
|
|
10
|
+
return (r = n.children) == null ? void 0 : r.length;
|
|
11
|
+
}).length || e.onChange(t);
|
|
12
|
+
}
|
|
22
13
|
}
|
|
23
|
-
|
|
24
|
-
&.notification-enter-active {
|
|
25
|
-
opacity: 1;
|
|
26
|
-
transform: translateY(0);
|
|
27
|
-
transition: 350ms ease;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
&.notification-exit {
|
|
31
|
-
opacity: 0;
|
|
32
|
-
transform: translateY(16px);
|
|
33
|
-
transition: 350ms ease;
|
|
34
|
-
}
|
|
35
|
-
pointer-events: none;
|
|
36
|
-
`, w = t(n)`
|
|
37
|
-
display: inline-flex;
|
|
38
|
-
flex-direction: row;
|
|
39
|
-
align-items: center;
|
|
40
|
-
padding: 20px 24px 24px 24px;
|
|
41
|
-
border-radius: 4px;
|
|
42
|
-
margin: 0 auto;
|
|
43
|
-
background-color: #fff;
|
|
44
|
-
box-shadow: ${i.shadows.lg};
|
|
45
|
-
pointer-events: all;
|
|
46
|
-
`, y = t(a)`
|
|
47
|
-
display: inline-flex;
|
|
48
|
-
flex-direction: row;
|
|
49
|
-
align-items: center;
|
|
50
|
-
margin: 0 auto;
|
|
51
|
-
background-color: #fff;
|
|
52
|
-
box-shadow: ${i.shadows.lg};
|
|
53
|
-
pointer-events: all;
|
|
54
|
-
`, $ = t(l)`
|
|
55
|
-
margin-right: 16px;
|
|
56
|
-
`, b = t(e)`
|
|
57
|
-
line-height: 20px;
|
|
58
|
-
`, r = t(e)`
|
|
59
|
-
margin: ${(o) => o.margin ? o.margin : ""};
|
|
60
|
-
color: ${(o) => o.color};
|
|
61
|
-
`, v = t(e)`
|
|
62
|
-
margin-right: 8px;
|
|
63
|
-
color: ${(o) => o.color};
|
|
64
|
-
`, B = t(x)``, k = t(n)`
|
|
65
|
-
display: flex;
|
|
66
|
-
flex-direction: row;
|
|
67
|
-
align-items: flex-end;
|
|
68
|
-
flex-grow: 2;
|
|
69
|
-
margin-left: 24px;
|
|
70
|
-
margin-right: 24px;
|
|
71
|
-
`;
|
|
72
|
-
t.button`
|
|
73
|
-
display: flex;
|
|
74
|
-
flex-direction: row;
|
|
75
|
-
width: 100%;
|
|
76
|
-
padding: 12px 16px;
|
|
77
|
-
cursor: pointer;
|
|
78
|
-
|
|
79
|
-
& > ${r} {
|
|
80
|
-
white-space: nowrap;
|
|
81
|
-
user-select: none;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
&:hover {
|
|
85
|
-
background-color: ${i.colors.neutral.grey.lightest};
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
&:hover > ${r} {
|
|
89
|
-
color: ${i.colors.secondary.blue.base};
|
|
90
|
-
}
|
|
91
|
-
`;
|
|
14
|
+
);
|
|
92
15
|
export {
|
|
93
|
-
|
|
94
|
-
$ as Button,
|
|
95
|
-
w as Container,
|
|
96
|
-
B as Glyph,
|
|
97
|
-
b as Hint,
|
|
98
|
-
u as Notification,
|
|
99
|
-
y as Pill,
|
|
100
|
-
r as Text,
|
|
101
|
-
x as UIGlyph,
|
|
102
|
-
k as Wrap
|
|
16
|
+
h as LegacySortableViews
|
|
103
17
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DateValue } from '
|
|
1
|
+
import { DateValue } from 'react-aria-components';
|
|
2
2
|
import { TransformedView } from 'src/types';
|
|
3
3
|
import { RangeFilter } from '../RangeFilter/RangeFilter';
|
|
4
4
|
import { NumberRangeFilter } from '../NumberRangeFilter/NumberRangeFilter';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DateRanges } from '
|
|
2
|
-
import { DateValue } from '
|
|
1
|
+
import { DateRanges } from '@veeqo/ui';
|
|
2
|
+
import { DateValue } from 'react-aria-components';
|
|
3
3
|
import { FilterType } from '../../constants/dateConstants';
|
|
4
4
|
export declare class RangeFilter {
|
|
5
5
|
filterType: FilterType | undefined;
|
|
@@ -7,7 +7,7 @@ export declare class RangeFilter {
|
|
|
7
7
|
lte: DateValue;
|
|
8
8
|
constructor(filterType?: FilterType);
|
|
9
9
|
setFilterType: (filterType?: DateRanges | "CUSTOM") => void;
|
|
10
|
-
get filterSelection(): import('
|
|
10
|
+
get filterSelection(): import('@veeqo/ui').SelectOption;
|
|
11
11
|
get filterLabel(): string;
|
|
12
12
|
setDates: (start: DateValue, end: DateValue) => void;
|
|
13
13
|
clear: () => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RowGroupingConfiguration, SortState } from '
|
|
1
|
+
import { RowGroupingConfiguration, SortState } from '@veeqo/ui';
|
|
2
2
|
type ExpandedRows = RowGroupingConfiguration['expandedRows'];
|
|
3
3
|
export declare class Table {
|
|
4
4
|
expandedRows: ExpandedRows;
|
|
@@ -5,24 +5,23 @@
|
|
|
5
5
|
* Mock Service Worker.
|
|
6
6
|
* @see https://github.com/mswjs/msw
|
|
7
7
|
* - Please do NOT modify this file.
|
|
8
|
-
* - Please do NOT serve this file on production.
|
|
9
8
|
*/
|
|
10
9
|
|
|
11
|
-
const PACKAGE_VERSION = '2.
|
|
12
|
-
const INTEGRITY_CHECKSUM = '
|
|
10
|
+
const PACKAGE_VERSION = '2.11.2'
|
|
11
|
+
const INTEGRITY_CHECKSUM = '4db4a41e972cec1b64cc569c66952d82'
|
|
13
12
|
const IS_MOCKED_RESPONSE = Symbol('isMockedResponse')
|
|
14
13
|
const activeClientIds = new Set()
|
|
15
14
|
|
|
16
|
-
|
|
15
|
+
addEventListener('install', function () {
|
|
17
16
|
self.skipWaiting()
|
|
18
17
|
})
|
|
19
18
|
|
|
20
|
-
|
|
19
|
+
addEventListener('activate', function (event) {
|
|
21
20
|
event.waitUntil(self.clients.claim())
|
|
22
21
|
})
|
|
23
22
|
|
|
24
|
-
|
|
25
|
-
const clientId = event.source
|
|
23
|
+
addEventListener('message', async function (event) {
|
|
24
|
+
const clientId = Reflect.get(event.source || {}, 'id')
|
|
26
25
|
|
|
27
26
|
if (!clientId || !self.clients) {
|
|
28
27
|
return
|
|
@@ -72,11 +71,6 @@ self.addEventListener('message', async function (event) {
|
|
|
72
71
|
break
|
|
73
72
|
}
|
|
74
73
|
|
|
75
|
-
case 'MOCK_DEACTIVATE': {
|
|
76
|
-
activeClientIds.delete(clientId)
|
|
77
|
-
break
|
|
78
|
-
}
|
|
79
|
-
|
|
80
74
|
case 'CLIENT_CLOSED': {
|
|
81
75
|
activeClientIds.delete(clientId)
|
|
82
76
|
|
|
@@ -94,69 +88,92 @@ self.addEventListener('message', async function (event) {
|
|
|
94
88
|
}
|
|
95
89
|
})
|
|
96
90
|
|
|
97
|
-
|
|
98
|
-
const
|
|
91
|
+
addEventListener('fetch', function (event) {
|
|
92
|
+
const requestInterceptedAt = Date.now()
|
|
99
93
|
|
|
100
94
|
// Bypass navigation requests.
|
|
101
|
-
if (request.mode === 'navigate') {
|
|
95
|
+
if (event.request.mode === 'navigate') {
|
|
102
96
|
return
|
|
103
97
|
}
|
|
104
98
|
|
|
105
99
|
// Opening the DevTools triggers the "only-if-cached" request
|
|
106
100
|
// that cannot be handled by the worker. Bypass such requests.
|
|
107
|
-
if (
|
|
101
|
+
if (
|
|
102
|
+
event.request.cache === 'only-if-cached' &&
|
|
103
|
+
event.request.mode !== 'same-origin'
|
|
104
|
+
) {
|
|
108
105
|
return
|
|
109
106
|
}
|
|
110
107
|
|
|
111
108
|
// Bypass all requests when there are no active clients.
|
|
112
109
|
// Prevents the self-unregistered worked from handling requests
|
|
113
|
-
// after it's been
|
|
110
|
+
// after it's been terminated (still remains active until the next reload).
|
|
114
111
|
if (activeClientIds.size === 0) {
|
|
115
112
|
return
|
|
116
113
|
}
|
|
117
114
|
|
|
118
|
-
// Generate unique request ID.
|
|
119
115
|
const requestId = crypto.randomUUID()
|
|
120
|
-
event.respondWith(handleRequest(event, requestId))
|
|
116
|
+
event.respondWith(handleRequest(event, requestId, requestInterceptedAt))
|
|
121
117
|
})
|
|
122
118
|
|
|
123
|
-
|
|
119
|
+
/**
|
|
120
|
+
* @param {FetchEvent} event
|
|
121
|
+
* @param {string} requestId
|
|
122
|
+
* @param {number} requestInterceptedAt
|
|
123
|
+
*/
|
|
124
|
+
async function handleRequest(event, requestId, requestInterceptedAt) {
|
|
124
125
|
const client = await resolveMainClient(event)
|
|
125
|
-
const
|
|
126
|
+
const requestCloneForEvents = event.request.clone()
|
|
127
|
+
const response = await getResponse(
|
|
128
|
+
event,
|
|
129
|
+
client,
|
|
130
|
+
requestId,
|
|
131
|
+
requestInterceptedAt,
|
|
132
|
+
)
|
|
126
133
|
|
|
127
134
|
// Send back the response clone for the "response:*" life-cycle events.
|
|
128
135
|
// Ensure MSW is active and ready to handle the message, otherwise
|
|
129
136
|
// this message will pend indefinitely.
|
|
130
137
|
if (client && activeClientIds.has(client.id)) {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
138
|
+
const serializedRequest = await serializeRequest(requestCloneForEvents)
|
|
139
|
+
|
|
140
|
+
// Clone the response so both the client and the library could consume it.
|
|
141
|
+
const responseClone = response.clone()
|
|
142
|
+
|
|
143
|
+
sendToClient(
|
|
144
|
+
client,
|
|
145
|
+
{
|
|
146
|
+
type: 'RESPONSE',
|
|
147
|
+
payload: {
|
|
148
|
+
isMockedResponse: IS_MOCKED_RESPONSE in response,
|
|
149
|
+
request: {
|
|
150
|
+
id: requestId,
|
|
151
|
+
...serializedRequest,
|
|
152
|
+
},
|
|
153
|
+
response: {
|
|
141
154
|
type: responseClone.type,
|
|
142
155
|
status: responseClone.status,
|
|
143
156
|
statusText: responseClone.statusText,
|
|
144
|
-
body: responseClone.body,
|
|
145
157
|
headers: Object.fromEntries(responseClone.headers.entries()),
|
|
158
|
+
body: responseClone.body,
|
|
146
159
|
},
|
|
147
160
|
},
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
161
|
+
},
|
|
162
|
+
responseClone.body ? [serializedRequest.body, responseClone.body] : [],
|
|
163
|
+
)
|
|
151
164
|
}
|
|
152
165
|
|
|
153
166
|
return response
|
|
154
167
|
}
|
|
155
168
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
169
|
+
/**
|
|
170
|
+
* Resolve the main client for the given event.
|
|
171
|
+
* Client that issues a request doesn't necessarily equal the client
|
|
172
|
+
* that registered the worker. It's with the latter the worker should
|
|
173
|
+
* communicate with during the response resolving phase.
|
|
174
|
+
* @param {FetchEvent} event
|
|
175
|
+
* @returns {Promise<Client | undefined>}
|
|
176
|
+
*/
|
|
160
177
|
async function resolveMainClient(event) {
|
|
161
178
|
const client = await self.clients.get(event.clientId)
|
|
162
179
|
|
|
@@ -184,12 +201,16 @@ async function resolveMainClient(event) {
|
|
|
184
201
|
})
|
|
185
202
|
}
|
|
186
203
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
204
|
+
/**
|
|
205
|
+
* @param {FetchEvent} event
|
|
206
|
+
* @param {Client | undefined} client
|
|
207
|
+
* @param {string} requestId
|
|
208
|
+
* @returns {Promise<Response>}
|
|
209
|
+
*/
|
|
210
|
+
async function getResponse(event, client, requestId, requestInterceptedAt) {
|
|
190
211
|
// Clone the request because it might've been already used
|
|
191
212
|
// (i.e. its body has been read and sent to the client).
|
|
192
|
-
const requestClone = request.clone()
|
|
213
|
+
const requestClone = event.request.clone()
|
|
193
214
|
|
|
194
215
|
function passthrough() {
|
|
195
216
|
// Cast the request headers to a new Headers instance
|
|
@@ -230,29 +251,18 @@ async function getResponse(event, client, requestId) {
|
|
|
230
251
|
}
|
|
231
252
|
|
|
232
253
|
// Notify the client that a request has been intercepted.
|
|
233
|
-
const
|
|
254
|
+
const serializedRequest = await serializeRequest(event.request)
|
|
234
255
|
const clientMessage = await sendToClient(
|
|
235
256
|
client,
|
|
236
257
|
{
|
|
237
258
|
type: 'REQUEST',
|
|
238
259
|
payload: {
|
|
239
260
|
id: requestId,
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
method: request.method,
|
|
243
|
-
headers: Object.fromEntries(request.headers.entries()),
|
|
244
|
-
cache: request.cache,
|
|
245
|
-
credentials: request.credentials,
|
|
246
|
-
destination: request.destination,
|
|
247
|
-
integrity: request.integrity,
|
|
248
|
-
redirect: request.redirect,
|
|
249
|
-
referrer: request.referrer,
|
|
250
|
-
referrerPolicy: request.referrerPolicy,
|
|
251
|
-
body: requestBuffer,
|
|
252
|
-
keepalive: request.keepalive,
|
|
261
|
+
interceptedAt: requestInterceptedAt,
|
|
262
|
+
...serializedRequest,
|
|
253
263
|
},
|
|
254
264
|
},
|
|
255
|
-
[
|
|
265
|
+
[serializedRequest.body],
|
|
256
266
|
)
|
|
257
267
|
|
|
258
268
|
switch (clientMessage.type) {
|
|
@@ -268,6 +278,12 @@ async function getResponse(event, client, requestId) {
|
|
|
268
278
|
return passthrough()
|
|
269
279
|
}
|
|
270
280
|
|
|
281
|
+
/**
|
|
282
|
+
* @param {Client} client
|
|
283
|
+
* @param {any} message
|
|
284
|
+
* @param {Array<Transferable>} transferrables
|
|
285
|
+
* @returns {Promise<any>}
|
|
286
|
+
*/
|
|
271
287
|
function sendToClient(client, message, transferrables = []) {
|
|
272
288
|
return new Promise((resolve, reject) => {
|
|
273
289
|
const channel = new MessageChannel()
|
|
@@ -280,14 +296,18 @@ function sendToClient(client, message, transferrables = []) {
|
|
|
280
296
|
resolve(event.data)
|
|
281
297
|
}
|
|
282
298
|
|
|
283
|
-
client.postMessage(
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
)
|
|
299
|
+
client.postMessage(message, [
|
|
300
|
+
channel.port2,
|
|
301
|
+
...transferrables.filter(Boolean),
|
|
302
|
+
])
|
|
287
303
|
})
|
|
288
304
|
}
|
|
289
305
|
|
|
290
|
-
|
|
306
|
+
/**
|
|
307
|
+
* @param {Response} response
|
|
308
|
+
* @returns {Response}
|
|
309
|
+
*/
|
|
310
|
+
function respondWithMock(response) {
|
|
291
311
|
// Setting response status code to 0 is a no-op.
|
|
292
312
|
// However, when responding with a "Response.error()", the produced Response
|
|
293
313
|
// instance will have status code set to 0. Since it's not possible to create
|
|
@@ -305,3 +325,24 @@ async function respondWithMock(response) {
|
|
|
305
325
|
|
|
306
326
|
return mockedResponse
|
|
307
327
|
}
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* @param {Request} request
|
|
331
|
+
*/
|
|
332
|
+
async function serializeRequest(request) {
|
|
333
|
+
return {
|
|
334
|
+
url: request.url,
|
|
335
|
+
mode: request.mode,
|
|
336
|
+
method: request.method,
|
|
337
|
+
headers: Object.fromEntries(request.headers.entries()),
|
|
338
|
+
cache: request.cache,
|
|
339
|
+
credentials: request.credentials,
|
|
340
|
+
destination: request.destination,
|
|
341
|
+
integrity: request.integrity,
|
|
342
|
+
redirect: request.redirect,
|
|
343
|
+
referrer: request.referrer,
|
|
344
|
+
referrerPolicy: request.referrerPolicy,
|
|
345
|
+
body: await request.arrayBuffer(),
|
|
346
|
+
keepalive: request.keepalive,
|
|
347
|
+
}
|
|
348
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { mockSWRReturn } from './mockSWRReturn';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const mockSWRReturn: (props?: any) => import('vitest').MockedFunction<import('swr').SWRHook>;
|
package/dist/setupTests.d.ts
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { expect } from 'vitest';
|
|
2
|
+
import * as matchers from '@testing-library/jest-dom/matchers';
|
|
3
|
+
declare module 'vitest' {
|
|
4
|
+
interface Assertion<T = any> extends matchers.TestingLibraryMatchers<typeof expect.stringContaining, T> {
|
|
5
|
+
toBeInTheDocument(): T;
|
|
6
|
+
toBeDisabled(): T;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { SWRConfiguration } from '
|
|
1
|
+
import { SWRConfiguration } from 'swr';
|
|
2
2
|
export declare const DISABLE_FETCH_SWR_OPTIONS: SWRConfiguration;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { DateRanges } from '
|
|
1
|
+
import { DateRanges } from '@veeqo/ui';
|
|
2
2
|
export declare const isValidDateRange: (value: string) => value is DateRanges;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veeqo/transfigure",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -33,11 +33,12 @@
|
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"@dnd-kit/core": "^6.0.7",
|
|
35
35
|
"@dnd-kit/sortable": "^7.0.2",
|
|
36
|
+
"@dnd-kit/utilities": "^3.2.0",
|
|
36
37
|
"@internationalized/date": "3.5.4",
|
|
37
38
|
"@material-ui/core": "^4.11.0",
|
|
38
39
|
"@tanstack/react-table": "^8.21.2",
|
|
39
40
|
"@veeqo/components": "6.1.1",
|
|
40
|
-
"@veeqo/ui": "
|
|
41
|
+
"@veeqo/ui": "13.4.3",
|
|
41
42
|
"ajv-keywords": "^5.1.0",
|
|
42
43
|
"axios": "^1.6.2",
|
|
43
44
|
"framer-motion": "^6.5.1",
|
|
@@ -66,8 +67,9 @@
|
|
|
66
67
|
"@babel/runtime-corejs3": "^7.27.1",
|
|
67
68
|
"@dnd-kit/core": "^6.0.7",
|
|
68
69
|
"@dnd-kit/sortable": "^7.0.2",
|
|
70
|
+
"@dnd-kit/utilities": "^3.2.0",
|
|
69
71
|
"@eslint/js": "^9.21.0",
|
|
70
|
-
"@internationalized/date": "3.
|
|
72
|
+
"@internationalized/date": "3.9.0",
|
|
71
73
|
"@material-ui/core": "^4.11.0",
|
|
72
74
|
"@storybook/addon-essentials": "^8.6.12",
|
|
73
75
|
"@storybook/addon-interactions": "^8.6.12",
|
|
@@ -89,12 +91,13 @@
|
|
|
89
91
|
"@typescript-eslint/eslint-plugin": "^8.37.0",
|
|
90
92
|
"@typescript-eslint/parser": "^8.37.0",
|
|
91
93
|
"@veeqo/components": "6.1.1",
|
|
92
|
-
"@veeqo/ui": "
|
|
94
|
+
"@veeqo/ui": "13.4.3",
|
|
93
95
|
"@vitejs/plugin-react": "^4.3.4",
|
|
94
96
|
"@vitest/browser": "^3.1.2",
|
|
95
97
|
"@vitest/coverage-v8": "^3.1.2",
|
|
96
98
|
"@vitest/ui": "^3.1.2",
|
|
97
99
|
"ajv": "^8.17.1",
|
|
100
|
+
"ajv-keywords": "^5.1.0",
|
|
98
101
|
"axios": "^1.6.2",
|
|
99
102
|
"babel-plugin-styled-components": "^2.1.4",
|
|
100
103
|
"eslint": "^9.21.0",
|
|
@@ -123,6 +126,7 @@
|
|
|
123
126
|
"react-dom": "17.0.2",
|
|
124
127
|
"react-hook-form": "^6.15.1",
|
|
125
128
|
"react-transition-group": "^4.4.1",
|
|
129
|
+
"react-use": "^15.3.8",
|
|
126
130
|
"storybook": "^8.6.12",
|
|
127
131
|
"styled-components": "^5.1.1",
|
|
128
132
|
"swr": "^2.0.4",
|