@blocklet/editor 2.4.62 → 2.4.63

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.
@@ -37,11 +37,12 @@ export default function Card({ title, body, image, icon, href, horizontal = fals
37
37
  }, children: _jsxs(Box, { sx: { display: 'flex', flexDirection: 'column', flex: 1, gap: 1 }, children: [_jsxs(Box, { sx: {
38
38
  display: 'flex',
39
39
  flexDirection: 'column',
40
- gap: 1,
40
+ gap: horizontal ? 1 : 2,
41
41
  ...(horizontal && { flexDirection: 'row', alignItems: 'center' }),
42
42
  }, children: [renderIcon(), _jsx(Typography, { variant: "h5", component: "h4", sx: {
43
43
  fontWeight: 600,
44
44
  color: 'text.primary',
45
+ lineHeight: 1,
45
46
  }, children: title })] }), body && (_jsx(Typography, { variant: "body2", sx: {
46
47
  color: 'text.secondary',
47
48
  }, children: body })), isLink && cta && (_jsx(Box, { sx: { display: 'flex', alignItems: 'center', marginTop: 'auto' }, children: _jsxs(Typography, { variant: "body2", sx: {
@@ -330,7 +330,7 @@ const ImageContainer = ({ success, loading, error, confirmText, uploadImage, pla
330
330
  p: 1,
331
331
  border: 1,
332
332
  borderColor: 'divider',
333
- borderRadius: 1,
333
+ borderRadius: 2,
334
334
  }),
335
335
  }, children: [props.children ||
336
336
  (!!placeholder && _jsx("img", { alt: "", ...placeholderProps, onLoad: () => setShowMask(true), src: placeholder })), !showMask || success ? null : loading ? (_jsx(Mask, { children: _jsx(LinearProgress, {}) })) : error ? (_jsx(Mask, { children: _jsx(Alert, { severity: "error", action: _jsx(Button, { size: "small", onClick: uploadImage, children: "Retry" }), children: error }) })) : confirmText ? (_jsx(Mask, { children: _jsx(Alert, { severity: "warning", action: _jsx(Button, { size: "small", onClick: uploadImage, children: "Upload" }), children: confirmText }) })) : null] }));
@@ -1,5 +1,11 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Box, alpha, styled, GlobalStyles, useTheme } from '@mui/material';
3
+ const getShapeRadiusValue = (theme) => {
4
+ if (typeof theme.shape.borderRadius === 'number') {
5
+ return theme.shape.borderRadius;
6
+ }
7
+ return parseInt(theme.shape.borderRadius, 10);
8
+ };
3
9
  const StyledEditorWrapper = styled(Box) `
4
10
  position: relative;
5
11
  color: ${({ theme }) => alpha(theme.palette.text.primary, 0.8)};
@@ -41,7 +47,7 @@ const StyledEditorWrapper = styled(Box) `
41
47
  // 增大最外层 list item 的 marginLeft, https://github.com/blocklet/discuss-kit/issues/2123
42
48
  > ol > li,
43
49
  > ul > li {
44
- margin-left: 32px;
50
+ margin-left: 24px;
45
51
  }
46
52
 
47
53
  // collapsible dark-mode
@@ -123,23 +129,29 @@ const StyledEditorWrapper = styled(Box) `
123
129
  background-color: ${({ theme }) => theme.palette.grey[50]} !important;
124
130
  }
125
131
 
126
- @container blocklet-editor (max-width: 700px) {
132
+ @container blocklet-editor (max-width: 1000px) {
127
133
  .be-editable img,
128
134
  .be-editable *:has(img) {
129
135
  width: 100% !important;
130
136
  }
131
137
  }
132
138
 
139
+ /* img/video 圆角样式 */
133
140
  .be-editable div:has(> video) {
134
141
  padding: 8px;
135
142
  border: 1px solid ${({ theme }) => theme.palette.divider};
136
- border-radius: ${({ theme }) => theme.shape.borderRadius}px;
143
+ border-radius: ${({ theme }) => getShapeRadiusValue(theme) * 2}px;
137
144
  overflow: hidden;
138
145
  line-height: 1;
139
146
  }
140
147
 
141
- .be-editable video {
142
- border-radius: 4px;
148
+ .be-editable video,
149
+ .be-editable img {
150
+ border-radius: 8px;
151
+ }
152
+
153
+ .be-editable p > table {
154
+ margin: 0;
143
155
  }
144
156
  `;
145
157
  export function StyledEditorContent({ ref = undefined, children, ...rest }) {
@@ -147,7 +147,9 @@ const createCustomTheme = (theme) => {
147
147
  margin-top: 0.5em;
148
148
  margin-bottom: 0.5em;
149
149
  padding-left: 0.25em;
150
- `, theme.typography.body1, { lineHeight: 1.5 });
150
+ `, theme.typography.body1
151
+ // { lineHeight: 1.5 }
152
+ );
151
153
  const listItemChecked = css `
152
154
  margin-left: 0 !important;
153
155
  margin-right: 8px;
@@ -201,12 +203,6 @@ const createCustomTheme = (theme) => {
201
203
  outline: 2px solid ${palette.primary.light};
202
204
  `;
203
205
  const image = css `
204
- img {
205
- .be-content:not(.editable) & {
206
- border-radius: 0.375rem;
207
- }
208
- }
209
-
210
206
  .image-caption-container {
211
207
  // fix #924
212
208
  .ImageNode__contentEditable {
@@ -241,8 +237,8 @@ const createCustomTheme = (theme) => {
241
237
  line-height: 1.53;
242
238
  font-size: 13px;
243
239
  margin: 0;
244
- margin-top: 8px;
245
- margin-bottom: 8px;
240
+ margin-top: 20px;
241
+ margin-bottom: 32px;
246
242
  tab-size: 2;
247
243
  /* white-space: pre; */
248
244
  overflow-x: auto;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/editor",
3
- "version": "2.4.62",
3
+ "version": "2.4.63",
4
4
  "main": "lib/index.js",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -70,7 +70,7 @@
70
70
  "ufo": "^1.5.4",
71
71
  "url-join": "^4.0.1",
72
72
  "zustand": "^4.5.5",
73
- "@blocklet/pdf": "2.4.62"
73
+ "@blocklet/pdf": "2.4.63"
74
74
  },
75
75
  "devDependencies": {
76
76
  "@babel/core": "^7.25.2",