@hufe921/canvas-editor 0.9.72 → 0.9.73

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.
@@ -23,7 +23,7 @@ var __publicField = (obj, key, value) => {
23
23
  return value;
24
24
  };
25
25
  var index = "";
26
- const version = "0.9.72";
26
+ const version = "0.9.73";
27
27
  var MaxHeightRatio;
28
28
  (function(MaxHeightRatio2) {
29
29
  MaxHeightRatio2["HALF"] = "half";
@@ -92,6 +92,8 @@ const SURROGATE_PAIR_REG = /[\uD800-\uDBFF][\uDC00-\uDFFF]/;
92
92
  const EMOJI_REG = /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
93
93
  const UNICODE_SYMBOL_REG = new RegExp(`${EMOJI_REG.source}|${SURROGATE_PAIR_REG.source}`, "g");
94
94
  const PUNCTUATION_REG = /[、,。?!;:……「」“”‘’*()【】〔〕〖〗〘〙〚〛《》———﹝﹞–—\\/·.,!?;:`~<>()[\]{}'"|]/;
95
+ const START_LINE_BREAK_REG = new RegExp(`^[${ZERO}
96
+ ]`);
95
97
  function debounce(func, delay) {
96
98
  let timer;
97
99
  return function(...args) {
@@ -3625,6 +3627,7 @@ var UlStyle;
3625
3627
  UlStyle2["DISC"] = "disc";
3626
3628
  UlStyle2["CIRCLE"] = "circle";
3627
3629
  UlStyle2["SQUARE"] = "square";
3630
+ UlStyle2["CHECKBOX"] = "checkbox";
3628
3631
  })(UlStyle || (UlStyle = {}));
3629
3632
  var OlStyle;
3630
3633
  (function(OlStyle2) {
@@ -3636,11 +3639,13 @@ var ListStyle;
3636
3639
  ListStyle2["CIRCLE"] = "circle";
3637
3640
  ListStyle2["SQUARE"] = "square";
3638
3641
  ListStyle2["DECIMAL"] = "decimal";
3642
+ ListStyle2["CHECKBOX"] = "checkbox";
3639
3643
  })(ListStyle || (ListStyle = {}));
3640
3644
  const ulStyleMapping = {
3641
3645
  [UlStyle.DISC]: "\u2022",
3642
3646
  [UlStyle.CIRCLE]: "\u25E6",
3643
- [UlStyle.SQUARE]: "\u25AB\uFE0E"
3647
+ [UlStyle.SQUARE]: "\u25AB\uFE0E",
3648
+ [UlStyle.CHECKBOX]: "\u2611\uFE0F"
3644
3649
  };
3645
3650
  const listTypeElementMapping = {
3646
3651
  [ListType.OL]: "ol",
@@ -3650,7 +3655,8 @@ const listStyleCSSMapping = {
3650
3655
  [ListStyle.DISC]: "disc",
3651
3656
  [ListStyle.CIRCLE]: "circle",
3652
3657
  [ListStyle.SQUARE]: "square",
3653
- [ListStyle.DECIMAL]: "decimal"
3658
+ [ListStyle.DECIMAL]: "decimal",
3659
+ [ListStyle.CHECKBOX]: "checkbox"
3654
3660
  };
3655
3661
  var TitleLevel;
3656
3662
  (function(TitleLevel2) {
@@ -3728,7 +3734,7 @@ function formatElementList(elementList, options) {
3728
3734
  isHandleFirstElement: true
3729
3735
  }, options);
3730
3736
  const startElement = elementList[0];
3731
- if (isHandleFirstElement && ((startElement == null ? void 0 : startElement.type) && startElement.type !== ElementType.TEXT || (startElement == null ? void 0 : startElement.value) !== ZERO && (startElement == null ? void 0 : startElement.value) !== "\n")) {
3737
+ if (isHandleFirstElement && (startElement == null ? void 0 : startElement.type) !== ElementType.LIST && ((startElement == null ? void 0 : startElement.type) && startElement.type !== ElementType.TEXT || !START_LINE_BREAK_REG.test(startElement == null ? void 0 : startElement.value))) {
3732
3738
  elementList.unshift({
3733
3739
  value: ZERO
3734
3740
  });
@@ -4025,56 +4031,60 @@ function zipElementList(payload) {
4025
4031
  let e = 0;
4026
4032
  while (e < elementList.length) {
4027
4033
  let element = elementList[e];
4028
- if (e === 0 && element.value === ZERO && (!element.type || element.type === ElementType.TEXT)) {
4034
+ if (e === 0 && element.value === ZERO && !element.listId && (!element.type || element.type === ElementType.TEXT)) {
4029
4035
  e++;
4030
4036
  continue;
4031
4037
  }
4032
4038
  if (element.titleId && element.level) {
4033
4039
  const titleId = element.titleId;
4034
- const level = element.level;
4035
- const titleElement = {
4036
- type: ElementType.TITLE,
4037
- value: "",
4038
- level
4039
- };
4040
- const valueList = [];
4041
- while (e < elementList.length) {
4042
- const titleE = elementList[e];
4043
- if (titleId !== titleE.titleId) {
4044
- e--;
4045
- break;
4040
+ if (titleId) {
4041
+ const level = element.level;
4042
+ const titleElement = {
4043
+ type: ElementType.TITLE,
4044
+ value: "",
4045
+ level
4046
+ };
4047
+ const valueList = [];
4048
+ while (e < elementList.length) {
4049
+ const titleE = elementList[e];
4050
+ if (titleId !== titleE.titleId) {
4051
+ e--;
4052
+ break;
4053
+ }
4054
+ delete titleE.level;
4055
+ valueList.push(titleE);
4056
+ e++;
4046
4057
  }
4047
- delete titleE.level;
4048
- valueList.push(titleE);
4049
- e++;
4058
+ titleElement.valueList = zipElementList(valueList);
4059
+ element = titleElement;
4050
4060
  }
4051
- titleElement.valueList = zipElementList(valueList);
4052
- element = titleElement;
4053
4061
  } else if (element.listId && element.listType) {
4054
4062
  const listId = element.listId;
4055
- const listType = element.listType;
4056
- const listStyle = element.listStyle;
4057
- const listElement = {
4058
- type: ElementType.LIST,
4059
- value: "",
4060
- listId,
4061
- listType,
4062
- listStyle
4063
- };
4064
- const valueList = [];
4065
- while (e < elementList.length) {
4066
- const listE = elementList[e];
4067
- if (listId !== listE.listId) {
4068
- e--;
4069
- break;
4063
+ if (listId) {
4064
+ const listType = element.listType;
4065
+ const listStyle = element.listStyle;
4066
+ const listElement = {
4067
+ type: ElementType.LIST,
4068
+ value: "",
4069
+ listId,
4070
+ listType,
4071
+ listStyle
4072
+ };
4073
+ const valueList = [];
4074
+ while (e < elementList.length) {
4075
+ const listE = elementList[e];
4076
+ if (listId !== listE.listId) {
4077
+ e--;
4078
+ break;
4079
+ }
4080
+ delete listE.listType;
4081
+ delete listE.listStyle;
4082
+ valueList.push(listE);
4083
+ e++;
4070
4084
  }
4071
- delete listE.listType;
4072
- delete listE.listStyle;
4073
- valueList.push(listE);
4074
- e++;
4085
+ listElement.valueList = zipElementList(valueList);
4086
+ element = listElement;
4075
4087
  }
4076
- listElement.valueList = zipElementList(valueList);
4077
- element = listElement;
4078
4088
  } else if (element.type === ElementType.TABLE) {
4079
4089
  if (element.pagingId) {
4080
4090
  let tableIndex = e + 1;
@@ -4115,70 +4125,76 @@ function zipElementList(payload) {
4115
4125
  }
4116
4126
  } else if (element.type === ElementType.HYPERLINK) {
4117
4127
  const hyperlinkId = element.hyperlinkId;
4118
- const hyperlinkElement = {
4119
- type: ElementType.HYPERLINK,
4120
- value: "",
4121
- url: element.url
4122
- };
4123
- const valueList = [];
4124
- while (e < elementList.length) {
4125
- const hyperlinkE = elementList[e];
4126
- if (hyperlinkId !== hyperlinkE.hyperlinkId) {
4127
- e--;
4128
- break;
4128
+ if (hyperlinkId) {
4129
+ const hyperlinkElement = {
4130
+ type: ElementType.HYPERLINK,
4131
+ value: "",
4132
+ url: element.url
4133
+ };
4134
+ const valueList = [];
4135
+ while (e < elementList.length) {
4136
+ const hyperlinkE = elementList[e];
4137
+ if (hyperlinkId !== hyperlinkE.hyperlinkId) {
4138
+ e--;
4139
+ break;
4140
+ }
4141
+ delete hyperlinkE.type;
4142
+ delete hyperlinkE.url;
4143
+ valueList.push(hyperlinkE);
4144
+ e++;
4129
4145
  }
4130
- delete hyperlinkE.type;
4131
- delete hyperlinkE.url;
4132
- valueList.push(hyperlinkE);
4133
- e++;
4146
+ hyperlinkElement.valueList = zipElementList(valueList);
4147
+ element = hyperlinkElement;
4134
4148
  }
4135
- hyperlinkElement.valueList = zipElementList(valueList);
4136
- element = hyperlinkElement;
4137
4149
  } else if (element.type === ElementType.DATE) {
4138
4150
  const dateId = element.dateId;
4139
- const dateElement = {
4140
- type: ElementType.DATE,
4141
- value: "",
4142
- dateFormat: element.dateFormat
4143
- };
4144
- const valueList = [];
4145
- while (e < elementList.length) {
4146
- const dateE = elementList[e];
4147
- if (dateId !== dateE.dateId) {
4148
- e--;
4149
- break;
4151
+ if (dateId) {
4152
+ const dateElement = {
4153
+ type: ElementType.DATE,
4154
+ value: "",
4155
+ dateFormat: element.dateFormat
4156
+ };
4157
+ const valueList = [];
4158
+ while (e < elementList.length) {
4159
+ const dateE = elementList[e];
4160
+ if (dateId !== dateE.dateId) {
4161
+ e--;
4162
+ break;
4163
+ }
4164
+ delete dateE.type;
4165
+ delete dateE.dateFormat;
4166
+ valueList.push(dateE);
4167
+ e++;
4150
4168
  }
4151
- delete dateE.type;
4152
- delete dateE.dateFormat;
4153
- valueList.push(dateE);
4154
- e++;
4169
+ dateElement.valueList = zipElementList(valueList);
4170
+ element = dateElement;
4155
4171
  }
4156
- dateElement.valueList = zipElementList(valueList);
4157
- element = dateElement;
4158
4172
  } else if (element.controlId) {
4159
4173
  const controlId = element.controlId;
4160
- const control = element.control;
4161
- const controlElement = {
4162
- type: ElementType.CONTROL,
4163
- value: "",
4164
- control
4165
- };
4166
- const valueList = [];
4167
- while (e < elementList.length) {
4168
- const controlE = elementList[e];
4169
- if (controlId !== controlE.controlId) {
4170
- e--;
4171
- break;
4172
- }
4173
- if (controlE.controlComponent === ControlComponent.VALUE) {
4174
- delete controlE.control;
4175
- delete controlE.controlId;
4176
- valueList.push(controlE);
4174
+ if (controlId) {
4175
+ const control = element.control;
4176
+ const controlElement = {
4177
+ type: ElementType.CONTROL,
4178
+ value: "",
4179
+ control
4180
+ };
4181
+ const valueList = [];
4182
+ while (e < elementList.length) {
4183
+ const controlE = elementList[e];
4184
+ if (controlId !== controlE.controlId) {
4185
+ e--;
4186
+ break;
4187
+ }
4188
+ if (controlE.controlComponent === ControlComponent.VALUE) {
4189
+ delete controlE.control;
4190
+ delete controlE.controlId;
4191
+ valueList.push(controlE);
4192
+ }
4193
+ e++;
4177
4194
  }
4178
- e++;
4195
+ controlElement.control.value = zipElementList(valueList);
4196
+ element = controlElement;
4179
4197
  }
4180
- controlElement.control.value = zipElementList(valueList);
4181
- element = controlElement;
4182
4198
  }
4183
4199
  const pickElement = pickElementAttr(element);
4184
4200
  if (!element.type || element.type === ElementType.TEXT || element.type === ElementType.SUBSCRIPT || element.type === ElementType.SUPERSCRIPT) {
@@ -4293,6 +4309,11 @@ function splitListElement(elementList) {
4293
4309
  const listElementListMap = new Map();
4294
4310
  for (let e = 0; e < elementList.length; e++) {
4295
4311
  const element = elementList[e];
4312
+ if (e === 0) {
4313
+ if (element.checkbox)
4314
+ continue;
4315
+ element.value = element.value.replace(START_LINE_BREAK_REG, "");
4316
+ }
4296
4317
  if (element.listWrap) {
4297
4318
  const listElementList = listElementListMap.get(curListIndex) || [];
4298
4319
  listElementList.push(element);
@@ -4675,6 +4696,8 @@ function getTextFromElementList(elementList) {
4675
4696
  ` : ``}`;
4676
4697
  }
4677
4698
  }
4699
+ } else if (element.type === ElementType.TAB) {
4700
+ text += ` `;
4678
4701
  } else if (element.type === ElementType.HYPERLINK) {
4679
4702
  text += element.valueList.map((v) => v.value).join("");
4680
4703
  } else if (element.type === ElementType.TITLE) {
@@ -4682,10 +4705,14 @@ function getTextFromElementList(elementList) {
4682
4705
  } else if (element.type === ElementType.LIST) {
4683
4706
  const zipList = zipElementList(element.valueList);
4684
4707
  const listElementListMap = splitListElement(zipList);
4708
+ let ulListStyleText = "";
4709
+ if (element.listType === ListType.UL) {
4710
+ ulListStyleText = ulStyleMapping[element.listStyle];
4711
+ }
4685
4712
  listElementListMap.forEach((listElementList, listIndex) => {
4686
4713
  const isLast = listElementListMap.size - 1 === listIndex;
4687
4714
  text += `
4688
- ${listIndex + 1}.${buildText(listElementList)}${isLast ? `
4715
+ ${ulListStyleText || `${listIndex + 1}.`}${buildText(listElementList)}${isLast ? `
4689
4716
  ` : ``}`;
4690
4717
  });
4691
4718
  } else if (element.type === ElementType.CHECKBOX) {
@@ -6684,34 +6711,44 @@ function drop(evt, host) {
6684
6711
  }
6685
6712
  }
6686
6713
  }
6687
- function dblclick(host, evt) {
6714
+ function getWordRangeBySegmenter(host) {
6715
+ var _a;
6716
+ if (!Intl.Segmenter)
6717
+ return null;
6688
6718
  const draw = host.getDraw();
6689
- const LETTER_REG = draw.getLetterReg();
6690
- const position = draw.getPosition();
6691
- const positionContext = position.getPositionByXY({
6692
- x: evt.offsetX,
6693
- y: evt.offsetY
6694
- });
6695
- if (positionContext.isImage && positionContext.isDirectHit) {
6696
- draw.getPreviewer().render();
6697
- return;
6698
- }
6699
- if (draw.getIsPagingMode()) {
6700
- if (!~positionContext.index && positionContext.zone) {
6701
- draw.getZone().setZone(positionContext.zone);
6702
- draw.clearSideEffect();
6703
- position.setPositionContext({
6704
- isTable: false
6705
- });
6706
- return;
6719
+ const cursorPosition = draw.getPosition().getCursorPosition();
6720
+ if (!cursorPosition)
6721
+ return null;
6722
+ const rangeManager = draw.getRange();
6723
+ const paragraphInfo = rangeManager.getRangeParagraphInfo();
6724
+ if (!paragraphInfo)
6725
+ return null;
6726
+ const paragraphText = ((_a = paragraphInfo == null ? void 0 : paragraphInfo.elementList) == null ? void 0 : _a.map((e) => !e.type || TEXTLIKE_ELEMENT_TYPE.includes(e.type) && e.controlComponent !== ControlComponent.CHECKBOX ? e.value : ZERO).join("")) || "";
6727
+ if (!paragraphText)
6728
+ return null;
6729
+ const cursorStartIndex = cursorPosition.index;
6730
+ const offset = paragraphInfo.startIndex;
6731
+ const segmenter = new Intl.Segmenter(void 0, { granularity: "word" });
6732
+ const segments = segmenter.segment(paragraphText);
6733
+ let startIndex = -1;
6734
+ let endIndex = -1;
6735
+ for (const { segment, index: index2, isWordLike } of segments) {
6736
+ const realSegmentStartIndex = index2 + offset;
6737
+ if (isWordLike && cursorStartIndex >= realSegmentStartIndex && cursorStartIndex < realSegmentStartIndex + segment.length) {
6738
+ startIndex = realSegmentStartIndex - 1;
6739
+ endIndex = startIndex + segment.length;
6740
+ break;
6707
6741
  }
6708
6742
  }
6709
- if (positionContext.isCheckbox && positionContext.isDirectHit)
6710
- return;
6711
- const cursorPosition = position.getCursorPosition();
6743
+ return ~startIndex && ~endIndex ? { startIndex, endIndex } : null;
6744
+ }
6745
+ function getWordRangeByCursor(host) {
6746
+ const draw = host.getDraw();
6747
+ const cursorPosition = draw.getPosition().getCursorPosition();
6712
6748
  if (!cursorPosition)
6713
- return;
6749
+ return null;
6714
6750
  const { value, index: index2 } = cursorPosition;
6751
+ const LETTER_REG = draw.getLetterReg();
6715
6752
  let upCount = 0;
6716
6753
  let downCount = 0;
6717
6754
  const isNumber = NUMBER_LIKE_REG.test(value);
@@ -6740,9 +6777,40 @@ function dblclick(host, evt) {
6740
6777
  }
6741
6778
  const startIndex = index2 - upCount - 1;
6742
6779
  if (startIndex < 0)
6780
+ return null;
6781
+ return {
6782
+ startIndex,
6783
+ endIndex: index2 + downCount
6784
+ };
6785
+ }
6786
+ function dblclick(host, evt) {
6787
+ const draw = host.getDraw();
6788
+ const position = draw.getPosition();
6789
+ const positionContext = position.getPositionByXY({
6790
+ x: evt.offsetX,
6791
+ y: evt.offsetY
6792
+ });
6793
+ if (positionContext.isImage && positionContext.isDirectHit) {
6794
+ draw.getPreviewer().render();
6795
+ return;
6796
+ }
6797
+ if (draw.getIsPagingMode()) {
6798
+ if (!~positionContext.index && positionContext.zone) {
6799
+ draw.getZone().setZone(positionContext.zone);
6800
+ draw.clearSideEffect();
6801
+ position.setPositionContext({
6802
+ isTable: false
6803
+ });
6804
+ return;
6805
+ }
6806
+ }
6807
+ if (positionContext.isCheckbox && positionContext.isDirectHit)
6743
6808
  return;
6744
6809
  const rangeManager = draw.getRange();
6745
- rangeManager.setRange(startIndex, index2 + downCount);
6810
+ const segmenterRange = getWordRangeBySegmenter(host) || getWordRangeByCursor(host);
6811
+ if (!segmenterRange)
6812
+ return;
6813
+ rangeManager.setRange(segmenterRange.startIndex, segmenterRange.endIndex);
6746
6814
  draw.render({
6747
6815
  isSubmitHistory: false,
6748
6816
  isSetCursor: false,
@@ -7434,6 +7502,8 @@ class Position {
7434
7502
  const { index: index2, pageNo, left: left2, isFirstLetter, coordinate: { leftTop, rightTop, leftBottom } } = positionList[j];
7435
7503
  if (positionNo !== pageNo)
7436
7504
  continue;
7505
+ if (pageNo > positionNo)
7506
+ break;
7437
7507
  if (leftTop[0] - left2 <= x && rightTop[0] >= x && leftTop[1] <= y && leftBottom[1] >= y) {
7438
7508
  let curPositionIndex2 = j;
7439
7509
  const element = elementList[j];
@@ -7456,7 +7526,7 @@ class Position {
7456
7526
  const tdValueElement = td.value[tdValueIndex];
7457
7527
  return {
7458
7528
  index: index2,
7459
- isCheckbox: tdValueElement.type === ElementType.CHECKBOX || tdValueElement.controlComponent === ControlComponent.CHECKBOX,
7529
+ isCheckbox: tablePosition.isCheckbox || tdValueElement.type === ElementType.CHECKBOX || tdValueElement.controlComponent === ControlComponent.CHECKBOX,
7460
7530
  isControl: !!tdValueElement.controlId,
7461
7531
  isImage: tablePosition.isImage,
7462
7532
  isDirectHit: tablePosition.isDirectHit,
@@ -7532,13 +7602,10 @@ class Position {
7532
7602
  }
7533
7603
  const lastLetterList = positionList.filter((p) => p.isLastLetter && p.pageNo === positionNo);
7534
7604
  for (let j = 0; j < lastLetterList.length; j++) {
7535
- const { index: index2, pageNo, coordinate: { leftTop, leftBottom } } = lastLetterList[j];
7536
- if (positionNo !== pageNo)
7537
- continue;
7605
+ const { index: index2, rowNo, coordinate: { leftTop, leftBottom } } = lastLetterList[j];
7538
7606
  if (y > leftTop[1] && y <= leftBottom[1]) {
7539
- const isHead = x < this.options.margins[3];
7540
- if (isHead) {
7541
- const headIndex = positionList.findIndex((p) => p.pageNo === positionNo && p.rowNo === lastLetterList[j].rowNo);
7607
+ const headIndex = positionList.findIndex((p) => p.pageNo === positionNo && p.rowNo === rowNo);
7608
+ if (x < this.options.margins[3]) {
7542
7609
  if (~headIndex) {
7543
7610
  if (positionList[headIndex].value === ZERO) {
7544
7611
  curPositionIndex = headIndex;
@@ -7550,6 +7617,13 @@ class Position {
7550
7617
  curPositionIndex = index2;
7551
7618
  }
7552
7619
  } else {
7620
+ if (elementList[headIndex].listStyle === ListStyle.CHECKBOX && x < leftTop[0]) {
7621
+ return {
7622
+ index: headIndex,
7623
+ isDirectHit: true,
7624
+ isCheckbox: true
7625
+ };
7626
+ }
7553
7627
  curPositionIndex = index2;
7554
7628
  }
7555
7629
  isLastArea = true;
@@ -7828,10 +7902,11 @@ class RangeManager {
7828
7902
  }
7829
7903
  return rangeRow;
7830
7904
  }
7831
- getRangeParagraphElementList() {
7905
+ getRangeParagraphInfo() {
7832
7906
  const { startIndex, endIndex } = this.range;
7833
7907
  if (!~startIndex && !~endIndex)
7834
7908
  return null;
7909
+ let startPositionIndex = -1;
7835
7910
  const rangeElementList = [];
7836
7911
  const rangeRow = this.getRangeParagraph();
7837
7912
  if (!rangeRow)
@@ -7844,10 +7919,22 @@ class RangeManager {
7844
7919
  if (!rowArray)
7845
7920
  continue;
7846
7921
  if (rowArray.includes(position.rowNo)) {
7922
+ if (!~startPositionIndex) {
7923
+ startPositionIndex = position.index;
7924
+ }
7847
7925
  rangeElementList.push(elementList[p]);
7848
7926
  }
7849
7927
  }
7850
- return rangeElementList;
7928
+ if (!rangeElementList.length)
7929
+ return null;
7930
+ return {
7931
+ elementList: rangeElementList,
7932
+ startIndex: startPositionIndex
7933
+ };
7934
+ }
7935
+ getRangeParagraphElementList() {
7936
+ var _a;
7937
+ return ((_a = this.getRangeParagraphInfo()) == null ? void 0 : _a.elementList) || null;
7851
7938
  }
7852
7939
  getIsSelectAll() {
7853
7940
  const elementList = this.draw.getElementList();
@@ -8045,9 +8132,9 @@ class RangeManager {
8045
8132
  this.eventBus.emit("rangeStyleChange", rangeStyle);
8046
8133
  }
8047
8134
  }
8048
- shrinkBoundary() {
8049
- const elementList = this.draw.getElementList();
8050
- const range = this.getRange();
8135
+ shrinkBoundary(context = {}) {
8136
+ const elementList = context.elementList || this.draw.getElementList();
8137
+ const range = context.range || this.getRange();
8051
8138
  const { startIndex, endIndex } = range;
8052
8139
  if (!~startIndex && !~endIndex)
8053
8140
  return;
@@ -9709,7 +9796,10 @@ class Header {
9709
9796
  }
9710
9797
  _computeRowList() {
9711
9798
  const innerWidth = this.draw.getInnerWidth();
9712
- this.rowList = this.draw.computeRowList(innerWidth, this.elementList);
9799
+ this.rowList = this.draw.computeRowList({
9800
+ innerWidth,
9801
+ elementList: this.elementList
9802
+ });
9713
9803
  }
9714
9804
  _computePositionList() {
9715
9805
  const headerTop = this.getHeaderTop();
@@ -10261,7 +10351,7 @@ class TextControl {
10261
10351
  }
10262
10352
  const elementList = context.elementList || this.control.getElementList();
10263
10353
  const range = context.range || this.control.getRange();
10264
- this.control.shrinkBoundary();
10354
+ this.control.shrinkBoundary(context);
10265
10355
  const { startIndex, endIndex } = range;
10266
10356
  const draw = this.control.getDraw();
10267
10357
  if (startIndex !== endIndex) {
@@ -10492,8 +10582,8 @@ class Control {
10492
10582
  getRange() {
10493
10583
  return this.range.getRange();
10494
10584
  }
10495
- shrinkBoundary() {
10496
- this.range.shrinkBoundary();
10585
+ shrinkBoundary(context = {}) {
10586
+ this.range.shrinkBoundary(context);
10497
10587
  }
10498
10588
  getActiveControl() {
10499
10589
  return this.activeControl;
@@ -12669,7 +12759,10 @@ class Footer {
12669
12759
  }
12670
12760
  _computeRowList() {
12671
12761
  const innerWidth = this.draw.getInnerWidth();
12672
- this.rowList = this.draw.computeRowList(innerWidth, this.elementList);
12762
+ this.rowList = this.draw.computeRowList({
12763
+ innerWidth,
12764
+ elementList: this.elementList
12765
+ });
12673
12766
  }
12674
12767
  _computePositionList() {
12675
12768
  const footerBottom = this.getFooterBottom();
@@ -12864,6 +12957,7 @@ class ListParticle {
12864
12957
  return Math.ceil((textMetrics.width + this.LIST_GAP) * scale);
12865
12958
  }
12866
12959
  drawListStyle(ctx, row, position) {
12960
+ var _a;
12867
12961
  const { elementList, offsetX, listIndex, ascent } = row;
12868
12962
  const startElement = elementList[0];
12869
12963
  if (startElement.value !== ZERO || startElement.listWrap)
@@ -12876,21 +12970,35 @@ class ListParticle {
12876
12970
  break;
12877
12971
  tabWidth += defaultTabWidth * scale;
12878
12972
  }
12879
- let text = "";
12880
- if (startElement.listType === ListType.UL) {
12881
- text = ulStyleMapping[startElement.listStyle] || ulStyleMapping[UlStyle.DISC];
12882
- } else {
12883
- text = `${listIndex + 1}${KeyMap.PERIOD}`;
12884
- }
12885
- if (!text)
12886
- return;
12887
12973
  const { coordinate: { leftTop: [startX, startY] } } = position;
12888
12974
  const x = startX - offsetX + tabWidth;
12889
12975
  const y = startY + ascent;
12890
- ctx.save();
12891
- ctx.font = `${defaultSize * scale}px ${defaultFont}`;
12892
- ctx.fillText(text, x, y);
12893
- ctx.restore();
12976
+ if (startElement.listStyle === ListStyle.CHECKBOX) {
12977
+ const { width, height, gap } = this.options.checkbox;
12978
+ const checkboxRowElement = __spreadProps(__spreadValues({}, startElement), {
12979
+ checkbox: {
12980
+ value: !!((_a = startElement.checkbox) == null ? void 0 : _a.value)
12981
+ },
12982
+ metrics: __spreadProps(__spreadValues({}, startElement.metrics), {
12983
+ width: (width + gap * 2) * scale,
12984
+ height: height * scale
12985
+ })
12986
+ });
12987
+ this.draw.getCheckboxParticle().render(ctx, checkboxRowElement, x - gap * scale, y);
12988
+ } else {
12989
+ let text = "";
12990
+ if (startElement.listType === ListType.UL) {
12991
+ text = ulStyleMapping[startElement.listStyle] || ulStyleMapping[UlStyle.DISC];
12992
+ } else {
12993
+ text = `${listIndex + 1}${KeyMap.PERIOD}`;
12994
+ }
12995
+ if (!text)
12996
+ return;
12997
+ ctx.save();
12998
+ ctx.font = `${defaultSize * scale}px ${defaultFont}`;
12999
+ ctx.fillText(text, x, y);
13000
+ ctx.restore();
13001
+ }
12894
13002
  }
12895
13003
  }
12896
13004
  class Placeholder {
@@ -12919,7 +13027,10 @@ class Placeholder {
12919
13027
  }
12920
13028
  _computeRowList() {
12921
13029
  const innerWidth = this.draw.getInnerWidth();
12922
- this.rowList = this.draw.computeRowList(innerWidth, this.elementList);
13030
+ this.rowList = this.draw.computeRowList({
13031
+ innerWidth,
13032
+ elementList: this.elementList
13033
+ });
12923
13034
  }
12924
13035
  _computePositionList() {
12925
13036
  const headerExtraHeight = this.draw.getHeader().getExtraHeight();
@@ -13947,8 +14058,9 @@ class Draw {
13947
14058
  getElementSize(el) {
13948
14059
  return el.actualSize || el.size || this.options.defaultSize;
13949
14060
  }
13950
- computeRowList(innerWidth, elementList) {
14061
+ computeRowList(payload) {
13951
14062
  var _a, _b, _c, _d, _e, _f, _g, _h;
14063
+ const { innerWidth, elementList, isPagingMode = false } = payload;
13952
14064
  const { defaultSize, defaultRowMargin, scale, tdPadding, defaultTabWidth } = this.options;
13953
14065
  const defaultBasicRowMarginHeight = this.getDefaultBasicRowMarginHeight();
13954
14066
  const canvas = document.createElement("canvas");
@@ -14032,7 +14144,11 @@ class Draw {
14032
14144
  const tr = trList[t];
14033
14145
  for (let d = 0; d < tr.tdList.length; d++) {
14034
14146
  const td = tr.tdList[d];
14035
- const rowList2 = this.computeRowList((td.width - tdPaddingWidth) * scale, td.value);
14147
+ const rowList2 = this.computeRowList({
14148
+ innerWidth: (td.width - tdPaddingWidth) * scale,
14149
+ elementList: td.value,
14150
+ isPagingMode
14151
+ });
14036
14152
  const rowHeight = rowList2.reduce((pre, cur) => pre + cur.height, 0);
14037
14153
  td.rowList = rowList2;
14038
14154
  const curTdHeight = rowHeight / scale + tdPaddingHeight;
@@ -14091,80 +14207,82 @@ class Draw {
14091
14207
  metrics.height = elementHeight;
14092
14208
  metrics.boundingBoxDescent = elementHeight;
14093
14209
  metrics.boundingBoxAscent = -rowMargin;
14094
- const height2 = this.getHeight();
14095
- const marginHeight = this.getMainOuterHeight();
14096
- let curPagePreHeight = marginHeight;
14097
- for (let r = 0; r < rowList.length; r++) {
14098
- const row = rowList[r];
14099
- if (row.height + curPagePreHeight > height2 || ((_c = rowList[r - 1]) == null ? void 0 : _c.isPageBreak)) {
14100
- curPagePreHeight = marginHeight + row.height;
14101
- } else {
14102
- curPagePreHeight += row.height;
14210
+ if (isPagingMode) {
14211
+ const height2 = this.getHeight();
14212
+ const marginHeight = this.getMainOuterHeight();
14213
+ let curPagePreHeight = marginHeight;
14214
+ for (let r = 0; r < rowList.length; r++) {
14215
+ const row = rowList[r];
14216
+ if (row.height + curPagePreHeight > height2 || ((_c = rowList[r - 1]) == null ? void 0 : _c.isPageBreak)) {
14217
+ curPagePreHeight = marginHeight + row.height;
14218
+ } else {
14219
+ curPagePreHeight += row.height;
14220
+ }
14103
14221
  }
14104
- }
14105
- const rowMarginHeight = rowMargin * 2 * scale;
14106
- if (curPagePreHeight + element.trList[0].height + rowMarginHeight > height2) {
14107
- curPagePreHeight = marginHeight;
14108
- }
14109
- if (curPagePreHeight + rowMarginHeight + elementHeight > height2) {
14110
- const trList2 = element.trList;
14111
- let deleteStart = 0;
14112
- let deleteCount = 0;
14113
- let preTrHeight = 0;
14114
- if (trList2.length > 1) {
14115
- for (let r = 0; r < trList2.length; r++) {
14116
- const tr = trList2[r];
14117
- const trHeight = tr.height * scale;
14118
- if (curPagePreHeight + rowMarginHeight + preTrHeight + trHeight > height2) {
14119
- const rowColCount = tr.tdList.reduce((pre, cur) => pre + cur.colspan, 0);
14120
- if (((_d = element.colgroup) == null ? void 0 : _d.length) !== rowColCount) {
14121
- deleteCount = 0;
14222
+ const rowMarginHeight = rowMargin * 2 * scale;
14223
+ if (curPagePreHeight + element.trList[0].height + rowMarginHeight > height2) {
14224
+ curPagePreHeight = marginHeight;
14225
+ }
14226
+ if (curPagePreHeight + rowMarginHeight + elementHeight > height2) {
14227
+ const trList2 = element.trList;
14228
+ let deleteStart = 0;
14229
+ let deleteCount = 0;
14230
+ let preTrHeight = 0;
14231
+ if (trList2.length > 1) {
14232
+ for (let r = 0; r < trList2.length; r++) {
14233
+ const tr = trList2[r];
14234
+ const trHeight = tr.height * scale;
14235
+ if (curPagePreHeight + rowMarginHeight + preTrHeight + trHeight > height2) {
14236
+ const rowColCount = tr.tdList.reduce((pre, cur) => pre + cur.colspan, 0);
14237
+ if (((_d = element.colgroup) == null ? void 0 : _d.length) !== rowColCount) {
14238
+ deleteCount = 0;
14239
+ }
14240
+ break;
14241
+ } else {
14242
+ deleteStart = r + 1;
14243
+ deleteCount = trList2.length - deleteStart;
14244
+ preTrHeight += trHeight;
14122
14245
  }
14123
- break;
14124
- } else {
14125
- deleteStart = r + 1;
14126
- deleteCount = trList2.length - deleteStart;
14127
- preTrHeight += trHeight;
14128
14246
  }
14129
14247
  }
14248
+ if (deleteCount) {
14249
+ const cloneTrList = trList2.splice(deleteStart, deleteCount);
14250
+ const cloneTrHeight = cloneTrList.reduce((pre, cur) => pre + cur.height, 0);
14251
+ const pagingId = element.pagingId || getUUID();
14252
+ element.pagingId = pagingId;
14253
+ element.height -= cloneTrHeight;
14254
+ metrics.height -= cloneTrHeight;
14255
+ metrics.boundingBoxDescent -= cloneTrHeight;
14256
+ const cloneElement = deepClone(element);
14257
+ cloneElement.pagingId = pagingId;
14258
+ cloneElement.trList = cloneTrList;
14259
+ cloneElement.id = getUUID();
14260
+ this.spliceElementList(elementList, i + 1, 0, cloneElement);
14261
+ }
14130
14262
  }
14131
- if (deleteCount) {
14132
- const cloneTrList = trList2.splice(deleteStart, deleteCount);
14133
- const cloneTrHeight = cloneTrList.reduce((pre, cur) => pre + cur.height, 0);
14134
- const pagingId = element.pagingId || getUUID();
14135
- element.pagingId = pagingId;
14136
- element.height -= cloneTrHeight;
14137
- metrics.height -= cloneTrHeight;
14138
- metrics.boundingBoxDescent -= cloneTrHeight;
14139
- const cloneElement = deepClone(element);
14140
- cloneElement.pagingId = pagingId;
14141
- cloneElement.trList = cloneTrList;
14142
- cloneElement.id = getUUID();
14143
- this.spliceElementList(elementList, i + 1, 0, cloneElement);
14144
- }
14145
- }
14146
- if (element.pagingId) {
14147
- const positionContext = this.position.getPositionContext();
14148
- if (positionContext.isTable) {
14149
- let newPositionContextIndex = -1;
14150
- let newPositionContextTrIndex = -1;
14151
- let tableIndex = i;
14152
- while (tableIndex < elementList.length) {
14153
- const curElement = elementList[tableIndex];
14154
- if (curElement.pagingId !== element.pagingId)
14155
- break;
14156
- const trIndex = curElement.trList.findIndex((r) => r.id === positionContext.trId);
14157
- if (~trIndex) {
14158
- newPositionContextIndex = tableIndex;
14159
- newPositionContextTrIndex = trIndex;
14160
- break;
14263
+ if (element.pagingId) {
14264
+ const positionContext = this.position.getPositionContext();
14265
+ if (positionContext.isTable) {
14266
+ let newPositionContextIndex = -1;
14267
+ let newPositionContextTrIndex = -1;
14268
+ let tableIndex = i;
14269
+ while (tableIndex < elementList.length) {
14270
+ const curElement = elementList[tableIndex];
14271
+ if (curElement.pagingId !== element.pagingId)
14272
+ break;
14273
+ const trIndex = curElement.trList.findIndex((r) => r.id === positionContext.trId);
14274
+ if (~trIndex) {
14275
+ newPositionContextIndex = tableIndex;
14276
+ newPositionContextTrIndex = trIndex;
14277
+ break;
14278
+ }
14279
+ tableIndex++;
14280
+ }
14281
+ if (~newPositionContextIndex) {
14282
+ positionContext.index = newPositionContextIndex;
14283
+ positionContext.trIndex = newPositionContextTrIndex;
14284
+ this.position.setPositionContext(positionContext);
14161
14285
  }
14162
- tableIndex++;
14163
- }
14164
- if (~newPositionContextIndex) {
14165
- positionContext.index = newPositionContextIndex;
14166
- positionContext.trIndex = newPositionContextTrIndex;
14167
- this.position.setPositionContext(positionContext);
14168
14286
  }
14169
14287
  }
14170
14288
  }
@@ -14682,7 +14800,11 @@ class Draw {
14682
14800
  this.footer.compute();
14683
14801
  }
14684
14802
  }
14685
- this.rowList = this.computeRowList(innerWidth, this.elementList);
14803
+ this.rowList = this.computeRowList({
14804
+ isPagingMode,
14805
+ innerWidth,
14806
+ elementList: this.elementList
14807
+ });
14686
14808
  this.pageRowList = this._computePageList();
14687
14809
  this.position.computePositionList();
14688
14810
  const searchKeyword = this.search.getSearchKeyword();