reflet-sdk 0.3.5 → 0.4.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.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { A as SubscribeResponse, C as RefletNotFoundError, D as RoadmapItem, E as Roadmap, M as VoteResponse, O as RoadmapLane, S as RefletError, T as RefletValidationError, _ as OrganizationConfig, a as CommentReply, b as RefletAuthError, d as FeedbackDetail, f as FeedbackItem, g as FeedbackTag, h as FeedbackStatus, i as Comment, j as UnsubscribeResponse, l as FeedbackAuthor, m as FeedbackListResponse, n as AddCommentResponse, o as CreateFeedbackParams, p as FeedbackListParams, r as ChangelogEntry, s as CreateFeedbackResponse, t as AddCommentParams, v as OrganizationSettings, w as RefletUser, x as RefletConfig, y as OrganizationStatus } from "./types-wANRMsGI.js";
2
- import { t as Reflet } from "./client-BpEYxx4d.js";
1
+ import { A as SubscribeResponse, C as RefletNotFoundError, D as RoadmapItem, E as Roadmap, M as VoteResponse, O as RoadmapLane, S as RefletError, T as RefletValidationError, _ as OrganizationConfig, a as CommentReply, b as RefletAuthError, d as FeedbackDetail, f as FeedbackItem, g as FeedbackTag, h as FeedbackStatus, i as Comment, j as UnsubscribeResponse, l as FeedbackAuthor, m as FeedbackListResponse, n as AddCommentResponse, o as CreateFeedbackParams, p as FeedbackListParams, r as ChangelogEntry, s as CreateFeedbackResponse, t as AddCommentParams, v as OrganizationSettings, w as RefletUser, x as RefletConfig, y as OrganizationStatus } from "./types-Cak4ZkSy.js";
2
+ import { t as Reflet } from "./client-BomgCsXm.js";
3
3
  export { type AddCommentParams, type AddCommentResponse, type ChangelogEntry, type Comment, type CommentReply, type CreateFeedbackParams, type CreateFeedbackResponse, type FeedbackAuthor, type FeedbackDetail, type FeedbackItem, type FeedbackListParams, type FeedbackListResponse, type FeedbackStatus, type FeedbackTag, type OrganizationConfig, type OrganizationSettings, type OrganizationStatus, Reflet, RefletAuthError, type RefletConfig, RefletError, RefletNotFoundError, type RefletUser, RefletValidationError, type Roadmap, type RoadmapItem, type RoadmapLane, type SubscribeResponse, type UnsubscribeResponse, type VoteResponse };
@@ -1,6 +1,15 @@
1
1
  import { t as Reflet } from "./client-BYuSKJw5.js";
2
2
  import { createContext, useContext, useEffect, useMemo, useState } from "react";
3
3
  import { jsx } from "react/jsx-runtime";
4
+ //#region src/z-index.ts
5
+ const REFLET_Z_INDEX = {
6
+ annotatorOverlay: 2147483001,
7
+ captureHalo: 2147482999,
8
+ dialogContent: 2147482991,
9
+ dialogOverlay: 2147482990,
10
+ widgetRoot: 2147483e3
11
+ };
12
+ //#endregion
4
13
  //#region src/react-context.tsx
5
14
  const RefletContext = createContext(null);
6
15
  /**
@@ -80,6 +89,6 @@ function useRefletClient() {
80
89
  return client;
81
90
  }
82
91
  //#endregion
83
- export { useRefletContext as i, RefletProvider as n, useRefletClient as r, RefletContext as t };
92
+ export { REFLET_Z_INDEX as a, useRefletContext as i, RefletProvider as n, useRefletClient as r, RefletContext as t };
84
93
 
85
- //# sourceMappingURL=react-context-DZw_HHjj.js.map
94
+ //# sourceMappingURL=react-context-3_IbhIFB.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react-context-3_IbhIFB.js","names":[],"sources":["../src/z-index.ts","../src/react-context.tsx"],"sourcesContent":["export const REFLET_Z_INDEX = {\n annotatorOverlay: 2_147_483_001,\n captureHalo: 2_147_482_999,\n dialogContent: 2_147_482_991,\n dialogOverlay: 2_147_482_990,\n widgetRoot: 2_147_483_000,\n} as const;\n","import {\n createContext,\n type ReactNode,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from \"react\";\nimport { Reflet } from \"./client\";\nimport type { RefletConfig, RefletUser } from \"./types\";\n\n// ============================================\n// Context Types\n// ============================================\n\nexport interface RefletContextValue {\n baseUrl?: string;\n client: Reflet;\n isReady: boolean;\n publicKey: string;\n setUser: (user: RefletUser | undefined) => void;\n user: RefletUser | undefined;\n userToken: string | undefined;\n}\n\n// ============================================\n// Context\n// ============================================\n\nexport const RefletContext = createContext<RefletContextValue | null>(null);\n\n// ============================================\n// Provider\n// ============================================\n\nexport interface RefletProviderProps {\n /** API base URL (optional, defaults to Reflet production API) */\n baseUrl?: string;\n /** Children */\n children: ReactNode;\n /** Your organization's public API key */\n publicKey: string;\n /** Initial user identification */\n user?: RefletUser;\n /** Pre-signed user token (alternative to user) */\n userToken?: string;\n}\n\n/**\n * Provider component for Reflet SDK\n *\n * @example\n * ```tsx\n * import { RefletProvider } from 'reflet-sdk/react';\n *\n * function App() {\n * return (\n * <RefletProvider\n * publicKey=\"fb_pub_xxx\"\n * user={{ id: 'user_123', email: 'user@example.com', name: 'John' }}\n * >\n * <YourApp />\n * </RefletProvider>\n * );\n * }\n * ```\n */\nexport function RefletProvider({\n publicKey,\n baseUrl,\n user: initialUser,\n userToken,\n children,\n}: RefletProviderProps) {\n const [user, setUser] = useState<RefletUser | undefined>(initialUser);\n const [isReady, setIsReady] = useState(false);\n\n const client = useMemo(() => {\n const config: RefletConfig = {\n baseUrl,\n publicKey,\n user,\n userToken,\n };\n return new Reflet(config);\n }, [publicKey, baseUrl, user, userToken]);\n\n // Update client when user changes\n useEffect(() => {\n if (userToken) {\n client.setUserToken(userToken);\n } else {\n client.setUser(user);\n }\n }, [client, user, userToken]);\n\n // Mark as ready after mount\n useEffect(() => {\n setIsReady(true);\n }, []);\n\n const value = useMemo(\n () => ({\n baseUrl,\n client,\n isReady,\n publicKey,\n setUser,\n user,\n userToken,\n }),\n [client, publicKey, baseUrl, isReady, user, userToken]\n );\n\n return (\n <RefletContext.Provider value={value}>{children}</RefletContext.Provider>\n );\n}\n\n// ============================================\n// Hook to access context\n// ============================================\n\nexport function useRefletContext(): RefletContextValue {\n const context = useContext(RefletContext);\n if (!context) {\n throw new Error(\"useRefletContext must be used within a RefletProvider\");\n }\n return context;\n}\n\nexport function useRefletClient(): Reflet {\n const { client } = useRefletContext();\n return client;\n}\n"],"mappings":";;;;AAAA,MAAa,iBAAiB;CAC5B,kBAAkB;CAClB,aAAa;CACb,eAAe;CACf,eAAe;CACf,YAAY;AACd;;;ACuBA,MAAa,gBAAgB,cAAyC,IAAI;;;;;;;;;;;;;;;;;;;;AAsC1E,SAAgB,eAAe,EAC7B,WACA,SACA,MAAM,aACN,WACA,YACsB;CACtB,MAAM,CAAC,MAAM,WAAW,SAAiC,WAAW;CACpE,MAAM,CAAC,SAAS,cAAc,SAAS,KAAK;CAE5C,MAAM,SAAS,cAAc;EAO3B,OAAO,IAAI,OAAO;GALhB;GACA;GACA;GACA;EAEqB,CAAC;CAC1B,GAAG;EAAC;EAAW;EAAS;EAAM;CAAS,CAAC;CAGxC,gBAAgB;EACd,IAAI,WACF,OAAO,aAAa,SAAS;OAE7B,OAAO,QAAQ,IAAI;CAEvB,GAAG;EAAC;EAAQ;EAAM;CAAS,CAAC;CAG5B,gBAAgB;EACd,WAAW,IAAI;CACjB,GAAG,CAAC,CAAC;CAEL,MAAM,QAAQ,eACL;EACL;EACA;EACA;EACA;EACA;EACA;EACA;CACF,IACA;EAAC;EAAQ;EAAW;EAAS;EAAS;EAAM;CAAS,CACvD;CAEA,OACE,oBAAC,cAAc,UAAf;EAA+B;EAAQ;CAAiC,CAAA;AAE5E;AAMA,SAAgB,mBAAuC;CACrD,MAAM,UAAU,WAAW,aAAa;CACxC,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,uDAAuD;CAEzE,OAAO;AACT;AAEA,SAAgB,kBAA0B;CACxC,MAAM,EAAE,WAAW,iBAAiB;CACpC,OAAO;AACT"}
package/dist/react.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { D as RoadmapItem, E as Roadmap, O as RoadmapLane, _ as OrganizationConfig, d as FeedbackDetail, f as FeedbackItem, g as FeedbackTag, h as FeedbackStatus, i as Comment, o as CreateFeedbackParams, p as FeedbackListParams, r as ChangelogEntry, s as CreateFeedbackResponse, t as AddCommentParams, v as OrganizationSettings, w as RefletUser, x as RefletConfig, y as OrganizationStatus } from "./types-wANRMsGI.js";
2
- import { t as Reflet } from "./client-BpEYxx4d.js";
1
+ import { D as RoadmapItem, E as Roadmap, O as RoadmapLane, _ as OrganizationConfig, d as FeedbackDetail, f as FeedbackItem, g as FeedbackTag, h as FeedbackStatus, i as Comment, o as CreateFeedbackParams, p as FeedbackListParams, r as ChangelogEntry, s as CreateFeedbackResponse, t as AddCommentParams, v as OrganizationSettings, w as RefletUser, x as RefletConfig, y as OrganizationStatus } from "./types-Cak4ZkSy.js";
2
+ import { t as Reflet } from "./client-BomgCsXm.js";
3
3
  import { ReactNode } from "react";
4
4
  //#region src/react-changelog-widget.d.ts
5
5
  interface ChangelogWidgetProps {
@@ -92,12 +92,9 @@ export declare function useRefletContext(): RefletContextValue;
92
92
  export declare function useRefletClient(): Reflet;
93
93
  //#endregion
94
94
  //#region src/react-feedback-dialog-types.d.ts
95
- type FeedbackCategory = "feature" | "bug" | "question";
96
95
  interface FeedbackDialogLabels {
97
96
  cancel?: string;
98
- categoryBug?: string;
99
- categoryFeature?: string;
100
- categoryQuestion?: string;
97
+ close?: string;
101
98
  descriptionPlaceholder?: string;
102
99
  emailLabel?: string;
103
100
  emailPlaceholder?: string;
@@ -111,10 +108,6 @@ interface FeedbackDialogLabels {
111
108
  interface FeedbackDialogProps {
112
109
  /** API base URL override */
113
110
  baseUrl?: string;
114
- /** Categories to show (default: all three) */
115
- categories?: FeedbackCategory[];
116
- /** Default selected category */
117
- defaultCategory?: FeedbackCategory;
118
111
  /** Custom labels / i18n */
119
112
  labels?: FeedbackDialogLabels;
120
113
  /** Called when dialog closes */
@@ -140,7 +133,7 @@ interface FeedbackDialogProps {
140
133
  }
141
134
  //#endregion
142
135
  //#region src/react-feedback-dialog.d.ts
143
- export declare function FeedbackDialog({ open, onOpenChange, publicKey, baseUrl, user, userToken, theme, primaryColor, defaultCategory, categories, labels: labelsProp, onSubmit, onOpen, onClose }: FeedbackDialogProps): import("react").JSX.Element | null;
136
+ export declare function FeedbackDialog({ open, onOpenChange, publicKey, baseUrl, user, userToken, theme, primaryColor, labels: labelsProp, onSubmit, onOpen, onClose }: FeedbackDialogProps): import("react").JSX.Element | null;
144
137
  //#endregion
145
138
  //#region src/react-feedback-button.d.ts
146
139
  interface FeedbackButtonProps {
@@ -151,14 +144,10 @@ interface FeedbackButtonProps {
151
144
  asChild?: boolean;
152
145
  /** API base URL override */
153
146
  baseUrl?: string;
154
- /** Categories to show */
155
- categories?: FeedbackCategory[];
156
147
  /** Custom trigger content or element (used with asChild) */
157
148
  children?: ReactNode;
158
149
  /** Custom CSS class for the default trigger button */
159
150
  className?: string;
160
- /** Default selected category */
161
- defaultCategory?: FeedbackCategory;
162
151
  /** Custom labels / i18n */
163
152
  labels?: FeedbackDialogLabels & {
164
153
  trigger?: string;
@@ -180,7 +169,7 @@ interface FeedbackButtonProps {
180
169
  /** Pre-signed user token */
181
170
  userToken?: string;
182
171
  }
183
- export declare function FeedbackButton({ publicKey, baseUrl, user, userToken, theme, primaryColor, defaultCategory, categories, labels, onSubmit, onOpen, onClose, className, asChild, children }: FeedbackButtonProps): import("react").JSX.Element;
172
+ export declare function FeedbackButton({ publicKey, baseUrl, user, userToken, theme, primaryColor, labels, onSubmit, onOpen, onClose, className, asChild, children }: FeedbackButtonProps): import("react").JSX.Element;
184
173
  //#endregion
185
174
  //#region src/react-hooks-types.d.ts
186
175
  interface UseQueryResult<T> {
@@ -273,5 +262,5 @@ export declare function useUnreadChangelogCount(publicKey: string): {
273
262
  markAsRead: () => void;
274
263
  };
275
264
  //#endregion
276
- export { type AddCommentParams, type ChangelogEntry, type Comment, type CreateFeedbackParams, type FeedbackButtonProps, type FeedbackCategory, type FeedbackDetail, type FeedbackDialogLabels, type FeedbackDialogProps, type FeedbackItem, type FeedbackListParams, type FeedbackStatus, type FeedbackTag, type OrganizationConfig, type OrganizationSettings, type OrganizationStatus, Reflet, type RefletConfig, type RefletContextValue, type RefletProviderProps, type RefletUser, type Roadmap, type RoadmapItem, type RoadmapLane, type UseFeedbackListOptions };
265
+ export { type AddCommentParams, type ChangelogEntry, type Comment, type CreateFeedbackParams, type FeedbackButtonProps, type FeedbackDetail, type FeedbackDialogLabels, type FeedbackDialogProps, type FeedbackItem, type FeedbackListParams, type FeedbackStatus, type FeedbackTag, type OrganizationConfig, type OrganizationSettings, type OrganizationStatus, Reflet, type RefletConfig, type RefletContextValue, type RefletProviderProps, type RefletUser, type Roadmap, type RoadmapItem, type RoadmapLane, type UseFeedbackListOptions };
277
266
  //# sourceMappingURL=react.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"react.d.ts","names":[],"sources":["../src/react-changelog-widget.tsx","../src/react-context.tsx","../src/react-feedback-dialog-types.ts","../src/react-feedback-dialog.tsx","../src/react-feedback-button.tsx","../src/react-hooks-types.ts","../src/react-mutation-hooks.ts","../src/react-query-hooks.ts"],"mappings":";;;;UAGU;EACR;EACA;EACA;EACA;EACA;EACA,gBAAgB,OAAO;EACvB;EACA;EACA;EACA;EACA;EACA;;UAGQ;EACR;EACA;EACA;EACA,YAAY;EACZ;EACA;;QAGM;YACI;IACR,6BACE,QAAQ,yBACL;;;;;;;;;;;;;;;;;wBAkBO,kBACd,WACA,MACA,UACA,OACA,cACA,YACA,iBACA,gBACA,QACA,QACA,SACA,gBACC;;;UC/Cc;EACf;EACA,QAAQ;EACR;EACA;EACA,UAAU,MAAM;EAChB,MAAM;EACN;;qBAOW,+BAAa,QAAA;UAMT;;EAEf;;EAEA,UAAU;;EAEV;;EAEA,OAAO;;EAEP;;;;;;;;;;;;;;;;;;;;;wBAsBc,iBACd,WACA,SACA,MAAM,aACN,WACA,YACC,sCAAmB,IAAA;wBAkDN,oBAAoB;wBAQpB,mBAAmB;;;KCjIvB;UAEK;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;;EAEf;;EAEA,aAAa;;EAEb,kBAAkB;;EAElB,SAAS;;EAET;;EAEA;;EAEA,eAAe;;EAEf,YAAY,QAAQ;;EAEpB;;EAEA;;EAEA;;EAEA;;EAEA,OAAO;;EAEP;;;;wBCnCc,iBACd,MACA,cACA,WACA,SACA,MACA,WACA,OACA,cACA,iBACA,YACA,QAAQ,YACR,UACA,QACA,WACC,sCAAmB,IAAA;;;UCRL;;;;;EAKf;;EAEA;;EAEA,aAAa;;EAEb,WAAW;;EAEX;;EAEA,kBAAkB;;EAElB,SAAS;IAAyB;;;EAElC;;EAEA;;EAEA,YAAY,QAAQ;;EAEpB;;EAEA;;EAEA;;EAEA,OAAO;;EAEP;;wBA6Bc,iBACd,WACA,SACA,MACA,WACA,OACA,cACA,iBACA,YACA,QACA,UACA,QACA,SACA,WACA,SACA,YACC,sCAAmB,IAAA;;;UClGL,eAAe;EAC9B,MAAM;EACN,OAAO;EACP;EACA,eAAe;;UAGA,kBAAkB,OAAO;EACxC,MAAM;EACN,OAAO;EACP;EACA,SAAS,WAAW,eAAe,QAAQ;EAC3C;;;;;;;;;;;;;;;;;wBCiDc,qBAAqB;EACjC;EAAoB;GACtB;;;;;;;;;;;;;wBA0Bc,WAAW;EACvB;EAAgB;;EAChB;EAAoB;;;;;wBAuBR,iBAAiB;EAC7B;GACF;;;;wBAiBc;EACd,YAAY,uBAAuB;IAAU;;EAC7C,cAAc,uBAAuB;IAAU;;EAC/C;EACA,OAAO;;;;wBCtFO,yBAAyB,eAAe;UAUvC,+BAA+B;EAC9C;;wBAGc,gBACd,UAAS,yBACR;EAAiB,OAAO;EAAgB;EAAe;;wBAyB1C,YACd,iCACC,eAAe;wBAiBF,YACd,gCACA,+BACC,eAAe;wBAiBF,cAAc,eAAe;wBAU7B,aAAa,iBAAiB,eAAe;wBAe7C,wBAAwB;EACtC;EACA"}
1
+ {"version":3,"file":"react.d.ts","names":[],"sources":["../src/react-changelog-widget.tsx","../src/react-context.tsx","../src/react-feedback-dialog-types.ts","../src/react-feedback-dialog.tsx","../src/react-feedback-button.tsx","../src/react-hooks-types.ts","../src/react-mutation-hooks.ts","../src/react-query-hooks.ts"],"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