@colisweb/rescript-toolkit 2.41.2 → 2.43.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@colisweb/rescript-toolkit",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.43.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"clean": "rescript clean",
|
|
6
6
|
"build": "rescript build -with-deps",
|
|
@@ -23,21 +23,21 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@colisweb/react-day-picker": "7.4.16",
|
|
25
25
|
"@colisweb/restorative": "0.5.1",
|
|
26
|
-
"@reach/accordion": "0.
|
|
27
|
-
"@reach/alert-dialog": "0.
|
|
28
|
-
"@reach/auto-id": "0.
|
|
29
|
-
"@reach/combobox": "0.
|
|
30
|
-
"@reach/dialog": "0.
|
|
31
|
-
"@reach/disclosure": "0.
|
|
32
|
-
"@reach/listbox": "0.
|
|
33
|
-
"@reach/menu-button": "0.
|
|
34
|
-
"@reach/popover": "0.
|
|
35
|
-
"@reach/portal": "0.
|
|
36
|
-
"@reach/tabs": "0.
|
|
37
|
-
"@reach/tooltip": "0.
|
|
38
|
-
"@reach/visually-hidden": "0.
|
|
26
|
+
"@reach/accordion": "0.17.0",
|
|
27
|
+
"@reach/alert-dialog": "0.17.0",
|
|
28
|
+
"@reach/auto-id": "0.17.0",
|
|
29
|
+
"@reach/combobox": "0.17.0",
|
|
30
|
+
"@reach/dialog": "0.17.0",
|
|
31
|
+
"@reach/disclosure": "0.17.0",
|
|
32
|
+
"@reach/listbox": "0.17.0",
|
|
33
|
+
"@reach/menu-button": "0.17.0",
|
|
34
|
+
"@reach/popover": "0.17.0",
|
|
35
|
+
"@reach/portal": "0.17.0",
|
|
36
|
+
"@reach/tabs": "0.17.0",
|
|
37
|
+
"@reach/tooltip": "0.17.0",
|
|
38
|
+
"@reach/visually-hidden": "0.17.0",
|
|
39
39
|
"@rescript/react": "0.10.3",
|
|
40
|
-
"autoprefixer": "10.4.
|
|
40
|
+
"autoprefixer": "10.4.7",
|
|
41
41
|
"axios": "0.24.0",
|
|
42
42
|
"bs-axios": "0.0.43",
|
|
43
43
|
"bs-css": "13.4.0",
|
|
@@ -50,31 +50,35 @@
|
|
|
50
50
|
"dedent": "0.7.0",
|
|
51
51
|
"downshift": "5.2.5",
|
|
52
52
|
"lenses-ppx": "6.1.10",
|
|
53
|
-
"list-selectors": "2.0.
|
|
54
|
-
"postcss": "8.4.
|
|
53
|
+
"list-selectors": "2.0.1",
|
|
54
|
+
"postcss": "8.4.14",
|
|
55
55
|
"postcss-loader": "4.2.0",
|
|
56
56
|
"postcss-preset-env": "6.7.0",
|
|
57
|
-
"prismjs": "1.
|
|
57
|
+
"prismjs": "1.28.0",
|
|
58
58
|
"react-datepicker": "3.8.0",
|
|
59
|
-
"react-icons": "4.
|
|
60
|
-
"react-select": "5.
|
|
61
|
-
"react-table": "7.
|
|
62
|
-
"react-use": "17.
|
|
59
|
+
"react-icons": "4.4.0",
|
|
60
|
+
"react-select": "5.4.0",
|
|
61
|
+
"react-table": "7.8.0",
|
|
62
|
+
"react-use": "17.4.0",
|
|
63
63
|
"reason-promise": "1.1.5",
|
|
64
64
|
"res-react-intl": "3.1.2",
|
|
65
65
|
"reschema": "1.3.1",
|
|
66
66
|
"rescript": "9.1.4",
|
|
67
67
|
"rescript-classnames": "6.0.0",
|
|
68
68
|
"rescript-react-update": "5.0.0",
|
|
69
|
-
"sanitize-html": "2.
|
|
70
|
-
"swr": "1.
|
|
69
|
+
"sanitize-html": "2.7.0",
|
|
70
|
+
"swr": "1.3.0",
|
|
71
71
|
"tailwindcss": "3.1.4",
|
|
72
72
|
"react-error-boundary": "3.1.4",
|
|
73
|
-
"@datadog/browser-rum": "4.
|
|
74
|
-
"react-intl": "
|
|
73
|
+
"@datadog/browser-rum": "4.14.0",
|
|
74
|
+
"react-intl": "6.0.5",
|
|
75
|
+
"lodash": "4.17.21",
|
|
76
|
+
"react-helmet": "6.1.0",
|
|
77
|
+
"react": "18.2.0",
|
|
78
|
+
"react-dom": "18.2.0"
|
|
75
79
|
},
|
|
76
80
|
"devDependencies": {
|
|
77
|
-
"@babel/core": "7.
|
|
81
|
+
"@babel/core": "7.18.6",
|
|
78
82
|
"@sentry/browser": "6.17.6",
|
|
79
83
|
"@storybook/addon-actions": "6.1.21",
|
|
80
84
|
"@storybook/addon-essentials": "6.1.21",
|
|
@@ -83,11 +87,9 @@
|
|
|
83
87
|
"@storybook/addons": "6.1.21",
|
|
84
88
|
"@storybook/react": "6.1.21",
|
|
85
89
|
"@storybook/theming": "6.1.21",
|
|
86
|
-
"babel-loader": "8.2.
|
|
90
|
+
"babel-loader": "8.2.5",
|
|
87
91
|
"highlight.js": "11.3.1",
|
|
88
92
|
"raw-loader": "4.0.2",
|
|
89
|
-
"react": "17.0.2",
|
|
90
|
-
"react-dom": "17.0.2",
|
|
91
93
|
"react-is": "17.0.2",
|
|
92
94
|
"sass": "1.45.0"
|
|
93
95
|
}
|
package/src/ui/Toolkit__Ui.res
CHANGED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
@react.component
|
|
2
|
+
let make = (
|
|
3
|
+
~fallbackRender: ReactErrorBoundary.fallbackProps => React.element,
|
|
4
|
+
~children: React.element,
|
|
5
|
+
~resetKeys: option<array<'a>>=?,
|
|
6
|
+
~customShouldRaiseAnError=false,
|
|
7
|
+
) => {
|
|
8
|
+
<ReactErrorBoundary
|
|
9
|
+
fallbackRender
|
|
10
|
+
?resetKeys
|
|
11
|
+
onError={err => {
|
|
12
|
+
switch Obj.magic(err) {
|
|
13
|
+
| #decodeError(requestConfig, deccoError) =>
|
|
14
|
+
Toolkit__BrowserLogger.error2(
|
|
15
|
+
`Decode error${requestConfig["url"]->Option.mapWithDefault("", url => " " ++ url)}`,
|
|
16
|
+
{
|
|
17
|
+
"deccoError": deccoError,
|
|
18
|
+
"requestConfig": requestConfig,
|
|
19
|
+
},
|
|
20
|
+
)
|
|
21
|
+
| #default(axiosError) =>
|
|
22
|
+
Js.Exn.message(axiosError)->Option.forEach(message => {
|
|
23
|
+
let message = message->Js.String2.toLowerCase
|
|
24
|
+
let ignoredTerms = ["timeout", "network"]
|
|
25
|
+
|
|
26
|
+
if ignoredTerms->Array.some(Js.String2.includes(message)) {
|
|
27
|
+
()
|
|
28
|
+
} else {
|
|
29
|
+
Toolkit__BrowserLogger.error2(axiosError, axiosError)
|
|
30
|
+
}
|
|
31
|
+
})
|
|
32
|
+
| #custom(err) =>
|
|
33
|
+
if customShouldRaiseAnError {
|
|
34
|
+
Toolkit__BrowserLogger.error2("Custom error", err)
|
|
35
|
+
}
|
|
36
|
+
| err =>
|
|
37
|
+
switch Js.Exn.message(Obj.magic(err)) {
|
|
38
|
+
| None => Toolkit__BrowserLogger.error2("Unhandled error", err)
|
|
39
|
+
| Some(message) => Toolkit__BrowserLogger.error2(Obj.magic(message), err)
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}}>
|
|
43
|
+
{children}
|
|
44
|
+
</ReactErrorBoundary>
|
|
45
|
+
}
|