mirror of
https://github.com/utopia-os/utopia-ui.git
synced 2025-12-13 07:46:10 +00:00
linting
This commit is contained in:
parent
49a2e9a6bf
commit
f3406d50c0
1
lib/package-lock.json
generated
1
lib/package-lock.json
generated
@ -39,6 +39,7 @@
|
||||
"html-truncate": "^1.2.2",
|
||||
"leaflet": "^1.9.4",
|
||||
"leaflet.locatecontrol": "^0.79.0",
|
||||
"mdast-util-to-string": "^4.0.0",
|
||||
"prosemirror-markdown": "^1.13.2",
|
||||
"prosemirror-state": "^1.4.3",
|
||||
"radash": "^12.1.0",
|
||||
|
||||
@ -127,6 +127,7 @@
|
||||
"html-truncate": "^1.2.2",
|
||||
"leaflet": "^1.9.4",
|
||||
"leaflet.locatecontrol": "^0.79.0",
|
||||
"mdast-util-to-string": "^4.0.0",
|
||||
"prosemirror-markdown": "^1.13.2",
|
||||
"prosemirror-state": "^1.4.3",
|
||||
"radash": "^12.1.0",
|
||||
|
||||
@ -1,28 +1,45 @@
|
||||
import { Image } from '@tiptap/extension-image'
|
||||
|
||||
import type { Attribute } from '@tiptap/core'
|
||||
|
||||
export const CustomImage = Image.extend({
|
||||
addAttributes() {
|
||||
const parentAttrs = (this.parent?.() ?? {}) as Record<string, Attribute>
|
||||
|
||||
return {
|
||||
...this.parent?.(),
|
||||
...parentAttrs,
|
||||
|
||||
style: {
|
||||
default: null,
|
||||
parseHTML: (element) => element.getAttribute('style'),
|
||||
renderHTML: (attributes) => {
|
||||
if (!attributes.style) {
|
||||
parseHTML: (element: Element): string | null => {
|
||||
return element.getAttribute('style')
|
||||
},
|
||||
renderHTML: (attrs: { style: string | null }) => {
|
||||
if (!attrs.style) {
|
||||
return {}
|
||||
}
|
||||
return { style: attributes.style }
|
||||
return { style: attrs.style }
|
||||
},
|
||||
},
|
||||
|
||||
width: {
|
||||
default: null,
|
||||
parseHTML: (element) => element.getAttribute('width'),
|
||||
renderHTML: (attrs) => (attrs.width ? { width: attrs.width } : {}),
|
||||
parseHTML: (element: Element): string | null => {
|
||||
return element.getAttribute('width')
|
||||
},
|
||||
renderHTML: (attrs: { width: string | null }) => {
|
||||
return attrs.width ? { width: attrs.width } : {}
|
||||
},
|
||||
},
|
||||
|
||||
height: {
|
||||
default: null,
|
||||
parseHTML: (element) => element.getAttribute('height'),
|
||||
renderHTML: (attrs) => (attrs.height ? { height: attrs.height } : {}),
|
||||
parseHTML: (element: Element): string | null => {
|
||||
return element.getAttribute('height')
|
||||
},
|
||||
renderHTML: (attrs: { height: string | null }) => {
|
||||
return attrs.height ? { height: attrs.height } : {}
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
@ -16,6 +16,7 @@ export const MentionList = forwardRef<MentionListHandle, MentionListProps>(funct
|
||||
const [selectedIndex, setSelectedIndex] = useState<number>(0)
|
||||
|
||||
const selectItem = (index: number) => {
|
||||
// eslint-disable-next-line security/detect-object-injection
|
||||
const item = items[index]
|
||||
if (item) {
|
||||
command({ id: item })
|
||||
|
||||
@ -71,7 +71,6 @@ export function RichTextEditor({
|
||||
const handleChange = () => {
|
||||
if (updateFormValue) {
|
||||
if (editor) {
|
||||
console.log(getStyledMarkdown(editor))
|
||||
updateFormValue(getStyledMarkdown(editor))
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user