-
Notifications
You must be signed in to change notification settings - Fork 600
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HtmlEditor: ignore errors after move to TS
- Loading branch information
1 parent
0f9d7e6
commit 935aa33
Showing
53 changed files
with
5,451 additions
and
5,004 deletions.
There are no files selected for viewing
39 changes: 20 additions & 19 deletions
39
packages/devextreme/js/__internal/ui/html_editor/converters/m_delta.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
94 changes: 49 additions & 45 deletions
94
packages/devextreme/js/__internal/ui/html_editor/converters/m_markdown.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 5 additions & 3 deletions
8
packages/devextreme/js/__internal/ui/html_editor/formats/m_align.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
import Quill from 'devextreme-quill'; | ||
|
||
// eslint-disable-next-line import/no-mutable-exports | ||
let AlignStyle = {}; | ||
|
||
if(Quill) { | ||
AlignStyle = Quill.import('attributors/style/align'); | ||
AlignStyle.whitelist.push('left'); | ||
if (Quill) { | ||
AlignStyle = Quill.import('attributors/style/align'); | ||
// @ts-expect-error | ||
AlignStyle.whitelist.push('left'); | ||
} | ||
|
||
export default AlignStyle; |
8 changes: 5 additions & 3 deletions
8
packages/devextreme/js/__internal/ui/html_editor/formats/m_font.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
import Quill from 'devextreme-quill'; | ||
|
||
// eslint-disable-next-line import/no-mutable-exports | ||
let FontStyle = {}; | ||
|
||
if(Quill) { | ||
FontStyle = Quill.import('attributors/style/font'); | ||
FontStyle.whitelist = null; | ||
if (Quill) { | ||
FontStyle = Quill.import('attributors/style/font'); | ||
// @ts-expect-error | ||
FontStyle.whitelist = null; | ||
} | ||
|
||
export default FontStyle; |
123 changes: 63 additions & 60 deletions
123
packages/devextreme/js/__internal/ui/html_editor/formats/m_image.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,70 @@ | ||
import { isObject } from '@js/core/utils/type'; | ||
import Quill from 'devextreme-quill'; | ||
import { isObject } from '../../../core/utils/type'; | ||
|
||
// eslint-disable-next-line import/no-mutable-exports | ||
let ExtImage = {}; | ||
|
||
if(Quill) { | ||
const Image = Quill.import('formats/image'); | ||
|
||
ExtImage = class ExtImage extends Image { | ||
static create(data) { | ||
const SRC = data && data.src || data; | ||
const node = super.create(SRC); | ||
|
||
if(isObject(data)) { | ||
const setAttribute = (attr, value) => { | ||
data[attr] && node.setAttribute(attr, value); | ||
}; | ||
|
||
setAttribute('alt', data.alt); | ||
setAttribute('width', data.width); | ||
setAttribute('height', data.height); | ||
} | ||
|
||
return node; | ||
} | ||
|
||
static formats(domNode) { | ||
const formats = super.formats(domNode); | ||
|
||
formats['imageSrc'] = domNode.getAttribute('src'); | ||
|
||
return formats; | ||
} | ||
|
||
formats() { | ||
const formats = super.formats(); | ||
const floatValue = this.domNode.style['float']; | ||
|
||
if(floatValue) { | ||
formats['float'] = floatValue; | ||
} | ||
|
||
return formats; | ||
} | ||
|
||
format(name, value) { | ||
if(name === 'float') { | ||
this.domNode.style[name] = value; | ||
} else { | ||
super.format(name, value); | ||
} | ||
} | ||
|
||
static value(domNode) { | ||
return { | ||
src: domNode.getAttribute('src'), | ||
width: domNode.getAttribute('width'), | ||
height: domNode.getAttribute('height'), | ||
alt: domNode.getAttribute('alt') | ||
}; | ||
} | ||
}; | ||
|
||
ExtImage.blotName = 'extendedImage'; | ||
if (Quill) { | ||
const Image = Quill.import('formats/image'); | ||
|
||
ExtImage = class ExtImage extends Image { | ||
static create(data) { | ||
const SRC = data && data.src || data; | ||
const node = super.create(SRC); | ||
|
||
if (isObject(data)) { | ||
const setAttribute = (attr, value) => { | ||
data[attr] && node.setAttribute(attr, value); | ||
}; | ||
// @ts-expect-error | ||
setAttribute('alt', data.alt); | ||
// @ts-expect-error | ||
setAttribute('width', data.width); | ||
// @ts-expect-error | ||
setAttribute('height', data.height); | ||
} | ||
|
||
return node; | ||
} | ||
|
||
static formats(domNode) { | ||
const formats = super.formats(domNode); | ||
|
||
formats.imageSrc = domNode.getAttribute('src'); | ||
|
||
return formats; | ||
} | ||
|
||
formats() { | ||
const formats = super.formats(); | ||
const floatValue = this.domNode.style.float; | ||
|
||
if (floatValue) { | ||
formats.float = floatValue; | ||
} | ||
|
||
return formats; | ||
} | ||
|
||
format(name, value) { | ||
if (name === 'float') { | ||
this.domNode.style[name] = value; | ||
} else { | ||
super.format(name, value); | ||
} | ||
} | ||
|
||
static value(domNode) { | ||
return { | ||
src: domNode.getAttribute('src'), | ||
width: domNode.getAttribute('width'), | ||
height: domNode.getAttribute('height'), | ||
alt: domNode.getAttribute('alt'), | ||
}; | ||
} | ||
}; | ||
// @ts-expect-error | ||
ExtImage.blotName = 'extendedImage'; | ||
} | ||
|
||
export default ExtImage; |
Oops, something went wrong.