@helpway/react 0.10.0 → 0.12.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
@@ -375,6 +375,59 @@ interface MessagePreviewProps {
375
375
  */
376
376
  declare function MessagePreview({ onOpen, avatar, placement, autoDismissMs, footer, }: MessagePreviewProps): react_jsx_runtime.JSX.Element | null;
377
377
 
378
+ /** Placement of the announcement stack — mirrors `MessagePreviewPlacement`. */
379
+ type AnnouncementPreviewsPlacement = "launcher" | "anchored";
380
+ /** Shape of a single announcement entry as it lives in the widget store. */
381
+ interface AnnouncementPreviewEntry {
382
+ title: string;
383
+ body: string | null;
384
+ slug: string;
385
+ tabId: string;
386
+ badge: string | null;
387
+ }
388
+ interface AnnouncementPreviewsProps {
389
+ /** Called when the visitor taps an announcement card. Receives the
390
+ * entry's slug + the parent tab id. The consumer decides what to
391
+ * do — at minimum `setOpen(true)`, optionally deep-link into the
392
+ * matching content tab + detail. */
393
+ onOpen: (slug: string, tabId: string) => void;
394
+ /** The avatar node shown in each card's header. Injected so the
395
+ * component is decoupled from avatar resolution; pass
396
+ * `<WidgetLogo />` for the SDK default. */
397
+ avatar: ReactNode;
398
+ /**
399
+ * Outer positioning mode. `"launcher"` (default) keeps the stack
400
+ * pinned above the floating bubble; `"anchored"` drops that and
401
+ * lets the consumer's positioned wrapper place the stack — and
402
+ * each card stretches to the wrapper width instead of the launcher
403
+ * 300px (via the same `.hw-preview--anchored` modifier the
404
+ * message preview uses).
405
+ */
406
+ placement?: AnnouncementPreviewsPlacement;
407
+ /**
408
+ * Optional caption rendered as a separated footer beneath each
409
+ * card (e.g. a "via X" provenance line). Omitted on the launcher
410
+ * so its visual stays byte-identical to the original.
411
+ */
412
+ footer?: ReactNode;
413
+ }
414
+ /**
415
+ * `<AnnouncementPreviews>` — proactive "new content" cards shown when
416
+ * the widget panel is closed and the visitor hasn't seen the latest
417
+ * entries from a "Promote new content" tab yet. Stacks multiple
418
+ * entries vertically.
419
+ *
420
+ * Extracted from the default widget so `hideLauncher` integrations can
421
+ * surface the *exact same* cards next to their own UI instead of the
422
+ * floating launcher. Visual/markup is byte-identical to the launcher
423
+ * version — only the outer positioning is parameterised via
424
+ * `placement`. Announcements never auto-dismiss (visitors need time to
425
+ * read); they're cleared by tapping the card or the ✕.
426
+ *
427
+ * Must be rendered inside `<SupportProvider>`.
428
+ */
429
+ declare function AnnouncementPreviews({ onOpen, avatar, placement, footer, }: AnnouncementPreviewsProps): react_jsx_runtime.JSX.Element | null;
430
+
378
431
  /**
379
432
  * Lightweight Markdown → HTML renderer.
380
433
  * Zero dependencies. Handles common patterns:
@@ -403,4 +456,4 @@ declare function MarkdownContent({ bodyHtml, bodyMarkdown, className, }: {
403
456
  className?: string;
404
457
  }): react_jsx_runtime.JSX.Element | null;
405
458
 
406
- export { Composer, DefaultWidget, type HelpwayPublicAPI, HelpwayWidget, type HelpwayWidgetProps, type IdentifyData, MarkdownContent, MessageBubble, MessageList, MessagePreview, type MessagePreviewPlacement, type MessagePreviewProps, SupportProvider, WidgetLogo, linkifyText, renderMarkdown, useComposer, useConversations, useIdentify, usePresence, useRealtime, useTimeline, useUnread, useWidget, useWidgetStore };
459
+ export { type AnnouncementPreviewEntry, AnnouncementPreviews, type AnnouncementPreviewsPlacement, type AnnouncementPreviewsProps, Composer, DefaultWidget, type HelpwayPublicAPI, HelpwayWidget, type HelpwayWidgetProps, type IdentifyData, MarkdownContent, MessageBubble, MessageList, MessagePreview, type MessagePreviewPlacement, type MessagePreviewProps, SupportProvider, WidgetLogo, linkifyText, renderMarkdown, useComposer, useConversations, useIdentify, usePresence, useRealtime, useTimeline, useUnread, useWidget, useWidgetStore };