@sw7d/paper-renderer 0.1.3 → 0.1.5

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.
@@ -449,53 +449,53 @@ function ue(e, t, n, r, i, a, o, s) {
449
449
  return c += de(t, i, n, l, o, s), l += 30, c += fe(e, r, l, s), l += 40, c += pe(e, l, a), c;
450
450
  }
451
451
  function de(e, t, n, r, i, a) {
452
- let o = i && n > 0 ? `满分: ${n} 分` : "", s = o ? `<span class="score" data-region="score">${V(o)}</span>` : "", { contentWidth: c, contentX: l } = e, u = a === "edit";
453
- return ` <foreignObject class="header-block header-block--school-info" transform="translate(${l}, ${r})" width="${c}" height="30" data-region="header-desc" opacity="1">
454
- <div class="header-school-info">
455
- <div contenteditable="${u ? "true" : "false"}" class="headerDesc${u ? " editable-dashed" : ""}" data-editable="schoolName">${V(t)}</div>
452
+ let o = i && n > 0 ? `满分: ${n} 分` : "", s = o ? `<span class="swed-score" data-region="score">${V(o)}</span>` : "", { contentWidth: c, contentX: l } = e, u = a === "edit";
453
+ return ` <foreignObject class="swed-header-block swed-header-block--school-info" transform="translate(${l}, ${r})" width="${c}" height="30" data-region="header-desc" opacity="1">
454
+ <div class="swed-header-school-info">
455
+ <div contenteditable="${u ? "true" : "false"}" class="swed-headerDesc${u ? " swed-editable-dashed" : ""}" data-editable="schoolName">${V(t)}</div>
456
456
  ${s}
457
457
  </div>
458
458
  </foreignObject>\n`;
459
459
  }
460
460
  function fe(e, t, n, r) {
461
461
  let { contentWidth: i, contentX: a } = e, o = r === "edit";
462
- return ` <foreignObject class="header-block header-block--paper-name" transform="translate(${a}, ${n})" width="${i}" height="40" data-region="paper-name" opacity="1">
463
- <div class="header-paper-name">
464
- <div class="input-box">
465
- <label class="input-box__label">${V(t)}</label>
466
- <div class="input-box__input textarea${o ? " editable-dashed" : ""}" id="paperName" contenteditable="${o ? "true" : "false"}" data-editable="paperName">${V(t)}</div>
462
+ return ` <foreignObject class="swed-header-block swed-header-block--paper-name" transform="translate(${a}, ${n})" width="${i}" height="40" data-region="paper-name" opacity="1">
463
+ <div class="swed-header-paper-name">
464
+ <div class="swed-input-box">
465
+ <label class="swed-input-box__label">${V(t)}</label>
466
+ <div class="swed-input-box__input swed-textarea${o ? " swed-editable-dashed" : ""}" id="paperName" contenteditable="${o ? "true" : "false"}" data-editable="paperName">${V(t)}</div>
467
467
  </div>
468
468
  </div>
469
469
  </foreignObject>\n`;
470
470
  }
471
471
  function pe(e, t, n) {
472
472
  let { contentWidth: r, contentX: i } = e;
473
- return ` <foreignObject class="header-block header-block--student-info" transform="translate(${i}, ${t})" width="${r}" height="100" opacity="1">
474
- <div class="header-student-info">
475
- <div answer-sheet-edit-personal-element="qrCode" class="qr-code-img" data-region="qr-code">
473
+ return ` <foreignObject class="swed-header-block swed-header-block--student-info" transform="translate(${i}, ${t})" width="${r}" height="100" opacity="1">
474
+ <div class="swed-header-student-info">
475
+ <div answer-sheet-edit-personal-element="qrCode" class="swed-qr-code-img" data-region="qr-code">
476
476
  <img src="${n || "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Crect width='60' height='60' fill='%23ddd'/%3E%3Ctext x='30' y='35' text-anchor='middle' font-size='10' fill='%23999'%3EQR%3C/text%3E%3C/svg%3E"}" style="width:65px;height:65px;" />
477
477
  </div>
478
- <div class="student-fields">
479
- <div class="student-fields-row">
480
- <div class="student-field" data-region="student-name"><span class="label">姓名:</span><div class="underline studentName"></div></div>
481
- <div class="student-field" data-region="student-class"><span class="label">班级:</span><div class="underline clazzName"></div></div>
478
+ <div class="swed-student-fields">
479
+ <div class="swed-student-fields-row">
480
+ <div class="swed-student-field" data-region="student-name"><span class="swed-label">姓名:</span><div class="swed-underline swed-studentName"></div></div>
481
+ <div class="swed-student-field" data-region="student-class"><span class="swed-label">班级:</span><div class="swed-underline swed-clazzName"></div></div>
482
482
  </div>
483
- <div class="student-code" data-region="student-code">准考证号: <table student-code-num="8" class="answer-sheet-hand-student-code student-code-table studyNo"><tbody><tr>${"<td class=\"student-code-cell\"></td>".repeat(8)}</tr></tbody></table></div>
483
+ <div class="swed-student-code" data-region="student-code">准考证号: <table student-code-num="8" class="swed-student-code-table studyNo"><tbody><tr>${"<td class=\"swed-student-code-cell\"></td>".repeat(8)}</tr></tbody></table></div>
484
484
  </div>
485
485
  </div>
486
486
  </foreignObject>\n`;
487
487
  }
488
488
  function me(e, t, n, r, i) {
489
- let a = r && t > 0 ? `满分: ${t} 分` : "", o = a ? `<span class="score" data-region="score">${V(a)}</span>` : "", { contentWidth: s, contentX: c } = e, l = i === "edit";
490
- return ` <foreignObject class="header-block header-block--school-info" transform="translate(${c}, 0)" width="${s}" height="30" opacity="1">
491
- <div class="header-school-info header-school-info--simple">
492
- <div contenteditable="${l ? "true" : "false"}" class="headerDesc${l ? " editable-dashed" : ""}" data-editable="schoolName" data-region="header-desc">${V(n)}</div>
489
+ let a = r && t > 0 ? `满分: ${t} 分` : "", o = a ? `<span class="swed-score" data-region="score">${V(a)}</span>` : "", { contentWidth: s, contentX: c } = e, l = i === "edit";
490
+ return ` <foreignObject class="swed-header-block swed-header-block--school-info" transform="translate(${c}, 0)" width="${s}" height="30" opacity="1">
491
+ <div class="swed-header-school-info swed-header-school-info--simple">
492
+ <div contenteditable="${l ? "true" : "false"}" class="swed-headerDesc${l ? " swed-editable-dashed" : ""}" data-editable="schoolName" data-region="header-desc">${V(n)}</div>
493
493
  ${o}
494
494
  </div>
495
495
  </foreignObject>\n`;
496
496
  }
497
497
  function he() {
498
- return " <foreignObject class=\"vueplug\" transform=\"translate(0, 0)\" width=\"681\" height=\"50\">\n <div class=\"tail-time-wrapper\">\n <div class=\"answer-wrapper\" style=\"display:none;\">\n <div class=\"tail-col\"><p class=\"text\">作答时长</p><p class=\"text text-second\">请在框内填涂</p></div>\n <div class=\"tail-col center-col\">\n <i class=\"el-icon tail-label triangle\"><svg viewBox=\"0 0 1024 1024\" xmlns=\"http://www.w3.org/2000/svg\" style=\"width:14px;height:14px;\"><path fill=\"currentColor\" d=\"M384 192v640l384-320.064z\"></path></svg></i>\n <div class=\"rect rect-fill text-second\"></div>\n </div>\n <div class=\"tail-col center-col tail-col-item\"><p class=\"tail-label text\">10分钟以内</p><div class=\"rect rect-stroke text-second tail-time\" time=\"0\"></div></div>\n <div class=\"tail-col center-col tail-col-item\"><p class=\"tail-label text\">10-20分钟</p><div class=\"rect rect-stroke text-second tail-time\" time=\"10\"></div></div>\n <div class=\"tail-col center-col tail-col-item\"><p class=\"tail-label text\">20-30分钟</p><div class=\"rect rect-stroke text-second tail-time\" time=\"20\"></div></div>\n <div class=\"tail-col center-col tail-col-item\"><p class=\"tail-label text\">&gt;30分钟</p><div class=\"rect rect-stroke text-second tail-time\" time=\"30\"></div></div>\n </div>\n <div class=\"tail-col revise-wrapper\" style=\"display:none;\">\n <p class=\"text\">订正情况</p>\n <i class=\"el-icon triangle\" style=\"font-size:14px;margin:0 8px;\"><svg viewBox=\"0 0 1024 1024\" xmlns=\"http://www.w3.org/2000/svg\" style=\"width:14px;height:14px;\"><path fill=\"currentColor\" d=\"M384 192v640l384-320.064z\"></path></svg></i>\n <div class=\"revise-area center-col\"><p class=\"revise-area-label\">已订正</p><div class=\"revise-area-rect\"></div></div>\n </div>\n </div>\n </foreignObject>\n";
498
+ return " <foreignObject class=\"swed-vueplug\" transform=\"translate(0, 0)\" width=\"681\" height=\"50\">\n <div class=\"swed-tail-time-wrapper\">\n <div class=\"swed-answer-wrapper\" style=\"display:none;\">\n <div class=\"swed-tail-col\"><p class=\"swed-text\">作答时长</p><p class=\"swed-text swed-text-second\">请在框内填涂</p></div>\n <div class=\"swed-tail-col swed-center-col\">\n <i class=\"swed-el-icon swed-tail-label swed-triangle\"><svg viewBox=\"0 0 1024 1024\" xmlns=\"http://www.w3.org/2000/svg\" style=\"width:14px;height:14px;\"><path fill=\"currentColor\" d=\"M384 192v640l384-320.064z\"></path></svg></i>\n <div class=\"swed-rect swed-rect-fill swed-text-second\"></div>\n </div>\n <div class=\"swed-tail-col swed-center-col swed-tail-col-item\"><p class=\"swed-tail-label swed-text\">10分钟以内</p><div class=\"swed-rect swed-rect-stroke swed-text-second swed-tail-time\" time=\"0\"></div></div>\n <div class=\"swed-tail-col swed-center-col swed-tail-col-item\"><p class=\"swed-tail-label swed-text\">10-20分钟</p><div class=\"swed-rect swed-rect-stroke swed-text-second swed-tail-time\" time=\"10\"></div></div>\n <div class=\"swed-tail-col swed-center-col swed-tail-col-item\"><p class=\"swed-tail-label swed-text\">20-30分钟</p><div class=\"swed-rect swed-rect-stroke swed-text-second swed-tail-time\" time=\"20\"></div></div>\n <div class=\"swed-tail-col swed-center-col swed-tail-col-item\"><p class=\"swed-tail-label swed-text\">&gt;30分钟</p><div class=\"swed-rect swed-rect-stroke swed-text-second swed-tail-time\" time=\"30\"></div></div>\n </div>\n <div class=\"swed-tail-col swed-revise-wrapper\" style=\"display:none;\">\n <p class=\"swed-text\">订正情况</p>\n <i class=\"swed-el-icon swed-triangle\" style=\"font-size:14px;margin:0 8px;\"><svg viewBox=\"0 0 1024 1024\" xmlns=\"http://www.w3.org/2000/svg\" style=\"width:14px;height:14px;\"><path fill=\"currentColor\" d=\"M384 192v640l384-320.064z\"></path></svg></i>\n <div class=\"swed-revise-area swed-center-col\"><p class=\"swed-revise-area-label\">已订正</p><div class=\"swed-revise-area-rect\"></div></div>\n </div>\n </div>\n </foreignObject>\n";
499
499
  }
500
500
  function ge() {
501
501
  return "<defs>\n<polygon id=\"break\" fill=\"#6B8AB8\" points=\"12 0 12 60 0 52 15.5 90 30 52 18 60 18 0\"></polygon>\n<polygon id=\"enter\" fill=\"#6B8AB8\" points=\"44 0 52 0 52 45 16 45 29 62 25.5 66 0 41 25.5 17 29 20.5 16 37 44 37\"></polygon>\n</defs>\n";
@@ -503,16 +503,16 @@ function ge() {
503
503
  //#endregion
504
504
  //#region src/engine/svg/optionsRenderer.ts
505
505
  function H(e, t, n, r, i) {
506
- let a = t - 20, o = ` <g class="option" transform="translate(0, ${n})">\n`, s = e.map((e) => _e(e, 20, a)), c = e.map((e) => e.paragraphs.reduce((e, t) => e + (t.height || 26), 0)), l = 0, u = 0, d = 0, f = 0;
506
+ let a = t - 20, o = ` <g class="swed-option" transform="translate(0, ${n})">\n`, s = e.map((e) => _e(e, 20, a)), c = e.map((e) => e.paragraphs.reduce((e, t) => e + (t.height || 26), 0)), l = 0, u = 0, d = 0, f = 0;
507
507
  for (let n = 0; n < e.length; n++) {
508
508
  let p = s[n], m = c[n];
509
509
  if (l > 0) {
510
510
  let e = n - f, r = t - s.slice(f, n).reduce((e, t) => e + t, 0) - p, i = e > 0 ? Math.max(8, r / e) : 8;
511
511
  l + p + i > t && (l = 0, u += d, d = 0, f = n);
512
512
  }
513
- o += ` <g class="option-item" transform="translate(${l}, ${u})">\n`;
513
+ o += ` <g class="swed-option-item" transform="translate(${l}, ${u})">\n`;
514
514
  let h = e[n].paragraphs[0]?.lines[0]?.baseline || r * 1.56;
515
- o += ` <text class="text" xml:space="preserve" font-size="${r}" font-weight="normal" font-family="Times New Roman" font-style="normal" fill="#000000" fill-opacity="1" y="${h.toFixed(3)}">${V(e[n].label)}.</text>\n`, o += " <g>\n";
515
+ o += ` <text class="swed-text" xml:space="preserve" font-size="${r}" font-weight="normal" font-family="Times New Roman" font-style="normal" fill="#000000" fill-opacity="1" y="${h.toFixed(3)}">${V(e[n].label)}.</text>\n`, o += " <g>\n";
516
516
  let g = 0;
517
517
  for (let t of e[n].paragraphs) o += xe(t, a, g, !1, "", r, i, 20), g += t.height || 26;
518
518
  o += " </g>\n", o += " </g>\n";
@@ -551,7 +551,7 @@ function ve(e, t) {
551
551
  }
552
552
  function ye(e, t, n, r, i, a, o, s, c, l) {
553
553
  let u = t.metadata?.topicId || t.id, d = e.width || 333.5, f = e.height || 100, p = "";
554
- r && (p += ` <rect x="0.5" y="${n - .5}" width="${d}" height="${f}" fill="none" stroke="rgba(85,165,255,0.4)" stroke-width="0.5" stroke-dasharray="4,4" />\n`), i && l === "edit" && (p += ` <rect x="0" y="${n - 1}" width="${d + 2}" height="${f + 2}" fill="none" stroke="#409eff" stroke-width="1.5" rx="2" />\n`), p += ` <g class="question" transform="translate(0, ${n})" topicid="${u}" data-block-id="${t.id}">\n`;
554
+ r && (p += ` <rect x="0.5" y="${n - .5}" width="${d}" height="${f}" fill="none" stroke="rgba(85,165,255,0.4)" stroke-width="0.5" stroke-dasharray="4,4" />\n`), i && l === "edit" && (p += ` <rect x="0" y="${n - 1}" width="${d + 2}" height="${f + 2}" fill="none" stroke="#409eff" stroke-width="1.5" rx="2" />\n`), p += ` <g class="swed-question" transform="translate(0, ${n})" topicid="${u}" data-block-id="${t.id}">\n`;
555
555
  let m = t.type === "question" && t.metadata?.questionNo || "", h = t.paragraphs[0]?.lines[0], g = h ? ve(h, s) : 20, _ = 0;
556
556
  t.type === "question" ? _ = m.length > 2 ? 26.25 : 17.5 : t.type === "sub-question" && (_ = 26.25);
557
557
  let v = e.paragraphStart, y = Math.min(v + e.paragraphCount, t.paragraphs.length), b = 0;
@@ -562,7 +562,7 @@ function ye(e, t, n, r, i, a, o, s, c, l) {
562
562
  let x = 0;
563
563
  t.options && t.options.length > 0 && o && (x = U(t.options, d - _), b += x);
564
564
  let S = Math.max(b, e.height), C = (t.type === "question" || t.type === "sub-question") && e.paragraphCount > 0;
565
- C && l === "edit" && (p += ` <rect class="question-hitarea" x="0" y="0" width="${d}" height="${S}" fill="transparent" />\n`), p += " <g>\n", p += ` <g class="question-stem" transform="translate(${_}, 0)">\n`;
565
+ C && l === "edit" && (p += ` <rect class="swed-question-hitarea" x="0" y="0" width="${d}" height="${S}" fill="transparent" />\n`), p += " <g>\n", p += ` <g class="swed-question-stem" transform="translate(${_}, 0)">\n`;
566
566
  let w = a && c && t.metadata?.score || "", T = 0, E = !1;
567
567
  for (let e = v; e < y; e++) {
568
568
  let n = t.paragraphs[e], r = !(n.lines.length > 0 && n.lines.every((e) => e.elements.length > 0 && e.elements.every((e) => e.type === "enter"))) && !E;
@@ -572,13 +572,13 @@ function ye(e, t, n, r, i, a, o, s, c, l) {
572
572
  let e = d - _;
573
573
  p += H(t.options, e, T, s, l), T += x;
574
574
  }
575
- if (p += " </g>\n", p += " </g>\n", C && l === "edit" && (p += ` <path class="question-border" d="M 0.5 0 L ${d - .5} 0 L ${d - .5} ${S} L 0.5 ${S} Z" stroke="#231815" stroke-dasharray="2,5" transform="translate(0.5, 0)" stroke-width="0.5" fill="none" pointer-events="none"></path>\n`), a) {
575
+ if (p += " </g>\n", p += " </g>\n", C && l === "edit" && (p += ` <path class="swed-question-border" d="M 0.5 0 L ${d - .5} 0 L ${d - .5} ${S} L 0.5 ${S} Z" stroke="#231815" stroke-dasharray="2,5" transform="translate(0.5, 0)" stroke-width="0.5" fill="none" pointer-events="none"></path>\n`), a) {
576
576
  if (m) {
577
577
  let e = m.length > 2;
578
- p += ` <text class="topic-no" font-size="14" font-weight="normal" font-family="SimSun,STSong" font-style="normal" fill="#000000" fill-opacity="1" transform="translate(0, ${g.toFixed(2)})" x="4">${V(m)}</text>\n`, e ? p += ` <text class="topic-no" font-size="14" font-weight="normal" font-family="SimSun,STSong" font-style="normal" fill="#000000" fill-opacity="1" transform="translate(20.25, ${g.toFixed(2)})"></text>\n` : p += ` <text class="topic-no" font-size="14" font-weight="normal" font-family="SimSun,STSong" font-style="normal" fill="#000000" fill-opacity="1" transform="translate(11.5, ${g.toFixed(2)})"></text>\n`;
578
+ p += ` <text class="swed-topic-no" font-size="14" font-weight="normal" font-family="SimSun,STSong" font-style="normal" fill="#000000" fill-opacity="1" transform="translate(0, ${g.toFixed(2)})" x="4">${V(m)}</text>\n`, e ? p += ` <text class="swed-topic-no" font-size="14" font-weight="normal" font-family="SimSun,STSong" font-style="normal" fill="#000000" fill-opacity="1" transform="translate(20.25, ${g.toFixed(2)})"></text>\n` : p += ` <text class="swed-topic-no" font-size="14" font-weight="normal" font-family="SimSun,STSong" font-style="normal" fill="#000000" fill-opacity="1" transform="translate(11.5, ${g.toFixed(2)})"></text>\n`;
579
579
  }
580
580
  let e = t.metadata?.subLabel || "";
581
- e && (p += ` <text class="topic-no" font-size="14" font-weight="normal" font-family="SimSun,STSong" font-style="normal" fill="#000000" fill-opacity="1" transform="translate(4, ${g.toFixed(2)})">${V(e)}</text>\n`, p += ` <text class="topic-no" font-size="14" font-weight="normal" font-family="SimSun,STSong" font-style="normal" fill="#000000" fill-opacity="1" transform="translate(20.25, ${g.toFixed(2)})"></text>\n`);
581
+ e && (p += ` <text class="swed-topic-no" font-size="14" font-weight="normal" font-family="SimSun,STSong" font-style="normal" fill="#000000" fill-opacity="1" transform="translate(4, ${g.toFixed(2)})">${V(e)}</text>\n`, p += ` <text class="swed-topic-no" font-size="14" font-weight="normal" font-family="SimSun,STSong" font-style="normal" fill="#000000" fill-opacity="1" transform="translate(20.25, ${g.toFixed(2)})"></text>\n`);
582
582
  }
583
583
  return p += " </g>\n", p;
584
584
  }
@@ -586,10 +586,10 @@ function be(e, t, n, r = 0, i = !0, a = !1, o = "edit") {
586
586
  let s = e.metadata?.label || "", c = e.height || 40;
587
587
  if (!s) return "";
588
588
  let l = i && e.metadata?.score || "", u = "";
589
- return a && o === "edit" && (u += ` <rect x="${r}" y="${t}" width="${n.toFixed(1)}" height="${c}" fill="none" stroke="#409eff" stroke-width="1.5" rx="2" />\n`), u += ` <foreignObject class="vueplug" data-block-id="${e.id}" transform="translate(${r}, ${t})" width="${n.toFixed(1)}" height="${c}" rendered="true" opacity="1">\n <div class="title_wrapper" topictitle="${V(s)}" topicgroupinfo="">
590
- <div class="title-content">
591
- <span class="title-text">${V(s)}</span>
592
- ${l ? `<span class="title-score">(${V(l)})</span>` : ""}
589
+ return a && o === "edit" && (u += ` <rect x="${r}" y="${t}" width="${n.toFixed(1)}" height="${c}" fill="none" stroke="#409eff" stroke-width="1.5" rx="2" />\n`), u += ` <foreignObject class="swed-vueplug" data-block-id="${e.id}" transform="translate(${r}, ${t})" width="${n.toFixed(1)}" height="${c}" rendered="true" opacity="1">\n <div class="swed-title_wrapper" topictitle="${V(s)}" topicgroupinfo="">
590
+ <div class="swed-title-content">
591
+ <span class="swed-title-text">${V(s)}</span>
592
+ ${l ? `<span class="swed-title-score">(${V(l)})</span>` : ""}
593
593
  </div>
594
594
  </div>
595
595
  </foreignObject>\n`, u;
@@ -598,16 +598,16 @@ function xe(e, t, n, r, i = "", a, o, s = 0) {
598
598
  let c = "", l = 0;
599
599
  for (let n = 0; n < e.lines.length; n++) {
600
600
  let s = e.lines[n], u = ve(s, a), d = r && n === 0, f = s.elements.length > 0 && s.elements.every((e) => e.type === "enter"), p = s.lineHeight;
601
- c += ` <g class="line" transform="translate(0, ${l})" baseline="${u.toFixed(2)}">\n`;
601
+ c += ` <g class="swed-line" transform="translate(0, ${l})" baseline="${u.toFixed(2)}">\n`;
602
602
  let m = 0;
603
603
  if (d && i) {
604
604
  let e = `(${i}分)`, t = u - a;
605
- c += ` <text class="question-score" font-size="${a}" font-weight="normal" font-family="SimSun, STSong, serif" font-style="normal" fill="#000000" fill-opacity="1" transform="translate(0, ${t.toFixed(2)})" y="${a}">${V(e)}</text>\n`, m += se(e, a, "SimSun, STSong, serif");
605
+ c += ` <text class="swed-question-score" font-size="${a}" font-weight="normal" font-family="SimSun, STSong, serif" font-style="normal" fill="#000000" fill-opacity="1" transform="translate(0, ${t.toFixed(2)})" y="${a}">${V(e)}</text>\n`, m += se(e, a, "SimSun, STSong, serif");
606
606
  }
607
607
  if (f) {
608
608
  if (o === "edit") {
609
609
  let e = p.toFixed(1);
610
- c += ` <line x1="0" y1="${e}" x2="${t.toFixed(2)}" y2="${e}" stroke="#d9d9d9" stroke-width="0.5" stroke-dasharray="4,4" opacity="0.5"></line>\n`, c += ` <g class="enter" transform="translate(2, ${(u - 10).toFixed(2)})">\n`, c += " <use href=\"#enter\" transform=\"scale(0.013)\" fill=\"#c8c8c8\" opacity=\"0.5\"></use>\n", c += " </g>\n";
610
+ c += ` <line x1="0" y1="${e}" x2="${t.toFixed(2)}" y2="${e}" stroke="#d9d9d9" stroke-width="0.5" stroke-dasharray="4,4" opacity="0.5"></line>\n`, c += ` <g class="swed-enter" transform="translate(2, ${(u - 10).toFixed(2)})">\n`, c += " <use href=\"#enter\" transform=\"scale(0.013)\" fill=\"#c8c8c8\" opacity=\"0.5\"></use>\n", c += " </g>\n";
611
611
  }
612
612
  } else {
613
613
  let r = 0;
@@ -619,12 +619,12 @@ function xe(e, t, n, r, i = "", a, o, s = 0) {
619
619
  for (let e of s.elements) c += Se(e, m + r + (s.offsetX || 0), u, s.lineHeight, f, o, e.type === "image" ? e.id : void 0, e.type === "image" ? i : void 0), m += e.width;
620
620
  if (o === "edit" && n === e.lines.length - 1) {
621
621
  let e = m + r + (s.offsetX || 0) + 2;
622
- c += ` <g class="enter" transform="translate(${e.toFixed(2)}, ${(u - 10).toFixed(2)})">\n`, c += " <use href=\"#enter\" transform=\"scale(0.013)\" fill=\"#c8c8c8\" opacity=\"0.5\"></use>\n", c += " </g>\n";
622
+ c += ` <g class="swed-enter" transform="translate(${e.toFixed(2)}, ${(u - 10).toFixed(2)})">\n`, c += " <use href=\"#enter\" transform=\"scale(0.013)\" fill=\"#c8c8c8\" opacity=\"0.5\"></use>\n", c += " </g>\n";
623
623
  }
624
624
  }
625
625
  c += ` <line x1="0" y1="${p.toFixed(2)}" x2="${t.toFixed(2)}" y2="${p.toFixed(2)}" style="fill:#000;stroke-width:1;stroke:#000;" opacity="0"></line>\n`, c += " </g>\n", l += p;
626
626
  }
627
- return ` <g class="paragraph" transform="translate(${s}, ${n})">\n${c} </g>\n`;
627
+ return ` <g class="swed-paragraph" transform="translate(${s}, ${n})">\n${c} </g>\n`;
628
628
  }
629
629
  function Se(e, t, n, r, i, a, o, s) {
630
630
  switch (e.type) {
@@ -635,7 +635,7 @@ function Se(e, t, n, r, i, a, o, s) {
635
635
  l += ` <rect x="${t.toFixed(2)}" y="${e.toFixed(2)}" width="${r.width.toFixed(2)}" height="${n.toFixed(2)}" fill="${r.backgroundColor}" fill-opacity="0.3"></rect>\n`;
636
636
  }
637
637
  let u = r.italic ? -r.fontSize * .02 : 0, d = r.fontFamily ? V(r.fontFamily) : "&quot;Times New Roman&quot;, SimSun";
638
- if (l += ` <text class="text" xml:space="preserve" font-size="${r.fontSize}" font-weight="${a}" font-family="${d}" font-style="${i}" fill="${r.color}" fill-opacity="1" x="${c}" y="${(o + u).toFixed(2)}" dominant-baseline="hanging">${V(r.value)}</text>\n`, r.dotAbove) {
638
+ if (l += ` <text class="swed-text" xml:space="preserve" font-size="${r.fontSize}" font-weight="${a}" font-family="${d}" font-style="${i}" fill="${r.color}" fill-opacity="1" x="${c}" y="${(o + u).toFixed(2)}" dominant-baseline="hanging">${V(r.value)}</text>\n`, r.dotAbove) {
639
639
  let e = Math.max(1.5, r.fontSize * .1), n = o + r.fontSize * .9 + e;
640
640
  for (let i = 0; i < s.length; i++) {
641
641
  let a = r.xPositions.length === s.length ? r.xPositions[i] + t + z(s[i], r.fontSize, r.fontFamily, r.bold, r.italic) / 2 : t + i * r.fontSize * .6 + r.fontSize * .3;
@@ -662,32 +662,32 @@ function Se(e, t, n, r, i, a, o, s) {
662
662
  }
663
663
  case "formula": {
664
664
  let r = e, i = r.svgContent.match(/vertical-align:\s*([-\d.]+)ex/), a = i ? parseFloat(i[1]) * 7 : -(r.height || 20), o = Math.round(n + a);
665
- return ` <g class="formula" transform="translate(${t.toFixed(2)}, ${o})">\n${r.svgContent} </g>\n`;
665
+ return ` <g class="swed-formula" transform="translate(${t.toFixed(2)}, ${o})">\n${r.svgContent} </g>\n`;
666
666
  }
667
667
  case "underline": {
668
- let r = e, i = (n - 30 / 2).toFixed(2), o = 30 .toFixed(2), s = r.topicId ? ` topicid="${r.topicId}" real-index="${r.realIndex ?? 0}" id="${r.topicId}-${r.realIndex ?? 0}"` : "", c = r.id ? ` data-underline-id="${r.id}"` : "", l = r.blankType ? ` data-blank-type="${r.blankType}"` : "", u = a === "edit" ? `<rect class="underline-hitarea" x="0" y="0" width="${r.width.toFixed(2)}" height="30" fill="transparent" opacity="0"></rect>\n` : "";
668
+ let r = e, i = (n - 30 / 2).toFixed(2), o = 30 .toFixed(2), s = r.topicId ? ` topicid="${r.topicId}" real-index="${r.realIndex ?? 0}" id="${r.topicId}-${r.realIndex ?? 0}"` : "", c = r.id ? ` data-underline-id="${r.id}"` : "", l = r.blankType ? ` data-blank-type="${r.blankType}"` : "", u = a === "edit" ? `<rect class="swed-underline-hitarea" x="0" y="0" width="${r.width.toFixed(2)}" height="30" fill="transparent" opacity="0"></rect>\n` : "";
669
669
  if ((r.isEmpty || r.blankType) && !r.isSplitPart) {
670
670
  let e = (42 / 2).toFixed(2), n = a === "edit" ? `<rect x="0" y="0" width="${r.width.toFixed(2)}" height="30" fill="rgb(245,245,245)" opacity="1"></rect>\n` : "", d = a === "edit" ? `<text font-size="12" text-anchor="middle" font-family="'Times New Roman',SimSun,STSong" fill="#aaa" fill-opacity="1" x="${(r.width / 2).toFixed(2)}" y="${e}">${V(r.placeholder)}</text>\n` : "";
671
- return ` <g class="underline" transform="translate(${t.toFixed(2)}, ${i})"${s}${c}${l}>\n ${u} ${n} ${d} <line x1="2" y1="${o}" x2="${(r.width - 2).toFixed(2)}" y2="${o}" style="stroke:#000;stroke-width:0.7"></line>\n </g>\n`;
671
+ return ` <g class="swed-underline" transform="translate(${t.toFixed(2)}, ${i})"${s}${c}${l}>\n ${u} ${n} ${d} <line x1="2" y1="${o}" x2="${(r.width - 2).toFixed(2)}" y2="${o}" style="stroke:#000;stroke-width:0.7"></line>\n </g>\n`;
672
672
  }
673
673
  if (r.isSplitPart && (r.isEmpty || r.blankType) && a === "edit") {
674
674
  let e = `<rect x="0" y="0" width="${r.width.toFixed(2)}" height="30" fill="rgb(245,245,245)" opacity="0.6"></rect>\n`;
675
- return ` <g class="underline" transform="translate(${t.toFixed(2)}, ${i})"${s}${c}${l}>\n ${u} ${e} <line x1="2" y1="${o}" x2="${(r.width - 2).toFixed(2)}" y2="${o}" style="stroke:#000;stroke-width:${r.lineWidth}"></line>\n </g>\n`;
675
+ return ` <g class="swed-underline" transform="translate(${t.toFixed(2)}, ${i})"${s}${c}${l}>\n ${u} ${e} <line x1="2" y1="${o}" x2="${(r.width - 2).toFixed(2)}" y2="${o}" style="stroke:#000;stroke-width:${r.lineWidth}"></line>\n </g>\n`;
676
676
  }
677
- return ` <g class="underline" transform="translate(${t.toFixed(2)}, ${i})"${s}${c}${l}>\n ${u} <line x1="2" y1="${o}" x2="${(r.width - 2).toFixed(2)}" y2="${o}" style="stroke:#000;stroke-width:${r.lineWidth}"></line>\n </g>\n`;
677
+ return ` <g class="swed-underline" transform="translate(${t.toFixed(2)}, ${i})"${s}${c}${l}>\n ${u} <line x1="2" y1="${o}" x2="${(r.width - 2).toFixed(2)}" y2="${o}" style="stroke:#000;stroke-width:${r.lineWidth}"></line>\n </g>\n`;
678
678
  }
679
679
  case "image": {
680
680
  let r = e;
681
681
  if (r.rawHtml && !r.src) {
682
682
  let e = o ? ` data-image-id="${o}"` : "", i = (r.width / 2).toFixed(2), a = (r.height / 2).toFixed(2), c = s ? "0" : (n - r.height / 2).toFixed(2);
683
- return ` <g class="image image-placeholder" transform="translate(${t.toFixed(2)}, ${c})"${e}>\n <rect x="0" y="0" width="${r.width}" height="${r.height}" fill="#f5f5f5" stroke="#999" stroke-width="1" stroke-dasharray="4,3" rx="4" ry="4" />\n <text x="${i}" y="${a}" text-anchor="middle" dominant-baseline="central" font-size="13" fill="#999">[表格加载中…]</text>\n </g>\n`;
683
+ return ` <g class="swed-image swed-image-placeholder" transform="translate(${t.toFixed(2)}, ${c})"${e}>\n <rect x="0" y="0" width="${r.width}" height="${r.height}" fill="#f5f5f5" stroke="#999" stroke-width="1" stroke-dasharray="4,3" rx="4" ry="4" />\n <text x="${i}" y="${a}" text-anchor="middle" dominant-baseline="central" font-size="13" fill="#999">[表格加载中…]</text>\n </g>\n`;
684
684
  }
685
685
  let i = s ? "0" : (n - r.height / 2).toFixed(2), c = o ? ` data-image-id="${o}"` : "", l = a === "edit" ? " style=\"cursor:move\"" : "";
686
- return ` <g class="image" transform="translate(${t.toFixed(2)}, ${i})"${c}${l}>\n <image href="${r.src}" width="${r.width}" height="${r.height}" preserveAspectRatio="xMidYMid meet" />\n </g>\n`;
686
+ return ` <g class="swed-image" transform="translate(${t.toFixed(2)}, ${i})"${c}${l}>\n <image href="${r.src}" width="${r.width}" height="${r.height}" preserveAspectRatio="xMidYMid meet" />\n </g>\n`;
687
687
  }
688
688
  case "enter": {
689
689
  let r = e, i = .013;
690
- return r.isLineBreak ? ` <g class="enter" transform="translate(${t.toFixed(2)}, ${(n - 12 + 2).toFixed(2)})">\n <use href="#enter" transform="scale(${i.toFixed(3)})" fill="#bfbfbf" opacity="0.4"></use>\n </g>\n` : ` <g class="enter" transform="translate(${t.toFixed(2)}, ${(n - 12 + 2).toFixed(2)})">\n <use href="#enter" transform="scale(${i.toFixed(3)})" fill="#c8c8c8" opacity="0.5"></use>\n </g>\n`;
690
+ return r.isLineBreak ? ` <g class="swed-enter" transform="translate(${t.toFixed(2)}, ${(n - 12 + 2).toFixed(2)})">\n <use href="#enter" transform="scale(${i.toFixed(3)})" fill="#bfbfbf" opacity="0.4"></use>\n </g>\n` : ` <g class="swed-enter" transform="translate(${t.toFixed(2)}, ${(n - 12 + 2).toFixed(2)})">\n <use href="#enter" transform="scale(${i.toFixed(3)})" fill="#c8c8c8" opacity="0.5"></use>\n </g>\n`;
691
691
  }
692
692
  default: return "";
693
693
  }
@@ -738,7 +738,7 @@ var Ce = class {
738
738
  f += ge();
739
739
  for (let r = 0; r < e.length; r++) {
740
740
  let l = e[r], d = r % 2 == 0 ? n.bodyTopEven ?? 173 : n.bodyTopOdd ?? 50, p = r * u;
741
- f += `<g class="page" transform="translate(0, ${p})">\n`, f += this.renderPageContent(l, t, d, n, r, e.length, {
741
+ f += `<g class="swed-page" transform="translate(0, ${p})">\n`, f += this.renderPageContent(l, t, d, n, r, e.length, {
742
742
  showBBoxes: i,
743
743
  selectedBlockId: a,
744
744
  totalScore: o,
@@ -887,17 +887,17 @@ var Ce = class {
887
887
  56,
888
888
  56
889
889
  ], d = u, f = c, p = e.width - d - f, m = r.columnGap ?? 15.5, h = r.columns || 1, g = h > 1 ? (p - m * (h - 1)) / h : p, _ = e.height - l - this.FOOTER_EXTRA_GAP, v = r.fontSize, y = typeof v == "number" ? v : 14, b = "";
890
- b += " <g class=\"background\"></g>\n";
890
+ b += " <g class=\"swed-background\"></g>\n";
891
891
  let x = this.computeHeaderLayout(r, e), S = {
892
892
  mode: "portrait",
893
893
  contentWidth: p,
894
894
  contentX: 0
895
895
  };
896
- b += ` <g class="header" transform="translate(${d}, ${r.headerTop ?? 18})">\n`, b += " <g class=\"header-content\"></g>\n", b += " <g class=\"header-embeds\">\n", i % 2 == 0 ? b += ue(x, S, o.totalScore ?? 0, o.paperName || "", o.schoolName || "", o.qrCodeImage || "", r.showScore ?? !0, this.renderMode) : b += me(S, o.totalScore ?? 0, o.schoolName || "", r.showScore ?? !0, this.renderMode), b += " </g>\n", b += " </g>\n", b += ` <g class="footer" transform="translate(${d}, ${_.toFixed(2)})">\n`, b += " <g class=\"footer-content\">\n", b += " <g class=\"anchor\" transform=\"translate(0, 0)\"></g>\n", b += " <g class=\"paragraph\" transform=\"translate(0, 0)\">\n", b += " <g class=\"line\" transform=\"translate(0, 0)\" baseline=\"19.6\">\n";
896
+ b += ` <g class="swed-header" transform="translate(${d}, ${r.headerTop ?? 18})">\n`, b += " <g class=\"swed-header-content\"></g>\n", b += " <g class=\"swed-header-embeds\">\n", i % 2 == 0 ? b += ue(x, S, o.totalScore ?? 0, o.paperName || "", o.schoolName || "", o.qrCodeImage || "", r.showScore ?? !0, this.renderMode) : b += me(S, o.totalScore ?? 0, o.schoolName || "", r.showScore ?? !0, this.renderMode), b += " </g>\n", b += " </g>\n", b += ` <g class="swed-footer" transform="translate(${d}, ${_.toFixed(2)})">\n`, b += " <g class=\"swed-footer-content\">\n", b += " <g class=\"swed-anchor\" transform=\"translate(0, 0)\"></g>\n", b += " <g class=\"swed-paragraph\" transform=\"translate(0, 0)\">\n", b += " <g class=\"swed-line\" transform=\"translate(0, 0)\" baseline=\"19.6\">\n";
897
897
  let C = `${i + 1}/${a}`, w = p / 2 - C.length * 6, T = C.split("").map((e, t) => (w + t * 12).toFixed(2)).join(" ");
898
- b += ` <text class="text" data-region="page-number" xml:space="preserve" font-size="12" font-weight="bold" font-family="&quot;Times New Roman&quot;, SimSun,'Cambria Math'" font-style="normal" fill="#898989" fill-opacity="1" x="${T}" y="19.6">${V(C)}</text>\n`, b += ` <line x1="0" y1="28.2" x2="${p.toFixed(2)}" y2="28.2" style="fill:#000;stroke-width:1;stroke:#000;" opacity="0"></line>\n`, b += " </g>\n", b += " </g>\n", b += " </g>\n", b += " <g class=\"footer-embeds\">\n", b += he(), b += " </g>\n", b += " </g>\n", b += " <g class=\"layout\">\n";
898
+ b += ` <text class="swed-text" data-region="page-number" xml:space="preserve" font-size="12" font-weight="bold" font-family="&quot;Times New Roman&quot;, SimSun,'Cambria Math'" font-style="normal" fill="#898989" fill-opacity="1" x="${T}" y="19.6">${V(C)}</text>\n`, b += ` <line x1="0" y1="28.2" x2="${p.toFixed(2)}" y2="28.2" style="fill:#000;stroke-width:1;stroke:#000;" opacity="0"></line>\n`, b += " </g>\n", b += " </g>\n", b += " </g>\n", b += " <g class=\"swed-footer-embeds\">\n", b += he(), b += " </g>\n", b += " </g>\n", b += " <g class=\"swed-layout\">\n";
899
899
  for (let t of e.cornerMarks) b += this.renderCornerMark(t);
900
- b += " </g>\n", b += ` <g class="body" transform="translate(${d}, ${n})">\n`, b += " <g class=\"content\">\n", b += " <g class=\"column\" transform=\"translate(0, 0)\">\n";
900
+ b += " </g>\n", b += ` <g class="swed-body" transform="translate(${d}, ${n})">\n`, b += " <g class=\"swed-content\">\n", b += " <g class=\"swed-column\" transform=\"translate(0, 0)\">\n";
901
901
  let E = this.groupBlocksByColumn(e.blocks);
902
902
  for (let e = 0; e < E.length; e++) {
903
903
  let n = E[e][0], i = n ? n.x : e === 0 ? 0 : g + m;
@@ -2330,7 +2330,7 @@ function gt(e) {
2330
2330
  //#region src/utils/questionHtmlParser.ts
2331
2331
  var _t = 0, vt = 0, yt = 0, bt = .5;
2332
2332
  function xt(e, t = {}) {
2333
- let { questionNo: n = "", score: r = "", contentWidth: i = 600, fontSize: a = 14, lineSpacing: o = 1.5, skipAnswerArea: s = !1 } = t, c = new DOMParser().parseFromString(e, "text/html"), l = [], u = Math.round(a * o * 1.67), d = n.length > 2 ? 26.25 : 17.5, f = new Set([
2333
+ let { questionNo: n = "", score: r = "", contentWidth: i = 600, fontSize: a = 14, lineSpacing: o = 1.5, skipAnswerArea: s = !1, protectContent: c = !1 } = t, l = new DOMParser().parseFromString(e, "text/html"), u = [], d = Math.round(a * o * 1.67), f = n.length > 2 ? 26.25 : 17.5, p = new Set([
2334
2334
  "p",
2335
2335
  "h1",
2336
2336
  "h2",
@@ -2343,13 +2343,13 @@ function xt(e, t = {}) {
2343
2343
  "ul",
2344
2344
  "div"
2345
2345
  ]);
2346
- for (let e = 0; e < c.body.childNodes.length; e++) {
2347
- let t = c.body.childNodes[e];
2346
+ for (let e = 0; e < l.body.childNodes.length; e++) {
2347
+ let t = l.body.childNodes[e];
2348
2348
  if (t.nodeType !== Node.ELEMENT_NODE) continue;
2349
2349
  let n = t, r = n.tagName.toLowerCase();
2350
2350
  if (r === "table") {
2351
- let e = jt(n, i, u), t = e.reduce((e, t) => e + t.lineHeight, 0) + 4;
2352
- l.push({
2351
+ let e = jt(n, i, d), t = e.reduce((e, t) => e + t.lineHeight, 0) + 4;
2352
+ u.push({
2353
2353
  lines: e,
2354
2354
  y: 0,
2355
2355
  height: t
@@ -2359,8 +2359,8 @@ function xt(e, t = {}) {
2359
2359
  if (r === "figure") {
2360
2360
  let e = n.querySelector("table");
2361
2361
  if (e) {
2362
- let t = jt(e, i, u), n = t.reduce((e, t) => e + t.lineHeight, 0) + 4;
2363
- l.push({
2362
+ let t = jt(e, i, d), n = t.reduce((e, t) => e + t.lineHeight, 0) + 4;
2363
+ u.push({
2364
2364
  lines: t,
2365
2365
  y: 0,
2366
2366
  height: n
@@ -2368,42 +2368,42 @@ function xt(e, t = {}) {
2368
2368
  }
2369
2369
  continue;
2370
2370
  }
2371
- if (!f.has(r)) continue;
2372
- let o = n, s = o.getAttribute("style") || "", p = J(o, a, s, i, d);
2373
- if (p.length === 0) continue;
2374
- let m = it(p, i, u), h = m.reduce((e, t) => e + t.lineHeight, 0) + 4, g = wt(s), _ = g === "center" ? "center" : g === "right" ? "right" : void 0;
2375
- l.push({
2371
+ if (!p.has(r)) continue;
2372
+ let o = n, s = o.getAttribute("style") || "", c = J(o, a, s, i, f);
2373
+ if (c.length === 0) continue;
2374
+ let m = it(c, i, d), h = m.reduce((e, t) => e + t.lineHeight, 0) + 4, g = wt(s), _ = g === "center" ? "center" : g === "right" ? "right" : void 0;
2375
+ u.push({
2376
2376
  lines: m,
2377
2377
  y: 0,
2378
2378
  height: h,
2379
2379
  justification: _
2380
2380
  });
2381
2381
  }
2382
- if (!s) for (let e = 0; e < 2; e++) l.push({
2382
+ if (!s) for (let e = 0; e < 2; e++) u.push({
2383
2383
  lines: [{
2384
2384
  elements: [{
2385
2385
  type: "enter",
2386
2386
  width: 20,
2387
2387
  height: 20
2388
2388
  }],
2389
- baseline: u * .5,
2390
- lineHeight: u,
2389
+ baseline: d * .5,
2390
+ lineHeight: d,
2391
2391
  y: 0
2392
2392
  }],
2393
2393
  y: 0,
2394
- height: u + 4
2394
+ height: d + 4
2395
2395
  });
2396
- let p = l.reduce((e, t) => e + (t.height || 26), 0), m = `topic-html-${++vt}`;
2396
+ let m = u.reduce((e, t) => e + (t.height || 26), 0), h = `topic-html-${++vt}`;
2397
2397
  return [{
2398
2398
  id: `q-html-${Date.now()}-${Math.random().toString(36).slice(2, 6)}`,
2399
2399
  type: "question",
2400
- paragraphs: l,
2401
- height: p,
2402
- protectContent: !0,
2400
+ paragraphs: u,
2401
+ height: m,
2402
+ protectContent: c,
2403
2403
  metadata: {
2404
2404
  questionNo: n,
2405
2405
  score: r,
2406
- topicId: m,
2406
+ topicId: h,
2407
2407
  originalContentWidth: i,
2408
2408
  label: n ? `第${n}题` : "导入题目"
2409
2409
  }
@@ -2705,35 +2705,36 @@ function jt(e, t, n) {
2705
2705
  //#endregion
2706
2706
  //#region src/utils/questionJsonParser.ts
2707
2707
  function Mt(e, t = {}) {
2708
- let { questionNo: n = "", score: r = "", contentWidth: i = 600, fontSize: a = 14, lineSpacing: o = 1.5 } = t, s = e.extra_json?.quest_type || "answer_question", c = s === "single_chose" || s === "multi_chose", l = Math.round(a * o * 1.67), u = xt(e.question, {
2708
+ let { questionNo: n = "", score: r = "", contentWidth: i = 600, fontSize: a = 14, lineSpacing: o = 1.5, protectContent: s = !1 } = t, c = e.extra_json?.quest_type || "answer_question", l = c === "single_chose" || c === "multi_chose", u = Math.round(a * o * 1.67), d = xt(e.question, {
2709
2709
  questionNo: n,
2710
2710
  score: r,
2711
2711
  contentWidth: i,
2712
2712
  fontSize: a,
2713
2713
  lineSpacing: o,
2714
- skipAnswerArea: !0
2714
+ skipAnswerArea: !0,
2715
+ protectContent: s
2715
2716
  });
2716
- if (u.length === 0) return [];
2717
- let d = u[0], f = {
2718
- id: d.id,
2717
+ if (d.length === 0) return [];
2718
+ let f = d[0], p = {
2719
+ id: f.id,
2719
2720
  type: "question",
2720
- paragraphs: [...d.paragraphs],
2721
+ paragraphs: [...f.paragraphs],
2721
2722
  height: 0,
2722
- protectContent: !0,
2723
- questionType: s,
2723
+ protectContent: s,
2724
+ questionType: c,
2724
2725
  metadata: {
2725
- ...d.metadata,
2726
+ ...f.metadata,
2726
2727
  qid: e.qid,
2727
- questType: s,
2728
+ questType: c,
2728
2729
  answer: e.extra_json?.answer || e.answer || "",
2729
2730
  rawOptions: e.extra_json?.options,
2730
2731
  tenantId: e.tenant_id,
2731
2732
  tags: e.tags
2732
2733
  }
2733
2734
  };
2734
- if (c && e.extra_json?.options && e.extra_json.options.length > 0) f.options = Nt(e.extra_json.options, i, a, o), f.paragraphs.push(Pt(l));
2735
- else for (let e = 0; e < 2; e++) f.paragraphs.push(Pt(l));
2736
- return f.height = f.paragraphs.reduce((e, t) => e + (t.height || 26), 0), [f];
2735
+ if (l && e.extra_json?.options && e.extra_json.options.length > 0) p.options = Nt(e.extra_json.options, i, a, o), p.paragraphs.push(Pt(u));
2736
+ else for (let e = 0; e < 2; e++) p.paragraphs.push(Pt(u));
2737
+ return p.height = p.paragraphs.reduce((e, t) => e + (t.height || 26), 0), [p];
2737
2738
  }
2738
2739
  function Nt(e, t, n, r) {
2739
2740
  let i = Math.max(100, t - 20);
@@ -4616,57 +4617,57 @@ function kn(e, t, n, r, i) {
4616
4617
  xPositions: o
4617
4618
  };
4618
4619
  }
4619
- function An(e, t, n, r, i, a) {
4620
- let o = [];
4620
+ function An(e, t, n, r, i, a, o = !1) {
4621
+ let s = [];
4621
4622
  for (let e = 0; e < n.length; e++) {
4622
4623
  let t = On(n[e], r);
4623
- o.push(xn(t, r, i, a && a > 0 ? a : void 0));
4624
+ s.push(xn(t, r, i, a && a > 0 ? a : void 0));
4624
4625
  }
4625
- for (let e = 0; e < 2; e++) o.push($(r, i));
4626
- let s = o.reduce((e, t) => e + (t.height || 26), 0), c = `topic-${e.replace(".", "")}-${++Cn}`;
4626
+ for (let e = 0; e < 2; e++) s.push($(r, i));
4627
+ let c = s.reduce((e, t) => e + (t.height || 26), 0), l = `topic-${e.replace(".", "")}-${++Cn}`;
4627
4628
  return {
4628
4629
  id: `q-${e.replace(".", "")}-${Date.now()}-${Math.random().toString(36).slice(2, 6)}`,
4629
4630
  type: "question",
4630
- paragraphs: o,
4631
- height: s,
4632
- protectContent: !0,
4631
+ paragraphs: s,
4632
+ height: c,
4633
+ protectContent: o,
4633
4634
  metadata: {
4634
4635
  questionNo: e,
4635
4636
  score: t,
4636
- topicId: c,
4637
+ topicId: l,
4637
4638
  originalContentWidth: a || 0,
4638
4639
  label: `第${e.replace(".", "")}题`
4639
4640
  }
4640
4641
  };
4641
4642
  }
4642
- function jn(e, t, n, r, i, a) {
4643
- let o = [], s = `group-${e.replace(".", "")}`, c = [], l = 0, u = (n, l) => {
4644
- if (c.length === 0) return;
4645
- let u = c.map((e) => xn(On(e, r), r, i, a && a > 0 ? a : void 0));
4646
- if (!n) for (let e = 0; e < 2; e++) u.push($(r, i));
4647
- let d = u.reduce((e, t) => e + (t.height || 26), 0), f = `${s}-${n ? "header" : `sub${l}`}`;
4648
- o.push({
4649
- id: `${f}-${Date.now()}-${Math.random().toString(36).slice(2, 6)}`,
4643
+ function jn(e, t, n, r, i, a, o = !1) {
4644
+ let s = [], c = `group-${e.replace(".", "")}`, l = [], u = 0, d = (n, u) => {
4645
+ if (l.length === 0) return;
4646
+ let d = l.map((e) => xn(On(e, r), r, i, a && a > 0 ? a : void 0));
4647
+ if (!n) for (let e = 0; e < 2; e++) d.push($(r, i));
4648
+ let f = d.reduce((e, t) => e + (t.height || 26), 0), p = `${c}-${n ? "header" : `sub${u}`}`;
4649
+ s.push({
4650
+ id: `${p}-${Date.now()}-${Math.random().toString(36).slice(2, 6)}`,
4650
4651
  type: n ? "question" : "sub-question",
4651
- paragraphs: u,
4652
- height: d,
4653
- protectContent: !0,
4652
+ paragraphs: d,
4653
+ height: f,
4654
+ protectContent: o,
4654
4655
  metadata: {
4655
4656
  questionNo: n ? e : "",
4656
4657
  score: n ? "" : t,
4657
- topicId: f,
4658
- blockGroup: s,
4658
+ topicId: p,
4659
+ blockGroup: c,
4659
4660
  originalContentWidth: a || 0,
4660
- subLabel: n ? "" : `(${l})`,
4661
- label: n ? `第${e.replace(".", "")}题` : `子题(${l})`
4661
+ subLabel: n ? "" : `(${u})`,
4662
+ label: n ? `第${e.replace(".", "")}题` : `子题(${u})`
4662
4663
  }
4663
- }), c = [];
4664
+ }), l = [];
4664
4665
  };
4665
4666
  for (let e of n) {
4666
4667
  let t = e.match(/^\((\d+)\)\s*/);
4667
- t ? (u(o.length === 0, l), l = parseInt(t[1]), c.push(e.substring(t[0].length))) : c.push(e);
4668
+ t ? (d(s.length === 0, u), u = parseInt(t[1]), l.push(e.substring(t[0].length))) : l.push(e);
4668
4669
  }
4669
- return u(o.length === 0, l), o;
4670
+ return d(s.length === 0, u), s;
4670
4671
  }
4671
4672
  function Mn(e) {
4672
4673
  let t = [];
@@ -4951,45 +4952,47 @@ function Pn(e) {
4951
4952
  function N(e, t) {
4952
4953
  A(e, { metadata: { title: t } }), M(), i.value = !0, h();
4953
4954
  }
4954
- function P(e) {
4955
- let r = e.content.split("\n").filter((e) => e.trim());
4956
- r.length === 0 && r.push("");
4957
- let o = e.score ? `(${e.score}分)` : "", s = r.some((e) => /^\(\d+\)\s*/.test(e)), c = Z(n.value), l = Q(n.value), u = a.value.columnWidth, d;
4958
- if (s) d = jn(e.no, o, r, c, l, u - 26.25);
4955
+ function P(e, r = !1) {
4956
+ let o = e.content.split("\n").filter((e) => e.trim());
4957
+ o.length === 0 && o.push("");
4958
+ let s = e.score ? `(${e.score}分)` : "", c = o.some((e) => /^\(\d+\)\s*/.test(e)), l = Z(n.value), u = Q(n.value), d = a.value.columnWidth, p;
4959
+ if (c) p = jn(e.no, s, o, l, u, d - 26.25, r);
4959
4960
  else {
4960
4961
  let t = e.no.length > 2 ? 26.25 : 17.5;
4961
- d = [An(e.no, o, r, c, l, u - t)];
4962
+ p = [An(e.no, s, o, l, u, d - t, r)];
4962
4963
  }
4963
- for (let e of d) t.value = [...t.value, e];
4964
- d.length > 0 && (f.value = d[d.length - 1].id), M(), i.value = !0, g();
4964
+ for (let e of p) t.value = [...t.value, e];
4965
+ p.length > 0 && (f.value = p[p.length - 1].id), M(), i.value = !0, g();
4965
4966
  }
4966
- function F(e, r, o) {
4967
- let s = Z(n.value), c = Q(n.value), l = a.value.columnWidth, u = (r?.length || 0) > 2 ? 26.25 : 17.5, d = xt(e, {
4967
+ function F(e, r, o, s = !1) {
4968
+ let c = Z(n.value), l = Q(n.value), u = a.value.columnWidth, d = (r?.length || 0) > 2 ? 26.25 : 17.5, p = xt(e, {
4968
4969
  questionNo: r || "",
4969
4970
  score: o || "",
4970
- contentWidth: l - u,
4971
- fontSize: s,
4972
- lineSpacing: c
4971
+ contentWidth: u - d,
4972
+ fontSize: c,
4973
+ lineSpacing: l,
4974
+ protectContent: s
4973
4975
  });
4974
- for (let e of d) t.value = [...t.value, e];
4975
- d.length > 0 && (f.value = d[d.length - 1].id), M(), i.value = !0, g();
4976
+ for (let e of p) t.value = [...t.value, e];
4977
+ p.length > 0 && (f.value = p[p.length - 1].id), M(), i.value = !0, g();
4976
4978
  }
4977
- function te(e, r, o) {
4978
- let s = Z(n.value), c = Q(n.value), l = a.value.columnWidth, u = (r?.length || 0) > 2 ? 26.25 : 17.5, d;
4979
+ function te(e, r, o, s = !1) {
4980
+ let c = Z(n.value), l = Q(n.value), u = a.value.columnWidth, d = (r?.length || 0) > 2 ? 26.25 : 17.5, p;
4979
4981
  try {
4980
- d = JSON.parse(e);
4982
+ p = JSON.parse(e);
4981
4983
  } catch {
4982
4984
  throw Error("JSON 格式错误,请检查");
4983
4985
  }
4984
- let p = Mt(d, {
4986
+ let m = Mt(p, {
4985
4987
  questionNo: r || "",
4986
4988
  score: o || "",
4987
- contentWidth: l - u,
4988
- fontSize: s,
4989
- lineSpacing: c
4989
+ contentWidth: u - d,
4990
+ fontSize: c,
4991
+ lineSpacing: l,
4992
+ protectContent: s
4990
4993
  });
4991
- for (let e of p) t.value = [...t.value, e];
4992
- p.length > 0 && (f.value = p[p.length - 1].id), M(), i.value = !0, g();
4994
+ for (let e of m) t.value = [...t.value, e];
4995
+ m.length > 0 && (f.value = m[m.length - 1].id), M(), i.value = !0, g();
4993
4996
  }
4994
4997
  function ne(e, t, n) {
4995
4998
  let r = p(e);
@@ -6370,18 +6373,18 @@ var Un = { class: "pe-root" }, Wn = { class: "pe-main" }, Gn = { class: "pe-edit
6370
6373
  isDirty: () => C.isDirty.value
6371
6374
  },
6372
6375
  questions: {
6373
- addFromHtml: (e, t, n) => {
6374
- C.addQuestionFromHtml(e, t, n), S("change");
6376
+ addFromHtml: (e, t, n, r) => {
6377
+ C.addQuestionFromHtml(e, t, n, r), S("change");
6375
6378
  },
6376
- addFromJson: (e, t, n) => {
6377
- C.addQuestionFromJson(e, t, n), S("change");
6379
+ addFromJson: (e, t, n, r) => {
6380
+ C.addQuestionFromJson(e, t, n, r), S("change");
6378
6381
  },
6379
- addFromText: (e, t, n) => {
6382
+ addFromText: (e, t, n, r) => {
6380
6383
  C.addNewQuestion({
6381
6384
  no: t || "",
6382
6385
  score: n || "",
6383
6386
  content: e
6384
- }), S("change");
6387
+ }, r), S("change");
6385
6388
  },
6386
6389
  remove: (e) => {
6387
6390
  C.removeBlock(e), S("change");
@@ -6611,7 +6614,7 @@ var Un = { class: "pe-root" }, Wn = { class: "pe-main" }, Gn = { class: "pe-edit
6611
6614
  let n = e.__vccOpts || e;
6612
6615
  for (let [e, r] of t) n[e] = r;
6613
6616
  return n;
6614
- }, Qn = /*#__PURE__*/ Zn(Xn, [["__scopeId", "data-v-e44f7765"]]), $n = { class: "pe-preview__pages" }, er = ["innerHTML"], tr = {
6617
+ }, Qn = /*#__PURE__*/ Zn(Xn, [["__scopeId", "data-v-906c9146"]]), $n = { class: "pe-preview__pages" }, er = ["innerHTML"], tr = {
6615
6618
  key: 0,
6616
6619
  class: "pe-preview__helpers"
6617
6620
  }, nr = {
@@ -16,9 +16,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
16
16
  isDirty: () => boolean;
17
17
  };
18
18
  questions: {
19
- addFromHtml: (html: string, no?: string, score?: string) => void;
20
- addFromJson: (json: string, no?: string, score?: string) => void;
21
- addFromText: (text: string, no?: string, score?: string) => void;
19
+ addFromHtml: (html: string, no?: string, score?: string, protectContent?: boolean) => void;
20
+ addFromJson: (json: string, no?: string, score?: string, protectContent?: boolean) => void;
21
+ addFromText: (text: string, no?: string, score?: string, protectContent?: boolean) => void;
22
22
  remove: (id: string) => void;
23
23
  addTitleBlock: (title: string, beforeId?: string) => void;
24
24
  reorder: (orderedIds: string[]) => void;
@@ -29,7 +29,7 @@ export declare function parseInlineSegments(text: string): Array<{
29
29
  value: string;
30
30
  }>;
31
31
  export declare function parseQuestionLine(text: string, fontSize: number): InlineElement[];
32
- export declare function createQuestionBlock(no: string, score: string, textLines: string[], fontSize: number, lineSpacing: number, contentWidth?: number): ContentBlock;
33
- export declare function createSubQuestionBlocks(no: string, score: string, textLines: string[], fontSize: number, lineSpacing: number, contentWidth?: number): ContentBlock[];
32
+ export declare function createQuestionBlock(no: string, score: string, textLines: string[], fontSize: number, lineSpacing: number, contentWidth?: number, protectContent?: boolean): ContentBlock;
33
+ export declare function createSubQuestionBlocks(no: string, score: string, textLines: string[], fontSize: number, lineSpacing: number, contentWidth?: number, protectContent?: boolean): ContentBlock[];
34
34
  export declare function getBlockPlainText(block: ContentBlock): string;
35
35
  export declare function getBlockLabel(block: ContentBlock): string;
@@ -55,9 +55,9 @@ export declare function usePaperBlockOps(deps: UsePaperBlockOpsDeps): {
55
55
  no: string;
56
56
  score: string;
57
57
  content: string;
58
- }) => void;
59
- addQuestionFromHtml: (html: string, no?: string, score?: string) => void;
60
- addQuestionFromJson: (jsonStr: string, no?: string, score?: string) => void;
58
+ }, protectContent?: boolean) => void;
59
+ addQuestionFromHtml: (html: string, no?: string, score?: string, protectContent?: boolean) => void;
60
+ addQuestionFromJson: (jsonStr: string, no?: string, score?: string, protectContent?: boolean) => void;
61
61
  updateInlineImageSize: (id: string, newWidth: number, newHeight?: number) => void;
62
62
  getImageParagraphInfo: (id: string) => {
63
63
  isStandalone: boolean;
@@ -157,9 +157,9 @@ export declare function usePaperCore(options?: UsePaperCoreOptions): {
157
157
  no: string;
158
158
  score: string;
159
159
  content: string;
160
- }) => void;
161
- addQuestionFromHtml: (html: string, no?: string, score?: string) => void;
162
- addQuestionFromJson: (jsonStr: string, no?: string, score?: string) => void;
160
+ }, protectContent?: boolean) => void;
161
+ addQuestionFromHtml: (html: string, no?: string, score?: string, protectContent?: boolean) => void;
162
+ addQuestionFromJson: (jsonStr: string, no?: string, score?: string, protectContent?: boolean) => void;
163
163
  getBlockPlainText: typeof import("./paperHelpers").getBlockPlainText;
164
164
  parseTextToParagraphs: (text: string, fontSize?: number, lineSpacing?: number, contentWidth?: number) => import("..").Paragraph[];
165
165
  getBlockLabel: typeof import("./paperHelpers").getBlockLabel;
@@ -33,6 +33,8 @@ export interface ParseQuestionHtmlOptions {
33
33
  lineSpacing?: number;
34
34
  /** 跳过自动追加作答空段落(由调用方自行控制) */
35
35
  skipAnswerArea?: boolean;
36
+ /** 是否启用内容保护,默认 true */
37
+ protectContent?: boolean;
36
38
  }
37
39
  /**
38
40
  * 将题库原始 HTML 转换为 ContentBlock[],可直接插入画板
@@ -48,6 +48,8 @@ export interface ParseQuestionJsonOptions {
48
48
  fontSize?: number;
49
49
  /** 默认行距倍数,默认 1.5 */
50
50
  lineSpacing?: number;
51
+ /** 是否启用内容保护,默认 true */
52
+ protectContent?: boolean;
51
53
  }
52
54
  /**
53
55
  * 将题库完整 JSON 转换为 ContentBlock[]
package/dist/style.css CHANGED
@@ -1,2 +1,2 @@
1
- .paper-page text.text{dominant-baseline:hanging;white-space:pre;font-family:Times New Roman,SimSun!important}.paper-page .block:hover{cursor:default}.paper-page .formula svg{vertical-align:middle;overflow:visible}.paper-page text[fill=\#aaa]{-webkit-user-select:none;user-select:none;font-size:13px}.paper-page [data-block-id]{cursor:pointer}.paper-page rect[stroke-dasharray="4,4"]{pointer-events:none}svg.paper-page{display:block}text.topic-no,text.question-score{dominant-baseline:hanging}.title_wrapper{box-sizing:border-box;color:#231f20;text-align:left;background:#fff;border:none;align-items:center;max-width:100%;height:38px;padding:5px 0;font-family:Times New Roman,黑体;font-size:14pt;display:flex;position:relative}.title_wrapper .title-content{align-items:center;width:100%;display:inline-flex;overflow:hidden}.title_wrapper .title-content .title-text{color:#231f20;white-space:nowrap;font-size:15px;font-weight:600;line-height:32px}.title_wrapper .title-content .title-score{color:#231f20;border:none;padding:0 2px 0 8px;font-size:10pt;font-weight:400;line-height:1.2}.header-block{font-family:Microsoft YaHei,PingFang SC,sans-serif}.header-school-info{color:#595959;justify-content:center;align-items:center;gap:12px;width:100%;padding:6px 0 0;display:flex}.header-school-info--simple{padding-top:3px}.headerDesc{font-size:14px;line-height:1.5}.headerDesc strong{color:#000;font-size:16px}.header-school-info .score{white-space:nowrap;font-size:12px;line-height:1.5;display:inline-block}.header-paper-name{text-align:center;width:100%;padding:2px 0}.header-paper-name .input-box{flex-direction:column;justify-content:center;align-items:center;display:flex}.header-paper-name .input-box__label{display:none}.header-paper-name .input-box__input{color:#000;text-align:center;background:0 0;border:none;outline:none;padding:2px 8px;font-size:22px;font-weight:700;line-height:1.5;display:block}.header-student-info{align-items:flex-start;gap:16px;width:100%;padding:4px 0 0;display:flex}.header-student-info .qr-code-img{flex-shrink:0;width:65px;height:65px}.header-student-info .qr-code-img img{width:100%;height:auto;display:block}.student-fields{flex-direction:column;flex:1;gap:10px;min-width:0;display:flex}.student-fields-row{flex-wrap:wrap;gap:16px;display:flex}.student-field{flex:1;align-items:center;min-width:120px;display:flex}.student-field .label{color:#000;white-space:nowrap;margin-right:4px;font-size:14px}.student-field .underline{border-bottom:1px solid #000;flex:1;min-width:60px;height:22px}.student-code{color:#000;align-items:center;font-size:13px;display:flex}.student-code-table{border-collapse:collapse;vertical-align:middle;margin-left:4px;display:inline-table}.student-code-cell{text-align:center;border:1px solid #000;width:25px;height:30px;font-size:14px}.tail-time-wrapper{color:#595959;width:100%;font-family:Microsoft YaHei,PingFang SC,sans-serif;font-size:12px}.answer-wrapper,.revise-wrapper{align-items:center;gap:6px;display:flex}.tail-col{align-items:center;gap:3px;display:flex}.center-col{flex-direction:column;align-items:center;gap:2px;display:flex}.tail-col-item{gap:1px}.tail-label.text{color:#8c8c8c;white-space:nowrap;font-size:11px}.tail-col .text{color:#595959;white-space:nowrap;font-size:12px}.tail-col .text-second{color:#bfbfbf;font-size:10px}.rect{box-sizing:border-box;border:1px solid #d9d9d9;border-radius:2px;width:18px;height:18px}.rect-fill{background:#f0f0f0}.rect-stroke{background:0 0}.revise-area{align-items:center;gap:4px;display:flex}.revise-area-label{color:#8c8c8c;white-space:nowrap;font-size:11px}.revise-area-rect{box-sizing:border-box;border:1px solid #d9d9d9;border-radius:2px;width:18px;height:18px}.el-icon.triangle{color:#8c8c8c;justify-content:center;align-items:center;font-size:14px;display:inline-flex}.pe-editor-surface::-webkit-scrollbar{width:6px;height:6px}.pe-editor-surface::-webkit-scrollbar-thumb{background:#d9d9d9;border-radius:3px}.pe-editor-surface::-webkit-scrollbar-thumb:hover{background:#bfbfbf}.paper-page g.question:hover>rect.question-hitarea{fill:#409eff0a}.paper-page g.question:hover>path.question-border{stroke:#409eff}.paper-page g.underline:hover>rect.underline-hitarea{fill:#409eff0f}.paper-page g.underline:hover>rect[fill="rgb(245,245,245)"]{fill:#f0f8f7}.editable-dashed{cursor:pointer;outline-offset:1px;border-radius:2px;outline:1px dashed #bfbfbf;padding:0 2px}.editable-dashed:hover,.editable-dashed:focus{outline-offset:1px;border-radius:2px;outline:1px dashed #409eff}.pe-root[data-v-e44f7765]{background:#f0f2f5;flex-direction:column;width:100%;height:100%;font-family:Microsoft YaHei,PingFang SC,sans-serif;display:flex;overflow:hidden}.pe-main[data-v-e44f7765]{background:#e8ebf0;flex:1;justify-content:center;display:flex;position:relative;overflow:hidden}.pe-editor[data-v-e44f7765]{justify-content:center;width:100%;height:100%;display:flex;overflow:hidden}.pe-editor-surface[data-v-e44f7765]{box-sizing:border-box;-webkit-user-select:none;user-select:none;scrollbar-width:none;-ms-overflow-style:none;font-synthesis:unset;text-rendering:auto;-webkit-font-smoothing:auto;background-color:#eee;width:100%;height:100%;padding:10px 0;position:relative;overflow:auto;transform:scaleY(.99999)}.pe-editor-defs[data-v-e44f7765]{width:1px;height:1px;position:absolute;overflow:hidden}.pe-editor-pages[data-v-e44f7765]{flex-direction:column;align-items:center;gap:24px;min-height:100%;padding:24px 0;display:flex}.pe-editor-page[data-v-e44f7765]{background:#fff;border:2px solid #0000;flex-shrink:0;line-height:0;transition:border-color .2s,box-shadow .2s;box-shadow:0 1px 6px #00000014}.pe-editor-page.active[data-v-e44f7765]{border-color:#409eff;box-shadow:0 2px 12px #409eff33}.pe-editor-viewport[data-v-e44f7765]{transform-origin:0 0;-webkit-user-select:text;user-select:text}.pe-editor-viewport[data-v-e44f7765] svg.paper-page{display:block}.pe-editor-controllers[data-v-e44f7765]{pointer-events:none;z-index:102;width:100%;height:100%;position:absolute;top:0;left:0;overflow:visible}.pe-ctrl-block[data-v-e44f7765]{pointer-events:auto}.pe-ctrl-height[data-v-e44f7765]{cursor:ns-resize;color:#fff;opacity:.85;z-index:103;pointer-events:auto;background:#409eff;border-radius:4px;justify-content:center;align-items:center;width:44px;height:20px;transition:opacity .15s;display:flex;position:absolute;bottom:-11px;left:50%;transform:translate(-50%)}.pe-ctrl-height[data-v-e44f7765]:hover{opacity:1;background:#048f80}.pe-ctrl-height[data-v-e44f7765]:active{background:#037066}.pe-ctrlUnderline[data-v-e44f7765]{pointer-events:auto;box-sizing:border-box;border:1.5px solid #409eff;border-radius:2px}.pe-ctrl-ul-left[data-v-e44f7765],.pe-ctrl-ul-right[data-v-e44f7765]{cursor:ew-resize;color:#fff;opacity:.85;z-index:103;background:#409eff;border-radius:4px;justify-content:center;align-items:center;width:20px;height:28px;transition:opacity .15s;display:flex;position:absolute;top:50%;transform:translateY(-50%)}.pe-ctrl-ul-left[data-v-e44f7765]{left:-12px}.pe-ctrl-ul-right[data-v-e44f7765]{right:-12px}.pe-ctrl-ul-left[data-v-e44f7765]:hover,.pe-ctrl-ul-right[data-v-e44f7765]:hover{opacity:1;background:#048f80}.pe-ctrl-ul-left[data-v-e44f7765]:active,.pe-ctrl-ul-right[data-v-e44f7765]:active{background:#037066}.pe-ctrlAnchor[data-v-e44f7765]{pointer-events:auto;box-sizing:border-box;cursor:move;border:1.5px solid #409eff;border-radius:1px}.pe-resize-se[data-v-e44f7765],.pe-resize-sw[data-v-e44f7765],.pe-resize-ne[data-v-e44f7765],.pe-resize-nw[data-v-e44f7765]{box-sizing:border-box;z-index:104;background:#409eff;border:1px solid #fff;border-radius:2px;width:10px;height:10px;position:absolute}.pe-resize-se[data-v-e44f7765]{cursor:nwse-resize;bottom:-5px;right:-5px}.pe-resize-sw[data-v-e44f7765]{cursor:nesw-resize;bottom:-5px;left:-5px}.pe-resize-ne[data-v-e44f7765]{cursor:nesw-resize;top:-5px;right:-5px}.pe-resize-nw[data-v-e44f7765]{cursor:nwse-resize;top:-5px;left:-5px}.pe-resize-se[data-v-e44f7765]:hover,.pe-resize-sw[data-v-e44f7765]:hover,.pe-resize-ne[data-v-e44f7765]:hover,.pe-resize-nw[data-v-e44f7765]:hover{background:#048f80}.pe-img-align-bar[data-v-e44f7765]{z-index:105;background:#409eff;border-radius:4px;gap:0;display:flex;position:absolute;overflow:hidden}.pe-align-btn[data-v-e44f7765]{color:#fff;cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;width:28px;height:24px;font-size:12px;transition:background .15s;display:flex}.pe-align-btn[data-v-e44f7765]:hover{background:#fff3}.pe-align-btn.active[data-v-e44f7765]{background:#00000040}.pe-editor-input-wrapper[data-v-e44f7765]{z-index:-1;opacity:0;width:0;position:absolute}.pe-editor-virtual-input[data-v-e44f7765]{width:5px;height:30px}.pe-editor-cursor[data-v-e44f7765]{z-index:99999999;background:#000;width:1px;height:0;animation:1s ease-in-out infinite pe-blink-e44f7765;position:absolute;top:0;left:0}@keyframes pe-blink-e44f7765{0%{opacity:.8}50%{opacity:0}}.pe-preview[data-v-c429b5aa]{width:100%;font-family:Times New Roman,宋体,Cambria Math,serif;overflow:hidden}.pe-preview__pages[data-v-c429b5aa]{flex-direction:column;align-items:center;gap:16px;padding:16px 0;display:flex}.pe-preview__page[data-v-c429b5aa]{background:#fff;position:relative;overflow:hidden;box-shadow:0 2px 12px #00000026}.pe-preview__page-col[data-v-c429b5aa]{position:absolute;top:0;left:0}.pe-preview__page-col[data-v-c429b5aa] svg{width:100%;height:100%;display:block}.pe-preview__helpers[data-v-c429b5aa]{pointer-events:none;width:100%;height:100%;position:absolute;top:0;left:0}.pe-preview__helper-box[data-v-c429b5aa]{box-sizing:border-box}.pe-preview__page-num[data-v-c429b5aa]{color:#bfbfbf;pointer-events:none;font-size:11px;position:absolute;bottom:4px;right:8px}.pe-preview--print .pe-preview__page[data-v-c429b5aa]{box-shadow:none;page-break-before:always;page-break-after:always;page-break-inside:avoid;-webkit-print-color-adjust:exact;print-color-adjust:exact;margin:0}.pe-preview--print .pe-preview__pages[data-v-c429b5aa]{gap:0;padding:0}.pe-preview--print .pe-preview__helpers[data-v-c429b5aa],.pe-preview--print .pe-preview__page-num[data-v-c429b5aa]{display:none!important}@media print{@page{margin:0}body[data-v-c429b5aa]{margin:0;padding:0}}
1
+ .paper-page text.swed-text{dominant-baseline:hanging;white-space:pre;font-family:Times New Roman,SimSun!important}.paper-page [data-block-id]:hover{cursor:default}.paper-page .swed-formula svg{vertical-align:middle;overflow:visible}.paper-page text[fill=\#aaa]{-webkit-user-select:none;user-select:none;font-size:13px}.paper-page [data-block-id]{cursor:pointer}.paper-page rect[stroke-dasharray="4,4"]{pointer-events:none}svg.paper-page{display:block}text.swed-topic-no,text.swed-question-score{dominant-baseline:hanging}.swed-title_wrapper{box-sizing:border-box;color:#231f20;text-align:left;background:#fff;border:none;align-items:center;max-width:100%;height:38px;padding:5px 0;font-family:Times New Roman,黑体;font-size:14pt;display:flex;position:relative}.title_wrapper .swed-title-content{align-items:center;width:100%;display:inline-flex;overflow:hidden}.title_wrapper .title-content .swed-title-text{color:#231f20;white-space:nowrap;font-size:15px;font-weight:600;line-height:32px}.title_wrapper .title-content .swed-title-score{color:#231f20;border:none;padding:0 2px 0 8px;font-size:10pt;font-weight:400;line-height:1.2}.swed-header-block{font-family:Microsoft YaHei,PingFang SC,sans-serif}.swed-header-school-info{color:#595959;justify-content:center;align-items:center;gap:12px;width:100%;padding:6px 0 0;display:flex}.swed-header-school-info--simple{padding-top:3px}.swed-headerDesc{font-size:14px;line-height:1.5}.swed-headerDesc strong{color:#000;font-size:16px}.swed-header-school-info .swed-score{white-space:nowrap;font-size:12px;line-height:1.5;display:inline-block}.swed-header-paper-name{text-align:center;width:100%;padding:2px 0}.swed-header-paper-name .swed-input-box{flex-direction:column;justify-content:center;align-items:center;display:flex}.swed-header-paper-name .swed-input-box__label{display:none}.swed-header-paper-name .swed-input-box__input{color:#000;text-align:center;background:0 0;border:none;outline:none;padding:2px 8px;font-size:22px;font-weight:700;line-height:1.5;display:block}.swed-header-student-info{align-items:flex-start;gap:16px;width:100%;padding:4px 0 0;display:flex}.swed-header-student-info .swed-qr-code-img{flex-shrink:0;width:65px;height:65px}.header-student-info .qr-code-img img{width:100%;height:auto;display:block}.swed-student-fields{flex-direction:column;flex:1;gap:10px;min-width:0;display:flex}.swed-student-fields-row{flex-wrap:wrap;gap:16px;display:flex}.swed-student-field{flex:1;align-items:center;min-width:120px;display:flex}.swed-student-field .swed-label{color:#000;white-space:nowrap;margin-right:4px;font-size:14px}.swed-student-field .swed-underline{border-bottom:1px solid #000;flex:1;min-width:60px;height:22px}.swed-student-code{color:#000;align-items:center;font-size:13px;display:flex}.swed-student-code-table{border-collapse:collapse;vertical-align:middle;margin-left:4px;display:inline-table}.swed-student-code-cell{text-align:center;border:1px solid #000;width:25px;height:30px;font-size:14px}.swed-tail-time-wrapper{color:#595959;width:100%;font-family:Microsoft YaHei,PingFang SC,sans-serif;font-size:12px}.swed-answer-wrapper,.swed-revise-wrapper{align-items:center;gap:6px;display:flex}.swed-tail-col{align-items:center;gap:3px;display:flex}.swed-center-col{flex-direction:column;align-items:center;gap:2px;display:flex}.swed-tail-col-item{gap:1px}.swed-tail-label.swed-text{color:#8c8c8c;white-space:nowrap;font-size:11px}.swed-tail-col .swed-text{color:#595959;white-space:nowrap;font-size:12px}.swed-tail-col .swed-text-second{color:#bfbfbf;font-size:10px}.swed-rect{box-sizing:border-box;border:1px solid #d9d9d9;border-radius:2px;width:18px;height:18px}.swed-rect-fill{background:#f0f0f0}.swed-rect-stroke{background:0 0}.swed-revise-area{align-items:center;gap:4px;display:flex}.swed-revise-area-label{color:#8c8c8c;white-space:nowrap;font-size:11px}.swed-revise-area-rect{box-sizing:border-box;border:1px solid #d9d9d9;border-radius:2px;width:18px;height:18px}.swed-el-icon.swed-triangle{color:#8c8c8c;justify-content:center;align-items:center;font-size:14px;display:inline-flex}.pe-editor-surface::-webkit-scrollbar{width:6px;height:6px}.pe-editor-surface::-webkit-scrollbar-thumb{background:#d9d9d9;border-radius:3px}.pe-editor-surface::-webkit-scrollbar-thumb:hover{background:#bfbfbf}.paper-page g.swed-question:hover>rect.swed-question-hitarea{fill:#409eff0a}.paper-page g.swed-question:hover>path.swed-question-border{stroke:#409eff}.paper-page g.swed-underline:hover>rect.swed-underline-hitarea{fill:#409eff0f}.paper-page g.swed-underline:hover>rect[fill="rgb(245,245,245)"]{fill:#f0f8f7}.swed-editable-dashed{cursor:pointer;outline-offset:1px;border-radius:2px;outline:1px dashed #bfbfbf;padding:0 2px}.editable-dashed:hover,.editable-dashed:focus{outline-offset:1px;border-radius:2px;outline:1px dashed #409eff}.pe-root[data-v-906c9146]{background:#f0f2f5;flex-direction:column;width:100%;height:100%;font-family:Microsoft YaHei,PingFang SC,sans-serif;display:flex;overflow:hidden}.pe-main[data-v-906c9146]{background:#e8ebf0;flex:1;justify-content:center;display:flex;position:relative;overflow:hidden}.pe-editor[data-v-906c9146]{justify-content:center;width:100%;height:100%;display:flex;overflow:hidden}.pe-editor-surface[data-v-906c9146]{box-sizing:border-box;-webkit-user-select:none;user-select:none;scrollbar-width:none;-ms-overflow-style:none;font-synthesis:unset;text-rendering:auto;-webkit-font-smoothing:auto;background-color:#eee;width:100%;height:100%;padding:10px 0;position:relative;overflow:auto;transform:scaleY(.99999)}.pe-editor-defs[data-v-906c9146]{width:1px;height:1px;position:absolute;overflow:hidden}.pe-editor-pages[data-v-906c9146]{flex-direction:column;align-items:center;gap:24px;min-height:100%;padding:24px 0;display:flex}.pe-editor-page[data-v-906c9146]{background:#fff;border:2px solid #0000;flex-shrink:0;line-height:0;transition:border-color .2s,box-shadow .2s;box-shadow:0 1px 6px #00000014}.pe-editor-page.active[data-v-906c9146]{border-color:#409eff;box-shadow:0 2px 12px #409eff33}.pe-editor-viewport[data-v-906c9146]{transform-origin:0 0;-webkit-user-select:text;user-select:text}.pe-editor-viewport[data-v-906c9146] svg.paper-page{display:block}.pe-editor-controllers[data-v-906c9146]{pointer-events:none;z-index:102;width:100%;height:100%;position:absolute;top:0;left:0;overflow:visible}.pe-ctrl-block[data-v-906c9146]{pointer-events:auto}.pe-ctrl-height[data-v-906c9146]{cursor:ns-resize;color:#fff;opacity:.85;z-index:103;pointer-events:auto;background:#409eff;border-radius:4px;justify-content:center;align-items:center;width:44px;height:20px;transition:opacity .15s;display:flex;position:absolute;bottom:-11px;left:50%;transform:translate(-50%)}.pe-ctrl-height[data-v-906c9146]:hover{opacity:1;background:#048f80}.pe-ctrl-height[data-v-906c9146]:active{background:#037066}.pe-ctrlUnderline[data-v-906c9146]{pointer-events:auto;box-sizing:border-box;border:1.5px solid #409eff;border-radius:2px}.pe-ctrl-ul-left[data-v-906c9146],.pe-ctrl-ul-right[data-v-906c9146]{cursor:ew-resize;color:#fff;opacity:.85;z-index:103;background:#409eff;border-radius:4px;justify-content:center;align-items:center;width:20px;height:28px;transition:opacity .15s;display:flex;position:absolute;top:50%;transform:translateY(-50%)}.pe-ctrl-ul-left[data-v-906c9146]{left:-12px}.pe-ctrl-ul-right[data-v-906c9146]{right:-12px}.pe-ctrl-ul-left[data-v-906c9146]:hover,.pe-ctrl-ul-right[data-v-906c9146]:hover{opacity:1;background:#048f80}.pe-ctrl-ul-left[data-v-906c9146]:active,.pe-ctrl-ul-right[data-v-906c9146]:active{background:#037066}.pe-ctrlAnchor[data-v-906c9146]{pointer-events:auto;box-sizing:border-box;cursor:move;border:1.5px solid #409eff;border-radius:1px}.pe-resize-se[data-v-906c9146],.pe-resize-sw[data-v-906c9146],.pe-resize-ne[data-v-906c9146],.pe-resize-nw[data-v-906c9146]{box-sizing:border-box;z-index:104;background:#409eff;border:1px solid #fff;border-radius:2px;width:10px;height:10px;position:absolute}.pe-resize-se[data-v-906c9146]{cursor:nwse-resize;bottom:-5px;right:-5px}.pe-resize-sw[data-v-906c9146]{cursor:nesw-resize;bottom:-5px;left:-5px}.pe-resize-ne[data-v-906c9146]{cursor:nesw-resize;top:-5px;right:-5px}.pe-resize-nw[data-v-906c9146]{cursor:nwse-resize;top:-5px;left:-5px}.pe-resize-se[data-v-906c9146]:hover,.pe-resize-sw[data-v-906c9146]:hover,.pe-resize-ne[data-v-906c9146]:hover,.pe-resize-nw[data-v-906c9146]:hover{background:#048f80}.pe-img-align-bar[data-v-906c9146]{z-index:105;background:#409eff;border-radius:4px;gap:0;display:flex;position:absolute;overflow:hidden}.pe-align-btn[data-v-906c9146]{color:#fff;cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;width:28px;height:24px;font-size:12px;transition:background .15s;display:flex}.pe-align-btn[data-v-906c9146]:hover{background:#fff3}.pe-align-btn.active[data-v-906c9146]{background:#00000040}.pe-editor-input-wrapper[data-v-906c9146]{z-index:-1;opacity:0;width:0;position:absolute}.pe-editor-virtual-input[data-v-906c9146]{width:5px;height:30px}.pe-editor-cursor[data-v-906c9146]{z-index:99999999;background:#000;width:1px;height:0;animation:1s ease-in-out infinite pe-blink-906c9146;position:absolute;top:0;left:0}@keyframes pe-blink-906c9146{0%{opacity:.8}50%{opacity:0}}.pe-preview[data-v-c429b5aa]{width:100%;font-family:Times New Roman,宋体,Cambria Math,serif;overflow:hidden}.pe-preview__pages[data-v-c429b5aa]{flex-direction:column;align-items:center;gap:16px;padding:16px 0;display:flex}.pe-preview__page[data-v-c429b5aa]{background:#fff;position:relative;overflow:hidden;box-shadow:0 2px 12px #00000026}.pe-preview__page-col[data-v-c429b5aa]{position:absolute;top:0;left:0}.pe-preview__page-col[data-v-c429b5aa] svg{width:100%;height:100%;display:block}.pe-preview__helpers[data-v-c429b5aa]{pointer-events:none;width:100%;height:100%;position:absolute;top:0;left:0}.pe-preview__helper-box[data-v-c429b5aa]{box-sizing:border-box}.pe-preview__page-num[data-v-c429b5aa]{color:#bfbfbf;pointer-events:none;font-size:11px;position:absolute;bottom:4px;right:8px}.pe-preview--print .pe-preview__page[data-v-c429b5aa]{box-shadow:none;page-break-before:always;page-break-after:always;page-break-inside:avoid;-webkit-print-color-adjust:exact;print-color-adjust:exact;margin:0}.pe-preview--print .pe-preview__pages[data-v-c429b5aa]{gap:0;padding:0}.pe-preview--print .pe-preview__helpers[data-v-c429b5aa],.pe-preview--print .pe-preview__page-num[data-v-c429b5aa]{display:none!important}@media print{@page{margin:0}body[data-v-c429b5aa]{margin:0;padding:0}}
2
2
  /*$vite$:1*/
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sw7d/paper-renderer",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "题卡设计器核心组件 - 纯编辑表面",
5
5
  "type": "module",
6
6
  "main": "./dist/paper-renderer.js",