@overmap-ai/blocks 1.0.17-add-error-boundary-component.2 → 1.0.17-add-error-boundary-component.4
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/OvermapErrorBoundary.d.ts +3 -1
- package/dist/blocks.js +7 -4
- package/dist/blocks.js.map +1 -1
- package/dist/blocks.umd.cjs +7 -4
- package/dist/blocks.umd.cjs.map +1 -1
- package/package.json +1 -1
- package/dist/OvermapErrorBoundary/OvermapErrorBoundary.stories.d.ts +0 -16
package/dist/blocks.umd.cjs
CHANGED
|
@@ -2261,11 +2261,13 @@
|
|
|
2261
2261
|
);
|
|
2262
2262
|
});
|
|
2263
2263
|
const Separator = React.memo(_Separator);
|
|
2264
|
-
const
|
|
2264
|
+
const centerStyles = { placeSelf: "center" };
|
|
2265
|
+
const ErrorFallback = React.memo((props) => {
|
|
2266
|
+
const { absoluteCentering } = props;
|
|
2265
2267
|
const { resetBoundary } = reactErrorBoundary.useErrorBoundary();
|
|
2266
2268
|
const height = "20px";
|
|
2267
|
-
const
|
|
2268
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(Flex, { gap: "2", direction: "row", children: [
|
|
2269
|
+
const outerFlexStyles = absoluteCentering ? { position: "absolute", top: "50%", transform: "translateY(-50%)" } : void 0;
|
|
2270
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Flex, { gap: "2", direction: "row", width: "100%", style: outerFlexStyles, children: [
|
|
2269
2271
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { flexGrow: 1 } }),
|
|
2270
2272
|
/* @__PURE__ */ jsxRuntime.jsx(FeatherIcon, { icon: "alert-triangle", size: height, style: centerStyles }),
|
|
2271
2273
|
/* @__PURE__ */ jsxRuntime.jsx(Text$1, { style: { lineHeight: height, ...centerStyles }, children: "Something went wrong" }),
|
|
@@ -2285,10 +2287,11 @@
|
|
|
2285
2287
|
});
|
|
2286
2288
|
ErrorFallback.displayName = "ErrorFallback";
|
|
2287
2289
|
const OvermapErrorBoundary = React.memo((props) => {
|
|
2290
|
+
const { absoluteCentering } = props;
|
|
2288
2291
|
const logError = React.useCallback((error, info) => {
|
|
2289
2292
|
console.error(error, info);
|
|
2290
2293
|
}, []);
|
|
2291
|
-
return /* @__PURE__ */ jsxRuntime.jsx(reactErrorBoundary.ErrorBoundary, { fallback: /* @__PURE__ */ jsxRuntime.jsx(ErrorFallback, {}), onError: logError, children: props.children });
|
|
2294
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactErrorBoundary.ErrorBoundary, { fallback: /* @__PURE__ */ jsxRuntime.jsx(ErrorFallback, { absoluteCentering }), onError: logError, children: props.children });
|
|
2292
2295
|
});
|
|
2293
2296
|
OvermapErrorBoundary.displayName = "OvermapErrorBoundary";
|
|
2294
2297
|
function _extends() {
|