@blocklet/pages-kit 0.3.28 → 0.3.30

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.
@@ -9,7 +9,7 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import { jsx as _jsx } from "react/jsx-runtime";
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import { Alert, Box, Typography } from '@mui/material';
14
14
  import { ErrorBoundary } from 'react-error-boundary';
15
15
  import { RenderNestedComponent } from '../../utils/property';
@@ -49,8 +49,16 @@ function ComponentRenderer(_a) {
49
49
  const children = (_jsx(Renderer, Object.assign({ renderCount: renderCount + 1 }, props, { Component: component.Component, props: Object.assign(Object.assign({}, component.props), props.props) })));
50
50
  return (ctx === null || ctx === void 0 ? void 0 : ctx.customRendererComponent) ? (_jsx(ctx.customRendererComponent, { Component: component.Component, children: children })) : (children);
51
51
  }
52
- if (blockletId || blockletTitle) {
53
- return (_jsx(Box, { sx: { px: 2, py: 2 }, children: _jsx(Typography, { variant: "body2", sx: { color: '#d32f2f' }, children: `Failed to load component, please select '${componentName !== null && componentName !== void 0 ? componentName : props.componentId}' component in settings, or contact administrator to install '${blockletTitle !== null && blockletTitle !== void 0 ? blockletTitle : blockletTitle}' Blocklet.` }) }));
52
+ if ((dev === null || dev === void 0 ? void 0 : dev.mode) === 'draft') {
53
+ return (_jsxs(Box, { sx: {
54
+ p: 3,
55
+ border: '1px dashed #d32f2f',
56
+ borderRadius: 1,
57
+ bgcolor: 'rgba(211, 47, 47, 0.04)',
58
+ display: 'flex',
59
+ flexDirection: 'column',
60
+ gap: 1,
61
+ }, children: [_jsx(Typography, { variant: "subtitle1", sx: { color: '#d32f2f', fontWeight: 500 }, children: "Component Failed to Load" }), _jsx(Typography, { variant: "body2", sx: { color: 'text.secondary' }, children: "Please try the following:" }), _jsxs(Box, { component: "ul", sx: { m: 0, pl: 2 }, children: [_jsxs(Typography, { component: "li", variant: "body2", sx: { color: 'text.secondary' }, children: ["Select component", ' ', _jsx(Box, { component: "span", sx: { fontWeight: 500 }, children: componentName !== null && componentName !== void 0 ? componentName : props.componentId }), ' ', "in settings or create this component."] }), (blockletId || blockletTitle) && (_jsxs(Typography, { component: "li", variant: "body2", sx: { color: 'text.secondary' }, children: ["Contact administrator to install", ' ', _jsx(Box, { component: "span", sx: { fontWeight: 500 }, children: blockletTitle !== null && blockletTitle !== void 0 ? blockletTitle : blockletId }), ' ', "Blocklet"] }))] })] }));
54
62
  }
55
63
  return null;
56
64
  }