@solhun/feedback-kit-core 0.2.0 → 0.2.2

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.d.cts CHANGED
@@ -1232,6 +1232,25 @@ interface LassoEnvelope {
1232
1232
  y: number;
1233
1233
  } | null;
1234
1234
  sourceFile: string | null;
1235
+ /**
1236
+ * 요소를 지목해서 연 제보만 채워진다. 지목이라고 `annotation.add` 로 보내면
1237
+ * 스크린샷·네트워크·로그·뷰포트를 **전부 잃는다** — 그 이벤트에는 실을 자리가
1238
+ * 없기 때문이다. 같은 제보가 들어온 문에 따라 정보량이 달라지면 안 되므로
1239
+ * 지목도 `report.create` 로 보내고 요소만 여기에 얹는다.
1240
+ */
1241
+ element: {
1242
+ tag: string;
1243
+ path: string | null;
1244
+ text: string | null;
1245
+ cssClasses: string | null;
1246
+ reactComponents: string | null;
1247
+ boundingBox: {
1248
+ x: number;
1249
+ y: number;
1250
+ width: number;
1251
+ height: number;
1252
+ } | null;
1253
+ } | null;
1235
1254
  /**
1236
1255
  * 대시보드가 구조화 필드로 읽는 자리. 본문 마크다운에도 같은 값이 들어가지만,
1237
1256
  * 거기 있는 건 사람이 읽는 용도라 화면의 뷰포트 칸이 비어 있었다(실측).
package/dist/index.d.ts CHANGED
@@ -1232,6 +1232,25 @@ interface LassoEnvelope {
1232
1232
  y: number;
1233
1233
  } | null;
1234
1234
  sourceFile: string | null;
1235
+ /**
1236
+ * 요소를 지목해서 연 제보만 채워진다. 지목이라고 `annotation.add` 로 보내면
1237
+ * 스크린샷·네트워크·로그·뷰포트를 **전부 잃는다** — 그 이벤트에는 실을 자리가
1238
+ * 없기 때문이다. 같은 제보가 들어온 문에 따라 정보량이 달라지면 안 되므로
1239
+ * 지목도 `report.create` 로 보내고 요소만 여기에 얹는다.
1240
+ */
1241
+ element: {
1242
+ tag: string;
1243
+ path: string | null;
1244
+ text: string | null;
1245
+ cssClasses: string | null;
1246
+ reactComponents: string | null;
1247
+ boundingBox: {
1248
+ x: number;
1249
+ y: number;
1250
+ width: number;
1251
+ height: number;
1252
+ } | null;
1253
+ } | null;
1235
1254
  /**
1236
1255
  * 대시보드가 구조화 필드로 읽는 자리. 본문 마크다운에도 같은 값이 들어가지만,
1237
1256
  * 거기 있는 건 사람이 읽는 용도라 화면의 뷰포트 칸이 비어 있었다(실측).
package/dist/index.js CHANGED
@@ -2119,27 +2119,6 @@ function buildLassoEnvelope(report) {
2119
2119
  const parsed = Date.parse(report.createdAt);
2120
2120
  const timestamp = Number.isFinite(parsed) ? parsed : 0;
2121
2121
  const el = report.element;
2122
- if (report.kind === "annotation") {
2123
- return {
2124
- clientSubmissionId: report.clientSubmissionId,
2125
- clientType,
2126
- event: "annotation.add",
2127
- timestamp,
2128
- url: c.url ?? "",
2129
- priority: report.priority,
2130
- annotation: {
2131
- id: report.clientSubmissionId,
2132
- comment: renderReportBody(report),
2133
- x: report.pin?.x ?? null,
2134
- y: report.pin?.y ?? null,
2135
- element: el ? el.tag : null,
2136
- elementPath: el?.attributes["data-feedback-source"] ?? null,
2137
- selectedText: el?.text ?? null,
2138
- boundingBox: el?.boundingBox ?? null,
2139
- timestamp
2140
- }
2141
- };
2142
- }
2143
2122
  return {
2144
2123
  clientSubmissionId: report.clientSubmissionId,
2145
2124
  clientType,
@@ -2152,6 +2131,16 @@ function buildLassoEnvelope(report) {
2152
2131
  comment: renderReportBody(report),
2153
2132
  pin: report.pin ? { x: report.pin.x, y: report.pin.y } : null,
2154
2133
  sourceFile: el?.attributes["data-feedback-source"] ?? null,
2134
+ element: el ? {
2135
+ tag: el.tag,
2136
+ // 요소를 다시 찾는 선택자. 없으면 사람이 화면에서 찾아야 하지만
2137
+ // 제보 자체는 성립한다.
2138
+ path: el.selector ?? null,
2139
+ text: el.text,
2140
+ cssClasses: el.className,
2141
+ reactComponents: el.attributes["react-components"] ?? null,
2142
+ boundingBox: el.boundingBox
2143
+ } : null,
2155
2144
  web: clientType === "web" ? {
2156
2145
  url: c.url,
2157
2146
  route: c.screen,