@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,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.consent = void 0;
|
|
4
|
+
const styled_components_1 = require("styled-components");
|
|
5
|
+
exports.consent = (0, styled_components_1.css) `
|
|
6
|
+
/**
|
|
7
|
+
* @tokens Consent
|
|
8
|
+
*/
|
|
9
|
+
--consent-banner-width: 380px;
|
|
10
|
+
--consent-banner-offset: var(--spacing-base); // @presenter Spacing
|
|
11
|
+
--consent-banner-bg-color: var(--bg-color); // @presenter Color
|
|
12
|
+
--consent-banner-text-color: var(--text-color-primary); // @presenter Color
|
|
13
|
+
--consent-banner-border-color: var(--border-color-primary); // @presenter Color
|
|
14
|
+
--consent-banner-border-radius: var(--border-radius-lg);
|
|
15
|
+
--consent-banner-box-shadow: var(--bg-raised-shadow);
|
|
16
|
+
--consent-banner-padding: var(--spacing-base); // @presenter Spacing
|
|
17
|
+
--consent-banner-gap: var(--spacing-sm); // @presenter Spacing
|
|
18
|
+
--consent-banner-title-font-size: var(--font-size-base);
|
|
19
|
+
--consent-banner-font-size: var(--font-size-sm);
|
|
20
|
+
--consent-banner-z-index: var(--z-index-overlay);
|
|
21
|
+
|
|
22
|
+
--consent-dialog-width: 560px;
|
|
23
|
+
--consent-dialog-max-width: calc(100vw - 2 * var(--spacing-base));
|
|
24
|
+
--consent-dialog-padding: var(--spacing-lg); // @presenter Spacing
|
|
25
|
+
--consent-dialog-border-radius: var(--border-radius-lg);
|
|
26
|
+
--consent-dialog-bg-color: var(--modal-bg-color); // @presenter Color
|
|
27
|
+
--consent-dialog-box-shadow: var(--modal-box-shadow);
|
|
28
|
+
--consent-dialog-row-border-color: var(--border-color-primary); // @presenter Color
|
|
29
|
+
--consent-dialog-description-color: var(--text-color-secondary); // @presenter Color
|
|
30
|
+
`;
|
|
31
|
+
//# sourceMappingURL=variables.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { RenderableChildren } from '../../core/types';
|
|
2
|
+
import type { DropdownAlignment, RenderableChildren } from '../../core/types';
|
|
3
3
|
type DropdownMenuContext = {
|
|
4
4
|
close: () => void;
|
|
5
5
|
isOpen: boolean;
|
|
@@ -9,13 +9,15 @@ export type DropdownProps = {
|
|
|
9
9
|
children: RenderableChildren<DropdownMenuContext>;
|
|
10
10
|
triggerEvent?: 'click' | 'hover';
|
|
11
11
|
placement?: 'top' | 'bottom';
|
|
12
|
-
alignment?:
|
|
12
|
+
alignment?: DropdownAlignment;
|
|
13
13
|
active?: boolean;
|
|
14
14
|
closeOnClick?: boolean;
|
|
15
15
|
dataAttributes?: Record<string, string>;
|
|
16
16
|
className?: string;
|
|
17
17
|
withArrow?: boolean;
|
|
18
18
|
portalled?: boolean;
|
|
19
|
+
/** Element the menu lines up with when it is not the dropdown itself, e.g. a whole split button. */
|
|
20
|
+
alignmentAnchorRef?: React.RefObject<HTMLElement | null>;
|
|
19
21
|
onClick?: (event: React.UIEvent) => void;
|
|
20
22
|
onClose?: () => void;
|
|
21
23
|
onOpen?: () => void;
|
|
@@ -38,14 +38,17 @@ const react_1 = __importStar(require("react"));
|
|
|
38
38
|
const react_dom_1 = require("react-dom");
|
|
39
39
|
const styled_components_1 = __importStar(require("styled-components"));
|
|
40
40
|
const hooks_1 = require("../../core/hooks");
|
|
41
|
+
const utils_1 = require("../../core/utils");
|
|
41
42
|
const ChevronDownIcon_1 = require("../../icons/ChevronDownIcon/ChevronDownIcon");
|
|
42
43
|
const ChevronUpIcon_1 = require("../../icons/ChevronUpIcon/ChevronUpIcon");
|
|
43
44
|
const useIsomorphicLayoutEffect = typeof window !== 'undefined' ? react_1.useLayoutEffect : react_1.useEffect;
|
|
44
|
-
exports.Dropdown = (0, react_1.forwardRef)(({ children, className, active, trigger, triggerEvent = 'click', closeOnClick = true, withArrow, dataAttributes, placement, alignment, portalled = false, onClick, onClose, onOpen, }, ref) => {
|
|
45
|
+
exports.Dropdown = (0, react_1.forwardRef)(({ children, className, active, trigger, triggerEvent = 'click', closeOnClick = true, withArrow, dataAttributes, placement, alignment, portalled = false, alignmentAnchorRef, onClick, onClose, onOpen, }, ref) => {
|
|
46
|
+
var _a, _b;
|
|
45
47
|
const dropdownRef = (0, react_1.useRef)(null);
|
|
46
48
|
const menuRef = (0, react_1.useRef)(null);
|
|
47
49
|
const [isOpen, setIsOpen] = (0, hooks_1.useControlledState)(false, active);
|
|
48
50
|
const [menuStyle, setMenuStyle] = (0, react_1.useState)({});
|
|
51
|
+
const [fittedAlignment, setFittedAlignment] = (0, react_1.useState)(alignment);
|
|
49
52
|
const wrapperRef = ref || dropdownRef;
|
|
50
53
|
const handleOpen = () => {
|
|
51
54
|
setIsOpen(true);
|
|
@@ -77,13 +80,13 @@ exports.Dropdown = (0, react_1.forwardRef)(({ children, className, active, trigg
|
|
|
77
80
|
}
|
|
78
81
|
};
|
|
79
82
|
const updateMenuPosition = (0, react_1.useCallback)(() => {
|
|
80
|
-
var _a;
|
|
81
|
-
var
|
|
83
|
+
var _a, _b;
|
|
84
|
+
var _c, _d, _e;
|
|
82
85
|
const wrapper = wrapperRef.current;
|
|
83
86
|
if (!wrapper)
|
|
84
87
|
return;
|
|
85
|
-
const rect = wrapper.getBoundingClientRect();
|
|
86
|
-
const menuHeight = (
|
|
88
|
+
const rect = ((_c = alignmentAnchorRef === null || alignmentAnchorRef === void 0 ? void 0 : alignmentAnchorRef.current) !== null && _c !== void 0 ? _c : wrapper).getBoundingClientRect();
|
|
89
|
+
const menuHeight = (_d = (_a = menuRef.current) === null || _a === void 0 ? void 0 : _a.offsetHeight) !== null && _d !== void 0 ? _d : 0;
|
|
87
90
|
const fitsBelow = rect.bottom + menuHeight <= window.innerHeight;
|
|
88
91
|
const fitsAbove = rect.top - menuHeight >= 0;
|
|
89
92
|
const openUpward = placement === 'top' ? fitsAbove || !fitsBelow : !fitsBelow && fitsAbove;
|
|
@@ -94,7 +97,7 @@ exports.Dropdown = (0, react_1.forwardRef)(({ children, className, active, trigg
|
|
|
94
97
|
else {
|
|
95
98
|
style.top = rect.bottom;
|
|
96
99
|
}
|
|
97
|
-
if (alignment === 'end') {
|
|
100
|
+
if ((0, utils_1.fitDropdownAlignment)(rect, (_e = (_b = menuRef.current) === null || _b === void 0 ? void 0 : _b.offsetWidth) !== null && _e !== void 0 ? _e : 0, alignment) === 'end') {
|
|
98
101
|
style.right = window.innerWidth - rect.right;
|
|
99
102
|
}
|
|
100
103
|
else {
|
|
@@ -105,7 +108,25 @@ exports.Dropdown = (0, react_1.forwardRef)(({ children, className, active, trigg
|
|
|
105
108
|
style.zIndex = zIndex;
|
|
106
109
|
}
|
|
107
110
|
setMenuStyle(style);
|
|
108
|
-
}, [placement, alignment, wrapperRef]);
|
|
111
|
+
}, [placement, alignment, wrapperRef, alignmentAnchorRef]);
|
|
112
|
+
/* The absolute-positioned menu is placed by CSS, so the side is measured once it is
|
|
113
|
+
shown and again on resize; a side that runs off the viewport flips to the other one. */
|
|
114
|
+
const updateFittedAlignment = (0, react_1.useCallback)(() => {
|
|
115
|
+
var _a;
|
|
116
|
+
const wrapper = wrapperRef.current;
|
|
117
|
+
const menu = menuRef.current;
|
|
118
|
+
if (!wrapper || !menu)
|
|
119
|
+
return;
|
|
120
|
+
const rect = ((_a = alignmentAnchorRef === null || alignmentAnchorRef === void 0 ? void 0 : alignmentAnchorRef.current) !== null && _a !== void 0 ? _a : wrapper).getBoundingClientRect();
|
|
121
|
+
setFittedAlignment((0, utils_1.fitDropdownAlignment)(rect, menu.offsetWidth, alignment));
|
|
122
|
+
}, [alignment, wrapperRef, alignmentAnchorRef]);
|
|
123
|
+
useIsomorphicLayoutEffect(() => {
|
|
124
|
+
if (portalled || !isOpen)
|
|
125
|
+
return;
|
|
126
|
+
updateFittedAlignment();
|
|
127
|
+
window.addEventListener('resize', updateFittedAlignment);
|
|
128
|
+
return () => window.removeEventListener('resize', updateFittedAlignment);
|
|
129
|
+
}, [portalled, isOpen, updateFittedAlignment]);
|
|
109
130
|
useIsomorphicLayoutEffect(() => {
|
|
110
131
|
if (!portalled || !isOpen)
|
|
111
132
|
return;
|
|
@@ -120,8 +141,9 @@ exports.Dropdown = (0, react_1.forwardRef)(({ children, className, active, trigg
|
|
|
120
141
|
(0, hooks_1.useOutsideClick)(portalled ? [wrapperRef, menuRef] : wrapperRef, handleClose);
|
|
121
142
|
const menuContent = typeof children === 'function' ? children({ close: handleClose, isOpen }) : children;
|
|
122
143
|
const triggerChild = react_1.default.Children.only(trigger);
|
|
123
|
-
const
|
|
124
|
-
const
|
|
144
|
+
const isLinkTrigger = Boolean(((_a = triggerChild.props) === null || _a === void 0 ? void 0 : _a.to) || ((_b = triggerChild.props) === null || _b === void 0 ? void 0 : _b.href));
|
|
145
|
+
const dropdownTrigger = (0, react_1.cloneElement)(triggerChild, Object.assign(Object.assign(Object.assign({ onClick: triggerEvent === 'click' ? handleToggle : undefined, 'aria-haspopup': 'menu', 'aria-expanded': isOpen, icon: withArrow ? isOpen ? react_1.default.createElement(ChevronUpIcon_1.ChevronUpIcon, null) : react_1.default.createElement(ChevronDownIcon_1.ChevronDownIcon, null) : undefined }, (withArrow ? { iconPosition: 'right' } : {})), triggerChild.props), { onKeyDown: triggerEvent === 'click' || !isLinkTrigger ? handleKeyDown : undefined }));
|
|
146
|
+
const menu = (react_1.default.createElement(ChildrenWrapper, { ref: menuRef, $placement: placement, $alignment: fittedAlignment, $isOpen: isOpen, $portalled: portalled, style: portalled ? menuStyle : undefined, onClick: closeOnClick ? handleChildClick : undefined }, menuContent));
|
|
125
147
|
const portalledMenu = isOpen && typeof document !== 'undefined' ? (0, react_dom_1.createPortal)(menu, document.body) : null;
|
|
126
148
|
return (react_1.default.createElement(DropdownWrapper, Object.assign({ "data-component-name": "Dropdown/Dropdown", "data-testid": "dropdown" }, dataAttributes, { className: className, ref: wrapperRef, onPointerEnter: triggerEvent === 'hover' ? handleOpen : undefined, onPointerLeave: triggerEvent === 'hover' ? handleClose : undefined, onClick: onClick }),
|
|
127
149
|
dropdownTrigger,
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import type { ReactNode, JSX } from 'react';
|
|
3
3
|
import type { DropdownMenuItemProps } from '../../components/Dropdown/DropdownMenuItem';
|
|
4
4
|
export type DropdownMenuProps = {
|
|
5
|
+
id?: string;
|
|
5
6
|
className?: string;
|
|
6
7
|
role?: string;
|
|
7
8
|
footer?: React.ReactNode;
|
|
@@ -15,7 +15,7 @@ function DropdownMenu(props) {
|
|
|
15
15
|
if ('items' in props) {
|
|
16
16
|
content = props.items.map((item, idx) => (react_1.default.createElement(DropdownMenuItem_1.DropdownMenuItem, Object.assign({ key: idx }, item), item.content)));
|
|
17
17
|
}
|
|
18
|
-
return (react_1.default.createElement(DropdownMenuWrapper, { "data-component-name": "Dropdown/DropdownMenu", "data-testid": "dropdown-menu", className: props.className, role: props.role || 'menu' },
|
|
18
|
+
return (react_1.default.createElement(DropdownMenuWrapper, { "data-component-name": "Dropdown/DropdownMenu", "data-testid": "dropdown-menu", id: props.id, className: props.className, role: props.role || 'menu' },
|
|
19
19
|
content,
|
|
20
20
|
props.footer || null));
|
|
21
21
|
}
|
|
@@ -43,6 +43,7 @@ const hooks_1 = require("../../core/hooks");
|
|
|
43
43
|
function Reasons({ settings, onChange, className }) {
|
|
44
44
|
const { label, component = 'checkbox', items = [] } = settings;
|
|
45
45
|
const [checkedState, setCheckedState] = React.useState(new Array(items.length).fill(false));
|
|
46
|
+
const idPrefix = React.useId();
|
|
46
47
|
const { useTranslate } = (0, hooks_1.useThemeHooks)();
|
|
47
48
|
const { translate } = useTranslate();
|
|
48
49
|
if (!items.length) {
|
|
@@ -59,8 +60,8 @@ function Reasons({ settings, onChange, className }) {
|
|
|
59
60
|
React.createElement(Label, null, label ||
|
|
60
61
|
translate('feedback.settings.reasons.label', 'Which statement describes your thoughts about this page?')),
|
|
61
62
|
items.map((reason, idx) => (React.createElement(OptionWrapper, { key: reason },
|
|
62
|
-
React.createElement("input", { type: component, value: reason, checked: checkedState[idx], name: "reasons", onChange: () => handleOptionChange(idx) }),
|
|
63
|
-
React.createElement("label", { "data-translation-key": `feedback.settings.reasons.items.${idx + 1}`,
|
|
63
|
+
React.createElement("input", { id: `${idPrefix}-${idx}`, type: component, value: reason, checked: checkedState[idx], name: "reasons", onChange: () => handleOptionChange(idx) }),
|
|
64
|
+
React.createElement("label", { "data-translation-key": `feedback.settings.reasons.items.${idx + 1}`, htmlFor: `${idPrefix}-${idx}` }, translate(`feedback.settings.reasons.items.${idx + 1}`, reason)))))));
|
|
64
65
|
}
|
|
65
66
|
const ReasonsWrapper = styled_components_1.default.div `
|
|
66
67
|
font-family: var(--feedback-font-family);
|
|
@@ -22,22 +22,41 @@ function FilterCheckboxes({ filter, filterValuesCasing, showCounter = true, }) {
|
|
|
22
22
|
react_1.default.createElement(FilterTitle_1.FilterTitle, { "data-translation-key": filter.titleTranslationKey }, translate(filter.titleTranslationKey, filter.title)),
|
|
23
23
|
react_1.default.createElement(FilterOptions_1.FilterOptions, null, (filter.filteredOptions || filter.options).map(({ value, count }) => {
|
|
24
24
|
const id = 'filter--' + filter.property + '--' + value;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
react_1.default.createElement(
|
|
32
|
-
|
|
33
|
-
filter.
|
|
34
|
-
|
|
35
|
-
|
|
25
|
+
const checked = filter.selectedOptions instanceof Set
|
|
26
|
+
? filter.selectedOptions.has(value) ||
|
|
27
|
+
filter.selectedOptions.has(value === null || value === void 0 ? void 0 : value.toLowerCase())
|
|
28
|
+
: false;
|
|
29
|
+
return (react_1.default.createElement(FilterCheckboxOption, { key: id },
|
|
30
|
+
react_1.default.createElement(CheckboxIcon_1.CheckboxIcon, { checked: checked }),
|
|
31
|
+
react_1.default.createElement(FilterOptionLabel_1.FilterOptionLabel, { "data-translation-key": value },
|
|
32
|
+
react_1.default.createElement(FilterCheckboxInput, { checked: checked, onChange: () => {
|
|
33
|
+
filter.toggleOption(value);
|
|
34
|
+
telemetry.sendFilterCheckboxToggledMessage([
|
|
35
|
+
(0, utils_1.getBaseDataAttributes)('filterId', 'checkbox'),
|
|
36
|
+
]);
|
|
37
|
+
} }),
|
|
38
|
+
(0, utils_1.changeTextCasing)(translate(value), filterValuesCasing)),
|
|
36
39
|
showCounter && react_1.default.createElement(CounterTag_1.CounterTag, { borderless: true }, count)));
|
|
37
40
|
}))));
|
|
38
41
|
}
|
|
39
42
|
const FilterCheckboxOption = (0, styled_components_1.default)(FilterOption_1.FilterOption) `
|
|
40
43
|
padding-left: var(--filter-option-checkbox-padding-left);
|
|
44
|
+
|
|
45
|
+
&:has(input:focus-visible) {
|
|
46
|
+
outline: 1px solid var(--button-border-color-focused);
|
|
47
|
+
outline-offset: -1px;
|
|
48
|
+
}
|
|
49
|
+
`;
|
|
50
|
+
const FilterCheckboxInput = styled_components_1.default.input.attrs({ type: 'checkbox' }) `
|
|
51
|
+
position: absolute;
|
|
52
|
+
width: 1px;
|
|
53
|
+
height: 1px;
|
|
54
|
+
margin: -1px;
|
|
55
|
+
padding: 0;
|
|
56
|
+
overflow: hidden;
|
|
57
|
+
clip: rect(0 0 0 0);
|
|
58
|
+
white-space: nowrap;
|
|
59
|
+
border: 0;
|
|
41
60
|
`;
|
|
42
61
|
const FilterCheckboxesWrapper = styled_components_1.default.div `
|
|
43
62
|
display: flex;
|
|
@@ -1,10 +1,43 @@
|
|
|
1
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
|
+
})();
|
|
2
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
37
|
};
|
|
5
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
39
|
exports.FilterDateRange = FilterDateRange;
|
|
7
|
-
const react_1 =
|
|
40
|
+
const react_1 = __importStar(require("react"));
|
|
8
41
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
42
|
const FilterOptions_1 = require("../../components/Filter/FilterOptions");
|
|
10
43
|
const FilterTitle_1 = require("../../components/Filter/FilterTitle");
|
|
@@ -12,6 +45,7 @@ const DatePicker_1 = require("../../components/DatePicker/DatePicker");
|
|
|
12
45
|
const hooks_1 = require("../../core/hooks");
|
|
13
46
|
const utils_1 = require("../../core/utils");
|
|
14
47
|
function FilterDateRange({ filter }) {
|
|
48
|
+
const [today] = (0, react_1.useState)(() => new Date());
|
|
15
49
|
const { useTranslate } = (0, hooks_1.useThemeHooks)();
|
|
16
50
|
const { translate } = useTranslate();
|
|
17
51
|
const from = filter.selectedOptions.from ? new Date(filter.selectedOptions.from) : undefined;
|
|
@@ -22,7 +56,7 @@ function FilterDateRange({ filter }) {
|
|
|
22
56
|
react_1.default.createElement(DateRangeWrapper, null,
|
|
23
57
|
react_1.default.createElement(DateRangeRow, null,
|
|
24
58
|
react_1.default.createElement("span", null, translate('filter.dateRange.from', 'From:')),
|
|
25
|
-
react_1.default.createElement(DatePicker_1.DatePicker, { closeCalendar: true, format: "y-MM-dd", dayPlaceholder: "DD", monthPlaceholder: "MM", yearPlaceholder: "YYYY", value: from, maxDate:
|
|
59
|
+
react_1.default.createElement(DatePicker_1.DatePicker, { closeCalendar: true, format: "y-MM-dd", dayPlaceholder: "DD", monthPlaceholder: "MM", yearPlaceholder: "YYYY", value: from, maxDate: today, onChange: (from) => {
|
|
26
60
|
if (Array.isArray(from))
|
|
27
61
|
return;
|
|
28
62
|
filter.selectOption(Object.assign(Object.assign({}, filter.selectedOptions), { from: (0, utils_1.formatDateWithoutTimeZone)(from), to: (0, utils_1.formatDateWithoutTimeZone)(to) }));
|
|
@@ -11,6 +11,7 @@ const utils_1 = require("../../core/utils");
|
|
|
11
11
|
const hooks_1 = require("../../core/hooks");
|
|
12
12
|
const FooterCopyright_1 = require("../../components/Footer/FooterCopyright");
|
|
13
13
|
const FooterColumn_1 = require("../../components/Footer/FooterColumn");
|
|
14
|
+
const ConsentSettingsLink_1 = require("../../components/Consent/ConsentSettingsLink");
|
|
14
15
|
function Footer({ className }) {
|
|
15
16
|
const { footer } = (0, hooks_1.useThemeConfig)() || {};
|
|
16
17
|
const { items = [], copyrightText } = footer || {};
|
|
@@ -22,7 +23,9 @@ function Footer({ className }) {
|
|
|
22
23
|
!!items.length && (react_1.default.createElement(FooterColumnsSection, null, withColumns
|
|
23
24
|
? items.map((column, index) => (react_1.default.createElement(FooterColumn_1.FooterColumn, { key: `${column.label}_${index}`, column: column })))
|
|
24
25
|
: items.map((item, index) => (react_1.default.createElement(FooterItem_1.FooterItem, { key: index, item: item }))))),
|
|
25
|
-
react_1.default.createElement(FooterCopyrightWrapper, null,
|
|
26
|
+
react_1.default.createElement(FooterCopyrightWrapper, null,
|
|
27
|
+
copyrightText && react_1.default.createElement(FooterCopyright_1.FooterCopyright, { copyrightText: copyrightText }),
|
|
28
|
+
react_1.default.createElement(ConsentSettingsLink_1.ConsentSettingsLink, null))));
|
|
26
29
|
}
|
|
27
30
|
const FooterCopyrightWrapper = styled_components_1.default.div `
|
|
28
31
|
display: flex;
|
|
@@ -43,6 +43,7 @@ const Button_1 = require("../../components/Button/Button");
|
|
|
43
43
|
function Image(props) {
|
|
44
44
|
const { src, srcSet, images: galleryImages, alt, className, width, height, border, caption, framed, style, withLightbox, lightboxStyle, } = props;
|
|
45
45
|
const lightboxContainerRef = (0, react_1.useRef)(null);
|
|
46
|
+
const lightboxTriggerRef = (0, react_1.useRef)(null);
|
|
46
47
|
const [lightboxImage, setLightboxImage] = (0, react_1.useState)(undefined);
|
|
47
48
|
const parsedSourceSetMap = (0, react_1.useMemo)(() => {
|
|
48
49
|
return srcSet ? (0, utils_1.parseSrcSet)(srcSet) : new Map();
|
|
@@ -53,28 +54,47 @@ function Image(props) {
|
|
|
53
54
|
setLightboxImage(undefined);
|
|
54
55
|
}
|
|
55
56
|
}, []);
|
|
56
|
-
const handleImageClick = (0, react_1.useCallback)((src) => {
|
|
57
|
+
const handleImageClick = (0, react_1.useCallback)((src, trigger) => {
|
|
57
58
|
if (!withLightbox || lightboxImage) {
|
|
58
59
|
return;
|
|
59
60
|
}
|
|
61
|
+
lightboxTriggerRef.current = trigger;
|
|
60
62
|
setLightboxImage(src);
|
|
61
63
|
}, [withLightbox, lightboxImage]);
|
|
64
|
+
const getLightboxTriggerProps = (imageSrc) => withLightbox
|
|
65
|
+
? {
|
|
66
|
+
role: 'button',
|
|
67
|
+
tabIndex: 0,
|
|
68
|
+
'aria-label': alt ? undefined : 'Open image',
|
|
69
|
+
onClick: (e) => handleImageClick(imageSrc, e.currentTarget),
|
|
70
|
+
onKeyDown: (e) => {
|
|
71
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
72
|
+
e.preventDefault();
|
|
73
|
+
handleImageClick(imageSrc, e.currentTarget);
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
}
|
|
77
|
+
: {};
|
|
62
78
|
const handleCloseLightbox = (0, react_1.useCallback)(() => {
|
|
63
79
|
setLightboxImage(undefined);
|
|
64
80
|
}, []);
|
|
65
81
|
(0, hooks_1.useModalScrollLock)(!!lightboxImage);
|
|
66
82
|
(0, react_1.useEffect)(() => {
|
|
67
|
-
var _a;
|
|
83
|
+
var _a, _b;
|
|
68
84
|
if (lightboxImage) {
|
|
69
85
|
(_a = lightboxContainerRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
70
86
|
}
|
|
87
|
+
else {
|
|
88
|
+
(_b = lightboxTriggerRef.current) === null || _b === void 0 ? void 0 : _b.focus();
|
|
89
|
+
lightboxTriggerRef.current = null;
|
|
90
|
+
}
|
|
71
91
|
}, [lightboxImage]);
|
|
72
92
|
const combinedStyles = Object.assign(Object.assign(Object.assign({}, (withLightbox && { cursor: 'pointer' })), (border && { border })), (typeof style === 'string' ? (0, utils_1.parseStyleString)(style) : style));
|
|
73
93
|
const lightboxOverlayStyles = typeof lightboxStyle === 'string' ? (0, utils_1.parseStyleString)(lightboxStyle) : lightboxStyle;
|
|
74
|
-
const images = src ? (react_1.default.createElement("img", { src: src, alt: alt, className: className, width: width, height: height, style: combinedStyles,
|
|
94
|
+
const images = src ? (react_1.default.createElement("img", Object.assign({ src: src, alt: alt, className: className, width: width, height: height, style: combinedStyles }, getLightboxTriggerProps(src)))) : (Array.from(parsedSourceSetMap).map(([key, value]) => (react_1.default.createElement(ColorModeAwareImage, Object.assign({ key: key, $colorMode: key, src: value, alt: alt, className: className, width: width, height: height, $withLightbox: withLightbox, style: combinedStyles }, getLightboxTriggerProps(value))))));
|
|
75
95
|
const hasGallery = Array.isArray(galleryImages) && galleryImages.length > 0;
|
|
76
96
|
const visibleGalleryImages = hasGallery ? galleryImages.slice(0, 3) : [];
|
|
77
|
-
const gallery = hasGallery ? (react_1.default.createElement(GalleryRow, null, visibleGalleryImages.map((galleryImageSrc, index) => (react_1.default.createElement("img", { key: `${galleryImageSrc}-${index}`, src: galleryImageSrc, alt: alt, style: withLightbox ? { cursor: 'pointer' } : undefined,
|
|
97
|
+
const gallery = hasGallery ? (react_1.default.createElement(GalleryRow, null, visibleGalleryImages.map((galleryImageSrc, index) => (react_1.default.createElement("img", Object.assign({ key: `${galleryImageSrc}-${index}`, src: galleryImageSrc, alt: alt, style: withLightbox ? { cursor: 'pointer' } : undefined }, getLightboxTriggerProps(galleryImageSrc))))))) : null;
|
|
78
98
|
const hasCaption = Boolean(caption);
|
|
79
99
|
const hasWrapper = Boolean(framed || hasCaption || hasGallery);
|
|
80
100
|
const wrapperContent = hasGallery ? gallery : images;
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
export type JsonFold = {
|
|
3
|
+
isExpanded: (path: string, level: number) => boolean;
|
|
4
|
+
setExpanded: (path: string, expanded: boolean) => void;
|
|
5
|
+
};
|
|
6
|
+
type Foldable = [path: string, level: number];
|
|
7
|
+
export declare function isFoldable(value: unknown): value is Record<string, unknown>;
|
|
8
|
+
export declare function collectFoldables(value: unknown, path?: string, level?: number): Foldable[];
|
|
2
9
|
export declare function JsonValue(props: {
|
|
3
10
|
value: any;
|
|
4
11
|
level: number;
|
|
12
|
+
path: string;
|
|
5
13
|
standalone?: boolean;
|
|
6
|
-
|
|
7
|
-
expandAllSignal: boolean | undefined;
|
|
14
|
+
fold: JsonFold;
|
|
8
15
|
maxStringLength?: number;
|
|
9
16
|
}): React.ReactNode;
|
|
17
|
+
export {};
|
|
@@ -3,30 +3,36 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.isFoldable = isFoldable;
|
|
7
|
+
exports.collectFoldables = collectFoldables;
|
|
6
8
|
exports.JsonValue = JsonValue;
|
|
7
9
|
const react_1 = __importDefault(require("react"));
|
|
8
10
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
11
|
const Button_1 = require("../../components/Button/Button");
|
|
10
12
|
const ShowMoreToggleButton_1 = require("../../components/Button/ShowMoreToggleButton");
|
|
11
13
|
const ChevronDownIcon_1 = require("../../icons/ChevronDownIcon/ChevronDownIcon");
|
|
14
|
+
function isFoldable(value) {
|
|
15
|
+
return (typeof value === 'object' &&
|
|
16
|
+
value !== null &&
|
|
17
|
+
Object.values(value).some((item) => item !== undefined));
|
|
18
|
+
}
|
|
19
|
+
function collectFoldables(value, path = '', level = 1) {
|
|
20
|
+
if (!isFoldable(value))
|
|
21
|
+
return [];
|
|
22
|
+
return Object.entries(value).flatMap(([key, child]) => {
|
|
23
|
+
const childPath = `${path}/${key}`;
|
|
24
|
+
return isFoldable(child)
|
|
25
|
+
? [[childPath, level], ...collectFoldables(child, childPath, level + 1)]
|
|
26
|
+
: [];
|
|
27
|
+
});
|
|
28
|
+
}
|
|
12
29
|
function JsonValue(props) {
|
|
13
|
-
const { standalone,
|
|
30
|
+
const { standalone, fold, level, path, value, maxStringLength } = props;
|
|
14
31
|
const indent = ' '.repeat(level * 2);
|
|
15
|
-
const
|
|
16
|
-
const isExpanded = expandAllSignal !== undefined && level > 0 ? expandAllSignal : isExpandedState;
|
|
17
|
-
const [prevExpandAllSignal, setPrevExpandAllSignal] = react_1.default.useState(expandAllSignal);
|
|
18
|
-
const [prevLevel, setPrevLevel] = react_1.default.useState(level);
|
|
19
|
-
if (prevExpandAllSignal !== expandAllSignal || prevLevel !== level) {
|
|
20
|
-
setPrevExpandAllSignal(expandAllSignal);
|
|
21
|
-
setPrevLevel(level);
|
|
22
|
-
if (expandAllSignal !== undefined && !(expandAllSignal === false && level === 0)) {
|
|
23
|
-
setExpanded(expandAllSignal);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
32
|
+
const isExpanded = fold.isExpanded(path, level);
|
|
26
33
|
const keys = (value && Object.keys(value).filter((key) => value[key] !== undefined)) || []; // filter out undefined properties
|
|
27
34
|
const valueType = typeof value;
|
|
28
|
-
|
|
29
|
-
if (isPrimitive) {
|
|
35
|
+
if (!isFoldable(value)) {
|
|
30
36
|
const isOversizedString = typeof value === 'string' && maxStringLength !== undefined && value.length > maxStringLength;
|
|
31
37
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
32
38
|
standalone ? indent : null,
|
|
@@ -36,14 +42,14 @@ function JsonValue(props) {
|
|
|
36
42
|
const closingPunctuation = Array.isArray(value) ? ']' : '}';
|
|
37
43
|
const valueElement = Array.isArray(value)
|
|
38
44
|
? value.map((item, index) => (react_1.default.createElement(react_1.default.Fragment, { key: index },
|
|
39
|
-
react_1.default.createElement(JsonValue, { value: item, level: level + 1,
|
|
40
|
-
index < value.length - 1 ? ',\n' : null)))
|
|
45
|
+
react_1.default.createElement(JsonValue, { value: item, level: level + 1, path: `${path}/${index}`, standalone: true, fold: fold, maxStringLength: maxStringLength }),
|
|
46
|
+
index < value.length - 1 ? react_1.default.createElement("span", null, ',\n') : null)))
|
|
41
47
|
: keys.map((key, index) => (react_1.default.createElement(react_1.default.Fragment, { key: key },
|
|
42
|
-
react_1.default.createElement(JsonKeyValue, { name: key, value: value[key], level: level + 1,
|
|
43
|
-
index < keys.length - 1 ? ',\n' : null)));
|
|
48
|
+
react_1.default.createElement(JsonKeyValue, { name: key, value: value[key], level: level + 1, path: `${path}/${key}`, fold: fold, maxStringLength: maxStringLength }),
|
|
49
|
+
index < keys.length - 1 ? react_1.default.createElement("span", null, ',\n') : null)));
|
|
44
50
|
const openingPunctuationElement = standalone ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
45
51
|
indent,
|
|
46
|
-
level > 0 ? (react_1.default.createElement(ExpandIcon, { onClick: () => setExpanded(
|
|
52
|
+
level > 0 ? (react_1.default.createElement(ExpandIcon, { onClick: () => fold.setExpanded(path, !isExpanded), isExpanded: isExpanded })) : null,
|
|
47
53
|
openingPunctuation,
|
|
48
54
|
isExpanded ? '\n' : null)) : null;
|
|
49
55
|
const closingPunctuationElement = standalone ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
@@ -56,34 +62,24 @@ function JsonValue(props) {
|
|
|
56
62
|
closingPunctuationElement));
|
|
57
63
|
}
|
|
58
64
|
function JsonKeyValue(props) {
|
|
59
|
-
const {
|
|
65
|
+
const { fold, level, name, path, value, maxStringLength } = props;
|
|
60
66
|
const indent = ' '.repeat(level * 2);
|
|
61
|
-
const
|
|
62
|
-
const isCollapsible = typeof value === 'object' && value !== null && keys.length > 0;
|
|
63
|
-
const [isExpandedState, setExpanded] = react_1.default.useState(expandAllSignal !== null && expandAllSignal !== void 0 ? expandAllSignal : level < defaultExpandLevel);
|
|
64
|
-
const isExpanded = expandAllSignal !== undefined ? expandAllSignal : isExpandedState;
|
|
65
|
-
const [prevExpandAllSignal, setPrevExpandAllSignal] = react_1.default.useState(expandAllSignal);
|
|
66
|
-
if (prevExpandAllSignal !== expandAllSignal) {
|
|
67
|
-
setPrevExpandAllSignal(expandAllSignal);
|
|
68
|
-
if (expandAllSignal !== undefined) {
|
|
69
|
-
setExpanded(expandAllSignal);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
67
|
+
const isExpanded = fold.isExpanded(path, level);
|
|
72
68
|
const openingPunctuation = Array.isArray(value) ? '[' : '{';
|
|
73
69
|
const closingPunctuation = Array.isArray(value) ? ']' : '}';
|
|
74
|
-
const valueElement =
|
|
70
|
+
const valueElement = isFoldable(value) ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
75
71
|
openingPunctuation,
|
|
76
72
|
isExpanded ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
77
73
|
'\n',
|
|
78
|
-
react_1.default.createElement(JsonValue, { value: value, level: level,
|
|
74
|
+
react_1.default.createElement(JsonValue, { value: value, level: level, path: path, fold: fold, maxStringLength: maxStringLength }),
|
|
79
75
|
'\n')) : (' … '),
|
|
80
76
|
isExpanded ? indent : null,
|
|
81
|
-
closingPunctuation)) : (react_1.default.createElement(JsonValue, { value: value, level: level,
|
|
77
|
+
closingPunctuation)) : (react_1.default.createElement(JsonValue, { value: value, level: level, path: path, fold: fold, maxStringLength: maxStringLength }));
|
|
82
78
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
83
79
|
indent,
|
|
84
|
-
|
|
80
|
+
isFoldable(value) ? (react_1.default.createElement(ExpandIcon, { onClick: () => fold.setExpanded(path, !isExpanded), isExpanded: isExpanded })) : null,
|
|
85
81
|
react_1.default.createElement("span", { className: "property token string" }, `"${name}"`),
|
|
86
|
-
":
|
|
82
|
+
react_1.default.createElement("span", null, ': '),
|
|
87
83
|
valueElement));
|
|
88
84
|
}
|
|
89
85
|
function TruncatedStringValue({ value, maxStringLength, }) {
|
|
@@ -42,21 +42,18 @@ const styled_components_1 = __importDefault(require("styled-components"));
|
|
|
42
42
|
const CodeBlock_1 = require("../../components/CodeBlock/CodeBlock");
|
|
43
43
|
const Helpers_1 = require("../../components/JsonViewer/Helpers");
|
|
44
44
|
function JsonComponent({ data, expandLevel = 1, className, onCopyClick, onPanelToggle, title, controls = {}, maxStringLength, }) {
|
|
45
|
-
const
|
|
46
|
-
const
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
setExpandAllSignal(undefined);
|
|
52
|
-
});
|
|
45
|
+
const defaultExpandLevel = Math.max(1, expandLevel);
|
|
46
|
+
const foldables = react_1.default.useMemo(() => (0, Helpers_1.collectFoldables)(data), [data]);
|
|
47
|
+
const [expandedPaths, setExpandedPaths] = react_1.default.useState({});
|
|
48
|
+
const fold = {
|
|
49
|
+
isExpanded: (path, level) => { var _a; return (_a = expandedPaths[path]) !== null && _a !== void 0 ? _a : level < defaultExpandLevel; },
|
|
50
|
+
setExpanded: (path, expanded) => setExpandedPaths((prev) => (Object.assign(Object.assign({}, prev), { [path]: expanded }))),
|
|
53
51
|
};
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
});
|
|
52
|
+
const hasFoldables = foldables.length > 0;
|
|
53
|
+
const allExpanded = foldables.every(([path, level]) => fold.isExpanded(path, level));
|
|
54
|
+
const toggleAll = () => {
|
|
55
|
+
onPanelToggle === null || onPanelToggle === void 0 ? void 0 : onPanelToggle(!allExpanded);
|
|
56
|
+
setExpandedPaths(Object.fromEntries(foldables.map(([path]) => [path, !allExpanded])));
|
|
60
57
|
};
|
|
61
58
|
const source = JSON.stringify(data, null, 2);
|
|
62
59
|
const hasHeader = title || controls;
|
|
@@ -65,13 +62,13 @@ function JsonComponent({ data, expandLevel = 1, className, onCopyClick, onPanelT
|
|
|
65
62
|
? {
|
|
66
63
|
title,
|
|
67
64
|
className: 'code-block-header',
|
|
68
|
-
controls: controls && Object.assign(Object.assign({}, controls), { copy: Object.assign(Object.assign({}, controls.copy), { data, onClick: onCopyClick, handleOutside: true }), expand:
|
|
69
|
-
? Object.assign(Object.assign({}, controls.expand), { onClick:
|
|
70
|
-
? Object.assign(Object.assign({}, controls.collapse), { onClick:
|
|
65
|
+
controls: controls && Object.assign(Object.assign({}, controls), { copy: Object.assign(Object.assign({}, controls.copy), { data, onClick: onCopyClick, handleOutside: true }), expand: hasFoldables && !allExpanded
|
|
66
|
+
? Object.assign(Object.assign({}, controls.expand), { onClick: toggleAll }) : undefined, collapse: hasFoldables && allExpanded
|
|
67
|
+
? Object.assign(Object.assign({}, controls.collapse), { onClick: toggleAll }) : undefined }),
|
|
71
68
|
}
|
|
72
69
|
: undefined, source: source },
|
|
73
70
|
react_1.default.createElement(FoldingWrap, null,
|
|
74
|
-
react_1.default.createElement(Helpers_1.JsonValue, { value: data, level: 0,
|
|
71
|
+
react_1.default.createElement(Helpers_1.JsonValue, { value: data, level: 0, path: "", standalone: true, fold: fold, maxStringLength: maxStringLength })))));
|
|
75
72
|
}
|
|
76
73
|
exports.JsonViewer = (0, react_1.memo)(JsonComponent);
|
|
77
74
|
const FoldingWrap = styled_components_1.default.div `
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { JSX } from 'react';
|
|
2
|
+
export type LoadProgressBarProps = {
|
|
3
|
+
/** Also shows the bar while the host's own navigation is pending. */
|
|
4
|
+
pending?: boolean;
|
|
5
|
+
className?: string;
|
|
6
|
+
};
|
|
7
|
+
/** A top-of-page bar while a page load is pending. */
|
|
8
|
+
export declare function LoadProgressBar({ pending, className, }: LoadProgressBarProps): JSX.Element | null;
|