@flamingo-stack/openframe-frontend-core 0.0.825 → 0.0.826
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/build/export-map.json +1 -1
- package/dist/{case-study-card-IZBMHA6R.cjs → case-study-card-O4IQCJAX.cjs} +5 -5
- package/dist/{chunk-QOAA7ZHB.cjs → chunk-2HQNXX2K.cjs} +2 -2
- package/dist/{chunk-2U7GXE3T.cjs → chunk-2TQJSB62.cjs} +2157 -811
- package/dist/{chunk-NONMZ5WJ.cjs → chunk-2VLPXUQK.cjs} +14 -83
- package/dist/{chunk-7DJWIVQC.cjs → chunk-37OYBX7W.cjs} +36 -36
- package/dist/{chunk-OBQ5WUNG.cjs → chunk-3B6ZE4EZ.cjs} +29 -29
- package/dist/{chunk-AO6YVNAH.cjs → chunk-5AQKXEMI.cjs} +979 -1357
- package/dist/{chunk-25HBH4J6.cjs → chunk-5BM7X4GA.cjs} +2 -2
- package/dist/{chunk-47SHKOCY.cjs → chunk-63T2KKDZ.cjs} +86 -86
- package/dist/{chunk-MHR4C465.cjs → chunk-6G4WRMEM.cjs} +3 -3
- package/dist/{chunk-AUBR3FGY.cjs → chunk-74GWFGH2.cjs} +28 -28
- package/dist/{chunk-467T3LCG.cjs → chunk-7PZQ7SHB.cjs} +49 -32
- package/dist/{chunk-6LVJKPR3.cjs → chunk-AJM4YZTW.cjs} +8 -8
- package/dist/{chunk-2XLPRW7V.cjs → chunk-BIG3O33P.cjs} +6 -2
- package/dist/chunk-BMQLM2NU.cjs +40 -0
- package/dist/{chunk-DVHSYPDB.cjs → chunk-DAKGX2WF.cjs} +2 -2
- package/dist/{chunk-2IWAHBCC.cjs → chunk-DRSFR5AC.cjs} +159 -159
- package/dist/{chunk-IJCSQFLD.cjs → chunk-DU6AF77X.cjs} +83 -121
- package/dist/{chunk-NL34HKLS.cjs → chunk-EJNDTSKY.cjs} +91 -91
- package/dist/{chunk-SBFBNOKU.cjs → chunk-ENMPSEEQ.cjs} +4 -4
- package/dist/{chunk-ZECG6GU5.cjs → chunk-F2J5WN6U.cjs} +2 -2
- package/dist/{chunk-BOS7OIC4.cjs → chunk-GRHF5SWL.cjs} +5 -2
- package/dist/{chunk-Z7BLMJEI.cjs → chunk-GZAPOCKS.cjs} +54 -54
- package/dist/{chunk-5S2GW6YG.cjs → chunk-HJAPXKWK.cjs} +17 -17
- package/dist/{chunk-P25RVNGX.cjs → chunk-HQ4FKHOO.cjs} +249 -108
- package/dist/{chunk-ZRDVFADQ.cjs → chunk-IBD2FPSX.cjs} +75 -9
- package/dist/{chunk-T266OITJ.cjs → chunk-IKWQW3YJ.cjs} +45 -45
- package/dist/{chunk-B7NSH7IK.cjs → chunk-IWQ2LJGW.cjs} +5 -5
- package/dist/{chunk-MALCUN2G.cjs → chunk-JDR72QFU.cjs} +12 -14
- package/dist/{chunk-EHANO6UE.cjs → chunk-K34TTZAE.cjs} +9 -129
- package/dist/{chunk-QDDBOCG3.cjs → chunk-KPGKTEEB.cjs} +2 -2
- package/dist/{chunk-4IY5FKYL.cjs → chunk-MDEOCOIE.cjs} +23 -23
- package/dist/chunk-OEP5KAT6.cjs +56 -0
- package/dist/chunk-OT6P57ZS.cjs +94 -0
- package/dist/{chunk-QQT23JJ7.cjs → chunk-PBHP3FHO.cjs} +4 -4
- package/dist/{chunk-IMMTH3F3.cjs → chunk-PJY3SYCS.cjs} +29 -27
- package/dist/{chunk-N7IDLF2G.cjs → chunk-PWAKRRRO.cjs} +1283 -268
- package/dist/{chunk-UEULXVW2.cjs → chunk-QS6AKUUL.cjs} +22 -22
- package/dist/{chunk-BN7QENV7.cjs → chunk-QYJZDEG7.cjs} +6 -6
- package/dist/{chunk-NPNZAAOB.cjs → chunk-S6UJEW4G.cjs} +2 -2
- package/dist/{chunk-XJMLZ63Y.cjs → chunk-TJG2BJ5J.cjs} +4 -4
- package/dist/{chunk-QOOMUGF2.cjs → chunk-TYJ73DHW.cjs} +15 -15
- package/dist/{chunk-A34UNP5V.cjs → chunk-W4VEDSAX.cjs} +80 -11
- package/dist/{chunk-DNZCSPMU.cjs → chunk-WGMU45NV.cjs} +20 -20
- package/dist/{chunk-APTFXX2C.cjs → chunk-XDHQC4XH.cjs} +46 -46
- package/dist/{cloud-tenants-M4VFFN33.cjs → cloud-tenants-F67KQ5GC.cjs} +108 -106
- package/dist/components/case-studies/index.cjs +124 -122
- package/dist/components/chat/approval-batch-message.d.ts.map +1 -1
- package/dist/components/chat/approval-batch-message.js +2 -2
- package/dist/components/chat/chat-archive-page.d.ts +7 -0
- package/dist/components/chat/chat-archive-page.d.ts.map +1 -1
- package/dist/components/chat/chat-archive-page.js +9 -0
- package/dist/components/chat/chat-composer.d.ts +24 -4
- package/dist/components/chat/chat-composer.d.ts.map +1 -1
- package/dist/components/chat/chat-composer.js +90 -48
- package/dist/components/chat/chat-context-memory-bar.d.ts +4 -1
- package/dist/components/chat/chat-context-memory-bar.d.ts.map +1 -1
- package/dist/components/chat/chat-context-memory-bar.js +8 -5
- package/dist/components/chat/chat-context-picker.d.ts +8 -1
- package/dist/components/chat/chat-context-picker.d.ts.map +1 -1
- package/dist/components/chat/chat-context-picker.js +32 -9
- package/dist/components/chat/chat-header-rename-field.d.ts +18 -0
- package/dist/components/chat/chat-header-rename-field.d.ts.map +1 -0
- package/dist/components/chat/chat-header-rename-field.js +49 -0
- package/dist/components/chat/chat-input.d.ts.map +1 -1
- package/dist/components/chat/chat-input.js +5 -0
- package/dist/components/chat/composer-sheet.d.ts +44 -0
- package/dist/components/chat/composer-sheet.d.ts.map +1 -0
- package/dist/components/chat/composer-sheet.js +140 -0
- package/dist/components/chat/embeddable-chat.d.ts +114 -1
- package/dist/components/chat/embeddable-chat.d.ts.map +1 -1
- package/dist/components/chat/embeddable-chat.js +328 -215
- package/dist/components/chat/index.cjs +118 -103
- package/dist/components/chat/index.d.ts +6 -0
- package/dist/components/chat/index.d.ts.map +1 -1
- package/dist/components/chat/index.js +9 -0
- package/dist/components/chat/mingo-chat-day-groups.d.ts +18 -0
- package/dist/components/chat/mingo-chat-day-groups.d.ts.map +1 -0
- package/dist/components/chat/mingo-chat-day-groups.js +45 -0
- package/dist/components/chat/mingo-chat-header.d.ts +34 -6
- package/dist/components/chat/mingo-chat-header.d.ts.map +1 -1
- package/dist/components/chat/mingo-chat-header.js +44 -7
- package/dist/components/chat/mingo-chat-history-section.d.ts +30 -0
- package/dist/components/chat/mingo-chat-history-section.d.ts.map +1 -0
- package/dist/components/chat/mingo-chat-history-section.js +500 -0
- package/dist/components/chat/mingo-chat-history.d.ts +5 -2
- package/dist/components/chat/mingo-chat-history.d.ts.map +1 -1
- package/dist/components/chat/mingo-chat-history.js +26 -30
- package/dist/components/chat/mingo-chat-list-shared.d.ts +136 -0
- package/dist/components/chat/mingo-chat-list-shared.d.ts.map +1 -0
- package/dist/components/chat/mingo-chat-list-shared.js +76 -0
- package/dist/components/chat/mingo-chat-rail.d.ts +19 -51
- package/dist/components/chat/mingo-chat-rail.d.ts.map +1 -1
- package/dist/components/chat/mingo-chat-rail.js +23 -45
- package/dist/components/chat/mingo-edge-light.d.ts +13 -0
- package/dist/components/chat/mingo-edge-light.d.ts.map +1 -0
- package/dist/components/chat/mingo-edge-light.js +17 -0
- package/dist/components/chat/mingo-history-rail.d.ts +5 -4
- package/dist/components/chat/mingo-history-rail.d.ts.map +1 -1
- package/dist/components/chat/mingo-history-rail.js +5 -10
- package/dist/components/chat/mingo-quick-action-wall.d.ts +27 -0
- package/dist/components/chat/mingo-quick-action-wall.d.ts.map +1 -0
- package/dist/components/chat/mingo-quick-action-wall.js +41 -0
- package/dist/components/chat/mingo-welcome.d.ts.map +1 -1
- package/dist/components/chat/mingo-welcome.js +6 -20
- package/dist/components/chat/model-display.d.ts.map +1 -1
- package/dist/components/chat/model-display.js +38 -9
- package/dist/components/chat/tool-execution-display.d.ts.map +1 -1
- package/dist/components/chat/tool-execution-display.js +15 -1
- package/dist/components/chat/types/component.types.d.ts +13 -1
- package/dist/components/chat/types/component.types.d.ts.map +1 -1
- package/dist/components/chat/utils/chat-day-label.d.ts +8 -0
- package/dist/components/chat/utils/chat-day-label.d.ts.map +1 -0
- package/dist/components/chat/utils/chat-day-label.js +21 -0
- package/dist/components/contact/index.cjs +109 -107
- package/dist/components/docs/index.cjs +112 -110
- package/dist/components/embeds/index.cjs +109 -107
- package/dist/components/faq/index.cjs +110 -108
- package/dist/components/features/board/board-column.d.ts +3 -1
- package/dist/components/features/board/board-column.d.ts.map +1 -1
- package/dist/components/features/board/board-column.js +6 -2
- package/dist/components/features/board/board.d.ts +6 -0
- package/dist/components/features/board/board.d.ts.map +1 -1
- package/dist/components/features/board/board.js +14 -3
- package/dist/components/features/board/touch-board.d.ts +1 -1
- package/dist/components/features/board/touch-board.d.ts.map +1 -1
- package/dist/components/features/board/touch-board.js +3 -1
- package/dist/components/features/index.cjs +108 -106
- package/dist/components/features/notifications/approval-request-notification-tile.d.ts +7 -1
- package/dist/components/features/notifications/approval-request-notification-tile.d.ts.map +1 -1
- package/dist/components/features/notifications/approval-request-notification-tile.js +1 -1
- package/dist/components/features/notifications/notification-drawer.d.ts +6 -1
- package/dist/components/features/notifications/notification-drawer.d.ts.map +1 -1
- package/dist/components/features/notifications/notification-drawer.js +3 -2
- package/dist/components/features/notifications/notification-tile.d.ts +4 -1
- package/dist/components/features/notifications/notification-tile.d.ts.map +1 -1
- package/dist/components/features/notifications/notification-tile.js +9 -7
- package/dist/components/features/time-tracker/time-tracker-header-button.d.ts +18 -1
- package/dist/components/features/time-tracker/time-tracker-header-button.d.ts.map +1 -1
- package/dist/components/features/time-tracker/time-tracker-header-button.js +31 -7
- package/dist/components/help-center-pages/index.cjs +217 -215
- package/dist/components/icons-v2-generated/icon-loaders.d.ts.map +1 -1
- package/dist/components/icons-v2-generated/icon-loaders.js +1 -0
- package/dist/components/icons-v2-generated/icon-names.js +1 -1
- package/dist/components/icons-v2-generated/index.cjs +90 -86
- package/dist/components/icons-v2-generated/loaders/dots-loader-icon.d.ts.map +1 -1
- package/dist/components/icons-v2-generated/loaders/dots-loader-icon.js +21 -24
- package/dist/components/icons-v2-generated/logos/index.d.ts +1 -0
- package/dist/components/icons-v2-generated/logos/index.d.ts.map +1 -1
- package/dist/components/icons-v2-generated/logos/index.js +2 -0
- package/dist/components/icons-v2-generated/logos/mingo-logo-icon.d.ts +9 -0
- package/dist/components/icons-v2-generated/logos/mingo-logo-icon.d.ts.map +1 -0
- package/dist/components/icons-v2-generated/logos/mingo-logo-icon.js +36 -0
- package/dist/components/index.cjs +215 -182
- package/dist/components/meeting-scheduler/index.cjs +182 -180
- package/dist/components/navigation/account-popover.d.ts +62 -0
- package/dist/components/navigation/account-popover.d.ts.map +1 -0
- package/dist/components/navigation/account-popover.js +138 -0
- package/dist/components/navigation/app-header.d.ts +36 -2
- package/dist/components/navigation/app-header.d.ts.map +1 -1
- package/dist/components/navigation/app-header.js +28 -24
- package/dist/components/navigation/app-layout-context.d.ts +17 -0
- package/dist/components/navigation/app-layout-context.d.ts.map +1 -1
- package/dist/components/navigation/app-layout-context.js +9 -1
- package/dist/components/navigation/app-layout.d.ts +93 -1
- package/dist/components/navigation/app-layout.d.ts.map +1 -1
- package/dist/components/navigation/app-layout.js +149 -30
- package/dist/components/navigation/header-button.d.ts +11 -1
- package/dist/components/navigation/header-button.d.ts.map +1 -1
- package/dist/components/navigation/header-button.js +16 -5
- package/dist/components/navigation/header-mingo-button.d.ts.map +1 -1
- package/dist/components/navigation/header-mingo-button.js +6 -5
- package/dist/components/navigation/index.cjs +120 -109
- package/dist/components/navigation/index.d.ts +10 -1
- package/dist/components/navigation/index.d.ts.map +1 -1
- package/dist/components/navigation/index.js +8 -0
- package/dist/components/navigation/mingo-ai-button.d.ts.map +1 -1
- package/dist/components/navigation/mingo-ai-button.js +2 -1
- package/dist/components/navigation/mobile-burger-menu.d.ts.map +1 -1
- package/dist/components/navigation/mobile-burger-menu.js +155 -39
- package/dist/components/navigation/navigation-sidebar-grouped.d.ts +57 -0
- package/dist/components/navigation/navigation-sidebar-grouped.d.ts.map +1 -0
- package/dist/components/navigation/navigation-sidebar-grouped.js +365 -0
- package/dist/components/navigation/navigation-sidebar-match.d.ts +37 -0
- package/dist/components/navigation/navigation-sidebar-match.d.ts.map +1 -0
- package/dist/components/navigation/navigation-sidebar-match.js +85 -0
- package/dist/components/navigation/navigation-sidebar-slot.d.ts +7 -0
- package/dist/components/navigation/navigation-sidebar-slot.d.ts.map +1 -0
- package/dist/components/navigation/navigation-sidebar-slot.js +11 -0
- package/dist/components/navigation/navigation-sidebar-toggle.d.ts +7 -1
- package/dist/components/navigation/navigation-sidebar-toggle.d.ts.map +1 -1
- package/dist/components/navigation/navigation-sidebar-toggle.js +52 -23
- package/dist/components/navigation/navigation-sidebar.d.ts +13 -1
- package/dist/components/navigation/navigation-sidebar.d.ts.map +1 -1
- package/dist/components/navigation/navigation-sidebar.js +188 -52
- package/dist/components/navigation/notifications-bell-button.d.ts +28 -0
- package/dist/components/navigation/notifications-bell-button.d.ts.map +1 -0
- package/dist/components/navigation/notifications-bell-button.js +44 -0
- package/dist/components/navigation/ticket-alerts-button.d.ts +7 -1
- package/dist/components/navigation/ticket-alerts-button.d.ts.map +1 -1
- package/dist/components/navigation/ticket-alerts-button.js +3 -2
- package/dist/components/onboarding-guides/index.cjs +111 -109
- package/dist/components/product-demo/index.cjs +119 -117
- package/dist/components/related-content/index.cjs +13 -13
- package/dist/components/tickets/index.cjs +115 -113
- package/dist/components/ui/actions-menu.d.ts +6 -1
- package/dist/components/ui/actions-menu.d.ts.map +1 -1
- package/dist/components/ui/actions-menu.js +6 -2
- package/dist/components/ui/fade-preview.d.ts +8 -0
- package/dist/components/ui/fade-preview.d.ts.map +1 -1
- package/dist/components/ui/fade-preview.js +7 -5
- package/dist/components/ui/index.cjs +136 -111
- package/dist/components/ui/index.d.ts +1 -0
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/index.js +1 -0
- package/dist/components/ui/mobile-action-bar.d.ts +14 -0
- package/dist/components/ui/mobile-action-bar.d.ts.map +1 -0
- package/dist/components/ui/mobile-action-bar.js +68 -0
- package/dist/components/ui/no-data/no-data-styles.d.ts +1 -1
- package/dist/components/ui/no-data/no-data-styles.d.ts.map +1 -1
- package/dist/components/ui/no-data/no-data-styles.js +1 -1
- package/dist/components/ui/page-actions.d.ts.map +1 -1
- package/dist/components/ui/page-actions.js +24 -8
- package/dist/components/ui/panel-resize-handle.d.ts +6 -2
- package/dist/components/ui/panel-resize-handle.d.ts.map +1 -1
- package/dist/components/ui/panel-resize-handle.js +6 -3
- package/dist/components/ui/square-avatar.d.ts.map +1 -1
- package/dist/components/ui/square-avatar.js +5 -2
- package/dist/{devices-DW5NDXMD.cjs → devices-SJORCARH.cjs} +109 -107
- package/dist/dots-loader-icon-5JXWD6FB.cjs +7 -0
- package/dist/{embeddable-chat-NBJMXEXB.cjs → embeddable-chat-7Z4CEZJL.cjs} +513 -398
- package/dist/hooks/index.cjs +15 -16
- package/dist/hooks/ui/use-content-breakpoint.d.ts +4 -2
- package/dist/hooks/ui/use-content-breakpoint.d.ts.map +1 -1
- package/dist/{icon-loaders-OLGJZGRP.cjs → icon-loaders-SUPEKMBJ.cjs} +2 -1
- package/dist/index.cjs +154 -121
- package/dist/{knowledge-EYJG2TNW.cjs → knowledge-QXILUVEM.cjs} +109 -107
- package/dist/{logs-2LV7DTSL.cjs → logs-E3KQQQD6.cjs} +118 -115
- package/dist/mingo-logo-icon-WGPBSDTF.cjs +7 -0
- package/dist/{policies-HSDYIQBX.cjs → policies-IOYQY6TF.cjs} +112 -110
- package/dist/{remote-session-BQMTIQTU.cjs → remote-session-QGFG5WAL.cjs} +99 -97
- package/dist/{scripts-UI6V7ANQ.cjs → scripts-E5TWWUNP.cjs} +115 -113
- package/dist/{software-update-WMLY7VHH.cjs → software-update-QZGYG4TD.cjs} +112 -110
- package/dist/{tickets-board-TRXOX77R.cjs → tickets-board-KCH6ITUV.cjs} +95 -94
- package/dist/types/navigation.d.ts +131 -0
- package/dist/types/navigation.d.ts.map +1 -1
- package/dist/utils/index.cjs +65 -25
- package/package.json +1 -1
- package/src/components/chat/approval-batch-message.tsx +3 -2
- package/src/components/chat/chat-archive-page.tsx +16 -0
- package/src/components/chat/chat-composer.tsx +131 -61
- package/src/components/chat/chat-context-memory-bar.tsx +27 -17
- package/src/components/chat/chat-context-picker.tsx +45 -11
- package/src/components/chat/chat-header-rename-field.tsx +68 -0
- package/src/components/chat/chat-input.tsx +9 -1
- package/src/components/chat/composer-sheet.tsx +196 -0
- package/src/components/chat/embeddable-chat.tsx +636 -319
- package/src/components/chat/index.ts +6 -0
- package/src/components/chat/mingo-chat-day-groups.ts +62 -0
- package/src/components/chat/mingo-chat-header.tsx +99 -23
- package/src/components/chat/mingo-chat-history-section.tsx +670 -0
- package/src/components/chat/mingo-chat-history.tsx +31 -45
- package/src/components/chat/mingo-chat-list-shared.tsx +244 -0
- package/src/components/chat/mingo-chat-rail.tsx +45 -97
- package/src/components/chat/mingo-edge-light.tsx +25 -0
- package/src/components/chat/mingo-history-rail.tsx +7 -17
- package/src/components/chat/mingo-quick-action-wall.tsx +64 -0
- package/src/components/chat/mingo-welcome.tsx +5 -19
- package/src/components/chat/model-display.tsx +66 -14
- package/src/components/chat/tool-execution-display.tsx +9 -1
- package/src/components/chat/types/component.types.ts +13 -1
- package/src/components/chat/utils/chat-day-label.ts +24 -0
- package/src/components/features/board/board-column.tsx +8 -0
- package/src/components/features/board/board.tsx +16 -2
- package/src/components/features/board/touch-board.tsx +2 -0
- package/src/components/features/notifications/approval-request-notification-tile.tsx +8 -2
- package/src/components/features/notifications/notification-drawer.tsx +7 -1
- package/src/components/features/notifications/notification-tile.tsx +17 -9
- package/src/components/features/time-tracker/time-tracker-header-button.tsx +53 -6
- package/src/components/icons-v2/icon-colors.json +4 -0
- package/src/components/icons-v2-generated/icon-loaders.ts +1 -0
- package/src/components/icons-v2-generated/icon-names.ts +1 -1
- package/src/components/icons-v2-generated/loaders/dots-loader-icon.tsx +18 -27
- package/src/components/icons-v2-generated/logos/index.ts +1 -0
- package/src/components/icons-v2-generated/logos/mingo-logo-icon.tsx +35 -0
- package/src/components/navigation/account-popover.tsx +198 -0
- package/src/components/navigation/app-header.tsx +74 -33
- package/src/components/navigation/app-layout-context.ts +22 -0
- package/src/components/navigation/app-layout.tsx +290 -24
- package/src/components/navigation/header-button.tsx +27 -5
- package/src/components/navigation/header-mingo-button.tsx +6 -5
- package/src/components/navigation/index.ts +19 -0
- package/src/components/navigation/mingo-ai-button.tsx +2 -3
- package/src/components/navigation/mobile-burger-menu.tsx +219 -53
- package/src/components/navigation/navigation-sidebar-grouped.tsx +554 -0
- package/src/components/navigation/navigation-sidebar-match.ts +152 -0
- package/src/components/navigation/navigation-sidebar-slot.ts +12 -0
- package/src/components/navigation/navigation-sidebar-toggle.tsx +39 -6
- package/src/components/navigation/navigation-sidebar.tsx +278 -61
- package/src/components/navigation/notifications-bell-button.tsx +70 -0
- package/src/components/navigation/ticket-alerts-button.tsx +9 -2
- package/src/components/ui/actions-menu.tsx +19 -3
- package/src/components/ui/fade-preview.tsx +13 -6
- package/src/components/ui/index.ts +1 -0
- package/src/components/ui/mobile-action-bar.ts +87 -0
- package/src/components/ui/no-data/no-data-styles.ts +5 -2
- package/src/components/ui/page-actions.tsx +38 -11
- package/src/components/ui/panel-resize-handle.tsx +14 -5
- package/src/components/ui/square-avatar.tsx +5 -2
- package/src/hooks/ui/use-content-breakpoint.ts +4 -2
- package/src/styles/ods-interaction-states.css +68 -0
- package/src/types/navigation.ts +140 -0
- package/dist/chunk-C7GIHB3V.cjs +0 -59
- package/dist/dots-loader-icon-RBLX46X7.cjs +0 -7
- package/dist/{chunk-ZOZR3QI2.cjs → chunk-46547WQW.cjs} +0 -0
- package/dist/{video-file-player-IAMWBKEQ.cjs → video-file-player-IHO66P2Q.cjs} +1 -1
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
import { type ComponentProps, type ReactNode, type Ref, useCallback, useMemo } from 'react';
|
|
4
4
|
import { cn } from '../../utils/cn';
|
|
5
|
-
import { BoxArchiveIcon } from '../icons-v2-generated';
|
|
5
|
+
import { BoxArchiveIcon, Ellipsis01Icon } from '../icons-v2-generated';
|
|
6
|
+
import { ActionsMenuDropdown, type ActionsMenuItem } from '../ui/actions-menu';
|
|
6
7
|
import { ChatAttachmentAddButton } from './chat-attachment-bar';
|
|
7
8
|
import { ChatFooter } from './chat-container';
|
|
8
9
|
import { ChatContextMemoryBar } from './chat-context-memory-bar';
|
|
9
10
|
import { ChatComposerPlusMenu, ChatContextChipStrip, ChatContextPicker } from './chat-context-picker';
|
|
10
11
|
import { ChatInput } from './chat-input';
|
|
12
|
+
import { MingoEdgeLight } from './mingo-edge-light';
|
|
11
13
|
import { ModelDisplay } from './model-display';
|
|
12
14
|
import type { ChatInputRef, ModelDisplayProps } from './types/component.types';
|
|
13
15
|
import type { ChatContextItem, ChatContextPickerConfig } from './types/context-item.types';
|
|
@@ -38,8 +40,17 @@ export interface ChatComposerProps {
|
|
|
38
40
|
attachmentsCount?: number;
|
|
39
41
|
onAddFiles?: (files: FileList | File[]) => void;
|
|
40
42
|
attachmentsDisabled?: boolean;
|
|
41
|
-
/** Model + usage row props, forwarded to `<ModelDisplay>`.
|
|
42
|
-
model
|
|
43
|
+
/** Model + usage row props, forwarded to `<ModelDisplay>`. Omitted → no
|
|
44
|
+
* model row (e.g. a composer docked on a home page, before any chat). */
|
|
45
|
+
model?: ModelDisplayProps;
|
|
46
|
+
/** The composer's own ⋯ menu, at the end of the input row before Send
|
|
47
|
+
* (e.g. "Compact Chat Memory"). Empty or omitted → no menu. Not shown on an
|
|
48
|
+
* archived chat (there is no input), inert while `lock` is set. */
|
|
49
|
+
menuItems?: ActionsMenuItem[];
|
|
50
|
+
/** Controls at the end of the row under the input, after the model and its
|
|
51
|
+
* usage (e.g. "Compact chat memory"). Draws that row on its own if there is
|
|
52
|
+
* no model. */
|
|
53
|
+
footerActions?: ReactNode;
|
|
43
54
|
|
|
44
55
|
// ─── Entity-context picker (Figma 31:28708 / 1:5699) ──────────────────────
|
|
45
56
|
// When `contextPicker` is set the composer renders the `+` "Assign Item"
|
|
@@ -59,6 +70,9 @@ export interface ChatComposerProps {
|
|
|
59
70
|
* as a summary strip at the top of the composer card, above the assigned-item
|
|
60
71
|
* chips. Empty/omitted → no strip. */
|
|
61
72
|
contextMemoryItems?: ChatContextItem[];
|
|
73
|
+
/** A host control at the start of the context memory strip (e.g. "Continue
|
|
74
|
+
* <chat>"); the strip shows for it alone when nothing is remembered. */
|
|
75
|
+
contextLeading?: ReactNode;
|
|
62
76
|
/** Drop one entity from the context memory (dropdown row ×). */
|
|
63
77
|
onRemoveContextMemoryItem?: (item: ChatContextItem) => void;
|
|
64
78
|
/** The host is reading a record it will add to the context memory: the empty strip draws its loading form. */
|
|
@@ -79,6 +93,13 @@ export interface ChatComposerProps {
|
|
|
79
93
|
/** Non-destructive ghost preview shown in the empty composer (e.g. a hovered
|
|
80
94
|
* quick-action's full prompt). Forwarded to `ChatInput.previewText`. */
|
|
81
95
|
previewText?: string;
|
|
96
|
+
/** Clear the bottom safe-area inset (the iOS home bar) under the composer.
|
|
97
|
+
* Default `true`. `false` for a composer docked inside a layout that already
|
|
98
|
+
* owns that inset (a native shell's root), where it would be doubled. */
|
|
99
|
+
safeAreaBottom?: boolean;
|
|
100
|
+
/** Mingo's AI edge light (`MingoEdgeLight`, the header launcher's) travelling
|
|
101
|
+
* around the input card. Not on an archived chat. Default `false`. */
|
|
102
|
+
edgeLight?: boolean;
|
|
82
103
|
}
|
|
83
104
|
|
|
84
105
|
/**
|
|
@@ -110,6 +131,7 @@ export function ChatComposer({
|
|
|
110
131
|
onToggleContextItem,
|
|
111
132
|
onRemoveContextItem,
|
|
112
133
|
contextMemoryItems,
|
|
134
|
+
contextLeading,
|
|
113
135
|
onRemoveContextMemoryItem,
|
|
114
136
|
contextMemoryPending,
|
|
115
137
|
contextPickerOpen = false,
|
|
@@ -119,6 +141,10 @@ export function ChatComposer({
|
|
|
119
141
|
onMentionQueryChange,
|
|
120
142
|
onValueChange,
|
|
121
143
|
previewText,
|
|
144
|
+
menuItems,
|
|
145
|
+
footerActions,
|
|
146
|
+
safeAreaBottom = true,
|
|
147
|
+
edgeLight = false,
|
|
122
148
|
}: ChatComposerProps) {
|
|
123
149
|
const contextEnabled = !!contextPicker && !archived;
|
|
124
150
|
const locked = lock != null;
|
|
@@ -137,6 +163,35 @@ export function ChatComposer({
|
|
|
137
163
|
}, [entityTypes]);
|
|
138
164
|
const resolveContextIcon = useCallback((item: ChatContextItem) => iconByType.get(item.type), [iconByType]);
|
|
139
165
|
|
|
166
|
+
const menu =
|
|
167
|
+
menuItems && menuItems.length > 0 ? (
|
|
168
|
+
<ActionsMenuDropdown
|
|
169
|
+
triggerAriaLabel="Composer actions"
|
|
170
|
+
side="top"
|
|
171
|
+
align="end"
|
|
172
|
+
onCloseAutoFocus={e => e.preventDefault()}
|
|
173
|
+
groups={[{ items: menuItems }]}
|
|
174
|
+
customTrigger={
|
|
175
|
+
<button
|
|
176
|
+
type="button"
|
|
177
|
+
aria-label="Composer actions"
|
|
178
|
+
disabled={locked}
|
|
179
|
+
className={cn(
|
|
180
|
+
'flex h-6 shrink-0 items-center text-ods-text-secondary transition-colors duration-200',
|
|
181
|
+
'cursor-pointer hover:text-ods-text-primary focus-visible:text-ods-accent focus-visible:outline-none',
|
|
182
|
+
'disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:text-ods-text-secondary',
|
|
183
|
+
)}
|
|
184
|
+
>
|
|
185
|
+
<Ellipsis01Icon size={20} />
|
|
186
|
+
</button>
|
|
187
|
+
}
|
|
188
|
+
/>
|
|
189
|
+
) : undefined;
|
|
190
|
+
// The row under the input: the legacy attachment `+` and the model. Neither →
|
|
191
|
+
// no row at all, rather than an empty one under the input.
|
|
192
|
+
const showLegacyAttach = !contextEnabled && showAttachmentButton && !!onAddFiles;
|
|
193
|
+
const showFooterRow = showLegacyAttach || !!model || !!footerActions;
|
|
194
|
+
|
|
140
195
|
// The input is identical in both layouts; only `hideBorder` (context mode
|
|
141
196
|
// lets the outer card own the chrome) and the `+` adornment differ.
|
|
142
197
|
const inputNode = (
|
|
@@ -159,6 +214,7 @@ export function ChatComposer({
|
|
|
159
214
|
onMentionQueryChange={contextEnabled ? onMentionQueryChange : undefined}
|
|
160
215
|
onValueChange={contextEnabled ? onValueChange : undefined}
|
|
161
216
|
hideBorder={contextEnabled}
|
|
217
|
+
endIcon={menu}
|
|
162
218
|
// `+` lives INSIDE the input (start adornment, Figma 31:28275) and opens
|
|
163
219
|
// the single context dropdown directly. The picker is passed as the
|
|
164
220
|
// button's `dropdown` so it anchors to the `+`, not the input row.
|
|
@@ -186,14 +242,60 @@ export function ChatComposer({
|
|
|
186
242
|
/>
|
|
187
243
|
);
|
|
188
244
|
|
|
245
|
+
const liveCard = contextEnabled ? (
|
|
246
|
+
// Unified card (Figma 1:6073 / 271:38656): the context-memory
|
|
247
|
+
// summary strip and the assigned-chip strip (both `bg-ods-bg`,
|
|
248
|
+
// `border-b`) stack flush above the input; the card owns the border
|
|
249
|
+
// / radius / focus ring. No `overflow-hidden` so the picker and the
|
|
250
|
+
// memory popover can float above the input (whichever strip comes
|
|
251
|
+
// first gets `rounded-t`).
|
|
252
|
+
// `has-[[data-editor]:focus]` (not `focus-within`) so the accent
|
|
253
|
+
// border reacts ONLY to the composer editor — not the picker's search
|
|
254
|
+
// input or item buttons, which also live inside this card. The editor
|
|
255
|
+
// is a `contentEditable` div (`data-editor`), not a `<textarea>`, so we
|
|
256
|
+
// target its data attribute rather than the element name.
|
|
257
|
+
<div className="rounded-md border border-ods-border bg-ods-card transition-colors has-[[data-editor]:focus]:border-ods-accent">
|
|
258
|
+
{/* Ambient navigation-history context — always the same items, so
|
|
259
|
+
it sits furthest from the textarea. Self-hides when empty. */}
|
|
260
|
+
<ChatContextMemoryBar
|
|
261
|
+
items={memory}
|
|
262
|
+
onRemove={onRemoveContextMemoryItem}
|
|
263
|
+
pending={contextMemoryPending}
|
|
264
|
+
resolveIcon={resolveContextIcon}
|
|
265
|
+
disabled={sending || locked}
|
|
266
|
+
leading={contextLeading}
|
|
267
|
+
className="rounded-t-md"
|
|
268
|
+
/>
|
|
269
|
+
{selected.length > 0 && (
|
|
270
|
+
<ChatContextChipStrip
|
|
271
|
+
items={selected}
|
|
272
|
+
onRemove={onRemoveContextItem}
|
|
273
|
+
resolveIcon={resolveContextIcon}
|
|
274
|
+
disabled={sending || locked}
|
|
275
|
+
className={cn(
|
|
276
|
+
'border-b border-ods-border bg-ods-bg p-2',
|
|
277
|
+
// Only the TOP strip rounds into the card corner.
|
|
278
|
+
memory.length === 0 && !contextLeading && 'rounded-t-md',
|
|
279
|
+
)}
|
|
280
|
+
/>
|
|
281
|
+
)}
|
|
282
|
+
{/* Picker is rendered inside the `+` button (its `dropdown` prop)
|
|
283
|
+
so it anchors to the button, not this card. */}
|
|
284
|
+
{inputNode}
|
|
285
|
+
</div>
|
|
286
|
+
) : (
|
|
287
|
+
inputNode
|
|
288
|
+
);
|
|
289
|
+
|
|
189
290
|
return (
|
|
190
291
|
<div
|
|
191
292
|
className="flex flex-shrink-0 flex-col gap-[var(--spacing-system-xxs)] px-[var(--spacing-system-m)] pb-[var(--spacing-system-xxs)]"
|
|
192
293
|
// Tight `xxs` bottom padding (the model/usage row already sits just below
|
|
193
|
-
// the input); `max(…, safe-area-inset)` still clears the iOS home bar
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
294
|
+
// the input); `max(…, safe-area-inset)` still clears the iOS home bar —
|
|
295
|
+
// unless the host's layout already does (`safeAreaBottom={false}`).
|
|
296
|
+
style={
|
|
297
|
+
safeAreaBottom ? { paddingBottom: 'max(var(--spacing-system-xxs), env(safe-area-inset-bottom))' } : undefined
|
|
298
|
+
}
|
|
197
299
|
>
|
|
198
300
|
<div>
|
|
199
301
|
<ChatFooter className="!p-0" fullWidth>
|
|
@@ -202,67 +304,35 @@ export function ChatComposer({
|
|
|
202
304
|
<BoxArchiveIcon size={24} className="shrink-0 text-ods-text-secondary" />
|
|
203
305
|
<p className="truncate text-ods-text-secondary text-h4">Unarchive the chat to continue</p>
|
|
204
306
|
</div>
|
|
205
|
-
) :
|
|
206
|
-
//
|
|
207
|
-
//
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
// first gets `rounded-t`).
|
|
212
|
-
// `has-[[data-editor]:focus]` (not `focus-within`) so the accent
|
|
213
|
-
// border reacts ONLY to the composer editor — not the picker's search
|
|
214
|
-
// input or item buttons, which also live inside this card. The editor
|
|
215
|
-
// is a `contentEditable` div (`data-editor`), not a `<textarea>`, so we
|
|
216
|
-
// target its data attribute rather than the element name.
|
|
217
|
-
<div className="rounded-md border border-ods-border bg-ods-card transition-colors has-[[data-editor]:focus]:border-ods-accent">
|
|
218
|
-
{/* Ambient navigation-history context — always the same items, so
|
|
219
|
-
it sits furthest from the textarea. Self-hides when empty. */}
|
|
220
|
-
<ChatContextMemoryBar
|
|
221
|
-
items={memory}
|
|
222
|
-
onRemove={onRemoveContextMemoryItem}
|
|
223
|
-
pending={contextMemoryPending}
|
|
224
|
-
resolveIcon={resolveContextIcon}
|
|
225
|
-
disabled={sending || locked}
|
|
226
|
-
className="rounded-t-md"
|
|
227
|
-
/>
|
|
228
|
-
{selected.length > 0 && (
|
|
229
|
-
<ChatContextChipStrip
|
|
230
|
-
items={selected}
|
|
231
|
-
onRemove={onRemoveContextItem}
|
|
232
|
-
resolveIcon={resolveContextIcon}
|
|
233
|
-
disabled={sending || locked}
|
|
234
|
-
className={cn(
|
|
235
|
-
'border-b border-ods-border bg-ods-bg p-2',
|
|
236
|
-
// Only the TOP strip rounds into the card corner.
|
|
237
|
-
memory.length === 0 && 'rounded-t-md',
|
|
238
|
-
)}
|
|
239
|
-
/>
|
|
240
|
-
)}
|
|
241
|
-
{/* Picker is rendered inside the `+` button (its `dropdown` prop)
|
|
242
|
-
so it anchors to the button, not this card. */}
|
|
243
|
-
{inputNode}
|
|
307
|
+
) : edgeLight ? (
|
|
308
|
+
// On the card's border box: a wrapper the card fills, so the ring
|
|
309
|
+
// lies over the card's border.
|
|
310
|
+
<div className="relative">
|
|
311
|
+
{liveCard}
|
|
312
|
+
<MingoEdgeLight className="rounded-md" />
|
|
244
313
|
</div>
|
|
245
314
|
) : (
|
|
246
|
-
|
|
315
|
+
liveCard
|
|
247
316
|
)}
|
|
248
317
|
</ChatFooter>
|
|
249
318
|
</div>
|
|
250
319
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
<ModelDisplay {...model} />
|
|
320
|
+
{showFooterRow && (
|
|
321
|
+
<div className="flex w-full items-center gap-2">
|
|
322
|
+
{/* Legacy (Guide-mode, no context picker) inline attachment `+`. With the
|
|
323
|
+
context picker on, uploads live in the in-input `+` menu instead. */}
|
|
324
|
+
{showLegacyAttach && onAddFiles && (
|
|
325
|
+
<ChatAttachmentAddButton
|
|
326
|
+
attachmentsEnabled
|
|
327
|
+
attachmentsCount={attachmentsCount}
|
|
328
|
+
onAddFiles={onAddFiles}
|
|
329
|
+
disabled={attachmentsDisabled || locked}
|
|
330
|
+
/>
|
|
331
|
+
)}
|
|
332
|
+
<div className="min-w-0 flex-1">{model && <ModelDisplay {...model} />}</div>
|
|
333
|
+
{footerActions && <div className="flex shrink-0 items-center">{footerActions}</div>}
|
|
264
334
|
</div>
|
|
265
|
-
|
|
335
|
+
)}
|
|
266
336
|
</div>
|
|
267
337
|
);
|
|
268
338
|
}
|
|
@@ -48,6 +48,9 @@ export interface ChatContextMemoryBarProps {
|
|
|
48
48
|
resolveIcon?: (item: ChatContextItem) => ReactNode;
|
|
49
49
|
/** External disable (e.g. while a message is streaming). */
|
|
50
50
|
disabled?: boolean;
|
|
51
|
+
/** A host control at the strip's start (e.g. "Continue <chat>" over a page).
|
|
52
|
+
* With it the strip shows even with nothing remembered — the control alone. */
|
|
53
|
+
leading?: ReactNode;
|
|
51
54
|
/**
|
|
52
55
|
* The host is reading a record it will remember (a record page whose record has not answered yet). With nothing
|
|
53
56
|
* remembered so far the strip draws its loading form at its own height, so the composer does not grow when the
|
|
@@ -62,6 +65,7 @@ export function ChatContextMemoryBar({
|
|
|
62
65
|
onRemove,
|
|
63
66
|
resolveIcon,
|
|
64
67
|
disabled = false,
|
|
68
|
+
leading,
|
|
65
69
|
pending = false,
|
|
66
70
|
className,
|
|
67
71
|
}: ChatContextMemoryBarProps) {
|
|
@@ -99,9 +103,10 @@ export function ChatContextMemoryBar({
|
|
|
99
103
|
};
|
|
100
104
|
}, [open]);
|
|
101
105
|
|
|
102
|
-
|
|
106
|
+
const hasItems = items.length > 0;
|
|
107
|
+
if (!hasItems && !leading && !pending) return null;
|
|
103
108
|
|
|
104
|
-
if (
|
|
109
|
+
if (!hasItems && !leading) {
|
|
105
110
|
// The loading form: the strip's own box, its count line a bar and its trigger's place kept.
|
|
106
111
|
return (
|
|
107
112
|
<div aria-hidden className={cn(MEMORY_STRIP_CLASS, className)}>
|
|
@@ -128,22 +133,27 @@ export function ChatContextMemoryBar({
|
|
|
128
133
|
}
|
|
129
134
|
}}
|
|
130
135
|
>
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
136
|
+
{leading}
|
|
137
|
+
{hasItems ? (
|
|
138
|
+
<p className="min-w-0 flex-1 truncate text-ods-text-secondary text-h6">
|
|
139
|
+
{items.length} recently viewed {items.length === 1 ? 'item' : 'items'} in context
|
|
140
|
+
</p>
|
|
141
|
+
) : null}
|
|
134
142
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
143
|
+
{hasItems && (
|
|
144
|
+
<Button
|
|
145
|
+
variant="bare"
|
|
146
|
+
size="icon-sm"
|
|
147
|
+
type="button"
|
|
148
|
+
aria-label="Show remembered context"
|
|
149
|
+
aria-expanded={open}
|
|
150
|
+
title="Show remembered context"
|
|
151
|
+
onClick={() => setOpen(o => !o)}
|
|
152
|
+
className="shrink-0"
|
|
153
|
+
>
|
|
154
|
+
<Ellipsis01Icon size={16} />
|
|
155
|
+
</Button>
|
|
156
|
+
)}
|
|
147
157
|
|
|
148
158
|
{open && (
|
|
149
159
|
<div
|
|
@@ -453,6 +453,13 @@ export interface ChatContextChipStripProps {
|
|
|
453
453
|
renderItem?: (item: ChatContextItem) => ReactNode;
|
|
454
454
|
disabled?: boolean;
|
|
455
455
|
className?: string;
|
|
456
|
+
/**
|
|
457
|
+
* Makes a chip's icon and label a button — e.g. the page the composer sits on,
|
|
458
|
+
* whose click asks Mingo about it. The × (`onRemove`) stays its own button.
|
|
459
|
+
*/
|
|
460
|
+
onSelect?: (item: ChatContextItem) => void;
|
|
461
|
+
/** What a click on a chip does: its tooltip and accessible name, before the label (with `onSelect`). */
|
|
462
|
+
selectHint?: string;
|
|
456
463
|
}
|
|
457
464
|
|
|
458
465
|
/**
|
|
@@ -467,8 +474,25 @@ export function ChatContextChipStrip({
|
|
|
467
474
|
renderItem,
|
|
468
475
|
disabled = false,
|
|
469
476
|
className,
|
|
477
|
+
onSelect,
|
|
478
|
+
selectHint,
|
|
470
479
|
}: ChatContextChipStripProps) {
|
|
471
480
|
if (items.length === 0) return null;
|
|
481
|
+
const chipFace = (item: ChatContextItem) => (
|
|
482
|
+
<>
|
|
483
|
+
{resolveIcon && (
|
|
484
|
+
<span className="flex size-4 shrink-0 items-center justify-center text-ods-text-secondary [&_svg]:size-4">
|
|
485
|
+
{resolveIcon(item)}
|
|
486
|
+
</span>
|
|
487
|
+
)}
|
|
488
|
+
<span
|
|
489
|
+
className="max-w-[220px] truncate font-mono font-medium uppercase tracking-[-0.28px] text-h5"
|
|
490
|
+
title={onSelect ? undefined : item.label}
|
|
491
|
+
>
|
|
492
|
+
{item.label}
|
|
493
|
+
</span>
|
|
494
|
+
</>
|
|
495
|
+
);
|
|
472
496
|
return (
|
|
473
497
|
// `tag` pills (Figma 1:6073): 32px tall, card surface, bordered, mono-
|
|
474
498
|
// uppercase label, 16px lead icon + xmark-circle remove. Wraps to new rows.
|
|
@@ -478,24 +502,34 @@ export function ChatContextChipStrip({
|
|
|
478
502
|
// whole pill when provided and non-null; otherwise the default pill.
|
|
479
503
|
const hostNode = renderItem?.(item);
|
|
480
504
|
if (hostNode != null) return <Fragment key={itemKey(item)}>{hostNode}</Fragment>;
|
|
505
|
+
const selectName = selectHint ? `${selectHint}: ${item.label}` : item.label;
|
|
481
506
|
return (
|
|
482
507
|
<div
|
|
483
508
|
key={itemKey(item)}
|
|
484
|
-
className=
|
|
509
|
+
className={cn(
|
|
510
|
+
'flex h-8 shrink-0 items-center gap-2 rounded-md border border-ods-border bg-ods-card px-2 text-ods-text-primary',
|
|
511
|
+
onSelect && 'transition-colors has-[[data-chip-select]:hover]:border-ods-border-hover',
|
|
512
|
+
)}
|
|
485
513
|
role="group"
|
|
486
514
|
aria-label={`Context ${item.label}`}
|
|
487
515
|
>
|
|
488
|
-
{
|
|
489
|
-
<
|
|
490
|
-
|
|
491
|
-
|
|
516
|
+
{onSelect ? (
|
|
517
|
+
<Button
|
|
518
|
+
variant="bare"
|
|
519
|
+
size="wrap"
|
|
520
|
+
type="button"
|
|
521
|
+
data-chip-select=""
|
|
522
|
+
onClick={() => onSelect(item)}
|
|
523
|
+
disabled={disabled}
|
|
524
|
+
title={selectName}
|
|
525
|
+
aria-label={selectName}
|
|
526
|
+
className="min-w-0 gap-2 text-ods-text-primary hover:text-ods-accent focus-visible:text-ods-accent [&_svg]:size-4"
|
|
527
|
+
>
|
|
528
|
+
{chipFace(item)}
|
|
529
|
+
</Button>
|
|
530
|
+
) : (
|
|
531
|
+
chipFace(item)
|
|
492
532
|
)}
|
|
493
|
-
<span
|
|
494
|
-
className="max-w-[220px] truncate font-mono font-medium uppercase tracking-[-0.28px] text-ods-text-primary text-h5"
|
|
495
|
-
title={item.label}
|
|
496
|
-
>
|
|
497
|
-
{item.label}
|
|
498
|
-
</span>
|
|
499
533
|
{onRemove && (
|
|
500
534
|
<Button
|
|
501
535
|
variant="bare"
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useEffect, useRef, useState } from 'react';
|
|
4
|
+
import { cn } from '../../utils/cn';
|
|
5
|
+
|
|
6
|
+
export interface ChatHeaderRenameFieldProps {
|
|
7
|
+
/** The chat's current title; selected on mount, so typing replaces it. */
|
|
8
|
+
initialValue: string;
|
|
9
|
+
/** Enter, or the field losing focus. Fired with the raw value: the host
|
|
10
|
+
* decides what an empty or unchanged title means. */
|
|
11
|
+
onSubmit: (value: string) => void;
|
|
12
|
+
/** Escape. Nothing is saved. */
|
|
13
|
+
onCancel: () => void;
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Inline rename for the chat header's title: the title cell becomes this field,
|
|
19
|
+
* its text selected. Enter saves, Escape cancels, blur saves. Settles once —
|
|
20
|
+
* the header unmounts it on either outcome, and a blur from that unmount must
|
|
21
|
+
* not save a second time (or save after a cancel).
|
|
22
|
+
*/
|
|
23
|
+
export function ChatHeaderRenameField({ initialValue, onSubmit, onCancel, className }: ChatHeaderRenameFieldProps) {
|
|
24
|
+
const [value, setValue] = useState(initialValue);
|
|
25
|
+
const inputRef = useRef<HTMLInputElement>(null);
|
|
26
|
+
const settledRef = useRef(false);
|
|
27
|
+
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
const el = inputRef.current;
|
|
30
|
+
if (!el) return;
|
|
31
|
+
el.focus({ preventScroll: true });
|
|
32
|
+
el.select();
|
|
33
|
+
}, []);
|
|
34
|
+
|
|
35
|
+
const settle = (save: boolean) => {
|
|
36
|
+
if (settledRef.current) return;
|
|
37
|
+
settledRef.current = true;
|
|
38
|
+
if (save) onSubmit(value);
|
|
39
|
+
else onCancel();
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<input
|
|
44
|
+
ref={inputRef}
|
|
45
|
+
value={value}
|
|
46
|
+
aria-label="Chat name"
|
|
47
|
+
onChange={e => setValue(e.target.value)}
|
|
48
|
+
onKeyDown={e => {
|
|
49
|
+
// An IME commits its candidate with Enter: that keystroke is not a save.
|
|
50
|
+
if (e.nativeEvent.isComposing) return;
|
|
51
|
+
if (e.key === 'Enter') {
|
|
52
|
+
e.preventDefault();
|
|
53
|
+
settle(true);
|
|
54
|
+
} else if (e.key === 'Escape') {
|
|
55
|
+
// The page may read Escape too (e.g. as "back"): this one is ours.
|
|
56
|
+
e.preventDefault();
|
|
57
|
+
e.stopPropagation();
|
|
58
|
+
settle(false);
|
|
59
|
+
}
|
|
60
|
+
}}
|
|
61
|
+
onBlur={() => settle(true)}
|
|
62
|
+
className={cn(
|
|
63
|
+
'h-8 w-full min-w-0 rounded-md border border-ods-accent bg-ods-bg px-[var(--spacing-system-xs)] text-ods-text-primary outline-none text-h3',
|
|
64
|
+
className,
|
|
65
|
+
)}
|
|
66
|
+
/>
|
|
67
|
+
);
|
|
68
|
+
}
|
|
@@ -180,6 +180,7 @@ const ChatInput = forwardRef<ChatInputRef, ChatInputProps>((allProps, ref) => {
|
|
|
180
180
|
onMentionQueryChange,
|
|
181
181
|
onValueChange,
|
|
182
182
|
startIcon,
|
|
183
|
+
endIcon,
|
|
183
184
|
hideBorder,
|
|
184
185
|
previewText,
|
|
185
186
|
// Remaining textarea-only attrs are intentionally dropped — the editor is a
|
|
@@ -241,8 +242,13 @@ const ChatInput = forwardRef<ChatInputRef, ChatInputProps>((allProps, ref) => {
|
|
|
241
242
|
// …and any draft edit while a preview is showing dismisses it immediately, so
|
|
242
243
|
// keystrokes into the (preview-hidden) editor become visible at once. Keyed on
|
|
243
244
|
// `value` only — depending on `previewText` would re-dismiss on every hover,
|
|
244
|
-
// hence the ref above.
|
|
245
|
+
// hence the ref above. A CHANGE of the value, not the mount: a preview the
|
|
246
|
+
// host already holds when the composer (re)mounts — a docked composer is
|
|
247
|
+
// remounted on every conversation switch — is no edit, and must still show.
|
|
248
|
+
const previewValueRef = useRef(value);
|
|
245
249
|
useEffect(() => {
|
|
250
|
+
if (previewValueRef.current === value) return;
|
|
251
|
+
previewValueRef.current = value;
|
|
246
252
|
if (previewTextRef.current) setPreviewDismissed(true);
|
|
247
253
|
}, [value]);
|
|
248
254
|
|
|
@@ -745,6 +751,8 @@ const ChatInput = forwardRef<ChatInputRef, ChatInputProps>((allProps, ref) => {
|
|
|
745
751
|
/>
|
|
746
752
|
</div>
|
|
747
753
|
|
|
754
|
+
{endIcon && <span className="flex h-6 shrink-0 items-center">{endIcon}</span>}
|
|
755
|
+
|
|
748
756
|
<Button
|
|
749
757
|
variant="bare"
|
|
750
758
|
size="icon-sm"
|