@alepha/ui 0.36.1 → 0.37.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/account/$pageAccount.d.ts +1 -1
- package/dist/account/$pageAccount.d.ts.map +1 -1
- package/dist/account/$pageAccount.js.map +1 -1
- package/dist/account/AccountDisplay.d.ts +13 -0
- package/dist/account/AccountDisplay.d.ts.map +1 -0
- package/dist/account/AccountDisplay.js +48 -0
- package/dist/account/AccountDisplay.js.map +1 -0
- package/dist/account/AccountProfile.d.ts.map +1 -1
- package/dist/account/AccountProfile.js +14 -10
- package/dist/account/AccountProfile.js.map +1 -1
- package/dist/account/AccountRouter.d.ts +6 -6
- package/dist/account/AccountRouter.d.ts.map +1 -1
- package/dist/account/index.d.ts +5 -0
- package/dist/account/index.d.ts.map +1 -1
- package/dist/account/index.js +2 -1
- package/dist/admin/$pageAdmin.d.ts +1 -1
- package/dist/admin/$pageAdmin.d.ts.map +1 -1
- package/dist/admin/$pageAdmin.js.map +1 -1
- package/dist/admin/AdminAudits.js.map +1 -1
- package/dist/admin/AdminJobDetail.js.map +1 -1
- package/dist/admin/AdminJobs.js.map +1 -1
- package/dist/admin/AdminNotifications.js.map +1 -1
- package/dist/admin/AdminRouter.d.ts +14 -14
- package/dist/admin/AdminRouter.d.ts.map +1 -1
- package/dist/admin/AdminUserDetail.js.map +1 -1
- package/dist/admin/AdminUsers.js.map +1 -1
- package/dist/admin/ParameterHistoryItem.js.map +1 -1
- package/dist/ai/AiChat.d.ts +26 -39
- package/dist/ai/AiChat.d.ts.map +1 -1
- package/dist/ai/AiChat.js +65 -123
- package/dist/ai/AiChat.js.map +1 -1
- package/dist/ai/AiChatDock.d.ts +23 -0
- package/dist/ai/AiChatDock.d.ts.map +1 -0
- package/dist/ai/AiChatDock.js +90 -0
- package/dist/ai/AiChatDock.js.map +1 -0
- package/dist/ai/AiChatDockSlot.d.ts +15 -0
- package/dist/ai/AiChatDockSlot.d.ts.map +1 -0
- package/dist/ai/AiChatDockSlot.js +20 -0
- package/dist/ai/AiChatDockSlot.js.map +1 -0
- package/dist/ai/AiChatLauncher.d.ts +17 -0
- package/dist/ai/AiChatLauncher.d.ts.map +1 -0
- package/dist/ai/AiChatLauncher.js +42 -0
- package/dist/ai/AiChatLauncher.js.map +1 -0
- package/dist/ai/AiChatMessage.d.ts +6 -0
- package/dist/ai/AiChatMessage.d.ts.map +1 -1
- package/dist/ai/AiChatMessage.js +20 -4
- package/dist/ai/AiChatMessage.js.map +1 -1
- package/dist/ai/AiChatPanel.d.ts +71 -0
- package/dist/ai/AiChatPanel.d.ts.map +1 -0
- package/dist/ai/AiChatPanel.js +143 -0
- package/dist/ai/AiChatPanel.js.map +1 -0
- package/dist/ai/index.d.ts +8 -4
- package/dist/ai/index.d.ts.map +1 -1
- package/dist/ai/index.js +5 -1
- package/dist/ai/useAiChat.d.ts +12 -0
- package/dist/ai/useAiChat.d.ts.map +1 -1
- package/dist/ai/useAiChat.js +32 -15
- package/dist/ai/useAiChat.js.map +1 -1
- package/dist/auth/AuthLogin.d.ts +9 -0
- package/dist/auth/AuthLogin.d.ts.map +1 -1
- package/dist/auth/AuthLogin.js +2 -2
- package/dist/auth/AuthLogin.js.map +1 -1
- package/dist/auth/AuthRegister.d.ts +4 -1
- package/dist/auth/AuthRegister.d.ts.map +1 -1
- package/dist/auth/AuthRegister.js +1 -1
- package/dist/auth/AuthRegister.js.map +1 -1
- package/dist/auth/AuthResetPassword.d.ts +8 -0
- package/dist/auth/AuthResetPassword.d.ts.map +1 -1
- package/dist/auth/AuthResetPassword.js +2 -2
- package/dist/auth/AuthResetPassword.js.map +1 -1
- package/dist/auth/AuthRouter.d.ts +4 -4
- package/dist/auth/AuthRouter.d.ts.map +1 -1
- package/dist/core/Badge.d.ts.map +1 -1
- package/dist/core/Badge.js +7 -3
- package/dist/core/Badge.js.map +1 -1
- package/dist/core/Collapsible.d.ts +50 -0
- package/dist/core/Collapsible.d.ts.map +1 -0
- package/dist/core/Collapsible.js +70 -0
- package/dist/core/Collapsible.js.map +1 -0
- package/dist/core/Combobox.d.ts +7 -1
- package/dist/core/Combobox.d.ts.map +1 -1
- package/dist/core/Combobox.js +2 -2
- package/dist/core/Combobox.js.map +1 -1
- package/dist/core/PaneRail.d.ts +24 -7
- package/dist/core/PaneRail.d.ts.map +1 -1
- package/dist/core/PaneRail.js +24 -19
- package/dist/core/PaneRail.js.map +1 -1
- package/dist/core/Stepper.d.ts +36 -0
- package/dist/core/Stepper.d.ts.map +1 -0
- package/dist/core/Stepper.js +54 -0
- package/dist/core/Stepper.js.map +1 -0
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +3 -1
- package/dist/core/useToast.js +13 -13
- package/dist/core/useToast.js.map +1 -1
- package/dist/form/AutoForm.d.ts.map +1 -1
- package/dist/form/AutoForm.js +29 -0
- package/dist/form/AutoForm.js.map +1 -1
- package/dist/form/AutoFormErrorPopover.js +13 -3
- package/dist/form/AutoFormErrorPopover.js.map +1 -1
- package/dist/form/Control.d.ts +14 -1
- package/dist/form/Control.d.ts.map +1 -1
- package/dist/form/Control.js +12 -2
- package/dist/form/Control.js.map +1 -1
- package/dist/form/ControlDate.d.ts.map +1 -1
- package/dist/form/ControlDate.js +3 -0
- package/dist/form/ControlDate.js.map +1 -1
- package/dist/form/ControlDateRange.d.ts +12 -1
- package/dist/form/ControlDateRange.d.ts.map +1 -1
- package/dist/form/ControlDateRange.js +11 -1
- package/dist/form/ControlDateRange.js.map +1 -1
- package/dist/form/ControlNumber.d.ts.map +1 -1
- package/dist/form/ControlNumber.js +2 -0
- package/dist/form/ControlNumber.js.map +1 -1
- package/dist/form/ControlObject.d.ts.map +1 -1
- package/dist/form/ControlObject.js +15 -1
- package/dist/form/ControlObject.js.map +1 -1
- package/dist/form/ControlPassword.d.ts +4 -0
- package/dist/form/ControlPassword.d.ts.map +1 -1
- package/dist/form/ControlPassword.js +1 -0
- package/dist/form/ControlPassword.js.map +1 -1
- package/dist/form/ControlSelect.d.ts +23 -1
- package/dist/form/ControlSelect.d.ts.map +1 -1
- package/dist/form/ControlSelect.js +5 -0
- package/dist/form/ControlSelect.js.map +1 -1
- package/dist/form/ControlSelectCombobox.d.ts +11 -1
- package/dist/form/ControlSelectCombobox.d.ts.map +1 -1
- package/dist/form/ControlSelectCombobox.js +9 -1
- package/dist/form/ControlSelectCombobox.js.map +1 -1
- package/dist/form/ControlUpload.d.ts.map +1 -1
- package/dist/form/ControlUpload.js +1 -0
- package/dist/form/ControlUpload.js.map +1 -1
- package/dist/form/FormField.d.ts +5 -0
- package/dist/form/FormField.d.ts.map +1 -1
- package/dist/form/FormField.js +7 -0
- package/dist/form/FormField.js.map +1 -1
- package/dist/i18n/fr/uiFr.d.ts.map +1 -1
- package/dist/i18n/fr/uiFr.js +14 -0
- package/dist/i18n/fr/uiFr.js.map +1 -1
- package/dist/shell/$pageNav.d.ts +2 -2
- package/dist/shell/$pageNav.d.ts.map +1 -1
- package/dist/shell/$pageNav.js.map +1 -1
- package/dist/shell/AppShell.d.ts +6 -0
- package/dist/shell/AppShell.d.ts.map +1 -1
- package/dist/shell/AppShell.js +31 -27
- package/dist/shell/AppShell.js.map +1 -1
- package/dist/shell/ButtonSettings.d.ts +6 -2
- package/dist/shell/ButtonSettings.d.ts.map +1 -1
- package/dist/shell/ButtonSettings.js +17 -3
- package/dist/shell/ButtonSettings.js.map +1 -1
- package/dist/shell/ButtonSettingsVisionMenuItem.d.ts +16 -0
- package/dist/shell/ButtonSettingsVisionMenuItem.d.ts.map +1 -0
- package/dist/shell/ButtonSettingsVisionMenuItem.js +24 -0
- package/dist/shell/ButtonSettingsVisionMenuItem.js.map +1 -0
- package/dist/shell/ButtonVision.d.ts +28 -0
- package/dist/shell/ButtonVision.d.ts.map +1 -0
- package/dist/shell/ButtonVision.js +46 -0
- package/dist/shell/ButtonVision.js.map +1 -0
- package/dist/shell/index.d.ts +6 -3
- package/dist/shell/index.d.ts.map +1 -1
- package/dist/shell/index.js +2 -1
- package/dist/styles.css +57 -0
- package/dist/table/DataTable.d.ts.map +1 -1
- package/dist/table/DataTable.js +29 -4
- package/dist/table/DataTable.js.map +1 -1
- package/dist/table/DataTableColumnPicker.d.ts.map +1 -1
- package/dist/table/DataTableColumnPicker.js +1 -0
- package/dist/table/DataTableColumnPicker.js.map +1 -1
- package/dist/table/DataTableFilterBar.d.ts +1 -1
- package/dist/table/DataTableFilterBar.d.ts.map +1 -1
- package/dist/table/DataTableFilterBar.js +5 -108
- package/dist/table/DataTableFilterBar.js.map +1 -1
- package/dist/table/DataTableHeaderFilter.d.ts +51 -0
- package/dist/table/DataTableHeaderFilter.d.ts.map +1 -0
- package/dist/table/DataTableHeaderFilter.js +113 -0
- package/dist/table/DataTableHeaderFilter.js.map +1 -0
- package/dist/table/DataTableHeaderRow.d.ts +7 -0
- package/dist/table/DataTableHeaderRow.d.ts.map +1 -1
- package/dist/table/DataTableHeaderRow.js +92 -74
- package/dist/table/DataTableHeaderRow.js.map +1 -1
- package/dist/table/DataTableTabs.d.ts +42 -0
- package/dist/table/DataTableTabs.d.ts.map +1 -0
- package/dist/table/DataTableTabs.js +55 -0
- package/dist/table/DataTableTabs.js.map +1 -0
- package/dist/table/dataTableBaseProps.d.ts +12 -0
- package/dist/table/dataTableBaseProps.d.ts.map +1 -1
- package/dist/table/dataTablePersistence.d.ts.map +1 -1
- package/dist/table/dataTablePersistence.js +4 -2
- package/dist/table/dataTablePersistence.js.map +1 -1
- package/dist/table/dataTableTypes.d.ts +18 -0
- package/dist/table/dataTableTypes.d.ts.map +1 -1
- package/dist/table/index.d.ts +5 -2
- package/dist/table/index.d.ts.map +1 -1
- package/dist/table/index.js +2 -1
- package/dist/table/useDataTableColumns.d.ts.map +1 -1
- package/dist/table/useDataTableColumns.js +1 -0
- package/dist/table/useDataTableColumns.js.map +1 -1
- package/dist/table/useDataTableFilterModel.d.ts +110 -0
- package/dist/table/useDataTableFilterModel.d.ts.map +1 -0
- package/dist/table/useDataTableFilterModel.js +154 -0
- package/dist/table/useDataTableFilterModel.js.map +1 -0
- package/docs/packages-alepha-ui-account.md +4 -0
- package/docs/packages-alepha-ui-ai.md +5 -5
- package/docs/packages-alepha-ui-shell.md +4 -3
- package/docs/packages-alepha-ui-table.md +4 -2
- package/package.json +8 -8
- package/src/account/$pageAccount.tsx +5 -4
- package/src/account/AccountDisplay.tsx +58 -0
- package/src/account/AccountProfile.tsx +30 -42
- package/src/account/__tests__/AccountProfile.browser.spec.tsx +141 -0
- package/src/account/__tests__/AccountRecoveryCodes.browser.spec.tsx +1 -1
- package/src/account/index.ts +5 -0
- package/src/admin/$pageAdmin.tsx +5 -4
- package/src/admin/AdminAudits.tsx +1 -1
- package/src/admin/AdminJobDetail.tsx +1 -1
- package/src/admin/AdminJobs.tsx +1 -1
- package/src/admin/AdminNotifications.tsx +1 -1
- package/src/admin/AdminUserDetail.tsx +1 -1
- package/src/admin/AdminUsers.tsx +1 -1
- package/src/admin/ParameterHistoryItem.tsx +1 -1
- package/src/admin/__tests__/AdminFilesUsageCard.browser.spec.tsx +17 -9
- package/src/ai/AiChat.tsx +94 -183
- package/src/ai/AiChatDock.tsx +129 -0
- package/src/ai/AiChatDockSlot.tsx +23 -0
- package/src/ai/AiChatLauncher.tsx +58 -0
- package/src/ai/AiChatMessage.tsx +36 -2
- package/src/ai/AiChatPanel.tsx +252 -0
- package/src/ai/__tests__/AiChat.browser.spec.tsx +187 -5
- package/src/ai/index.ts +8 -4
- package/src/ai/useAiChat.ts +63 -14
- package/src/auth/AuthLogin.tsx +19 -4
- package/src/auth/AuthRegister.tsx +6 -3
- package/src/auth/AuthResetPassword.tsx +18 -8
- package/src/auth/__tests__/AuthCancel.browser.spec.tsx +129 -0
- package/src/core/Badge.tsx +7 -3
- package/src/core/Collapsible.tsx +95 -0
- package/src/core/Combobox.tsx +11 -3
- package/src/core/PaneRail.tsx +36 -20
- package/src/core/Stepper.tsx +118 -0
- package/src/core/__tests__/Badge.browser.spec.tsx +5 -5
- package/src/core/__tests__/Collapsible.browser.spec.tsx +88 -0
- package/src/core/__tests__/PaneRail.browser.spec.tsx +48 -0
- package/src/core/__tests__/Stepper.browser.spec.tsx +39 -0
- package/src/core/__tests__/primitiveSlots.spec.ts +7 -0
- package/src/core/index.ts +15 -0
- package/src/form/AutoForm.tsx +32 -0
- package/src/form/AutoFormErrorPopover.tsx +27 -6
- package/src/form/Control.tsx +22 -0
- package/src/form/ControlDate.tsx +3 -0
- package/src/form/ControlDateRange.tsx +87 -58
- package/src/form/ControlNumber.tsx +2 -0
- package/src/form/ControlObject.tsx +20 -1
- package/src/form/ControlPassword.tsx +5 -0
- package/src/form/ControlSelect.tsx +32 -1
- package/src/form/ControlSelectCombobox.tsx +82 -56
- package/src/form/ControlUpload.tsx +1 -0
- package/src/form/FormField.tsx +23 -1
- package/src/form/__tests__/ControlFieldErrors.browser.spec.tsx +253 -0
- package/src/form/__tests__/ControlValidateMode.browser.spec.tsx +217 -0
- package/src/form/__tests__/ControlVariantErrors.browser.spec.tsx +133 -0
- package/src/i18n/fr/uiFr.ts +18 -1
- package/src/markdown/css.d.ts +11 -0
- package/src/shell/$pageNav.tsx +6 -4
- package/src/shell/AppShell.tsx +7 -0
- package/src/shell/ButtonSettings.tsx +20 -5
- package/src/shell/ButtonSettingsVisionMenuItem.tsx +40 -0
- package/src/shell/ButtonVision.tsx +73 -0
- package/src/shell/__tests__/ButtonSettings.browser.spec.tsx +42 -2
- package/src/shell/__tests__/ButtonVision.browser.spec.tsx +73 -0
- package/src/shell/__tests__/visionTokens.spec.ts +104 -0
- package/src/shell/index.ts +6 -3
- package/src/styles.css +57 -0
- package/src/table/DataTable.tsx +52 -4
- package/src/table/DataTableColumnPicker.tsx +3 -0
- package/src/table/DataTableFilterBar.tsx +18 -191
- package/src/table/DataTableHeaderFilter.tsx +156 -0
- package/src/table/DataTableHeaderRow.tsx +78 -40
- package/src/table/DataTableTabs.tsx +114 -0
- package/src/table/__tests__/DataTableHeaderFilter.browser.spec.tsx +174 -0
- package/src/table/__tests__/DataTableStaleColumns.browser.spec.tsx +80 -0
- package/src/table/__tests__/DataTableTabs.browser.spec.tsx +72 -0
- package/src/table/dataTableBaseProps.ts +12 -0
- package/src/table/dataTablePersistence.ts +11 -5
- package/src/table/dataTableTypes.ts +18 -0
- package/src/table/index.ts +9 -2
- package/src/table/useDataTableColumns.ts +1 -0
- package/src/table/useDataTableFilterModel.tsx +240 -0
package/src/ai/AiChat.tsx
CHANGED
|
@@ -1,77 +1,69 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { SquarePen, Sparkles, X } from "lucide-react";
|
|
3
|
-
import { type ComponentType, useEffect, useRef } from "react";
|
|
1
|
+
import { useEffect, useState, useSyncExternalStore } from "react";
|
|
4
2
|
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
DrawerClose,
|
|
10
|
-
DrawerContent,
|
|
11
|
-
DrawerTitle,
|
|
12
|
-
} from "../core/Drawer.tsx";
|
|
13
|
-
import { Spinner } from "../core/Spinner.tsx";
|
|
14
|
-
import {
|
|
15
|
-
type MarkdownLinkRenderer,
|
|
16
|
-
MarkdownView,
|
|
17
|
-
} from "../markdown/MarkdownView.tsx";
|
|
18
|
-
import { AiChatComposer } from "./AiChatComposer.tsx";
|
|
19
|
-
import {
|
|
20
|
-
AiChatConfirmCard,
|
|
21
|
-
type AiChatConfirmCardProps,
|
|
22
|
-
} from "./AiChatConfirmCard.tsx";
|
|
23
|
-
import { AiChatEmpty, type AiChatSuggestion } from "./AiChatEmpty.tsx";
|
|
24
|
-
import { AiChatHistory } from "./AiChatHistory.tsx";
|
|
25
|
-
import { AiChatMessage, type AiChatToolLabel } from "./AiChatMessage.tsx";
|
|
3
|
+
import { Drawer, DrawerContent, DrawerTitle } from "../core/Drawer.tsx";
|
|
4
|
+
import { AiChatDock } from "./AiChatDock.tsx";
|
|
5
|
+
import { AiChatLauncher } from "./AiChatLauncher.tsx";
|
|
6
|
+
import { AiChatPanel, type AiChatViewProps } from "./AiChatPanel.tsx";
|
|
26
7
|
import { type UseAiChatOptions, useAiChat } from "./useAiChat.ts";
|
|
27
8
|
|
|
28
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Where the conversation sits.
|
|
11
|
+
* - `drawer`: a modal drawer from the right, over a dimmed page.
|
|
12
|
+
* - `dock`: a panel beside the page, which stays readable and usable
|
|
13
|
+
* (see `AiChatDock`), and folds into a pill.
|
|
14
|
+
* - `auto`: the dock from 1024px up, the drawer below, where a page has no
|
|
15
|
+
* width to give.
|
|
16
|
+
*/
|
|
17
|
+
export type AiChatMode = "auto" | "dock" | "drawer";
|
|
18
|
+
|
|
19
|
+
export interface AiChatProps extends UseAiChatOptions, AiChatViewProps {
|
|
29
20
|
open: boolean;
|
|
30
21
|
onOpenChange: (open: boolean) => void;
|
|
31
22
|
/**
|
|
32
|
-
*
|
|
33
|
-
*/
|
|
34
|
-
title?: string;
|
|
35
|
-
/**
|
|
36
|
-
* Offer the list of past conversations, in a header menu. Default true.
|
|
37
|
-
*/
|
|
38
|
-
history?: boolean;
|
|
39
|
-
/**
|
|
40
|
-
* Questions a new conversation offers to start from.
|
|
41
|
-
*/
|
|
42
|
-
suggestions?: AiChatSuggestion[];
|
|
43
|
-
/**
|
|
44
|
-
* Names each tool step in the user's words ("Searched clients"), running
|
|
45
|
-
* and done. Without it a step shows the tool's own name.
|
|
46
|
-
*/
|
|
47
|
-
toolLabel?: AiChatToolLabel;
|
|
48
|
-
/**
|
|
49
|
-
* A confirmation card per tool name, in place of the generic field list:
|
|
50
|
-
* an app shows a booking as a booking. It gets the pending call as the
|
|
51
|
-
* server stored it, and the approve and deny callbacks.
|
|
52
|
-
*/
|
|
53
|
-
confirmCards?: Record<string, ComponentType<AiChatConfirmCardProps>>;
|
|
54
|
-
/**
|
|
55
|
-
* How links in the assistant's replies render (`MarkdownView`'s
|
|
56
|
-
* `renderLink`): route the paths the app knows, leave the rest as text.
|
|
23
|
+
* Where the conversation sits. Defaults to `drawer`.
|
|
57
24
|
*/
|
|
58
|
-
|
|
25
|
+
mode?: AiChatMode;
|
|
59
26
|
}
|
|
60
27
|
|
|
28
|
+
const DOCK_QUERY = "(min-width: 1024px)";
|
|
29
|
+
|
|
30
|
+
const subscribe = (onChange: () => void) => {
|
|
31
|
+
const mql = window.matchMedia?.(DOCK_QUERY);
|
|
32
|
+
mql?.addEventListener("change", onChange);
|
|
33
|
+
return () => mql?.removeEventListener("change", onChange);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* True where `auto` docks. The server snapshot is false, which is also what
|
|
38
|
+
* the hydration render reads, and the chat is closed on the server anyway.
|
|
39
|
+
*/
|
|
40
|
+
const useWideScreen = () =>
|
|
41
|
+
useSyncExternalStore(
|
|
42
|
+
subscribe,
|
|
43
|
+
() => window.matchMedia?.(DOCK_QUERY).matches ?? false,
|
|
44
|
+
() => false,
|
|
45
|
+
);
|
|
46
|
+
|
|
61
47
|
/**
|
|
62
|
-
* The assistant in a drawer
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
* through `useAiContext()`, and runs `navigate` and `fillForm` for the model.
|
|
48
|
+
* The assistant: the conversation of `AiChatPanel`, in a drawer or a dock.
|
|
49
|
+
* It knows the page through `useAiContext()`, and runs `navigate` and
|
|
50
|
+
* `fillForm` for the model. The conversation lives here, so it survives a
|
|
51
|
+
* close, a minimize and a switch between drawer and dock.
|
|
67
52
|
*
|
|
68
|
-
*
|
|
53
|
+
* A docked chat minimizes into a pill (`AiChatLauncher`): it reports itself
|
|
54
|
+
* closed through `onOpenChange(false)`, so the app's own button opens it
|
|
55
|
+
* again, and the pill does too.
|
|
56
|
+
*
|
|
57
|
+
* Needs `AlephaApiAi` on the server and a `$ai` declared by the app. A dock
|
|
58
|
+
* needs an `AiChatDockSlot` in the layout to make room for it (`AppShell`'s
|
|
59
|
+
* `aside`); without one it floats over the page's right edge.
|
|
69
60
|
*
|
|
70
61
|
* @example
|
|
71
62
|
* ```tsx
|
|
72
63
|
* const [open, setOpen] = useState(false);
|
|
73
64
|
* <Button onClick={() => setOpen(true)}>Ask</Button>
|
|
74
65
|
* <AiChat
|
|
66
|
+
* mode="auto"
|
|
75
67
|
* open={open}
|
|
76
68
|
* onOpenChange={setOpen}
|
|
77
69
|
* suggestions={[{ label: "Who still owes today?" }]}
|
|
@@ -79,150 +71,69 @@ export interface AiChatProps extends UseAiChatOptions {
|
|
|
79
71
|
* ```
|
|
80
72
|
*/
|
|
81
73
|
export const AiChat = (props: AiChatProps) => {
|
|
82
|
-
const { tr } = useI18n();
|
|
83
74
|
const chat = useAiChat(props);
|
|
84
|
-
const
|
|
85
|
-
const
|
|
86
|
-
const
|
|
75
|
+
const wide = useWideScreen();
|
|
76
|
+
const [minimized, setMinimized] = useState(false);
|
|
77
|
+
const mode = props.mode ?? "drawer";
|
|
78
|
+
const docked = mode === "dock" || (mode === "auto" && wide);
|
|
87
79
|
|
|
88
|
-
//
|
|
80
|
+
// Opened again, from the pill or from the app's own button: the pill goes.
|
|
89
81
|
useEffect(() => {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
82
|
+
if (props.open) {
|
|
83
|
+
// oxlint-disable-next-line react/set-state-in-effect -- `open` is the app's state; the pill follows it
|
|
84
|
+
setMinimized(false);
|
|
93
85
|
}
|
|
94
|
-
}, [
|
|
86
|
+
}, [props.open]);
|
|
95
87
|
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
args: [chat.activity],
|
|
101
|
-
}))
|
|
102
|
-
: undefined;
|
|
88
|
+
const close = () => {
|
|
89
|
+
setMinimized(false);
|
|
90
|
+
props.onOpenChange(false);
|
|
91
|
+
};
|
|
103
92
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
93
|
+
if (docked) {
|
|
94
|
+
if (props.open) {
|
|
95
|
+
return (
|
|
96
|
+
<AiChatDock>
|
|
97
|
+
<AiChatPanel
|
|
98
|
+
{...props}
|
|
99
|
+
chat={chat}
|
|
100
|
+
onClose={close}
|
|
101
|
+
onMinimize={() => {
|
|
102
|
+
setMinimized(true);
|
|
103
|
+
props.onOpenChange(false);
|
|
104
|
+
}}
|
|
105
|
+
/>
|
|
106
|
+
</AiChatDock>
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
return minimized ? (
|
|
110
|
+
<AiChatLauncher
|
|
111
|
+
chat={chat}
|
|
112
|
+
title={props.title}
|
|
113
|
+
onRestore={() => props.onOpenChange(true)}
|
|
114
|
+
/>
|
|
115
|
+
) : null;
|
|
116
|
+
}
|
|
107
117
|
|
|
108
118
|
return (
|
|
109
119
|
<Drawer
|
|
110
120
|
open={props.open}
|
|
111
|
-
onOpenChange={(open) => props.onOpenChange(
|
|
121
|
+
onOpenChange={(open) => (open ? props.onOpenChange(true) : close())}
|
|
112
122
|
swipeDirection="right"
|
|
113
123
|
>
|
|
114
124
|
<DrawerContent
|
|
115
|
-
data-testid="ai-chat"
|
|
116
125
|
// From `sm` up the panel floats: a gap from the page's edges, every
|
|
117
126
|
// corner rounded, a shadow, and no bleed strip past its edge.
|
|
118
127
|
className="flex h-full w-full flex-col gap-0 p-0 sm:h-[calc(100dvh-1.5rem)] sm:max-w-md sm:[--drawer-inset:0.75rem] sm:after:hidden sm:data-[swipe-direction=right]:rounded-2xl sm:data-[swipe-direction=right]:border sm:data-[swipe-direction=right]:shadow-2xl"
|
|
119
128
|
>
|
|
120
|
-
<
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
<AiChatHistory
|
|
127
|
-
current={chat.conversationId}
|
|
128
|
-
disabled={chat.loading}
|
|
129
|
-
onOpen={(id) => chat.open(id)}
|
|
130
|
-
/>
|
|
129
|
+
<AiChatPanel
|
|
130
|
+
{...props}
|
|
131
|
+
chat={chat}
|
|
132
|
+
onClose={close}
|
|
133
|
+
renderTitle={(title, className) => (
|
|
134
|
+
<DrawerTitle className={className}>{title}</DrawerTitle>
|
|
131
135
|
)}
|
|
132
|
-
|
|
133
|
-
size="icon-sm"
|
|
134
|
-
variant="minimal"
|
|
135
|
-
disabled={chat.loading || empty}
|
|
136
|
-
aria-label={tr("ai.chat.new", { default: "New conversation" })}
|
|
137
|
-
onClick={() => chat.open(undefined)}
|
|
138
|
-
>
|
|
139
|
-
<SquarePen className="size-4" />
|
|
140
|
-
</Button>
|
|
141
|
-
<DrawerClose
|
|
142
|
-
render={
|
|
143
|
-
<Button
|
|
144
|
-
size="icon-sm"
|
|
145
|
-
variant="minimal"
|
|
146
|
-
aria-label={tr("ai.chat.close", { default: "Close" })}
|
|
147
|
-
/>
|
|
148
|
-
}
|
|
149
|
-
>
|
|
150
|
-
<X className="size-4" />
|
|
151
|
-
</DrawerClose>
|
|
152
|
-
</div>
|
|
153
|
-
<div
|
|
154
|
-
ref={thread}
|
|
155
|
-
// `shrink-0` on every line: in a scrolling column a card (overflow
|
|
156
|
-
// hidden, so no content minimum) would shrink to its border once
|
|
157
|
-
// the thread outgrows the drawer (#Q3174).
|
|
158
|
-
className="flex min-h-0 flex-1 flex-col gap-3 overflow-y-auto px-4 py-4 *:shrink-0"
|
|
159
|
-
>
|
|
160
|
-
{empty ? (
|
|
161
|
-
<AiChatEmpty
|
|
162
|
-
suggestions={props.suggestions}
|
|
163
|
-
disabled={chat.loading}
|
|
164
|
-
onPick={(prompt) => chat.send(prompt)}
|
|
165
|
-
/>
|
|
166
|
-
) : (
|
|
167
|
-
<>
|
|
168
|
-
{chat.items.map((item) => (
|
|
169
|
-
<AiChatMessage
|
|
170
|
-
key={item.id}
|
|
171
|
-
item={item}
|
|
172
|
-
renderLink={props.renderLink}
|
|
173
|
-
toolLabel={props.toolLabel}
|
|
174
|
-
/>
|
|
175
|
-
))}
|
|
176
|
-
{chat.streaming && (
|
|
177
|
-
<div
|
|
178
|
-
data-testid="ai-chat-streaming"
|
|
179
|
-
className="mr-4 self-start text-sm leading-relaxed"
|
|
180
|
-
>
|
|
181
|
-
<MarkdownView
|
|
182
|
-
content={chat.streaming}
|
|
183
|
-
renderLink={props.renderLink}
|
|
184
|
-
/>
|
|
185
|
-
</div>
|
|
186
|
-
)}
|
|
187
|
-
{running && (
|
|
188
|
-
<div className="text-muted-foreground flex items-center gap-1.5 px-0.5 text-xs">
|
|
189
|
-
<Spinner className="size-3.5" />
|
|
190
|
-
{running}
|
|
191
|
-
</div>
|
|
192
|
-
)}
|
|
193
|
-
{busy && !running && !chat.streaming && (
|
|
194
|
-
<div
|
|
195
|
-
className="text-muted-foreground flex items-center gap-1.5 px-0.5 text-xs"
|
|
196
|
-
aria-live="polite"
|
|
197
|
-
>
|
|
198
|
-
<Spinner className="size-3.5" />
|
|
199
|
-
{tr("ai.chat.thinking", { default: "Thinking…" })}
|
|
200
|
-
</div>
|
|
201
|
-
)}
|
|
202
|
-
{chat.pending?.kind === "confirm" && Card && (
|
|
203
|
-
<Card
|
|
204
|
-
pending={chat.pending}
|
|
205
|
-
loading={chat.loading}
|
|
206
|
-
onApprove={() => chat.approve()}
|
|
207
|
-
onDeny={() => chat.deny()}
|
|
208
|
-
/>
|
|
209
|
-
)}
|
|
210
|
-
</>
|
|
211
|
-
)}
|
|
212
|
-
{chat.error && (
|
|
213
|
-
<Alert variant="destructive" data-testid="ai-chat-error">
|
|
214
|
-
<AlertDescription>{chat.error}</AlertDescription>
|
|
215
|
-
</Alert>
|
|
216
|
-
)}
|
|
217
|
-
</div>
|
|
218
|
-
<div className="border-border border-t px-3 pt-3 pb-2.5">
|
|
219
|
-
<AiChatComposer
|
|
220
|
-
busy={busy}
|
|
221
|
-
waiting={chat.pending?.kind === "confirm"}
|
|
222
|
-
onSend={(message) => chat.send(message)}
|
|
223
|
-
onStop={() => chat.stop()}
|
|
224
|
-
/>
|
|
225
|
-
</div>
|
|
136
|
+
/>
|
|
226
137
|
</DrawerContent>
|
|
227
138
|
</Drawer>
|
|
228
139
|
);
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { useI18n } from "alepha/react/i18n";
|
|
2
|
+
import {
|
|
3
|
+
type PointerEvent as ReactPointerEvent,
|
|
4
|
+
type ReactNode,
|
|
5
|
+
useCallback,
|
|
6
|
+
useEffect,
|
|
7
|
+
useRef,
|
|
8
|
+
useState,
|
|
9
|
+
} from "react";
|
|
10
|
+
import { createPortal } from "react-dom";
|
|
11
|
+
|
|
12
|
+
import { cn } from "../core/utils.ts";
|
|
13
|
+
import { AI_CHAT_DOCK_SLOT } from "./AiChatDockSlot.tsx";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The clamp on the dock's width. Narrower than 320px and a confirmation card
|
|
17
|
+
* wraps every field; wider than 640px and the page it sits beside is what
|
|
18
|
+
* suffers.
|
|
19
|
+
*/
|
|
20
|
+
export const AI_CHAT_DOCK_MIN = 320;
|
|
21
|
+
export const AI_CHAT_DOCK_MAX = 640;
|
|
22
|
+
export const AI_CHAT_DOCK_DEFAULT = 384;
|
|
23
|
+
|
|
24
|
+
const STORAGE_KEY = "alepha.ui.ai.dockWidth";
|
|
25
|
+
|
|
26
|
+
const clamp = (value: number): number =>
|
|
27
|
+
Math.max(AI_CHAT_DOCK_MIN, Math.min(AI_CHAT_DOCK_MAX, Math.round(value)));
|
|
28
|
+
|
|
29
|
+
export interface AiChatDockProps {
|
|
30
|
+
children: ReactNode;
|
|
31
|
+
className?: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* The assistant beside the page, not over it: no backdrop, no focus trap,
|
|
36
|
+
* nothing that closes it on a click elsewhere, so the page stays readable
|
|
37
|
+
* and usable while the conversation goes on, and a link in a reply changes
|
|
38
|
+
* the page next to it. It renders into the layout's `AiChatDockSlot`, which
|
|
39
|
+
* narrows the page to make room, and its left edge drags to resize; the
|
|
40
|
+
* width is remembered in this browser.
|
|
41
|
+
*/
|
|
42
|
+
export const AiChatDock = (props: AiChatDockProps) => {
|
|
43
|
+
const { tr } = useI18n();
|
|
44
|
+
const [target, setTarget] = useState<{ node: Element; slot: boolean }>();
|
|
45
|
+
const [width, setWidth] = useState(AI_CHAT_DOCK_DEFAULT);
|
|
46
|
+
const drag = useRef<{ x: number; width: number } | null>(null);
|
|
47
|
+
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
// After the commit, not in an initializer: the server has no document,
|
|
50
|
+
// and the slot is a sibling the same commit mounts.
|
|
51
|
+
const slot = document.querySelector(`[data-slot="${AI_CHAT_DOCK_SLOT}"]`);
|
|
52
|
+
// oxlint-disable-next-line react/set-state-in-effect -- the portal target only exists after the commit, see above
|
|
53
|
+
setTarget(
|
|
54
|
+
slot ? { node: slot, slot: true } : { node: document.body, slot: false },
|
|
55
|
+
);
|
|
56
|
+
try {
|
|
57
|
+
const stored = window.localStorage.getItem(STORAGE_KEY);
|
|
58
|
+
if (stored) setWidth(clamp(Number(stored)));
|
|
59
|
+
} catch {
|
|
60
|
+
// Private mode, or storage denied: the default width is a fine answer.
|
|
61
|
+
}
|
|
62
|
+
}, []);
|
|
63
|
+
|
|
64
|
+
useEffect(() => {
|
|
65
|
+
const onMove = (event: PointerEvent) => {
|
|
66
|
+
if (!drag.current) return;
|
|
67
|
+
// The handle is on the left edge: dragging left widens the dock.
|
|
68
|
+
setWidth(clamp(drag.current.width - (event.clientX - drag.current.x)));
|
|
69
|
+
};
|
|
70
|
+
const onUp = () => {
|
|
71
|
+
if (!drag.current) return;
|
|
72
|
+
drag.current = null;
|
|
73
|
+
document.body.style.removeProperty("cursor");
|
|
74
|
+
try {
|
|
75
|
+
window.localStorage.setItem(STORAGE_KEY, String(width));
|
|
76
|
+
} catch {
|
|
77
|
+
// Losing the preference is not worth an error.
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
document.addEventListener("pointermove", onMove);
|
|
81
|
+
document.addEventListener("pointerup", onUp);
|
|
82
|
+
return () => {
|
|
83
|
+
document.removeEventListener("pointermove", onMove);
|
|
84
|
+
document.removeEventListener("pointerup", onUp);
|
|
85
|
+
};
|
|
86
|
+
}, [width]);
|
|
87
|
+
|
|
88
|
+
const startResize = useCallback(
|
|
89
|
+
(event: ReactPointerEvent) => {
|
|
90
|
+
drag.current = { x: event.clientX, width };
|
|
91
|
+
// Keeps the resize cursor while the pointer outruns the strip.
|
|
92
|
+
document.body.style.cursor = "col-resize";
|
|
93
|
+
event.preventDefault();
|
|
94
|
+
},
|
|
95
|
+
[width],
|
|
96
|
+
);
|
|
97
|
+
|
|
98
|
+
if (!target) {
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
return createPortal(
|
|
103
|
+
<aside
|
|
104
|
+
data-testid="ai-chat-dock"
|
|
105
|
+
aria-label={tr("ai.chat.title", { default: "Assistant" })}
|
|
106
|
+
style={{ width }}
|
|
107
|
+
className={cn(
|
|
108
|
+
"bg-card text-card-foreground relative flex flex-col overflow-hidden rounded-xl border text-sm shadow-sm",
|
|
109
|
+
target.slot
|
|
110
|
+
? // In the layout's column: a card the page narrows for, kept in
|
|
111
|
+
// view when the page itself scrolls.
|
|
112
|
+
"sticky top-2 my-2 me-2 h-[calc(100%-1rem)] max-h-[calc(100svh-1rem)]"
|
|
113
|
+
: // No slot: over the page's right edge, still without a backdrop.
|
|
114
|
+
"fixed inset-y-2 end-2 z-40 shadow-2xl",
|
|
115
|
+
props.className,
|
|
116
|
+
)}
|
|
117
|
+
>
|
|
118
|
+
<div
|
|
119
|
+
role="separator"
|
|
120
|
+
aria-orientation="vertical"
|
|
121
|
+
aria-label={tr("ai.chat.resize", { default: "Resize the assistant" })}
|
|
122
|
+
onPointerDown={startResize}
|
|
123
|
+
className="hover:bg-primary/20 absolute inset-y-0 start-0 z-10 w-1.5 cursor-col-resize transition-colors"
|
|
124
|
+
/>
|
|
125
|
+
{props.children}
|
|
126
|
+
</aside>,
|
|
127
|
+
target.node,
|
|
128
|
+
);
|
|
129
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { cn } from "../core/utils.ts";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The `data-slot` that marks the column an `AiChatDock` renders into.
|
|
5
|
+
*/
|
|
6
|
+
export const AI_CHAT_DOCK_SLOT = "ai-chat-dock";
|
|
7
|
+
|
|
8
|
+
export interface AiChatDockSlotProps {
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Where a layout makes room for the assistant's dock: a column beside the
|
|
14
|
+
* page, empty and zero-wide until the dock opens. Pass it to `AppShell` as
|
|
15
|
+
* `aside`; any other layout puts it as a flex sibling of its content. Without one, the dock floats over the page's right edge
|
|
16
|
+
* instead, still without a backdrop.
|
|
17
|
+
*/
|
|
18
|
+
export const AiChatDockSlot = (props: AiChatDockSlotProps) => (
|
|
19
|
+
<div
|
|
20
|
+
data-slot={AI_CHAT_DOCK_SLOT}
|
|
21
|
+
className={cn("flex min-h-0 shrink-0", props.className)}
|
|
22
|
+
/>
|
|
23
|
+
);
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { useI18n } from "alepha/react/i18n";
|
|
2
|
+
import { Sparkles } from "lucide-react";
|
|
3
|
+
|
|
4
|
+
import { Badge } from "../core/Badge.tsx";
|
|
5
|
+
import { Spinner } from "../core/Spinner.tsx";
|
|
6
|
+
import { cn } from "../core/utils.ts";
|
|
7
|
+
import type { UseAiChat } from "./useAiChat.ts";
|
|
8
|
+
|
|
9
|
+
export interface AiChatLauncherProps {
|
|
10
|
+
/**
|
|
11
|
+
* The conversation the pill speaks for.
|
|
12
|
+
*/
|
|
13
|
+
chat: UseAiChat;
|
|
14
|
+
title?: string;
|
|
15
|
+
onRestore: () => void;
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* A minimized assistant: a pill at the bottom corner that brings the panel
|
|
21
|
+
* back, and still says what the conversation is doing, so folding it away
|
|
22
|
+
* never hides an action waiting for the user's approval.
|
|
23
|
+
*/
|
|
24
|
+
export const AiChatLauncher = (props: AiChatLauncherProps) => {
|
|
25
|
+
const { tr } = useI18n();
|
|
26
|
+
const { chat } = props;
|
|
27
|
+
const waiting = chat.pending?.kind === "confirm";
|
|
28
|
+
const busy = chat.loading && !chat.pending;
|
|
29
|
+
const title = props.title ?? tr("ai.chat.title", { default: "Assistant" });
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<button
|
|
33
|
+
type="button"
|
|
34
|
+
data-testid="ai-chat-launcher"
|
|
35
|
+
onClick={props.onRestore}
|
|
36
|
+
aria-label={tr("ai.chat.restore", {
|
|
37
|
+
default: "Open $1",
|
|
38
|
+
args: [title],
|
|
39
|
+
})}
|
|
40
|
+
className={cn(
|
|
41
|
+
"bg-card text-card-foreground hover:bg-accent focus-visible:ring-ring/50 fixed end-4 bottom-4 z-40 inline-flex items-center gap-2 rounded-full border py-2 ps-3.5 pe-4 text-sm font-medium shadow-lg transition-colors outline-none focus-visible:ring-3",
|
|
42
|
+
props.className,
|
|
43
|
+
)}
|
|
44
|
+
>
|
|
45
|
+
{busy ? (
|
|
46
|
+
<Spinner className="size-4" />
|
|
47
|
+
) : (
|
|
48
|
+
<Sparkles className="text-primary size-4" />
|
|
49
|
+
)}
|
|
50
|
+
{title}
|
|
51
|
+
{waiting && (
|
|
52
|
+
<Badge variant="tint" tone="warning" aria-live="polite">
|
|
53
|
+
{tr("ai.chat.awaiting", { default: "Action to approve" })}
|
|
54
|
+
</Badge>
|
|
55
|
+
)}
|
|
56
|
+
</button>
|
|
57
|
+
);
|
|
58
|
+
};
|
package/src/ai/AiChatMessage.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useI18n } from "alepha/react/i18n";
|
|
2
|
-
import { Ban, Check, X } from "lucide-react";
|
|
2
|
+
import { Ban, Check, Scissors, X } from "lucide-react";
|
|
3
3
|
|
|
4
|
+
import { Button } from "../core/Button.tsx";
|
|
4
5
|
import { cn } from "../core/utils.ts";
|
|
5
6
|
import {
|
|
6
7
|
type MarkdownLinkRenderer,
|
|
@@ -18,6 +19,12 @@ export interface AiChatMessageProps {
|
|
|
18
19
|
* The words a tool step shows: `AiChat`'s `toolLabel`.
|
|
19
20
|
*/
|
|
20
21
|
toolLabel?: AiChatToolLabel;
|
|
22
|
+
/**
|
|
23
|
+
* Asks the assistant to go on, from the notice under a reply that was cut
|
|
24
|
+
* short. Absent, the notice shows without its button: `AiChatPanel` passes
|
|
25
|
+
* it on the last line only, and never while a turn runs.
|
|
26
|
+
*/
|
|
27
|
+
onContinue?: () => void;
|
|
21
28
|
}
|
|
22
29
|
|
|
23
30
|
/**
|
|
@@ -83,7 +90,34 @@ export const AiChatMessage = (props: AiChatMessageProps) => {
|
|
|
83
90
|
data-testid="ai-chat-assistant"
|
|
84
91
|
className="mr-4 self-start text-sm leading-relaxed"
|
|
85
92
|
>
|
|
86
|
-
|
|
93
|
+
{item.content ? (
|
|
94
|
+
<MarkdownView content={item.content} renderLink={props.renderLink} />
|
|
95
|
+
) : null}
|
|
96
|
+
{item.cut ? (
|
|
97
|
+
<div
|
|
98
|
+
data-testid="ai-chat-cut"
|
|
99
|
+
role="status"
|
|
100
|
+
className="text-warning-text mt-2 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs"
|
|
101
|
+
>
|
|
102
|
+
<Scissors className="size-3.5 shrink-0" />
|
|
103
|
+
<span>
|
|
104
|
+
{tr("ai.chat.cut", {
|
|
105
|
+
default:
|
|
106
|
+
"This answer was cut short: it reached the length limit. Ask a narrower question, or continue.",
|
|
107
|
+
})}
|
|
108
|
+
</span>
|
|
109
|
+
{props.onContinue ? (
|
|
110
|
+
<Button
|
|
111
|
+
type="button"
|
|
112
|
+
variant="outlined"
|
|
113
|
+
size="xs"
|
|
114
|
+
onClick={props.onContinue}
|
|
115
|
+
>
|
|
116
|
+
{tr("ai.chat.continue", { default: "Continue" })}
|
|
117
|
+
</Button>
|
|
118
|
+
) : null}
|
|
119
|
+
</div>
|
|
120
|
+
) : null}
|
|
87
121
|
</div>
|
|
88
122
|
);
|
|
89
123
|
};
|