@flamingo-stack/openframe-frontend-core 0.0.439 → 0.0.440
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-RVWC4P3H.js → chunk-2BTDPDME.js} +9 -9
- package/dist/chunk-2BTDPDME.js.map +1 -0
- package/dist/{chunk-G5FALXNO.js → chunk-63TSTDME.js} +21 -21
- package/dist/chunk-63TSTDME.js.map +1 -0
- package/dist/{chunk-4ACSUJ7Q.js → chunk-6CITW5BD.js} +10 -10
- package/dist/chunk-6CITW5BD.js.map +1 -0
- package/dist/{chunk-QXYOGJQJ.js → chunk-7KDR5P23.js} +2 -2
- package/dist/{chunk-PEIR7D25.js → chunk-7KNOHGMI.js} +2 -2
- package/dist/{chunk-ZMUFTGL7.cjs → chunk-7QP65IE4.cjs} +5 -5
- package/dist/{chunk-ZMUFTGL7.cjs.map → chunk-7QP65IE4.cjs.map} +1 -1
- package/dist/{chunk-WPVBTVI3.js → chunk-AGV26PUR.js} +6 -6
- package/dist/{chunk-WPVBTVI3.js.map → chunk-AGV26PUR.js.map} +1 -1
- package/dist/{chunk-HTVVXVJL.cjs → chunk-DUQQEQ7G.cjs} +1431 -1594
- package/dist/chunk-DUQQEQ7G.cjs.map +1 -0
- package/dist/{chunk-COMBYYQY.js → chunk-FPE3SQ5D.js} +13 -13
- package/dist/chunk-FPE3SQ5D.js.map +1 -0
- package/dist/{chunk-WAGTZVQN.js → chunk-IAZ5AN2E.js} +30 -30
- package/dist/chunk-IAZ5AN2E.js.map +1 -0
- package/dist/{chunk-RQQZF6G6.cjs → chunk-IPEIOR77.cjs} +130 -130
- package/dist/chunk-IPEIOR77.cjs.map +1 -0
- package/dist/{chunk-3WJQL4DN.cjs → chunk-IZ6A6K6N.cjs} +25 -25
- package/dist/chunk-IZ6A6K6N.cjs.map +1 -0
- package/dist/{chunk-EE5NH5SH.cjs → chunk-J5NO7PAG.cjs} +3 -3
- package/dist/{chunk-EE5NH5SH.cjs.map → chunk-J5NO7PAG.cjs.map} +1 -1
- package/dist/{chunk-IAN7GUIV.cjs → chunk-JNC4LVD6.cjs} +42 -42
- package/dist/chunk-JNC4LVD6.cjs.map +1 -0
- package/dist/{chunk-VWGF6IFR.cjs → chunk-JOH5D76X.cjs} +108 -108
- package/dist/chunk-JOH5D76X.cjs.map +1 -0
- package/dist/{chunk-7WM77CSW.js → chunk-JYI4R25Q.js} +5 -5
- package/dist/chunk-JYI4R25Q.js.map +1 -0
- package/dist/{chunk-M6QGB6DC.cjs → chunk-KUXGQ2FQ.cjs} +36 -36
- package/dist/chunk-KUXGQ2FQ.cjs.map +1 -0
- package/dist/{chunk-M3LD6DNE.cjs → chunk-LFWPWIAC.cjs} +16 -16
- package/dist/{chunk-M3LD6DNE.cjs.map → chunk-LFWPWIAC.cjs.map} +1 -1
- package/dist/{chunk-R46QEE3R.cjs → chunk-LUKRPHEW.cjs} +96 -96
- package/dist/chunk-LUKRPHEW.cjs.map +1 -0
- package/dist/{chunk-IMK6RUEC.cjs → chunk-PYR4LVAF.cjs} +10 -10
- package/dist/chunk-PYR4LVAF.cjs.map +1 -0
- package/dist/{chunk-2ELBNZJ3.js → chunk-QAG357PE.js} +7 -7
- package/dist/chunk-QAG357PE.js.map +1 -0
- package/dist/{chunk-N2TJ3HAM.cjs → chunk-QO6MCQYE.cjs} +9 -9
- package/dist/chunk-QO6MCQYE.cjs.map +1 -0
- package/dist/{chunk-EGRZHR7J.js → chunk-SM26C2L7.js} +9 -9
- package/dist/chunk-SM26C2L7.js.map +1 -0
- package/dist/{chunk-AUJXLVXA.cjs → chunk-TAQMYVO6.cjs} +42 -42
- package/dist/{chunk-AUJXLVXA.cjs.map → chunk-TAQMYVO6.cjs.map} +1 -1
- package/dist/{chunk-C3FH53AP.cjs → chunk-UFBUQO7Z.cjs} +19 -19
- package/dist/{chunk-C3FH53AP.cjs.map → chunk-UFBUQO7Z.cjs.map} +1 -1
- package/dist/{chunk-F7YVI54P.js → chunk-W3JZXLJ2.js} +10 -10
- package/dist/chunk-W3JZXLJ2.js.map +1 -0
- package/dist/{chunk-WZ6TCAYQ.cjs → chunk-XMCVUYKC.cjs} +14 -14
- package/dist/chunk-XMCVUYKC.cjs.map +1 -0
- package/dist/{chunk-P7PISHM5.js → chunk-Y3NFB6HR.js} +5 -5
- package/dist/chunk-Y3NFB6HR.js.map +1 -0
- package/dist/{chunk-PBTY7AH5.js → chunk-YZJUHEPZ.js} +95 -95
- package/dist/chunk-YZJUHEPZ.js.map +1 -0
- package/dist/{chunk-NQQ4NLUT.js → chunk-ZQYFDYWV.js} +4298 -4461
- package/dist/chunk-ZQYFDYWV.js.map +1 -0
- package/dist/components/case-studies/index.cjs +15 -15
- package/dist/components/case-studies/index.cjs.map +1 -1
- package/dist/components/case-studies/index.js +9 -9
- package/dist/components/case-studies/index.js.map +1 -1
- package/dist/components/chat/approval-request-message.d.ts.map +1 -1
- package/dist/components/chat/entity-cards/blog-card.d.ts.map +1 -1
- package/dist/components/chat/index.cjs +4 -4
- package/dist/components/chat/index.js +3 -3
- package/dist/components/chat/tool-call-blocks.d.ts.map +1 -1
- package/dist/components/chat/utils/compact-card-classes.d.ts +3 -3
- package/dist/components/chat/utils/compact-card-classes.d.ts.map +1 -1
- package/dist/components/contact/index.cjs +5 -5
- package/dist/components/contact/index.js +4 -4
- package/dist/components/docs/index.cjs +7 -7
- package/dist/components/docs/index.js +6 -6
- package/dist/components/embeds/index.cjs +5 -5
- package/dist/components/embeds/index.js +4 -4
- package/dist/components/faq/index.cjs +6 -6
- package/dist/components/faq/index.js +5 -5
- package/dist/components/features/index.cjs +4 -4
- package/dist/components/features/index.js +3 -3
- package/dist/components/help-center-pages/index.cjs +23 -23
- package/dist/components/help-center-pages/index.js +14 -14
- package/dist/components/index.cjs +262 -256
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +117 -111
- package/dist/components/index.js.map +1 -1
- package/dist/components/msp-display.d.ts.map +1 -1
- package/dist/components/navigation/index.cjs +4 -4
- package/dist/components/navigation/index.js +3 -3
- package/dist/components/navigation/sticky-section-nav.d.ts.map +1 -1
- package/dist/components/onboarding-guides/index.cjs +8 -8
- package/dist/components/onboarding-guides/index.js +7 -7
- package/dist/components/pricing-display.d.ts +9 -9
- package/dist/components/related-content/index.cjs +6 -6
- package/dist/components/related-content/index.js +5 -5
- package/dist/components/tickets/index.cjs +7 -7
- package/dist/components/tickets/index.js +6 -6
- package/dist/components/toast/index.cjs +5 -5
- package/dist/components/toast/index.cjs.map +1 -1
- package/dist/components/toast/index.js +5 -5
- package/dist/components/toast/index.js.map +1 -1
- package/dist/components/ui/bullet-list.d.ts.map +1 -1
- package/dist/components/ui/drawer.d.ts +1 -1
- package/dist/components/ui/drawer.d.ts.map +1 -1
- package/dist/components/ui/file-manager/index.cjs +73 -73
- package/dist/components/ui/file-manager/index.cjs.map +1 -1
- package/dist/components/ui/file-manager/index.js +24 -24
- package/dist/components/ui/file-manager/index.js.map +1 -1
- package/dist/components/ui/index.cjs +4 -4
- package/dist/components/ui/index.js +3 -3
- package/dist/components/ui/markdown-editor.d.ts.map +1 -1
- package/dist/components/ui/square-avatar.d.ts +3 -0
- package/dist/components/ui/square-avatar.d.ts.map +1 -1
- package/dist/components/user-display.d.ts.map +1 -1
- package/dist/components/vendor-tag.d.ts.map +1 -1
- package/dist/hooks/index.cjs +2 -2
- package/dist/hooks/index.js +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.js +3 -3
- package/dist/tailwind.config.cjs +38 -5
- package/dist/tailwind.config.cjs.map +1 -1
- package/dist/tailwind.config.js +38 -5
- package/dist/tailwind.config.js.map +1 -1
- package/package.json +1 -1
- package/src/ODS_TOKEN_RULES.md +5 -0
- package/src/components/.footer.md +2 -2
- package/src/components/announcement-bar.tsx +1 -1
- package/src/components/authors/author-detail-view.tsx +3 -3
- package/src/components/calendar.tsx +2 -2
- package/src/components/case-studies/share-experience-section.tsx +5 -5
- package/src/components/categories-cart.tsx +6 -6
- package/src/components/category-card.tsx +5 -5
- package/src/components/chart.tsx +3 -3
- package/src/components/chat/approval-request-message.tsx +2 -5
- package/src/components/chat/chat-attachment-bar.tsx +3 -3
- package/src/components/chat/chat-message-enhanced.tsx +1 -1
- package/src/components/chat/chat-message-list.tsx +1 -1
- package/src/components/chat/chat-message-row.tsx +3 -3
- package/src/components/chat/chat-quick-action.tsx +1 -1
- package/src/components/chat/chat-sidebar-skeleton.tsx +1 -1
- package/src/components/chat/chat-sidebar.tsx +6 -6
- package/src/components/chat/chat-typing-indicator.tsx +1 -1
- package/src/components/chat/context-compaction-display.tsx +1 -1
- package/src/components/chat/embeddable-chat.tsx +3 -3
- package/src/components/chat/entity-cards/admin-content-card.tsx +5 -5
- package/src/components/chat/entity-cards/blog-card.tsx +5 -8
- package/src/components/chat/entity-cards/case-study-card.tsx +5 -5
- package/src/components/chat/entity-cards/chat-ticket-item.tsx +1 -1
- package/src/components/chat/entity-cards/customer-interview-card.tsx +9 -9
- package/src/components/chat/entity-cards/data-room-doc-card.tsx +2 -2
- package/src/components/chat/entity-cards/dispatch.tsx +1 -1
- package/src/components/chat/entity-cards/entity-author-card.tsx +3 -3
- package/src/components/chat/entity-cards/entity-portrait-card.tsx +4 -4
- package/src/components/chat/entity-cards/generic-entity-card.tsx +3 -3
- package/src/components/chat/entity-cards/github-activity-card.tsx +11 -11
- package/src/components/chat/entity-cards/hubspot-ticket-card.tsx +5 -5
- package/src/components/chat/entity-cards/investor-update-card.tsx +1 -1
- package/src/components/chat/entity-cards/onboarding-guide-card.tsx +12 -12
- package/src/components/chat/entity-cards/program-card.tsx +12 -12
- package/src/components/chat/entity-cards/roadmap-card.tsx +6 -6
- package/src/components/chat/entity-cards/roadmap-vote-button.tsx +1 -1
- package/src/components/chat/entity-cards/slack-message-card.tsx +4 -4
- package/src/components/chat/error-message-display.tsx +2 -2
- package/src/components/chat/mingo-info-card.tsx +2 -2
- package/src/components/chat/model-display.tsx +7 -7
- package/src/components/chat/quick-action-chip.tsx +1 -1
- package/src/components/chat/source-action-button.tsx +2 -2
- package/src/components/chat/tool-call-blocks.tsx +3 -5
- package/src/components/chat/utils/.chip-action-class.md +1 -1
- package/src/components/chat/utils/.chip-styles.md +2 -2
- package/src/components/chat/utils/chip-action-class.ts +1 -1
- package/src/components/chat/utils/chip-styles.ts +2 -2
- package/src/components/chat/utils/compact-card-classes.ts +3 -3
- package/src/components/command.tsx +3 -3
- package/src/components/comment-card.tsx +1 -1
- package/src/components/contact/contact-form.tsx +9 -9
- package/src/components/context-menu.tsx +5 -5
- package/src/components/date-time-picker.tsx +2 -2
- package/src/components/docs/doc-viewer.tsx +4 -4
- package/src/components/embeds/figma-embed.tsx +2 -2
- package/src/components/embeds/file-download-card.tsx +2 -2
- package/src/components/embeds/google-sheets-viewer.tsx +1 -1
- package/src/components/embeds/linkedin-embed-client.tsx +3 -3
- package/src/components/embeds/og-link-preview.tsx +14 -14
- package/src/components/embeds/pdf-viewer.tsx +1 -1
- package/src/components/embeds/reddit-embed-client.tsx +9 -9
- package/src/components/embeds/twitter-embed-client.tsx +9 -9
- package/src/components/empty-state.tsx +5 -5
- package/src/components/faq/faq-section.tsx +1 -1
- package/src/components/features/ai-enrich/AIEnrichSection.tsx +14 -14
- package/src/components/features/ai-enrich/AIRequiredBadge.tsx +5 -5
- package/src/components/features/ai-enrich/AIStatusIndicator.tsx +8 -8
- package/src/components/features/ai-enrich/AIWarningsSection.tsx +4 -4
- package/src/components/features/ai-enrich/ConfidenceBadge.tsx +4 -4
- package/src/components/features/array-entry-manager.tsx +7 -7
- package/src/components/features/auth-providers-list.tsx +1 -1
- package/src/components/features/board/ticket-card.tsx +1 -1
- package/src/components/features/changelog-manager.tsx +10 -10
- package/src/components/features/command-box.tsx +2 -2
- package/src/components/features/entity-summary-editor.tsx +3 -3
- package/src/components/features/figma-prototype-viewer.tsx +9 -9
- package/src/components/features/filters-dropdown.tsx +2 -2
- package/src/components/features/highlight-config-section.tsx +3 -3
- package/src/components/features/highlight-video-combined-section.tsx +2 -2
- package/src/components/features/highlight-video-preview.tsx +2 -2
- package/src/components/features/highlight-video-section.tsx +9 -9
- package/src/components/features/media-gallery-manager.tsx +14 -14
- package/src/components/features/og-editor-preview.tsx +4 -4
- package/src/components/features/os-type-badge-group.tsx +1 -1
- package/src/components/features/os-type-badge.tsx +2 -2
- package/src/components/features/platform-badge.tsx +4 -4
- package/src/components/features/policy-configuration-panel.tsx +6 -6
- package/src/components/features/provider-button.tsx +1 -1
- package/src/components/features/push-button-selector.tsx +21 -21
- package/src/components/features/release-media-manager.tsx +16 -16
- package/src/components/features/section-selector.tsx +8 -8
- package/src/components/features/select-button.tsx +4 -4
- package/src/components/features/seo-editor-preview.tsx +20 -20
- package/src/components/features/social-links-manager.tsx +3 -3
- package/src/components/features/start-with-openframe-button.tsx +3 -3
- package/src/components/features/status-filter-component.tsx +1 -1
- package/src/components/features/tags-selector.tsx +6 -6
- package/src/components/features/transcript-summary-editor.tsx +9 -9
- package/src/components/features/video-bites-strip.tsx +1 -1
- package/src/components/features/video-ratio-tabs.tsx +1 -1
- package/src/components/features/video-source-selector.tsx +7 -7
- package/src/components/features/video.tsx +1 -1
- package/src/components/features/waitlist-form.tsx +3 -3
- package/src/components/filter-chip.tsx +13 -13
- package/src/components/footer.tsx +3 -3
- package/src/components/form.tsx +2 -2
- package/src/components/hero-image-uploader.tsx +3 -3
- package/src/components/image-cropper.tsx +2 -2
- package/src/components/layout/page-container.tsx +6 -6
- package/src/components/layout/page-heading.tsx +1 -1
- package/src/components/loading/card-skeleton.tsx +2 -2
- package/src/components/loading/category-card-skeleton.tsx +1 -1
- package/src/components/loading/margin-report-skeleton.tsx +22 -22
- package/src/components/loading/openmsp-heartbeat.tsx +1 -1
- package/src/components/loading/page-layout-skeleton.tsx +83 -83
- package/src/components/loading/unified-skeleton.tsx +1 -1
- package/src/components/loading/users-grid-skeleton.tsx +2 -2
- package/src/components/logs-list.tsx +8 -8
- package/src/components/media-carousel.tsx +7 -7
- package/src/components/metric-value.tsx +2 -2
- package/src/components/msp-display.tsx +8 -2
- package/src/components/navigation/app-header.tsx +6 -6
- package/src/components/navigation/header-organization-filter.tsx +2 -2
- package/src/components/navigation/header.tsx +4 -4
- package/src/components/navigation/mobile-burger-menu.tsx +7 -7
- package/src/components/navigation/mobile-nav-panel.tsx +1 -1
- package/src/components/navigation/multi-level-navigation.tsx +7 -7
- package/src/components/navigation/navigation-sidebar.tsx +1 -1
- package/src/components/navigation/sticky-section-nav.tsx +2 -2
- package/src/components/onboarding-guides/onboarding-guides-catalog-view.tsx +4 -4
- package/src/components/pagination.tsx +2 -2
- package/src/components/persistent-filter-controls.tsx +1 -1
- package/src/components/platform/.ShellTypeBadge.md +1 -1
- package/src/components/platform/CveLink.tsx +1 -1
- package/src/components/platform/ScriptArguments.tsx +2 -2
- package/src/components/platform/ScriptInfoSection.tsx +5 -5
- package/src/components/platform/ShellTypeBadge.tsx +6 -6
- package/src/components/platform/SoftwareInfo.tsx +2 -2
- package/src/components/pricing-display.tsx +9 -9
- package/src/components/profile/ProfileLoadingSkeleton.tsx +6 -6
- package/src/components/related-content/related-content-section.tsx +3 -3
- package/src/components/results-count.tsx +1 -1
- package/src/components/shared/delivery/delivery-row.tsx +1 -1
- package/src/components/shared/delivery/delivery-table.tsx +1 -1
- package/src/components/shared/dev-section/dev-section-view.tsx +1 -1
- package/src/components/shared/doc-search/doc-search-result-row.tsx +2 -2
- package/src/components/shared/legal-document/legal-document-page.tsx +5 -5
- package/src/components/shared/onboarding/onboarding-step-card.tsx +1 -1
- package/src/components/shared/product-release/product-release-card-skeleton.tsx +3 -3
- package/src/components/shared/product-release/product-release-card.tsx +14 -14
- package/src/components/shared/product-release/release-detail-page.tsx +16 -16
- package/src/components/shared/roadmap/roadmap-grid.tsx +2 -2
- package/src/components/smooth-accordion.tsx +1 -1
- package/src/components/social-icon-row.tsx +1 -1
- package/src/components/sonner.tsx +5 -5
- package/src/components/steps.tsx +3 -3
- package/src/components/tickets/help-center-create-form.tsx +1 -1
- package/src/components/tickets/help-center-list.tsx +1 -1
- package/src/components/tickets/ticket-center.tsx +2 -2
- package/src/components/tickets/ticket-detail-drawer.tsx +5 -5
- package/src/components/tickets/ticket-open-form.tsx +6 -6
- package/src/components/ui/.title-content-block.md +1 -1
- package/src/components/ui/accordion.tsx +2 -2
- package/src/components/ui/actions-menu.tsx +1 -1
- package/src/components/ui/alert-dialog.tsx +3 -3
- package/src/components/ui/alert.tsx +2 -2
- package/src/components/ui/allowed-domains-input.tsx +3 -3
- package/src/components/ui/autocomplete.tsx +3 -3
- package/src/components/ui/badge.tsx +2 -2
- package/src/components/ui/brand-association-card.tsx +2 -2
- package/src/components/ui/breadcrumb.tsx +3 -3
- package/src/components/ui/bullet-list.tsx +2 -2
- package/src/components/ui/button/button.tsx +1 -1
- package/src/components/ui/card.tsx +4 -4
- package/src/components/ui/checkbox-with-description.tsx +1 -1
- package/src/components/ui/chevron-button.tsx +1 -1
- package/src/components/ui/content-loader.tsx +16 -16
- package/src/components/ui/cursor-pagination.tsx +1 -1
- package/src/components/ui/date-picker.tsx +2 -2
- package/src/components/ui/device-card-compact.tsx +2 -2
- package/src/components/ui/device-card.tsx +3 -3
- package/src/components/ui/dialog.tsx +3 -3
- package/src/components/ui/drawer.tsx +4 -4
- package/src/components/ui/dropdown-menu.tsx +6 -6
- package/src/components/ui/error-state.tsx +9 -9
- package/src/components/ui/fade-preview.tsx +1 -1
- package/src/components/ui/field-wrapper.tsx +1 -1
- package/src/components/ui/file-manager/file-manager-breadcrumb.tsx +2 -2
- package/src/components/ui/file-manager/file-manager-empty.tsx +3 -3
- package/src/components/ui/file-manager/file-manager-skeleton.tsx +4 -4
- package/src/components/ui/file-manager/file-manager-table-row.tsx +7 -7
- package/src/components/ui/file-manager/file-manager-table.tsx +8 -8
- package/src/components/ui/file-upload.tsx +9 -9
- package/src/components/ui/filter-pill-row.tsx +1 -1
- package/src/components/ui/floating-tooltip.tsx +1 -1
- package/src/components/ui/highlight-card.tsx +1 -1
- package/src/components/ui/hover-dropdown.tsx +1 -1
- package/src/components/ui/image-gallery-modal.tsx +1 -1
- package/src/components/ui/info-row.tsx +1 -1
- package/src/components/ui/input.tsx +1 -1
- package/src/components/ui/label.tsx +5 -5
- package/src/components/ui/markdown-editor.tsx +4 -5
- package/src/components/ui/menubar.tsx +7 -7
- package/src/components/ui/modal-v2.tsx +1 -1
- package/src/components/ui/modal.tsx +1 -1
- package/src/components/ui/more-actions-menu.tsx +1 -1
- package/src/components/ui/navigation-menu.tsx +1 -1
- package/src/components/ui/organization-card.tsx +8 -8
- package/src/components/ui/page-loader.tsx +6 -6
- package/src/components/ui/phone-input.tsx +1 -1
- package/src/components/ui/progress-bar.tsx +5 -5
- package/src/components/ui/query-report-table/.query-report-table-header.md +1 -1
- package/src/components/ui/query-report-table/query-report-table-header.tsx +1 -1
- package/src/components/ui/query-report-table/query-report-table-row.tsx +2 -2
- package/src/components/ui/query-report-table/query-report-table.tsx +1 -1
- package/src/components/ui/release-changelog-section.tsx +2 -2
- package/src/components/ui/rich-markdown-renderer.tsx +6 -6
- package/src/components/ui/search-input.tsx +7 -7
- package/src/components/ui/select.tsx +1 -1
- package/src/components/ui/service-card.tsx +4 -4
- package/src/components/ui/sheet.tsx +3 -3
- package/src/components/ui/simple-markdown-renderer.tsx +4 -4
- package/src/components/ui/square-avatar.tsx +9 -5
- package/src/components/ui/status-badge.tsx +11 -11
- package/src/components/ui/status-indicator.tsx +6 -6
- package/src/components/ui/tab-content.tsx +1 -1
- package/src/components/ui/tab-navigation.tsx +2 -2
- package/src/components/ui/table/table-column-filter-dropdown.tsx +1 -1
- package/src/components/ui/table/table-description-cell.tsx +1 -1
- package/src/components/ui/table/table-timestamp-cell.tsx +1 -1
- package/src/components/ui/table/table.tsx +2 -2
- package/src/components/ui/tabs.tsx +1 -1
- package/src/components/ui/tag-search-input.tsx +1 -1
- package/src/components/ui/tag.tsx +23 -23
- package/src/components/ui/tags-input.tsx +2 -2
- package/src/components/ui/ticket-status-tag.tsx +1 -1
- package/src/components/ui/toaster.tsx +8 -8
- package/src/components/ui/toggle.tsx +1 -1
- package/src/components/ui/tooltip.tsx +1 -1
- package/src/components/user-display.tsx +12 -6
- package/src/components/user-summary-stub.tsx +4 -4
- package/src/components/vendor-display-button.tsx +2 -2
- package/src/components/vendor-icon.tsx +1 -1
- package/src/components/vendor-tag.tsx +9 -10
- package/src/components/yes-no-display.tsx +3 -3
- package/src/styles/ods-colors.css +2 -0
- package/tailwind.config.ts +49 -4
- package/dist/chunk-2ELBNZJ3.js.map +0 -1
- package/dist/chunk-3WJQL4DN.cjs.map +0 -1
- package/dist/chunk-4ACSUJ7Q.js.map +0 -1
- package/dist/chunk-7WM77CSW.js.map +0 -1
- package/dist/chunk-COMBYYQY.js.map +0 -1
- package/dist/chunk-EGRZHR7J.js.map +0 -1
- package/dist/chunk-F7YVI54P.js.map +0 -1
- package/dist/chunk-G5FALXNO.js.map +0 -1
- package/dist/chunk-HTVVXVJL.cjs.map +0 -1
- package/dist/chunk-IAN7GUIV.cjs.map +0 -1
- package/dist/chunk-IMK6RUEC.cjs.map +0 -1
- package/dist/chunk-M6QGB6DC.cjs.map +0 -1
- package/dist/chunk-N2TJ3HAM.cjs.map +0 -1
- package/dist/chunk-NQQ4NLUT.js.map +0 -1
- package/dist/chunk-P7PISHM5.js.map +0 -1
- package/dist/chunk-PBTY7AH5.js.map +0 -1
- package/dist/chunk-R46QEE3R.cjs.map +0 -1
- package/dist/chunk-RQQZF6G6.cjs.map +0 -1
- package/dist/chunk-RVWC4P3H.js.map +0 -1
- package/dist/chunk-VWGF6IFR.cjs.map +0 -1
- package/dist/chunk-WAGTZVQN.js.map +0 -1
- package/dist/chunk-WZ6TCAYQ.cjs.map +0 -1
- package/dist/components/accordion.d.ts +0 -8
- package/dist/components/accordion.d.ts.map +0 -1
- package/dist/components/alert-dialog.d.ts +0 -21
- package/dist/components/alert-dialog.d.ts.map +0 -1
- package/dist/components/alert.d.ts +0 -9
- package/dist/components/alert.d.ts.map +0 -1
- package/dist/components/badge.d.ts +0 -10
- package/dist/components/badge.d.ts.map +0 -1
- package/dist/components/breadcrumb.d.ts +0 -20
- package/dist/components/breadcrumb.d.ts.map +0 -1
- package/dist/components/chevron-button.d.ts +0 -14
- package/dist/components/chevron-button.d.ts.map +0 -1
- package/dist/components/dialog.d.ts +0 -29
- package/dist/components/dialog.d.ts.map +0 -1
- package/dist/components/dropdown-menu.d.ts +0 -28
- package/dist/components/dropdown-menu.d.ts.map +0 -1
- package/dist/components/input.d.ts +0 -8
- package/dist/components/input.d.ts.map +0 -1
- package/dist/components/label.d.ts +0 -6
- package/dist/components/label.d.ts.map +0 -1
- package/dist/components/menubar.d.ts +0 -34
- package/dist/components/menubar.d.ts.map +0 -1
- package/dist/components/navigation-menu.d.ts +0 -13
- package/dist/components/navigation-menu.d.ts.map +0 -1
- package/dist/components/select.d.ts +0 -14
- package/dist/components/select.d.ts.map +0 -1
- package/dist/components/sidebar.d.ts +0 -67
- package/dist/components/sidebar.d.ts.map +0 -1
- package/dist/components/square-avatar.d.ts +0 -21
- package/dist/components/square-avatar.d.ts.map +0 -1
- package/dist/components/table.d.ts +0 -11
- package/dist/components/table.d.ts.map +0 -1
- package/dist/components/tabs.d.ts +0 -18
- package/dist/components/tabs.d.ts.map +0 -1
- package/dist/components/toggle.d.ts +0 -13
- package/dist/components/toggle.d.ts.map +0 -1
- package/src/components/.accordion.md +0 -42
- package/src/components/.alert-dialog.md +0 -58
- package/src/components/.alert.md +0 -43
- package/src/components/.badge.md +0 -40
- package/src/components/.breadcrumb.md +0 -54
- package/src/components/.chevron-button.md +0 -46
- package/src/components/.dialog.md +0 -60
- package/src/components/.dropdown-menu.md +0 -51
- package/src/components/.input.md +0 -40
- package/src/components/.label.md +0 -41
- package/src/components/.menubar.md +0 -49
- package/src/components/.navigation-menu.md +0 -44
- package/src/components/.select.md +0 -54
- package/src/components/.sidebar.md +0 -58
- package/src/components/.square-avatar.md +0 -42
- package/src/components/.table.md +0 -51
- package/src/components/.tabs.md +0 -38
- package/src/components/.toggle.md +0 -49
- package/src/components/accordion.tsx +0 -56
- package/src/components/alert-dialog.tsx +0 -141
- package/src/components/alert.tsx +0 -59
- package/src/components/badge.tsx +0 -30
- package/src/components/breadcrumb.tsx +0 -115
- package/src/components/chevron-button.tsx +0 -68
- package/src/components/dialog.tsx +0 -150
- package/src/components/dropdown-menu.tsx +0 -200
- package/src/components/input.tsx +0 -39
- package/src/components/label.tsx +0 -19
- package/src/components/menubar.tsx +0 -236
- package/src/components/navigation-menu.tsx +0 -128
- package/src/components/select.tsx +0 -160
- package/src/components/sidebar.tsx +0 -764
- package/src/components/square-avatar.tsx +0 -61
- package/src/components/table.tsx +0 -72
- package/src/components/tabs.tsx +0 -65
- package/src/components/toggle.tsx +0 -45
- /package/dist/{chunk-QXYOGJQJ.js.map → chunk-7KDR5P23.js.map} +0 -0
- /package/dist/{chunk-PEIR7D25.js.map → chunk-7KNOHGMI.js.map} +0 -0
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
import {
|
|
3
3
|
ArticleAuthorByline,
|
|
4
4
|
DetailPageSkeleton
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-7KNOHGMI.js";
|
|
6
6
|
import {
|
|
7
7
|
DocSearchBar,
|
|
8
8
|
useDocSearch
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-JYI4R25Q.js";
|
|
10
10
|
import {
|
|
11
11
|
useSelfFetch
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-7KDR5P23.js";
|
|
13
13
|
import {
|
|
14
14
|
EntityAuthorCard,
|
|
15
15
|
EntityTagBadges,
|
|
@@ -26,10 +26,10 @@ import {
|
|
|
26
26
|
resolveContentHref,
|
|
27
27
|
toStripProfile,
|
|
28
28
|
useVideoWarmup
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-ZQYFDYWV.js";
|
|
30
30
|
import {
|
|
31
31
|
buildOgPlaceholderUrl
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-2BTDPDME.js";
|
|
33
33
|
import {
|
|
34
34
|
useChatRuntime
|
|
35
35
|
} from "./chunk-KFQXO7QB.js";
|
|
@@ -190,12 +190,12 @@ function OnboardingGuidesCatalogView({
|
|
|
190
190
|
preControls,
|
|
191
191
|
guides.length === 0 ? /* @__PURE__ */ jsxs2("div", { className: "text-center py-16", children: [
|
|
192
192
|
/* @__PURE__ */ jsx2(GraduationCap, { className: "h-12 w-12 text-ods-text-secondary mx-auto mb-4" }),
|
|
193
|
-
/* @__PURE__ */ jsx2("h2", { className: "text-ods-text-primary
|
|
194
|
-
/* @__PURE__ */ jsx2("p", { className: "text-ods-text-secondary
|
|
193
|
+
/* @__PURE__ */ jsx2("h2", { className: "text-ods-text-primary text-h3 mb-2", children: "No onboarding guides found" }),
|
|
194
|
+
/* @__PURE__ */ jsx2("p", { className: "text-ods-text-secondary text-h6", children: activeSection !== "all" ? "No guides in this section yet." : "We're working on the onboarding library. Check back soon." })
|
|
195
195
|
] }) : /* @__PURE__ */ jsx2("div", { className: isPending || isLoading ? "opacity-60 transition-opacity space-y-10" : "space-y-10", children: grouped.map((sec) => /* @__PURE__ */ jsxs2("section", { className: "space-y-4", children: [
|
|
196
|
-
/* @__PURE__ */ jsxs2("h2", { className: "text-h3
|
|
196
|
+
/* @__PURE__ */ jsxs2("h2", { className: "text-h3 text-ods-text-primary flex items-center gap-2", children: [
|
|
197
197
|
sec.section,
|
|
198
|
-
/* @__PURE__ */ jsx2("span", { className: "inline-flex items-center justify-center rounded-full bg-ods-text-secondary/20 text-ods-text-secondary text-
|
|
198
|
+
/* @__PURE__ */ jsx2("span", { className: "inline-flex items-center justify-center rounded-full bg-ods-text-secondary/20 text-ods-text-secondary text-h6 px-2 py-0.5", children: sec.guides.length })
|
|
199
199
|
] }),
|
|
200
200
|
/* @__PURE__ */ jsx2("ul", { className: "flex flex-col gap-4", children: sec.guides.map((guide) => /* @__PURE__ */ jsx2("li", { children: renderCardFn(guide) }, guide.id)) })
|
|
201
201
|
] }, sec.section)) })
|
|
@@ -395,4 +395,4 @@ export {
|
|
|
395
395
|
useOnboardingGuide,
|
|
396
396
|
useOnboardingGuideSections
|
|
397
397
|
};
|
|
398
|
-
//# sourceMappingURL=chunk-
|
|
398
|
+
//# sourceMappingURL=chunk-W3JZXLJ2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/onboarding-guides/onboarding-guides-catalog-view.tsx","../src/components/onboarding-guides/onboarding-guides-catalog-skeleton.tsx","../src/components/onboarding-guides/onboarding-guide-detail-view.tsx","../src/components/onboarding-guides/hooks/use-onboarding-guides.ts"],"sourcesContent":["'use client'\n\n/**\n * Public-facing catalog view for `/onboarding-guides`.\n *\n * Two data modes:\n * - **controlled** (hub SSR): pass `initialGuides` + `initialSections`\n * (server-fetched; section changes re-render the host with new props).\n * - **self-fetching** (config-only embed): omit the data props and pass\n * `guidesEndpoint` + `sectionsEndpoint` (the api routes). The view fetches\n * the guides (refetching on `?section=` change) + the section list itself —\n * no host data layer. (Plain fetch + useEffect, the DeliveryLists pattern.)\n *\n * The view renders ONLY its body + its OWN controls (the RAG `<DocSearchBar>` +\n * dynamic section pills — onboarding's controls are content-driven, unlike the\n * static search/filter the `DevSectionView` chrome ships). It does NOT render the\n * page chrome: the CALLER wraps it in `<DevSectionPage sectionKey=\"onboarding\">`\n * (hero + back button), exactly like the roadmap / releases / delivery pages — so\n * every dev-center surface composes the same way and the view stays embeddable in\n * tabbed contexts. Card hrefs flow through `runtime.composeContentUrl`.\n */\n\nimport { useMemo, useTransition, type ReactNode } from 'react'\nimport { GraduationCap } from 'lucide-react'\n\nimport { useRouter, useSearchParams } from '../../embed-shims'\nimport { useSelfFetch } from '../../hooks/use-self-fetch'\nimport { DocSearchBar, useDocSearch } from '../shared/doc-search'\nimport { FilterPillRow } from '../ui/filter-pill-row'\nimport { LoadError } from '../ui/error-state'\nimport { OnboardingGuideCard } from '../chat/entity-cards/onboarding-guide-card'\nimport { OnboardingGuidesCatalogSkeleton } from './onboarding-guides-catalog-skeleton'\nimport { useChatRuntime } from '../../contexts/chat-runtime-context'\nimport type { OnboardingGuide } from '../chat/types/entities/onboarding-guide'\nimport { resolveContentHref } from '../../utils/content-href'\n\ntype SectionSummary = { section: string; section_order: number; count: number }\n\nexport interface OnboardingGuidesCatalogViewProps {\n /** Controlled / SSR: server-fetched guides. Omit + pass `guidesEndpoint`\n * for the self-fetching config-only mode. */\n initialGuides?: OnboardingGuide[]\n initialSections?: SectionSummary[]\n initialSection?: string\n /** Self-fetch: GET list endpoint (the api route). Appends `?section=`. */\n guidesEndpoint?: string\n /** Self-fetch: GET section-summary endpoint (the api route). */\n sectionsEndpoint?: string\n /** Optional per-row card renderer override. */\n renderCard?: (guide: OnboardingGuide) => ReactNode\n /** Base path the catalog is mounted under (fallback href prefix + `?section=`\n * push target). Default `/onboarding-guides`. */\n basePath?: string\n}\n\nexport function OnboardingGuidesCatalogView({\n initialGuides,\n initialSections,\n initialSection = '',\n guidesEndpoint,\n sectionsEndpoint,\n renderCard,\n basePath = '/onboarding-guides',\n}: OnboardingGuidesCatalogViewProps) {\n const router = useRouter()\n const searchParams = useSearchParams()\n const [isPending, startTransition] = useTransition()\n const runtime = useChatRuntime()\n\n // Self-fetch only when the host supplied NO data but DID give an endpoint.\n const selfFetch = initialGuides === undefined && guidesEndpoint !== undefined\n // Active section: from the URL when self-fetching, from the prop (host RSC\n // already read the URL server-side) when controlled.\n const sectionValue = selfFetch ? searchParams.get('section') ?? '' : initialSection\n const activeSection = sectionValue || 'all'\n\n // Self-fetch the guides (refetched whenever `?section=` changes — it's folded\n // into the url) + the section summaries. Controlled mode passes `null` urls so\n // the hook never fetches. The guides fetch carries the error/retry affordance.\n const guidesQs = sectionValue ? `?section=${encodeURIComponent(sectionValue)}` : ''\n const guidesRes = useSelfFetch<{ data?: OnboardingGuide[] }>(\n selfFetch && guidesEndpoint ? `${guidesEndpoint}${guidesQs}` : null,\n )\n const sectionsRes = useSelfFetch<SectionSummary[]>(\n selfFetch && sectionsEndpoint ? sectionsEndpoint : null,\n )\n\n // Invariant: `guidesRes.data` is `null` until the first fetch resolves, then\n // `{ data: [...] }`. The `?.data ?? []` chain collapses never-fetched (null) and\n // legitimately-empty ([]) to the same `[]` — so the first-load skeleton gate below\n // keys on the OUTER `guidesRes.data == null` to distinguish them (an empty section\n // toggle keeps the chrome; only a true cold start shows the full-page skeleton).\n const guides = initialGuides ?? guidesRes.data?.data ?? []\n const sections = initialSections ?? (Array.isArray(sectionsRes.data) ? sectionsRes.data : [])\n const isLoading = selfFetch ? guidesRes.isLoading : false\n\n // Section grouping. Data arrives already filtered (server-side `?section=`\n // for the host, or our `?section=` fetch); this just buckets visible rows.\n const grouped = useMemo(() => {\n const map = new Map<string, { section_order: number; guides: OnboardingGuide[] }>()\n for (const g of guides) {\n const existing = map.get(g.section)\n if (existing) {\n if (g.section_order < existing.section_order) existing.section_order = g.section_order\n existing.guides.push(g)\n } else {\n map.set(g.section, { section_order: g.section_order, guides: [g] })\n }\n }\n for (const entry of map.values()) {\n entry.guides.sort((a, b) => a.step_order - b.step_order || a.title.localeCompare(b.title))\n }\n return Array.from(map.entries())\n .map(([section, info]) => ({ section, ...info }))\n .sort((a, b) => a.section_order - b.section_order || a.section.localeCompare(b.section))\n }, [guides])\n\n const sectionFilterOptions = useMemo(\n () => [\n { value: 'all', label: `All (${guides.length})` },\n ...sections.map((s) => ({ value: s.section, label: `${s.section} (${s.count})` })),\n ],\n [guides.length, sections],\n )\n\n // Section pill change → push `?section=X`. Controlled mode: host RSC\n // re-fetches. Self-fetch mode: our guides effect re-fetches on the URL change.\n const setSection = (value: string) => {\n const params = new URLSearchParams(searchParams.toString())\n if (value === 'all') {\n params.delete('section')\n } else {\n params.set('section', value)\n }\n const qs = params.toString()\n startTransition(() => {\n router.push(qs ? `${basePath}?${qs}` : basePath)\n })\n }\n\n // Search bar — scoped to onboarding-guides only via RAG-search `tableIds`.\n const source = runtime?.source ?? 'openframe'\n const docSearch = useDocSearch({\n source,\n baseRoute: basePath,\n onNavigate: (path) => router.push(path),\n tableIds: ['onboarding-guides'],\n })\n\n // Per-row card renderer — runtime-composed href, fallback to relative.\n const defaultRenderCard = (guide: OnboardingGuide) => {\n const cta = resolveContentHref(runtime?.composeContentUrl, {\n type: 'onboarding_guide',\n slug: guide.slug,\n basePath,\n platforms: guide.onboarding_guide_platforms,\n })\n return (\n <OnboardingGuideCard\n guide={guide}\n href={cta.href}\n targetPlatform={cta.targetPlatform}\n size=\"catalog\"\n />\n )\n }\n const renderCardFn = renderCard ?? defaultRenderCard\n\n const preControls = (\n <div className=\"space-y-4\">\n <DocSearchBar\n placeholder=\"Search onboarding guides, releases, case studies…\"\n query={docSearch.query}\n onQueryChange={docSearch.setQuery}\n results={docSearch.results}\n isLoading={docSearch.isLoading}\n onResultSelect={docSearch.handleResultSelect}\n showDropdown={docSearch.keepDropdownOpen}\n />\n {sections.length > 0 && (\n <FilterPillRow\n label=\"Section\"\n selectedValue={activeSection}\n onValueChange={setSection}\n options={sectionFilterOptions}\n />\n )}\n </div>\n )\n\n // A failed guides fetch → a RETRYABLE error (not the indistinguishable-from-\n // empty \"no guides found\" state) — parity with the sibling self-fetch views.\n if (selfFetch && guidesRes.error) {\n return <LoadError message=\"Failed to load onboarding guides.\" onRetry={guidesRes.reload} />\n }\n // Full-page skeleton ONLY on the very first load (no data has loaded yet) — a\n // later section toggle that legitimately returns ZERO guides keeps the page\n // chrome (search + section pills) and dims the grid via the className below.\n if (selfFetch && guidesRes.data == null && isLoading) {\n return <OnboardingGuidesCatalogSkeleton />\n }\n\n return (\n <div className=\"w-full flex flex-col gap-10\">\n {preControls}\n {guides.length === 0 ? (\n <div className=\"text-center py-16\">\n <GraduationCap className=\"h-12 w-12 text-ods-text-secondary mx-auto mb-4\" />\n <h2 className=\"text-ods-text-primary text-h3 mb-2\">\n No onboarding guides found\n </h2>\n <p className=\"text-ods-text-secondary text-h6\">\n {activeSection !== 'all'\n ? 'No guides in this section yet.'\n : \"We're working on the onboarding library. Check back soon.\"}\n </p>\n </div>\n ) : (\n <div className={isPending || isLoading ? 'opacity-60 transition-opacity space-y-10' : 'space-y-10'}>\n {grouped.map((sec) => (\n <section key={sec.section} className=\"space-y-4\">\n <h2 className=\"text-h3 text-ods-text-primary flex items-center gap-2\">\n {sec.section}\n <span className=\"inline-flex items-center justify-center rounded-full bg-ods-text-secondary/20 text-ods-text-secondary text-h6 px-2 py-0.5\">\n {sec.guides.length}\n </span>\n </h2>\n {/* HORIZONTAL catalog list — single column so consecutive steps\n read top-to-bottom; a grid would visually reorder them. */}\n <ul className=\"flex flex-col gap-4\">\n {sec.guides.map((guide) => (\n <li key={guide.id}>{renderCardFn(guide)}</li>\n ))}\n </ul>\n </section>\n ))}\n </div>\n )}\n </div>\n )\n}\n","'use client'\n\nimport { OnboardingGuideCardSkeleton } from '../chat/entity-cards/onboarding-guide-card'\n\n/**\n * Loading skeleton for `/onboarding-guides` — CHROME-LESS, exactly like the\n * loaded `<OnboardingGuidesCatalogView>`. The HOST page owns the\n * `<DevSectionPage sectionKey=\"onboarding\">` shell (hero + back button);\n * this component renders only what replaces the view: the search/pill\n * placeholder block and the section card lists.\n *\n * HISTORY: this used to mount its own `<DevSectionPage>` — nested inside the\n * page's shell that double-rendered the hero + back button during loading\n * (the view was made chrome-less in the page restructure; the skeleton was\n * missed). Keep BOTH chrome-less.\n *\n * Wrapper mirrors the loaded view's `w-full flex flex-col gap-10`; per-card\n * height matches the loaded catalog card so resolve shifts are zero.\n */\nexport function OnboardingGuidesCatalogSkeleton() {\n return (\n <div className=\"w-full flex flex-col gap-10 animate-pulse\">\n {/* Search input placeholder — matches `<SearchInput>` h-12 — plus the\n section pill row (~74 px incl. padding), same as the loaded\n preControls block. */}\n <div className=\"space-y-4\">\n <div className=\"h-12 w-full bg-ods-card border border-ods-border rounded-md\" />\n <div className=\"flex flex-wrap items-center gap-3 p-4 bg-ods-card border border-ods-border rounded-lg\">\n <div className=\"h-4 w-14 bg-ods-border/60 rounded\" />\n {[0, 1, 2, 3].map((i) => (\n <div\n key={i}\n className=\"h-10 w-24 bg-ods-card border border-ods-border rounded-md\"\n />\n ))}\n </div>\n </div>\n <div className=\"space-y-10\">\n {[4, 3, 3].map((cardCount, sectionIdx) => (\n <section key={sectionIdx} className=\"space-y-4\">\n <h2 className=\"text-h3 tracking-[-0.36px] text-ods-text-primary flex items-center gap-2\">\n <span className=\"h-6 w-40 bg-ods-border/70 rounded\" />\n <span className=\"h-5 w-8 bg-ods-text-secondary/20 rounded-full\" />\n </h2>\n <ul className=\"flex flex-col gap-4\">\n {Array.from({ length: cardCount }).map((_, cardIdx) => (\n <li key={cardIdx}>\n <OnboardingGuideCardSkeleton size=\"catalog\" />\n </li>\n ))}\n </ul>\n </section>\n ))}\n </div>\n </div>\n )\n}\n","'use client'\n\n/**\n * Public-facing detail view for `/onboarding-guides/<slug>`.\n *\n * Two modes:\n * - **controlled** (hub SSR): pass `initialData` (a server-fetched guide).\n * - **self-fetching** (config-only embed): pass `slug` + `guideEndpoint`\n * (the api route) and the view fetches the guide itself — no host data\n * layer. (Plain fetch + useEffect, the DeliveryLists pattern.)\n *\n * Everything else flows through lib primitives + the ChatRuntime context\n * (markdown, video warmup, captions, related-card hrefs via\n * `runtime.composeContentUrl`). Optional `MarkdownRenderer` lets hosts swap a\n * renderer with extra plugins.\n */\n\nimport { type ComponentType, type ReactNode } from 'react'\nimport { PageLayout } from '../layout/page-layout'\n\nimport { useRouter } from '../../embed-shims'\n// PageShell (max-w-[1920px]) — the guide detail content must share the SAME\n// container sizing as the related-content/FAQ rail the host page renders\n// below it (which uses the wide shell). ArticleDetailLayout (1280px) made\n// the detail block visibly narrower than the rail.\nimport { PageShell } from '../layout/article-detail-layout'\nimport { DetailPageSkeleton } from '../shared/detail-page-skeleton'\nimport { EntityVideoSection } from '../features/entity-video-section'\nimport { VideoBitesStrip } from '../features/video-bites-strip'\nimport { toStripProfile } from '../features/video-bites-shared'\nimport { useVideoWarmup } from '../features/use-video-warmup'\nimport { getCaptionsUrl } from '../features/captions-url'\nimport { RichMarkdownRenderer } from '../ui/rich-markdown-renderer'\nimport { EntityTagBadges } from '../features/entity-tag-badges'\nimport { LoadError } from '../ui/error-state'\nimport { ArticleAuthorByline } from '../shared/article-author-byline'\nimport { EntityAuthorCard } from '../chat/entity-cards/entity-author-card'\nimport { OnboardingGuideCard } from '../chat/entity-cards/onboarding-guide-card'\nimport { useChatRuntime } from '../../contexts/chat-runtime-context'\nimport type { OnboardingGuide } from '../chat/types/entities/onboarding-guide'\nimport type { VideoTeaser } from '../../types/video-processing'\nimport { resolveContentHref } from '../../utils/content-href'\nimport { buildOgPlaceholderUrl } from '../../utils/og-placeholder'\nimport { useSelfFetch } from '../../hooks/use-self-fetch'\n\nexport interface OnboardingGuideDetailViewProps {\n /** Server-fetched guide (controlled / SSR mode). Omit it and pass\n * `slug` + `guideEndpoint` for the self-fetching config-only mode. */\n initialData?: OnboardingGuide\n /** Self-fetch: the guide's slug (the host reads it from its route). */\n slug?: string\n /** Self-fetch: builds the GET url for a single guide (the api route).\n * e.g. `(s) => \\`/content/api/onboarding-guides/${s}\\``. */\n guideEndpoint?: (slug: string) => string\n related?: OnboardingGuide[]\n /** Link target for the author name in the metadata grid — the host\n * computes it (public author page; absent ⇒ plain text). */\n authorHref?: string\n /** Bio paragraph for the end-of-article author byline. Defaults to the\n * guide payload's `author.about` (hubs that hydrate it can omit this). */\n authorBio?: string | null\n /** Byline fallback paragraph when the bio is empty — the host passes its\n * platform-aware copy (the lib has no config awareness). Absent ⇒ the\n * byline renders nothing below the name when the bio is empty. */\n fallbackBio?: string | null\n /** Optional markdown renderer override. Defaults to lib\n * `<RichMarkdownRenderer>`. */\n MarkdownRenderer?: ComponentType<{ content: string }>\n /** Optional per-row related-card renderer override. */\n renderRelatedCard?: (guide: OnboardingGuide) => ReactNode\n /** Back-link target. Defaults to `basePath`. */\n backHref?: string\n /** Back-link label. Defaults to \"Back to Getting Started\". */\n backLabel?: string\n /** Base path the related-card hrefs default to when\n * `runtime.composeContentUrl` is not wired. Default `/onboarding-guides`. */\n basePath?: string\n /** Optional slot rendered inside the page chrome, BELOW the article + related\n * guides — e.g. the hub's cross-type related-content / FAQ rail. Lets the hub\n * mount this view directly (no local wrapper); embedders omit it. */\n relatedContent?: ReactNode\n /** Render the standalone `<PageShell>`. Default true. Pass false when the host\n * layout already provides the page container — only the padding box renders,\n * avoiding a nested `<main>`. */\n shell?: boolean\n}\n\nexport function OnboardingGuideDetailView({\n authorHref,\n authorBio,\n fallbackBio,\n initialData,\n slug,\n guideEndpoint,\n related = [],\n MarkdownRenderer = RichMarkdownRenderer,\n renderRelatedCard,\n backHref,\n backLabel = 'Back to Getting Started',\n basePath = '/onboarding-guides',\n relatedContent,\n shell = true,\n}: OnboardingGuideDetailViewProps) {\n const resolvedBackHref = backHref ?? basePath\n const runtime = useChatRuntime()\n const router = useRouter()\n // `shell` true → standalone `<PageShell>`; false → padding-only box (no nested\n // <main>) for hosts whose layout already provides the container.\n const renderShell = (node: ReactNode) =>\n shell ? <PageShell>{node}</PageShell> : <div className=\"page-shell-content\">{node}</div>\n\n // Controlled (hub SSR `initialData`) OR self-fetch by slug (config-only embed).\n const url = initialData ? null : slug && guideEndpoint ? guideEndpoint(slug) : null\n const { data: guide, isLoading, error, reload } = useSelfFetch<OnboardingGuide>(url, { initialData })\n\n // Hooks must run unconditionally — feed them optional-chained values so they\n // no-op while the guide is still loading.\n const { ref: videoWarmupRef } = useVideoWarmup<HTMLDivElement>({\n videoUrl: guide?.main_video_url,\n supabaseStorageOrigin: runtime?.endpoints.supabaseStorageOrigin,\n })\n\n if (error || (!guide && !isLoading)) {\n return renderShell(<LoadError message=\"Guide not found.\" onRetry={reload} />)\n }\n if (!guide) {\n // Skeleton (not a bare \"Loading…\") for parity with every other shared view —\n // catalog, roadmap, releases all render a skeleton on first load, so the detail\n // page shouldn't flash text then content. `bare` + `PageShell` so the loading\n // state matches the loaded page's full width / padding / min-height.\n return renderShell(\n // Match the loaded page's top offset (TitleBlock's\n // `pt-[var(--spacing-system-l)]`) so content doesn't jump on load.\n <div className=\"pt-[var(--spacing-system-l)]\">\n <DetailPageSkeleton bare showImageGallery={false} />\n </div>\n )\n }\n\n const captionsUrl = getCaptionsUrl('onboarding_guide', guide.id, guide.srt_content)\n\n const videoPoster =\n guide.main_video_thumbnail ||\n guide.featured_image ||\n guide.og_image_url ||\n // `buildOgPlaceholderUrl` always returns a usable string (relative route at\n // worst), so it's the terminal fallback — no trailing `|| undefined` needed.\n buildOgPlaceholderUrl(runtime?.endpoints, guide.title, { aspect: 'wide' })\n\n const defaultRenderRelatedCard = (g: OnboardingGuide) => {\n const cta = resolveContentHref(runtime?.composeContentUrl, {\n type: 'onboarding_guide',\n slug: g.slug,\n basePath,\n platforms: g.onboarding_guide_platforms,\n })\n return <OnboardingGuideCard guide={g} href={cta.href} targetPlatform={cta.targetPlatform} />\n }\n const renderRelatedCardFn = renderRelatedCard ?? defaultRenderRelatedCard\n\n return renderShell(\n <PageLayout\n title={guide.title}\n titleSize=\"h1\"\n titleWrap\n backButton={{ label: backLabel, onClick: () => router.push(resolvedBackHref) }}\n >\n {/* Tags — flat onboarding_guide_tags[] from entity_tags. */}\n <EntityTagBadges tags={(guide as any).onboarding_guide_tags} />\n\n {/* Metadata grid — Section · Step | Published | Author. */}\n <EntityAuthorCard\n author={guide.author}\n authorHref={authorHref}\n publishedAt={guide.published_at}\n extraCells={[\n {\n value: `${guide.section} · Step ${guide.step_order}`,\n label: 'Section',\n uppercase: false,\n },\n ]}\n />\n\n {/* Video. `main_video_url` (Mux/MP4) and `youtube_url` are independent\n columns — either populated renders the player. */}\n {(guide.main_video_url || guide.youtube_url) && (\n <div ref={videoWarmupRef}>\n <EntityVideoSection\n mainVideoUrl={guide.main_video_url}\n youtubeUrl={guide.youtube_url || undefined}\n highlightVideoUrl={guide.highlight_video_url}\n mainVideoPoster={videoPoster}\n highlightVideoThumbnail={guide.highlight_video_thumbnail || undefined}\n videoSummary={undefined}\n videoBites={undefined}\n title={guide.title}\n srtContent={guide.srt_content}\n captionsUrl={captionsUrl}\n MarkdownRenderer={MarkdownRenderer}\n />\n </div>\n )}\n\n {/* Markdown body */}\n {guide.content && (\n <div className=\"space-y-4\">\n <MarkdownRenderer content={guide.content} />\n </div>\n )}\n\n {/* Video Bites — unified strip; renders nothing when no published bites. */}\n <VideoBitesStrip\n bites={(guide.video_bites as VideoTeaser[] | null) ?? []}\n filterPublished={true}\n showTitle={false}\n profile={toStripProfile(guide.author)}\n href={`/onboarding-guides/${guide.slug}`}\n />\n\n {/* End-of-article author byline (avatar + linked name + bio) — the\n author DESCRIPTION block every article-shaped detail page renders.\n Hidden when the guide has no author (the byline returns null). */}\n <ArticleAuthorByline\n author={guide.author?.full_name ?? null}\n avatar={guide.author?.avatar_url}\n jobTitle={guide.author?.job_title}\n bio={authorBio ?? guide.author?.about}\n href={authorHref}\n fallbackBio={fallbackBio}\n />\n\n {/* Related — same-section, ordered by step. */}\n {related.length > 0 && (\n <div className=\"space-y-4 pt-8 border-t border-ods-border\">\n <h2 className=\"text-h3 tracking-[-0.36px] text-ods-text-primary\">\n More in {guide.section}\n </h2>\n <ul className=\"flex flex-col gap-3\">\n {related.map((r) => (\n <li key={r.id}>{renderRelatedCardFn(r)}</li>\n ))}\n </ul>\n </div>\n )}\n\n {/* Host slot — cross-type related-content / FAQ rail. */}\n {relatedContent}\n </PageLayout>\n )\n}\n","'use client'\n\n/**\n * React Query hooks for Onboarding Guides — PUBLIC reads only.\n *\n * Admin mutations (create/update/delete/publish/stats/save-highlight)\n * stay HUB-side in `hooks/use-onboarding-guides.ts` and import the\n * `onboardingGuideKeys.admin` sub-namespace from this module so the\n * cache namespace `['onboarding-guides']` has a single source of truth.\n *\n * Endpoints (`/api/onboarding-guides*`) are host-supplied — non-Next.js\n * embedders must reverse-proxy the same routes. Same precedent as the\n * tickets list hook.\n */\n\nimport { useQuery } from '@tanstack/react-query'\n\nimport type {\n OnboardingGuide,\n OnboardingGuideFilters,\n OnboardingGuideListResponse,\n OnboardingGuideSectionSummary,\n} from '../../chat/types/entities/onboarding-guide'\n\n/**\n * Cache key builder for the `['onboarding-guides']` namespace.\n *\n * Includes BOTH public-read sub-keys (`lists`, `list`, `details`,\n * `detail`, `sections`) AND the `admin` sub-namespace. Admin mutations\n * live hub-side but invalidate against this same builder so a single\n * `qc.invalidateQueries({ queryKey: onboardingGuideKeys.all })` from\n * an admin hook also clears the public read cache.\n */\nexport const onboardingGuideKeys = {\n all: ['onboarding-guides'] as const,\n lists: () => [...onboardingGuideKeys.all, 'list'] as const,\n list: (filters: OnboardingGuideFilters) =>\n [...onboardingGuideKeys.lists(), filters] as const,\n details: () => [...onboardingGuideKeys.all, 'detail'] as const,\n detail: (slug: string) => [...onboardingGuideKeys.details(), slug] as const,\n sections: () => [...onboardingGuideKeys.all, 'sections'] as const,\n admin: {\n all: ['admin', 'onboarding-guides'] as const,\n lists: () => ['admin', 'onboarding-guides', 'list'] as const,\n detail: (slug: string) =>\n ['admin', 'onboarding-guide', slug] as const,\n stats: () => ['admin', 'onboarding-guides', 'stats'] as const,\n },\n}\n\nexport function useOnboardingGuides(filters?: OnboardingGuideFilters) {\n return useQuery({\n queryKey: onboardingGuideKeys.list(filters || {}),\n queryFn: async (): Promise<OnboardingGuideListResponse> => {\n const params = new URLSearchParams()\n if (filters?.search) params.set('search', filters.search)\n if (filters?.section) params.set('section', filters.section)\n if (filters?.limit) params.set('limit', filters.limit.toString())\n if (filters?.offset) params.set('offset', filters.offset.toString())\n const res = await fetch(`/api/onboarding-guides?${params}`)\n if (!res.ok) throw new Error('Failed to fetch onboarding guides')\n return res.json()\n },\n })\n}\n\nexport function useOnboardingGuide(slug: string | undefined) {\n return useQuery({\n queryKey: onboardingGuideKeys.detail(slug || ''),\n queryFn: async (): Promise<OnboardingGuide> => {\n const res = await fetch(`/api/onboarding-guides/${slug}`)\n if (!res.ok) throw new Error('Failed to fetch onboarding guide')\n return res.json()\n },\n enabled: !!slug,\n })\n}\n\nexport function useOnboardingGuideSections() {\n return useQuery({\n queryKey: onboardingGuideKeys.sections(),\n queryFn: async (): Promise<OnboardingGuideSectionSummary[]> => {\n const res = await fetch('/api/onboarding-guides/sections')\n if (!res.ok)\n throw new Error('Failed to fetch onboarding-guide sections')\n return res.json()\n },\n staleTime: 0,\n })\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,SAAS,SAAS,qBAAqC;AACvD,SAAS,qBAAqB;;;ACGtB,cACA,YADA;AAPD,SAAS,kCAAkC;AAChD,SACE,qBAAC,SAAI,WAAU,6CAIb;AAAA,yBAAC,SAAI,WAAU,aACb;AAAA,0BAAC,SAAI,WAAU,+DAA8D;AAAA,MAC7E,qBAAC,SAAI,WAAU,yFACb;AAAA,4BAAC,SAAI,WAAU,qCAAoC;AAAA,QAClD,CAAC,GAAG,GAAG,GAAG,CAAC,EAAE,IAAI,CAAC,MACjB;AAAA,UAAC;AAAA;AAAA,YAEC,WAAU;AAAA;AAAA,UADL;AAAA,QAEP,CACD;AAAA,SACH;AAAA,OACF;AAAA,IACA,oBAAC,SAAI,WAAU,cACZ,WAAC,GAAG,GAAG,CAAC,EAAE,IAAI,CAAC,WAAW,eACzB,qBAAC,aAAyB,WAAU,aAClC;AAAA,2BAAC,QAAG,WAAU,4EACZ;AAAA,4BAAC,UAAK,WAAU,qCAAoC;AAAA,QACpD,oBAAC,UAAK,WAAU,iDAAgD;AAAA,SAClE;AAAA,MACA,oBAAC,QAAG,WAAU,uBACX,gBAAM,KAAK,EAAE,QAAQ,UAAU,CAAC,EAAE,IAAI,CAAC,GAAG,YACzC,oBAAC,QACC,8BAAC,+BAA4B,MAAK,WAAU,KADrC,OAET,CACD,GACH;AAAA,SAXY,UAYd,CACD,GACH;AAAA,KACF;AAEJ;;;ADsGM,gBAAAA,MAWF,QAAAC,aAXE;AAvGC,SA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kCAAkC;AAC/D,aAAO,IAAI,KAAK;AAAA,IAClB;AAAA,IACA,SAAS,CAAC,CAAC;AAAA,EACb,CAAC;AACH;AAEO,SAAS,6BAA6B;AAC3C,SAAO,SAAS;AAAA,IACd,UAAU,oBAAoB,SAAS;AAAA,IACvC,SAAS,YAAsD;AAC7D,YAAM,MAAM,MAAM,MAAM,iCAAiC;AACzD,UAAI,CAAC,IAAI;AACP,cAAM,IAAI,MAAM,2CAA2C;AAC7D,aAAO,IAAI,KAAK;AAAA,IAClB;AAAA,IACA,WAAW;AAAA,EACb,CAAC;AACH;","names":["jsx","jsxs","jsx","jsxs"]}
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkDUQQEQ7Gcjs = require('./chunk-DUQQEQ7G.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunkQO6MCQYEcjs = require('./chunk-QO6MCQYE.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
var _chunk2B6773QMcjs = require('./chunk-2B6773QM.cjs');
|
|
@@ -34,7 +34,7 @@ function DocSearchResultRow({
|
|
|
34
34
|
}) {
|
|
35
35
|
const docType = _optionalChain([result, 'access', _ => _.metadata, 'optionalAccess', _2 => _2.documentType]) || void 0;
|
|
36
36
|
const sourceRepo = _optionalChain([result, 'access', _3 => _3.metadata, 'optionalAccess', _4 => _4.sourceRepo]) || void 0;
|
|
37
|
-
const { Icon: SourceIcon, label: iconLabel } =
|
|
37
|
+
const { Icon: SourceIcon, label: iconLabel } = _chunkDUQQEQ7Gcjs.resolveSourceIcon.call(void 0, {
|
|
38
38
|
sourceRepo,
|
|
39
39
|
documentType: docType
|
|
40
40
|
});
|
|
@@ -52,11 +52,11 @@ function DocSearchResultRow({
|
|
|
52
52
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
53
53
|
"div",
|
|
54
54
|
{
|
|
55
|
-
className: `text-
|
|
55
|
+
className: `text-h6 truncate ${isHighlighted ? "text-ods-accent" : "text-ods-text-primary"}`,
|
|
56
56
|
children: result.title || result.path
|
|
57
57
|
}
|
|
58
58
|
),
|
|
59
|
-
!isGroup && _optionalChain([result, 'access', _7 => _7.path, 'optionalAccess', _8 => _8.includes, 'call', _9 => _9("/")]) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-
|
|
59
|
+
!isGroup && _optionalChain([result, 'access', _7 => _7.path, 'optionalAccess', _8 => _8.includes, 'call', _9 => _9("/")]) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-h6 text-ods-text-secondary truncate mt-0.5", children: formatRelativePath(result.path) })
|
|
60
60
|
] })
|
|
61
61
|
] });
|
|
62
62
|
}
|
|
@@ -77,7 +77,7 @@ function DocSearchBar({
|
|
|
77
77
|
renderResult
|
|
78
78
|
}) {
|
|
79
79
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
80
|
-
|
|
80
|
+
_chunkDUQQEQ7Gcjs.SearchInput,
|
|
81
81
|
{
|
|
82
82
|
placeholder,
|
|
83
83
|
value: query,
|
|
@@ -186,7 +186,7 @@ function resolveSearchResultAction(result, source, runtimeMode) {
|
|
|
186
186
|
const externalUrl = meta.externalUrl;
|
|
187
187
|
if (externalUrl) {
|
|
188
188
|
const targetPlatform = meta.targetPlatform;
|
|
189
|
-
const isNewTab =
|
|
189
|
+
const isNewTab = _chunkDUQQEQ7Gcjs.decideNewTab.call(void 0, {
|
|
190
190
|
href: externalUrl,
|
|
191
191
|
targetPlatform,
|
|
192
192
|
surface: "useUnifiedNav",
|
|
@@ -231,7 +231,7 @@ function useDocSearch(config) {
|
|
|
231
231
|
const [query, setQuery] = _react.useState.call(void 0, "");
|
|
232
232
|
const [results, setResults] = _react.useState.call(void 0, []);
|
|
233
233
|
const [isFetching, setIsFetching] = _react.useState.call(void 0, false);
|
|
234
|
-
const debouncedQuery =
|
|
234
|
+
const debouncedQuery = _chunkQO6MCQYEcjs.useDebounce.call(void 0, query, 300);
|
|
235
235
|
_react.useEffect.call(void 0, () => {
|
|
236
236
|
if (!debouncedQuery || debouncedQuery.trim().length < 2) {
|
|
237
237
|
setResults([]);
|
|
@@ -248,7 +248,7 @@ function useDocSearch(config) {
|
|
|
248
248
|
limit: "10"
|
|
249
249
|
});
|
|
250
250
|
if (tableIdsKey) params.set("tableIds", tableIdsKey);
|
|
251
|
-
const response = await
|
|
251
|
+
const response = await _chunkQO6MCQYEcjs.contentFetch.call(void 0, `${resolvedSearchEndpoint}?${params.toString()}`);
|
|
252
252
|
if (!response.ok) {
|
|
253
253
|
throw new Error(`Search request failed: ${response.status}`);
|
|
254
254
|
}
|
|
@@ -288,7 +288,7 @@ function useDocSearch(config) {
|
|
|
288
288
|
if (_optionalChain([runtime, 'optionalAccess', _14 => _14.navigation, 'access', _15 => _15.mode]) === "embed") {
|
|
289
289
|
setKeepOpen(true);
|
|
290
290
|
const targetPlatform = _nullishCoalesce(_optionalChain([result, 'access', _16 => _16.metadata, 'optionalAccess', _17 => _17.targetPlatform]), () => ( null));
|
|
291
|
-
|
|
291
|
+
_chunkDUQQEQ7Gcjs.resolveExternalNavigation.call(void 0, {
|
|
292
292
|
href: action.href,
|
|
293
293
|
targetPlatform,
|
|
294
294
|
runtime
|
|
@@ -297,18 +297,18 @@ function useDocSearch(config) {
|
|
|
297
297
|
}
|
|
298
298
|
if (wantsNewTab) {
|
|
299
299
|
setKeepOpen(true);
|
|
300
|
-
window.open(action.href, "_blank",
|
|
300
|
+
window.open(action.href, "_blank", _chunkDUQQEQ7Gcjs.NEW_TAB_FEATURES);
|
|
301
301
|
return;
|
|
302
302
|
}
|
|
303
303
|
setKeepOpen(false);
|
|
304
304
|
const path = baseRoute && action.href.startsWith(`${baseRoute}/`) ? action.href.slice(baseRoute.length + 1) : null;
|
|
305
305
|
if (path && _optionalChain([onInPageSwap, 'optionalCall', _18 => _18(path)])) return;
|
|
306
|
-
router.push(
|
|
306
|
+
router.push(_chunkDUQQEQ7Gcjs.stripSameOriginToPath.call(void 0, action.href));
|
|
307
307
|
return;
|
|
308
308
|
}
|
|
309
309
|
case "navigate-new-tab":
|
|
310
310
|
setKeepOpen(true);
|
|
311
|
-
window.open(action.href, "_blank",
|
|
311
|
+
window.open(action.href, "_blank", _chunkDUQQEQ7Gcjs.NEW_TAB_FEATURES);
|
|
312
312
|
return;
|
|
313
313
|
case "ask-ai":
|
|
314
314
|
setKeepOpen(false);
|
|
@@ -347,4 +347,4 @@ function useDocSearch(config) {
|
|
|
347
347
|
|
|
348
348
|
|
|
349
349
|
exports.formatRelativePath = formatRelativePath; exports.DocSearchResultRow = DocSearchResultRow; exports.DocSearchBar = DocSearchBar; exports.mapDocSearchResults = mapDocSearchResults; exports.resolveSearchResultAction = resolveSearchResultAction; exports.useDocSearch = useDocSearch;
|
|
350
|
-
//# sourceMappingURL=chunk-
|
|
350
|
+
//# sourceMappingURL=chunk-XMCVUYKC.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-XMCVUYKC.cjs","../src/components/shared/doc-search/format-relative-path.ts","../src/components/shared/doc-search/doc-search-result-row.tsx","../src/components/shared/doc-search/doc-search-bar.tsx","../src/components/shared/doc-search/map-doc-search-results.ts","../src/components/shared/doc-search/resolve-search-result-action.ts","../src/components/shared/doc-search/use-doc-search.ts"],"names":["jsx"],"mappings":"AAAA,6rBAAY;AACZ;AACE;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;ACZO,SAAS,kBAAA,CAAmB,QAAA,EAA0B;AAC3D,EAAA,GAAA,CAAI,CAAC,QAAA,EAAU,OAAO,EAAA;AACtB,EAAA,MAAM,SAAA,EAAW,QA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A;AAChD,UAAA;AACnB,QAAA;AACc,MAAA;AAC0B,QAAA;AACxB,QAAA;AACD,UAAA;AACf,QAAA;AACA,MAAA;AACgB,QAAA;AACK,UAAA;AACrB,QAAA;AACF,MAAA;AACF,IAAA;AAEa,IAAA;AAEA,IAAA;AACC,MAAA;AACd,IAAA;AAC8D,EAAA;AAKL,EAAA;AAGb,EAAA;AAEnB,EAAA;AAUpB,IAAA;AACY,MAAA;AACb,QAAA;AACA,QAAA;AACoB,wBAAA;AACtB,MAAA;AAWc,MAAA;AAGO,MAAA;AACO,QAAA;AAGkB,UAAA;AACxB,YAAA;AAEoD,YAAA;AAC1C,YAAA;AACX,cAAA;AACb,cAAA;AACA,cAAA;AACM,YAAA;AACR,YAAA;AACF,UAAA;AACiB,UAAA;AACC,YAAA;AACmC,YAAA;AACnD,YAAA;AACF,UAAA;AAOiB,UAAA;AAGO,UAAA;AAEU,UAAA;AACY,UAAA;AAC9C,UAAA;AACF,QAAA;AACK,QAAA;AAIa,UAAA;AACmC,UAAA;AACnD,UAAA;AACG,QAAA;AAMc,UAAA;AACV,UAAA;AAC4D,YAAA;AACnE,UAAA;AACA,UAAA;AACG,QAAA;AAGc,UAAA;AACK,UAAA;AACtB,UAAA;AACG,QAAA;AACH,UAAA;AACJ,MAAA;AACF,IAAA;AAC6D,IAAA;AAC/D,EAAA;AAGgB,EAAA;AACG,IAAA;AACT,EAAA;AAEH,EAAA;AACL,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACkB,IAAA;AACpB,EAAA;AACF;ANyEqG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-XMCVUYKC.cjs","sourcesContent":[null,"/**\n * Format a full document path as a breadcrumb trail.\n * Shows parent folders only (excludes the last segment / filename).\n *\n * @example\n * formatRelativePath('openframe-oss-tenant/architecture/api-controllers.md')\n * // → 'Openframe oss tenant / Architecture'\n */\nexport function formatRelativePath(fullPath: string): string {\n if (!fullPath) return ''\n const segments = fullPath.replace(/\\.md$/, '').split('/')\n // Show only parent path (exclude the filename itself since the title already shows it)\n const parentSegments = segments.length > 1 ? segments.slice(0, -1) : segments\n return parentSegments\n .map((seg) => seg.charAt(0).toUpperCase() + seg.slice(1).replace(/-/g, ' '))\n .join(' / ')\n}\n","'use client'\n\n/**\n * Single row in the `<SearchInput>` dropdown — the standard layout\n * used by every doc-search-backed surface (company-hub data-room\n * search bar, onboarding-guide catalog search, …). Single source of\n * truth for the row appearance so search dropdowns are visually\n * identical everywhere.\n *\n * Resolves the source icon via the same `resolveSourceIcon()`\n * registry the inline chat-card refs use, so a row pointing at e.g.\n * an onboarding-guide surfaces the SAME `<GraduationCap>` glyph the\n * chat card surfaces — no cross-surface drift.\n */\n\nimport { resolveSourceIcon } from '../../chat/utils/source-row-cta'\nimport { formatRelativePath } from './format-relative-path'\n\n/**\n * Minimal result shape this row renders. Compatible with any\n * doc-search hook whose result type exposes `{ title?, path?,\n * metadata? }`. The two hub consumers (onboarding-guide catalog,\n * data-room sidebar) both satisfy this shape via their\n * `useDocSearch` hook result.\n */\nexport interface DocSearchResultRowEntry {\n title?: string\n path?: string\n metadata?: Record<string, unknown>\n}\n\nexport interface DocSearchResultRowProps {\n result: DocSearchResultRowEntry\n isHighlighted: boolean\n}\n\nexport function DocSearchResultRow({\n result,\n isHighlighted,\n}: DocSearchResultRowProps) {\n const docType = (result.metadata?.documentType as string) || undefined\n const sourceRepo = (result.metadata?.sourceRepo as string) || undefined\n const { Icon: SourceIcon, label: iconLabel } = resolveSourceIcon({\n sourceRepo,\n documentType: docType,\n })\n const isGroup = result.metadata?.isGroup as boolean | undefined\n\n return (\n <div className=\"flex items-center gap-3 w-full min-w-0\">\n <span\n className=\"flex-shrink-0 text-ods-text-secondary\"\n title={iconLabel}\n >\n <SourceIcon className=\"size-4\" />\n </span>\n <div className=\"min-w-0 flex-1\">\n <div\n className={`text-h6 truncate ${\n isHighlighted ? 'text-ods-accent' : 'text-ods-text-primary'\n }`}\n >\n {result.title || result.path}\n </div>\n {!isGroup && result.path?.includes('/') && (\n <div className=\"text-h6 text-ods-text-secondary truncate mt-0.5\">\n {formatRelativePath(result.path)}\n </div>\n )}\n </div>\n </div>\n )\n}\n","'use client'\n\n/**\n * `<DocSearchBar>` — the canonical RAG-search dropdown surface.\n *\n * Mounted by every doc-search consumer (data-room sidebar, onboarding-\n * guide catalog, and any future surface that needs typeahead against\n * `/api/docs/search`). Wraps `<SearchInput>` with the lib's standard\n * `<DocSearchResultRow>` so the dropdown looks identical everywhere.\n *\n * ## Why a presentation component, not a \"search bar that owns its\n * own hook\"\n *\n * The data-fetching hook (`useDocSearch`) lives hub-side because it\n * depends on hub-only context (`useDocNavigation`, the rag-table-\n * config registry, the hub's `decideNewTab` helper). Moving the hook\n * would cascade ~5 more file migrations into the lib.\n *\n * Instead, the hook stays hub-side and callers pass its result into\n * this component as plain props. Both consumers shrink to ~5 lines.\n */\n\nimport type { ReactNode } from 'react'\nimport { SearchInput, type SearchResult } from '../../ui/search-input'\nimport { DocSearchResultRow } from './doc-search-result-row'\n\nexport interface DocSearchBarProps {\n placeholder: string\n query: string\n onQueryChange: (value: string) => void\n /** Hook-fetched results. Reuses the lib's `<SearchInput>` `SearchResult`\n * shape directly so callers don't translate. */\n results: SearchResult[]\n isLoading: boolean\n /** Result selection handler. Mirrors `<SearchInput>` — the second\n * `modifiers` argument is preserved so cmd-click / shift-click on\n * a result row still forces new-tab behavior. Hub `useDocSearch`\n * reads these to short-circuit to `window.open()`. */\n onResultSelect: (\n result: SearchResult,\n modifiers?: {\n metaKey?: boolean\n ctrlKey?: boolean\n shiftKey?: boolean\n altKey?: boolean\n button?: number\n },\n ) => void\n /** Lets the caller's hook force the dropdown open after a recent\n * internal action (e.g. result navigation). `undefined` falls back\n * to `<SearchInput>`'s built-in focus/hover heuristics. */\n showDropdown?: boolean\n /** Defaults to 2 — matches the existing data-room and onboarding-\n * guide consumers. Override only if a surface needs different\n * typeahead semantics. */\n minQueryLength?: number\n /** Defaults to 0 — both existing consumers debounce inside the\n * hook, not the input. */\n debounceMs?: number\n className?: string\n /** Optional row-renderer override. Defaults to the lib's standard\n * `<DocSearchResultRow>` (source icon + title + path breadcrumb).\n * Override only when a surface needs custom row chrome. */\n renderResult?: (result: SearchResult, isHighlighted: boolean) => ReactNode\n}\n\nexport function DocSearchBar({\n placeholder,\n query,\n onQueryChange,\n results,\n isLoading,\n onResultSelect,\n showDropdown,\n minQueryLength = 2,\n debounceMs = 0,\n className = 'w-full',\n renderResult,\n}: DocSearchBarProps) {\n return (\n <SearchInput\n placeholder={placeholder}\n value={query}\n onChange={onQueryChange}\n results={results}\n isLoading={isLoading}\n onResultSelect={onResultSelect}\n showDropdown={showDropdown || undefined}\n debounceMs={debounceMs}\n minQueryLength={minQueryLength}\n className={className}\n renderResult={\n renderResult ??\n ((result, isHighlighted) => (\n <DocSearchResultRow result={result} isHighlighted={isHighlighted} />\n ))\n }\n />\n )\n}\n","/**\n * Map RAG `/api/docs/search` wire results into the `<DocSearchBar>`\n * dropdown's row shape, collapsing entity-table rows into grouped\n * results so the dropdown lists ONE \"Cap Table (12 records)\" row\n * instead of 12 individual rows.\n *\n * Pure transform — no telemetry, no navigation, no React deps. Lifted\n * from the hub's `hooks/use-docs.ts:mapDocSearchResults` (the hub's\n * `traceCompose` call was hub-only telemetry and is intentionally\n * dropped — callers that want logging can wrap this helper).\n */\n\nimport type { SearchResult } from '../../ui/search-input'\nimport type { DocSearchResult } from './types'\n\n/** Source repos that should be collapsed into grouped results in the search bar.\n * Only financial tables (all rows link to the same admin page).\n * Content tables (blog, webinar, podcast, etc.) stay individual since each has a unique URL. */\nconst SEARCH_GROUP_REPOS = new Set([\n 'financial-cap-table',\n 'financial-kpis',\n 'financial-pnl',\n 'financial-balance-sheet',\n 'financial-cash-flow',\n])\n\nconst ENTITY_LABELS: Record<string, string> = {\n 'financial-cap-table': 'Cap Table',\n 'financial-kpis': 'Financial KPIs',\n 'financial-pnl': 'Profit & Loss',\n 'financial-balance-sheet': 'Balance Sheets',\n 'financial-cash-flow': 'Cash Flow',\n 'blog-posts': 'Blog Posts',\n 'product-releases': 'Product Releases',\n 'case-studies': 'Case Studies',\n webinars: 'Webinars',\n events: 'Events',\n podcasts: 'Podcasts',\n}\n\nexport function mapDocSearchResults(docs: DocSearchResult[]): SearchResult[] {\n const entityGroups = new Map<string, DocSearchResult[]>()\n // Track insertion order — groups appear where the FIRST row of that\n // repo appeared in the response.\n const order: Array<\n { type: 'entity'; repo: string } | { type: 'doc'; doc: DocSearchResult }\n > = []\n const seenRepos = new Set<string>()\n\n for (const doc of docs) {\n if (doc.sourceRepo && SEARCH_GROUP_REPOS.has(doc.sourceRepo)) {\n const group = entityGroups.get(doc.sourceRepo) || []\n group.push(doc)\n entityGroups.set(doc.sourceRepo, group)\n if (!seenRepos.has(doc.sourceRepo)) {\n seenRepos.add(doc.sourceRepo)\n order.push({ type: 'entity', repo: doc.sourceRepo })\n }\n } else {\n order.push({ type: 'doc', doc })\n }\n }\n\n const results: SearchResult[] = []\n for (const entry of order) {\n if (entry.type === 'entity') {\n const rows = entityGroups.get(entry.repo)!\n const label = ENTITY_LABELS[entry.repo] || entry.repo\n results.push({\n id: `group-${entry.repo}`,\n title: `${label} (${rows.length} ${rows.length === 1 ? 'record' : 'records'})`,\n path: rows[0].path,\n type: 'file',\n metadata: {\n documentType: rows[0].documentType,\n externalUrl: rows[0].externalUrl,\n sourceRepo: entry.repo,\n id: rows[0].entityId,\n isGroup: true,\n items: rows.map((r) => ({\n name: r.name,\n externalUrl: r.externalUrl,\n id: r.entityId,\n sourceRepo: r.sourceRepo,\n documentType: r.documentType,\n })),\n },\n })\n } else {\n const doc = entry.doc\n const isNonMarkdown = doc.documentType && doc.documentType !== 'markdown'\n results.push({\n id: doc.path,\n title: doc.name,\n description: isNonMarkdown ? doc.name : doc.snippet,\n path: doc.path,\n type: doc.type,\n metadata: {\n matchType: doc.matchType,\n ...(doc.documentType ? { documentType: doc.documentType } : {}),\n ...(doc.externalUrl ? { externalUrl: doc.externalUrl } : {}),\n ...(doc.targetPlatform != null\n ? { targetPlatform: doc.targetPlatform }\n : {}),\n ...(doc.sourceRepo ? { sourceRepo: doc.sourceRepo } : {}),\n ...(doc.entityId ? { id: doc.entityId } : {}),\n },\n })\n }\n }\n\n return results\n}\n","/**\n * Resolve what should happen when the user picks a search result.\n * Returns one of five typed actions so the caller is a single switch.\n *\n * Resolution order:\n * 1. `externalUrl` present → use `decideNewTab` to choose same-tab vs\n * new-tab against the row's `targetPlatform`.\n * 2. Row has `id` + `sourceRepo` + `documentType` → synth an Ask-AI\n * action (entity drill-in via primary key, no URL).\n * 3. Row has only `path` → legacy navigation fallback.\n * 4. Nothing actionable → noop.\n *\n * Lifted from the hub's `hooks/use-docs.ts:resolveSearchResultAction`.\n * Pure — no React, no telemetry.\n */\n\nimport type { SearchResult } from '../../ui/search-input'\nimport type { ChatRef } from '../../chat/chat-ref.types'\nimport { decideNewTab } from '../../chat/utils/decide-new-tab'\n\nexport type SearchResultAction =\n | { kind: 'navigate-same-tab'; href: string }\n | { kind: 'navigate-new-tab'; href: string }\n | { kind: 'ask-ai'; detail: { source: string; ref: ChatRef } }\n | { kind: 'route'; path: string }\n | { kind: 'noop' }\n\nexport function resolveSearchResultAction(\n result: SearchResult,\n source: string,\n runtimeMode?: 'host' | 'embed',\n): SearchResultAction {\n const meta = result.metadata ?? {}\n const externalUrl = meta.externalUrl as string | undefined\n if (externalUrl) {\n // Same pure helper `useNavLink` and `useUnifiedNav` call — single\n // decision rule across cards, chips, and autocomplete rows. Thread\n // the caller's `source` as `currentSource` so the platform-vs-\n // platform comparison matches the hub's pre-migration behavior.\n const targetPlatform = meta.targetPlatform as string | null | undefined\n const isNewTab = decideNewTab({\n href: externalUrl,\n targetPlatform,\n surface: 'useUnifiedNav',\n runtimeMode,\n currentSource: source,\n })\n return isNewTab\n ? { kind: 'navigate-new-tab', href: externalUrl }\n : { kind: 'navigate-same-tab', href: externalUrl }\n }\n const rowId = meta.id as string | undefined\n const sourceRepo = meta.sourceRepo as string | undefined\n const documentType = meta.documentType as string | undefined\n if (rowId && sourceRepo && documentType) {\n return {\n kind: 'ask-ai',\n detail: {\n source,\n ref: { type: documentType, id: rowId, title: result.title, url: null },\n },\n }\n }\n if (result.path) {\n return { kind: 'route', path: result.path }\n }\n return { kind: 'noop' }\n}\n","'use client'\n\n/**\n * `useDocSearch` — debounced RAG-search hook against `/api/docs/search`.\n *\n * Pure fetch + navigation glue. Embedders can mount this directly\n * (any host with a reverse-proxy that exposes `/api/docs/search` will\n * work). Hub callers wire it into the lib `<DocSearchBar>` for the\n * canonical typeahead dropdown.\n *\n * ## What moved from hub to lib\n *\n * Lifted from `multi-platform-hub/hooks/use-docs.ts:useDocSearch`. Two\n * hub-only concerns are now optional injection points instead of\n * direct imports:\n *\n * - `useDocNavigation()` (hub's in-page doc-tree swap) → optional\n * `onInPageSwap?: (path: string) => boolean` config callback. When\n * present and returns true, the hook treats a same-origin result\n * click as \"handled in-page\"; when absent or returns false, the\n * hook falls back to `onNavigate(path)` (`router.push` on hub,\n * `window.location.assign` on bare embedders).\n * - `traceCompose` (hub-only telemetry) → dropped. The lib has no\n * equivalent runtime-context yet; bring it back when there is one.\n *\n * Everything else (debounce, `useChatRuntime` for embed-mode short-\n * circuit, embed-shim router, the action-resolver + result-mapper) is\n * now lib-resident.\n */\n\nimport { useState, useEffect, useCallback } from 'react'\nimport { useRouter } from '../../../embed-shims'\nimport { useDebounce } from '../../../hooks/ui/use-debounce'\nimport { useChatRuntime } from '../../../contexts/chat-runtime-context'\nimport { contentFetch } from '../../../utils/embed-content-fetch'\nimport type { SearchResult } from '../../ui/search-input'\nimport {\n resolveExternalNavigation,\n stripSameOriginToPath,\n NEW_TAB_FEATURES,\n} from '../../chat/utils/chat-nav-resolution'\nimport type { DocSearchResult } from './types'\nimport { mapDocSearchResults } from './map-doc-search-results'\nimport { resolveSearchResultAction } from './resolve-search-result-action'\n\nexport interface UseDocSearchConfig {\n /** Discriminator passed to `/api/docs/search?source=` (e.g.\n * `'openframe'`). Embedders set it to whatever discriminator their\n * reverse-proxy expects. */\n source: string\n /** Base route prefix this search lives under (e.g. `'/onboarding-guides'`).\n * When a result's href starts with `${baseRoute}/`, the hook\n * attempts the optional in-page swap path before falling through\n * to a full nav. */\n baseRoute: string\n /** Imperative navigation fallback. Called when no override\n * (in-page swap, new-tab) applies. Hub callers pass\n * `(path) => router.push(path)`; embedders pass an equivalent. */\n onNavigate: (path: string) => void\n /** Optional `RagTableConfig.id` list to narrow the search to specific\n * tables (e.g. `['onboarding-guides']`). Forwarded to\n * `/api/docs/search?tableIds=…` which intersects with the source's\n * standing set. */\n tableIds?: string[]\n /** Optional in-page swap callback. When the result's href is under\n * `baseRoute` AND this callback returns true, the hook treats the\n * click as handled in-page (no router push). Hub's\n * `<DocumentationSection>` wires this to\n * `useDocNavigation().navigate(path)`. */\n onInPageSwap?: (path: string) => boolean\n /** Optional endpoint override. Defaults to `'/api/docs/search'`\n * (the hub's reverse-proxy route). Embedders with a different\n * path can override. */\n searchEndpoint?: string\n}\n\nexport function useDocSearch(config: UseDocSearchConfig) {\n const {\n source,\n baseRoute,\n onNavigate,\n tableIds,\n onInPageSwap,\n searchEndpoint,\n } = config\n const tableIdsKey = tableIds && tableIds.length > 0 ? tableIds.join(',') : ''\n\n const router = useRouter()\n // Optional chat-runtime read — when present and mode='embed' the\n // search-result row click short-circuits to a new-tab open against\n // the absolutized URL. Null/host preserves today's behavior.\n // Also used as the proxy-prefix fallback for `searchEndpoint`, matching\n // how tickets resolves `findTicketUrl`.\n const runtime = useChatRuntime()\n const resolvedSearchEndpoint =\n searchEndpoint ?? runtime?.endpoints.docsSearchUrl ?? '/api/docs/search'\n\n const [query, setQuery] = useState('')\n const [results, setResults] = useState<SearchResult[]>([])\n const [isFetching, setIsFetching] = useState(false)\n const debouncedQuery = useDebounce(query, 300)\n\n useEffect(() => {\n if (!debouncedQuery || debouncedQuery.trim().length < 2) {\n setResults([])\n setIsFetching(false)\n return\n }\n\n let cancelled = false\n\n async function fetchResults() {\n setIsFetching(true)\n try {\n const params = new URLSearchParams({\n q: debouncedQuery,\n source,\n limit: '10',\n })\n if (tableIdsKey) params.set('tableIds', tableIdsKey)\n\n const response = await contentFetch(`${resolvedSearchEndpoint}?${params.toString()}`)\n if (!response.ok) {\n throw new Error(`Search request failed: ${response.status}`)\n }\n\n const json = await response.json()\n\n if (!cancelled && json.success && Array.isArray(json.data)) {\n const mapped = mapDocSearchResults(json.data as DocSearchResult[])\n setResults(mapped)\n }\n } catch (error) {\n console.error('Doc search error:', error)\n if (!cancelled) {\n setResults([])\n }\n } finally {\n if (!cancelled) {\n setIsFetching(false)\n }\n }\n }\n\n fetchResults()\n\n return () => {\n cancelled = true\n }\n }, [debouncedQuery, source, tableIdsKey, resolvedSearchEndpoint])\n\n // Derived loading state — single source of truth for \"should the\n // dropdown show 'Loading...' instead of 'No results found'\":\n const isLoading =\n query.trim().length >= 2 && (query !== debouncedQuery || isFetching)\n\n // Track whether dropdown should stay open (external link opened in new tab).\n const [keepOpen, setKeepOpen] = useState(false)\n\n const handleResultSelect = useCallback(\n (\n result: SearchResult,\n modifiers?: {\n metaKey?: boolean\n ctrlKey?: boolean\n shiftKey?: boolean\n altKey?: boolean\n button?: number\n },\n ) => {\n const action = resolveSearchResultAction(\n result,\n source,\n runtime?.navigation.mode,\n )\n // Modifier / non-primary mouse click → force new tab regardless of\n // same-tab/new-tab decision. The dropdown row is a `<div>`, not an\n // `<a target=\"_blank\">`, so the browser doesn't background-tab\n // natively on cmd-click. Honor it explicitly here for parity with\n // the anchor-based surfaces (cards, chips, related-content). Plain\n // Enter from the keyboard passes `modifiers === undefined`.\n const wantsNewTab =\n modifiers &&\n (modifiers.metaKey ||\n modifiers.ctrlKey ||\n modifiers.shiftKey ||\n modifiers.altKey ||\n (typeof modifiers.button === 'number' && modifiers.button !== 0))\n switch (action.kind) {\n case 'navigate-same-tab': {\n // Embed-mode short-circuit — autocomplete row clicked while\n // the chat panel is hosted inside an embedding app.\n if (runtime?.navigation.mode === 'embed') {\n setKeepOpen(true)\n const targetPlatform =\n (result.metadata?.targetPlatform as string | null | undefined) ?? null\n resolveExternalNavigation({\n href: action.href,\n targetPlatform,\n runtime,\n }).open()\n return\n }\n if (wantsNewTab) {\n setKeepOpen(true)\n window.open(action.href, '_blank', NEW_TAB_FEATURES)\n return\n }\n // Same-origin click:\n // 1. If the href is under the current doc-tree's baseRoute AND\n // an `onInPageSwap` callback is wired AND returns true →\n // consider in-page swap handled.\n // 2. Otherwise → embed-shim `router.push()` (soft RSC nav on\n // Next.js hosts, window.location.assign on bare hosts).\n setKeepOpen(false)\n const path =\n baseRoute && action.href.startsWith(`${baseRoute}/`)\n ? action.href.slice(baseRoute.length + 1)\n : null\n if (path && onInPageSwap?.(path)) return\n router.push(stripSameOriginToPath(action.href))\n return\n }\n case 'navigate-new-tab':\n // Cross-origin (e.g. clicking a flamingo.run release from\n // product-hub) — open in a new tab. Keep dropdown open so the\n // user can pick another result without re-searching.\n setKeepOpen(true)\n window.open(action.href, '_blank', NEW_TAB_FEATURES)\n return\n case 'ask-ai':\n // Row is searchable-but-not-openable (cap_table positions,\n // financial-kpi snapshots, anything backed by\n // `resolveUrl: () => null`). Dispatch a CustomEvent that\n // GlobalAskAI listens for — opens chat + drills via\n // `entityIdFilter` (primary-key only, same as inline-card Ask).\n setKeepOpen(false)\n window.dispatchEvent(\n new CustomEvent('ask-ai:open-with-ref', { detail: action.detail }),\n )\n return\n case 'route':\n // Final fallback: legacy navigation by path. Hits when a row\n // has neither URL nor pk metadata — a mapper/API regression.\n setKeepOpen(false)\n onNavigate(action.path)\n return\n case 'noop':\n return\n }\n },\n [onNavigate, source, baseRoute, router, onInPageSwap, runtime],\n )\n\n // Reset keepOpen when query changes.\n useEffect(() => {\n setKeepOpen(false)\n }, [query])\n\n return {\n query,\n setQuery,\n results,\n isLoading,\n handleResultSelect,\n keepDropdownOpen: keepOpen,\n }\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
useSelfFetch
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-7KDR5P23.js";
|
|
5
5
|
import {
|
|
6
6
|
PageLayout,
|
|
7
7
|
PageShell,
|
|
@@ -11,12 +11,12 @@ import {
|
|
|
11
11
|
faqSectionSlug,
|
|
12
12
|
parseFaqHash,
|
|
13
13
|
serializeJsonLd
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-ZQYFDYWV.js";
|
|
15
15
|
import {
|
|
16
16
|
STICKY_HEADER_OFFSET_PX,
|
|
17
17
|
navigateSamePageHash,
|
|
18
18
|
useScrollToHash
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-2BTDPDME.js";
|
|
20
20
|
import {
|
|
21
21
|
Chevron02DownIcon
|
|
22
22
|
} from "./chunk-OYGFWWLQ.js";
|
|
@@ -258,7 +258,7 @@ function GroupedFaqList({
|
|
|
258
258
|
"aria-current": isActive ? "true" : void 0,
|
|
259
259
|
onClick: (e) => handleJump(e, group.slug),
|
|
260
260
|
className: cn(
|
|
261
|
-
"rounded-full border px-4 py-2 text-
|
|
261
|
+
"rounded-full border px-4 py-2 text-h6 transition-colors",
|
|
262
262
|
isActive ? "border-ods-text-primary bg-ods-card text-ods-text-primary" : "border-ods-border bg-ods-card text-ods-text-secondary hover:border-ods-text-secondary hover:text-ods-text-primary"
|
|
263
263
|
),
|
|
264
264
|
children: group.section
|
|
@@ -382,4 +382,4 @@ export {
|
|
|
382
382
|
FaqSection,
|
|
383
383
|
FaqDocumentPage
|
|
384
384
|
};
|
|
385
|
-
//# sourceMappingURL=chunk-
|
|
385
|
+
//# sourceMappingURL=chunk-Y3NFB6HR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/faq/faq-section.tsx","../src/components/faq-accordion.tsx","../src/components/faq/json-ld.ts","../src/components/faq/faq-document-page.tsx"],"sourcesContent":["\"use client\"\n\nimport React, { useCallback, useEffect, useMemo, useState } from 'react'\nimport type { Faq } from '../../types/faq'\nimport { FaqAccordion, type FaqItem } from '../faq-accordion'\nimport { useSelfFetch } from '../../hooks/use-self-fetch'\nimport { buildSuggestionUrl } from '../../utils/suggestion-url'\nimport { serializeJsonLd } from '../../utils/common'\nimport { useScrollToHash } from '../../hooks/use-scroll-to-hash'\nimport { navigateSamePageHash, STICKY_HEADER_OFFSET_PX } from '../../utils/same-page-hash-nav'\nimport { faqSectionSlug, parseFaqHash, type FaqHashTarget } from '../../utils/faq-anchor'\nimport { cn } from '../../utils/cn'\nimport { buildFaqJsonLdFromFaqs, type FaqSchemaOptions } from './json-ld'\nimport { SECTION_HEADING_CLASS } from '../layout/page-heading'\n\nexport interface FaqSectionProps {\n /**\n * SSR hydrate. When provided, the hook skips the first client fetch (per\n * useSelfFetch contract). The consuming server page resolves FAQs then drills\n * them into this prop — the lib never re-fetches what the host already gated on.\n */\n initialFaqs?: Faq[]\n /** Both required together for entity-attached FAQs; partial → bare /api/faqs. */\n entityType?: string\n entityId?: number | string\n /**\n * Heading node above the grouped list. `undefined` → default\n * `<h2>`\"Frequently Asked Questions\". `null` → no heading (the host page\n * owns the `<h1>`, as the standalone /faqs surface does). A React node lets a\n * platform drill its own <PageHeading> without the lib referencing platform\n * state. Also drives category nesting so the document outline stays correct:\n * `null` → categories render `<h2>` (directly under the page `<h1>`);\n * otherwise categories render `<h3>` beneath this heading.\n */\n heading?: React.ReactNode | null\n /** Inject FAQPage schema.org JSON-LD as a <script>. Off by default so embeds\n * don't emit duplicate schema. */\n emitJsonLd?: boolean\n /** Overrides for the JSON-LD's name/description/url. */\n jsonLd?: FaqSchemaOptions\n className?: string\n /** Maps to /api/faqs `?count=` (the 5-tier fill target). Absent → param\n * not sent (server default applies). */\n minResults?: number\n /** Fetch-URL prefix for third-party embeds / reverse proxies\n * ('' = same-origin relative). */\n apiBaseUrl?: string\n}\n\nconst DEFAULT_HEADING_TEXT = 'Frequently Asked Questions'\n\n/** URL composition shared with RelatedContentSection (`buildSuggestionUrl`)\n * — byte-identical to the historical `buildFaqsUrl` output when\n * `minResults`/`apiBaseUrl` are absent. */\nfunction buildFaqsUrl(\n entityType?: string,\n entityId?: number | string,\n minResults?: number,\n apiBaseUrl = '',\n): string {\n return buildSuggestionUrl('/api/faqs', { apiBaseUrl, entityType, entityId, count: minResults })\n}\n\ninterface FaqGroup {\n /** null → the uncategorized bucket: no heading, no jump pill, rendered last. */\n section: string | null\n slug: string | null\n items: FaqItem[]\n}\n\n/** Group FAQs by `faq.section`, preserving the server's first-seen\n * (display_order) order for BOTH the section order and the rows within each\n * section. The uncategorized bucket (blank/missing section) sinks to the end\n * since it renders without a heading. Items carry NO badge here — the `<h2>`\n * IS the category, so a per-row chip would be redundant. */\nfunction groupFaqsBySection(faqs: Faq[]): FaqGroup[] {\n const order: string[] = []\n const byName = new Map<string, FaqGroup>()\n let uncategorized: FaqGroup | null = null\n for (const faq of faqs) {\n const item: FaqItem = { id: faq.id, question: faq.question, answer: faq.answer }\n const name = faq.section?.trim()\n if (!name) {\n if (!uncategorized) uncategorized = { section: null, slug: null, items: [] }\n uncategorized.items.push(item)\n continue\n }\n let group = byName.get(name)\n if (!group) {\n group = { section: name, slug: faqSectionSlug(name), items: [] }\n byName.set(name, group)\n order.push(name)\n }\n group.items.push(item)\n }\n const groups = order.map((name) => byName.get(name)!)\n if (uncategorized) groups.push(uncategorized)\n return groups\n}\n\n\n/** Map key for the uncategorized bucket — `group.slug` is null for it, so\n * every per-group map (default-open ids, accordion keys) uses this sentinel\n * to keep the lookup typed. */\nconst UNCATEGORIZED_KEY = '__uncategorized__'\nconst groupKey = (g: FaqGroup): string => g.slug ?? UNCATEGORIZED_KEY\n\n/**\n * Grouped FAQ layout: a category jump-nav above stacked `<h2>` category\n * sections (each its own accordion). Isolated into its own component so the\n * scroll-spy hooks only mount in grouped mode — `FaqSection`'s own hooks stay\n * unconditional.\n *\n * The pills are real `<a href=\"#slug\">` anchors (crawlable in-page links,\n * deep-linkable, work without JS); the click handler upgrades the jump to the\n * cancellation-proof `scrollElementIntoView` tween and syncs the URL hash.\n */\nfunction GroupedFaqList({\n groups,\n categoryHeadingAs,\n}: {\n groups: FaqGroup[]\n /** Heading tag for each category, so the document outline nests correctly\n * under whatever owns the heading above this block: `h2` on the standalone\n * page (the page owns the `<h1>`), `h3` beneath an embed's `<h2>` title.\n * The VISUAL is `SECTION_HEADING_CLASS` either way, so categories look\n * identical on every surface. */\n categoryHeadingAs: 'h2' | 'h3'\n}) {\n const CategoryHeading = categoryHeadingAs\n const navGroups = useMemo(() => groups.filter((g) => g.slug), [groups])\n const [activeSlug, setActiveSlug] = useState<string | null>(navGroups[0]?.slug ?? null)\n // Identity-stable key for the section set so the observer re-binds only when\n // the categories actually change (not on every parent re-render).\n const slugKey = navGroups.map((g) => g.slug).join('|')\n\n // Scroll-spy: mark the pill for the category currently at the top of the\n // viewport. rootMargin drops the trigger line just below the sticky header\n // and ignores the bottom ~55% so \"active\" is the section being read, not the\n // next one peeking in.\n useEffect(() => {\n if (navGroups.length < 2) return\n const tops = new Map<string, number>()\n const observer = new IntersectionObserver(\n (entries) => {\n for (const entry of entries) {\n const id = (entry.target as HTMLElement).id\n if (entry.isIntersecting) tops.set(id, entry.boundingClientRect.top)\n else tops.delete(id)\n }\n let bestId: string | null = null\n let bestTop = Number.POSITIVE_INFINITY\n for (const [id, top] of tops) {\n if (top < bestTop) {\n bestTop = top\n bestId = id\n }\n }\n if (bestId) setActiveSlug(bestId)\n },\n { rootMargin: `-${STICKY_HEADER_OFFSET_PX}px 0px -55% 0px`, threshold: 0 },\n )\n for (const group of navGroups) {\n const el = group.slug ? document.getElementById(group.slug) : null\n if (el) observer.observe(el)\n }\n return () => observer.disconnect()\n // slugKey encodes the section set; re-observe only when it changes.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [slugKey])\n\n // ─── Hash dispatch — `/faqs#faq-item-<id>` or `/faqs#faq-<section-slug>` ──\n // Tracks the current hash so:\n // 1. an item-kind hash seeds `defaultOpenIds` on the matching accordion\n // (auto-expands the cited question);\n // 2. either kind triggers the cancellation-proof tween scroll with the\n // sticky-header offset (native browser hash scroll runs once, ignores\n // our offset — re-running the tween puts the target in the right spot).\n // Listens to `hashchange` so back/forward replays the same behavior. SSR-\n // safe: initial null state matches the server render; the first effect\n // tick on the client updates it.\n const [hashTarget, setHashTarget] = useState<FaqHashTarget | null>(null)\n useEffect(() => {\n const refresh = () => setHashTarget(parseFaqHash(window.location.hash))\n refresh()\n window.addEventListener('hashchange', refresh)\n return () => window.removeEventListener('hashchange', refresh)\n }, [])\n\n // Per-group default-open set when the hash points at an item. The map key\n // matches `groupKey(group)` so the render-time lookup is O(1) per group.\n const defaultOpenByGroupKey = useMemo(() => {\n if (hashTarget?.kind !== 'item') return null\n const targetId = hashTarget.rawId\n const result = new Map<string, (string | number)[]>()\n for (const group of groups) {\n const hit = group.items.find((i) => String(i.id) === targetId)\n if (hit) result.set(groupKey(group), [hit.id])\n }\n return result.size > 0 ? result : null\n }, [groups, hashTarget])\n\n // Accordion is uncontrolled — `defaultOpenIds` is only consumed at mount,\n // so a new item hash needs a remount to honor it. Keying off the item-id\n // suffix triggers exactly the remount we need (and stays stable when the\n // hash points at a section, so category navigation never disturbs the\n // accordion's open state).\n const accordionKeySuffix =\n hashTarget?.kind === 'item' ? `item:${hashTarget.rawId}` : 'default'\n\n // Unified scroll-to-hash: rAF-polls for the target row (outlasts the SWR self-fetch\n // + Radix accordion expand) and re-fires on `hashchange` — including the synthetic\n // event `navigateSamePageHash` dispatches for a SOFT same-page chat-card nav (a\n // host-router `pushState` fires no `hashchange`). The ready-dep keys off BOTH the\n // loaded `groups` (so a deep-link / refresh scrolls once the self-fetched list\n // mounts) AND `hashTarget` (so a soft nav re-runs the scroll AFTER the re-render\n // that remounts + opens the cited row, landing on its FINAL expanded position\n // instead of racing the uncontrolled accordion's key-remount — the bare-`hashchange`\n // listener alone fires before the remount and lands on the stale closed position).\n const scrollDep =\n `${groups.length}|` +\n (hashTarget?.kind === 'item'\n ? `item:${hashTarget.rawId}`\n : hashTarget?.kind === 'section'\n ? `section:${hashTarget.slug}`\n : 'none')\n useScrollToHash(scrollDep, { headerOffset: STICKY_HEADER_OFFSET_PX })\n\n // A section hash also lights up its category pill; item hashes leave the pills\n // untouched so deep-linking a question never disturbs scroll-spy state.\n useEffect(() => {\n if (hashTarget?.kind === 'section') setActiveSlug(hashTarget.slug)\n }, [hashTarget])\n\n // Category pill click. `navigateSamePageHash` owns the entire transition:\n // replaceState → synthetic `hashchange` → `scrollElementIntoView` tween\n // with `STICKY_HEADER_OFFSET_PX` so the section heading lands BELOW the\n // sticky category nav on the FIRST tween (covers the same-target\n // re-click case, where the `hashTarget` effect at L214 is a no-op\n // because the state reference is equal). For DIFFERENT-target clicks\n // the helper's synthetic `hashchange` re-fires that effect, which\n // re-scrolls with the same offset and cancels this tween (singleton)\n // — both paths land at the same position. The effect is still\n // required for back/forward + direct URL edits, where the helper\n // isn't in the call chain.\n //\n // `history: 'replace'` matches the pre-helper behavior: category pills\n // are a TOC, not a navigation step, so the Back button leaves the\n // FAQ page in one step regardless of how many categories the user\n // clicked through.\n const handleJump = useCallback(\n (e: React.MouseEvent<HTMLAnchorElement>, slug: string) => {\n e.preventDefault()\n navigateSamePageHash('#' + slug, {\n headerOffset: STICKY_HEADER_OFFSET_PX,\n history: 'replace',\n })\n },\n [],\n )\n\n return (\n <div className=\"space-y-8\">\n {navGroups.length > 1 && (\n <nav aria-label=\"FAQ categories\" className=\"flex flex-wrap gap-2\">\n {navGroups.map((group) => {\n const isActive = group.slug === activeSlug\n return (\n <a\n key={group.slug}\n href={`#${group.slug}`}\n aria-current={isActive ? 'true' : undefined}\n onClick={(e) => handleJump(e, group.slug as string)}\n className={cn(\n \"rounded-full border px-4 py-2 text-h6 transition-colors\",\n isActive\n ? 'border-ods-text-primary bg-ods-card text-ods-text-primary'\n : 'border-ods-border bg-ods-card text-ods-text-secondary hover:border-ods-text-secondary hover:text-ods-text-primary',\n )}\n >\n {group.section}\n </a>\n )\n })}\n </nav>\n )}\n <div className=\"space-y-10\">\n {groups.map((group) => {\n const key = groupKey(group)\n return (\n <section\n key={key}\n id={group.slug ?? undefined}\n className=\"scroll-mt-24 space-y-4\"\n >\n {group.section && (\n <CategoryHeading className={SECTION_HEADING_CLASS}>{group.section}</CategoryHeading>\n )}\n <FaqAccordion\n // Re-key on item-hash changes so the remount picks up the new\n // `defaultOpenIds` (the accordion is uncontrolled). Stable for\n // section hashes — category navigation doesn't disturb state.\n key={`${key}:${accordionKeySuffix}`}\n items={group.items}\n defaultOpenIds={defaultOpenByGroupKey?.get(key)}\n />\n </section>\n )\n })}\n </div>\n </div>\n )\n}\n\nfunction FaqSkeleton() {\n return (\n <div className=\"space-y-8 animate-pulse\">\n <div className=\"h-12 md:h-14 w-2/3 rounded bg-ods-border\" />\n <div className=\"rounded-md border border-ods-border overflow-hidden bg-transparent divide-y divide-ods-border w-full\">\n {Array.from({ length: 8 }).map((_, idx) => (\n <div key={idx} className=\"flex items-center justify-between gap-6 md:gap-10 px-6 py-4\">\n <div className=\"h-6 w-5/6 rounded bg-ods-border\" />\n <div className=\"size-6 rounded bg-ods-border\" />\n </div>\n ))}\n </div>\n </div>\n )\n}\n\ninterface FaqsResponse {\n faqs: Faq[]\n}\n\n/**\n * The FAQ display surface — ONE rendering on every host: the list grouped by\n * `faq.section` (each category a heading + its own accordion, with a category\n * jump-nav once there are 2+ categories). There is no flat/ungrouped mode and\n * no page-vs-embedded shell fork; the standalone /faqs page and every embed\n * render through this single path, so they cannot drift.\n *\n * - Standalone /faqs page: pass `initialFaqs` (SSR) + `heading={null}` (the\n * page owns the <h1>) + `emitJsonLd` with `jsonLd` overrides for SEO.\n * - Per-entity embed: pass `entityType` + `entityId` (no `initialFaqs`); the\n * hook self-fetches `GET /api/faqs`, and `heading` is this block's own <h2>.\n *\n * CONTRACT: the consuming app MUST implement `GET /api/faqs`. On a fetch error\n * (or zero FAQs) the component renders nothing so the host page isn't\n * disfigured. The host always supplies the page shell — this renders a bare\n * <section>.\n */\nexport function FaqSection({\n initialFaqs,\n entityType,\n entityId,\n heading,\n emitJsonLd = false,\n jsonLd,\n className,\n minResults,\n apiBaseUrl = '',\n}: FaqSectionProps) {\n const url = buildFaqsUrl(entityType, entityId, minResults, apiBaseUrl)\n // Memoized — useSelfFetch re-syncs on [initialData]; a fresh per-render\n // wrapper object would setState-loop under re-rendering parents.\n const initialData = useMemo<FaqsResponse | undefined>(\n () => (initialFaqs ? { faqs: initialFaqs } : undefined),\n [initialFaqs],\n )\n const { data, isLoading, error } = useSelfFetch<FaqsResponse>(url, { initialData })\n\n const faqs = data?.faqs ?? []\n // Grouped before the early returns so the hook order stays stable.\n const groups = useMemo(() => (faqs.length > 0 ? groupFaqsBySection(faqs) : []), [faqs])\n\n // `undefined` → default <h2> title; `null` → the host page owns the <h1>, so\n // no title renders here. `heading === null` also makes the category headings\n // <h2> (directly under the page <h1>); otherwise they nest as <h3>.\n const headingNode =\n heading === undefined ? <h2 className={SECTION_HEADING_CLASS}>{DEFAULT_HEADING_TEXT}</h2> : heading\n\n // Degrade silently — never show an error banner or an empty section shell\n // where FAQs would be (host pages and the standalone surface both rely on it).\n if (error) return null\n if (!isLoading && faqs.length === 0) return null\n if (isLoading && faqs.length === 0) {\n return (\n <div className={className}>\n <FaqSkeleton />\n </div>\n )\n }\n\n const schema = emitJsonLd ? buildFaqJsonLdFromFaqs(faqs, jsonLd) : null\n\n return (\n <>\n <section className={className ?? 'space-y-10'}>\n {headingNode}\n <GroupedFaqList groups={groups} categoryHeadingAs={heading === null ? 'h2' : 'h3'} />\n </section>\n {schema && (\n <script\n type=\"application/ld+json\"\n // eslint-disable-next-line react/no-danger\n // serializeJsonLd, NOT raw JSON.stringify — FAQ answers are\n // admin-entered; an embedded \"</script>\" must not break the tag.\n dangerouslySetInnerHTML={{ __html: serializeJsonLd(schema) }}\n />\n )}\n </>\n )\n}\n","\"use client\"\n\nimport React, { useRef, useState, useEffect, useCallback } from 'react'\nimport { Chevron02DownIcon } from './icons-v2-generated/arrows/chevron-02-down-icon'\nimport { cn } from \"../utils/cn\"\nimport { faqItemAnchor } from \"../utils/faq-anchor\"\n\nexport interface FaqItem {\n id: number | string\n question: string\n answer: string\n}\n\ninterface FaqAccordionProps {\n items: FaqItem[]\n defaultOpenIds?: (number | string)[]\n}\n\n// Utility to measure scrollHeight outside render cycle\nconst useMeasuredHeight = (isOpen: boolean) => {\n const ref = useRef<HTMLDivElement | null>(null)\n const [maxHeight, setMaxHeight] = useState<string>('0px')\n\n const measure = useCallback(() => {\n if (ref.current) {\n const height = ref.current.scrollHeight\n setMaxHeight(`${height}px`)\n }\n }, [])\n\n // Update height only when section is open\n useEffect(() => {\n if (isOpen) {\n measure()\n } else {\n setMaxHeight('0px')\n }\n }, [isOpen, measure])\n\n return { ref, maxHeight }\n}\n\nexport function FaqAccordion({ items, defaultOpenIds = [] }: FaqAccordionProps) {\n const [openSet, setOpenSet] = useState<Set<string | number>>(new Set(defaultOpenIds))\n\n const toggle = (id: string | number) => {\n setOpenSet(prev => {\n const next = new Set(prev)\n if (next.has(id)) next.delete(id)\n else next.add(id)\n return next\n })\n }\n\n return (\n <div className=\"rounded-md border border-ods-border divide-y divide-ods-border bg-transparent overflow-hidden\">\n {items.map(item => {\n const isOpen = openSet.has(item.id)\n const { ref, maxHeight } = useMeasuredHeight(isOpen)\n\n return (\n <div\n key={item.id}\n // Per-row anchor — chat citation chips (`/faqs#faq-item-<id>`) land\n // here via native browser hash scroll AND via `FaqSection`'s tween\n // dispatch. `scroll-mt-24` keeps the row header below the 96px\n // sticky nav offset (matches `<section>`'s scroll-margin for\n // category anchors).\n id={faqItemAnchor(item.id)}\n className=\"scroll-mt-24 transition-colors hover:bg-ods-bg-hover\"\n >\n {/* Header */}\n <div\n role=\"button\"\n tabIndex={0}\n onClick={() => toggle(item.id)}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n toggle(item.id);\n }\n }}\n aria-expanded={isOpen}\n className=\"flex w-full items-center gap-6 md:gap-10 px-6 py-4 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ods-focus transition-colors cursor-pointer\"\n >\n <h3 className=\"flex-1 min-w-0 break-words\">\n {item.question}\n </h3>\n <Chevron02DownIcon\n aria-hidden=\"true\"\n size={24}\n className={cn(\n 'shrink-0 text-ods-text-primary transition-transform duration-300',\n isOpen && 'rotate-180',\n )}\n />\n </div>\n {/* Content wrapper with max-height animation */}\n <div\n style={{ maxHeight, transition: 'max-height 0.35s ease-in-out, opacity 0.35s ease-in-out', opacity: isOpen ? 1 : 0 }}\n className=\"overflow-hidden\"\n >\n {/* break-words: FAQ answers render as plain text, so a long URL or\n token has no wrap opportunity — and the parent is overflow-hidden,\n which would CLIP it past the viewport on mobile. Mirrors the\n markdown-renderer overflow-wrap fix. */}\n <div ref={ref} className=\"px-6 pb-4 text-ods-text-primary text-h4 break-words\">\n {item.answer}\n </div>\n </div>\n </div>\n )\n })}\n </div>\n )\n} ","/**\n * Pure FAQ JSON-LD builder. No React, no client-only deps — safe to import from\n * Server Components via the `./components/faq` subpath export. (Do NOT import\n * through the root `./components` barrel — that barrel is `\"use client\"` and\n * dragging it into a Server Component would force the client graph into the\n * server.)\n *\n * The hub used to harcode `name`/`description` here for OpenMSP; in the lib we\n * accept overrides so every embedder can supply its own platform branding.\n */\nimport type { Faq } from '../../types/faq'\n\nexport interface FaqSchemaOptions {\n name?: string\n description?: string\n url?: string\n}\n\nconst DEFAULT_NAME = 'Frequently Asked Questions'\nconst DEFAULT_DESCRIPTION =\n 'Answers to common questions.'\n\nexport function baseFaqSchema(opts: FaqSchemaOptions = {}) {\n return {\n '@context': 'https://schema.org',\n '@type': 'FAQPage',\n name: opts.name ?? DEFAULT_NAME,\n description: opts.description ?? DEFAULT_DESCRIPTION,\n ...(opts.url ? { url: opts.url } : {}),\n } as const\n}\n\nexport function buildFaqJsonLdFromFaqs(faqs: Faq[], opts: FaqSchemaOptions = {}) {\n return {\n ...baseFaqSchema(opts),\n mainEntity: faqs.map((faq) => ({\n '@type': 'Question',\n name: faq.question,\n acceptedAnswer: {\n '@type': 'Answer',\n text: faq.answer,\n },\n })),\n } as const\n}\n","'use client';\n\n/**\n * FaqDocumentPage — the full `/faqs` page with chrome, so embedders drop in\n * ONE component instead of hand-assembling `PageShell` + `PageLayout` around\n * the bare `<FaqSection>`. Mirrors `LegalDocumentPage` / `DevSectionPage`: the\n * page-level layout lives in the lib, the host page is a thin wrapper that\n * passes only config + the SSR-resolved data.\n *\n * HERO: the title + subtitle route through the canonical (frozen) `PageLayout`\n * `TitleBlock` with `titleSize=\"h1\"` — the unified Help Center header (the\n * `TitleBlock` element is always an `<h1>`; `titleSize` only sets its typography,\n * here `text-h1`). The page owns that `<h1>`, so `<FaqSection heading={null}>`\n * nests its category headings as `<h2>`/`<h3>` (the SEO-recommended FAQ document\n * outline).\n *\n * DATA: pass `initialFaqs` (SSR-resolved, platform-scoped) so `FaqSection`\n * skips its client self-fetch — the standalone page's static platform-only\n * contract. Omit it for embeds that want the self-fetching `/api/faqs`\n * suggestion-fill instead.\n */\n\nimport type { Faq } from '../../types/faq';\nimport { PageShell, PageLayout } from '../ui';\nimport { useRouter } from '../../embed-shims/next-navigation';\nimport { FaqSection } from './faq-section';\nimport type { FaqSchemaOptions } from './json-ld';\n\nexport interface FaqDocumentPageProps {\n /** Page title (frozen `PageLayout` `TitleBlock`). Default \"Frequently Asked Questions\". */\n title?: string;\n /** Subtitle under the title. */\n subtitle?: string;\n /** Back-button config — same pattern as `DevSectionPage` / `LegalDocumentPage`.\n * Pass `false` to hide. Default `{ label: 'Back to home', href: '/' }`. */\n backButton?: { label?: string; href?: string } | false;\n /** Render the standalone `<PageShell>` (own `<main>` + bg + max-width). Default\n * true. Pass false when the host layout already provides the page container\n * (e.g. openframe-frontend's `AppLayout` `<main>`) — only the padding box\n * renders, avoiding a nested `<main>`. */\n shell?: boolean;\n /** SSR-hydrate `FaqSection` (skips the client fetch — the platform-only\n * contract for the standalone page). Omit for self-fetching embeds. */\n initialFaqs?: Faq[];\n /** Emit FAQPage schema.org JSON-LD (forwarded to `FaqSection`). Off by\n * default so embeds don't emit duplicate schema. */\n emitJsonLd?: boolean;\n /** JSON-LD name/description/url overrides (forwarded to `FaqSection`). */\n jsonLd?: FaqSchemaOptions;\n /** Base URL `FaqSection` appends `/api/faqs` to (reverse-proxy embedders). */\n apiBaseUrl?: string;\n /** Optional entity scoping forwarded to `FaqSection`. */\n entityType?: string;\n entityId?: number | string;\n /** Minimum FAQ count before the section renders (forwarded to `FaqSection`). */\n minResults?: number;\n}\n\nexport function FaqDocumentPage({\n title = 'Frequently Asked Questions',\n subtitle,\n backButton,\n initialFaqs,\n emitJsonLd,\n jsonLd,\n apiBaseUrl,\n entityType,\n entityId,\n minResults,\n shell = true,\n}: FaqDocumentPageProps) {\n const router = useRouter();\n\n // Back-button config — mirrors LegalDocumentPage / DevSectionPage. Hide\n // entirely when the caller passes `false` (embed-mode where the host owns\n // nav chrome).\n const backCfg =\n backButton === false\n ? undefined\n : {\n label: backButton?.label ?? 'Back to home',\n onClick: () => router.push(backButton?.href ?? '/'),\n };\n\n const inner = (\n <PageLayout title={title} subtitle={subtitle} backButton={backCfg} titleSize=\"h1\" titleWrap>\n <FaqSection\n initialFaqs={initialFaqs}\n heading={null}\n emitJsonLd={emitJsonLd}\n jsonLd={jsonLd}\n apiBaseUrl={apiBaseUrl}\n entityType={entityType}\n entityId={entityId}\n minResults={minResults}\n />\n </PageLayout>\n );\n\n return shell ? <PageShell>{inner}</PageShell> : <div className=\"page-shell-content\">{inner}</div>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,SAAgB,eAAAA,cAAa,aAAAC,YAAW,SAA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