issue-sticker 0.3.1 → 0.5.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.
@@ -1,6 +1,6 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
- import { h as Presence, n as Portal$1, w as Arrow, D as DismissableLayer, C as Content, y as Root, j as useComposedRefs, t as createPopperScope, i as createContextScope, z as createSlottable, f as useId, e as useControllableState, v as Root2, A as Anchor, P as Primitive, g as composeEventHandlers, b as usePortalContainer, a as cn, d as OVERLAY_LAYER, s as stopEscapePropagation } from "./createLucideIcon-CmSNiW63.js";
3
+ import { P as Presence, i as Portal$1, w as Arrow, D as DismissableLayer, C as Content, y as Root, h as useComposedRefs, t as createPopperScope, j as createContextScope, z as createSlottable, m as useId, l as useControllableState, v as Root2, A as Anchor, e as Primitive, f as composeEventHandlers, b as usePortalContainer, a as cn, O as OVERLAY_LAYER, s as stopEscapePropagation } from "./createLucideIcon-BzRMP02h.js";
4
4
  var [createTooltipContext] = createContextScope("Tooltip", [
5
5
  createPopperScope
6
6
  ]);
package/headless.d.ts CHANGED
@@ -82,7 +82,6 @@ export interface Issue extends IssueStickerSummary {
82
82
  external_user_name: string | null;
83
83
  network_logs: NetworkLog[] | null;
84
84
  console_logs: ConsoleLog[] | null;
85
- comments?: unknown[];
86
85
  issue_external_mappings?: IssueExternalMapping[];
87
86
  project: { name: string } | null;
88
87
  reporter: { display_name: string | null } | null;
@@ -132,7 +131,8 @@ export type HeadlessErrorCode =
132
131
  | 'MEMBER_AUTH_REQUIRED'
133
132
  | 'NETWORK_ERROR'
134
133
  | 'CAPTURE_FAILED'
135
- | 'VALIDATION_ERROR';
134
+ | 'VALIDATION_ERROR'
135
+ | 'PAYLOAD_TOO_LARGE';
136
136
 
137
137
  export type HeadlessAuthMode = 'public' | 'member';
138
138
  export type HeadlessCaptureMediaMode = 'screenshot' | 'video';
@@ -227,6 +227,8 @@ export interface HeadlessSessionReplayState {
227
227
  }
228
228
 
229
229
  export interface HeadlessSnapshot {
230
+ /** 익스텐션이 이 페이지의 런타임을 소유 중인가. true 면 SDK 는 아무것도 띄우지 않는다. */
231
+ readonly extensionActive: boolean;
230
232
  readonly phase: HeadlessPhase;
231
233
  readonly auth: HeadlessAuthState;
232
234
  readonly issues: readonly IssueStickerSummary[];
@@ -265,11 +267,25 @@ export interface HeadlessIssueFilters {
265
267
  }
266
268
 
267
269
  export interface SubmitDraftInput {
268
- title: string;
269
- description: string;
270
+ /** intent 를 보내면 생략할 수 있다 — 서버가 생성한다. */
271
+ title?: string;
272
+ /** intent 를 보내면 생략할 수 있다 — 서버가 생성한다. */
273
+ description?: string;
274
+ /** 기대한 동작(To-be) 원문. 서버가 제목·설명을 비동기로 생성한다. */
275
+ intent?: string;
270
276
  dynamicFields?: Record<string, unknown>;
271
277
  }
272
278
 
279
+ /**
280
+ * createIssue에 전달하는 입력. 유저 액션 없이 코드 조건으로 이슈를 만들 때 씁니다.
281
+ */
282
+ export interface CreateIssueInput extends SubmitDraftInput {
283
+ /** 이슈를 붙일 요소. 기본값은 `document.body`(문서 좌상단). */
284
+ readonly target?: HTMLElement;
285
+ /** 기본 `'screenshot'`. `'none'`이면 캡처를 건너뛰고 즉시 전송합니다. */
286
+ readonly media?: 'screenshot' | 'none';
287
+ }
288
+
273
289
  export interface HeadlessClient {
274
290
  readonly phase: HeadlessPhase;
275
291
  getSnapshot(): HeadlessSnapshot;
@@ -285,6 +301,17 @@ export interface HeadlessClient {
285
301
  setSessionReplayEnabled(enabled: boolean): void;
286
302
  cancelIssueCapture(): void;
287
303
  submitDraft(input: SubmitDraftInput): Promise<Issue>;
304
+ /**
305
+ * 유저 액션 없이 코드에서 이슈를 만듭니다. 캡처 단계를 거치지 않으므로 `phase`와
306
+ * `draft`를 건드리지 않고, 사용자가 이슈를 작성하는 중에도 호출할 수 있습니다.
307
+ *
308
+ * 실패해도 예외를 던지지 않고 `null`을 돌려줍니다. 이미 오류를 처리하는 자리에서
309
+ * 부르는 메서드라, 이슈 생성만을 위한 try/catch 를 한 겹 더 쓰지 않아도 됩니다.
310
+ * 실패 사유는 콘솔 경고로 남습니다.
311
+ *
312
+ * 호출 조건이 잘못 잡히면 이슈가 무한히 쌓이므로 SDK가 60초 5건으로 제한합니다.
313
+ */
314
+ createIssue(input: CreateIssueInput): Promise<Issue | null>;
288
315
  loginAsMember(): Promise<void>;
289
316
  logoutMember(): Promise<void>;
290
317
  destroy(): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "issue-sticker",
3
- "version": "0.3.1",
3
+ "version": "0.5.0",
4
4
  "description": "IssueSticker SDK - Visual bug tracking widget for web applications",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "module",
@@ -56,13 +56,14 @@
56
56
  "serve:localdev": "vite --host 0.0.0.0 --port 4173 --mode localdev",
57
57
  "preview": "vite preview",
58
58
  "lint": "cd ../.. && eslint packages/sdk --ext .ts,.tsx,.js,.jsx",
59
- "typecheck": "npm run tsc",
59
+ "typecheck": "npm run tsc && npm run tsc:examples",
60
60
  "format": "cd ../.. && prettier --write packages/sdk --ignore-unknown",
61
61
  "format:check": "cd ../.. && prettier --check packages/sdk --ignore-unknown",
62
62
  "test": "vitest --run",
63
63
  "test:watch": "vitest",
64
64
  "test:ui": "vitest --ui",
65
65
  "tsc": "tsc --noEmit",
66
+ "tsc:examples": "tsc --noEmit -p tsconfig.examples.json",
66
67
  "tsc:watch": "tsc --noEmit --watch",
67
68
  "test:e2e": "playwright test",
68
69
  "test:e2e:ui": "playwright test --ui"
package/react.d.ts CHANGED
@@ -3,7 +3,14 @@ export interface SDKUser {
3
3
  name: string;
4
4
  }
5
5
 
6
- export type OnboardingTrigger = 'off' | 'onMount' | 'onFABClick';
6
+ export type OnboardingTrigger = 'off' | 'onMount';
7
+
8
+ export type ToolbarCorner = 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
9
+
10
+ export interface ToolbarConfig {
11
+ corner?: ToolbarCorner;
12
+ offset?: { x: number; y: number };
13
+ }
7
14
 
8
15
  export interface SDKConfig {
9
16
  apiKey: string;
@@ -12,6 +19,7 @@ export interface SDKConfig {
12
19
  useWebWorker?: boolean;
13
20
  };
14
21
  onboarding?: OnboardingTrigger;
22
+ toolbar?: ToolbarConfig;
15
23
  }
16
24
 
17
25
  export type SDKEvent =