@ones-editor/editor 2.1.7-beta.27 → 2.1.7-beta.29
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.js
CHANGED
|
@@ -46711,10 +46711,11 @@ ${codeText}
|
|
|
46711
46711
|
constructor(editor) {
|
|
46712
46712
|
__publicField(this, "draggingRefCell", null);
|
|
46713
46713
|
__publicField(this, "handleMouseMove", (editor, event) => {
|
|
46714
|
+
var _a;
|
|
46714
46715
|
if (editor.readonly || window.isDragging) {
|
|
46715
46716
|
return;
|
|
46716
46717
|
}
|
|
46717
|
-
if (editor.selectionHandler.isSelecting() && !this.draggingRefCell) {
|
|
46718
|
+
if (((_a = editor.selectionHandler) == null ? void 0 : _a.isSelecting()) && !this.draggingRefCell) {
|
|
46718
46719
|
return;
|
|
46719
46720
|
}
|
|
46720
46721
|
if (this.draggingRefCell) {
|
|
@@ -72252,11 +72253,35 @@ ${codeText}
|
|
|
72252
72253
|
"style-custom-tag": true
|
|
72253
72254
|
});
|
|
72254
72255
|
}
|
|
72256
|
+
const StyleTags = {
|
|
72257
|
+
u: "style-underline",
|
|
72258
|
+
strong: "style-bold",
|
|
72259
|
+
em: "style-italic",
|
|
72260
|
+
del: "style-strikethrough",
|
|
72261
|
+
superscript: "style-superscript",
|
|
72262
|
+
subscript: "style-subscript"
|
|
72263
|
+
};
|
|
72264
|
+
function applyHtmlToText(htm, attributes) {
|
|
72265
|
+
const html = htm.toLowerCase();
|
|
72266
|
+
const tags = Object.keys(StyleTags);
|
|
72267
|
+
for (let i = 0; i < tags.length; i += 1) {
|
|
72268
|
+
const tag = tags[i];
|
|
72269
|
+
const startTag = `<${tag}>`;
|
|
72270
|
+
const endTag = `</${tag}>`;
|
|
72271
|
+
if (html.indexOf(startTag) >= 0) {
|
|
72272
|
+
attributes[StyleTags[tag]] = true;
|
|
72273
|
+
} else if (html.indexOf(endTag) >= 0) {
|
|
72274
|
+
delete attributes[StyleTags[tag]];
|
|
72275
|
+
}
|
|
72276
|
+
}
|
|
72277
|
+
}
|
|
72255
72278
|
const logger$M = getLogger("token-to-text");
|
|
72256
72279
|
function tokensToText(tokens, attributes, options) {
|
|
72257
72280
|
const ops = tokens.map((token) => {
|
|
72258
72281
|
if (token.type === "text") {
|
|
72259
|
-
return textTokenToText(token,
|
|
72282
|
+
return textTokenToText(token, {
|
|
72283
|
+
...attributes
|
|
72284
|
+
}, options);
|
|
72260
72285
|
}
|
|
72261
72286
|
if (token.type === "strong") {
|
|
72262
72287
|
return options.tokensToText(token.tokens, {
|
|
@@ -72282,6 +72307,10 @@ ${codeText}
|
|
|
72282
72307
|
if (token.type === "codespan") {
|
|
72283
72308
|
return codespanToText(token, attributes);
|
|
72284
72309
|
}
|
|
72310
|
+
if (token.type === "html") {
|
|
72311
|
+
const html = token.text;
|
|
72312
|
+
applyHtmlToText(html, attributes);
|
|
72313
|
+
}
|
|
72285
72314
|
if (token.type === "br") {
|
|
72286
72315
|
return [{
|
|
72287
72316
|
insert: " ",
|
|
@@ -72863,11 +72892,11 @@ ${content}
|
|
|
72863
72892
|
replacement(content, node, options) {
|
|
72864
72893
|
const hLevel = Number(node.nodeName.charAt(1));
|
|
72865
72894
|
if (options.headingStyle === "setext" && hLevel < 3) {
|
|
72866
|
-
const
|
|
72895
|
+
const underline2 = repeat(hLevel === 1 ? "=" : "-", content.length);
|
|
72867
72896
|
return `
|
|
72868
72897
|
|
|
72869
72898
|
${content}
|
|
72870
|
-
${
|
|
72899
|
+
${underline2}
|
|
72871
72900
|
|
|
72872
72901
|
`;
|
|
72873
72902
|
}
|
|
@@ -73956,6 +73985,16 @@ ${content}
|
|
|
73956
73985
|
const newHtml = fragmentToHtml(fragment);
|
|
73957
73986
|
return newHtml;
|
|
73958
73987
|
}
|
|
73988
|
+
function underline(ts) {
|
|
73989
|
+
ts.addRule("underline", {
|
|
73990
|
+
filter: ["u"],
|
|
73991
|
+
replacement(content, node) {
|
|
73992
|
+
if (!content.trim())
|
|
73993
|
+
return "";
|
|
73994
|
+
return `<u>${content}</u>`;
|
|
73995
|
+
}
|
|
73996
|
+
});
|
|
73997
|
+
}
|
|
73959
73998
|
const logger$K = getLogger("html-to-doc");
|
|
73960
73999
|
const turndownService = new TurndownService();
|
|
73961
74000
|
turndownService.use(codeListToCode);
|
|
@@ -73967,6 +74006,7 @@ ${content}
|
|
|
73967
74006
|
turndownService.use(prismCodeToCode);
|
|
73968
74007
|
turndownService.use(wechatMessageTimeToBlockQuote);
|
|
73969
74008
|
turndownService.use(turndownPluginGfm.gfm);
|
|
74009
|
+
turndownService.use(underline);
|
|
73970
74010
|
function htmlToBlocks$1(html, options) {
|
|
73971
74011
|
const subDoc = processedHtmlToDocByMarkdown(html, options);
|
|
73972
74012
|
if (!subDoc) {
|
|
@@ -89137,7 +89177,7 @@ ${data2.flowchartText}
|
|
|
89137
89177
|
}
|
|
89138
89178
|
}
|
|
89139
89179
|
});
|
|
89140
|
-
editor.version = "2.1.7-beta.
|
|
89180
|
+
editor.version = "2.1.7-beta.29";
|
|
89141
89181
|
return editor;
|
|
89142
89182
|
}
|
|
89143
89183
|
function isDoc(doc2) {
|
|
@@ -89251,7 +89291,7 @@ ${data2.flowchartText}
|
|
|
89251
89291
|
}
|
|
89252
89292
|
}
|
|
89253
89293
|
OnesEditorToolbar.register(editor);
|
|
89254
|
-
editor.version = "2.1.7-beta.
|
|
89294
|
+
editor.version = "2.1.7-beta.29";
|
|
89255
89295
|
return editor;
|
|
89256
89296
|
}
|
|
89257
89297
|
async function showDocVersions(editor, options, serverUrl) {
|