@flamingo-stack/openframe-frontend-core 0.0.711 → 0.0.713
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/chunk-2NASBO7O.js +1137 -0
- package/dist/{chunk-RQRX4YC3.cjs → chunk-2RKFMUNW.cjs} +46 -46
- package/dist/chunk-2Y7QZAB2.cjs +158 -0
- package/dist/chunk-34I6XI3N.js +136 -0
- package/dist/{chunk-VWFZRMQR.js → chunk-3BB3IEJI.js} +13 -7
- package/dist/chunk-3K5ZLZE7.js +292 -0
- package/dist/chunk-3LU4UFPS.cjs +14 -0
- package/dist/{chunk-G47AP6LX.cjs → chunk-3QGUDPIH.cjs} +35 -33
- package/dist/{chunk-3UNL26CD.cjs → chunk-3RKBJT6K.cjs} +8 -6
- package/dist/chunk-4HJRHEXD.cjs +1612 -0
- package/dist/{chunk-JPG7OHEG.js → chunk-4QFWGLZO.js} +1 -1
- package/dist/chunk-4R2L3DSA.js +14 -0
- package/dist/{chunk-VMMHJFHG.js → chunk-6F4QOCGB.js} +10 -8
- package/dist/{chunk-Q6B35Y7O.js → chunk-6MNAIQNR.js} +22 -113
- package/dist/{chunk-KUC673HM.js → chunk-6T3BTD6Q.js} +204 -982
- package/dist/{chunk-F57ECE2I.js → chunk-6YPTUHM7.js} +4 -4
- package/dist/chunk-AAYNCJMW.cjs +48 -0
- package/dist/{chunk-FXJ3WWUB.js → chunk-ADBE7QF3.js} +5 -252
- package/dist/chunk-AECTRMGQ.cjs +334 -0
- package/dist/chunk-AGVXKD4K.js +334 -0
- package/dist/chunk-AL2GUHAJ.cjs +18 -0
- package/dist/{chunk-WMX26HB5.js → chunk-APJZBDQN.js} +12 -12
- package/dist/chunk-AUMKE74M.cjs +16 -0
- package/dist/chunk-B4NCVYEQ.cjs +292 -0
- package/dist/{chunk-WJUIXU6Y.js → chunk-CGHOH3GN.js} +28 -22
- package/dist/chunk-CMGFZHCN.js +233 -0
- package/dist/chunk-CMZ3QTFQ.js +1207 -0
- package/dist/chunk-CPA2CKRZ.cjs +125 -0
- package/dist/chunk-CYUUHFXL.js +41 -0
- package/dist/chunk-DC4RTYWK.cjs +1122 -0
- package/dist/{chunk-NF7GNGYG.js → chunk-DDWFCWOE.js} +5 -7
- package/dist/{chunk-QA6TROME.cjs → chunk-EOKSKJSS.cjs} +25 -83
- package/dist/{chunk-6NTPY5QA.cjs → chunk-ETYLOZOB.cjs} +978 -2413
- package/dist/{chunk-6AMIRXKM.cjs → chunk-F2EACDOR.cjs} +93 -87
- package/dist/chunk-F5BPGWGT.cjs +931 -0
- package/dist/chunk-FFT56TYB.cjs +401 -0
- package/dist/chunk-FYEJTF5Y.js +125 -0
- package/dist/chunk-G3GRYDMS.js +16 -0
- package/dist/chunk-G6OHIX5C.cjs +100 -0
- package/dist/{chunk-UDFRUKLC.cjs → chunk-GEDY7HQI.cjs} +2 -2
- package/dist/chunk-GQ7JJUIT.cjs +1207 -0
- package/dist/chunk-H3PKYE4N.js +18 -0
- package/dist/{chunk-EQWD4IJE.js → chunk-H4J72PRA.js} +74 -46
- package/dist/{chunk-AGDVEUVL.js → chunk-H5R7U2D2.js} +206 -5
- package/dist/{chunk-7AM6C6XH.cjs → chunk-HETQETPV.cjs} +9641 -9678
- package/dist/{chunk-Y2GSOUCS.cjs → chunk-HWVUR735.cjs} +2 -2
- package/dist/chunk-II4QMH26.cjs +35 -0
- package/dist/{chunk-XWEBHS7O.cjs → chunk-IJKMILMG.cjs} +82 -54
- package/dist/chunk-ILNN6QRW.js +1612 -0
- package/dist/{chunk-6GLQLTJI.js → chunk-IU4IO3CG.js} +35 -27
- package/dist/chunk-IYVFSLWJ.js +931 -0
- package/dist/{chunk-EX6GGCAC.cjs → chunk-J7YIQJPS.cjs} +15 -15
- package/dist/chunk-JHQ334WS.js +655 -0
- package/dist/{chunk-WCVZCGK5.cjs → chunk-JO5TLJPM.cjs} +129 -907
- package/dist/{chunk-PRX7HVLE.cjs → chunk-JVCAK4W3.cjs} +210 -9
- package/dist/chunk-KBJJQFYU.js +1122 -0
- package/dist/chunk-KEKCQENI.js +48 -0
- package/dist/{chunk-P6G3JZNC.cjs → chunk-KGAFUXGZ.cjs} +57 -148
- package/dist/chunk-KHXZFLIN.cjs +41 -0
- package/dist/{chunk-C4HRRB3V.cjs → chunk-KMB7JHGG.cjs} +23 -17
- package/dist/{chunk-K4PTDK34.js → chunk-KPUHSVJU.js} +322 -428
- package/dist/chunk-KT3U3ZRP.cjs +1137 -0
- package/dist/chunk-L2VUINHN.js +35 -0
- package/dist/{chunk-PLYEKV3N.cjs → chunk-MA4Q5RBP.cjs} +6 -6
- package/dist/chunk-NPAQSMRY.js +2087 -0
- package/dist/{chunk-IFWLJ66M.js → chunk-NQWJAOHO.js} +6 -4
- package/dist/{chunk-FYOKS5RI.cjs → chunk-OQKRXLTZ.cjs} +4719 -6351
- package/dist/chunk-P3JMAMHP.js +401 -0
- package/dist/{chunk-62KNLDXK.js → chunk-P6QCJXLD.js} +3 -3
- package/dist/chunk-PPXR22YC.cjs +2087 -0
- package/dist/chunk-PSVSEN4J.cjs +655 -0
- package/dist/{chunk-CDM7OSFB.cjs → chunk-QQQ46DFT.cjs} +125 -117
- package/dist/{chunk-FEMAJES4.cjs → chunk-QU4AHNRL.cjs} +41 -39
- package/dist/{chunk-2JTGK64G.js → chunk-RBVUIOIM.js} +12 -10
- package/dist/{chunk-SMAAV3HL.js → chunk-ROBQ5TR7.js} +10541 -10578
- package/dist/{chunk-TKZXHVBG.js → chunk-RRYNHAEL.js} +5 -5
- package/dist/{chunk-5HB7FLCV.js → chunk-STPC2AQU.js} +8338 -9970
- package/dist/{chunk-6K7QZDA6.cjs → chunk-TC4W7QDC.cjs} +8 -8
- package/dist/{chunk-FI6GMDO7.js → chunk-TTVOLEUS.js} +3605 -5040
- package/dist/{chunk-LM7TXMLU.cjs → chunk-ULWVKHSI.cjs} +8 -255
- package/dist/chunk-WANCBTUE.js +71 -0
- package/dist/{chunk-BIZNSF3U.cjs → chunk-WBNAEYTQ.cjs} +2 -51
- package/dist/chunk-WFPCCBOM.cjs +71 -0
- package/dist/chunk-WI6FHKD7.js +158 -0
- package/dist/chunk-WMNCVLES.js +100 -0
- package/dist/{chunk-UT4YHQZW.js → chunk-WSDT7LYL.js} +0 -49
- package/dist/chunk-WVOTC7HW.cjs +136 -0
- package/dist/chunk-XXBLN4BP.cjs +233 -0
- package/dist/{chunk-4IBPRIQH.js → chunk-YBQQNDC7.js} +1 -1
- package/dist/{chunk-QGZPZ3RL.js → chunk-YBS5QGON.js} +70 -128
- package/dist/{chunk-K6Y5NX6L.cjs → chunk-YIUSW4DB.cjs} +114 -220
- package/dist/{chunk-YD4LJZV4.cjs → chunk-ZX7SCPLO.cjs} +6 -8
- package/dist/cloud-tenants-HRJYNUJM.cjs +117 -0
- package/dist/cloud-tenants-SM7WLEGG.js +117 -0
- package/dist/components/case-studies/index.cjs +45 -29
- package/dist/components/case-studies/index.js +32 -16
- package/dist/components/chat/ask-prompts.d.ts +64 -0
- package/dist/components/chat/ask-prompts.d.ts.map +1 -0
- package/dist/components/chat/entity-cards/case-study-card.d.ts +6 -3
- package/dist/components/chat/entity-cards/case-study-card.d.ts.map +1 -1
- package/dist/components/chat/index.cjs +27 -8
- package/dist/components/chat/index.d.ts +1 -0
- package/dist/components/chat/index.d.ts.map +1 -1
- package/dist/components/chat/index.js +57 -38
- package/dist/components/chat/quick-action-chip.d.ts +7 -3
- package/dist/components/chat/quick-action-chip.d.ts.map +1 -1
- package/dist/components/contact/index.cjs +29 -13
- package/dist/components/contact/index.js +28 -12
- package/dist/components/docs/index.cjs +33 -16
- package/dist/components/docs/index.js +33 -16
- package/dist/components/docs/use-scroll-spy.d.ts +23 -1
- package/dist/components/docs/use-scroll-spy.d.ts.map +1 -1
- package/dist/components/embeds/index.cjs +29 -13
- package/dist/components/embeds/index.js +28 -12
- package/dist/components/faq/faq-section.d.ts +8 -1
- package/dist/components/faq/faq-section.d.ts.map +1 -1
- package/dist/components/faq/index.cjs +30 -14
- package/dist/components/faq/index.js +29 -13
- package/dist/components/features/approval-level.d.ts +49 -0
- package/dist/components/features/approval-level.d.ts.map +1 -0
- package/dist/components/features/array-entry-manager.d.ts +5 -1
- package/dist/components/features/array-entry-manager.d.ts.map +1 -1
- package/dist/components/features/board/board.d.ts +2 -0
- package/dist/components/features/board/board.d.ts.map +1 -1
- package/dist/components/features/board/ticket-card.d.ts.map +1 -1
- 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/types.d.ts +3 -0
- package/dist/components/features/board/types.d.ts.map +1 -1
- package/dist/components/features/board/use-board-collapse.d.ts +6 -1
- package/dist/components/features/board/use-board-collapse.d.ts.map +1 -1
- package/dist/components/features/capability-explorer.d.ts +94 -0
- package/dist/components/features/capability-explorer.d.ts.map +1 -0
- package/dist/components/features/cloud-tenants/index.d.ts +14 -0
- package/dist/components/features/cloud-tenants/index.d.ts.map +1 -0
- package/dist/components/features/cloud-tenants/tenant-access-cell.d.ts +9 -0
- package/dist/components/features/cloud-tenants/tenant-access-cell.d.ts.map +1 -0
- package/dist/components/features/cloud-tenants/tenant-cell.d.ts +8 -0
- package/dist/components/features/cloud-tenants/tenant-cell.d.ts.map +1 -0
- package/dist/components/features/cloud-tenants/tenant-customer-cell.d.ts +9 -0
- package/dist/components/features/cloud-tenants/tenant-customer-cell.d.ts.map +1 -0
- package/dist/components/features/cloud-tenants/tenant-presentation.d.ts +42 -0
- package/dist/components/features/cloud-tenants/tenant-presentation.d.ts.map +1 -0
- package/dist/components/features/cloud-tenants/tenant-row.d.ts +22 -0
- package/dist/components/features/cloud-tenants/tenant-row.d.ts.map +1 -0
- package/dist/components/features/cloud-tenants/tenants-table-columns.d.ts +42 -0
- package/dist/components/features/cloud-tenants/tenants-table-columns.d.ts.map +1 -0
- package/dist/components/features/cloud-tenants/tenants-table-view.d.ts +26 -0
- package/dist/components/features/cloud-tenants/tenants-table-view.d.ts.map +1 -0
- package/dist/components/features/devices/device-last-online.d.ts +3 -0
- package/dist/components/features/devices/device-last-online.d.ts.map +1 -0
- package/dist/components/features/devices/device-name.d.ts +42 -0
- package/dist/components/features/devices/device-name.d.ts.map +1 -0
- package/dist/components/features/devices/device-selector/device-selection-mode-radio.d.ts +26 -0
- package/dist/components/features/devices/device-selector/device-selection-mode-radio.d.ts.map +1 -0
- package/dist/components/features/devices/device-selector/device-selector-skeleton.d.ts +25 -0
- package/dist/components/features/devices/device-selector/device-selector-skeleton.d.ts.map +1 -0
- package/dist/components/features/devices/device-selector/device-selector.d.ts +38 -0
- package/dist/components/features/devices/device-selector/device-selector.d.ts.map +1 -0
- package/dist/components/features/devices/device-selector/device-selector.types.d.ts +133 -0
- package/dist/components/features/devices/device-selector/device-selector.types.d.ts.map +1 -0
- package/dist/components/features/devices/device-selector/narrowing.d.ts +13 -0
- package/dist/components/features/devices/device-selector/narrowing.d.ts.map +1 -0
- package/dist/components/features/devices/device-selector/use-device-selector.d.ts +17 -0
- package/dist/components/features/devices/device-selector/use-device-selector.d.ts.map +1 -0
- package/dist/components/features/devices/device-status.d.ts +23 -0
- package/dist/components/features/devices/device-status.d.ts.map +1 -0
- package/dist/components/features/devices/device-statuses.d.ts +40 -0
- package/dist/components/features/devices/device-statuses.d.ts.map +1 -0
- package/dist/components/features/devices/device-tags-filter-button.d.ts +22 -0
- package/dist/components/features/devices/device-tags-filter-button.d.ts.map +1 -0
- package/dist/components/features/devices/device-type-icon.d.ts +11 -0
- package/dist/components/features/devices/device-type-icon.d.ts.map +1 -0
- package/dist/components/features/devices/device-type-tile.d.ts +9 -0
- package/dist/components/features/devices/device-type-tile.d.ts.map +1 -0
- package/dist/components/features/devices/devices-filter-toolbar.d.ts +46 -0
- package/dist/components/features/devices/devices-filter-toolbar.d.ts.map +1 -0
- package/dist/components/features/devices/devices-grid-filters.d.ts +25 -0
- package/dist/components/features/devices/devices-grid-filters.d.ts.map +1 -0
- package/dist/components/features/devices/devices-grid.d.ts +12 -0
- package/dist/components/features/devices/devices-grid.d.ts.map +1 -0
- package/dist/components/features/devices/devices-list.d.ts +131 -0
- package/dist/components/features/devices/devices-list.d.ts.map +1 -0
- package/dist/components/features/devices/devices-panel-header.d.ts +46 -0
- package/dist/components/features/devices/devices-panel-header.d.ts.map +1 -0
- package/dist/components/features/devices/devices-panel-view.d.ts +79 -0
- package/dist/components/features/devices/devices-panel-view.d.ts.map +1 -0
- package/dist/components/features/devices/devices-table-columns.d.ts +76 -0
- package/dist/components/features/devices/devices-table-columns.d.ts.map +1 -0
- package/dist/components/features/devices/devices-view-config.d.ts +25 -0
- package/dist/components/features/devices/devices-view-config.d.ts.map +1 -0
- package/dist/components/features/devices/index.d.ts +24 -0
- package/dist/components/features/devices/index.d.ts.map +1 -0
- package/dist/components/features/devices/types.d.ts +68 -0
- package/dist/components/features/devices/types.d.ts.map +1 -0
- package/dist/components/features/devices/use-tag-filter-modal.d.ts +50 -0
- package/dist/components/features/devices/use-tag-filter-modal.d.ts.map +1 -0
- package/dist/components/features/index.cjs +235 -12
- package/dist/components/features/index.d.ts +8 -0
- package/dist/components/features/index.d.ts.map +1 -1
- package/dist/components/features/index.js +274 -51
- package/dist/components/features/knowledge-base/index.d.ts +7 -0
- package/dist/components/features/knowledge-base/index.d.ts.map +1 -0
- package/dist/components/features/knowledge-base/knowledge-base-article-view.d.ts +44 -0
- package/dist/components/features/knowledge-base/knowledge-base-article-view.d.ts.map +1 -0
- package/dist/components/features/knowledge-base/knowledge-base-item-icon.d.ts +13 -0
- package/dist/components/features/knowledge-base/knowledge-base-item-icon.d.ts.map +1 -0
- package/dist/components/features/knowledge-base/knowledge-base-status.d.ts +8 -0
- package/dist/components/features/knowledge-base/knowledge-base-status.d.ts.map +1 -0
- package/dist/components/features/knowledge-base/knowledge-base-table.d.ts +52 -0
- package/dist/components/features/knowledge-base/knowledge-base-table.d.ts.map +1 -0
- package/dist/components/features/logs/index.d.ts +12 -0
- package/dist/components/features/logs/index.d.ts.map +1 -0
- package/dist/components/features/logs/log-drawer.d.ts +29 -0
- package/dist/components/features/logs/log-drawer.d.ts.map +1 -0
- package/dist/components/features/logs/log-source-labels.d.ts +11 -0
- package/dist/components/features/logs/log-source-labels.d.ts.map +1 -0
- package/dist/components/features/logs/logs-page-view.d.ts +32 -0
- package/dist/components/features/logs/logs-page-view.d.ts.map +1 -0
- package/dist/components/features/logs/logs-table-columns.d.ts +15 -0
- package/dist/components/features/logs/logs-table-columns.d.ts.map +1 -0
- package/dist/components/features/logs/logs-table-view.d.ts +64 -0
- package/dist/components/features/logs/logs-table-view.d.ts.map +1 -0
- package/dist/components/features/logs/types.d.ts +52 -0
- package/dist/components/features/logs/types.d.ts.map +1 -0
- package/dist/components/features/policies/compute-policy-summary.d.ts +37 -0
- package/dist/components/features/policies/compute-policy-summary.d.ts.map +1 -0
- package/dist/components/features/policies/index.d.ts +8 -0
- package/dist/components/features/policies/index.d.ts.map +1 -0
- package/dist/components/features/policies/policies-table.d.ts +34 -0
- package/dist/components/features/policies/policies-table.d.ts.map +1 -0
- package/dist/components/features/policies/policy-summary-cards.d.ts +17 -0
- package/dist/components/features/policies/policy-summary-cards.d.ts.map +1 -0
- package/dist/components/features/policies/policy-table-row.d.ts +37 -0
- package/dist/components/features/policies/policy-table-row.d.ts.map +1 -0
- package/dist/components/features/policy-configuration-panel.d.ts.map +1 -1
- package/dist/components/features/remote-session/index.d.ts +8 -0
- package/dist/components/features/remote-session/index.d.ts.map +1 -1
- package/dist/components/features/remote-session/remote-desktop-chat-message-row.d.ts +21 -0
- package/dist/components/features/remote-session/remote-desktop-chat-message-row.d.ts.map +1 -0
- package/dist/components/features/remote-session/remote-desktop-chat-panel.d.ts +31 -0
- package/dist/components/features/remote-session/remote-desktop-chat-panel.d.ts.map +1 -0
- package/dist/components/features/remote-session/remote-desktop-fullscreen-toolbar.d.ts +21 -0
- package/dist/components/features/remote-session/remote-desktop-fullscreen-toolbar.d.ts.map +1 -0
- package/dist/components/features/remote-session/remote-desktop-view.d.ts +50 -0
- package/dist/components/features/remote-session/remote-desktop-view.d.ts.map +1 -0
- package/dist/components/features/software/index.d.ts +8 -0
- package/dist/components/features/software/index.d.ts.map +1 -0
- package/dist/components/features/software/package-managers.d.ts +30 -0
- package/dist/components/features/software/package-managers.d.ts.map +1 -0
- package/dist/components/features/software/package-search-field-placeholder.d.ts +7 -0
- package/dist/components/features/software/package-search-field-placeholder.d.ts.map +1 -0
- package/dist/components/features/software/schedule-fields.d.ts +34 -0
- package/dist/components/features/software/schedule-fields.d.ts.map +1 -0
- package/dist/components/features/software/software-action-copy.d.ts +25 -0
- package/dist/components/features/software/software-action-copy.d.ts.map +1 -0
- package/dist/components/features/software/software-action-form.d.ts +71 -0
- package/dist/components/features/software/software-action-form.d.ts.map +1 -0
- package/dist/components/features/software/software-row-fields.d.ts +23 -0
- package/dist/components/features/software/software-row-fields.d.ts.map +1 -0
- package/dist/components/features/software/software-row.d.ts +18 -0
- package/dist/components/features/software/software-row.d.ts.map +1 -0
- package/dist/components/features/sortable-list/index.d.ts +1 -0
- package/dist/components/features/sortable-list/index.d.ts.map +1 -1
- package/dist/components/features/sortable-list/sortable-drag-handle.d.ts +21 -0
- package/dist/components/features/sortable-list/sortable-drag-handle.d.ts.map +1 -0
- package/dist/components/help-center-pages/index.cjs +133 -114
- package/dist/components/help-center-pages/index.js +58 -39
- package/dist/components/index.cjs +328 -82
- package/dist/components/index.js +459 -213
- package/dist/components/layout/page-heading.d.ts +12 -3
- package/dist/components/layout/page-heading.d.ts.map +1 -1
- package/dist/components/meeting-scheduler/index.cjs +120 -98
- package/dist/components/meeting-scheduler/index.js +50 -28
- package/dist/components/navigation/index.cjs +36 -17
- package/dist/components/navigation/index.d.ts +3 -0
- package/dist/components/navigation/index.d.ts.map +1 -1
- package/dist/components/navigation/index.js +36 -17
- package/dist/components/navigation/mingo-ai-button.d.ts +23 -10
- package/dist/components/navigation/mingo-ai-button.d.ts.map +1 -1
- package/dist/components/navigation/sticky-section-nav.d.ts +14 -1
- package/dist/components/navigation/sticky-section-nav.d.ts.map +1 -1
- package/dist/components/onboarding-guides/index.cjs +32 -16
- package/dist/components/onboarding-guides/index.js +31 -15
- package/dist/components/product-demo/cast.d.ts +58 -0
- package/dist/components/product-demo/cast.d.ts.map +1 -0
- package/dist/components/product-demo/fixtures/cloud-tenants.d.ts +10 -0
- package/dist/components/product-demo/fixtures/cloud-tenants.d.ts.map +1 -0
- package/dist/components/product-demo/fixtures/devices.d.ts +14 -0
- package/dist/components/product-demo/fixtures/devices.d.ts.map +1 -0
- package/dist/components/product-demo/fixtures/knowledge.d.ts +14 -0
- package/dist/components/product-demo/fixtures/knowledge.d.ts.map +1 -0
- package/dist/components/product-demo/fixtures/logs.d.ts +15 -0
- package/dist/components/product-demo/fixtures/logs.d.ts.map +1 -0
- package/dist/components/product-demo/fixtures/policies.d.ts +13 -0
- package/dist/components/product-demo/fixtures/policies.d.ts.map +1 -0
- package/dist/components/product-demo/fixtures/remote-session.d.ts +20 -0
- package/dist/components/product-demo/fixtures/remote-session.d.ts.map +1 -0
- package/dist/components/product-demo/fixtures/shared.d.ts +156 -0
- package/dist/components/product-demo/fixtures/shared.d.ts.map +1 -0
- package/dist/components/product-demo/fixtures/software-update.d.ts +19 -0
- package/dist/components/product-demo/fixtures/software-update.d.ts.map +1 -0
- package/dist/components/product-demo/fixtures/tickets-board.d.ts +8 -0
- package/dist/components/product-demo/fixtures/tickets-board.d.ts.map +1 -0
- package/dist/components/product-demo/index.cjs +112 -0
- package/dist/components/product-demo/index.d.ts +6 -0
- package/dist/components/product-demo/index.d.ts.map +1 -0
- package/dist/components/product-demo/index.js +112 -0
- package/dist/components/product-demo/product-screen.d.ts +22 -0
- package/dist/components/product-demo/product-screen.d.ts.map +1 -0
- package/dist/components/product-demo/registry.d.ts +13 -0
- package/dist/components/product-demo/registry.d.ts.map +1 -0
- package/dist/components/product-demo/screen-keys.cjs +25 -0
- package/dist/components/product-demo/screen-keys.d.ts +27 -0
- package/dist/components/product-demo/screen-keys.d.ts.map +1 -0
- package/dist/components/product-demo/screen-keys.js +20 -0
- package/dist/components/product-demo/screens/cloud-tenants.d.ts +8 -0
- package/dist/components/product-demo/screens/cloud-tenants.d.ts.map +1 -0
- package/dist/components/product-demo/screens/devices.d.ts +10 -0
- package/dist/components/product-demo/screens/devices.d.ts.map +1 -0
- package/dist/components/product-demo/screens/knowledge.d.ts +9 -0
- package/dist/components/product-demo/screens/knowledge.d.ts.map +1 -0
- package/dist/components/product-demo/screens/logs.d.ts +4 -0
- package/dist/components/product-demo/screens/logs.d.ts.map +1 -0
- package/dist/components/product-demo/screens/policies.d.ts +8 -0
- package/dist/components/product-demo/screens/policies.d.ts.map +1 -0
- package/dist/components/product-demo/screens/remote-desktop-picture.d.ts +11 -0
- package/dist/components/product-demo/screens/remote-desktop-picture.d.ts.map +1 -0
- package/dist/components/product-demo/screens/remote-session.d.ts +8 -0
- package/dist/components/product-demo/screens/remote-session.d.ts.map +1 -0
- package/dist/components/product-demo/screens/software-update.d.ts +12 -0
- package/dist/components/product-demo/screens/software-update.d.ts.map +1 -0
- package/dist/components/product-demo/screens/tickets-board.d.ts +4 -0
- package/dist/components/product-demo/screens/tickets-board.d.ts.map +1 -0
- package/dist/components/product-demo/types.d.ts +9 -0
- package/dist/components/product-demo/types.d.ts.map +1 -0
- package/dist/components/related-content/index.cjs +14 -8
- package/dist/components/related-content/index.js +13 -7
- package/dist/components/tickets/index.cjs +36 -20
- package/dist/components/tickets/index.js +35 -19
- package/dist/components/ui/file-manager/index.cjs +38 -34
- package/dist/components/ui/file-manager/index.js +8 -4
- package/dist/components/ui/index.cjs +57 -17
- 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 +141 -101
- package/dist/components/ui/product-screen-frame.d.ts +45 -0
- package/dist/components/ui/product-screen-frame.d.ts.map +1 -0
- package/dist/components/ui/radio-group.d.ts +5 -0
- package/dist/components/ui/radio-group.d.ts.map +1 -1
- package/dist/components/ui/snap-carousel.d.ts +11 -1
- package/dist/components/ui/snap-carousel.d.ts.map +1 -1
- package/dist/components/ui/tag.d.ts +1 -1
- package/dist/components/ui/tag.d.ts.map +1 -1
- package/dist/devices-6XKQTQM5.cjs +81 -0
- package/dist/devices-LXSFGGEZ.js +81 -0
- package/dist/hooks/index.cjs +17 -8
- package/dist/hooks/index.js +32 -23
- package/dist/hooks/ui/index.d.ts +1 -0
- package/dist/hooks/ui/index.d.ts.map +1 -1
- package/dist/hooks/ui/use-header-height.d.ts +12 -0
- package/dist/hooks/ui/use-header-height.d.ts.map +1 -1
- package/dist/hooks/ui/use-sticky-toolbar.d.ts +29 -0
- package/dist/hooks/ui/use-sticky-toolbar.d.ts.map +1 -0
- package/dist/hooks/use-location-hash.d.ts +2 -2
- package/dist/hooks/use-location-hash.d.ts.map +1 -1
- package/dist/hooks/use-scroll-to-hash.d.ts +7 -0
- package/dist/hooks/use-scroll-to-hash.d.ts.map +1 -1
- package/dist/index.cjs +284 -25
- package/dist/index.js +737 -478
- package/dist/knowledge-7PDZLXPO.cjs +108 -0
- package/dist/knowledge-Q4SPFOTN.js +108 -0
- package/dist/logs-SZ4VB4FE.js +216 -0
- package/dist/logs-TO3NELGJ.cjs +216 -0
- package/dist/policies-533GQVFM.cjs +121 -0
- package/dist/policies-LB7VW2UB.js +121 -0
- package/dist/remote-session-GSGZOFDX.js +196 -0
- package/dist/remote-session-R6VAFESR.cjs +196 -0
- package/dist/software-update-DT2XSG7M.cjs +179 -0
- package/dist/software-update-ENZNVGKP.js +179 -0
- package/dist/tickets-board-BHLPAVNJ.cjs +137 -0
- package/dist/tickets-board-PYDNELSK.js +137 -0
- package/dist/types/case-study.d.ts +15 -1
- package/dist/types/case-study.d.ts.map +1 -1
- package/dist/utils/date-utils.d.ts +5 -0
- package/dist/utils/date-utils.d.ts.map +1 -1
- package/dist/utils/index.cjs +45 -2
- package/dist/utils/index.d.ts +2 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +41 -3
- package/dist/utils/open-in-new-tab.d.ts +7 -0
- package/dist/utils/open-in-new-tab.d.ts.map +1 -0
- package/dist/utils/same-page-hash-nav.d.ts +31 -0
- package/dist/utils/same-page-hash-nav.d.ts.map +1 -1
- package/dist/utils/scroll-into-view.d.ts +14 -1
- package/dist/utils/scroll-into-view.d.ts.map +1 -1
- package/package.json +13 -1
- package/src/components/chat/ask-prompts.tsx +226 -0
- package/src/components/chat/embeddable-chat.tsx +36 -2
- package/src/components/chat/entity-cards/case-study-card.tsx +122 -46
- package/src/components/chat/index.ts +1 -0
- package/src/components/chat/quick-action-chip.tsx +33 -9
- package/src/components/docs/use-scroll-spy.ts +93 -18
- package/src/components/faq/faq-section.tsx +82 -43
- package/src/components/features/approval-level.tsx +149 -0
- package/src/components/features/array-entry-manager.tsx +10 -1
- package/src/components/features/board/board.tsx +4 -1
- package/src/components/features/board/ticket-card.tsx +11 -1
- package/src/components/features/board/touch-board.tsx +2 -1
- package/src/components/features/board/types.ts +3 -0
- package/src/components/features/board/use-board-collapse.ts +7 -2
- package/src/components/features/capability-explorer.tsx +412 -0
- package/src/components/features/cloud-tenants/index.ts +28 -0
- package/src/components/features/cloud-tenants/tenant-access-cell.tsx +24 -0
- package/src/components/features/cloud-tenants/tenant-cell.tsx +26 -0
- package/src/components/features/cloud-tenants/tenant-customer-cell.tsx +27 -0
- package/src/components/features/cloud-tenants/tenant-presentation.ts +111 -0
- package/src/components/features/cloud-tenants/tenant-row.ts +21 -0
- package/src/components/features/cloud-tenants/tenants-table-columns.ts +30 -0
- package/src/components/features/cloud-tenants/tenants-table-view.tsx +142 -0
- package/src/components/features/devices/device-last-online.ts +6 -0
- package/src/components/features/devices/device-name.ts +51 -0
- package/src/components/features/devices/device-selector/device-selection-mode-radio.tsx +107 -0
- package/src/components/features/devices/device-selector/device-selector-skeleton.tsx +32 -0
- package/src/components/features/devices/device-selector/device-selector.tsx +799 -0
- package/src/components/features/devices/device-selector/device-selector.types.ts +138 -0
- package/src/components/features/devices/device-selector/narrowing.ts +33 -0
- package/src/components/features/devices/device-selector/use-device-selector.ts +51 -0
- package/src/components/features/devices/device-status.ts +102 -0
- package/src/components/features/devices/device-statuses.ts +88 -0
- package/src/components/features/devices/device-tags-filter-button.tsx +49 -0
- package/src/components/features/devices/device-type-icon.tsx +29 -0
- package/src/components/features/devices/device-type-tile.tsx +17 -0
- package/src/components/features/devices/devices-filter-toolbar.tsx +114 -0
- package/src/components/features/devices/devices-grid-filters.tsx +99 -0
- package/src/components/features/devices/devices-grid.tsx +86 -0
- package/src/components/features/devices/devices-list.tsx +357 -0
- package/src/components/features/devices/devices-panel-header.tsx +97 -0
- package/src/components/features/devices/devices-panel-view.tsx +261 -0
- package/src/components/features/devices/devices-table-columns.tsx +356 -0
- package/src/components/features/devices/devices-view-config.tsx +38 -0
- package/src/components/features/devices/index.ts +89 -0
- package/src/components/features/devices/types.ts +74 -0
- package/src/components/features/devices/use-tag-filter-modal.ts +109 -0
- package/src/components/features/index.ts +10 -0
- package/src/components/features/knowledge-base/index.ts +19 -0
- package/src/components/features/knowledge-base/knowledge-base-article-view.tsx +134 -0
- package/src/components/features/knowledge-base/knowledge-base-item-icon.ts +14 -0
- package/src/components/features/knowledge-base/knowledge-base-status.ts +12 -0
- package/src/components/features/knowledge-base/knowledge-base-table.tsx +180 -0
- package/src/components/features/logs/index.ts +20 -0
- package/src/components/features/logs/log-drawer.tsx +138 -0
- package/src/components/features/logs/log-source-labels.ts +25 -0
- package/src/components/features/logs/logs-page-view.tsx +100 -0
- package/src/components/features/logs/logs-table-columns.ts +16 -0
- package/src/components/features/logs/logs-table-view.tsx +509 -0
- package/src/components/features/logs/types.ts +71 -0
- package/src/components/features/policies/compute-policy-summary.ts +115 -0
- package/src/components/features/policies/index.ts +14 -0
- package/src/components/features/policies/policies-table.tsx +235 -0
- package/src/components/features/policies/policy-summary-cards.tsx +69 -0
- package/src/components/features/policies/policy-table-row.ts +37 -0
- package/src/components/features/policy-configuration-panel.tsx +3 -12
- package/src/components/features/remote-session/index.ts +8 -0
- package/src/components/features/remote-session/remote-desktop-chat-message-row.tsx +56 -0
- package/src/components/features/remote-session/remote-desktop-chat-panel.tsx +102 -0
- package/src/components/features/remote-session/remote-desktop-fullscreen-toolbar.tsx +119 -0
- package/src/components/features/remote-session/remote-desktop-view.tsx +209 -0
- package/src/components/features/software/index.ts +39 -0
- package/src/components/features/software/package-managers.ts +54 -0
- package/src/components/features/software/package-search-field-placeholder.tsx +23 -0
- package/src/components/features/software/schedule-fields.tsx +105 -0
- package/src/components/features/software/software-action-copy.ts +70 -0
- package/src/components/features/software/software-action-form.tsx +199 -0
- package/src/components/features/software/software-row-fields.tsx +105 -0
- package/src/components/features/software/software-row.ts +22 -0
- package/src/components/features/sortable-list/index.ts +1 -0
- package/src/components/features/sortable-list/sortable-drag-handle.tsx +41 -0
- package/src/components/layout/page-heading.tsx +23 -6
- package/src/components/navigation/index.ts +5 -0
- package/src/components/navigation/mingo-ai-button.tsx +37 -13
- package/src/components/navigation/sticky-section-nav.tsx +99 -1
- package/src/components/product-demo/cast.tsx +78 -0
- package/src/components/product-demo/fixtures/cloud-tenants.ts +63 -0
- package/src/components/product-demo/fixtures/devices.ts +87 -0
- package/src/components/product-demo/fixtures/knowledge.ts +48 -0
- package/src/components/product-demo/fixtures/logs.ts +103 -0
- package/src/components/product-demo/fixtures/policies.ts +77 -0
- package/src/components/product-demo/fixtures/remote-session.ts +65 -0
- package/src/components/product-demo/fixtures/shared.ts +53 -0
- package/src/components/product-demo/fixtures/software-update.ts +63 -0
- package/src/components/product-demo/fixtures/tickets-board.ts +100 -0
- package/src/components/product-demo/index.ts +7 -0
- package/src/components/product-demo/product-screen.tsx +94 -0
- package/src/components/product-demo/registry.ts +20 -0
- package/src/components/product-demo/screen-keys.ts +31 -0
- package/src/components/product-demo/screens/cloud-tenants.tsx +23 -0
- package/src/components/product-demo/screens/devices.tsx +41 -0
- package/src/components/product-demo/screens/knowledge.tsx +27 -0
- package/src/components/product-demo/screens/logs.tsx +113 -0
- package/src/components/product-demo/screens/policies.tsx +29 -0
- package/src/components/product-demo/screens/remote-desktop-picture.tsx +118 -0
- package/src/components/product-demo/screens/remote-session.tsx +46 -0
- package/src/components/product-demo/screens/software-update.tsx +97 -0
- package/src/components/product-demo/screens/tickets-board.tsx +28 -0
- package/src/components/product-demo/types.ts +10 -0
- package/src/components/ui/index.ts +1 -0
- package/src/components/ui/product-screen-frame.tsx +136 -0
- package/src/components/ui/radio-group.tsx +16 -4
- package/src/components/ui/snap-carousel.tsx +26 -1
- package/src/components/ui/tag.tsx +5 -0
- package/src/hooks/ui/index.ts +1 -0
- package/src/hooks/ui/use-header-height.ts +51 -2
- package/src/hooks/ui/use-sticky-toolbar.ts +60 -0
- package/src/hooks/use-location-hash.ts +9 -5
- package/src/hooks/use-scroll-to-hash.ts +9 -1
- package/src/types/case-study.ts +21 -1
- package/src/utils/date-utils.ts +8 -1
- package/src/utils/index.ts +5 -0
- package/src/utils/open-in-new-tab.ts +12 -0
- package/src/utils/same-page-hash-nav.ts +57 -0
- package/src/utils/scroll-into-view.ts +21 -5
- package/dist/chunk-BM5MVGH3.cjs +0 -499
- package/dist/chunk-CUME3VTQ.js +0 -144
- package/dist/chunk-CZ7Y7UG4.js +0 -732
- package/dist/chunk-FLKJYMVB.js +0 -499
- package/dist/chunk-OF6GEI5A.cjs +0 -144
- package/dist/chunk-UVTD52MD.cjs +0 -732
|
@@ -0,0 +1,1122 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
AvatarStack,
|
|
4
|
+
resolveIcon
|
|
5
|
+
} from "./chunk-JHQ334WS.js";
|
|
6
|
+
import {
|
|
7
|
+
Tag,
|
|
8
|
+
VIEWER_TIMEZONE,
|
|
9
|
+
formatDateWithTimezone
|
|
10
|
+
} from "./chunk-IYVFSLWJ.js";
|
|
11
|
+
import {
|
|
12
|
+
ViewportBreakpoints
|
|
13
|
+
} from "./chunk-KEKCQENI.js";
|
|
14
|
+
import {
|
|
15
|
+
Send01Icon,
|
|
16
|
+
StopCircleIcon,
|
|
17
|
+
XmarkIcon
|
|
18
|
+
} from "./chunk-NCPTID44.js";
|
|
19
|
+
import {
|
|
20
|
+
Button
|
|
21
|
+
} from "./chunk-YDPKUAP4.js";
|
|
22
|
+
import {
|
|
23
|
+
cn
|
|
24
|
+
} from "./chunk-7RXWKTAP.js";
|
|
25
|
+
|
|
26
|
+
// src/components/ui/modal-v2.tsx
|
|
27
|
+
import { createContext, forwardRef, useContext, useRef, useEffect, useState } from "react";
|
|
28
|
+
import { RemoveScroll } from "react-remove-scroll";
|
|
29
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
30
|
+
var ANIMATION_DURATION = 200;
|
|
31
|
+
var ModalContext = createContext({});
|
|
32
|
+
var MODAL_V2_SIZE_CLASSES = {
|
|
33
|
+
default: "max-w-[min(28rem,calc(100vw-2rem))]",
|
|
34
|
+
medium: "max-w-[min(42rem,calc(100vw-2rem))]",
|
|
35
|
+
wide: "max-w-[min(1400px,calc(100vw-2rem))]"
|
|
36
|
+
};
|
|
37
|
+
var modalStack = [];
|
|
38
|
+
var isInPortaledLayer = (node) => node instanceof Element && node.closest('[data-radix-popper-content-wrapper], [role="listbox"], [role="menu"]') !== null;
|
|
39
|
+
var Modal = forwardRef(
|
|
40
|
+
({ isOpen, onClose, children, className, size = "default" }, ref) => {
|
|
41
|
+
const [isMounted, setIsMounted] = useState(isOpen);
|
|
42
|
+
const panelRef = useRef(null);
|
|
43
|
+
const restoreFocusRef = useRef(null);
|
|
44
|
+
const stackIdRef = useRef(/* @__PURE__ */ Symbol("modal"));
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
if (!isOpen) return void 0;
|
|
47
|
+
const stackId = stackIdRef.current;
|
|
48
|
+
modalStack.push(stackId);
|
|
49
|
+
restoreFocusRef.current = document.activeElement;
|
|
50
|
+
const raf = requestAnimationFrame(() => {
|
|
51
|
+
const panel = panelRef.current;
|
|
52
|
+
if (!panel) return;
|
|
53
|
+
if (panel.contains(document.activeElement)) return;
|
|
54
|
+
panel.focus();
|
|
55
|
+
});
|
|
56
|
+
const containFocus = (event) => {
|
|
57
|
+
if (modalStack[modalStack.length - 1] !== stackId) return;
|
|
58
|
+
const panel = panelRef.current;
|
|
59
|
+
if (!panel) return;
|
|
60
|
+
const target = event.target;
|
|
61
|
+
if (target && (panel.contains(target) || isInPortaledLayer(target))) return;
|
|
62
|
+
panel.focus();
|
|
63
|
+
};
|
|
64
|
+
document.addEventListener("focusin", containFocus);
|
|
65
|
+
const reasserts = [80, 240, 500].map(
|
|
66
|
+
(ms) => setTimeout(() => {
|
|
67
|
+
if (modalStack[modalStack.length - 1] !== stackId) return;
|
|
68
|
+
const panel = panelRef.current;
|
|
69
|
+
if (!panel) return;
|
|
70
|
+
if (!panel.contains(document.activeElement) && !isInPortaledLayer(document.activeElement)) panel.focus();
|
|
71
|
+
}, ms)
|
|
72
|
+
);
|
|
73
|
+
return () => {
|
|
74
|
+
cancelAnimationFrame(raf);
|
|
75
|
+
reasserts.forEach(clearTimeout);
|
|
76
|
+
document.removeEventListener("focusin", containFocus);
|
|
77
|
+
const idx = modalStack.lastIndexOf(stackId);
|
|
78
|
+
if (idx !== -1) modalStack.splice(idx, 1);
|
|
79
|
+
restoreFocusRef.current?.focus?.();
|
|
80
|
+
};
|
|
81
|
+
}, [isOpen]);
|
|
82
|
+
useEffect(() => {
|
|
83
|
+
if (!isOpen) return void 0;
|
|
84
|
+
const handleTab = (event) => {
|
|
85
|
+
if (event.key !== "Tab") return;
|
|
86
|
+
const panel = panelRef.current;
|
|
87
|
+
if (!panel) return;
|
|
88
|
+
if (isInPortaledLayer(document.activeElement)) return;
|
|
89
|
+
const focusables = Array.from(
|
|
90
|
+
panel.querySelectorAll(
|
|
91
|
+
'a[href], button:not([disabled]), input:not([disabled]):not([type="hidden"]), textarea:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])'
|
|
92
|
+
)
|
|
93
|
+
).filter((el) => el.getAttribute("aria-hidden") !== "true" && el.offsetParent !== null);
|
|
94
|
+
if (focusables.length === 0) return;
|
|
95
|
+
const first = focusables[0];
|
|
96
|
+
const last = focusables[focusables.length - 1];
|
|
97
|
+
const active = document.activeElement;
|
|
98
|
+
if (event.shiftKey) {
|
|
99
|
+
if (active === first || !panel.contains(active)) {
|
|
100
|
+
event.preventDefault();
|
|
101
|
+
last.focus();
|
|
102
|
+
}
|
|
103
|
+
} else if (active === last || !panel.contains(active)) {
|
|
104
|
+
event.preventDefault();
|
|
105
|
+
first.focus();
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
document.addEventListener("keydown", handleTab);
|
|
109
|
+
return () => document.removeEventListener("keydown", handleTab);
|
|
110
|
+
}, [isOpen]);
|
|
111
|
+
useEffect(() => {
|
|
112
|
+
if (isOpen) {
|
|
113
|
+
setIsMounted(true);
|
|
114
|
+
return void 0;
|
|
115
|
+
}
|
|
116
|
+
const timeout = setTimeout(() => setIsMounted(false), ANIMATION_DURATION);
|
|
117
|
+
return () => clearTimeout(timeout);
|
|
118
|
+
}, [isOpen]);
|
|
119
|
+
useEffect(() => {
|
|
120
|
+
if (!isOpen) return void 0;
|
|
121
|
+
const handleKeyDown = (event) => {
|
|
122
|
+
if (event.key === "Escape" && !event.defaultPrevented && modalStack[modalStack.length - 1] === stackIdRef.current) {
|
|
123
|
+
onClose();
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
127
|
+
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
128
|
+
}, [isOpen, onClose]);
|
|
129
|
+
if (!isMounted) return null;
|
|
130
|
+
const state = isOpen ? "open" : "closed";
|
|
131
|
+
return (
|
|
132
|
+
// `forwardProps` — RemoveScroll's default is to WRAP its children in a
|
|
133
|
+
// plain <div>. That wrapper is in normal flow, so a modal rendered inside
|
|
134
|
+
// a `flex`/`grid` container with a `gap` became an extra (zero-height)
|
|
135
|
+
// track the moment it opened, shifting every sibling below it down by one
|
|
136
|
+
// gap. Cloning onto the child instead leaves only the `fixed` overlay,
|
|
137
|
+
// which is out of flow and therefore not a flex/grid item at all.
|
|
138
|
+
// The child must stay a single element for `Children.only`.
|
|
139
|
+
/* @__PURE__ */ jsx(RemoveScroll, { enabled: isOpen, removeScrollBar: false, forwardProps: true, children: /* @__PURE__ */ jsxs(
|
|
140
|
+
"div",
|
|
141
|
+
{
|
|
142
|
+
className: "ods-viewport-layer fixed inset-0 z-[1300] flex items-end justify-center transition-[padding] duration-200 md:items-center",
|
|
143
|
+
style: { paddingBottom: "var(--of-keyboard-inset, 0px)" },
|
|
144
|
+
children: [
|
|
145
|
+
/* @__PURE__ */ jsx(
|
|
146
|
+
"div",
|
|
147
|
+
{
|
|
148
|
+
"data-state": state,
|
|
149
|
+
className: cn(
|
|
150
|
+
"absolute inset-0 bg-ods-overlay backdrop-blur-[2px] md:backdrop-blur-none",
|
|
151
|
+
"duration-200 fill-mode-forwards",
|
|
152
|
+
"data-[state=open]:animate-in data-[state=open]:fade-in-0",
|
|
153
|
+
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0",
|
|
154
|
+
// Hold the hidden end-state until unmount so the backdrop doesn't
|
|
155
|
+
// flash back to full opacity when the animation finishes a frame
|
|
156
|
+
// before the unmount timeout fires.
|
|
157
|
+
"data-[state=closed]:fill-mode-forwards"
|
|
158
|
+
),
|
|
159
|
+
onClick: onClose,
|
|
160
|
+
"aria-hidden": "true"
|
|
161
|
+
}
|
|
162
|
+
),
|
|
163
|
+
/* @__PURE__ */ jsx(
|
|
164
|
+
"div",
|
|
165
|
+
{
|
|
166
|
+
ref: (node) => {
|
|
167
|
+
panelRef.current = node;
|
|
168
|
+
if (typeof ref === "function") ref(node);
|
|
169
|
+
else if (ref) ref.current = node;
|
|
170
|
+
},
|
|
171
|
+
tabIndex: -1,
|
|
172
|
+
"data-state": state,
|
|
173
|
+
className: cn(
|
|
174
|
+
// A single base utility per size (not md:max-w-*) so consumer
|
|
175
|
+
// max-w-* overrides via className still win at every breakpoint.
|
|
176
|
+
"relative z-10 flex w-full min-w-0 flex-col",
|
|
177
|
+
// The panel is a focus TARGET (tabIndex -1), not a control: focus
|
|
178
|
+
// moves here on open so the dialog owns the keyboard, and the UA
|
|
179
|
+
// then paints its default ring around the whole modal. Opening by
|
|
180
|
+
// click hides it via :focus-visible heuristics, but a modal opened
|
|
181
|
+
// from a URL on page load has no preceding pointer event, so the
|
|
182
|
+
// ring showed on every refresh. Fields inside keep their own rings.
|
|
183
|
+
"outline-none",
|
|
184
|
+
MODAL_V2_SIZE_CLASSES[size],
|
|
185
|
+
"mx-4 mb-4 md:mb-0",
|
|
186
|
+
// dvh, not vh: vh ignores a mobile browser's retracting URL bar, so
|
|
187
|
+
// 90vh already overflowed behind Safari's toolbar. The `100%-2rem`
|
|
188
|
+
// arm resolves against the keyboard-padded wrapper above and caps
|
|
189
|
+
// the panel to what's left of it, less the 1rem `mb-4` and a
|
|
190
|
+
// matching 1rem of breathing room at the top — header and footer
|
|
191
|
+
// stay pinned, ModalV2Content scrolls. min() picks 90dvh on any
|
|
192
|
+
// viewport over 320px tall, so desktop is untouched.
|
|
193
|
+
"max-h-[min(90dvh,100%-2rem)]",
|
|
194
|
+
// `wide` also FIXES the desktop height rather than only capping it:
|
|
195
|
+
// its columns scroll independently, and a height that tracks
|
|
196
|
+
// content makes the panel jump as an entity hydrates in. Mobile
|
|
197
|
+
// keeps the bottom-sheet's content-sized height.
|
|
198
|
+
size === "wide" && "md:h-[min(90dvh,100%-2rem)]",
|
|
199
|
+
"bg-ods-bg md:bg-ods-card",
|
|
200
|
+
"rounded-md border border-ods-border shadow-xl",
|
|
201
|
+
"gap-[var(--spacing-system-l)] p-[var(--spacing-system-xl)]",
|
|
202
|
+
"duration-200 fill-mode-forwards",
|
|
203
|
+
"data-[state=open]:animate-in data-[state=open]:fade-in-0",
|
|
204
|
+
"data-[state=open]:slide-in-from-bottom-4 md:data-[state=open]:zoom-in-95 md:data-[state=open]:slide-in-from-bottom-0",
|
|
205
|
+
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0",
|
|
206
|
+
"data-[state=closed]:slide-out-to-bottom-4 md:data-[state=closed]:zoom-out-95 md:data-[state=closed]:slide-out-to-bottom-0",
|
|
207
|
+
// Hold the hidden end-state until unmount so the panel doesn't snap
|
|
208
|
+
// back to opacity/scale 1 for a frame before it unmounts.
|
|
209
|
+
"data-[state=closed]:fill-mode-forwards",
|
|
210
|
+
className
|
|
211
|
+
),
|
|
212
|
+
role: "dialog",
|
|
213
|
+
"aria-modal": "true",
|
|
214
|
+
children: /* @__PURE__ */ jsx(ModalContext.Provider, { value: { onClose }, children: /* @__PURE__ */ jsx(ViewportBreakpoints, { children }) })
|
|
215
|
+
}
|
|
216
|
+
)
|
|
217
|
+
]
|
|
218
|
+
}
|
|
219
|
+
) })
|
|
220
|
+
);
|
|
221
|
+
}
|
|
222
|
+
);
|
|
223
|
+
Modal.displayName = "ModalV2";
|
|
224
|
+
var ModalContent = forwardRef(({ children, className }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("min-h-0 flex-1 overflow-y-auto", className), children }));
|
|
225
|
+
ModalContent.displayName = "ModalV2Content";
|
|
226
|
+
var ModalTwoColumn = forwardRef(({ left, right, className }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("min-h-0 flex-1 overflow-y-auto lg:overflow-hidden", className), children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-[var(--spacing-system-xl)] lg:h-full lg:min-h-0 lg:grid-cols-2 lg:grid-rows-[minmax(0,1fr)]", children: [
|
|
227
|
+
/* @__PURE__ */ jsx("div", { className: "min-h-0 space-y-[var(--spacing-system-lf)] lg:overflow-y-auto lg:pr-[var(--spacing-system-sf)]", children: left }),
|
|
228
|
+
/* @__PURE__ */ jsx("div", { className: "min-h-0 space-y-[var(--spacing-system-lf)] lg:overflow-y-auto lg:pr-[var(--spacing-system-sf)]", children: right })
|
|
229
|
+
] }) }));
|
|
230
|
+
ModalTwoColumn.displayName = "ModalV2TwoColumn";
|
|
231
|
+
var ModalHeader = forwardRef(({ children, className }, ref) => {
|
|
232
|
+
const { onClose } = useContext(ModalContext);
|
|
233
|
+
return /* @__PURE__ */ jsxs("div", { ref, className: cn("flex items-center gap-[var(--spacing-system-sf)]", className), children: [
|
|
234
|
+
/* @__PURE__ */ jsx("div", { className: "flex min-w-0 flex-1 flex-col", children }),
|
|
235
|
+
onClose && /* @__PURE__ */ jsx(
|
|
236
|
+
"button",
|
|
237
|
+
{
|
|
238
|
+
onClick: onClose,
|
|
239
|
+
className: "hidden shrink-0 text-ods-text-secondary transition-colors hover:text-ods-text-primary md:flex",
|
|
240
|
+
"aria-label": "Close",
|
|
241
|
+
children: /* @__PURE__ */ jsx(XmarkIcon, { className: "size-6" })
|
|
242
|
+
}
|
|
243
|
+
)
|
|
244
|
+
] });
|
|
245
|
+
});
|
|
246
|
+
ModalHeader.displayName = "ModalV2Header";
|
|
247
|
+
var ModalTitle = forwardRef(({ children, className }, ref) => /* @__PURE__ */ jsx("h2", { ref, className: cn("text-ods-text-primary text-h2", className), children }));
|
|
248
|
+
ModalTitle.displayName = "ModalV2Title";
|
|
249
|
+
var ModalFooter = forwardRef(({ children, className }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("flex gap-4", className), children }));
|
|
250
|
+
ModalFooter.displayName = "ModalV2Footer";
|
|
251
|
+
|
|
252
|
+
// src/components/chat/types/chat.types.ts
|
|
253
|
+
var CHAT_TYPE = {
|
|
254
|
+
CLIENT: "CLIENT_CHAT",
|
|
255
|
+
ADMIN: "ADMIN_AI_CHAT"
|
|
256
|
+
};
|
|
257
|
+
var OWNER_TYPE = {
|
|
258
|
+
CLIENT: "CLIENT",
|
|
259
|
+
ADMIN: "ADMIN",
|
|
260
|
+
ASSISTANT: "ASSISTANT"
|
|
261
|
+
};
|
|
262
|
+
var MESSAGE_ROLE = {
|
|
263
|
+
USER: "user",
|
|
264
|
+
ASSISTANT: "assistant",
|
|
265
|
+
ERROR: "error",
|
|
266
|
+
SYSTEM: "system"
|
|
267
|
+
};
|
|
268
|
+
var ASSISTANT_TYPE = {
|
|
269
|
+
FAE: "fae",
|
|
270
|
+
MINGO: "mingo"
|
|
271
|
+
};
|
|
272
|
+
var AUTHOR_TYPE = {
|
|
273
|
+
USER: "user",
|
|
274
|
+
ADMIN: "admin",
|
|
275
|
+
FAE: "fae",
|
|
276
|
+
MINGO: "mingo",
|
|
277
|
+
SYSTEM: "system"
|
|
278
|
+
};
|
|
279
|
+
var APPROVAL_STATUS = {
|
|
280
|
+
PENDING: "pending",
|
|
281
|
+
APPROVED: "approved",
|
|
282
|
+
REJECTED: "rejected",
|
|
283
|
+
CANCELLED: "cancelled"
|
|
284
|
+
};
|
|
285
|
+
var APPROVAL_BLOCK_VARIANT = {
|
|
286
|
+
ADMIN: "admin",
|
|
287
|
+
CLIENT: "client"
|
|
288
|
+
};
|
|
289
|
+
var CHAT_APPEARANCE = {
|
|
290
|
+
CLASSIC: "classic",
|
|
291
|
+
V2: "v2"
|
|
292
|
+
};
|
|
293
|
+
var CONNECTION_STATUS = {
|
|
294
|
+
CONNECTING: "connecting",
|
|
295
|
+
CONNECTED: "connected",
|
|
296
|
+
DISCONNECTED: "disconnected",
|
|
297
|
+
RECONNECTING: "reconnecting",
|
|
298
|
+
CLOSED: "closed",
|
|
299
|
+
ERROR: "error"
|
|
300
|
+
};
|
|
301
|
+
function isStructuredContent(content) {
|
|
302
|
+
return Array.isArray(content);
|
|
303
|
+
}
|
|
304
|
+
function normalizeContent(content) {
|
|
305
|
+
if (typeof content === "string") {
|
|
306
|
+
return content ? [{ type: "text", text: content }] : [];
|
|
307
|
+
}
|
|
308
|
+
return content;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
// src/components/chat/chat-typing-indicator.tsx
|
|
312
|
+
import { forwardRef as forwardRef2 } from "react";
|
|
313
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
314
|
+
var ChatTypingIndicator = forwardRef2(
|
|
315
|
+
({ className, size = "md", showText = false, dotClassName, ...props }, ref) => {
|
|
316
|
+
const dotSizeClasses = {
|
|
317
|
+
sm: "w-1 h-1",
|
|
318
|
+
md: "w-1.5 h-1.5",
|
|
319
|
+
lg: "w-2 h-2"
|
|
320
|
+
};
|
|
321
|
+
const containerSizeClasses = {
|
|
322
|
+
sm: "h-4",
|
|
323
|
+
md: "h-6",
|
|
324
|
+
lg: "h-8"
|
|
325
|
+
};
|
|
326
|
+
return /* @__PURE__ */ jsxs2("div", { ref, className: cn("flex items-center gap-2", className), ...props, children: [
|
|
327
|
+
showText && /* @__PURE__ */ jsx2("span", { className: "text-ods-text-secondary text-h6", children: "Assistant is typing" }),
|
|
328
|
+
/* @__PURE__ */ jsxs2("div", { className: cn("inline-flex items-center justify-center gap-1", containerSizeClasses[size]), children: [
|
|
329
|
+
/* @__PURE__ */ jsx2(
|
|
330
|
+
"div",
|
|
331
|
+
{
|
|
332
|
+
className: cn(
|
|
333
|
+
dotSizeClasses[size],
|
|
334
|
+
"animate-dot-pulse rounded-full",
|
|
335
|
+
dotClassName || "bg-ods-text-primary"
|
|
336
|
+
),
|
|
337
|
+
style: { animationDelay: "0ms" }
|
|
338
|
+
}
|
|
339
|
+
),
|
|
340
|
+
/* @__PURE__ */ jsx2(
|
|
341
|
+
"div",
|
|
342
|
+
{
|
|
343
|
+
className: cn(
|
|
344
|
+
dotSizeClasses[size],
|
|
345
|
+
"animate-dot-pulse rounded-full",
|
|
346
|
+
dotClassName || "bg-ods-text-primary"
|
|
347
|
+
),
|
|
348
|
+
style: { animationDelay: "200ms" }
|
|
349
|
+
}
|
|
350
|
+
),
|
|
351
|
+
/* @__PURE__ */ jsx2(
|
|
352
|
+
"div",
|
|
353
|
+
{
|
|
354
|
+
className: cn(
|
|
355
|
+
dotSizeClasses[size],
|
|
356
|
+
"animate-dot-pulse rounded-full",
|
|
357
|
+
dotClassName || "bg-ods-text-primary"
|
|
358
|
+
),
|
|
359
|
+
style: { animationDelay: "400ms" }
|
|
360
|
+
}
|
|
361
|
+
)
|
|
362
|
+
] })
|
|
363
|
+
] });
|
|
364
|
+
}
|
|
365
|
+
);
|
|
366
|
+
ChatTypingIndicator.displayName = "ChatTypingIndicator";
|
|
367
|
+
|
|
368
|
+
// src/components/chat/mingo-onboarding-card.tsx
|
|
369
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
370
|
+
function MingoOnboardingCard({
|
|
371
|
+
icon,
|
|
372
|
+
title,
|
|
373
|
+
slashCommand,
|
|
374
|
+
description,
|
|
375
|
+
actions,
|
|
376
|
+
onClick,
|
|
377
|
+
className
|
|
378
|
+
}) {
|
|
379
|
+
const hasActions = !!actions && actions.length > 0;
|
|
380
|
+
const isInteractive = !hasActions && !!onClick;
|
|
381
|
+
const body = /* @__PURE__ */ jsxs3("div", { className: "flex w-full flex-col gap-[var(--spacing-system-xxs)]", children: [
|
|
382
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex w-full items-center gap-[var(--spacing-system-xxs)]", children: [
|
|
383
|
+
icon ? (
|
|
384
|
+
// Icon slot — monochrome `ods-text-secondary` (≈ #888) so
|
|
385
|
+
// consumers can drop any `icons-v2-generated` glyph (they use
|
|
386
|
+
// `currentColor`) without per-card styling. Brand multi-color
|
|
387
|
+
// SVGs ignore this color.
|
|
388
|
+
/* @__PURE__ */ jsx3("span", { className: "flex size-4 shrink-0 items-center justify-center text-ods-text-secondary", children: icon })
|
|
389
|
+
) : null,
|
|
390
|
+
/* @__PURE__ */ jsx3("span", { className: "min-w-0 flex-1 truncate text-ods-text-primary text-h6", children: title }),
|
|
391
|
+
slashCommand ? /* @__PURE__ */ jsx3("span", { className: "whitespace-nowrap text-ods-text-secondary text-h6", children: slashCommand }) : null
|
|
392
|
+
] }),
|
|
393
|
+
description ? /* @__PURE__ */ jsx3("p", { className: "w-full text-ods-text-secondary text-h6", children: description }) : null,
|
|
394
|
+
hasActions ? /* @__PURE__ */ jsx3("div", { className: "mt-[var(--spacing-system-xs)] flex flex-wrap items-center gap-[var(--spacing-system-xxs)]", children: actions.map((action) => /* @__PURE__ */ jsx3(
|
|
395
|
+
Button,
|
|
396
|
+
{
|
|
397
|
+
type: "button",
|
|
398
|
+
variant: "outline",
|
|
399
|
+
size: "small",
|
|
400
|
+
onClick: (e) => {
|
|
401
|
+
e.stopPropagation();
|
|
402
|
+
action.onClick(e);
|
|
403
|
+
},
|
|
404
|
+
children: action.label
|
|
405
|
+
},
|
|
406
|
+
action.id
|
|
407
|
+
)) }) : null
|
|
408
|
+
] });
|
|
409
|
+
const baseClass = cn(
|
|
410
|
+
"flex w-full items-start border-b border-ods-border bg-ods-card p-[var(--spacing-system-s)] text-left last:border-b-0",
|
|
411
|
+
isInteractive && "cursor-pointer transition-colors hover:bg-ods-bg-hover focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ods-accent",
|
|
412
|
+
className
|
|
413
|
+
);
|
|
414
|
+
if (isInteractive) {
|
|
415
|
+
return /* @__PURE__ */ jsx3("button", { type: "button", onClick, className: baseClass, children: body });
|
|
416
|
+
}
|
|
417
|
+
return /* @__PURE__ */ jsx3("div", { className: baseClass, children: body });
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
// src/components/chat/slash-command-suggestions.tsx
|
|
421
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
422
|
+
function SlashCommandSuggestions({
|
|
423
|
+
commands,
|
|
424
|
+
highlightedIdx,
|
|
425
|
+
onHover,
|
|
426
|
+
onSelect,
|
|
427
|
+
resolveSourceIcon,
|
|
428
|
+
onAction,
|
|
429
|
+
className
|
|
430
|
+
}) {
|
|
431
|
+
if (commands.length === 0) return null;
|
|
432
|
+
return /* @__PURE__ */ jsx4(
|
|
433
|
+
"div",
|
|
434
|
+
{
|
|
435
|
+
role: "menu",
|
|
436
|
+
"aria-label": "Slash command suggestions",
|
|
437
|
+
className: cn(
|
|
438
|
+
"absolute bottom-full left-0 right-0 z-50 mb-2 max-h-96 overflow-y-auto overscroll-contain",
|
|
439
|
+
"rounded-md border border-ods-border bg-ods-card shadow-lg",
|
|
440
|
+
className
|
|
441
|
+
),
|
|
442
|
+
children: commands.map((cmd, idx) => {
|
|
443
|
+
const Icon = resolveIcon(cmd.iconName);
|
|
444
|
+
const legacyMeta = !cmd.iconName && cmd.primarySourceId && resolveSourceIcon ? resolveSourceIcon(cmd.primarySourceId) : void 0;
|
|
445
|
+
const LegacyIcon = legacyMeta?.Icon;
|
|
446
|
+
const title = cmd.label ?? legacyMeta?.label ?? cmd.id;
|
|
447
|
+
const isHighlighted = idx === highlightedIdx;
|
|
448
|
+
const slashLabel = cmd.argumentHint ? `/${cmd.id} ${cmd.argumentHint}` : `/${cmd.id}`;
|
|
449
|
+
const cardActions = onAction && cmd.actions.length > 0 ? cmd.actions.map((action) => ({
|
|
450
|
+
id: action.id,
|
|
451
|
+
label: action.label,
|
|
452
|
+
onClick: (e) => {
|
|
453
|
+
e.stopPropagation();
|
|
454
|
+
onAction(cmd, action.id);
|
|
455
|
+
}
|
|
456
|
+
})) : void 0;
|
|
457
|
+
return /* @__PURE__ */ jsx4(
|
|
458
|
+
"div",
|
|
459
|
+
{
|
|
460
|
+
role: "menuitem",
|
|
461
|
+
"aria-current": isHighlighted ? "true" : void 0,
|
|
462
|
+
tabIndex: -1,
|
|
463
|
+
onMouseEnter: () => onHover(idx),
|
|
464
|
+
onClick: () => onSelect(cmd),
|
|
465
|
+
onKeyDown: (e) => {
|
|
466
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
467
|
+
e.preventDefault();
|
|
468
|
+
onSelect(cmd);
|
|
469
|
+
}
|
|
470
|
+
},
|
|
471
|
+
className: "cursor-pointer outline-none",
|
|
472
|
+
children: /* @__PURE__ */ jsx4(
|
|
473
|
+
MingoOnboardingCard,
|
|
474
|
+
{
|
|
475
|
+
icon: LegacyIcon ? /* @__PURE__ */ jsx4(LegacyIcon, { className: "size-4" }) : /* @__PURE__ */ jsx4(Icon, { size: 16 }),
|
|
476
|
+
title,
|
|
477
|
+
slashCommand: slashLabel,
|
|
478
|
+
description: cmd.description,
|
|
479
|
+
actions: cardActions,
|
|
480
|
+
className: cn("transition-colors", isHighlighted && "bg-ods-bg-hover")
|
|
481
|
+
}
|
|
482
|
+
)
|
|
483
|
+
},
|
|
484
|
+
cmd.id
|
|
485
|
+
);
|
|
486
|
+
})
|
|
487
|
+
}
|
|
488
|
+
);
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
// src/components/chat/chat-input.tsx
|
|
492
|
+
import {
|
|
493
|
+
useState as useState2,
|
|
494
|
+
useRef as useRef2,
|
|
495
|
+
useImperativeHandle,
|
|
496
|
+
forwardRef as forwardRef3,
|
|
497
|
+
useCallback,
|
|
498
|
+
useEffect as useEffect2,
|
|
499
|
+
useMemo
|
|
500
|
+
} from "react";
|
|
501
|
+
import { renderToStaticMarkup } from "react-dom/server";
|
|
502
|
+
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
503
|
+
var SLASH_INPUT_TRIGGER = /^\/([a-z][a-z0-9-]*)?$/;
|
|
504
|
+
var MENTION_GLOBAL = /@[A-Za-z0-9_.+/=-]+:[A-Za-z0-9_.+/=-]+/g;
|
|
505
|
+
var MENTION_TRIGGER_AT_END = /(^|\s)@([\w.-]*)$/;
|
|
506
|
+
function parseSegments(value, meta) {
|
|
507
|
+
const segs = [];
|
|
508
|
+
let last = 0;
|
|
509
|
+
MENTION_GLOBAL.lastIndex = 0;
|
|
510
|
+
let m;
|
|
511
|
+
while ((m = MENTION_GLOBAL.exec(value)) !== null) {
|
|
512
|
+
if (m.index > last) segs.push({ kind: "text", text: value.slice(last, m.index) });
|
|
513
|
+
const token = m[0].slice(1);
|
|
514
|
+
const info = meta.get(token);
|
|
515
|
+
segs.push({ kind: "mention", token, label: info?.label ?? token.slice(token.indexOf(":") + 1), icon: info?.icon });
|
|
516
|
+
last = m.index + m[0].length;
|
|
517
|
+
}
|
|
518
|
+
if (last < value.length) segs.push({ kind: "text", text: value.slice(last) });
|
|
519
|
+
return segs;
|
|
520
|
+
}
|
|
521
|
+
var isChip = (n) => n.nodeType === 1 && n.dataset?.token !== void 0;
|
|
522
|
+
function serialize(el) {
|
|
523
|
+
let out = "";
|
|
524
|
+
for (const node of Array.from(el.childNodes)) {
|
|
525
|
+
if (node.nodeType === Node.TEXT_NODE) out += node.textContent ?? "";
|
|
526
|
+
else if (isChip(node)) out += `@${node.dataset.token}`;
|
|
527
|
+
else if (node.tagName === "BR") continue;
|
|
528
|
+
else out += node.textContent ?? "";
|
|
529
|
+
}
|
|
530
|
+
return out;
|
|
531
|
+
}
|
|
532
|
+
function buildChipEl(token, label, icon) {
|
|
533
|
+
const span = document.createElement("span");
|
|
534
|
+
span.dataset.token = token;
|
|
535
|
+
span.setAttribute("contenteditable", "false");
|
|
536
|
+
span.className = "mx-0.5 inline-flex h-9 items-center select-none align-top";
|
|
537
|
+
span.innerHTML = renderToStaticMarkup(
|
|
538
|
+
/* @__PURE__ */ jsx5(
|
|
539
|
+
Tag,
|
|
540
|
+
{
|
|
541
|
+
as: "span",
|
|
542
|
+
variant: "badge",
|
|
543
|
+
icon,
|
|
544
|
+
label,
|
|
545
|
+
onClose: () => {
|
|
546
|
+
},
|
|
547
|
+
className: "max-w-[16rem] hover:border-ods-border [&_svg]:text-ods-text-secondary"
|
|
548
|
+
}
|
|
549
|
+
)
|
|
550
|
+
);
|
|
551
|
+
return span;
|
|
552
|
+
}
|
|
553
|
+
function rebuildDom(el, value, meta) {
|
|
554
|
+
el.replaceChildren();
|
|
555
|
+
for (const seg of parseSegments(value, meta)) {
|
|
556
|
+
if (seg.kind === "text") el.appendChild(document.createTextNode(seg.text));
|
|
557
|
+
else el.appendChild(buildChipEl(seg.token, seg.label, seg.icon));
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
function placeCaretAtEnd(el) {
|
|
561
|
+
const sel = typeof window !== "undefined" ? window.getSelection() : null;
|
|
562
|
+
if (!sel) return;
|
|
563
|
+
const range = document.createRange();
|
|
564
|
+
range.selectNodeContents(el);
|
|
565
|
+
range.collapse(false);
|
|
566
|
+
sel.removeAllRanges();
|
|
567
|
+
sel.addRange(range);
|
|
568
|
+
}
|
|
569
|
+
function placeCaretAtOffset(el, offset) {
|
|
570
|
+
const sel = typeof window !== "undefined" ? window.getSelection() : null;
|
|
571
|
+
if (!sel) return;
|
|
572
|
+
const node = el.firstChild;
|
|
573
|
+
const range = document.createRange();
|
|
574
|
+
if (node && node.nodeType === Node.TEXT_NODE) {
|
|
575
|
+
range.setStart(node, Math.max(0, Math.min(offset, node.textContent?.length ?? 0)));
|
|
576
|
+
range.collapse(true);
|
|
577
|
+
} else {
|
|
578
|
+
range.selectNodeContents(el);
|
|
579
|
+
range.collapse(false);
|
|
580
|
+
}
|
|
581
|
+
sel.removeAllRanges();
|
|
582
|
+
sel.addRange(range);
|
|
583
|
+
}
|
|
584
|
+
function insertTextAtCaret(text) {
|
|
585
|
+
const sel = typeof window !== "undefined" ? window.getSelection() : null;
|
|
586
|
+
if (!sel || sel.rangeCount === 0) return;
|
|
587
|
+
const range = sel.getRangeAt(0);
|
|
588
|
+
range.deleteContents();
|
|
589
|
+
const tn = document.createTextNode(text);
|
|
590
|
+
range.insertNode(tn);
|
|
591
|
+
range.setStartAfter(tn);
|
|
592
|
+
range.collapse(true);
|
|
593
|
+
sel.removeAllRanges();
|
|
594
|
+
sel.addRange(range);
|
|
595
|
+
}
|
|
596
|
+
var ChatInput = forwardRef3((allProps, ref) => {
|
|
597
|
+
const { slashCommands, ...rest } = allProps;
|
|
598
|
+
const {
|
|
599
|
+
className,
|
|
600
|
+
onSend,
|
|
601
|
+
onStop,
|
|
602
|
+
sending = false,
|
|
603
|
+
awaitingResponse = false,
|
|
604
|
+
awaitingTeam,
|
|
605
|
+
awaitingTeamCount,
|
|
606
|
+
appearance = CHAT_APPEARANCE.CLASSIC,
|
|
607
|
+
placeholder = "Enter your Request...",
|
|
608
|
+
reserveAvatarOffset: _reserveAvatarOffset,
|
|
609
|
+
disabled = false,
|
|
610
|
+
disabledPlaceholder = "Connection lost. Waiting to reconnect...",
|
|
611
|
+
autoFocus = false,
|
|
612
|
+
fullWidth = false,
|
|
613
|
+
allowEmptySend = false,
|
|
614
|
+
onMentionQueryChange,
|
|
615
|
+
onValueChange,
|
|
616
|
+
startIcon,
|
|
617
|
+
hideBorder,
|
|
618
|
+
previewText
|
|
619
|
+
// Remaining textarea-only attrs are intentionally dropped — the editor is a
|
|
620
|
+
// contenteditable div, not a <textarea>, so spreading them would warn.
|
|
621
|
+
} = rest;
|
|
622
|
+
const [value, setValue] = useState2("");
|
|
623
|
+
const [hasChips, setHasChips] = useState2(false);
|
|
624
|
+
const [focused, setFocused] = useState2(false);
|
|
625
|
+
const [isStopping, setIsStopping] = useState2(false);
|
|
626
|
+
const [previewDismissed, setPreviewDismissed] = useState2(false);
|
|
627
|
+
const editorRef = useRef2(null);
|
|
628
|
+
const shouldRefocusRef = useRef2(false);
|
|
629
|
+
const prevSendingRef = useRef2(sending);
|
|
630
|
+
const prevAwaitingResponseRef = useRef2(awaitingResponse);
|
|
631
|
+
const isComposingRef = useRef2(false);
|
|
632
|
+
const valueRef = useRef2(value);
|
|
633
|
+
valueRef.current = value;
|
|
634
|
+
const metaRef = useRef2(/* @__PURE__ */ new Map());
|
|
635
|
+
const focusEditor = useCallback(() => {
|
|
636
|
+
if (disabled) return;
|
|
637
|
+
editorRef.current?.focus({ preventScroll: true });
|
|
638
|
+
}, [disabled]);
|
|
639
|
+
useEffect2(() => {
|
|
640
|
+
if (autoFocus) focusEditor();
|
|
641
|
+
}, [autoFocus, focusEditor]);
|
|
642
|
+
useEffect2(() => {
|
|
643
|
+
onValueChange?.(value);
|
|
644
|
+
}, [value, onValueChange]);
|
|
645
|
+
const previewTextRef = useRef2(previewText);
|
|
646
|
+
useEffect2(() => {
|
|
647
|
+
previewTextRef.current = previewText;
|
|
648
|
+
});
|
|
649
|
+
useEffect2(() => {
|
|
650
|
+
setPreviewDismissed(false);
|
|
651
|
+
}, [previewText]);
|
|
652
|
+
useEffect2(() => {
|
|
653
|
+
if (previewTextRef.current) setPreviewDismissed(true);
|
|
654
|
+
}, [value]);
|
|
655
|
+
const applyValue = useCallback((next, caret = "end") => {
|
|
656
|
+
const el = editorRef.current;
|
|
657
|
+
if (el) {
|
|
658
|
+
rebuildDom(el, next, metaRef.current);
|
|
659
|
+
if (document.activeElement === el || caret === "end") {
|
|
660
|
+
if (typeof caret === "number") placeCaretAtOffset(el, caret);
|
|
661
|
+
else placeCaretAtEnd(el);
|
|
662
|
+
}
|
|
663
|
+
setHasChips(el.querySelector("[data-token]") !== null);
|
|
664
|
+
}
|
|
665
|
+
valueRef.current = next;
|
|
666
|
+
setValue(next);
|
|
667
|
+
}, []);
|
|
668
|
+
const fire = useCallback(
|
|
669
|
+
(message) => {
|
|
670
|
+
const can = (message.length > 0 || allowEmptySend) && !sending && !disabled;
|
|
671
|
+
if (!can || !onSend) return;
|
|
672
|
+
const sentMeta = metaRef.current;
|
|
673
|
+
metaRef.current = /* @__PURE__ */ new Map();
|
|
674
|
+
applyValue("");
|
|
675
|
+
shouldRefocusRef.current = true;
|
|
676
|
+
focusEditor();
|
|
677
|
+
const restore = () => {
|
|
678
|
+
if (valueRef.current.length > 0) return;
|
|
679
|
+
metaRef.current = sentMeta;
|
|
680
|
+
applyValue(message);
|
|
681
|
+
};
|
|
682
|
+
const result = onSend(message);
|
|
683
|
+
if (result instanceof Promise) {
|
|
684
|
+
void result.then((ok) => {
|
|
685
|
+
if (ok === false) restore();
|
|
686
|
+
});
|
|
687
|
+
} else if (result === false) {
|
|
688
|
+
restore();
|
|
689
|
+
}
|
|
690
|
+
},
|
|
691
|
+
[allowEmptySend, sending, disabled, onSend, focusEditor, applyValue]
|
|
692
|
+
);
|
|
693
|
+
const handleSubmit = useCallback(() => {
|
|
694
|
+
fire(valueRef.current.trim());
|
|
695
|
+
}, [fire]);
|
|
696
|
+
useImperativeHandle(
|
|
697
|
+
ref,
|
|
698
|
+
() => ({
|
|
699
|
+
focus: () => focusEditor(),
|
|
700
|
+
blur: () => editorRef.current?.blur(),
|
|
701
|
+
clear: () => {
|
|
702
|
+
metaRef.current = /* @__PURE__ */ new Map();
|
|
703
|
+
applyValue("");
|
|
704
|
+
},
|
|
705
|
+
setValue: (next) => {
|
|
706
|
+
applyValue(next);
|
|
707
|
+
requestAnimationFrame(() => focusEditor());
|
|
708
|
+
},
|
|
709
|
+
setValueAndCursor: (next, cursorOffset) => {
|
|
710
|
+
applyValue(next, Math.max(0, Math.min(cursorOffset, next.length)));
|
|
711
|
+
requestAnimationFrame(() => focusEditor());
|
|
712
|
+
},
|
|
713
|
+
submit: (next) => fire(next.trim()),
|
|
714
|
+
getValue: () => valueRef.current,
|
|
715
|
+
removeMentionTrigger: () => {
|
|
716
|
+
applyValue(valueRef.current.replace(MENTION_TRIGGER_AT_END, "$1"));
|
|
717
|
+
},
|
|
718
|
+
commitMention: (token, meta) => {
|
|
719
|
+
if (meta) metaRef.current = new Map(metaRef.current).set(token, meta);
|
|
720
|
+
const v = valueRef.current;
|
|
721
|
+
const next = MENTION_TRIGGER_AT_END.test(v) ? v.replace(MENTION_TRIGGER_AT_END, `$1@${token} `) : `${v}${v.length > 0 && !v.endsWith(" ") ? " " : ""}@${token} `;
|
|
722
|
+
applyValue(next);
|
|
723
|
+
requestAnimationFrame(() => focusEditor());
|
|
724
|
+
}
|
|
725
|
+
}),
|
|
726
|
+
[focusEditor, fire, applyValue]
|
|
727
|
+
);
|
|
728
|
+
const mentionEnabled = !!onMentionQueryChange;
|
|
729
|
+
const mentionQuery = useMemo(() => {
|
|
730
|
+
if (!mentionEnabled) return null;
|
|
731
|
+
const m = value.match(MENTION_TRIGGER_AT_END);
|
|
732
|
+
return m ? m[2] ?? "" : null;
|
|
733
|
+
}, [value, mentionEnabled]);
|
|
734
|
+
useEffect2(() => {
|
|
735
|
+
if (mentionEnabled) onMentionQueryChange?.(mentionQuery);
|
|
736
|
+
}, [mentionEnabled, mentionQuery, onMentionQueryChange]);
|
|
737
|
+
const slashMatch = useMemo(() => slashCommands ? value.match(SLASH_INPUT_TRIGGER) : null, [value, slashCommands]);
|
|
738
|
+
const slashPrefix = slashMatch ? slashMatch[1] ?? "" : null;
|
|
739
|
+
const [slashSuggestions, setSlashSuggestions] = useState2([]);
|
|
740
|
+
const [highlightedIdx, setHighlightedIdx] = useState2(0);
|
|
741
|
+
useEffect2(() => {
|
|
742
|
+
if (slashPrefix == null || !slashCommands) {
|
|
743
|
+
setSlashSuggestions([]);
|
|
744
|
+
return void 0;
|
|
745
|
+
}
|
|
746
|
+
let cancelled = false;
|
|
747
|
+
const ctrl = new AbortController();
|
|
748
|
+
const runFetch = async () => {
|
|
749
|
+
try {
|
|
750
|
+
const next = await slashCommands.fetchCommands(slashPrefix, ctrl.signal);
|
|
751
|
+
if (!cancelled) {
|
|
752
|
+
setSlashSuggestions(next);
|
|
753
|
+
setHighlightedIdx(0);
|
|
754
|
+
}
|
|
755
|
+
} catch (err) {
|
|
756
|
+
if (!cancelled && err?.name !== "AbortError") {
|
|
757
|
+
console.warn("[chat-input] slash-command fetch failed:", err);
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
};
|
|
761
|
+
const handle = setTimeout(() => {
|
|
762
|
+
runFetch().catch((err) => {
|
|
763
|
+
console.warn("[chat-input] slash-command fetch threw unexpectedly:", err);
|
|
764
|
+
});
|
|
765
|
+
}, 150);
|
|
766
|
+
return () => {
|
|
767
|
+
cancelled = true;
|
|
768
|
+
ctrl.abort();
|
|
769
|
+
clearTimeout(handle);
|
|
770
|
+
};
|
|
771
|
+
}, [slashPrefix, slashCommands]);
|
|
772
|
+
const acceptSuggestion = useCallback(
|
|
773
|
+
(cmd) => {
|
|
774
|
+
metaRef.current = /* @__PURE__ */ new Map();
|
|
775
|
+
const next = `/${cmd.id} `;
|
|
776
|
+
applyValue(next, next.length);
|
|
777
|
+
setSlashSuggestions([]);
|
|
778
|
+
requestAnimationFrame(() => focusEditor());
|
|
779
|
+
},
|
|
780
|
+
[applyValue, focusEditor]
|
|
781
|
+
);
|
|
782
|
+
const syncFromDom = useCallback(() => {
|
|
783
|
+
const el = editorRef.current;
|
|
784
|
+
if (!el) return;
|
|
785
|
+
setHasChips(el.querySelector("[data-token]") !== null);
|
|
786
|
+
setValue(serialize(el));
|
|
787
|
+
}, []);
|
|
788
|
+
const handleInput = useCallback(() => {
|
|
789
|
+
if (isComposingRef.current) return;
|
|
790
|
+
syncFromDom();
|
|
791
|
+
}, [syncFromDom]);
|
|
792
|
+
const handlePaste = useCallback(
|
|
793
|
+
(e) => {
|
|
794
|
+
e.preventDefault();
|
|
795
|
+
const text = e.clipboardData.getData("text/plain");
|
|
796
|
+
if (!text) return;
|
|
797
|
+
insertTextAtCaret(text);
|
|
798
|
+
syncFromDom();
|
|
799
|
+
},
|
|
800
|
+
[syncFromDom]
|
|
801
|
+
);
|
|
802
|
+
const handleKeyDown = useCallback(
|
|
803
|
+
(e) => {
|
|
804
|
+
if (slashSuggestions.length > 0 && slashPrefix !== null) {
|
|
805
|
+
if (e.key === "Escape") {
|
|
806
|
+
e.preventDefault();
|
|
807
|
+
setSlashSuggestions([]);
|
|
808
|
+
return;
|
|
809
|
+
}
|
|
810
|
+
if (e.key === "ArrowDown") {
|
|
811
|
+
e.preventDefault();
|
|
812
|
+
setHighlightedIdx((i) => (i + 1) % slashSuggestions.length);
|
|
813
|
+
return;
|
|
814
|
+
}
|
|
815
|
+
if (e.key === "ArrowUp") {
|
|
816
|
+
e.preventDefault();
|
|
817
|
+
setHighlightedIdx((i) => (i - 1 + slashSuggestions.length) % slashSuggestions.length);
|
|
818
|
+
return;
|
|
819
|
+
}
|
|
820
|
+
if (e.key === "Tab" || e.key === "Enter" && !e.shiftKey) {
|
|
821
|
+
e.preventDefault();
|
|
822
|
+
const sel = slashSuggestions[highlightedIdx];
|
|
823
|
+
if (sel) acceptSuggestion(sel);
|
|
824
|
+
return;
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
if (mentionQuery !== null) {
|
|
828
|
+
if (e.key === "Escape") {
|
|
829
|
+
e.preventDefault();
|
|
830
|
+
applyValue(valueRef.current.replace(MENTION_TRIGGER_AT_END, "$1"));
|
|
831
|
+
return;
|
|
832
|
+
}
|
|
833
|
+
if (e.key === "Enter" && !e.shiftKey) {
|
|
834
|
+
e.preventDefault();
|
|
835
|
+
return;
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
if (e.key === "Enter") {
|
|
839
|
+
if (e.shiftKey) {
|
|
840
|
+
e.preventDefault();
|
|
841
|
+
insertTextAtCaret("\n");
|
|
842
|
+
syncFromDom();
|
|
843
|
+
} else {
|
|
844
|
+
e.preventDefault();
|
|
845
|
+
handleSubmit();
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
},
|
|
849
|
+
[
|
|
850
|
+
slashSuggestions,
|
|
851
|
+
slashPrefix,
|
|
852
|
+
highlightedIdx,
|
|
853
|
+
acceptSuggestion,
|
|
854
|
+
handleSubmit,
|
|
855
|
+
mentionQuery,
|
|
856
|
+
applyValue,
|
|
857
|
+
syncFromDom
|
|
858
|
+
]
|
|
859
|
+
);
|
|
860
|
+
const handleEditorMouseDown = useCallback(
|
|
861
|
+
(e) => {
|
|
862
|
+
const target = e.target;
|
|
863
|
+
const chip = target.closest("[data-token]");
|
|
864
|
+
if (!chip || !target.closest("button")) return;
|
|
865
|
+
e.preventDefault();
|
|
866
|
+
const token = chip.dataset.token ?? "";
|
|
867
|
+
const next = valueRef.current.replace(`@${token} `, "").replace(`@${token}`, "").replace(/[^\S\n]{2,}/g, " ").replace(/^[^\S\n]+/, "");
|
|
868
|
+
applyValue(next);
|
|
869
|
+
requestAnimationFrame(() => focusEditor());
|
|
870
|
+
},
|
|
871
|
+
[applyValue, focusEditor]
|
|
872
|
+
);
|
|
873
|
+
useEffect2(() => {
|
|
874
|
+
if (!sending) setIsStopping(false);
|
|
875
|
+
}, [sending]);
|
|
876
|
+
useEffect2(() => {
|
|
877
|
+
const wasSending = prevSendingRef.current;
|
|
878
|
+
prevSendingRef.current = sending;
|
|
879
|
+
if (wasSending && !sending && shouldRefocusRef.current && !awaitingResponse && !disabled) {
|
|
880
|
+
shouldRefocusRef.current = false;
|
|
881
|
+
focusEditor();
|
|
882
|
+
}
|
|
883
|
+
}, [sending, awaitingResponse, disabled, focusEditor]);
|
|
884
|
+
useEffect2(() => {
|
|
885
|
+
const wasAwaiting = prevAwaitingResponseRef.current;
|
|
886
|
+
prevAwaitingResponseRef.current = awaitingResponse;
|
|
887
|
+
if (!wasAwaiting || awaitingResponse || !shouldRefocusRef.current || disabled) return void 0;
|
|
888
|
+
shouldRefocusRef.current = false;
|
|
889
|
+
const id = requestAnimationFrame(() => focusEditor());
|
|
890
|
+
return () => cancelAnimationFrame(id);
|
|
891
|
+
}, [awaitingResponse, disabled, focusEditor]);
|
|
892
|
+
const handleStop = useCallback(async () => {
|
|
893
|
+
if (!onStop || isStopping) return;
|
|
894
|
+
setIsStopping(true);
|
|
895
|
+
try {
|
|
896
|
+
await onStop();
|
|
897
|
+
} catch {
|
|
898
|
+
setIsStopping(false);
|
|
899
|
+
}
|
|
900
|
+
}, [onStop, isStopping]);
|
|
901
|
+
const isStopMode = sending && !!onStop;
|
|
902
|
+
const hasContent = value.trim().length > 0 || allowEmptySend;
|
|
903
|
+
const sendDisabled = sending || disabled || !hasContent;
|
|
904
|
+
const isEmpty = value.length === 0;
|
|
905
|
+
const showPreview = !sending && !disabled && !!previewText && !previewDismissed;
|
|
906
|
+
return /* @__PURE__ */ jsx5(
|
|
907
|
+
"div",
|
|
908
|
+
{
|
|
909
|
+
className: cn(
|
|
910
|
+
fullWidth ? "w-full flex-shrink-0" : "mx-auto w-full max-w-ods-content-narrow flex-shrink-0",
|
|
911
|
+
className
|
|
912
|
+
),
|
|
913
|
+
children: awaitingResponse && appearance === CHAT_APPEARANCE.CLASSIC ? /* @__PURE__ */ jsxs4("div", { className: "relative flex items-center justify-center gap-[var(--spacing-system-xs)] rounded-md border border-ods-border bg-ods-card px-[var(--spacing-system-s)] py-[var(--spacing-system-s)] transition-colors", children: [
|
|
914
|
+
/* @__PURE__ */ jsx5(ChatTypingIndicator, { size: "sm", dotClassName: "bg-ods-text-primary" }),
|
|
915
|
+
/* @__PURE__ */ jsx5("p", { className: "text-ods-text-secondary text-h4", children: "Waiting for Technician Response" })
|
|
916
|
+
] }) : awaitingResponse ? (
|
|
917
|
+
// Hand-off bar (fae chat v2): who has the conversation now, and that a
|
|
918
|
+
// reply is on its way. Same 48px height as the editor row it replaces,
|
|
919
|
+
// so the thread above does not jump when the chat is handed off.
|
|
920
|
+
/* @__PURE__ */ jsxs4(
|
|
921
|
+
"div",
|
|
922
|
+
{
|
|
923
|
+
role: "status",
|
|
924
|
+
className: "flex min-h-11 w-full items-center justify-center gap-[var(--spacing-system-xs)] rounded-md border border-ods-border bg-ods-bg p-[var(--spacing-system-sf)] md:min-h-12",
|
|
925
|
+
children: [
|
|
926
|
+
awaitingTeam && awaitingTeam.length > 0 && /* @__PURE__ */ jsx5(
|
|
927
|
+
AvatarStack,
|
|
928
|
+
{
|
|
929
|
+
people: awaitingTeam,
|
|
930
|
+
total: awaitingTeamCount,
|
|
931
|
+
size: "xs",
|
|
932
|
+
ringClassName: "ring-ods-bg",
|
|
933
|
+
label: "Technicians"
|
|
934
|
+
}
|
|
935
|
+
),
|
|
936
|
+
/* @__PURE__ */ jsx5("p", { className: "min-w-0 truncate text-ods-text-primary text-h4", children: "Handed off to your technical support team" }),
|
|
937
|
+
/* @__PURE__ */ jsx5(ChatTypingIndicator, { size: "sm", dotClassName: "bg-ods-text-secondary" })
|
|
938
|
+
]
|
|
939
|
+
}
|
|
940
|
+
)
|
|
941
|
+
) : /* @__PURE__ */ jsxs4("div", { className: "relative", children: [
|
|
942
|
+
/* @__PURE__ */ jsx5(
|
|
943
|
+
SlashCommandSuggestions,
|
|
944
|
+
{
|
|
945
|
+
commands: slashPrefix !== null ? slashSuggestions : [],
|
|
946
|
+
highlightedIdx,
|
|
947
|
+
onHover: setHighlightedIdx,
|
|
948
|
+
onSelect: acceptSuggestion,
|
|
949
|
+
resolveSourceIcon: slashCommands?.resolveSourceIcon,
|
|
950
|
+
onAction: slashCommands?.onAction
|
|
951
|
+
}
|
|
952
|
+
),
|
|
953
|
+
/* @__PURE__ */ jsxs4(
|
|
954
|
+
"div",
|
|
955
|
+
{
|
|
956
|
+
onMouseDown: (e) => {
|
|
957
|
+
if (e.target === e.currentTarget) {
|
|
958
|
+
e.preventDefault();
|
|
959
|
+
focusEditor();
|
|
960
|
+
}
|
|
961
|
+
},
|
|
962
|
+
className: cn(
|
|
963
|
+
// `items-center` keeps the empty single-line text AND a mention chip
|
|
964
|
+
// vertically centered the same way. With a chip in the box, `py-1.5`
|
|
965
|
+
// (6px) pairs with the editor's `leading-9` (36px) → that row is
|
|
966
|
+
// 36 + 2*6 = 48px. The 36px line box is just barely above the 32px
|
|
967
|
+
// chip (incl. its ~3.5px vertical-align overhead), so there's almost
|
|
968
|
+
// no slack for the chip to drift in → it reads as centered.
|
|
969
|
+
// A chipless row is shorter than its content box and the `min-h-*`
|
|
970
|
+
// here is what sets its height: 48px from `md` up, 44px below.
|
|
971
|
+
"group flex min-h-11 w-full cursor-text items-center gap-2 px-3 py-1.5 transition-colors duration-200 md:min-h-12",
|
|
972
|
+
!hideBorder && "rounded-[6px] border border-ods-border bg-ods-card",
|
|
973
|
+
!hideBorder && (focused ? "border-ods-accent" : !disabled && "hover:border-ods-border-hover hover:bg-ods-bg-hover"),
|
|
974
|
+
!hideBorder && disabled && "!cursor-not-allowed bg-ods-bg",
|
|
975
|
+
hideBorder && "bg-transparent"
|
|
976
|
+
),
|
|
977
|
+
children: [
|
|
978
|
+
startIcon && /* @__PURE__ */ jsx5("span", { className: "flex h-6 shrink-0 items-center", children: startIcon }),
|
|
979
|
+
/* @__PURE__ */ jsxs4("div", { className: "relative min-w-0 flex-1", children: [
|
|
980
|
+
isEmpty && !showPreview && /* @__PURE__ */ jsx5(
|
|
981
|
+
"span",
|
|
982
|
+
{
|
|
983
|
+
"data-editor-ghost": true,
|
|
984
|
+
className: cn(
|
|
985
|
+
// One line, clipped with an ellipsis (Figma 954:28455): the
|
|
986
|
+
// disabled copy is a sentence, and the panel's narrowest
|
|
987
|
+
// width does not fit it — wrapped, it ran under the row.
|
|
988
|
+
"pointer-events-none absolute left-0 top-0 w-full select-none truncate text-h4",
|
|
989
|
+
// Disabled reads as disabled (Figma 954:28455): the copy says
|
|
990
|
+
// why, and the colour says it is not an invitation to type.
|
|
991
|
+
disabled ? "text-ods-text-disabled" : "text-ods-text-secondary"
|
|
992
|
+
),
|
|
993
|
+
children: disabled ? disabledPlaceholder : placeholder
|
|
994
|
+
}
|
|
995
|
+
),
|
|
996
|
+
showPreview && /* @__PURE__ */ jsx5(
|
|
997
|
+
"p",
|
|
998
|
+
{
|
|
999
|
+
"data-editor-ghost": true,
|
|
1000
|
+
className: cn(
|
|
1001
|
+
"pointer-events-none absolute inset-x-0 top-0 m-0 select-none truncate text-ods-text-secondary text-h4",
|
|
1002
|
+
hasChips && "!leading-9"
|
|
1003
|
+
),
|
|
1004
|
+
children: previewText
|
|
1005
|
+
}
|
|
1006
|
+
),
|
|
1007
|
+
/* @__PURE__ */ jsx5(
|
|
1008
|
+
"div",
|
|
1009
|
+
{
|
|
1010
|
+
ref: editorRef,
|
|
1011
|
+
"data-editor": true,
|
|
1012
|
+
role: "textbox",
|
|
1013
|
+
"aria-multiline": "true",
|
|
1014
|
+
"aria-label": disabled ? disabledPlaceholder : typeof placeholder === "string" ? placeholder : "Message",
|
|
1015
|
+
contentEditable: !disabled,
|
|
1016
|
+
suppressContentEditableWarning: true,
|
|
1017
|
+
spellCheck: true,
|
|
1018
|
+
onInput: handleInput,
|
|
1019
|
+
onKeyDown: handleKeyDown,
|
|
1020
|
+
onPaste: handlePaste,
|
|
1021
|
+
onMouseDown: handleEditorMouseDown,
|
|
1022
|
+
onCompositionStart: () => {
|
|
1023
|
+
isComposingRef.current = true;
|
|
1024
|
+
},
|
|
1025
|
+
onCompositionEnd: () => {
|
|
1026
|
+
isComposingRef.current = false;
|
|
1027
|
+
syncFromDom();
|
|
1028
|
+
},
|
|
1029
|
+
onFocus: () => setFocused(true),
|
|
1030
|
+
onBlur: () => setFocused(false),
|
|
1031
|
+
className: cn(
|
|
1032
|
+
"max-h-[160px] overflow-y-auto overscroll-contain whitespace-pre-wrap break-words outline-none",
|
|
1033
|
+
// While a ghost preview shows, the editor stays IN FLOW (it
|
|
1034
|
+
// alone drives the row height, which must NOT change on hover —
|
|
1035
|
+
// see the preview comment above) and is only made transparent;
|
|
1036
|
+
// the absolutely-positioned single-line preview paints over it.
|
|
1037
|
+
showPreview && "opacity-0",
|
|
1038
|
+
// WITH chips, `leading-9` (36px) sits just above the 32px chip's
|
|
1039
|
+
// line-box need (~35.5px incl. vertical-align overhead): the LINE
|
|
1040
|
+
// drives row height (deterministic 48px, no overflow) AND the
|
|
1041
|
+
// near-zero slack keeps the chip centered against the `align-top`
|
|
1042
|
+
// `h-9` wrapper `buildChipEl` gives it. ~4px gap between wrapped
|
|
1043
|
+
// chip rows.
|
|
1044
|
+
// WITHOUT chips there is nothing tall to center, and forcing the
|
|
1045
|
+
// same 36px box on 14px phone text (`text-h4`) put a blank line's
|
|
1046
|
+
// worth of air between every wrapped row — so plain drafts keep
|
|
1047
|
+
// `text-h4`'s own responsive line-height (20px / 24px at md).
|
|
1048
|
+
// `min-h-*` pins the single-line box even when EMPTY: a
|
|
1049
|
+
// non-editable (`contentEditable=false`, i.e. `disabled`) empty div
|
|
1050
|
+
// would otherwise collapse to 0px, and `items-center` would
|
|
1051
|
+
// re-center the shorter wrapper in the row — dropping the `top-0`
|
|
1052
|
+
// placeholder down.
|
|
1053
|
+
"text-ods-text-primary text-h4",
|
|
1054
|
+
hasChips ? "min-h-9 !leading-9" : "min-h-[var(--font-line-space-h4-body)]",
|
|
1055
|
+
"scrollbar-thin scrollbar-track-transparent scrollbar-thumb-ods-border/30 hover:scrollbar-thumb-ods-text-secondary/30",
|
|
1056
|
+
disabled && "cursor-not-allowed"
|
|
1057
|
+
)
|
|
1058
|
+
}
|
|
1059
|
+
)
|
|
1060
|
+
] }),
|
|
1061
|
+
/* @__PURE__ */ jsx5(
|
|
1062
|
+
"button",
|
|
1063
|
+
{
|
|
1064
|
+
type: "button",
|
|
1065
|
+
"aria-label": isStopMode ? "Stop generation" : "Send message",
|
|
1066
|
+
onClick: isStopMode ? handleStop : handleSubmit,
|
|
1067
|
+
disabled: isStopMode ? isStopping : sendDisabled,
|
|
1068
|
+
className: cn(
|
|
1069
|
+
"flex h-6 shrink-0 items-center text-ods-text-secondary transition-colors duration-200",
|
|
1070
|
+
// Focus accent applies to the SEND icon only. Stop stays neutral
|
|
1071
|
+
// regardless of where focus sits — otherwise it reads yellow after
|
|
1072
|
+
// an Enter-send (editor keeps focus) but gray after an approve
|
|
1073
|
+
// click (focus moved to the card button).
|
|
1074
|
+
focused && !isStopMode && "text-ods-accent",
|
|
1075
|
+
"[&_svg]:size-4 md:[&_svg]:size-6",
|
|
1076
|
+
"cursor-pointer hover:text-ods-text-primary",
|
|
1077
|
+
"focus-visible:text-ods-accent focus-visible:outline-none",
|
|
1078
|
+
"disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:text-ods-text-secondary"
|
|
1079
|
+
),
|
|
1080
|
+
children: isStopMode ? /* @__PURE__ */ jsx5(StopCircleIcon, { size: 20 }) : /* @__PURE__ */ jsx5(Send01Icon, { size: 20 })
|
|
1081
|
+
}
|
|
1082
|
+
)
|
|
1083
|
+
]
|
|
1084
|
+
}
|
|
1085
|
+
)
|
|
1086
|
+
] })
|
|
1087
|
+
}
|
|
1088
|
+
);
|
|
1089
|
+
});
|
|
1090
|
+
ChatInput.displayName = "ChatInput";
|
|
1091
|
+
|
|
1092
|
+
// src/utils/format-date.ts
|
|
1093
|
+
var INVALID_DATE_PLACEHOLDER = "\u2014";
|
|
1094
|
+
var render = (input, fields) => formatDateWithTimezone(input, VIEWER_TIMEZONE, fields, { viewerLocale: true }) || INVALID_DATE_PLACEHOLDER;
|
|
1095
|
+
var formatDate = (input) => render(input, { dateStyle: "short" });
|
|
1096
|
+
var formatTime = (input) => render(input, { timeStyle: "short" });
|
|
1097
|
+
|
|
1098
|
+
export {
|
|
1099
|
+
Modal,
|
|
1100
|
+
ModalContent,
|
|
1101
|
+
ModalTwoColumn,
|
|
1102
|
+
ModalHeader,
|
|
1103
|
+
ModalTitle,
|
|
1104
|
+
ModalFooter,
|
|
1105
|
+
CHAT_TYPE,
|
|
1106
|
+
OWNER_TYPE,
|
|
1107
|
+
MESSAGE_ROLE,
|
|
1108
|
+
ASSISTANT_TYPE,
|
|
1109
|
+
AUTHOR_TYPE,
|
|
1110
|
+
APPROVAL_STATUS,
|
|
1111
|
+
APPROVAL_BLOCK_VARIANT,
|
|
1112
|
+
CHAT_APPEARANCE,
|
|
1113
|
+
CONNECTION_STATUS,
|
|
1114
|
+
isStructuredContent,
|
|
1115
|
+
normalizeContent,
|
|
1116
|
+
formatDate,
|
|
1117
|
+
formatTime,
|
|
1118
|
+
ChatTypingIndicator,
|
|
1119
|
+
MingoOnboardingCard,
|
|
1120
|
+
SlashCommandSuggestions,
|
|
1121
|
+
ChatInput
|
|
1122
|
+
};
|