@lumen-stack/react 0.9.3 → 0.10.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.cts CHANGED
@@ -2,7 +2,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
3
  import { ReactNode, RefObject } from 'react';
4
4
  import { LumenUser, AmplitudeIdentity, ScreenshotCaptureOptions, LumenRecordProvider, LumenClient, SubmitPayload, SubmitOptions, SubmitResult, CaptureResult } from '@lumen-stack/core';
5
- export { CaptureMetadata, CaptureMethod, CapturePlatform, CaptureResult, FeedbackCategory, LUMEN_SHAKE_MESSAGE, LumenClient, LumenError, LumenRecordProvider, LumenRecordingResult, LumenRecordingSession, LumenUser, NativeCaptureProviderOptions, NativeCaptureRequest, NativeCaptureResponse, ScreenshotCaptureMode, ScreenshotCaptureOptions, ScreenshotCaptureProvider, ShakeMessage, SubmitPayload, SubmitResult, VideoRecorderHandle, VideoRecording, createNativeCaptureProvider, isLumenEventTarget } from '@lumen-stack/core';
5
+ export { CaptureMetadata, CaptureMethod, CapturePlatform, CaptureResult, FeedbackCategory, LUMEN_KEYBOARD_CSS_VAR, LUMEN_KEYBOARD_EVENT, LUMEN_SHAKE_MESSAGE, LumenClient, LumenError, LumenRecordProvider, LumenRecordingResult, LumenRecordingSession, LumenUser, NativeCaptureProviderOptions, NativeCaptureRequest, NativeCaptureResponse, ScreenshotCaptureMode, ScreenshotCaptureOptions, ScreenshotCaptureProvider, ShakeMessage, SubmitPayload, SubmitResult, VideoRecorderHandle, VideoRecording, createNativeCaptureProvider, isLumenEventTarget, isolateLumenEvents, readLumenKeyboardInset, setLumenKeyboardInset } from '@lumen-stack/core';
6
6
 
7
7
  type LumenTriggerPlacement = "br" | "bl" | "tr" | "tl";
8
8
  interface FloatingTriggerConfig {
@@ -15,7 +15,15 @@ interface FloatingTriggerConfig {
15
15
  safeArea?: boolean;
16
16
  /** Selectors to clear; pass `false` to disable auto-detect entirely. */
17
17
  avoid?: string | string[] | false;
18
- hideOnKeyboard?: boolean;
18
+ /**
19
+ * What the floating trigger does when the soft keyboard opens:
20
+ * - `"auto"` (default) — lift the trigger above the keyboard when its height
21
+ * is known (incl. WebView hosts that inject it), else hide it.
22
+ * - `"lift"` — always lift by the keyboard inset.
23
+ * - `"hide"` — fade out (the pre-0.10 behavior).
24
+ * Booleans are accepted for back-compat: `true` → `"hide"`, `false` → off.
25
+ */
26
+ hideOnKeyboard?: boolean | "auto" | "lift" | "hide";
19
27
  zIndex?: number;
20
28
  label?: string;
21
29
  icon?: ReactNode;
@@ -157,9 +165,30 @@ interface LumenProviderProps {
157
165
  * Runs after `beforeOpen` and before the pre-open screenshot.
158
166
  */
159
167
  onTriggerActivate?: (event?: Event) => void | Promise<void>;
168
+ /**
169
+ * Stop the trigger's own pointer/click events from bubbling into host
170
+ * outside-click handlers (Silk/Vaul/Radix), so a host bottom sheet/dialog
171
+ * stays open when the user taps the Lumen trigger. Default `true`. Hosts that
172
+ * listen in the capture phase should still guard with `isLumenEventTarget`.
173
+ */
174
+ isolateEvents?: boolean;
175
+ /**
176
+ * Soft-keyboard height (CSS px) for WebView hosts where
177
+ * `window.visualViewport` does NOT shrink (iOS WKWebView). When set, the
178
+ * trigger lifts above the keyboard and the modal keeps its focused input
179
+ * visible. Prefer `setLumenKeyboardInset()` from injected JS for a native
180
+ * shell; this prop is for same-process hosts that already track the height.
181
+ */
182
+ keyboardInset?: number;
183
+ /**
184
+ * Hide the floating/notch trigger while a host overlay owns the screen (the
185
+ * host's own modal, a full-screen route, etc.). The sheet stays openable
186
+ * programmatically via `useLumen().open()`. Default `false`.
187
+ */
188
+ suppressTrigger?: boolean;
160
189
  children: React.ReactNode;
161
190
  }
162
- declare function LumenProvider({ apiKey, apiUrl, user, amplitude, floatingButton, trigger, hideOn, theme, portalTarget, capture, record, shakeToOpen, onOpenChange, beforeOpen, onTriggerActivate, children, }: LumenProviderProps): react_jsx_runtime.JSX.Element;
191
+ declare function LumenProvider({ apiKey, apiUrl, user, amplitude, floatingButton, trigger, hideOn, theme, portalTarget, capture, record, shakeToOpen, onOpenChange, beforeOpen, onTriggerActivate, isolateEvents, keyboardInset, suppressTrigger, children, }: LumenProviderProps): react_jsx_runtime.JSX.Element;
163
192
 
164
193
  interface FeedbackButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
165
194
  variant?: "default" | "ghost" | "outline";
@@ -240,6 +269,10 @@ interface LumenContextValue {
240
269
  initialCaptureError: Error | null;
241
270
  /** True while the trigger has been activated and the pre-open capture is running. */
242
271
  isOpening: boolean;
272
+ /** Whether Lumen stops its own pointer/click events from leaking into host overlays. */
273
+ isolateEvents: boolean;
274
+ /** Soft-keyboard inset override (px) from the host, when provided. */
275
+ keyboardInset: number | undefined;
243
276
  openCapture: (event?: Event) => void;
244
277
  closeCapture: () => void;
245
278
  isSubmitting: boolean;
@@ -247,4 +280,21 @@ interface LumenContextValue {
247
280
  }
248
281
  declare function useLumen(): LumenContextValue;
249
282
 
250
- export { CaptureModal, FeedbackButton, type FeedbackButtonProps, type FloatingTriggerConfig, type HeadlessTriggerConfig, type InlineTriggerConfig, type LumenContextValue, LumenProvider, type LumenProviderProps, type LumenTheme, type LumenTrigger, type LumenTriggerPlacement, type NotchEdge, type NotchTriggerConfig, useLumen };
283
+ interface KeyboardInsetState {
284
+ /** True when the soft keyboard is judged to be covering the viewport. */
285
+ open: boolean;
286
+ /** Keyboard height (CSS px) to lift UI by. 0 when closed/unknown. */
287
+ inset: number;
288
+ }
289
+ /**
290
+ * Keyboard-awareness that works on web AND inside an iOS WKWebView.
291
+ *
292
+ * `window.visualViewport` does NOT shrink for the keyboard in a WKWebView, so a
293
+ * viewport-only approach silently fails there. This hook merges three sources
294
+ * (see {@link decideKeyboardInset}) and returns both whether the keyboard is
295
+ * open and how tall it is, so callers can lift the trigger / modal input above
296
+ * it rather than just hiding them.
297
+ */
298
+ declare function useKeyboardInset(enabled: boolean, override?: number): KeyboardInsetState;
299
+
300
+ export { CaptureModal, FeedbackButton, type FeedbackButtonProps, type FloatingTriggerConfig, type HeadlessTriggerConfig, type InlineTriggerConfig, type KeyboardInsetState, type LumenContextValue, LumenProvider, type LumenProviderProps, type LumenTheme, type LumenTrigger, type LumenTriggerPlacement, type NotchEdge, type NotchTriggerConfig, useKeyboardInset, useLumen };
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
3
  import { ReactNode, RefObject } from 'react';
4
4
  import { LumenUser, AmplitudeIdentity, ScreenshotCaptureOptions, LumenRecordProvider, LumenClient, SubmitPayload, SubmitOptions, SubmitResult, CaptureResult } from '@lumen-stack/core';
5
- export { CaptureMetadata, CaptureMethod, CapturePlatform, CaptureResult, FeedbackCategory, LUMEN_SHAKE_MESSAGE, LumenClient, LumenError, LumenRecordProvider, LumenRecordingResult, LumenRecordingSession, LumenUser, NativeCaptureProviderOptions, NativeCaptureRequest, NativeCaptureResponse, ScreenshotCaptureMode, ScreenshotCaptureOptions, ScreenshotCaptureProvider, ShakeMessage, SubmitPayload, SubmitResult, VideoRecorderHandle, VideoRecording, createNativeCaptureProvider, isLumenEventTarget } from '@lumen-stack/core';
5
+ export { CaptureMetadata, CaptureMethod, CapturePlatform, CaptureResult, FeedbackCategory, LUMEN_KEYBOARD_CSS_VAR, LUMEN_KEYBOARD_EVENT, LUMEN_SHAKE_MESSAGE, LumenClient, LumenError, LumenRecordProvider, LumenRecordingResult, LumenRecordingSession, LumenUser, NativeCaptureProviderOptions, NativeCaptureRequest, NativeCaptureResponse, ScreenshotCaptureMode, ScreenshotCaptureOptions, ScreenshotCaptureProvider, ShakeMessage, SubmitPayload, SubmitResult, VideoRecorderHandle, VideoRecording, createNativeCaptureProvider, isLumenEventTarget, isolateLumenEvents, readLumenKeyboardInset, setLumenKeyboardInset } from '@lumen-stack/core';
6
6
 
7
7
  type LumenTriggerPlacement = "br" | "bl" | "tr" | "tl";
8
8
  interface FloatingTriggerConfig {
@@ -15,7 +15,15 @@ interface FloatingTriggerConfig {
15
15
  safeArea?: boolean;
16
16
  /** Selectors to clear; pass `false` to disable auto-detect entirely. */
17
17
  avoid?: string | string[] | false;
18
- hideOnKeyboard?: boolean;
18
+ /**
19
+ * What the floating trigger does when the soft keyboard opens:
20
+ * - `"auto"` (default) — lift the trigger above the keyboard when its height
21
+ * is known (incl. WebView hosts that inject it), else hide it.
22
+ * - `"lift"` — always lift by the keyboard inset.
23
+ * - `"hide"` — fade out (the pre-0.10 behavior).
24
+ * Booleans are accepted for back-compat: `true` → `"hide"`, `false` → off.
25
+ */
26
+ hideOnKeyboard?: boolean | "auto" | "lift" | "hide";
19
27
  zIndex?: number;
20
28
  label?: string;
21
29
  icon?: ReactNode;
@@ -157,9 +165,30 @@ interface LumenProviderProps {
157
165
  * Runs after `beforeOpen` and before the pre-open screenshot.
158
166
  */
159
167
  onTriggerActivate?: (event?: Event) => void | Promise<void>;
168
+ /**
169
+ * Stop the trigger's own pointer/click events from bubbling into host
170
+ * outside-click handlers (Silk/Vaul/Radix), so a host bottom sheet/dialog
171
+ * stays open when the user taps the Lumen trigger. Default `true`. Hosts that
172
+ * listen in the capture phase should still guard with `isLumenEventTarget`.
173
+ */
174
+ isolateEvents?: boolean;
175
+ /**
176
+ * Soft-keyboard height (CSS px) for WebView hosts where
177
+ * `window.visualViewport` does NOT shrink (iOS WKWebView). When set, the
178
+ * trigger lifts above the keyboard and the modal keeps its focused input
179
+ * visible. Prefer `setLumenKeyboardInset()` from injected JS for a native
180
+ * shell; this prop is for same-process hosts that already track the height.
181
+ */
182
+ keyboardInset?: number;
183
+ /**
184
+ * Hide the floating/notch trigger while a host overlay owns the screen (the
185
+ * host's own modal, a full-screen route, etc.). The sheet stays openable
186
+ * programmatically via `useLumen().open()`. Default `false`.
187
+ */
188
+ suppressTrigger?: boolean;
160
189
  children: React.ReactNode;
161
190
  }
162
- declare function LumenProvider({ apiKey, apiUrl, user, amplitude, floatingButton, trigger, hideOn, theme, portalTarget, capture, record, shakeToOpen, onOpenChange, beforeOpen, onTriggerActivate, children, }: LumenProviderProps): react_jsx_runtime.JSX.Element;
191
+ declare function LumenProvider({ apiKey, apiUrl, user, amplitude, floatingButton, trigger, hideOn, theme, portalTarget, capture, record, shakeToOpen, onOpenChange, beforeOpen, onTriggerActivate, isolateEvents, keyboardInset, suppressTrigger, children, }: LumenProviderProps): react_jsx_runtime.JSX.Element;
163
192
 
164
193
  interface FeedbackButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
165
194
  variant?: "default" | "ghost" | "outline";
@@ -240,6 +269,10 @@ interface LumenContextValue {
240
269
  initialCaptureError: Error | null;
241
270
  /** True while the trigger has been activated and the pre-open capture is running. */
242
271
  isOpening: boolean;
272
+ /** Whether Lumen stops its own pointer/click events from leaking into host overlays. */
273
+ isolateEvents: boolean;
274
+ /** Soft-keyboard inset override (px) from the host, when provided. */
275
+ keyboardInset: number | undefined;
243
276
  openCapture: (event?: Event) => void;
244
277
  closeCapture: () => void;
245
278
  isSubmitting: boolean;
@@ -247,4 +280,21 @@ interface LumenContextValue {
247
280
  }
248
281
  declare function useLumen(): LumenContextValue;
249
282
 
250
- export { CaptureModal, FeedbackButton, type FeedbackButtonProps, type FloatingTriggerConfig, type HeadlessTriggerConfig, type InlineTriggerConfig, type LumenContextValue, LumenProvider, type LumenProviderProps, type LumenTheme, type LumenTrigger, type LumenTriggerPlacement, type NotchEdge, type NotchTriggerConfig, useLumen };
283
+ interface KeyboardInsetState {
284
+ /** True when the soft keyboard is judged to be covering the viewport. */
285
+ open: boolean;
286
+ /** Keyboard height (CSS px) to lift UI by. 0 when closed/unknown. */
287
+ inset: number;
288
+ }
289
+ /**
290
+ * Keyboard-awareness that works on web AND inside an iOS WKWebView.
291
+ *
292
+ * `window.visualViewport` does NOT shrink for the keyboard in a WKWebView, so a
293
+ * viewport-only approach silently fails there. This hook merges three sources
294
+ * (see {@link decideKeyboardInset}) and returns both whether the keyboard is
295
+ * open and how tall it is, so callers can lift the trigger / modal input above
296
+ * it rather than just hiding them.
297
+ */
298
+ declare function useKeyboardInset(enabled: boolean, override?: number): KeyboardInsetState;
299
+
300
+ export { CaptureModal, FeedbackButton, type FeedbackButtonProps, type FloatingTriggerConfig, type HeadlessTriggerConfig, type InlineTriggerConfig, type KeyboardInsetState, type LumenContextValue, LumenProvider, type LumenProviderProps, type LumenTheme, type LumenTrigger, type LumenTriggerPlacement, type NotchEdge, type NotchTriggerConfig, useKeyboardInset, useLumen };