@mdaemon/html-editor 1.0.12 → 1.0.13
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.
- package/dist/index.d.ts +2 -0
- package/dist/index.js +50 -0
- package/dist/index.mjs +50 -0
- package/dist/styles.css +3 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -369,6 +369,8 @@ export declare interface MDHTMLEditor {
|
|
|
369
369
|
getTipTap(): Editor | null;
|
|
370
370
|
}
|
|
371
371
|
|
|
372
|
+
export declare const Mention: Node_2<any, any>;
|
|
373
|
+
|
|
372
374
|
/**
|
|
373
375
|
* Reset the global translation function to the default identity function.
|
|
374
376
|
* This also clears the customized flag so that the next editor created
|
package/dist/index.js
CHANGED
|
@@ -43774,6 +43774,54 @@ const SignatureBlock = Node3.create({
|
|
|
43774
43774
|
return ["div", mergeAttributes(HTMLAttributes), 0];
|
|
43775
43775
|
}
|
|
43776
43776
|
});
|
|
43777
|
+
const Mention = Node3.create({
|
|
43778
|
+
name: "mention",
|
|
43779
|
+
group: "inline",
|
|
43780
|
+
inline: true,
|
|
43781
|
+
atom: true,
|
|
43782
|
+
selectable: true,
|
|
43783
|
+
draggable: false,
|
|
43784
|
+
addAttributes() {
|
|
43785
|
+
return {
|
|
43786
|
+
jid: {
|
|
43787
|
+
default: null,
|
|
43788
|
+
parseHTML: (element) => element.getAttribute("data-jid"),
|
|
43789
|
+
renderHTML: (attributes) => {
|
|
43790
|
+
if (!attributes.jid) return {};
|
|
43791
|
+
return { "data-jid": attributes.jid };
|
|
43792
|
+
}
|
|
43793
|
+
},
|
|
43794
|
+
display: {
|
|
43795
|
+
default: null,
|
|
43796
|
+
parseHTML: (element) => element.getAttribute("data-display"),
|
|
43797
|
+
renderHTML: (attributes) => {
|
|
43798
|
+
if (!attributes.display) return {};
|
|
43799
|
+
return { "data-display": attributes.display };
|
|
43800
|
+
}
|
|
43801
|
+
}
|
|
43802
|
+
};
|
|
43803
|
+
},
|
|
43804
|
+
parseHTML() {
|
|
43805
|
+
return [
|
|
43806
|
+
{
|
|
43807
|
+
tag: "span.composer-mention"
|
|
43808
|
+
}
|
|
43809
|
+
];
|
|
43810
|
+
},
|
|
43811
|
+
renderHTML({ node, HTMLAttributes }) {
|
|
43812
|
+
return [
|
|
43813
|
+
"span",
|
|
43814
|
+
mergeAttributes(
|
|
43815
|
+
{
|
|
43816
|
+
class: "composer-mention",
|
|
43817
|
+
contenteditable: "false"
|
|
43818
|
+
},
|
|
43819
|
+
HTMLAttributes
|
|
43820
|
+
),
|
|
43821
|
+
`@${node.attrs.display}`
|
|
43822
|
+
];
|
|
43823
|
+
}
|
|
43824
|
+
});
|
|
43777
43825
|
const en = {
|
|
43778
43826
|
"Bold": "Bold",
|
|
43779
43827
|
"Italic": "Italic",
|
|
@@ -46304,6 +46352,7 @@ class HTMLEditor {
|
|
|
46304
46352
|
// We use CodeBlockLowlight instead
|
|
46305
46353
|
}),
|
|
46306
46354
|
SignatureBlock,
|
|
46355
|
+
Mention,
|
|
46307
46356
|
Underline,
|
|
46308
46357
|
TextStyle,
|
|
46309
46358
|
FontFamily,
|
|
@@ -46565,6 +46614,7 @@ exports.FontSize = FontSize;
|
|
|
46565
46614
|
exports.HTMLEditor = HTMLEditor;
|
|
46566
46615
|
exports.LineHeight = LineHeight;
|
|
46567
46616
|
exports.LinkEditor = LinkEditor;
|
|
46617
|
+
exports.Mention = Mention;
|
|
46568
46618
|
exports.SearchReplace = SearchReplace;
|
|
46569
46619
|
exports.SignatureBlock = SignatureBlock;
|
|
46570
46620
|
exports.SourceEditor = SourceEditor;
|
package/dist/index.mjs
CHANGED
|
@@ -43772,6 +43772,54 @@ const SignatureBlock = Node3.create({
|
|
|
43772
43772
|
return ["div", mergeAttributes(HTMLAttributes), 0];
|
|
43773
43773
|
}
|
|
43774
43774
|
});
|
|
43775
|
+
const Mention = Node3.create({
|
|
43776
|
+
name: "mention",
|
|
43777
|
+
group: "inline",
|
|
43778
|
+
inline: true,
|
|
43779
|
+
atom: true,
|
|
43780
|
+
selectable: true,
|
|
43781
|
+
draggable: false,
|
|
43782
|
+
addAttributes() {
|
|
43783
|
+
return {
|
|
43784
|
+
jid: {
|
|
43785
|
+
default: null,
|
|
43786
|
+
parseHTML: (element) => element.getAttribute("data-jid"),
|
|
43787
|
+
renderHTML: (attributes) => {
|
|
43788
|
+
if (!attributes.jid) return {};
|
|
43789
|
+
return { "data-jid": attributes.jid };
|
|
43790
|
+
}
|
|
43791
|
+
},
|
|
43792
|
+
display: {
|
|
43793
|
+
default: null,
|
|
43794
|
+
parseHTML: (element) => element.getAttribute("data-display"),
|
|
43795
|
+
renderHTML: (attributes) => {
|
|
43796
|
+
if (!attributes.display) return {};
|
|
43797
|
+
return { "data-display": attributes.display };
|
|
43798
|
+
}
|
|
43799
|
+
}
|
|
43800
|
+
};
|
|
43801
|
+
},
|
|
43802
|
+
parseHTML() {
|
|
43803
|
+
return [
|
|
43804
|
+
{
|
|
43805
|
+
tag: "span.composer-mention"
|
|
43806
|
+
}
|
|
43807
|
+
];
|
|
43808
|
+
},
|
|
43809
|
+
renderHTML({ node, HTMLAttributes }) {
|
|
43810
|
+
return [
|
|
43811
|
+
"span",
|
|
43812
|
+
mergeAttributes(
|
|
43813
|
+
{
|
|
43814
|
+
class: "composer-mention",
|
|
43815
|
+
contenteditable: "false"
|
|
43816
|
+
},
|
|
43817
|
+
HTMLAttributes
|
|
43818
|
+
),
|
|
43819
|
+
`@${node.attrs.display}`
|
|
43820
|
+
];
|
|
43821
|
+
}
|
|
43822
|
+
});
|
|
43775
43823
|
const en = {
|
|
43776
43824
|
"Bold": "Bold",
|
|
43777
43825
|
"Italic": "Italic",
|
|
@@ -46302,6 +46350,7 @@ class HTMLEditor {
|
|
|
46302
46350
|
// We use CodeBlockLowlight instead
|
|
46303
46351
|
}),
|
|
46304
46352
|
SignatureBlock,
|
|
46353
|
+
Mention,
|
|
46305
46354
|
Underline,
|
|
46306
46355
|
TextStyle,
|
|
46307
46356
|
FontFamily,
|
|
@@ -46564,6 +46613,7 @@ export {
|
|
|
46564
46613
|
HTMLEditor,
|
|
46565
46614
|
LineHeight,
|
|
46566
46615
|
LinkEditor,
|
|
46616
|
+
Mention,
|
|
46567
46617
|
SearchReplace,
|
|
46568
46618
|
SignatureBlock,
|
|
46569
46619
|
SourceEditor,
|
package/dist/styles.css
CHANGED