@redocly/theme 0.70.0-next.1 → 0.70.0-next.11
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/lib/components/Buttons/ConnectMCPButton.js +19 -14
- package/lib/components/Buttons/variables.d.ts +1 -0
- package/lib/components/Buttons/variables.js +4 -1
- package/lib/components/Catalog/Catalog.js +3 -3
- package/lib/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsGraph.lazy.d.ts +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsGraph.lazy.js +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistorySidebar.js +2 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntitySchema.js +1 -1
- package/lib/components/Catalog/CatalogFilter/CatalogFilterCheckboxes.js +30 -11
- package/lib/components/Catalog/CatalogFilter/CatalogFilterDateRange.js +2 -1
- package/lib/components/Catalog/CatalogMobileFiltersPanel/CatalogMobileFiltersPanel.js +1 -1
- package/lib/components/Catalog/CatalogMobileFiltersPanel/CatalogMobileFiltersPanelOverlay.js +2 -2
- package/lib/components/CodeBlock/CodeBlockControls.js +3 -5
- package/lib/components/Consent/Consent.d.ts +2 -0
- package/lib/components/Consent/Consent.js +17 -0
- package/lib/components/Consent/ConsentBanner.d.ts +2 -0
- package/lib/components/Consent/ConsentBanner.js +120 -0
- package/lib/components/Consent/ConsentDialog.d.ts +2 -0
- package/lib/components/Consent/ConsentDialog.js +128 -0
- package/lib/components/Consent/ConsentSettingsLink.d.ts +2 -0
- package/lib/components/Consent/ConsentSettingsLink.js +35 -0
- package/lib/components/Consent/variables.d.ts +1 -0
- package/lib/components/Consent/variables.js +31 -0
- package/lib/components/Dropdown/Dropdown.d.ts +4 -2
- package/lib/components/Dropdown/Dropdown.js +31 -9
- package/lib/components/Dropdown/DropdownMenu.d.ts +1 -0
- package/lib/components/Dropdown/DropdownMenu.js +1 -1
- package/lib/components/Feedback/Reasons.js +3 -2
- package/lib/components/Filter/FilterCheckboxes.js +30 -11
- package/lib/components/Filter/FilterDateRange.js +36 -2
- package/lib/components/Footer/Footer.js +4 -1
- package/lib/components/Image/Image.js +24 -4
- package/lib/components/JsonViewer/Helpers.d.ts +10 -2
- package/lib/components/JsonViewer/Helpers.js +32 -36
- package/lib/components/JsonViewer/JsonViewer.js +15 -18
- package/lib/components/LoadProgressBar/LoadProgressBar.d.ts +8 -0
- package/lib/components/LoadProgressBar/LoadProgressBar.js +122 -0
- package/lib/components/MCP/McpConnectionTabs.js +9 -2
- package/lib/components/Markdown/Markdown.js +3 -2
- package/lib/components/Markdown/styles/base-table.js +14 -1
- package/lib/components/Markdown/variables.js +1 -0
- package/lib/components/Menu/Menu.js +4 -0
- package/lib/components/Menu/MenuSelect.d.ts +7 -0
- package/lib/components/Menu/MenuSelect.js +129 -0
- package/lib/components/Menu/variables.js +43 -4
- package/lib/components/Navbar/Navbar.js +44 -5
- package/lib/components/Navbar/variables.js +3 -0
- package/lib/components/NavigationTabs/NavigationTab.d.ts +7 -0
- package/lib/components/NavigationTabs/NavigationTab.js +93 -0
- package/lib/components/NavigationTabs/NavigationTabContent.d.ts +7 -0
- package/lib/components/NavigationTabs/NavigationTabContent.js +50 -0
- package/lib/components/NavigationTabs/NavigationTabMenu.d.ts +7 -0
- package/lib/components/NavigationTabs/NavigationTabMenu.js +18 -0
- package/lib/components/NavigationTabs/NavigationTabs.d.ts +7 -0
- package/lib/components/NavigationTabs/NavigationTabs.js +97 -0
- package/lib/components/NavigationTabs/variables.d.ts +1 -0
- package/lib/components/NavigationTabs/variables.js +37 -0
- package/lib/components/Portal/Portal.js +37 -5
- package/lib/components/Product/utils.js +1 -1
- package/lib/components/Search/SearchAiActionButtons.js +8 -3
- package/lib/components/Search/SearchAiActivity.d.ts +10 -0
- package/lib/components/Search/SearchAiActivity.js +278 -0
- package/lib/components/Search/SearchAiConversationInput.js +10 -6
- package/lib/components/Search/SearchAiDialog.js +13 -2
- package/lib/components/Search/SearchAiMessage.d.ts +2 -1
- package/lib/components/Search/SearchAiMessage.js +21 -109
- package/lib/components/Search/SearchAiResponse.js +1 -0
- package/lib/components/Search/SearchDialog.js +10 -0
- package/lib/components/Search/SearchItem.js +11 -10
- package/lib/components/Search/SearchTrigger.js +37 -6
- package/lib/components/Search/variables.js +17 -2
- package/lib/components/Segmented/Segmented.js +23 -3
- package/lib/components/Select/Select.js +10 -3
- package/lib/components/Select/SelectInput.d.ts +1 -0
- package/lib/components/Select/SelectInput.js +5 -11
- package/lib/components/Sidebar/Sidebar.js +2 -2
- package/lib/components/SplitButton/SplitButton.js +37 -3
- package/lib/components/TableOfContent/TableOfContent.js +2 -2
- package/lib/core/constants/common.d.ts +1 -0
- package/lib/core/constants/common.js +1 -0
- package/lib/core/constants/consent.d.ts +2 -0
- package/lib/core/constants/consent.js +30 -0
- package/lib/core/constants/index.d.ts +2 -0
- package/lib/core/constants/index.js +2 -0
- package/lib/core/constants/mcp.d.ts +2 -2
- package/lib/core/constants/mcp.js +3 -8
- package/lib/core/constants/prompt.d.ts +9 -0
- package/lib/core/constants/prompt.js +33 -0
- package/lib/core/constants/search.d.ts +1 -1
- package/lib/core/constants/search.js +6 -2
- package/lib/core/contexts/PortalContainerContext.d.ts +2 -0
- package/lib/core/contexts/PortalContainerContext.js +7 -0
- package/lib/core/hooks/code-walkthrough/use-code-panel.d.ts +1 -1
- package/lib/core/hooks/code-walkthrough/use-code-walkthrough-controls.d.ts +1 -1
- package/lib/core/hooks/code-walkthrough/use-code-walkthrough-controls.js +1 -1
- package/lib/core/hooks/code-walkthrough/use-code-walkthrough-steps.d.ts +1 -1
- package/lib/core/hooks/code-walkthrough/use-code-walkthrough.d.ts +1 -2
- package/lib/core/hooks/code-walkthrough/use-renderable-files.d.ts +1 -1
- package/lib/core/hooks/index.d.ts +9 -0
- package/lib/core/hooks/index.js +9 -0
- package/lib/core/hooks/menu/use-collapse.js +1 -1
- package/lib/core/hooks/menu/use-mobile-menu-items.js +75 -51
- package/lib/core/hooks/menu/use-mobile-menu-levels.js +12 -7
- package/lib/core/hooks/prompt/use-prompt-actions.d.ts +7 -0
- package/lib/core/hooks/prompt/use-prompt-actions.js +19 -0
- package/lib/core/hooks/prompt/use-prompt-text-limit.d.ts +19 -0
- package/lib/core/hooks/prompt/use-prompt-text-limit.js +35 -0
- package/lib/core/hooks/search/use-persisted-quick-filter.d.ts +21 -0
- package/lib/core/hooks/search/use-persisted-quick-filter.js +92 -0
- package/lib/core/hooks/search/use-search-ai-activity.d.ts +11 -0
- package/lib/core/hooks/search/use-search-ai-activity.js +15 -0
- package/lib/core/hooks/use-connect-mcp-button.js +3 -1
- package/lib/core/hooks/use-consent-dialog.d.ts +12 -0
- package/lib/core/hooks/use-consent-dialog.js +36 -0
- package/lib/core/hooks/use-consent-telemetry.d.ts +1 -0
- package/lib/core/hooks/use-consent-telemetry.js +42 -0
- package/lib/core/hooks/use-dialog-hotkeys.js +4 -2
- package/lib/core/hooks/use-full-height.d.ts +1 -1
- package/lib/core/hooks/use-full-height.js +8 -8
- package/lib/core/hooks/use-page-actions.d.ts +1 -1
- package/lib/core/hooks/use-page-actions.js +10 -8
- package/lib/core/hooks/use-pointer-border-highlight.d.ts +7 -0
- package/lib/core/hooks/use-pointer-border-highlight.js +29 -0
- package/lib/core/hooks/use-scroll-item-into-view.d.ts +2 -0
- package/lib/core/hooks/use-scroll-item-into-view.js +16 -0
- package/lib/core/hooks/use-tab-list.d.ts +31 -0
- package/lib/core/hooks/use-tab-list.js +49 -0
- package/lib/core/hooks/use-telemetry-fallback.d.ts +2 -0
- package/lib/core/hooks/use-telemetry-fallback.js +2 -0
- package/lib/core/hooks/use-theme-hooks.js +16 -0
- package/lib/core/styles/dark.js +14 -12
- package/lib/core/styles/global.d.ts +2 -0
- package/lib/core/styles/global.js +115 -136
- package/lib/core/styles/index.d.ts +1 -0
- package/lib/core/styles/index.js +3 -1
- package/lib/core/styles/search-ai-appear.d.ts +1 -0
- package/lib/core/styles/search-ai-appear.js +18 -0
- package/lib/core/types/code-walkthrough.d.ts +84 -0
- package/lib/core/types/consent.d.ts +54 -0
- package/lib/core/types/consent.js +3 -0
- package/lib/core/types/dropdown.d.ts +1 -0
- package/lib/core/types/dropdown.js +3 -0
- package/lib/core/types/hooks.d.ts +8 -1
- package/lib/core/types/index.d.ts +4 -0
- package/lib/core/types/l10n.d.ts +1 -1
- package/lib/core/types/mcp.d.ts +3 -2
- package/lib/core/types/navigation-tabs.d.ts +49 -0
- package/lib/core/types/navigation-tabs.js +3 -0
- package/lib/core/types/prompt.d.ts +9 -0
- package/lib/core/types/prompt.js +3 -0
- package/lib/core/types/search.d.ts +25 -0
- package/lib/core/utils/Dynamic.d.ts +8 -1
- package/lib/core/utils/Dynamic.js +34 -3
- package/lib/core/utils/assign-ref.d.ts +2 -0
- package/lib/core/utils/assign-ref.js +12 -0
- package/lib/core/utils/consent-settings-link-placement.d.ts +3 -0
- package/lib/core/utils/consent-settings-link-placement.js +15 -0
- package/lib/core/utils/content-segments.d.ts +12 -1
- package/lib/core/utils/content-segments.js +90 -5
- package/lib/core/utils/download-code-walkthrough.d.ts +1 -1
- package/lib/core/utils/dropdown.d.ts +2 -0
- package/lib/core/utils/dropdown.js +12 -0
- package/lib/core/utils/get-ai-prompt-link.d.ts +15 -0
- package/lib/core/utils/get-ai-prompt-link.js +29 -0
- package/lib/core/utils/get-code-walkthrough-file-text.d.ts +1 -1
- package/lib/core/utils/index.d.ts +5 -0
- package/lib/core/utils/index.js +5 -0
- package/lib/core/utils/match-code-walkthrough-conditions.d.ts +1 -1
- package/lib/core/utils/mcp.d.ts +2 -1
- package/lib/core/utils/mcp.js +13 -3
- package/lib/core/utils/menu.d.ts +4 -0
- package/lib/core/utils/menu.js +48 -8
- package/lib/core/utils/navigation-tabs.d.ts +8 -0
- package/lib/core/utils/navigation-tabs.js +71 -0
- package/lib/core/utils/search-ai-activity.d.ts +4 -0
- package/lib/core/utils/search-ai-activity.js +83 -0
- package/lib/core/utils/urls.js +3 -1
- package/lib/core/utils/with-load-progress.d.ts +3 -0
- package/lib/core/utils/with-load-progress.js +24 -19
- package/lib/ext/configure.d.ts +1 -1
- package/lib/ext/configure.js +0 -1
- package/lib/icons/ExpandCollapseIcon/ExpandCollapseIcon.d.ts +29 -0
- package/lib/icons/ExpandCollapseIcon/ExpandCollapseIcon.js +81 -0
- package/lib/icons/LinkIcon/LinkIconSymbol.d.ts +12 -0
- package/lib/icons/LinkIcon/LinkIconSymbol.js +41 -0
- package/lib/index.d.ts +7 -0
- package/lib/index.js +9 -1
- package/lib/layouts/PageLayout.js +1 -1
- package/lib/layouts/RootLayout.js +2 -2
- package/lib/markdoc/components/CodeWalkthrough/CodeFilters.d.ts +1 -1
- package/lib/markdoc/components/CodeWalkthrough/CodeFilters.js +1 -1
- package/lib/markdoc/components/CodeWalkthrough/CodePanel.d.ts +1 -1
- package/lib/markdoc/components/CodeWalkthrough/CodePanel.js +3 -3
- package/lib/markdoc/components/CodeWalkthrough/CodePanelHeader.d.ts +1 -1
- package/lib/markdoc/components/CodeWalkthrough/CodePanelToolbar.d.ts +1 -1
- package/lib/markdoc/components/CodeWalkthrough/CodeStep.d.ts +1 -1
- package/lib/markdoc/components/CodeWalkthrough/CodeWalkthrough.d.ts +1 -1
- package/lib/markdoc/components/CodeWalkthrough/CodeWalkthrough.js +1 -1
- package/lib/markdoc/components/Prompt/Prompt.d.ts +15 -0
- package/lib/markdoc/components/Prompt/Prompt.js +163 -0
- package/lib/markdoc/components/Prompt/PromptActions.d.ts +13 -0
- package/lib/markdoc/components/Prompt/PromptActions.js +43 -0
- package/lib/markdoc/components/Prompt/PromptBody.d.ts +14 -0
- package/lib/markdoc/components/Prompt/PromptBody.js +99 -0
- package/lib/markdoc/components/Prompt/PromptCopyButton.d.ts +10 -0
- package/lib/markdoc/components/Prompt/PromptCopyButton.js +28 -0
- package/lib/markdoc/components/Prompt/PromptHeader.d.ts +9 -0
- package/lib/markdoc/components/Prompt/PromptHeader.js +57 -0
- package/lib/markdoc/components/Prompt/PromptShowHideButton.d.ts +7 -0
- package/lib/markdoc/components/Prompt/PromptShowHideButton.js +21 -0
- package/lib/markdoc/components/Prompt/PromptToggleLabel.d.ts +7 -0
- package/lib/markdoc/components/Prompt/PromptToggleLabel.js +28 -0
- package/lib/markdoc/components/Prompt/variables.d.ts +1 -0
- package/lib/markdoc/components/Prompt/variables.dark.d.ts +1 -0
- package/lib/markdoc/components/Prompt/variables.dark.js +8 -0
- package/lib/markdoc/components/Prompt/variables.js +44 -0
- package/lib/markdoc/components/Tabs/TabList.js +8 -6
- package/lib/markdoc/components/default.d.ts +1 -0
- package/lib/markdoc/components/default.js +1 -0
- package/lib/markdoc/default.d.ts +2 -0
- package/lib/markdoc/default.js +2 -0
- package/lib/markdoc/tags/code-walkthrough.d.ts +1 -1
- package/lib/markdoc/tags/connect-mcp.js +15 -0
- package/lib/markdoc/tags/prompt.d.ts +2 -0
- package/lib/markdoc/tags/prompt.js +56 -0
- package/package.json +4 -8
- package/src/components/Buttons/ConnectMCPButton.tsx +21 -16
- package/src/components/Buttons/variables.ts +4 -0
- package/src/components/Catalog/Catalog.tsx +6 -4
- package/src/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsGraph.lazy.tsx +3 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistorySidebar.tsx +2 -2
- package/src/components/Catalog/CatalogEntity/CatalogEntitySchema.tsx +1 -1
- package/src/components/Catalog/CatalogFilter/CatalogFilterCheckboxes.tsx +37 -22
- package/src/components/Catalog/CatalogFilter/CatalogFilterDateRange.tsx +3 -2
- package/src/components/Catalog/CatalogMobileFiltersPanel/CatalogMobileFiltersPanel.tsx +1 -1
- package/src/components/Catalog/CatalogMobileFiltersPanel/CatalogMobileFiltersPanelOverlay.tsx +2 -2
- package/src/components/CodeBlock/CodeBlockControls.tsx +4 -7
- package/src/components/Consent/Consent.tsx +18 -0
- package/src/components/Consent/ConsentBanner.tsx +110 -0
- package/src/components/Consent/ConsentDialog.tsx +210 -0
- package/src/components/Consent/ConsentSettingsLink.tsx +44 -0
- package/src/components/Consent/variables.ts +28 -0
- package/src/components/Dropdown/Dropdown.tsx +32 -7
- package/src/components/Dropdown/DropdownMenu.tsx +7 -1
- package/src/components/Feedback/Reasons.tsx +3 -2
- package/src/components/Filter/FilterCheckboxes.tsx +33 -18
- package/src/components/Filter/FilterDateRange.tsx +3 -2
- package/src/components/Footer/Footer.tsx +2 -0
- package/src/components/Image/Image.tsx +26 -5
- package/src/components/JsonViewer/Helpers.tsx +51 -54
- package/src/components/JsonViewer/JsonViewer.tsx +23 -25
- package/src/components/LoadProgressBar/LoadProgressBar.tsx +113 -0
- package/src/components/MCP/McpConnectionTabs.tsx +22 -5
- package/src/components/Markdown/Markdown.tsx +3 -2
- package/src/components/Markdown/styles/base-table.ts +14 -1
- package/src/components/Markdown/variables.ts +1 -0
- package/src/components/Menu/Menu.tsx +5 -0
- package/src/components/Menu/MenuSelect.tsx +198 -0
- package/src/components/Menu/variables.ts +43 -4
- package/src/components/Navbar/Navbar.tsx +22 -5
- package/src/components/Navbar/variables.ts +3 -0
- package/src/components/NavigationTabs/NavigationTab.tsx +148 -0
- package/src/components/NavigationTabs/NavigationTabContent.tsx +66 -0
- package/src/components/NavigationTabs/NavigationTabMenu.tsx +40 -0
- package/src/components/NavigationTabs/NavigationTabs.tsx +83 -0
- package/src/components/NavigationTabs/variables.ts +34 -0
- package/src/components/Portal/Portal.tsx +4 -2
- package/src/components/Product/utils.ts +1 -1
- package/src/components/Search/SearchAiActionButtons.tsx +31 -19
- package/src/components/Search/SearchAiActivity.tsx +318 -0
- package/src/components/Search/SearchAiConversationInput.tsx +13 -7
- package/src/components/Search/SearchAiDialog.tsx +20 -4
- package/src/components/Search/SearchAiMessage.tsx +28 -136
- package/src/components/Search/SearchAiResponse.tsx +1 -0
- package/src/components/Search/SearchDialog.tsx +11 -0
- package/src/components/Search/SearchItem.tsx +19 -10
- package/src/components/Search/SearchTrigger.tsx +47 -3
- package/src/components/Search/variables.ts +17 -2
- package/src/components/Segmented/Segmented.tsx +25 -16
- package/src/components/Select/Select.tsx +12 -6
- package/src/components/Select/SelectInput.tsx +10 -18
- package/src/components/Sidebar/Sidebar.tsx +2 -2
- package/src/components/SplitButton/SplitButton.tsx +8 -2
- package/src/components/TableOfContent/TableOfContent.tsx +2 -2
- package/src/core/constants/common.ts +1 -0
- package/src/core/constants/consent.ts +29 -0
- package/src/core/constants/index.ts +2 -0
- package/src/core/constants/mcp.ts +3 -9
- package/src/core/constants/prompt.ts +34 -0
- package/src/core/constants/search.ts +6 -2
- package/src/core/contexts/PortalContainerContext.tsx +4 -0
- package/src/core/hooks/__mocks__/index.ts +5 -0
- package/src/core/hooks/__mocks__/use-theme-hooks.ts +20 -0
- package/src/core/hooks/code-walkthrough/__mocks__/MockIntersectionObserver.ts +1 -2
- package/src/core/hooks/code-walkthrough/__mocks__/mock-intersection-observer.ts +1 -2
- package/src/core/hooks/code-walkthrough/use-code-panel.ts +1 -1
- package/src/core/hooks/code-walkthrough/use-code-walkthrough-controls.ts +2 -2
- package/src/core/hooks/code-walkthrough/use-code-walkthrough-steps.ts +1 -1
- package/src/core/hooks/code-walkthrough/use-code-walkthrough.ts +3 -3
- package/src/core/hooks/code-walkthrough/use-renderable-files.ts +1 -1
- package/src/core/hooks/index.ts +9 -0
- package/src/core/hooks/menu/use-collapse.ts +1 -1
- package/src/core/hooks/menu/use-mobile-menu-items.ts +91 -56
- package/src/core/hooks/menu/use-mobile-menu-levels.ts +14 -6
- package/src/core/hooks/prompt/use-prompt-actions.ts +28 -0
- package/src/core/hooks/prompt/use-prompt-text-limit.ts +59 -0
- package/src/core/hooks/search/use-persisted-quick-filter.ts +125 -0
- package/src/core/hooks/search/use-search-ai-activity.ts +31 -0
- package/src/core/hooks/use-connect-mcp-button.ts +13 -2
- package/src/core/hooks/use-consent-dialog.ts +51 -0
- package/src/core/hooks/use-consent-telemetry.ts +56 -0
- package/src/core/hooks/use-dialog-hotkeys.ts +11 -5
- package/src/core/hooks/use-full-height.ts +8 -8
- package/src/core/hooks/use-page-actions.ts +21 -9
- package/src/core/hooks/use-pointer-border-highlight.ts +46 -0
- package/src/core/hooks/use-scroll-item-into-view.ts +18 -0
- package/src/core/hooks/use-tab-list.ts +63 -0
- package/src/core/hooks/use-telemetry-fallback.ts +2 -0
- package/src/core/hooks/use-theme-hooks.ts +16 -0
- package/src/core/styles/dark.ts +2 -0
- package/src/core/styles/global.ts +96 -116
- package/src/core/styles/index.ts +2 -1
- package/src/core/styles/search-ai-appear.ts +16 -0
- package/src/core/types/code-walkthrough.ts +103 -0
- package/src/core/types/consent.ts +51 -0
- package/src/core/types/dropdown.ts +1 -0
- package/src/core/types/hooks.ts +8 -0
- package/src/core/types/index.ts +4 -0
- package/src/core/types/l10n.ts +46 -2
- package/src/core/types/mcp.ts +4 -2
- package/src/core/types/navigation-tabs.ts +54 -0
- package/src/core/types/prompt.ts +11 -0
- package/src/core/types/search.ts +23 -0
- package/src/core/utils/Dynamic.tsx +67 -35
- package/src/core/utils/assign-ref.ts +9 -0
- package/src/core/utils/consent-settings-link-placement.ts +18 -0
- package/src/core/utils/content-segments.ts +98 -6
- package/src/core/utils/download-code-walkthrough.ts +1 -1
- package/src/core/utils/dropdown.ts +14 -0
- package/src/core/utils/get-ai-prompt-link.ts +30 -0
- package/src/core/utils/get-code-walkthrough-file-text.ts +1 -1
- package/src/core/utils/index.ts +5 -0
- package/src/core/utils/match-code-walkthrough-conditions.ts +1 -1
- package/src/core/utils/mcp.ts +16 -4
- package/src/core/utils/menu.ts +54 -9
- package/src/core/utils/navigation-tabs.ts +99 -0
- package/src/core/utils/search-ai-activity.ts +110 -0
- package/src/core/utils/urls.ts +3 -1
- package/src/core/utils/with-load-progress.ts +23 -18
- package/src/ext/configure.ts +1 -1
- package/src/icons/CheckboxIcon/CheckboxIcon.tsx +1 -0
- package/src/icons/ChevronSortIcon/ChevronSortIcon.tsx +1 -0
- package/src/icons/ExpandCollapseIcon/ExpandCollapseIcon.tsx +56 -0
- package/src/icons/LinkIcon/LinkIconSymbol.tsx +51 -0
- package/src/index.ts +8 -0
- package/src/layouts/PageLayout.tsx +1 -1
- package/src/layouts/RootLayout.tsx +2 -2
- package/src/markdoc/components/CodeWalkthrough/CodeFilters.tsx +2 -2
- package/src/markdoc/components/CodeWalkthrough/CodePanel.tsx +4 -4
- package/src/markdoc/components/CodeWalkthrough/CodePanelHeader.tsx +1 -1
- package/src/markdoc/components/CodeWalkthrough/CodePanelToolbar.tsx +1 -1
- package/src/markdoc/components/CodeWalkthrough/CodeStep.tsx +1 -1
- package/src/markdoc/components/CodeWalkthrough/CodeWalkthrough.tsx +2 -2
- package/src/markdoc/components/Prompt/Prompt.tsx +219 -0
- package/src/markdoc/components/Prompt/PromptActions.tsx +104 -0
- package/src/markdoc/components/Prompt/PromptBody.tsx +107 -0
- package/src/markdoc/components/Prompt/PromptCopyButton.tsx +73 -0
- package/src/markdoc/components/Prompt/PromptHeader.tsx +81 -0
- package/src/markdoc/components/Prompt/PromptShowHideButton.tsx +43 -0
- package/src/markdoc/components/Prompt/PromptToggleLabel.tsx +41 -0
- package/src/markdoc/components/Prompt/variables.dark.ts +5 -0
- package/src/markdoc/components/Prompt/variables.ts +41 -0
- package/src/markdoc/components/Tabs/TabList.tsx +9 -12
- package/src/markdoc/components/default.ts +1 -0
- package/src/markdoc/default.ts +2 -0
- package/src/markdoc/tags/code-walkthrough.ts +1 -1
- package/src/markdoc/tags/connect-mcp.ts +16 -1
- package/src/markdoc/tags/prompt.ts +58 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.PromptBody = PromptBody;
|
|
40
|
+
const react_1 = __importDefault(require("react"));
|
|
41
|
+
const styled_components_1 = __importStar(require("styled-components"));
|
|
42
|
+
const Button_1 = require("../../../components/Button/Button");
|
|
43
|
+
const ChevronDownIcon_1 = require("../../../icons/ChevronDownIcon/ChevronDownIcon");
|
|
44
|
+
const ChevronUpIcon_1 = require("../../../icons/ChevronUpIcon/ChevronUpIcon");
|
|
45
|
+
const hooks_1 = require("../../../core/hooks");
|
|
46
|
+
function PromptBody({ prompt, textRef, textLimit, isExpanded, hasHiddenText, onToggleExpanded, controls, className, }) {
|
|
47
|
+
const { useTranslate } = (0, hooks_1.useThemeHooks)();
|
|
48
|
+
const { translate } = useTranslate();
|
|
49
|
+
return (react_1.default.createElement(PromptBodyWrapper, { "data-component-name": "Markdoc/Prompt/PromptBody", className: className },
|
|
50
|
+
react_1.default.createElement(ZoneWrapper, null,
|
|
51
|
+
react_1.default.createElement(TextWrapper, { ref: textRef, $textLimit: textLimit }, prompt),
|
|
52
|
+
controls),
|
|
53
|
+
hasHiddenText || isExpanded ? (react_1.default.createElement(Button_1.Button, { variant: "ghost", size: "small", icon: isExpanded ? react_1.default.createElement(ChevronUpIcon_1.ChevronUpIcon, null) : react_1.default.createElement(ChevronDownIcon_1.ChevronDownIcon, null), iconPosition: "right", onClick: onToggleExpanded }, isExpanded
|
|
54
|
+
? translate('promptTag.showLess', 'Show less')
|
|
55
|
+
: translate('promptTag.showFullPrompt', 'Show full prompt'))) : null));
|
|
56
|
+
}
|
|
57
|
+
const PromptBodyWrapper = styled_components_1.default.div `
|
|
58
|
+
display: flex;
|
|
59
|
+
flex-direction: column;
|
|
60
|
+
align-items: flex-start;
|
|
61
|
+
gap: var(--prompt-body-toggle-gap);
|
|
62
|
+
`;
|
|
63
|
+
const ZoneWrapper = styled_components_1.default.div `
|
|
64
|
+
display: flex;
|
|
65
|
+
align-items: flex-start;
|
|
66
|
+
width: 100%;
|
|
67
|
+
gap: var(--prompt-body-gap);
|
|
68
|
+
padding: var(--prompt-body-padding-vertical) var(--prompt-body-padding-horizontal);
|
|
69
|
+
background-color: var(--prompt-body-bg-color);
|
|
70
|
+
border-radius: var(--prompt-body-border-radius);
|
|
71
|
+
`;
|
|
72
|
+
/* width: 0 keeps the nowrap text from widening the block; flex-grow gives the text the real width. */
|
|
73
|
+
const TextWrapper = styled_components_1.default.div `
|
|
74
|
+
flex: 1 1 0;
|
|
75
|
+
width: 0;
|
|
76
|
+
min-width: 0;
|
|
77
|
+
white-space: pre-wrap;
|
|
78
|
+
overflow: visible;
|
|
79
|
+
overflow-wrap: anywhere;
|
|
80
|
+
font-size: var(--prompt-body-font-size);
|
|
81
|
+
line-height: var(--prompt-body-line-height);
|
|
82
|
+
color: var(--prompt-body-text-color);
|
|
83
|
+
|
|
84
|
+
${({ $textLimit }) => $textLimit === 'maxLines' &&
|
|
85
|
+
(0, styled_components_1.css) `
|
|
86
|
+
display: -webkit-box;
|
|
87
|
+
-webkit-box-orient: vertical;
|
|
88
|
+
-webkit-line-clamp: var(--prompt-body-max-lines);
|
|
89
|
+
overflow: hidden;
|
|
90
|
+
`}
|
|
91
|
+
|
|
92
|
+
${({ $textLimit }) => $textLimit === 'oneLine' &&
|
|
93
|
+
(0, styled_components_1.css) `
|
|
94
|
+
white-space: nowrap;
|
|
95
|
+
overflow: hidden;
|
|
96
|
+
text-overflow: ellipsis;
|
|
97
|
+
`}
|
|
98
|
+
`;
|
|
99
|
+
//# sourceMappingURL=PromptBody.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { JSX } from 'react';
|
|
2
|
+
export type PromptCopyButtonPlacement = 'header' | 'body' | 'standalone';
|
|
3
|
+
export type PromptCopyButtonProps = {
|
|
4
|
+
prompt: string;
|
|
5
|
+
/** `header` next to the split button, `body` inside the prompt zone, `standalone` for the button-only variant. */
|
|
6
|
+
placement: PromptCopyButtonPlacement;
|
|
7
|
+
onCopy: () => void;
|
|
8
|
+
className?: string;
|
|
9
|
+
};
|
|
10
|
+
export declare function PromptCopyButton({ prompt, placement, onCopy, className, }: PromptCopyButtonProps): JSX.Element;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.PromptCopyButton = PromptCopyButton;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
+
const CopyButton_1 = require("../../../components/Buttons/CopyButton");
|
|
10
|
+
const hooks_1 = require("../../../core/hooks");
|
|
11
|
+
function PromptCopyButton({ prompt, placement, onCopy, className, }) {
|
|
12
|
+
const { useTranslate } = (0, hooks_1.useThemeHooks)();
|
|
13
|
+
const { translate } = useTranslate();
|
|
14
|
+
if (placement === 'standalone') {
|
|
15
|
+
return (react_1.default.createElement(CopyButton_1.CopyButton, { data: prompt, type: "compound", variant: "secondary", size: "small", buttonText: translate('promptTag.copy.buttonText', 'Copy prompt'), onCopyClick: onCopy, dataTestId: "prompt-copy-button", className: className }));
|
|
16
|
+
}
|
|
17
|
+
if (placement === 'header') {
|
|
18
|
+
return (react_1.default.createElement(HeaderCopyButtonWrapper, { data: prompt, variant: "outlined", size: "small", onCopyClick: onCopy, dataTestId: "prompt-header-copy-button", className: className }));
|
|
19
|
+
}
|
|
20
|
+
return (react_1.default.createElement(CopyButton_1.CopyButton, { data: prompt, variant: "text", size: "small", onCopyClick: onCopy, dataTestId: "prompt-copy-button", className: className }));
|
|
21
|
+
}
|
|
22
|
+
/* The outlined border adds to the box; the smaller padding keeps the 24px height of the sibling buttons. */
|
|
23
|
+
const HeaderCopyButtonWrapper = (0, styled_components_1.default)(CopyButton_1.CopyButton) `
|
|
24
|
+
&& .button {
|
|
25
|
+
--button-icon-padding: var(--prompt-header-copy-button-padding);
|
|
26
|
+
}
|
|
27
|
+
`;
|
|
28
|
+
//# sourceMappingURL=PromptCopyButton.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { JSX, ReactNode } from 'react';
|
|
2
|
+
export type PromptHeaderProps = {
|
|
3
|
+
title?: string;
|
|
4
|
+
icon?: string;
|
|
5
|
+
iconRawContent?: string;
|
|
6
|
+
controls?: ReactNode;
|
|
7
|
+
className?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare function PromptHeader({ title, icon, iconRawContent, controls, className, }: PromptHeaderProps): JSX.Element;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.PromptHeader = PromptHeader;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
+
const AiStarsIcon_1 = require("../../../icons/AiStarsIcon/AiStarsIcon");
|
|
10
|
+
const GenericIcon_1 = require("../../../icons/GenericIcon/GenericIcon");
|
|
11
|
+
function PromptHeader({ title, icon, iconRawContent, controls, className, }) {
|
|
12
|
+
return (react_1.default.createElement(PromptHeaderWrapper, { "data-component-name": "Markdoc/Prompt/PromptHeader", className: className },
|
|
13
|
+
react_1.default.createElement(IconWrapper, null, icon ? (react_1.default.createElement(GenericIcon_1.GenericIcon, { icon: icon, rawContent: iconRawContent })) : (react_1.default.createElement(AiStarsIcon_1.AiStarsIcon, { color: "--prompt-icon-color" }))),
|
|
14
|
+
title ? react_1.default.createElement(TitleWrapper, null, title) : null,
|
|
15
|
+
controls ? react_1.default.createElement(ControlsWrapper, null, controls) : null));
|
|
16
|
+
}
|
|
17
|
+
const PromptHeaderWrapper = styled_components_1.default.div `
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
gap: var(--prompt-header-gap);
|
|
21
|
+
`;
|
|
22
|
+
const IconWrapper = styled_components_1.default.div `
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
justify-content: center;
|
|
26
|
+
flex-shrink: 0;
|
|
27
|
+
width: var(--prompt-icon-size);
|
|
28
|
+
height: var(--prompt-icon-size);
|
|
29
|
+
color: var(--prompt-icon-color);
|
|
30
|
+
--icon-width: var(--prompt-icon-size);
|
|
31
|
+
--icon-height: var(--prompt-icon-size);
|
|
32
|
+
--icon-color: var(--prompt-icon-color);
|
|
33
|
+
|
|
34
|
+
svg {
|
|
35
|
+
width: 100%;
|
|
36
|
+
height: 100%;
|
|
37
|
+
}
|
|
38
|
+
`;
|
|
39
|
+
const TitleWrapper = styled_components_1.default.div `
|
|
40
|
+
flex: 1;
|
|
41
|
+
min-width: 0;
|
|
42
|
+
overflow: hidden;
|
|
43
|
+
text-overflow: ellipsis;
|
|
44
|
+
white-space: nowrap;
|
|
45
|
+
font-size: var(--prompt-title-font-size);
|
|
46
|
+
font-weight: var(--prompt-title-font-weight);
|
|
47
|
+
line-height: var(--prompt-title-line-height);
|
|
48
|
+
color: var(--prompt-title-text-color);
|
|
49
|
+
`;
|
|
50
|
+
const ControlsWrapper = styled_components_1.default.div `
|
|
51
|
+
display: flex;
|
|
52
|
+
align-items: center;
|
|
53
|
+
flex-shrink: 0;
|
|
54
|
+
margin-left: auto;
|
|
55
|
+
gap: var(--prompt-header-actions-gap);
|
|
56
|
+
`;
|
|
57
|
+
//# sourceMappingURL=PromptHeader.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { JSX } from 'react';
|
|
2
|
+
export type PromptShowHideButtonProps = {
|
|
3
|
+
isPromptVisible: boolean;
|
|
4
|
+
onToggle: () => void;
|
|
5
|
+
className?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function PromptShowHideButton({ isPromptVisible, onToggle, className, }: PromptShowHideButtonProps): JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.PromptShowHideButton = PromptShowHideButton;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const Button_1 = require("../../../components/Button/Button");
|
|
9
|
+
const ChevronDownIcon_1 = require("../../../icons/ChevronDownIcon/ChevronDownIcon");
|
|
10
|
+
const ChevronUpIcon_1 = require("../../../icons/ChevronUpIcon/ChevronUpIcon");
|
|
11
|
+
const hooks_1 = require("../../../core/hooks");
|
|
12
|
+
const PromptToggleLabel_1 = require("../../../markdoc/components/Prompt/PromptToggleLabel");
|
|
13
|
+
function PromptShowHideButton({ isPromptVisible, onToggle, className, }) {
|
|
14
|
+
const { useTranslate } = (0, hooks_1.useThemeHooks)();
|
|
15
|
+
const { translate } = useTranslate();
|
|
16
|
+
const showPromptLabel = translate('promptTag.showPrompt', 'Show prompt');
|
|
17
|
+
const hidePromptLabel = translate('promptTag.hidePrompt', 'Hide prompt');
|
|
18
|
+
return (react_1.default.createElement(Button_1.Button, { "data-component-name": "Markdoc/Prompt/PromptShowHideButton", className: className, variant: "text", size: "small", icon: isPromptVisible ? react_1.default.createElement(ChevronUpIcon_1.ChevronUpIcon, null) : react_1.default.createElement(ChevronDownIcon_1.ChevronDownIcon, null), iconPosition: "right", onClick: onToggle },
|
|
19
|
+
react_1.default.createElement(PromptToggleLabel_1.PromptToggleLabel, { active: isPromptVisible ? hidePromptLabel : showPromptLabel, inactive: isPromptVisible ? showPromptLabel : hidePromptLabel })));
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=PromptShowHideButton.js.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.PromptToggleLabel = PromptToggleLabel;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
+
/* Both labels share one grid cell, so the toggle keeps the width of the longer label
|
|
10
|
+
and the buttons next to it do not move when the label changes. */
|
|
11
|
+
function PromptToggleLabel({ active, inactive, className, }) {
|
|
12
|
+
return (react_1.default.createElement(PromptToggleLabelWrapper, { "data-component-name": "Markdoc/Prompt/PromptToggleLabel", className: className },
|
|
13
|
+
react_1.default.createElement("span", null, active),
|
|
14
|
+
react_1.default.createElement("span", { "aria-hidden": "true" }, inactive)));
|
|
15
|
+
}
|
|
16
|
+
const PromptToggleLabelWrapper = styled_components_1.default.span `
|
|
17
|
+
display: grid;
|
|
18
|
+
text-align: center;
|
|
19
|
+
|
|
20
|
+
> span {
|
|
21
|
+
grid-area: 1 / 1;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
> span[aria-hidden='true'] {
|
|
25
|
+
visibility: hidden;
|
|
26
|
+
}
|
|
27
|
+
`;
|
|
28
|
+
//# sourceMappingURL=PromptToggleLabel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const promptTag: import("styled-components").RuleSet<object>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const promptTagDarkMode: import("styled-components").RuleSet<object>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.promptTagDarkMode = void 0;
|
|
4
|
+
const styled_components_1 = require("styled-components");
|
|
5
|
+
exports.promptTagDarkMode = (0, styled_components_1.css) `
|
|
6
|
+
--prompt-body-bg-color: var(--color-brand-subtle-bg, var(--color-warm-grey-3)); // @presenter Color
|
|
7
|
+
`;
|
|
8
|
+
//# sourceMappingURL=variables.dark.js.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.promptTag = void 0;
|
|
4
|
+
const styled_components_1 = require("styled-components");
|
|
5
|
+
exports.promptTag = (0, styled_components_1.css) `
|
|
6
|
+
/**
|
|
7
|
+
* @tokens Prompt
|
|
8
|
+
**/
|
|
9
|
+
--prompt-bg-color: var(--bg-color); // @presenter Color
|
|
10
|
+
--prompt-border-color: var(--border-color-secondary); // @presenter Color
|
|
11
|
+
--prompt-border-width: var(--border-width); // @presenter Border
|
|
12
|
+
--prompt-border-radius: var(--border-radius-xl); // @presenter BorderRadius
|
|
13
|
+
--prompt-margin: var(--spacing-base) 0; // @presenter Spacing
|
|
14
|
+
--prompt-padding-vertical: var(--spacing-sm); // @presenter Spacing
|
|
15
|
+
--prompt-padding-horizontal: var(--spacing-base); // @presenter Spacing
|
|
16
|
+
--prompt-gap: var(--spacing-sm); // @presenter Spacing
|
|
17
|
+
--prompt-border-highlight-color-start: var(--search-ai-gradient-start-color, var(--search-ai-gradient-start-color-legacy)); // @presenter Color
|
|
18
|
+
--prompt-border-highlight-color-end: var(--search-ai-gradient-end-color, var(--search-ai-gradient-end-color-legacy)); // @presenter Color
|
|
19
|
+
--prompt-border-highlight-size: 120px;
|
|
20
|
+
--prompt-border-highlight-transition: opacity 0.2s ease-out;
|
|
21
|
+
|
|
22
|
+
--prompt-header-gap: var(--spacing-xs); // @presenter Spacing
|
|
23
|
+
--prompt-header-actions-gap: var(--spacing-xxs); // @presenter Spacing
|
|
24
|
+
--prompt-header-copy-button-padding: var(--spacing-xxs); // @presenter Spacing
|
|
25
|
+
--prompt-icon-size: 18px;
|
|
26
|
+
--prompt-icon-color: var(--color-primary-base, var(--color-warm-grey-11)); // @presenter Color
|
|
27
|
+
--prompt-title-font-size: var(--font-size-base); // @presenter FontSize
|
|
28
|
+
--prompt-title-font-weight: var(--font-weight-semibold); // @presenter FontWeight
|
|
29
|
+
--prompt-title-line-height: var(--line-height-base); // @presenter LineHeight
|
|
30
|
+
--prompt-title-text-color: var(--text-color-primary); // @presenter Color
|
|
31
|
+
|
|
32
|
+
--prompt-body-bg-color: var(--color-primary-bg, var(--color-warm-grey-2)); // @presenter Color
|
|
33
|
+
--prompt-body-border-radius: var(--border-radius-lg); // @presenter BorderRadius
|
|
34
|
+
--prompt-body-padding-vertical: var(--spacing-xs); // @presenter Spacing
|
|
35
|
+
--prompt-body-padding-horizontal: var(--spacing-sm); // @presenter Spacing
|
|
36
|
+
--prompt-body-gap: var(--spacing-xxs); // @presenter Spacing
|
|
37
|
+
--prompt-body-font-size: var(--font-size-base); // @presenter FontSize
|
|
38
|
+
--prompt-body-line-height: var(--line-height-base); // @presenter LineHeight
|
|
39
|
+
--prompt-body-text-color: var(--text-color-primary); // @presenter Color
|
|
40
|
+
--prompt-body-max-lines: 5;
|
|
41
|
+
--prompt-body-toggle-gap: var(--spacing-xxs); // @presenter Spacing
|
|
42
|
+
// @tokens End
|
|
43
|
+
`;
|
|
44
|
+
//# sourceMappingURL=variables.js.map
|
|
@@ -152,7 +152,7 @@ function TabList({ childrenArray, size, activeTab, onTabChange, containerRef, on
|
|
|
152
152
|
overflowTabs.some((i) => childrenArray[i] && activeTab === childrenArray[i].props.label);
|
|
153
153
|
// Show as selector when no visible tabs (all tabs in dropdown)
|
|
154
154
|
const showAsSelector = visibleTabs.length === 0 && hasOverflow;
|
|
155
|
-
const { dropdownPosition, setIsDropdownOpen, setDropdownPosition } = useDropdownPosition(hasOverflow, dropdownRef);
|
|
155
|
+
const { dropdownPosition, isDropdownOpen, setIsDropdownOpen, setDropdownPosition } = useDropdownPosition(hasOverflow, dropdownRef);
|
|
156
156
|
return (react_1.default.createElement(exports.TabListContainer, { role: "tablist", ref: containerRef },
|
|
157
157
|
react_1.default.createElement(HighlightBar, { $size: size, style: highlightStyle },
|
|
158
158
|
react_1.default.createElement("div", null)),
|
|
@@ -163,11 +163,9 @@ function TabList({ childrenArray, size, activeTab, onTabChange, containerRef, on
|
|
|
163
163
|
return null;
|
|
164
164
|
return renderTab(child, index, size, setTabRef, handleKeyboard, onTabClick);
|
|
165
165
|
}),
|
|
166
|
-
hasOverflow && (react_1.default.createElement(exports.TabItem, { size: size, active: isMoreActive || showAsSelector, tabIndex: 0, className:
|
|
167
|
-
react_1.default.createElement(DropdownWrapper, { $top: dropdownPosition.top, $left: dropdownPosition.left,
|
|
168
|
-
|
|
169
|
-
} },
|
|
170
|
-
react_1.default.createElement(FixedPositionDropdown, { ref: dropdownRef, trigger: react_1.default.createElement(exports.TabButtonLink, { size: size, className: isMoreActive || showAsSelector ? 'active' : undefined }, showAsSelector ? react_1.default.createElement(TabButtonText, null, activeTab) : 'More'), alignment: "start", withArrow: true, onClose: () => {
|
|
166
|
+
hasOverflow && (react_1.default.createElement(exports.TabItem, { size: size, active: isMoreActive || showAsSelector, tabIndex: 0, className: isDropdownOpen ? 'dropdown-tab dropdown-tab-open' : 'dropdown-tab' },
|
|
167
|
+
react_1.default.createElement(DropdownWrapper, { $top: dropdownPosition.top, $left: dropdownPosition.left },
|
|
168
|
+
react_1.default.createElement(FixedPositionDropdown, { ref: dropdownRef, trigger: react_1.default.createElement(exports.TabButtonLink, { size: size, className: isMoreActive || showAsSelector ? 'active' : undefined }, showAsSelector ? react_1.default.createElement(TabButtonText, null, activeTab) : 'More'), alignment: "start", withArrow: true, onOpen: () => setIsDropdownOpen(true), onClose: () => {
|
|
171
169
|
setIsDropdownOpen(false);
|
|
172
170
|
setDropdownPosition({});
|
|
173
171
|
} },
|
|
@@ -259,6 +257,10 @@ exports.TabListContainer = styled_components_1.default.ul `
|
|
|
259
257
|
min-width: 0;
|
|
260
258
|
max-width: 100%;
|
|
261
259
|
}
|
|
260
|
+
|
|
261
|
+
&.dropdown-tab-open {
|
|
262
|
+
z-index: var(--dropdown-menu-z-index);
|
|
263
|
+
}
|
|
262
264
|
}
|
|
263
265
|
}
|
|
264
266
|
`;
|
|
@@ -28,3 +28,4 @@ export * from '../../markdoc/components/Icon/Icon';
|
|
|
28
28
|
export * from '../../markdoc/components/ConnectMCP/ConnectMCP';
|
|
29
29
|
export * from '../../markdoc/components/LoginButton/LoginButton';
|
|
30
30
|
export * from '../../markdoc/components/MarkdownLink/MarkdownLink';
|
|
31
|
+
export * from '../../markdoc/components/Prompt/Prompt';
|
|
@@ -44,4 +44,5 @@ __exportStar(require("../../markdoc/components/Icon/Icon"), exports);
|
|
|
44
44
|
__exportStar(require("../../markdoc/components/ConnectMCP/ConnectMCP"), exports);
|
|
45
45
|
__exportStar(require("../../markdoc/components/LoginButton/LoginButton"), exports);
|
|
46
46
|
__exportStar(require("../../markdoc/components/MarkdownLink/MarkdownLink"), exports);
|
|
47
|
+
__exportStar(require("../../markdoc/components/Prompt/Prompt"), exports);
|
|
47
48
|
//# sourceMappingURL=default.js.map
|
package/lib/markdoc/default.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ import { icon } from '../markdoc/tags/icon';
|
|
|
30
30
|
import { connectMcp } from '../markdoc/tags/connect-mcp';
|
|
31
31
|
import { loginButton } from '../markdoc/tags/login-button';
|
|
32
32
|
import { diagram } from '../markdoc/tags/diagram';
|
|
33
|
+
import { prompt } from '../markdoc/tags/prompt';
|
|
33
34
|
export declare const tags: {
|
|
34
35
|
[accordion.tagName]: import("./tags/types").MarkdocTagSchema;
|
|
35
36
|
[accordionGroup.tagName]: import("./tags/types").MarkdocTagSchema;
|
|
@@ -56,4 +57,5 @@ export declare const tags: {
|
|
|
56
57
|
[connectMcp.tagName]: import("./tags/types").MarkdocTagSchema;
|
|
57
58
|
[loginButton.tagName]: import("./tags/types").MarkdocTagSchema;
|
|
58
59
|
[diagram.tagName]: import("./tags/types").MarkdocTagSchema;
|
|
60
|
+
[prompt.tagName]: import("./tags/types").MarkdocTagSchema;
|
|
59
61
|
};
|
package/lib/markdoc/default.js
CHANGED
|
@@ -72,6 +72,7 @@ const icon_1 = require("../markdoc/tags/icon");
|
|
|
72
72
|
const connect_mcp_1 = require("../markdoc/tags/connect-mcp");
|
|
73
73
|
const login_button_1 = require("../markdoc/tags/login-button");
|
|
74
74
|
const diagram_1 = require("../markdoc/tags/diagram");
|
|
75
|
+
const prompt_1 = require("../markdoc/tags/prompt");
|
|
75
76
|
exports.tags = {
|
|
76
77
|
[accordion_1.accordion.tagName]: accordion_1.accordion.schema,
|
|
77
78
|
[accordion_group_1.accordionGroup.tagName]: accordion_group_1.accordionGroup.schema,
|
|
@@ -98,5 +99,6 @@ exports.tags = {
|
|
|
98
99
|
[connect_mcp_1.connectMcp.tagName]: connect_mcp_1.connectMcp.schema,
|
|
99
100
|
[login_button_1.loginButton.tagName]: login_button_1.loginButton.schema,
|
|
100
101
|
[diagram_1.diagram.tagName]: diagram_1.diagram.schema,
|
|
102
|
+
[prompt_1.prompt.tagName]: prompt_1.prompt.schema,
|
|
101
103
|
};
|
|
102
104
|
//# sourceMappingURL=default.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Node, RenderableTreeNode } from '@markdoc/markdoc';
|
|
2
2
|
import type { MarkdocSchemaWrapper } from '../../markdoc/tags/types';
|
|
3
|
-
import type { CodeWalkthroughConditions, CodeWalkthroughFilter, TogglesMarkdocAttr, InputsMarkdocAttr } from '
|
|
3
|
+
import type { CodeWalkthroughConditions, CodeWalkthroughFilter, TogglesMarkdocAttr, InputsMarkdocAttr } from '../../core/types';
|
|
4
4
|
export declare const codeWalkthrough: MarkdocSchemaWrapper;
|
|
5
5
|
export declare function collectStepsFromChildren(children: RenderableTreeNode[], idx?: number): RenderableTreeNode[];
|
|
6
6
|
export declare function collectTogglesFromChildren(children: Node[], toggles?: TogglesMarkdocAttr): TogglesMarkdocAttr;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.connectMcp = void 0;
|
|
4
4
|
const constants_1 = require("../../core/constants");
|
|
5
|
+
const utils_1 = require("../../core/utils");
|
|
5
6
|
exports.connectMcp = {
|
|
6
7
|
schema: {
|
|
7
8
|
render: 'ConnectMCP',
|
|
@@ -19,6 +20,20 @@ exports.connectMcp = {
|
|
|
19
20
|
options: {
|
|
20
21
|
type: Array,
|
|
21
22
|
default: constants_1.DEFAULT_MCP_OPTIONS,
|
|
23
|
+
validate(value) {
|
|
24
|
+
if (!Array.isArray(value))
|
|
25
|
+
return [];
|
|
26
|
+
const unknownOptions = value.filter((option) => !(0, utils_1.isMCPOption)(option));
|
|
27
|
+
if (unknownOptions.length === 0)
|
|
28
|
+
return [];
|
|
29
|
+
return [
|
|
30
|
+
{
|
|
31
|
+
id: 'invalid-connect-mcp-options',
|
|
32
|
+
level: 'error',
|
|
33
|
+
message: `Invalid connect-mcp options: ${unknownOptions.join(', ')}. Must be one of: ${constants_1.MCP_OPTIONS.join(', ')}`,
|
|
34
|
+
},
|
|
35
|
+
];
|
|
36
|
+
},
|
|
22
37
|
},
|
|
23
38
|
},
|
|
24
39
|
selfClosing: true,
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.prompt = void 0;
|
|
7
|
+
const markdoc_1 = __importDefault(require("@markdoc/markdoc"));
|
|
8
|
+
const constants_1 = require("../../core/constants");
|
|
9
|
+
const ALLOWED_ACTIONS = Object.values(constants_1.AI_PROMPT_TARGETS);
|
|
10
|
+
exports.prompt = {
|
|
11
|
+
schema: {
|
|
12
|
+
render: 'Prompt',
|
|
13
|
+
attributes: {
|
|
14
|
+
title: { type: String },
|
|
15
|
+
icon: { type: String, resolver: 'relativeOrCdnIcon' },
|
|
16
|
+
iconRawContent: { type: String, render: true }, // internal
|
|
17
|
+
actions: { type: Array, default: [] },
|
|
18
|
+
hidePrompt: { type: Boolean, default: false },
|
|
19
|
+
singleLine: { type: Boolean, default: false },
|
|
20
|
+
buttonOnly: { type: Boolean, default: false },
|
|
21
|
+
rawContent: { type: String, render: false, resolver: 'tagRawContent' }, // internal
|
|
22
|
+
},
|
|
23
|
+
transform(node, config) {
|
|
24
|
+
const attributes = node.transformAttributes(config);
|
|
25
|
+
const actions = Array.isArray(attributes.actions)
|
|
26
|
+
? [...new Set(attributes.actions.filter((action) => ALLOWED_ACTIONS.includes(action)))]
|
|
27
|
+
: [];
|
|
28
|
+
const prompt = getRawBody(node);
|
|
29
|
+
return new markdoc_1.default.Tag('Prompt', Object.assign(Object.assign({}, attributes), { actions, prompt }), []);
|
|
30
|
+
},
|
|
31
|
+
validate(node) {
|
|
32
|
+
const errors = [];
|
|
33
|
+
const { actions } = node.attributes;
|
|
34
|
+
if (Array.isArray(actions)) {
|
|
35
|
+
for (const action of actions) {
|
|
36
|
+
if (!ALLOWED_ACTIONS.includes(action)) {
|
|
37
|
+
errors.push({
|
|
38
|
+
id: 'prompt-unknown-action',
|
|
39
|
+
level: 'error',
|
|
40
|
+
message: `attribute "actions" contains unknown value "${action}"; allowed values: ${ALLOWED_ACTIONS.join(', ')}`,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return errors;
|
|
46
|
+
},
|
|
47
|
+
// The prompt is for human readers: it stays out of the .md page, llms.txt, and AI search.
|
|
48
|
+
renderForLlms: () => '',
|
|
49
|
+
},
|
|
50
|
+
tagName: constants_1.PROMPT_TAG,
|
|
51
|
+
};
|
|
52
|
+
function getRawBody(node) {
|
|
53
|
+
const rawContent = node.attributes.rawContent;
|
|
54
|
+
return typeof rawContent === 'string' ? rawContent : '';
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=prompt.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/theme",
|
|
3
|
-
"version": "0.70.0-next.
|
|
3
|
+
"version": "0.70.0-next.11",
|
|
4
4
|
"description": "Shared UI components lib",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"theme",
|
|
@@ -42,7 +42,8 @@
|
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@babel/core": "7.29.7",
|
|
44
44
|
"@markdoc/markdoc": "0.5.2",
|
|
45
|
-
"@redocly/realm-asyncapi-sdk": "0.16.0-next.
|
|
45
|
+
"@redocly/realm-asyncapi-sdk": "0.16.0-next.5",
|
|
46
|
+
"@redocly/tooling-test-utils": "0.0.0",
|
|
46
47
|
"@shikijs/types": "3.21.0",
|
|
47
48
|
"@testing-library/react": "16.3.0",
|
|
48
49
|
"@testing-library/user-event": "14.6.1",
|
|
@@ -51,7 +52,6 @@
|
|
|
51
52
|
"@types/lodash.debounce": "4.0.9",
|
|
52
53
|
"@types/lodash.throttle": "4.1.9",
|
|
53
54
|
"@types/node": "24.1.0",
|
|
54
|
-
"@types/nprogress": "0.2.3",
|
|
55
55
|
"@types/react": "^19.2.7",
|
|
56
56
|
"@types/react-dom": "^19.2.3",
|
|
57
57
|
"@vitest/coverage-v8": "4.1.11",
|
|
@@ -61,17 +61,14 @@
|
|
|
61
61
|
"resize-observer-polyfill": "1.5.1",
|
|
62
62
|
"rimraf": "5.0.7",
|
|
63
63
|
"styled-components": "^6.4.2",
|
|
64
|
-
"ts-node": "10.9.2",
|
|
65
64
|
"tsc-alias": "1.8.16",
|
|
66
|
-
"tsconfig-paths": "4.2.0",
|
|
67
|
-
"tsconfig-paths-webpack-plugin": "3.5.2",
|
|
68
65
|
"typescript": "6.0.3",
|
|
69
66
|
"vitest": "4.1.11",
|
|
70
67
|
"vitest-when": "0.6.2",
|
|
71
68
|
"webpack": "5.105.2"
|
|
72
69
|
},
|
|
73
70
|
"dependencies": {
|
|
74
|
-
"@redocly/config": "0.
|
|
71
|
+
"@redocly/config": "0.65.0",
|
|
75
72
|
"@tanstack/react-query": "5.62.3",
|
|
76
73
|
"@tanstack/react-virtual": "3.13.0",
|
|
77
74
|
"@xyflow/react": "12.8.3",
|
|
@@ -83,7 +80,6 @@
|
|
|
83
80
|
"jszip": "3.10.1",
|
|
84
81
|
"lodash.debounce": "^4.0.8",
|
|
85
82
|
"lodash.throttle": "4.1.1",
|
|
86
|
-
"nprogress": "0.2.0",
|
|
87
83
|
"openapi-sampler": "^1.7.6",
|
|
88
84
|
"react-calendar": "5.1.0",
|
|
89
85
|
"react-date-picker": "11.0.0"
|