diff --git a/lib/src/models/documents/attribute.dart b/lib/src/models/documents/attribute.dart index 284cf580..2585e8b7 100644 --- a/lib/src/models/documents/attribute.dart +++ b/lib/src/models/documents/attribute.dart @@ -50,11 +50,9 @@ class Attribute { static const BoldAttribute bold = BoldAttribute(); - static final ScriptAttribute subscript = - ScriptAttribute(ScriptAttributes.sub); + static final ScriptAttribute subscript = ScriptAttribute(ScriptAttributes.sub); - static final ScriptAttribute superscript = - ScriptAttribute(ScriptAttributes.sup); + static final ScriptAttribute superscript = ScriptAttribute(ScriptAttributes.sup); static const ItalicAttribute italic = ItalicAttribute(); @@ -116,6 +114,8 @@ class Attribute { static const MentionAttribute mention = MentionAttribute(null); + static const MentionAllAttribute mentionAll = MentionAllAttribute(null); + static const VideoAttribute video = VideoAttribute(null); static final Set inlineKeys = { @@ -163,6 +163,7 @@ class Attribute { Attribute.video.key, Attribute.file.key, Attribute.mention.key, + Attribute.mentionAll.key, }; static const Attribute h1 = HeaderAttribute(level: 1); @@ -256,9 +257,7 @@ class Attribute { if (identical(this, other)) return true; if (other is! Attribute) return false; final typedOther = other; - return key == typedOther.key && - scope == typedOther.scope && - value == typedOther.value; + return key == typedOther.key && scope == typedOther.scope && value == typedOther.value; } @override @@ -307,29 +306,24 @@ class LinkAttribute extends Attribute { } class ColorAttribute extends Attribute { - const ColorAttribute(String? val) - : super('color', AttributeScope.INLINE, val); + const ColorAttribute(String? val) : super('color', AttributeScope.INLINE, val); } class BackgroundAttribute extends Attribute { - const BackgroundAttribute(String? val) - : super('background', AttributeScope.INLINE, val); + const BackgroundAttribute(String? val) : super('background', AttributeScope.INLINE, val); } /// This is custom attribute for hint class PlaceholderAttribute extends Attribute { - const PlaceholderAttribute() - : super('placeholder', AttributeScope.INLINE, true); + const PlaceholderAttribute() : super('placeholder', AttributeScope.INLINE, true); } class HeaderAttribute extends Attribute { - const HeaderAttribute({int? level}) - : super('header', AttributeScope.BLOCK, level); + const HeaderAttribute({int? level}) : super('header', AttributeScope.BLOCK, level); } class IndentAttribute extends Attribute { - const IndentAttribute({int? level}) - : super('indent', AttributeScope.BLOCK, level); + const IndentAttribute({int? level}) : super('indent', AttributeScope.BLOCK, level); } class AlignAttribute extends Attribute { @@ -349,23 +343,19 @@ class BlockQuoteAttribute extends Attribute { } class DirectionAttribute extends Attribute { - const DirectionAttribute(String? val) - : super('direction', AttributeScope.BLOCK, val); + const DirectionAttribute(String? val) : super('direction', AttributeScope.BLOCK, val); } class WidthAttribute extends Attribute { - const WidthAttribute(String? val) - : super('width', AttributeScope.IGNORE, val); + const WidthAttribute(String? val) : super('width', AttributeScope.IGNORE, val); } class HeightAttribute extends Attribute { - const HeightAttribute(String? val) - : super('height', AttributeScope.IGNORE, val); + const HeightAttribute(String? val) : super('height', AttributeScope.IGNORE, val); } class StyleAttribute extends Attribute { - const StyleAttribute(String? val) - : super('style', AttributeScope.IGNORE, val); + const StyleAttribute(String? val) : super('style', AttributeScope.IGNORE, val); } class TokenAttribute extends Attribute { @@ -373,8 +363,7 @@ class TokenAttribute extends Attribute { } class ScriptAttribute extends Attribute { - ScriptAttribute(ScriptAttributes? val) - : super('script', AttributeScope.INLINE, val?.value); + ScriptAttribute(ScriptAttributes? val) : super('script', AttributeScope.INLINE, val?.value); } enum ScriptAttributes { @@ -387,21 +376,21 @@ enum ScriptAttributes { } class ImageAttribute extends Attribute { - const ImageAttribute(String? url) - : super('img', AttributeScope.EMBEDS, url); + const ImageAttribute(String? url) : super('img', AttributeScope.EMBEDS, url); } class VideoAttribute extends Attribute { - const VideoAttribute(String? url) - : super('video', AttributeScope.EMBEDS, url); + const VideoAttribute(String? url) : super('video', AttributeScope.EMBEDS, url); } class FileAttribute extends Attribute { - const FileAttribute(String? url) - : super('file', AttributeScope.EMBEDS, url); + const FileAttribute(String? url) : super('file', AttributeScope.EMBEDS, url); } class MentionAttribute extends Attribute { - const MentionAttribute(String? url) - : super('mention', AttributeScope.EMBEDS, url); + const MentionAttribute(String? url) : super('mention', AttributeScope.EMBEDS, url); +} + +class MentionAllAttribute extends Attribute { + const MentionAllAttribute(String? url) : super('mention_all', AttributeScope.EMBEDS, url); }