@sw7d/paper-renderer 0.1.10 → 0.2.1

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.
@@ -654,14 +654,14 @@ function Se(e, t, n, r, i, a, o, s) {
654
654
  return ` <g class="swed-formula" transform="translate(${t.toFixed(2)}, ${o})">\n${r.svgContent} </g>\n`;
655
655
  }
656
656
  case "underline": {
657
- 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` : "";
658
- if ((r.isEmpty || r.blankType) && !r.isSplitPart) {
657
+ 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` : "", d = (r.isEmpty || !!r.blankType) && !r.isSplitPart, f = !r.blankType || r.blankType === "tiankong";
658
+ if (d) {
659
659
  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` : "";
660
- 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`;
660
+ return ` <g class="swed-underline" transform="translate(${t.toFixed(2)}, ${i})"${s}${c}${l}>\n ${u} ${n} ${d}` + (f ? ` <line x1="2" y1="${o}" x2="${(r.width - 2).toFixed(2)}" y2="${o}" style="stroke:#000;stroke-width:0.7"></line>\n` : "") + " </g>\n";
661
661
  }
662
662
  if (r.isSplitPart && (r.isEmpty || r.blankType) && a === "edit") {
663
663
  let e = `<rect x="0" y="0" width="${r.width.toFixed(2)}" height="30" fill="rgb(245,245,245)" opacity="0.6"></rect>\n`;
664
- 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`;
664
+ return ` <g class="swed-underline" transform="translate(${t.toFixed(2)}, ${i})"${s}${c}${l}>\n ${u} ${e}` + (f ? ` <line x1="2" y1="${o}" x2="${(r.width - 2).toFixed(2)}" y2="${o}" style="stroke:#000;stroke-width:${r.lineWidth}"></line>\n` : "") + " </g>\n";
665
665
  }
666
666
  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`;
667
667
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sw7d/paper-renderer",
3
- "version": "0.1.10",
3
+ "version": "0.2.1",
4
4
  "description": "题卡设计器核心组件 - 纯编辑表面",
5
5
  "type": "module",
6
6
  "main": "./dist/paper-renderer.js",