@ctzhian/tiptap 1.11.4 → 1.12.0

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.
Files changed (53) hide show
  1. package/dist/Editor/demo.js +16 -21
  2. package/dist/EditorMarkdown/index.js +1 -1
  3. package/dist/asset/css/index.css +19 -8
  4. package/dist/component/ActionDropdown/index.d.ts +25 -0
  5. package/dist/component/ActionDropdown/index.js +147 -0
  6. package/dist/component/CustomDragHandle/index.js +2 -2
  7. package/dist/component/FloatingPopover/index.d.ts +2 -0
  8. package/dist/component/FloatingPopover/index.js +7 -1
  9. package/dist/component/HoverPopover/index.d.ts +29 -0
  10. package/dist/component/HoverPopover/index.js +143 -0
  11. package/dist/component/Icons/chrome-icon.d.ts +6 -0
  12. package/dist/component/Icons/chrome-icon.js +31 -0
  13. package/dist/component/Icons/edit-line-icon.d.ts +6 -0
  14. package/dist/component/Icons/edit-line-icon.js +13 -0
  15. package/dist/component/Icons/file-icon.d.ts +6 -0
  16. package/dist/component/Icons/file-icon.js +20 -0
  17. package/dist/component/Icons/index.d.ts +3 -0
  18. package/dist/component/Icons/index.js +3 -0
  19. package/dist/component/index.d.ts +2 -0
  20. package/dist/component/index.js +2 -0
  21. package/dist/extension/component/Alert/index.js +73 -85
  22. package/dist/extension/component/Attachment/AttachmentContent.d.ts +14 -0
  23. package/dist/extension/component/Attachment/AttachmentContent.js +142 -0
  24. package/dist/extension/component/Attachment/index.js +144 -201
  25. package/dist/extension/component/CodeBlock/Readonly.js +43 -35
  26. package/dist/extension/component/CodeBlock/index.js +139 -90
  27. package/dist/extension/component/Image/Insert.js +41 -26
  28. package/dist/extension/component/Image/Readonly.js +13 -6
  29. package/dist/extension/component/Image/index.d.ts +1 -0
  30. package/dist/extension/component/Image/index.js +234 -92
  31. package/dist/extension/component/Link/Insert.js +1 -1
  32. package/dist/extension/component/Link/LinkContent.d.ts +13 -0
  33. package/dist/extension/component/Link/LinkContent.js +169 -0
  34. package/dist/extension/component/Link/index.js +182 -264
  35. package/dist/extension/component/MentionList/index.js +1 -1
  36. package/dist/extension/component/UploadProgress/index.d.ts +1 -1
  37. package/dist/extension/index.js +1 -1
  38. package/dist/index.css +64 -63
  39. package/dist/themes/dark.js +2 -2
  40. package/dist/themes/light.d.ts +1 -1
  41. package/dist/themes/light.js +2 -2
  42. package/dist/themes/palette.d.ts +1 -1
  43. package/package.json +1 -1
  44. package/dist/extension/component/Attachment/Readonly.d.ts +0 -9
  45. package/dist/extension/component/Attachment/Readonly.js +0 -91
  46. package/dist/extension/component/CustomLink/Insert.d.ts +0 -0
  47. package/dist/extension/component/CustomLink/Insert.js +0 -176
  48. package/dist/extension/component/CustomLink/Readonly.d.ts +0 -0
  49. package/dist/extension/component/CustomLink/Readonly.js +0 -106
  50. package/dist/extension/component/CustomLink/index.d.ts +0 -0
  51. package/dist/extension/component/CustomLink/index.js +0 -440
  52. package/dist/extension/component/Link/Readonly.d.ts +0 -8
  53. package/dist/extension/component/Link/Readonly.js +0 -110
@@ -1,106 +0,0 @@
1
- // import { Avatar, Box, Link, Stack } from "@mui/material"
2
- // import { LinkIcon } from "@ctzhian/tiptap/component/Icons"
3
- // import React from "react"
4
- // import { LinkAttributes } from "."
5
-
6
- // interface ReadonlyLinkProps {
7
- // attrs: LinkAttributes
8
- // }
9
-
10
- // export const ReadonlyLink: React.FC<ReadonlyLinkProps> = (props) => {
11
- // const { attrs } = props
12
-
13
- // const handleClick = (e: React.MouseEvent) => {
14
- // e.preventDefault()
15
- // if (attrs.href) {
16
- // window.open(attrs.href, attrs.target || '_blank')
17
- // }
18
- // }
19
-
20
- // // 获取网站图标
21
- // const getFavicon = (url: string) => {
22
- // try {
23
- // const urlObj = new URL(url)
24
- // return `${urlObj.protocol}//${urlObj.host}/favicon.ico`
25
- // } catch {
26
- // return null
27
- // }
28
- // }
29
-
30
- // if (attrs.type === 'card') {
31
- // return (
32
- // <Box
33
- // component="div"
34
- // onClick={handleClick}
35
- // sx={{
36
- // display: 'block',
37
- // border: '1px solid',
38
- // borderColor: 'divider',
39
- // borderRadius: 1,
40
- // p: 2,
41
- // cursor: 'pointer',
42
- // textDecoration: 'none',
43
- // color: 'inherit',
44
- // maxWidth: 400,
45
- // '&:hover': {
46
- // bgcolor: 'action.hover'
47
- // }
48
- // }}
49
- // >
50
- // <Stack direction="row" gap={2} alignItems="center">
51
- // <Avatar
52
- // sx={{ width: 24, height: 24 }}
53
- // src={getFavicon(attrs.href) || undefined}
54
- // >
55
- // <LinkIcon sx={{ fontSize: '1.125rem' }} />
56
- // </Avatar>
57
- // <Stack flex={1} sx={{ minWidth: 0 }}>
58
- // <Box
59
- // sx={{
60
- // fontWeight: 500,
61
- // fontSize: '0.875rem',
62
- // overflow: 'hidden',
63
- // textOverflow: 'ellipsis',
64
- // whiteSpace: 'nowrap'
65
- // }}
66
- // >
67
- // {attrs.title || attrs.href}
68
- // </Box>
69
- // <Box
70
- // sx={{
71
- // fontSize: '0.75rem',
72
- // color: 'text.secondary',
73
- // overflow: 'hidden',
74
- // textOverflow: 'ellipsis',
75
- // whiteSpace: 'nowrap'
76
- // }}
77
- // >
78
- // {attrs.href}
79
- // </Box>
80
- // </Stack>
81
- // </Stack>
82
- // </Box>
83
- // )
84
- // }
85
-
86
- // // 默认链接风格
87
- // return (
88
- // <Link
89
- // component="a"
90
- // href={attrs.href}
91
- // target={attrs.target || '_blank'}
92
- // rel={attrs.rel || 'noopener noreferrer'}
93
- // onClick={handleClick}
94
- // sx={{
95
- // color: 'primary.main',
96
- // textDecoration: 'underline',
97
- // cursor: 'pointer',
98
- // '&:hover': {
99
- // textDecoration: 'none'
100
- // }
101
- // }}
102
- // >
103
- // {attrs.title || attrs.href}
104
- // </Link>
105
- // )
106
- // }
File without changes
@@ -1,440 +0,0 @@
1
- // import { MarkViewRendererProps } from "@tiptap/react"
2
- // import React from "react"
3
- // import InsertLink from "./Insert"
4
-
5
- // export interface LinkAttributes {
6
- // href: string
7
- // target?: string | null
8
- // rel?: string | null
9
- // class?: string | null
10
- // title?: string
11
- // type?: 'link' | 'card'
12
- // }
13
-
14
- // export const LinkViewWrapper: React.FC<MarkViewRendererProps> = (props) => {
15
- // const {
16
- // editor,
17
- // mark,
18
- // updateAttributes,
19
- // } = props
20
-
21
- // const attrs = mark.attrs as LinkAttributes
22
-
23
- // // const [showActions, setShowActions] = useState(false)
24
- // // const [selected, setSelected] = useState(false)
25
- // // const [linkElement, setLinkElement] = useState<HTMLAnchorElement | null>(null)
26
- // // const [editMode, setEditMode] = useState(false)
27
- // // const [editTitle, setEditTitle] = useState('')
28
- // // const [editHref, setEditHref] = useState('')
29
- // // const [editType, setEditType] = useState<'link' | 'card'>('link')
30
-
31
- // // const getFavicon = (url: string) => {
32
- // // try {
33
- // // const urlObj = new URL(url)
34
- // // return `${urlObj.protocol}//${urlObj.host}/favicon.ico`
35
- // // } catch {
36
- // // return null
37
- // // }
38
- // // }
39
-
40
- // // const handleClick = (e: React.MouseEvent) => {
41
- // // e.preventDefault()
42
- // // if (editor.isEditable) {
43
- // // setSelected(!selected)
44
- // // if (!selected) {
45
- // // setShowActions(true)
46
- // // } else {
47
- // // // 第二次点击,打开链接
48
- // // window.open(attrs.href, attrs.target || '_blank')
49
- // // setShowActions(false)
50
- // // setSelected(false)
51
- // // }
52
- // // } else {
53
- // // // 只读模式直接打开链接
54
- // // window.open(attrs.href, attrs.target || '_blank')
55
- // // }
56
- // // }
57
-
58
- // // const handleOpen = () => {
59
- // // window.open(attrs.href, attrs.target || '_blank')
60
- // // setShowActions(false)
61
- // // setSelected(false)
62
- // // }
63
-
64
- // // const handleEdit = () => {
65
- // // setEditTitle(attrs.title || '')
66
- // // setEditHref(attrs.href)
67
- // // setEditType(attrs.type || 'link')
68
- // // setEditMode(true)
69
- // // setShowActions(false)
70
- // // }
71
-
72
- // // const handleSaveEdit = () => {
73
- // // if (editHref.trim()) {
74
- // // updateAttributes({
75
- // // href: editHref.trim(),
76
- // // title: editTitle.trim() || editHref.trim(),
77
- // // type: editType
78
- // // })
79
- // // }
80
- // // setEditMode(false)
81
- // // setSelected(false)
82
- // // }
83
-
84
- // // const handleCancelEdit = () => {
85
- // // setEditMode(false)
86
- // // setEditTitle('')
87
- // // setEditHref('')
88
- // // setEditType('link')
89
- // // }
90
-
91
- // // const handleCopy = async () => {
92
- // // try {
93
- // // await navigator.clipboard.writeText(attrs.href)
94
- // // } catch (err) {
95
- // // console.error('复制失败:', err)
96
- // // }
97
- // // setShowActions(false)
98
- // // setSelected(false)
99
- // // }
100
-
101
- // // const handleUnlink = () => {
102
- // // editor.chain().unsetLink().run()
103
- // // setShowActions(false)
104
- // // setSelected(false)
105
- // // }
106
-
107
- // // const handleToggleStyle = () => {
108
- // // updateAttributes({
109
- // // type: attrs.type === 'link' ? 'card' : 'link'
110
- // // })
111
- // // setShowActions(false)
112
- // // setSelected(false)
113
- // // }
114
-
115
- // // 点击外部关闭操作菜单
116
- // // useEffect(() => {
117
- // // const handleClickOutside = (event: MouseEvent) => {
118
- // // if (linkElement && !linkElement.contains(event.target as Node)) {
119
- // // setShowActions(false)
120
- // // setSelected(false)
121
- // // }
122
- // // }
123
-
124
- // // if (showActions) {
125
- // // document.addEventListener('mousedown', handleClickOutside)
126
- // // return () => document.removeEventListener('mousedown', handleClickOutside)
127
- // // }
128
- // // }, [showActions, linkElement])
129
-
130
- // // 对于空 href,渲染插入组件
131
- // if (!attrs.href) {
132
- // return <InsertLink updateAttributes={updateAttributes} />
133
- // }
134
-
135
- // // 只读模式
136
- // // if (!editor.isEditable) {
137
- // // return <ReadonlyLink attrs={attrs} />
138
- // // }
139
-
140
- // // 简单的测试实现,显示 attrs 数据确实可以获取到
141
- // return (
142
- // <a
143
- // href={attrs.href}
144
- // target={attrs.target || '_blank'}
145
- // className={attrs.class || ''}
146
- // title={attrs.title || ''}
147
- // data-type={attrs.type || 'link'}
148
- // style={{
149
- // color: 'blue',
150
- // textDecoration: 'underline',
151
- // background: attrs.type === 'card' ? '#f0f0f0' : 'transparent',
152
- // padding: attrs.type === 'card' ? '4px' : '0'
153
- // }}
154
- // >
155
- // {/* 显示调试信息 */}
156
- // {attrs.title || attrs.href}
157
- // {attrs.type === 'card' && ' [Card Style]'}
158
- // </a>
159
- // )
160
-
161
- // // 卡片风格
162
- // // if (attrs.type === 'card') {
163
- // // return (
164
- // // <>
165
- // // <Box
166
- // // ref={setLinkElement}
167
- // // component="div"
168
- // // onClick={handleClick}
169
- // // sx={{
170
- // // display: 'block',
171
- // // border: '1px solid',
172
- // // borderColor: selected ? 'primary.main' : 'divider',
173
- // // borderRadius: 1,
174
- // // p: 2,
175
- // // cursor: 'pointer',
176
- // // textDecoration: 'none',
177
- // // color: 'inherit',
178
- // // maxWidth: 400,
179
- // // mb: 1,
180
- // // '&:hover': {
181
- // // bgcolor: 'action.hover'
182
- // // }
183
- // // }}
184
- // // >
185
- // // <Stack direction="row" gap={2} alignItems="center">
186
- // // <Avatar
187
- // // sx={{ width: 24, height: 24 }}
188
- // // src={getFavicon(attrs.href) || undefined}
189
- // // >
190
- // // <LinkIcon sx={{ fontSize: 16 }} />
191
- // // </Avatar>
192
- // // <Stack flex={1} sx={{ minWidth: 0 }}>
193
- // // <Box
194
- // // sx={{
195
- // // fontWeight: 500,
196
- // // fontSize: '0.875rem',
197
- // // overflow: 'hidden',
198
- // // textOverflow: 'ellipsis',
199
- // // whiteSpace: 'nowrap'
200
- // // }}
201
- // // >
202
- // // {attrs.title || attrs.href}
203
- // // </Box>
204
- // // <Box
205
- // // sx={{
206
- // // fontSize: '0.75rem',
207
- // // color: 'text.secondary',
208
- // // overflow: 'hidden',
209
- // // textOverflow: 'ellipsis',
210
- // // whiteSpace: 'nowrap'
211
- // // }}
212
- // // >
213
- // // {attrs.href}
214
- // // </Box>
215
- // // </Stack>
216
- // // </Stack>
217
- // // </Box>
218
-
219
- // // <FloatingPopover
220
- // // open={showActions}
221
- // // anchorEl={linkElement}
222
- // // onClose={() => {
223
- // // setShowActions(false)
224
- // // setSelected(false)
225
- // // }}
226
- // // placement="top"
227
- // // >
228
- // // <Stack direction="row" sx={{ p: 1 }}>
229
- // // <Tooltip title="打开">
230
- // // <IconButton size="small" onClick={handleOpen}>
231
- // // <ShareBoxLineIcon fontSize="small" />
232
- // // </IconButton>
233
- // // </Tooltip>
234
- // // <Tooltip title="编辑">
235
- // // <IconButton size="small" onClick={handleEdit}>
236
- // // <EditBoxLineIcon fontSize="small" />
237
- // // </IconButton>
238
- // // </Tooltip>
239
- // // <Tooltip title="复制链接">
240
- // // <IconButton size="small" onClick={handleCopy}>
241
- // // <CopyIcon fontSize="small" />
242
- // // </IconButton>
243
- // // </Tooltip>
244
- // // <Tooltip title="取消链接">
245
- // // <IconButton size="small" onClick={handleUnlink}>
246
- // // <DeleteLineIcon fontSize="small" />
247
- // // </IconButton>
248
- // // </Tooltip>
249
- // // <Tooltip title="切换到文字链接">
250
- // // <IconButton size="small" onClick={handleToggleStyle}>
251
- // // <TitleIcon fontSize="small" />
252
- // // </IconButton>
253
- // // </Tooltip>
254
- // // </Stack>
255
- // // </FloatingPopover>
256
-
257
- // // <FloatingPopover
258
- // // open={editMode}
259
- // // anchorEl={linkElement}
260
- // // onClose={handleCancelEdit}
261
- // // placement="bottom"
262
- // // >
263
- // // <Stack gap={2} sx={{ p: 2, width: 320 }}>
264
- // // <TextField
265
- // // fullWidth
266
- // // size="small"
267
- // // label="标题"
268
- // // value={editTitle}
269
- // // onChange={(e) => setEditTitle(e.target.value)}
270
- // // placeholder="链接标题(可选)"
271
- // // />
272
- // // <TextField
273
- // // fullWidth
274
- // // size="small"
275
- // // label="地址"
276
- // // value={editHref}
277
- // // onChange={(e) => setEditHref(e.target.value)}
278
- // // placeholder="https://example.com"
279
- // // required
280
- // // />
281
- // // <FormControl component="fieldset">
282
- // // <FormLabel component="legend" sx={{ fontSize: '0.875rem' }}>风格</FormLabel>
283
- // // <RadioGroup
284
- // // row
285
- // // value={editType}
286
- // // onChange={(e) => setEditType(e.target.value as 'link' | 'card')}
287
- // // >
288
- // // <FormControlLabel value="link" control={<Radio size="small" />} label="链接" />
289
- // // <FormControlLabel value="card" control={<Radio size="small" />} label="卡片" />
290
- // // </RadioGroup>
291
- // // </FormControl>
292
- // // <Stack direction="row" gap={1}>
293
- // // <Button
294
- // // variant="outlined"
295
- // // size="small"
296
- // // fullWidth
297
- // // onClick={handleCancelEdit}
298
- // // >
299
- // // 取消
300
- // // </Button>
301
- // // <Button
302
- // // variant="contained"
303
- // // size="small"
304
- // // fullWidth
305
- // // onClick={handleSaveEdit}
306
- // // disabled={!editHref.trim()}
307
- // // >
308
- // // 保存
309
- // // </Button>
310
- // // </Stack>
311
- // // </Stack>
312
- // // </FloatingPopover>
313
- // // </>
314
- // // )
315
- // // }
316
-
317
- // // 链接风格
318
- // // return (
319
- // // <>
320
- // // <MarkViewContent
321
- // // as="a"
322
- // // ref={setLinkElement}
323
- // // onClick={handleClick}
324
- // // style={{
325
- // // color: '#1976d2',
326
- // // textDecoration: 'underline',
327
- // // cursor: 'pointer',
328
- // // borderRadius: '4px',
329
- // // padding: selected ? '0 4px' : '0',
330
- // // backgroundColor: selected ? 'rgba(25, 118, 210, 0.08)' : 'transparent',
331
- // // }}
332
- // // onMouseEnter={(e) => {
333
- // // e.currentTarget.style.textDecoration = 'none'
334
- // // e.currentTarget.style.backgroundColor = 'rgba(0, 0, 0, 0.04)'
335
- // // }}
336
- // // onMouseLeave={(e) => {
337
- // // e.currentTarget.style.textDecoration = 'underline'
338
- // // e.currentTarget.style.backgroundColor = selected ? 'rgba(25, 118, 210, 0.08)' : 'transparent'
339
- // // }}
340
- // // />
341
-
342
- // // <FloatingPopover
343
- // // open={showActions}
344
- // // anchorEl={linkElement}
345
- // // onClose={() => {
346
- // // setShowActions(false)
347
- // // setSelected(false)
348
- // // }}
349
- // // placement="top"
350
- // // >
351
- // // <Stack direction="row" sx={{ p: 1 }}>
352
- // // <Tooltip title="打开">
353
- // // <IconButton size="small" onClick={handleOpen}>
354
- // // <ShareBoxLineIcon fontSize="small" />
355
- // // </IconButton>
356
- // // </Tooltip>
357
- // // <Tooltip title="编辑">
358
- // // <IconButton size="small" onClick={handleEdit}>
359
- // // <EditBoxLineIcon fontSize="small" />
360
- // // </IconButton>
361
- // // </Tooltip>
362
- // // <Tooltip title="复制链接">
363
- // // <IconButton size="small" onClick={handleCopy}>
364
- // // <CopyIcon fontSize="small" />
365
- // // </IconButton>
366
- // // </Tooltip>
367
- // // <Tooltip title="取消链接">
368
- // // <IconButton size="small" onClick={handleUnlink}>
369
- // // <LinkUnlinkIcon fontSize="small" />
370
- // // </IconButton>
371
- // // </Tooltip>
372
- // // <Tooltip title="切换到卡片链接">
373
- // // <IconButton size="small" onClick={handleToggleStyle}>
374
- // // <LinkIcon fontSize="small" />
375
- // // </IconButton>
376
- // // </Tooltip>
377
- // // </Stack>
378
- // // </FloatingPopover>
379
-
380
- // // <FloatingPopover
381
- // // open={editMode}
382
- // // anchorEl={linkElement}
383
- // // onClose={handleCancelEdit}
384
- // // placement="bottom"
385
- // // >
386
- // // <Stack gap={2} sx={{ p: 2, width: 320 }}>
387
- // // <TextField
388
- // // fullWidth
389
- // // size="small"
390
- // // label="标题"
391
- // // value={editTitle}
392
- // // onChange={(e) => setEditTitle(e.target.value)}
393
- // // placeholder="链接标题(可选)"
394
- // // />
395
- // // <TextField
396
- // // fullWidth
397
- // // size="small"
398
- // // label="地址"
399
- // // value={editHref}
400
- // // onChange={(e) => setEditHref(e.target.value)}
401
- // // placeholder="https://example.com"
402
- // // required
403
- // // />
404
- // // <FormControl component="fieldset">
405
- // // <FormLabel component="legend" sx={{ fontSize: '0.875rem' }}>风格</FormLabel>
406
- // // <RadioGroup
407
- // // row
408
- // // value={editType}
409
- // // onChange={(e) => setEditType(e.target.value as 'link' | 'card')}
410
- // // >
411
- // // <FormControlLabel value="link" control={<Radio size="small" />} label="链接" />
412
- // // <FormControlLabel value="card" control={<Radio size="small" />} label="卡片" />
413
- // // </RadioGroup>
414
- // // </FormControl>
415
- // // <Stack direction="row" gap={1}>
416
- // // <Button
417
- // // variant="outlined"
418
- // // size="small"
419
- // // fullWidth
420
- // // onClick={handleCancelEdit}
421
- // // >
422
- // // 取消
423
- // // </Button>
424
- // // <Button
425
- // // variant="contained"
426
- // // size="small"
427
- // // fullWidth
428
- // // onClick={handleSaveEdit}
429
- // // disabled={!editHref.trim()}
430
- // // >
431
- // // 保存
432
- // // </Button>
433
- // // </Stack>
434
- // // </Stack>
435
- // // </FloatingPopover>
436
- // // </>
437
- // // )
438
- // }
439
-
440
- // export default LinkViewWrapper
@@ -1,8 +0,0 @@
1
- import { NodeViewProps } from "@tiptap/react";
2
- import React from "react";
3
- import { LinkAttributes } from ".";
4
- interface ReadonlyLinkProps extends Partial<NodeViewProps> {
5
- attrs: LinkAttributes;
6
- }
7
- declare const ReadonlyLink: ({ attrs, selected }: ReadonlyLinkProps) => React.JSX.Element;
8
- export default ReadonlyLink;
@@ -1,110 +0,0 @@
1
- import { LinkIcon } from "../../../component/Icons";
2
- import { getLinkTitle } from "../../../util";
3
- import { Avatar, Box, Stack } from "@mui/material";
4
- import { NodeViewWrapper } from "@tiptap/react";
5
- import React from "react";
6
- var ReadonlyLink = function ReadonlyLink(_ref) {
7
- var attrs = _ref.attrs,
8
- selected = _ref.selected;
9
- var favicon = '';
10
- try {
11
- favicon = new URL(attrs.href).origin + '/favicon.ico';
12
- } catch (error) {}
13
- return /*#__PURE__*/React.createElement(NodeViewWrapper, {
14
- className: "link-wrapper"
15
- }, attrs.type === 'block' ? /*#__PURE__*/React.createElement(Box, {
16
- component: 'a',
17
- href: attrs.href,
18
- target: attrs.target,
19
- rel: attrs.rel,
20
- "data-title": attrs.title,
21
- "data-type": attrs.type,
22
- sx: {
23
- display: 'block',
24
- textDecoration: 'none !important'
25
- }
26
- }, /*#__PURE__*/React.createElement(Stack, {
27
- direction: 'row',
28
- alignItems: 'center',
29
- gap: 2,
30
- sx: {
31
- border: '1px solid',
32
- borderColor: 'divider',
33
- color: 'text.primary',
34
- cursor: 'pointer',
35
- borderRadius: 'var(--mui-shape-borderRadius)',
36
- p: 2,
37
- ':hover': {
38
- borderColor: 'primary.main',
39
- color: 'primary.main'
40
- }
41
- }
42
- }, /*#__PURE__*/React.createElement(Avatar, {
43
- sx: {
44
- width: '2rem',
45
- height: '2rem',
46
- alignSelf: 'center',
47
- bgcolor: '#FFFFFF'
48
- },
49
- src: favicon
50
- }, /*#__PURE__*/React.createElement(LinkIcon, {
51
- sx: {
52
- fontSize: '2rem',
53
- cursor: 'grab',
54
- color: 'primary.main',
55
- alignSelf: 'center',
56
- ':active': {
57
- cursor: 'grabbing'
58
- }
59
- }
60
- })), /*#__PURE__*/React.createElement(Stack, {
61
- sx: {
62
- flex: 1
63
- },
64
- gap: 0.5
65
- }, /*#__PURE__*/React.createElement(Box, {
66
- sx: {
67
- fontSize: '0.875rem',
68
- fontWeight: 'bold'
69
- }
70
- }, attrs.title || getLinkTitle(attrs.href)), /*#__PURE__*/React.createElement(Box, {
71
- sx: {
72
- fontSize: '0.75rem',
73
- color: 'text.secondary'
74
- }
75
- }, attrs.href)))) : /*#__PURE__*/React.createElement(Box, {
76
- component: 'a',
77
- href: attrs.href,
78
- target: attrs.target,
79
- rel: attrs.rel,
80
- "data-title": attrs.title,
81
- "data-type": attrs.type,
82
- sx: {
83
- display: 'inline-flex',
84
- alignItems: 'baseline',
85
- gap: '2px',
86
- color: 'primary.main',
87
- fontWeight: 500,
88
- lineHeight: 1.625
89
- }
90
- }, attrs.type === 'icon' && /*#__PURE__*/React.createElement(Avatar, {
91
- sx: {
92
- width: '1rem',
93
- height: '1rem',
94
- alignSelf: 'center',
95
- bgcolor: '#FFFFFF'
96
- },
97
- src: favicon
98
- }, /*#__PURE__*/React.createElement(LinkIcon, {
99
- sx: {
100
- fontSize: '1rem',
101
- cursor: 'grab',
102
- color: 'primary.main',
103
- alignSelf: 'center',
104
- ':active': {
105
- cursor: 'grabbing'
106
- }
107
- }
108
- })), attrs.title || getLinkTitle(attrs.href)));
109
- };
110
- export default ReadonlyLink;