@solhun/feedback-kit-core 0.6.1 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1482,7 +1482,7 @@ var ReportModalController = class {
1482
1482
  /** 지금 들고 있는 핀의 기준. 핀이 없으면 의미 없다(기본 `picture`). */
1483
1483
  this.pinAnchor = "picture";
1484
1484
  /**
1485
- * 사용자가 [제안 ▾] 를 직접 건드렸는가(방향 무관). 한 번이라도 건드리면 이후
1485
+ * 사용자가 [이런 건가요? ▾] 를 직접 건드렸는가(방향 무관). 한 번이라도 건드리면 이후
1486
1486
  * 타이핑에 의한 자동 접힘/펼침이 멈춘다 — "사람이 편 상태는 모달이 닫힐 때까지 유지"를
1487
1487
  * 이렇게 구현한다. `open()` 에서 매번 리셋된다.
1488
1488
  */
@@ -1572,13 +1572,13 @@ var ReportModalController = class {
1572
1572
  this.submitAttempted = false;
1573
1573
  this.pinAnchor = opts.pin && !pendingReport ? "viewport" : "picture";
1574
1574
  this.userToggledHints = false;
1575
- const resolvedComment = pendingReport?.comment ?? "";
1575
+ const resolvedComment = pendingReport?.comment ?? this.state.comment;
1576
1576
  this.patch({
1577
1577
  open: true,
1578
1578
  comment: resolvedComment,
1579
1579
  // 요소를 지목해서 연 경우엔 그 요소를 물고 간다. 대기 항목 복원이 우선이다.
1580
1580
  element: pendingReport?.element ?? opts.element ?? null,
1581
- priority: pendingReport?.priority ?? "unset",
1581
+ priority: pendingReport?.priority ?? this.state.priority,
1582
1582
  screenshot: pendingReport?.screenshot ?? null,
1583
1583
  screenshotStatus: "none",
1584
1584
  screenshotMessage: null,
@@ -1615,16 +1615,32 @@ var ReportModalController = class {
1615
1615
  cancelClose() {
1616
1616
  this.patch({ closeConfirmVisible: false });
1617
1617
  }
1618
- /** 확인 없이 닫는다(요소 지목 모드로 넘어갈 때처럼 흐름이 이어지는 경우). */
1618
+ /**
1619
+ * 확인 없이 닫는다(요소 지목 모드로 넘어갈 때처럼 흐름이 이어지는 경우).
1620
+ *
1621
+ * **쓰던 글은 남긴다.** 지목으로 넘어가는 건 이 제보를 버린 게 아니라 "가리킬 요소를
1622
+ * 고르러 나간" 것이다. 예전엔 여기서 코멘트를 통째로 비웠고, 그래서 모달에 몇 줄 써 놓고
1623
+ * [요소 지목 모드]를 켜면 **확인도 없이 글이 사라졌다** — 사용자가 직접 닫을 때
1624
+ * (`requestClose`)는 확인을 받는데 이 경로만 안 받았다.
1625
+ *
1626
+ * 그림과 좌표는 남기지 않는다. 지목하러 간다는 건 **어느 화면의 무엇을 가리킬지 다시
1627
+ * 정한다**는 뜻이라, 그때의 캡처와 핀은 다음 화면에서 새로 잡는 게 맞다.
1628
+ */
1619
1629
  dismiss() {
1620
- this.close();
1630
+ this.close({ keepText: true });
1621
1631
  }
1632
+ /**
1633
+ * @param opts.keepResult 전송 결과까지 통째로 보존한다(대기 중 제보 복원용).
1634
+ * @param opts.keepText 사람이 입력한 것(코멘트·우선순위)만 보존한다. 그림·좌표·전송
1635
+ * 상태는 평소처럼 비운다.
1636
+ */
1622
1637
  close(opts) {
1623
1638
  this.captureGeneration += 1;
1624
1639
  const keepDraft = opts?.keepResult || this.state.submitStatus === "pending";
1640
+ const keepText = keepDraft || opts?.keepText === true;
1625
1641
  const cleared = keepDraft ? {} : {
1626
- comment: "",
1627
- priority: "unset",
1642
+ comment: keepText ? this.state.comment : "",
1643
+ priority: keepText ? this.state.priority : "unset",
1628
1644
  screenshot: null,
1629
1645
  screenshotStatus: "none",
1630
1646
  screenshotMessage: null,
@@ -1766,7 +1782,7 @@ ${hint.draft}`;
1766
1782
  ...this.hintsPatchFor(comment)
1767
1783
  });
1768
1784
  }
1769
- /** [제안 ▾] 토글. 방향과 무관하게 이후 자동 접힘/펼침을 멈춘다(`userToggledHints`). */
1785
+ /** [이런 건가요? ▾] 토글. 방향과 무관하게 이후 자동 접힘/펼침을 멈춘다(`userToggledHints`). */
1770
1786
  toggleHints() {
1771
1787
  this.userToggledHints = true;
1772
1788
  this.patch({ hintsExpanded: !this.state.hintsExpanded });