@overmap-ai/blocks 1.0.17-add-error-boundary-component.1 → 1.0.17-add-error-boundary-component.2
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/blocks.js +23 -10
- package/dist/blocks.js.map +1 -1
- package/dist/blocks.umd.cjs +23 -11
- package/dist/blocks.umd.cjs.map +1 -1
- package/package.json +1 -1
package/dist/blocks.js
CHANGED
|
@@ -13,7 +13,8 @@ import { Root as Root$1, Item as Item$1 } from "@radix-ui/react-toggle-group";
|
|
|
13
13
|
import { Root as Root$2 } from "@radix-ui/react-toolbar";
|
|
14
14
|
import * as RadixToast from "@radix-ui/react-toast";
|
|
15
15
|
import { ToastProvider as ToastProvider$1, ToastViewport as ToastViewport$1 } from "@radix-ui/react-toast";
|
|
16
|
-
import { ErrorBoundary } from "react-error-boundary";
|
|
16
|
+
import { useErrorBoundary, ErrorBoundary } from "react-error-boundary";
|
|
17
|
+
import FeatherIcon from "feather-icons-react";
|
|
17
18
|
import { flushSync } from "react-dom";
|
|
18
19
|
import { HeaderCell, Table as Table$1, Header, HeaderRow, Body, Cell, Row } from "@table-library/react-table-library/table.js";
|
|
19
20
|
import { useTheme } from "@table-library/react-table-library/theme.js";
|
|
@@ -2261,22 +2262,34 @@ const _Separator = forwardRef(function Separator2({
|
|
|
2261
2262
|
);
|
|
2262
2263
|
});
|
|
2263
2264
|
const Separator = memo(_Separator);
|
|
2264
|
-
const ErrorFallback = memo((
|
|
2265
|
-
|
|
2266
|
-
const
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
/* @__PURE__ */ jsx(
|
|
2265
|
+
const ErrorFallback = memo(() => {
|
|
2266
|
+
const { resetBoundary } = useErrorBoundary();
|
|
2267
|
+
const height = "20px";
|
|
2268
|
+
const centerStyles = { placeSelf: "center" };
|
|
2269
|
+
return /* @__PURE__ */ jsxs(Flex, { gap: "2", direction: "row", children: [
|
|
2270
|
+
/* @__PURE__ */ jsx("div", { style: { flexGrow: 1 } }),
|
|
2271
|
+
/* @__PURE__ */ jsx(FeatherIcon, { icon: "alert-triangle", size: height, style: centerStyles }),
|
|
2272
|
+
/* @__PURE__ */ jsx(Text$1, { style: { lineHeight: height, ...centerStyles }, children: "Something went wrong" }),
|
|
2273
|
+
/* @__PURE__ */ jsx(
|
|
2274
|
+
IconButton,
|
|
2275
|
+
{
|
|
2276
|
+
"aria-label": "Try again",
|
|
2277
|
+
variant: "soft",
|
|
2278
|
+
onClick: resetBoundary,
|
|
2279
|
+
style: centerStyles,
|
|
2280
|
+
hoverEffects: ["spin180Clockwise"],
|
|
2281
|
+
children: /* @__PURE__ */ jsx(FeatherIcon, { icon: "refresh-ccw", size: height })
|
|
2282
|
+
}
|
|
2283
|
+
),
|
|
2284
|
+
/* @__PURE__ */ jsx("div", { style: { flexGrow: 1 } })
|
|
2270
2285
|
] });
|
|
2271
2286
|
});
|
|
2272
2287
|
ErrorFallback.displayName = "ErrorFallback";
|
|
2273
2288
|
const OvermapErrorBoundary = memo((props) => {
|
|
2274
2289
|
const logError = useCallback((error, info) => {
|
|
2275
2290
|
console.error(error, info);
|
|
2276
|
-
alert("Test");
|
|
2277
2291
|
}, []);
|
|
2278
|
-
|
|
2279
|
-
return /* @__PURE__ */ jsx(Box, { style: { background: "green" }, p: "2", children: /* @__PURE__ */ jsx(ErrorBoundary, { fallbackRender: ErrorFallback, onError: logError, children: props.children }) });
|
|
2292
|
+
return /* @__PURE__ */ jsx(ErrorBoundary, { fallback: /* @__PURE__ */ jsx(ErrorFallback, {}), onError: logError, children: props.children });
|
|
2280
2293
|
});
|
|
2281
2294
|
OvermapErrorBoundary.displayName = "OvermapErrorBoundary";
|
|
2282
2295
|
function _extends() {
|