@overmap-ai/blocks 1.0.17-add-error-boundary-component.0 → 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/OvermapErrorBoundary/index.d.ts +1 -0
- package/dist/blocks.js +33 -0
- package/dist/blocks.js.map +1 -1
- package/dist/blocks.umd.cjs +33 -2
- package/dist/blocks.umd.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/blocks.umd.cjs
CHANGED
|
@@ -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-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-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.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, 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,6 +2261,36 @@
|
|
|
2261
2261
|
);
|
|
2262
2262
|
});
|
|
2263
2263
|
const Separator = React.memo(_Separator);
|
|
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 } })
|
|
2284
|
+
] });
|
|
2285
|
+
});
|
|
2286
|
+
ErrorFallback.displayName = "ErrorFallback";
|
|
2287
|
+
const OvermapErrorBoundary = React.memo((props) => {
|
|
2288
|
+
const logError = React.useCallback((error, info) => {
|
|
2289
|
+
console.error(error, info);
|
|
2290
|
+
}, []);
|
|
2291
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactErrorBoundary.ErrorBoundary, { fallback: /* @__PURE__ */ jsxRuntime.jsx(ErrorFallback, {}), onError: logError, children: props.children });
|
|
2292
|
+
});
|
|
2293
|
+
OvermapErrorBoundary.displayName = "OvermapErrorBoundary";
|
|
2264
2294
|
function _extends() {
|
|
2265
2295
|
_extends = Object.assign ? Object.assign.bind() : function(target) {
|
|
2266
2296
|
for (var i = 1; i < arguments.length; i++) {
|
|
@@ -3684,6 +3714,7 @@
|
|
|
3684
3714
|
exports2.LeftAndRightPanels = LeftAndRightPanels;
|
|
3685
3715
|
exports2.MultiPagePopover = MultiPagePopover;
|
|
3686
3716
|
exports2.MultiSelect = MultiSelect;
|
|
3717
|
+
exports2.OvermapErrorBoundary = OvermapErrorBoundary;
|
|
3687
3718
|
exports2.Popover = Popover;
|
|
3688
3719
|
exports2.Root = Root;
|
|
3689
3720
|
exports2.Select = Select;
|