@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.
@@ -1,6 +1,6 @@
1
1
  (function(global, factory) {
2
- typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react/jsx-runtime"), require("@radix-ui/themes"), require("react"), require("react-responsive"), require("@radix-ui/react-icons"), require("@radix-ui/react-dropdown-menu"), require("@radix-ui/react-dialog"), require("re-resizable"), require("@radix-ui/react-dismissable-layer"), require("react-transition-group"), require("@radix-ui/react-toggle-group"), require("@radix-ui/react-toolbar"), require("@radix-ui/react-toast"), require("react-error-boundary"), require("react-dom"), require("@table-library/react-table-library/table.js"), require("@table-library/react-table-library/theme.js"), require("@table-library/react-table-library/sort.js"), require("@table-library/react-table-library/select.js"), require("@table-library/react-table-library/pagination.js"), require("react-device-detect")) : typeof define === "function" && define.amd ? define(["exports", "react/jsx-runtime", "@radix-ui/themes", "react", "react-responsive", "@radix-ui/react-icons", "@radix-ui/react-dropdown-menu", "@radix-ui/react-dialog", "re-resizable", "@radix-ui/react-dismissable-layer", "react-transition-group", "@radix-ui/react-toggle-group", "@radix-ui/react-toolbar", "@radix-ui/react-toast", "react-error-boundary", "react-dom", "@table-library/react-table-library/table.js", "@table-library/react-table-library/theme.js", "@table-library/react-table-library/sort.js", "@table-library/react-table-library/select.js", "@table-library/react-table-library/pagination.js", "react-device-detect"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.blocks = {}, global.jsxRuntime, global.themes, global.React, global.reactResponsive, global.reactIcons, global.RadixDropdownMenu, global.RadixDialogPrimitive, global.reResizable, global.reactDismissableLayer, global.reactTransitionGroup, global.reactToggleGroup, global.reactToolbar, global.RadixToast, global.reactErrorBoundary, global.reactDom, global.table_js, global.theme_js, global.sort_js, global.select_js, global.pagination_js, global.reactDeviceDetect));
3
- })(this, function(exports2, jsxRuntime, themes, React, reactResponsive, reactIcons, RadixDropdownMenu, RadixDialogPrimitive, reResizable, reactDismissableLayer, reactTransitionGroup, reactToggleGroup, reactToolbar, RadixToast, reactErrorBoundary, reactDom, table_js, theme_js, sort_js, select_js, pagination_js, reactDeviceDetect) {
2
+ typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react/jsx-runtime"), require("@radix-ui/themes"), require("react"), require("react-responsive"), require("@radix-ui/react-icons"), require("@radix-ui/react-dropdown-menu"), require("@radix-ui/react-dialog"), require("re-resizable"), require("@radix-ui/react-dismissable-layer"), require("react-transition-group"), require("@radix-ui/react-toggle-group"), require("@radix-ui/react-toolbar"), require("@radix-ui/react-toast"), require("react-error-boundary"), require("feather-icons-react"), require("react-dom"), require("@table-library/react-table-library/table.js"), require("@table-library/react-table-library/theme.js"), require("@table-library/react-table-library/sort.js"), require("@table-library/react-table-library/select.js"), require("@table-library/react-table-library/pagination.js"), require("react-device-detect")) : typeof define === "function" && define.amd ? define(["exports", "react/jsx-runtime", "@radix-ui/themes", "react", "react-responsive", "@radix-ui/react-icons", "@radix-ui/react-dropdown-menu", "@radix-ui/react-dialog", "re-resizable", "@radix-ui/react-dismissable-layer", "react-transition-group", "@radix-ui/react-toggle-group", "@radix-ui/react-toolbar", "@radix-ui/react-toast", "react-error-boundary", "feather-icons-react", "react-dom", "@table-library/react-table-library/table.js", "@table-library/react-table-library/theme.js", "@table-library/react-table-library/sort.js", "@table-library/react-table-library/select.js", "@table-library/react-table-library/pagination.js", "react-device-detect"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.blocks = {}, global.jsxRuntime, global.themes, global.React, global.reactResponsive, global.reactIcons, global.RadixDropdownMenu, global.RadixDialogPrimitive, global.reResizable, global.reactDismissableLayer, global.reactTransitionGroup, global.reactToggleGroup, global.reactToolbar, global.RadixToast, global.reactErrorBoundary, global.FeatherIcon, global.reactDom, global.table_js, global.theme_js, global.sort_js, global.select_js, global.pagination_js, global.reactDeviceDetect));
3
+ })(this, function(exports2, jsxRuntime, themes, React, reactResponsive, reactIcons, RadixDropdownMenu, RadixDialogPrimitive, reResizable, reactDismissableLayer, reactTransitionGroup, reactToggleGroup, reactToolbar, RadixToast, reactErrorBoundary, FeatherIcon, reactDom, table_js, theme_js, sort_js, select_js, pagination_js, reactDeviceDetect) {
4
4
  "use strict";
5
5
  function _interopNamespaceDefault(e) {
6
6
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
@@ -2261,22 +2261,34 @@
2261
2261
  );
2262
2262
  });
2263
2263
  const Separator = React.memo(_Separator);
2264
- const ErrorFallback = React.memo((props) => {
2265
- alert("FIND ME");
2266
- const { resetErrorBoundary } = props;
2267
- return /* @__PURE__ */ jsxRuntime.jsxs(themes.Box, { style: { background: "red" }, p: "2", children: [
2268
- /* @__PURE__ */ jsxRuntime.jsx(Text$1, { children: "Something went wrong" }),
2269
- /* @__PURE__ */ jsxRuntime.jsx(Button2, { onClick: resetErrorBoundary, children: "Try again" })
2264
+ const ErrorFallback = React.memo(() => {
2265
+ const { resetBoundary } = reactErrorBoundary.useErrorBoundary();
2266
+ const height = "20px";
2267
+ const centerStyles = { placeSelf: "center" };
2268
+ return /* @__PURE__ */ jsxRuntime.jsxs(Flex, { gap: "2", direction: "row", children: [
2269
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { flexGrow: 1 } }),
2270
+ /* @__PURE__ */ jsxRuntime.jsx(FeatherIcon, { icon: "alert-triangle", size: height, style: centerStyles }),
2271
+ /* @__PURE__ */ jsxRuntime.jsx(Text$1, { style: { lineHeight: height, ...centerStyles }, children: "Something went wrong" }),
2272
+ /* @__PURE__ */ jsxRuntime.jsx(
2273
+ IconButton,
2274
+ {
2275
+ "aria-label": "Try again",
2276
+ variant: "soft",
2277
+ onClick: resetBoundary,
2278
+ style: centerStyles,
2279
+ hoverEffects: ["spin180Clockwise"],
2280
+ children: /* @__PURE__ */ jsxRuntime.jsx(FeatherIcon, { icon: "refresh-ccw", size: height })
2281
+ }
2282
+ ),
2283
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { flexGrow: 1 } })
2270
2284
  ] });
2271
2285
  });
2272
2286
  ErrorFallback.displayName = "ErrorFallback";
2273
2287
  const OvermapErrorBoundary = React.memo((props) => {
2274
2288
  const logError = React.useCallback((error, info) => {
2275
2289
  console.error(error, info);
2276
- alert("Test");
2277
2290
  }, []);
2278
- alert(props.children);
2279
- return /* @__PURE__ */ jsxRuntime.jsx(themes.Box, { style: { background: "green" }, p: "2", children: /* @__PURE__ */ jsxRuntime.jsx(reactErrorBoundary.ErrorBoundary, { fallbackRender: ErrorFallback, onError: logError, children: props.children }) });
2291
+ return /* @__PURE__ */ jsxRuntime.jsx(reactErrorBoundary.ErrorBoundary, { fallback: /* @__PURE__ */ jsxRuntime.jsx(ErrorFallback, {}), onError: logError, children: props.children });
2280
2292
  });
2281
2293
  OvermapErrorBoundary.displayName = "OvermapErrorBoundary";
2282
2294
  function _extends() {