@ones-editor/editor 3.0.9-beta.1 → 3.0.9-beta.3

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
@@ -52396,7 +52396,22 @@ ${codeText}
52396
52396
  var _a, _b, _c;
52397
52397
  const list2 = blockData;
52398
52398
  if (type === "text") {
52399
- const text2 = ((_a = TextBlock.convertTo) == null ? void 0 : _a.call(TextBlock, editor, blockData, doc2, "text", path)) || "";
52399
+ let text2 = ((_a = TextBlock.convertTo) == null ? void 0 : _a.call(TextBlock, editor, blockData, doc2, "text", path)) || "";
52400
+ if (path.length === 1) {
52401
+ if (list2.checkbox === "checked") {
52402
+ text2 = `[x] ${text2}`;
52403
+ } else if (list2.checkbox === "unchecked") {
52404
+ text2 = `[ ] ${text2}`;
52405
+ }
52406
+ if (list2.ordered) {
52407
+ text2 = `${list2.start}. ${text2}`;
52408
+ } else {
52409
+ text2 = `- ${text2}`;
52410
+ }
52411
+ const level = list2.level || 0;
52412
+ const prefix = level > 0 ? " ".repeat(level - 1) : "";
52413
+ text2 = prefix + text2;
52414
+ }
52400
52415
  return text2;
52401
52416
  }
52402
52417
  if (type === "markdown") {
@@ -76493,6 +76508,11 @@ ${codeText}
76493
76508
  if (token.type === "codespan") {
76494
76509
  return codespanToText(token, attributes);
76495
76510
  }
76511
+ if (token.type === "confluenceText") {
76512
+ return textTokenToText(token, {
76513
+ ...attributes
76514
+ }, options);
76515
+ }
76496
76516
  if (token.type === "html") {
76497
76517
  const html = token.text;
76498
76518
  const testBr = html.trim().toLowerCase();
@@ -76956,6 +76976,31 @@ ${codeText}
76956
76976
  const extendedCustomTag = () => ({
76957
76977
  extensions: [extCustomTag()]
76958
76978
  });
76979
+ const confluenceTextTag = () => ({
76980
+ extensions: [{
76981
+ name: "confluenceText",
76982
+ level: "inline",
76983
+ start(src) {
76984
+ return src.indexOf("<cf-text>");
76985
+ },
76986
+ tokenizer(src) {
76987
+ const rule = /^<cf-text>([\s\S]*?)<\/cf-text>/;
76988
+ const match = rule.exec(src);
76989
+ if (match) {
76990
+ return {
76991
+ type: "confluenceText",
76992
+ raw: match[0],
76993
+ text: match[1]
76994
+ };
76995
+ }
76996
+ return void 0;
76997
+ },
76998
+ renderer(token) {
76999
+ console.log("confluenceText token:", token);
77000
+ return `<cf-text>${token.text}</cf-text>`;
77001
+ }
77002
+ }]
77003
+ });
76959
77004
  const latexOptions = {
76960
77005
  render: (formula, displayMode) => ""
76961
77006
  };
@@ -76964,6 +77009,7 @@ ${codeText}
76964
77009
  mangle: false
76965
77010
  });
76966
77011
  marked.marked.use(extendedCustomTag());
77012
+ marked.marked.use(confluenceTextTag());
76967
77013
  function markdownToDoc(markdown2, options) {
76968
77014
  const lexer = new marked.marked.Lexer();
76969
77015
  const tokens = lexer.lex(markdown2);
@@ -78515,6 +78561,19 @@ ${docStr}
78515
78561
  }
78516
78562
  });
78517
78563
  }
78564
+ function confluenceText(ts) {
78565
+ ts.addRule("cf-text", {
78566
+ filter: ["cf-text"],
78567
+ replacement(content, node) {
78568
+ if (!content.trim())
78569
+ return "";
78570
+ if (content.includes("abc")) {
78571
+ console.log("cf-text content:", content);
78572
+ }
78573
+ return `<cf-text>${node.textContent}</cf-text>`;
78574
+ }
78575
+ });
78576
+ }
78518
78577
  const logger$P = getLogger("html-to-doc");
78519
78578
  const turndownService = new TurndownService();
78520
78579
  turndownService.use(codeListToCode);
@@ -78531,6 +78590,7 @@ ${docStr}
78531
78590
  turndownService.use(textColor);
78532
78591
  turndownService.use(fontSize);
78533
78592
  turndownService.use(superScript);
78593
+ turndownService.use(confluenceText);
78534
78594
  function htmlToBlocks$1(html, options) {
78535
78595
  const subDoc = processedHtmlToDocByMarkdown(html, options);
78536
78596
  if (!subDoc) {
@@ -78554,7 +78614,7 @@ ${docStr}
78554
78614
  }
78555
78615
  }
78556
78616
  const markdown2 = turndownService.turndown(htmlFragment);
78557
- logger$P.debug(markdown2);
78617
+ logger$P.debug(`markdown: ${markdown2}`);
78558
78618
  return markdownToDoc(markdown2, {
78559
78619
  htmlToDoc: (html2) => {
78560
78620
  const doc2 = htmlToDocByMarkdown(html2, options);
@@ -79082,6 +79142,57 @@ ${docStr}
79082
79142
  }
79083
79143
  return null;
79084
79144
  }
79145
+ setTimeout(() => {
79146
+ const doc2 = htmlToDoc(`
79147
+ <p><cf-text>markdown \u8F6C\u4E49\uFF1A</cf-text></p>
79148
+ <p><cf-text>statement:
79149
+ ns_risefalltime v1=0.2f*vdd vh=0.8*fvdd tr=0.6n tf=0.6n file=./post_result_1224/tc2901_allmr_dc_ck_skew_3001200.output/time type=gate
79150
+ simulation:</cf-text></p>
79151
+ <p><cf-text>1, $abc$ , $a</cf-text></p>
79152
+ <div class="ones-code-card"><pre><code data-mode="manual" class="lang-java">&lt;
79153
+ &lt;p&gt;</code></pre></div>
79154
+ <p><cf-text>&lt;
79155
+ &lt;p>
79156
+ </cf-text></p>
79157
+ <p><cf-text>\u8BED\u6CD5\u89E3\u6790bug\uFF1A</cf-text></p>
79158
+ <p><cf-text>\u9700\u8981\u627E\u5230\u6B63\u786E\u7684\u5F00\u59CB\u548C\u7ED3\u675F\uFF1A</cf-text></p>
79159
+ <p><cf-text>imulation +</cf-text><u><cf-text>/- 3*gon- 3*global sigma, SS_global=T simulation+3*global sigma, tutlid, id_global= TT simulation*(1</cf-text></u><cf-text>/</cf-text><u><cf-text>- 3* global sigma), +for nmos vt, FF_global=T simulation*(1+3*global sigma), SS_global=T simulation *(1-3*global sigma)</cf-text></u></p>
79160
+ <p><cf-text>max(((rshO * 1r) + rend_calc) / (wr - dw)) * (1 + varn2*(v(plus, minus))</cf-text><strong><cf-text>(v(plus, minus))) * (1 + tcr1</cf-text></strong><cf-text>(pt - 25) + tor2*(pt - 25)*(pt - 25)), 1e-5)</cf-text></p>
79161
+ <p><cf-text>verification -> report -> OK -> next*6 -> start</cf-text></p>
79162
+ <p><cf-text>abc</cf-text></p>
79163
+ <p><cf-text>+ abc</cf-text></p>
79164
+ <p><cf-text>+ 0.01+(2*ldjskf+(2*bp) 0</cf-text></p>
79165
+ <p><cf-text>[a-zA-Z]</cf-text></p>
79166
+ <p><cf-text>\u5185\u5BB9\u4E3A\u7A7A\u7684\u8BED\u6CD5\uFF0C\u4E0D\u89E3\u6790\uFF0C\u5C55\u793A\u6587\u672C\uFF1A</cf-text></p>
79167
+ <p><cf-text>1 </cf-text><cf-text>\u2013</cf-text><cf-text>> abc </cf-text><cf-text>\u2013</cf-text><cf-text>> bcd</cf-text></p>
79168
+ <p><cf-text>!!abc</cf-text></p>
79169
+ <p><u><cf-text>br='5+dbr_bjt'+dbr_bjt=(1e-006) /l</cf-text></u><cf-text>(-2e-005)/w/nf)</cf-text><u><cf-text>(8e-11)/ ((w/nf)*(w/nf))</cf-text></u><cf-text>(1e-012)/ ((w/nf) *1)+(0)/(w/nf)/(w/nf)/l/l'</cf-text></p>
79170
+ <p><cf-text>\u8F6C\u6362\u5DEE\u5F02\uFF1A</cf-text></p>
79171
+ <p><cf-text>lfsrseed=</cf-text><cf-text>[1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31]</cf-text></p>
79172
+ <p><cf-text>*</cf-text></p>
79173
+ <p><cf-text>**</cf-text></p>
79174
+ <p><cf-text>***</cf-text></p>
79175
+ <ul>
79176
+ <li>
79177
+ <ul>
79178
+ <li>
79179
+ <ul>
79180
+ <li>
79181
+ <ul>
79182
+ <li><cf-text>abc ****</cf-text></li>
79183
+ </ul>
79184
+ </li>
79185
+ </ul>
79186
+ </li>
79187
+ </ul>
79188
+ </li>
79189
+ </ul>
79190
+ <p><cf-text>GVO- COM VO - VALUE = {IF(V(VIN, COM) &lt;V(VC-, COM), ((V(VC-, COM) -V(VIN, COM)) *G) , 0)}</cf-text></p>
79191
+ <p><cf-text>\u7279\u6B8A\u7A7A\u683C\uFF1A</cf-text></p>
79192
+ <p><cf-text>A B C\u3000D\u2002E\u2003F\u2009G\u200AH\u200BI J</cf-text></p>
79193
+ `);
79194
+ console.log(doc2);
79195
+ }, 1e3);
79085
79196
  class HtmlDataConverter {
79086
79197
  async fromData(editor, data2) {
79087
79198
  const result = {};
@@ -96777,7 +96888,7 @@ ${JSON.stringify(error2, null, 2)}`);
96777
96888
  }
96778
96889
  }
96779
96890
  });
96780
- editor.version = "3.0.9-beta.1";
96891
+ editor.version = "3.0.9-beta.3";
96781
96892
  return editor;
96782
96893
  }
96783
96894
  function isDoc(doc2) {
@@ -96911,7 +97022,7 @@ ${JSON.stringify(error2, null, 2)}`);
96911
97022
  OnesEditorDropTarget.register(editor);
96912
97023
  OnesEditorTocProvider.register(editor);
96913
97024
  OnesEditorExclusiveBlock.register(editor);
96914
- editor.version = "3.0.9-beta.1";
97025
+ editor.version = "3.0.9-beta.3";
96915
97026
  return editor;
96916
97027
  }
96917
97028
  async function showDocVersions(editor, options, serverUrl) {
@@ -97046,7 +97157,7 @@ ${JSON.stringify(error2, null, 2)}`);
97046
97157
  }
97047
97158
  }
97048
97159
  });
97049
- editor.version = "3.0.9-beta.1";
97160
+ editor.version = "3.0.9-beta.3";
97050
97161
  return editor;
97051
97162
  }
97052
97163
  const emojis$1 = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ones-editor/editor",
3
- "version": "3.0.9-beta.1",
3
+ "version": "3.0.9-beta.3",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "dependencies": {