@docyrus/ui-pro-ai-assistant 0.6.9 → 0.7.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/README.md CHANGED
@@ -271,7 +271,7 @@ The header renders a tab strip. The first tab is pinned to `tenantAiAgentId` and
271
271
  | `onMessageSend` | `(message: string) => void` | Fires when a message is sent |
272
272
  | `onVoiceStart` | `() => void` | Fires when voice recording starts |
273
273
  | `onVoiceEnd` | `() => void` | Fires when voice recording ends |
274
- | `onFullscreenChange` | `(isFullscreen: boolean) => void` | Fires when the assistant enters or exits fullscreen (true = entered) |
274
+ | `onFullscreenChange` | `(isFullscreen: boolean) => void` | Intercepts the expand button. When provided, replaces the package's built-in fullscreen toggle — the host receives the intended next state and decides what to do (toggle, redirect, etc.). When omitted, the package self-toggles its fullscreen state. |
275
275
  | `onShare` | `(info: { dataSourceId: string; recordId: string }) => void` | Custom share handler. When provided, the thread header share button calls this instead of the built-in sharing editor |
276
276
 
277
277
  #### Initial prompt
package/dist/index.js CHANGED
@@ -36794,25 +36794,23 @@ var DocyAssistant = ({
36794
36794
  }, 200);
36795
36795
  };
36796
36796
  const handleExpand = () => {
36797
+ if (onFullscreenChange) {
36798
+ const intendedNext = isInlineMode ? !isInlineFullscreen : !uiState.isExpanded;
36799
+ onFullscreenChange(intendedNext);
36800
+ return;
36801
+ }
36797
36802
  if (isInlineMode) {
36798
- setIsInlineFullscreen((prev) => {
36799
- const next = !prev;
36800
- onFullscreenChange?.(next);
36801
- return next;
36802
- });
36803
+ setIsInlineFullscreen((prev) => !prev);
36803
36804
  return;
36804
36805
  }
36805
36806
  if (uiState.isExpanded && renderMode === "inline") {
36806
36807
  uiActions.setRenderMode("inline");
36807
36808
  uiActions.setExpanded(false);
36808
36809
  uiActions.setDocked(false);
36809
- onFullscreenChange?.(false);
36810
36810
  return;
36811
36811
  }
36812
- const nextExpanded = !uiState.isExpanded;
36813
- uiActions.setExpanded(nextExpanded);
36812
+ uiActions.setExpanded(!uiState.isExpanded);
36814
36813
  uiActions.setDocked(false);
36815
- onFullscreenChange?.(nextExpanded);
36816
36814
  };
36817
36815
  const handleCreateProject = async (e) => {
36818
36816
  e.preventDefault();