@overmap-ai/blocks 1.0.19 → 1.0.20

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.
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ interface ErrorBoundaryProps extends React.PropsWithChildren {
3
+ absoluteCentering?: boolean;
4
+ }
5
+ export declare const OvermapErrorBoundary: React.MemoExoticComponent<(props: ErrorBoundaryProps) => import("react/jsx-runtime").JSX.Element>;
6
+ export {};
@@ -0,0 +1 @@
1
+ export * from "./OvermapErrorBoundary";
package/dist/blocks.js CHANGED
@@ -14,6 +14,8 @@ import { Root as Root$1, Item as Item$1 } from "@radix-ui/react-toggle-group";
14
14
  import { Root as Root$2 } from "@radix-ui/react-toolbar";
15
15
  import * as RadixToast from "@radix-ui/react-toast";
16
16
  import { ToastProvider as ToastProvider$1, ToastViewport as ToastViewport$1 } from "@radix-ui/react-toast";
17
+ import { useErrorBoundary, ErrorBoundary } from "react-error-boundary";
18
+ import FeatherIcon from "feather-icons-react";
17
19
  import { flushSync } from "react-dom";
18
20
  import { HeaderCell, Table as Table$1, Header, HeaderRow, Body, Cell, Row } from "@table-library/react-table-library/table.js";
19
21
  import { useTheme } from "@table-library/react-table-library/theme.js";
@@ -2260,6 +2262,39 @@ const _Separator = forwardRef(function Separator2({
2260
2262
  );
2261
2263
  });
2262
2264
  const Separator = memo(_Separator);
2265
+ const centerStyles = { placeSelf: "center" };
2266
+ const ErrorFallback = memo((props) => {
2267
+ const { absoluteCentering } = props;
2268
+ const { resetBoundary } = useErrorBoundary();
2269
+ const height = "20px";
2270
+ const outerFlexStyles = absoluteCentering ? { position: "absolute", top: "50%", transform: "translateY(-50%)" } : void 0;
2271
+ return /* @__PURE__ */ jsxs(Flex, { gap: "2", direction: "row", width: "100%", style: outerFlexStyles, children: [
2272
+ /* @__PURE__ */ jsx("div", { style: { flexGrow: 1 } }),
2273
+ /* @__PURE__ */ jsx(FeatherIcon, { icon: "alert-triangle", size: height, style: centerStyles }),
2274
+ /* @__PURE__ */ jsx(Text$1, { style: { lineHeight: height, ...centerStyles }, children: "Something went wrong" }),
2275
+ /* @__PURE__ */ jsx(
2276
+ IconButton,
2277
+ {
2278
+ "aria-label": "Try again",
2279
+ variant: "soft",
2280
+ onClick: resetBoundary,
2281
+ style: centerStyles,
2282
+ hoverEffects: ["spin180Clockwise"],
2283
+ children: /* @__PURE__ */ jsx(FeatherIcon, { icon: "refresh-ccw", size: height })
2284
+ }
2285
+ ),
2286
+ /* @__PURE__ */ jsx("div", { style: { flexGrow: 1 } })
2287
+ ] });
2288
+ });
2289
+ ErrorFallback.displayName = "ErrorFallback";
2290
+ const OvermapErrorBoundary = memo((props) => {
2291
+ const { absoluteCentering } = props;
2292
+ const logError = useCallback((error, info) => {
2293
+ console.error(error, info);
2294
+ }, []);
2295
+ return /* @__PURE__ */ jsx(ErrorBoundary, { fallback: /* @__PURE__ */ jsx(ErrorFallback, { absoluteCentering }), onError: logError, children: props.children });
2296
+ });
2297
+ OvermapErrorBoundary.displayName = "OvermapErrorBoundary";
2263
2298
  function _extends() {
2264
2299
  _extends = Object.assign ? Object.assign.bind() : function(target) {
2265
2300
  for (var i = 1; i < arguments.length; i++) {
@@ -3681,6 +3716,7 @@ export {
3681
3716
  LeftAndRightPanels,
3682
3717
  MultiPagePopover,
3683
3718
  MultiSelect,
3719
+ OvermapErrorBoundary,
3684
3720
  Popover,
3685
3721
  Root2 as Root,
3686
3722
  Select,