@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
|
@@ -3,10 +3,8 @@
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { useMdUp } from '../../hooks/ui/use-media-query';
|
|
5
5
|
import { cn } from '../../utils/cn';
|
|
6
|
-
import { useOptionalNotifications } from '../features/notifications/notifications-context';
|
|
7
6
|
import { TimeTrackerHeaderButton } from '../features/time-tracker';
|
|
8
7
|
import { Menu01Icon, SearchIcon, XmarkIcon } from '../icons-v2-generated';
|
|
9
|
-
import { BellIcon } from '../icons-v2-generated/interface/bell-icon';
|
|
10
8
|
import { LogOutIcon } from '../icons-v2-generated/interface/log-out-icon';
|
|
11
9
|
import { OpenframeLogoIcon } from '../icons-v2-generated/logos/openframe-logo-icon';
|
|
12
10
|
import { OpenframeTextIcon } from '../icons-v2-generated/logos/openframe-text-icon';
|
|
@@ -18,6 +16,7 @@ import { HeaderButton } from './header-button';
|
|
|
18
16
|
import { HeaderGlobalSearch } from './header-global-search';
|
|
19
17
|
import { HeaderMingoButton } from './header-mingo-button';
|
|
20
18
|
import { HeaderOrganizationFilter } from './header-organization-filter';
|
|
19
|
+
import { NotificationsBellButton } from './notifications-bell-button';
|
|
21
20
|
import { TicketAlertsButton } from './ticket-alerts-button';
|
|
22
21
|
import { TopNavigation } from './top-navigation';
|
|
23
22
|
|
|
@@ -70,6 +69,14 @@ export interface AppHeaderProps {
|
|
|
70
69
|
* EXCEPT the mobile burger menu toggle, which remains interactive.
|
|
71
70
|
*/
|
|
72
71
|
disabled?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* The host's own action cells beside the built-in ones (a phone "Chat
|
|
74
|
+
* history" cell, say). Drawn as the built-in cells are — an icon-only
|
|
75
|
+
* `HeaderButton` with the leading divider, dimmed and disabled with the
|
|
76
|
+
* header — in the order given, at their `placement`. Optional; without it the
|
|
77
|
+
* header is unchanged.
|
|
78
|
+
*/
|
|
79
|
+
customCells?: ReadonlyArray<AppHeaderCell>;
|
|
73
80
|
/**
|
|
74
81
|
* Draw placeholder cells instead of the live controls.
|
|
75
82
|
*
|
|
@@ -116,10 +123,37 @@ export interface AppHeaderProps {
|
|
|
116
123
|
* - `'icon-md'` — the same cell, from md only (the avatar: `isMdUp && showUser`).
|
|
117
124
|
* - `'icon-lg'` — the same cell, from lg only (the organization filter, which the
|
|
118
125
|
* live header renders `hidden lg:flex`).
|
|
126
|
+
* - `'icon-max-md'` — the same cell, below md only (a `customCells` entry with
|
|
127
|
+
* `mobileOnly`).
|
|
119
128
|
* - `'wide'` — the Mingo launcher: a 48px square below md, where the live button is
|
|
120
129
|
* `iconOnly`, and the fixed 140px labelled cell from md.
|
|
121
130
|
*/
|
|
122
|
-
export type HeaderLoadingCell = 'icon' | 'icon-md' | 'icon-lg' | 'wide';
|
|
131
|
+
export type HeaderLoadingCell = 'icon' | 'icon-md' | 'icon-lg' | 'icon-max-md' | 'wide';
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* A host-defined trailing cell — see `AppHeaderProps.customCells`.
|
|
135
|
+
*/
|
|
136
|
+
export interface AppHeaderCell {
|
|
137
|
+
/** Stable React key. */
|
|
138
|
+
id: string;
|
|
139
|
+
/** The cell's icon, sized like the built-in ones (`h-6 w-6`). */
|
|
140
|
+
icon: React.ReactNode;
|
|
141
|
+
/** Accessible name; the cell is icon-only. */
|
|
142
|
+
label: string;
|
|
143
|
+
onClick?: () => void;
|
|
144
|
+
/** Pressed look, e.g. while the panel the cell opens is showing. */
|
|
145
|
+
isActive?: boolean;
|
|
146
|
+
/** The shared unread dot on the icon. */
|
|
147
|
+
showUnreadDot?: boolean;
|
|
148
|
+
/**
|
|
149
|
+
* - `start` (default): before the built-in cells — after the phone search
|
|
150
|
+
* trigger and the organization filter, before the time tracker and the bell.
|
|
151
|
+
* - `end`: after them, immediately before the Mingo cell.
|
|
152
|
+
*/
|
|
153
|
+
placement?: 'start' | 'end';
|
|
154
|
+
/** Only below md: a phone top-bar cell. In CSS, like every split here. Default false. */
|
|
155
|
+
mobileOnly?: boolean;
|
|
156
|
+
}
|
|
123
157
|
|
|
124
158
|
export const AppHeader = React.memo(function AppHeaderImpl({
|
|
125
159
|
showSearch,
|
|
@@ -149,6 +183,7 @@ export const AppHeader = React.memo(function AppHeaderImpl({
|
|
|
149
183
|
disabled = false,
|
|
150
184
|
loading: loadingProp = false,
|
|
151
185
|
loadingActionCells,
|
|
186
|
+
customCells,
|
|
152
187
|
}: AppHeaderProps) {
|
|
153
188
|
const isMdUp = useMdUp() ?? false;
|
|
154
189
|
const loading = useLoadingScope() || loadingProp;
|
|
@@ -167,10 +202,12 @@ export const AppHeader = React.memo(function AppHeaderImpl({
|
|
|
167
202
|
// gated on `isMdUp`, and Mingo is `iconOnly` below md.
|
|
168
203
|
([
|
|
169
204
|
showOrganizations && 'icon-lg',
|
|
205
|
+
...customCellFootprints(customCells, 'start'),
|
|
170
206
|
showTimeTracker && 'icon',
|
|
171
207
|
showNotifications && 'icon',
|
|
172
208
|
showTicketAlerts && 'icon',
|
|
173
209
|
showUser && 'icon-md',
|
|
210
|
+
...customCellFootprints(customCells, 'end'),
|
|
174
211
|
showMingoAI && 'wide',
|
|
175
212
|
].filter(Boolean) as HeaderLoadingCell[])
|
|
176
213
|
}
|
|
@@ -183,6 +220,22 @@ export const AppHeader = React.memo(function AppHeaderImpl({
|
|
|
183
220
|
// Cells carry their own dividers in the unified TopNavigation model
|
|
184
221
|
// (the shell no longer applies divide-x).
|
|
185
222
|
const cellDivider = 'border-l border-ods-border';
|
|
223
|
+
const renderCustomCells = (placement: NonNullable<AppHeaderCell['placement']>) =>
|
|
224
|
+
customCells
|
|
225
|
+
?.filter(cell => (cell.placement ?? 'start') === placement)
|
|
226
|
+
.map(cell => (
|
|
227
|
+
<HeaderButton
|
|
228
|
+
key={cell.id}
|
|
229
|
+
type="button"
|
|
230
|
+
icon={cell.icon}
|
|
231
|
+
aria-label={cell.label}
|
|
232
|
+
onClick={cell.onClick}
|
|
233
|
+
isActive={cell.isActive}
|
|
234
|
+
showUnreadDot={cell.showUnreadDot}
|
|
235
|
+
disabled={disabled || !cell.onClick}
|
|
236
|
+
className={cn(cell.mobileOnly && 'md:hidden', cellDivider, dimmedClass)}
|
|
237
|
+
/>
|
|
238
|
+
));
|
|
186
239
|
|
|
187
240
|
return (
|
|
188
241
|
<TopNavigation
|
|
@@ -237,15 +290,17 @@ export const AppHeader = React.memo(function AppHeaderImpl({
|
|
|
237
290
|
/>
|
|
238
291
|
)}
|
|
239
292
|
|
|
293
|
+
{renderCustomCells('start')}
|
|
294
|
+
|
|
240
295
|
{/* Time tracker button */}
|
|
241
296
|
{showTimeTracker && <TimeTrackerHeaderButton disabled={disabled} className={cn(cellDivider, dimmedClass)} />}
|
|
242
297
|
|
|
243
298
|
{/* Notifications button */}
|
|
244
299
|
{showNotifications && (
|
|
245
|
-
<
|
|
300
|
+
<NotificationsBellButton
|
|
246
301
|
fallbackUnreadCount={unreadCount}
|
|
247
302
|
disabled={disabled}
|
|
248
|
-
|
|
303
|
+
className={cn(cellDivider, dimmedClass)}
|
|
249
304
|
/>
|
|
250
305
|
)}
|
|
251
306
|
|
|
@@ -327,6 +382,8 @@ export const AppHeader = React.memo(function AppHeaderImpl({
|
|
|
327
382
|
</DropdownMenu>
|
|
328
383
|
)}
|
|
329
384
|
|
|
385
|
+
{renderCustomCells('end')}
|
|
386
|
+
|
|
330
387
|
{/* Mingo AI launcher — anchored at the very end of the header. On mobile
|
|
331
388
|
it collapses to an icon-only affordance (no "Mingo AI" wordmark). */}
|
|
332
389
|
{showMingoAI && (
|
|
@@ -345,33 +402,6 @@ export const AppHeader = React.memo(function AppHeaderImpl({
|
|
|
345
402
|
);
|
|
346
403
|
});
|
|
347
404
|
|
|
348
|
-
interface NotificationsHeaderButtonProps {
|
|
349
|
-
fallbackUnreadCount: number;
|
|
350
|
-
disabled: boolean;
|
|
351
|
-
dimmedClass: string;
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
function NotificationsHeaderButton({ fallbackUnreadCount, disabled, dimmedClass }: NotificationsHeaderButtonProps) {
|
|
355
|
-
const ctx = useOptionalNotifications();
|
|
356
|
-
const hasUnread = (ctx?.unreadCount ?? fallbackUnreadCount) > 0;
|
|
357
|
-
const isActive = ctx?.isOpen ?? false;
|
|
358
|
-
const onClick = ctx?.toggle;
|
|
359
|
-
|
|
360
|
-
return (
|
|
361
|
-
<HeaderButton
|
|
362
|
-
icon={isActive ? <XmarkIcon className="h-6 w-6" /> : <BellIcon className="h-6 w-6" />}
|
|
363
|
-
// Shared dot primitive on the cell — same markup every indicator
|
|
364
|
-
// cell renders (see HeaderButton.showUnreadDot / <UnreadDot>).
|
|
365
|
-
showUnreadDot={!isActive && hasUnread}
|
|
366
|
-
aria-label={isActive ? 'Close notifications' : 'Notifications'}
|
|
367
|
-
onClick={onClick}
|
|
368
|
-
isActive={isActive}
|
|
369
|
-
disabled={disabled || !onClick}
|
|
370
|
-
className={dimmedClass}
|
|
371
|
-
/>
|
|
372
|
-
);
|
|
373
|
-
}
|
|
374
|
-
|
|
375
405
|
export default AppHeader;
|
|
376
406
|
|
|
377
407
|
// Literal class strings — Tailwind's scanner needs to see them spelled out.
|
|
@@ -379,8 +409,19 @@ const CELL_VISIBILITY: Record<Exclude<HeaderLoadingCell, 'wide'>, string | undef
|
|
|
379
409
|
icon: undefined,
|
|
380
410
|
'icon-md': 'hidden md:flex',
|
|
381
411
|
'icon-lg': 'hidden lg:flex',
|
|
412
|
+
'icon-max-md': 'md:hidden',
|
|
382
413
|
};
|
|
383
414
|
|
|
415
|
+
/** The loading footprints of the custom cells at one placement, in order. */
|
|
416
|
+
function customCellFootprints(
|
|
417
|
+
cells: ReadonlyArray<AppHeaderCell> | undefined,
|
|
418
|
+
placement: NonNullable<AppHeaderCell['placement']>,
|
|
419
|
+
): HeaderLoadingCell[] {
|
|
420
|
+
return (cells ?? [])
|
|
421
|
+
.filter(cell => (cell.placement ?? 'start') === placement)
|
|
422
|
+
.map(cell => (cell.mobileOnly ? 'icon-max-md' : 'icon'));
|
|
423
|
+
}
|
|
424
|
+
|
|
384
425
|
/** One trailing action cell placeholder — mirrors the live cells' 48/56px box. */
|
|
385
426
|
function HeaderCellSkeleton({ className }: { className?: string }) {
|
|
386
427
|
return (
|
|
@@ -393,7 +434,7 @@ function HeaderCellSkeleton({ className }: { className?: string }) {
|
|
|
393
434
|
/**
|
|
394
435
|
* Wide cell placeholder — mirrors `HeaderMingoButton` at both widths, which are
|
|
395
436
|
* two different shapes: the live button gets `iconOnly={!isMdUp}`, so below md it
|
|
396
|
-
* drops its wordmark and collapses to the same
|
|
437
|
+
* drops its wordmark and collapses to the same square as any other cell, and
|
|
397
438
|
* from md it is the fixed 140px labelled cell. Reserving 140px-worth of icon,
|
|
398
439
|
* label, gap and padding on a phone would make the placeholder cluster ~70px
|
|
399
440
|
* wider than the header it hands off to.
|
|
@@ -44,3 +44,25 @@ export const AppLayoutDrawerCoordinationContext = createContext<AppLayoutDrawerC
|
|
|
44
44
|
export function useAppLayoutDrawerCoordination(): AppLayoutDrawerCoordination | null {
|
|
45
45
|
return useContext(AppLayoutDrawerCoordinationContext);
|
|
46
46
|
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* The composer dock's height while AppLayout has one, 0 otherwise: what a page's
|
|
50
|
+
* window-pinned bottom bar rises by (`PageActions` on a phone), so it does not cover
|
|
51
|
+
* the composer.
|
|
52
|
+
*
|
|
53
|
+
* A context rather than a CSS variable on the page column. The dock grows with the
|
|
54
|
+
* draft (every new line, a staged attachment), and an inherited custom property
|
|
55
|
+
* there made WebKit restyle the whole page on each change; this way only the bars
|
|
56
|
+
* that read it re-render.
|
|
57
|
+
*/
|
|
58
|
+
export const ComposerDockHeightContext = createContext(0);
|
|
59
|
+
|
|
60
|
+
export function useComposerDockHeight(): number {
|
|
61
|
+
return useContext(ComposerDockHeightContext);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Marks the navigation sidebar's root, so a popup opened from a button inside it can
|
|
66
|
+
* start past the sidebar's edge instead of over it (the compact time tracker).
|
|
67
|
+
*/
|
|
68
|
+
export const NAVIGATION_SIDEBAR_ATTRIBUTE = 'data-navigation-sidebar';
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
4
|
-
import type { ReactNode } from 'react';
|
|
5
|
-
import { ContentAreaWidthContext } from '../../hooks/ui/use-content-breakpoint';
|
|
4
|
+
import type { CSSProperties, ReactNode } from 'react';
|
|
5
|
+
import { ContentAreaWidthContext, contentBreakpointFor } from '../../hooks/ui/use-content-breakpoint';
|
|
6
6
|
import { useIsomorphicLayoutEffect } from '../../hooks/ui/use-isomorphic-layout-effect';
|
|
7
7
|
import type { NavigationSidebarConfig } from '../../types/navigation';
|
|
8
8
|
import { cn } from '../../utils';
|
|
9
9
|
import { NotificationDrawer } from '../features/notifications/notification-drawer';
|
|
10
|
+
import { previewFadeMask } from '../ui/fade-preview';
|
|
11
|
+
import { useMobileActionBarHeight } from '../ui/mobile-action-bar';
|
|
10
12
|
import { AppHeader, type AppHeaderProps } from './app-header';
|
|
11
13
|
import {
|
|
12
14
|
AppLayoutDrawerContainerContext,
|
|
13
15
|
type AppLayoutDrawerCoordination,
|
|
14
16
|
AppLayoutDrawerCoordinationContext,
|
|
15
17
|
type AppLayoutDrawerHandle,
|
|
18
|
+
ComposerDockHeightContext,
|
|
16
19
|
} from './app-layout-context';
|
|
17
20
|
import { AppLayoutSidePanel, type AppLayoutSidePanelConfig, useAppLayoutSidePanel } from './app-layout-side-panel';
|
|
18
21
|
import { MobileBurgerMenu, type MobileBurgerMenuProps } from './mobile-burger-menu';
|
|
@@ -55,8 +58,103 @@ export interface AppLayoutProps {
|
|
|
55
58
|
* over the content area. Optional; without it the layout is unchanged.
|
|
56
59
|
*/
|
|
57
60
|
sidePanel?: AppLayoutSidePanelConfig;
|
|
61
|
+
/**
|
|
62
|
+
* A bar docked under the page (the Mingo composer). It sits below the
|
|
63
|
+
* scrolling `<main>`, outside it, so it stays put while the page scrolls and
|
|
64
|
+
* the page's scroll area ends above it: nothing is ever hidden under it. It
|
|
65
|
+
* spans the page column — left of a `sidePanel` — and, on a phone, sits at
|
|
66
|
+
* the bottom of the screen; the bottom safe-area inset belongs to the layout
|
|
67
|
+
* root (the host's `className`), not to the dock.
|
|
68
|
+
*
|
|
69
|
+
* With it, the page column is an adaptive content area, as with `sidePanel`:
|
|
70
|
+
* `<main>` and the dock each follow the column's width in their tokens and
|
|
71
|
+
* `content-md:` / `content-lg:` classes, and `useContentBreakpoint()` answers
|
|
72
|
+
* from it on both. Pass `null` to keep that (and the slot) while drawing
|
|
73
|
+
* nothing, e.g. behind a paywall; `undefined` removes it. Either way the page
|
|
74
|
+
* stays mounted. Optional; without it the layout is unchanged.
|
|
75
|
+
*/
|
|
76
|
+
composerDock?: ReactNode;
|
|
77
|
+
/**
|
|
78
|
+
* A layer over the page that ends at the `composerDock`'s top edge — the
|
|
79
|
+
* conversation sheet that rises from the composer over the page (a scrim over
|
|
80
|
+
* the page, the thread above the composer). The layer spans the page column,
|
|
81
|
+
* takes no pointer events itself (what the host draws in it opts in with
|
|
82
|
+
* `pointer-events-auto`) and is the positioning box for it: anchor the sheet to
|
|
83
|
+
* its bottom. It follows the dock's height as the composer grows. It is a
|
|
84
|
+
* content area like the dock, so `content-md:` / `content-lg:` and
|
|
85
|
+
* `useContentBreakpoint()` answer from the column's width. Above the page's own
|
|
86
|
+
* layers (sticky bars, the `contentCorner`), under in-layout drawers and modals.
|
|
87
|
+
* Only with a `composerDock`; omitted, `null` or `false` draws nothing and the
|
|
88
|
+
* page is unchanged.
|
|
89
|
+
*/
|
|
90
|
+
composerSheet?: ReactNode;
|
|
91
|
+
/**
|
|
92
|
+
* The `composerDock` lies over the bottom of the page instead of taking its height:
|
|
93
|
+
* the page scrolls on under it (`<main>` is padded by the dock's height, so its end
|
|
94
|
+
* still clears it) and fades out to fully transparent over the dock's height (the
|
|
95
|
+
* shared preview fade, `previewFadeMask`), seen either side of the composer. Where the
|
|
96
|
+
* dock is transparent the page takes the pointer and the wheel; the host makes its own
|
|
97
|
+
* content take them back (`pointer-events-auto`). Off: the dock is a band of its own
|
|
98
|
+
* under the page.
|
|
99
|
+
*
|
|
100
|
+
* `<main>` carries the floating dock's height as `--composer-dock-inset` (`0px`
|
|
101
|
+
* otherwise), for a page that fills `<main>`'s height and runs on under the dock
|
|
102
|
+
* rather than ending above it: it grows by the inset and gives it back as a negative
|
|
103
|
+
* margin (`h-[calc(100%+var(--composer-dock-inset,0px))]
|
|
104
|
+
* -mb-[var(--composer-dock-inset,0px)]`), and pads its own scroll areas' ends by it.
|
|
105
|
+
*/
|
|
106
|
+
composerDockFloats?: boolean;
|
|
107
|
+
/**
|
|
108
|
+
* Paints the page column — the page and the `composerDock` under it — as one
|
|
109
|
+
* surface: that surface's ground and the accent corner glow, so a chat page's
|
|
110
|
+
* background runs under the composer to the bottom of the window (`'mingo'`,
|
|
111
|
+
* with the dock's `EmbeddableChat` portalling its thread into the page). Takes
|
|
112
|
+
* effect on a column with a dock or a `contentCorner`. Omitted: the column is
|
|
113
|
+
* transparent, as before.
|
|
114
|
+
*/
|
|
115
|
+
pageSurface?: 'mingo';
|
|
116
|
+
/**
|
|
117
|
+
* The desktop `AppHeader`. `false` drops it from md up — the sidebar and the
|
|
118
|
+
* page start at the top of the window — and keeps the phone top bar (burger,
|
|
119
|
+
* logo, action cells) below md. Decided in CSS, so the first paint is right
|
|
120
|
+
* at every width. Default `true`.
|
|
121
|
+
*
|
|
122
|
+
* Without the header the notifications bell has no place of its own: render
|
|
123
|
+
* a `NotificationsBellButton variant="floating"` in `contentCorner`. The
|
|
124
|
+
* `NotificationDrawer` this layout mounts follows the `NotificationsProvider`,
|
|
125
|
+
* not the header.
|
|
126
|
+
*/
|
|
127
|
+
desktopHeader?: boolean;
|
|
128
|
+
/**
|
|
129
|
+
* Controls pinned to the top-right corner of the page column (the
|
|
130
|
+
* notifications bell when `desktopHeader` is off). Floats over the page at
|
|
131
|
+
* the header's layer and does not scroll with it; in-layout drawers cover it.
|
|
132
|
+
* From md up only — below md it is not displayed, as the phone top bar
|
|
133
|
+
* carries those controls. Leave room for it in the page's title row.
|
|
134
|
+
* Optional; without it the layout is unchanged.
|
|
135
|
+
*/
|
|
136
|
+
contentCorner?: ReactNode;
|
|
137
|
+
/**
|
|
138
|
+
* Controlled phone burger menu (below md). With it the host owns whether the
|
|
139
|
+
* menu is open — e.g. a top-bar cell that opens it on its chat history, or a
|
|
140
|
+
* navigation started from one of its slots that has to close it. Omitted:
|
|
141
|
+
* the layout keeps its own state, as before.
|
|
142
|
+
*/
|
|
143
|
+
mobileMenuOpen?: boolean;
|
|
144
|
+
/**
|
|
145
|
+
* Every open / close the layout asks for, controlled or not: the burger
|
|
146
|
+
* toggle, a nav entry clicked in the menu, an in-layout drawer opening over
|
|
147
|
+
* it, and — when `sidebarConfig.currentPath` is set — any change of that
|
|
148
|
+
* location while the menu is open (so a navigation started anywhere, a slot
|
|
149
|
+
* included, closes it). A host opening it through `mobileMenuOpen` also
|
|
150
|
+
* closes any open in-layout drawer, as the toggle does.
|
|
151
|
+
*/
|
|
152
|
+
onMobileMenuOpenChange?: (open: boolean) => void;
|
|
58
153
|
}
|
|
59
154
|
|
|
155
|
+
/** The floating dock's height on `<main>`, for a page that runs on under it (`composerDockFloats`). */
|
|
156
|
+
const COMPOSER_DOCK_INSET_VAR = '--composer-dock-inset';
|
|
157
|
+
|
|
60
158
|
export function AppLayout({
|
|
61
159
|
children,
|
|
62
160
|
sidebarConfig,
|
|
@@ -68,23 +166,73 @@ export function AppLayout({
|
|
|
68
166
|
drawer,
|
|
69
167
|
topBar,
|
|
70
168
|
sidePanel,
|
|
169
|
+
composerDock,
|
|
170
|
+
composerSheet,
|
|
171
|
+
composerDockFloats = false,
|
|
172
|
+
pageSurface,
|
|
173
|
+
desktopHeader = true,
|
|
174
|
+
contentCorner,
|
|
175
|
+
mobileMenuOpen: mobileMenuOpenProp,
|
|
176
|
+
onMobileMenuOpenChange,
|
|
71
177
|
}: AppLayoutProps) {
|
|
72
|
-
const
|
|
178
|
+
const menuControlled = mobileMenuOpenProp !== undefined;
|
|
179
|
+
const [uncontrolledMenuOpen, setUncontrolledMenuOpen] = useState(false);
|
|
180
|
+
const mobileMenuOpen = menuControlled ? mobileMenuOpenProp : uncontrolledMenuOpen;
|
|
73
181
|
const [drawerContainer, setDrawerContainer] = useState<HTMLDivElement | null>(null);
|
|
74
182
|
const [mainElement, setMainElement] = useState<HTMLElement | null>(null);
|
|
75
183
|
const [contentWidth, setContentWidth] = useState<number | null>(null);
|
|
184
|
+
const [dockElement, setDockElement] = useState<HTMLDivElement | null>(null);
|
|
185
|
+
const [dockHeight, setDockHeight] = useState(0);
|
|
76
186
|
|
|
77
187
|
const hasSidePanel = sidePanel !== undefined;
|
|
188
|
+
const hasDock = composerDock !== undefined;
|
|
189
|
+
const dockFloats = hasDock && composerDockFloats;
|
|
190
|
+
// A page's window-pinned action bar (`PageActions` below md) lies over the page's end
|
|
191
|
+
// as well, over the dock where there is one: the page runs on by its height too.
|
|
192
|
+
const actionBarHeight = useMobileActionBarHeight();
|
|
193
|
+
const bottomInset = (dockFloats ? dockHeight : 0) + actionBarHeight;
|
|
194
|
+
const hasCorner = contentCorner !== undefined;
|
|
195
|
+
// The page column lays out by its own width: something narrows it (the
|
|
196
|
+
// panel) or shares it with the page (the dock).
|
|
197
|
+
const adaptive = hasSidePanel || hasDock;
|
|
198
|
+
// The column needs a box of its own only to stack the dock under <main> and
|
|
199
|
+
// to anchor the corner; otherwise it is `contents` and <main> stays the row's
|
|
200
|
+
// flex item exactly as before.
|
|
201
|
+
const columnIsBox = hasDock || hasCorner;
|
|
78
202
|
const sidePanelState = useAppLayoutSidePanel(sidePanel, drawerContainer);
|
|
79
203
|
|
|
80
204
|
useIsomorphicLayoutEffect(() => {
|
|
81
|
-
if (!
|
|
82
|
-
|
|
205
|
+
if (!adaptive || !mainElement) return undefined;
|
|
206
|
+
// Every reader asks for the breakpoint (`useContentBreakpoint`), so only a
|
|
207
|
+
// crossing re-renders the layout: kept at the old width, the state bails out.
|
|
208
|
+
// Per pixel, the uncompiled layout and every breakpoint consumer re-rendered on
|
|
209
|
+
// each frame of a sidebar toggle, a window drag or a side-panel resize.
|
|
210
|
+
const update = () => {
|
|
211
|
+
const width = mainElement.clientWidth;
|
|
212
|
+
setContentWidth(previous =>
|
|
213
|
+
previous !== null && contentBreakpointFor(previous) === contentBreakpointFor(width) ? previous : width,
|
|
214
|
+
);
|
|
215
|
+
};
|
|
83
216
|
update();
|
|
84
217
|
const observer = new ResizeObserver(update);
|
|
85
218
|
observer.observe(mainElement);
|
|
86
219
|
return () => observer.disconnect();
|
|
87
|
-
}, [
|
|
220
|
+
}, [adaptive, mainElement]);
|
|
221
|
+
const contentAreaWidth = adaptive ? contentWidth : null;
|
|
222
|
+
|
|
223
|
+
// The sheet layer ends where the dock begins, and the dock grows with the
|
|
224
|
+
// composer (a longer draft, a staged attachment): follow its height. The page
|
|
225
|
+
// reads it too (`ComposerDockHeightContext`): a phone's bottom action bar
|
|
226
|
+
// (`PageActions`) is pinned to the window and would cover the composer.
|
|
227
|
+
const hasSheet = hasDock && composerSheet != null && composerSheet !== false;
|
|
228
|
+
useIsomorphicLayoutEffect(() => {
|
|
229
|
+
if (!hasDock || !dockElement) return undefined;
|
|
230
|
+
const update = () => setDockHeight(dockElement.offsetHeight);
|
|
231
|
+
update();
|
|
232
|
+
const observer = new ResizeObserver(update);
|
|
233
|
+
observer.observe(dockElement);
|
|
234
|
+
return () => observer.disconnect();
|
|
235
|
+
}, [hasDock, dockElement]);
|
|
88
236
|
|
|
89
237
|
// With a side panel the header's Mingo button only exists while the panel
|
|
90
238
|
// cannot dock: it opens the panel over the content and closes it again.
|
|
@@ -99,15 +247,27 @@ export function AppLayout({
|
|
|
99
247
|
mingoAICloseWhenActive: true,
|
|
100
248
|
};
|
|
101
249
|
const contentCovered = sidePanelState?.coversContent === true;
|
|
250
|
+
const contentOverlapped = sidePanelState?.overlapsContent === true;
|
|
102
251
|
|
|
103
|
-
// Mirrors `mobileMenuOpen`
|
|
104
|
-
// Refreshed after every commit rather than in
|
|
105
|
-
//
|
|
252
|
+
// Mirrors `mobileMenuOpen` (and the host's control of it) so the callbacks
|
|
253
|
+
// below can stay identity-stable. Refreshed after every commit rather than in
|
|
254
|
+
// the render body: the readers are clicks and effects, always past a commit.
|
|
106
255
|
const mobileMenuOpenRef = useRef(mobileMenuOpen);
|
|
256
|
+
const menuControlledRef = useRef(menuControlled);
|
|
257
|
+
const onMobileMenuOpenChangeRef = useRef(onMobileMenuOpenChange);
|
|
107
258
|
useEffect(() => {
|
|
108
259
|
mobileMenuOpenRef.current = mobileMenuOpen;
|
|
260
|
+
menuControlledRef.current = menuControlled;
|
|
261
|
+
onMobileMenuOpenChangeRef.current = onMobileMenuOpenChange;
|
|
109
262
|
});
|
|
110
263
|
|
|
264
|
+
// Every open / close goes through here: the layout's own state when it owns
|
|
265
|
+
// it, and the host hears of each actual change either way.
|
|
266
|
+
const setMobileMenuOpen = useCallback((next: boolean) => {
|
|
267
|
+
if (!menuControlledRef.current) setUncontrolledMenuOpen(next);
|
|
268
|
+
if (next !== mobileMenuOpenRef.current) onMobileMenuOpenChangeRef.current?.(next);
|
|
269
|
+
}, []);
|
|
270
|
+
|
|
111
271
|
const drawerHandlesRef = useRef(new Set<AppLayoutDrawerHandle>());
|
|
112
272
|
|
|
113
273
|
const handleToggleMobileMenu = useCallback(() => {
|
|
@@ -118,11 +278,33 @@ export function AppLayout({
|
|
|
118
278
|
for (const handle of drawerHandlesRef.current) handle.close();
|
|
119
279
|
}
|
|
120
280
|
setMobileMenuOpen(opening);
|
|
121
|
-
}, []);
|
|
281
|
+
}, [setMobileMenuOpen]);
|
|
122
282
|
|
|
123
283
|
const handleCloseMobileMenu = useCallback(() => {
|
|
124
284
|
setMobileMenuOpen(false);
|
|
125
|
-
}, []);
|
|
285
|
+
}, [setMobileMenuOpen]);
|
|
286
|
+
|
|
287
|
+
// A host that opens the menu itself gets what the toggle does: no in-layout
|
|
288
|
+
// drawer left open over it. Before paint, so the two never show together.
|
|
289
|
+
const menuWasOpenRef = useRef(mobileMenuOpen);
|
|
290
|
+
useIsomorphicLayoutEffect(() => {
|
|
291
|
+
const opened = mobileMenuOpen && !menuWasOpenRef.current;
|
|
292
|
+
menuWasOpenRef.current = mobileMenuOpen;
|
|
293
|
+
if (opened && menuControlled) {
|
|
294
|
+
for (const handle of drawerHandlesRef.current) handle.close();
|
|
295
|
+
}
|
|
296
|
+
}, [mobileMenuOpen, menuControlled]);
|
|
297
|
+
|
|
298
|
+
// A navigation closes the menu wherever it started — a nav entry already
|
|
299
|
+
// does, a slot (the chat history, an account item) cannot tell the menu.
|
|
300
|
+
// Only a CHANGE of the location counts, and only with one to watch.
|
|
301
|
+
const currentPath = sidebarConfig.currentPath;
|
|
302
|
+
const menuPathRef = useRef(currentPath);
|
|
303
|
+
useEffect(() => {
|
|
304
|
+
if (menuPathRef.current === currentPath) return;
|
|
305
|
+
menuPathRef.current = currentPath;
|
|
306
|
+
if (mobileMenuOpenRef.current) setMobileMenuOpen(false);
|
|
307
|
+
}, [currentPath, setMobileMenuOpen]);
|
|
126
308
|
|
|
127
309
|
const drawerCoordination = useMemo<AppLayoutDrawerCoordination>(
|
|
128
310
|
() => ({
|
|
@@ -139,7 +321,7 @@ export function AppLayout({
|
|
|
139
321
|
return () => drawerHandlesRef.current.delete(handle);
|
|
140
322
|
},
|
|
141
323
|
}),
|
|
142
|
-
[],
|
|
324
|
+
[setMobileMenuOpen],
|
|
143
325
|
);
|
|
144
326
|
|
|
145
327
|
return (
|
|
@@ -152,7 +334,12 @@ export function AppLayout({
|
|
|
152
334
|
`relative` so the tablet sidebar (position:absolute) anchors to this
|
|
153
335
|
row — below the topBar — instead of the viewport. */}
|
|
154
336
|
<div className="relative flex min-h-0 flex-1">
|
|
155
|
-
<NavigationSidebar
|
|
337
|
+
<NavigationSidebar
|
|
338
|
+
config={sidebarConfig}
|
|
339
|
+
disabled={disabled}
|
|
340
|
+
pushOnTablet={hasSidePanel}
|
|
341
|
+
animateWidth={!adaptive}
|
|
342
|
+
/>
|
|
156
343
|
{/* Mobile Burger Menu - opens below header */}
|
|
157
344
|
<MobileBurgerMenu
|
|
158
345
|
{...mobileBurgerMenuProps}
|
|
@@ -166,11 +353,14 @@ export function AppLayout({
|
|
|
166
353
|
<div className="flex flex-1 flex-col overflow-hidden">
|
|
167
354
|
<AppHeader
|
|
168
355
|
{...resolvedHeaderProps}
|
|
356
|
+
className={
|
|
357
|
+
desktopHeader ? resolvedHeaderProps.className : cn(resolvedHeaderProps.className, 'md:hidden')
|
|
358
|
+
}
|
|
169
359
|
isMobileMenuOpen={mobileMenuOpen}
|
|
170
360
|
onToggleMobileMenu={handleToggleMobileMenu}
|
|
171
361
|
disabled={disabled}
|
|
172
362
|
/>
|
|
173
|
-
<NotificationDrawer />
|
|
363
|
+
<NotificationDrawer showClose={!desktopHeader} />
|
|
174
364
|
|
|
175
365
|
{/* Main + AppLayoutDrawer portal target. `relative` so the drawer
|
|
176
366
|
can absolutely position within just this area (not over
|
|
@@ -182,27 +372,103 @@ export function AppLayout({
|
|
|
182
372
|
ref={setDrawerContainer}
|
|
183
373
|
className={cn('relative flex flex-1 overflow-hidden', sidePanel ? 'flex-row' : 'flex-col')}
|
|
184
374
|
>
|
|
185
|
-
{
|
|
186
|
-
|
|
187
|
-
|
|
375
|
+
{/* The page column. One element tree whatever the slots: a
|
|
376
|
+
slot that comes or goes (the side panel on every cold load
|
|
377
|
+
with Mingo v2, the dock behind the paywall) must not change
|
|
378
|
+
the element types above the page, or React remounts it. */}
|
|
379
|
+
<div
|
|
380
|
+
data-surface={columnIsBox ? pageSurface : undefined}
|
|
381
|
+
className={
|
|
382
|
+
columnIsBox
|
|
383
|
+
? cn(
|
|
384
|
+
'relative flex min-h-0 min-w-0 flex-1 flex-col',
|
|
385
|
+
pageSurface && 'ods-glow-accent-corner bg-ods-bg',
|
|
386
|
+
contentCovered && 'hidden',
|
|
387
|
+
contentOverlapped && 'isolate',
|
|
388
|
+
)
|
|
389
|
+
: 'contents'
|
|
390
|
+
}
|
|
391
|
+
>
|
|
392
|
+
{hasCorner && (
|
|
393
|
+
// z-40: the layer of the sticky header it stands in for —
|
|
394
|
+
// over the page's own layers, under in-layout drawers.
|
|
395
|
+
// Desktop only: the phone top bar holds these controls.
|
|
396
|
+
<div className="absolute right-[var(--spacing-system-mf)] top-[var(--spacing-system-mf)] z-40 hidden items-center gap-[var(--spacing-system-xsf)] md:flex">
|
|
397
|
+
{contentCorner}
|
|
398
|
+
</div>
|
|
399
|
+
)}
|
|
400
|
+
{/* `hidden` while the panel covers the area: the page stays
|
|
401
|
+
mounted, it just takes no room. */}
|
|
188
402
|
<main
|
|
189
403
|
ref={setMainElement}
|
|
190
404
|
className={cn(
|
|
191
|
-
'ods-content-area min-w-0 flex-1 overflow-y-auto',
|
|
405
|
+
adaptive ? 'ods-content-area min-w-0 flex-1 overflow-y-auto' : 'flex-1 overflow-y-auto',
|
|
192
406
|
contentCovered && 'hidden',
|
|
193
407
|
// While the panel is drawn over the page, keep the page's own
|
|
194
408
|
// z-indexed layers (sticky headers, fixed bars) under it.
|
|
195
|
-
|
|
409
|
+
contentOverlapped && 'isolate',
|
|
196
410
|
mainClassName,
|
|
197
411
|
)}
|
|
412
|
+
// A floating dock and a page's action bar lie over the page's end: the
|
|
413
|
+
// page runs on by their height, so its last line clears them. The dock's
|
|
414
|
+
// share is a variable too, for a page that runs on under it, and the
|
|
415
|
+
// page fades out to transparent under the dock (the mask stays with
|
|
416
|
+
// `<main>`'s box while its content scrolls).
|
|
417
|
+
style={
|
|
418
|
+
bottomInset > 0 || dockFloats
|
|
419
|
+
? ({
|
|
420
|
+
paddingBottom: bottomInset,
|
|
421
|
+
[COMPOSER_DOCK_INSET_VAR]: `${dockFloats ? dockHeight : 0}px`,
|
|
422
|
+
...(dockFloats && dockHeight > 0 ? previewFadeMask(`calc(100% - ${dockHeight}px)`) : {}),
|
|
423
|
+
} as CSSProperties)
|
|
424
|
+
: undefined
|
|
425
|
+
}
|
|
198
426
|
>
|
|
199
|
-
<ContentAreaWidthContext.Provider value={
|
|
200
|
-
<
|
|
427
|
+
<ContentAreaWidthContext.Provider value={contentAreaWidth}>
|
|
428
|
+
<ComposerDockHeightContext.Provider value={hasDock ? dockHeight : 0}>
|
|
429
|
+
{/* `display: contents` either way; it carries the content
|
|
430
|
+
tokens only inside an adaptive area. */}
|
|
431
|
+
<div className={adaptive ? 'ods-content-scope' : 'contents'}>{children}</div>
|
|
432
|
+
</ComposerDockHeightContext.Provider>
|
|
201
433
|
</ContentAreaWidthContext.Provider>
|
|
202
434
|
</main>
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
435
|
+
{hasSheet && (
|
|
436
|
+
// Over the page down to the dock's top edge. z-40: the
|
|
437
|
+
// layer of the corner and the page's own sticky bars' top —
|
|
438
|
+
// in-layout drawers (45) and modals still cover it.
|
|
439
|
+
<div
|
|
440
|
+
data-composer-sheet-layer=""
|
|
441
|
+
className="ods-content-area pointer-events-none absolute inset-x-0 top-0 z-40"
|
|
442
|
+
style={{ bottom: dockHeight }}
|
|
443
|
+
>
|
|
444
|
+
<ContentAreaWidthContext.Provider value={contentAreaWidth}>
|
|
445
|
+
{/* The sheet's scrim runs on under the dock, by its height. */}
|
|
446
|
+
<ComposerDockHeightContext.Provider value={dockHeight}>
|
|
447
|
+
<div className="ods-content-scope">{composerSheet}</div>
|
|
448
|
+
</ComposerDockHeightContext.Provider>
|
|
449
|
+
</ContentAreaWidthContext.Provider>
|
|
450
|
+
</div>
|
|
451
|
+
)}
|
|
452
|
+
{hasDock && (
|
|
453
|
+
// Its own container + token scope: a container query cannot
|
|
454
|
+
// reach from <main> to a sibling. Same column width. With a
|
|
455
|
+
// sheet it rises over the sheet's scrim, which runs on under it.
|
|
456
|
+
<div
|
|
457
|
+
ref={setDockElement}
|
|
458
|
+
className={cn(
|
|
459
|
+
'ods-content-area shrink-0',
|
|
460
|
+
hasSheet && 'relative z-40',
|
|
461
|
+
// Over the page's end; the page keeps the pointer where the dock
|
|
462
|
+
// is transparent.
|
|
463
|
+
dockFloats && 'pointer-events-none absolute inset-x-0 bottom-0 z-40',
|
|
464
|
+
)}
|
|
465
|
+
>
|
|
466
|
+
<ContentAreaWidthContext.Provider value={contentAreaWidth}>
|
|
467
|
+
<div className="ods-content-scope">{composerDock}</div>
|
|
468
|
+
</ContentAreaWidthContext.Provider>
|
|
469
|
+
</div>
|
|
470
|
+
)}
|
|
471
|
+
</div>
|
|
206
472
|
{sidePanel && sidePanelState && <AppLayoutSidePanel config={sidePanel} state={sidePanelState} />}
|
|
207
473
|
{/* `drawer` slot — rendered here so it sits inside the
|
|
208
474
|
AppLayoutDrawerContainerContext and can portal into this exact
|