@redocly/theme 0.55.0-rc.1 → 0.55.0
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/Admonition/Admonition.js +4 -0
- package/lib/components/Breadcrumbs/Breadcrumbs.d.ts +2 -0
- package/lib/components/Breadcrumbs/Breadcrumbs.js +2 -1
- package/lib/components/Button/Button.d.ts +1 -0
- package/lib/components/Catalog/Catalog.d.ts +11 -0
- package/lib/components/Catalog/Catalog.js +138 -0
- package/lib/components/Catalog/CatalogActionsRow.d.ts +15 -0
- package/lib/components/Catalog/CatalogActionsRow.js +34 -0
- package/lib/components/Catalog/CatalogCardView/CatalogCard.d.ts +8 -0
- package/lib/components/Catalog/CatalogCardView/CatalogCard.js +179 -0
- package/lib/components/Catalog/CatalogCardView/CatalogCardView.d.ts +8 -0
- package/lib/components/Catalog/CatalogCardView/CatalogCardView.js +20 -0
- package/lib/components/Catalog/CatalogEntities.d.ts +18 -0
- package/lib/components/Catalog/CatalogEntities.js +63 -0
- package/lib/components/Catalog/CatalogEntitiesEmptyState.d.ts +2 -0
- package/lib/components/Catalog/CatalogEntitiesEmptyState.js +38 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntity.d.ts +12 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntity.js +133 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityInfoBar.d.ts +7 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityInfoBar.js +49 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityLinks.d.ts +6 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityLinks.js +48 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityMetadata.d.ts +6 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityMetadata.js +111 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/ApiDescriptionProperty.d.ts +6 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/ApiDescriptionProperty.js +25 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.d.ts +6 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.js +69 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.d.ts +7 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.js +48 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/ContactProperty.d.ts +6 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/ContactProperty.js +19 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.d.ts +6 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.js +20 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/EntityTypeProperty.d.ts +6 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/EntityTypeProperty.js +20 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/GitProperty.d.ts +6 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/GitProperty.js +23 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/OwnersProperty.d.ts +6 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/OwnersProperty.js +21 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.d.ts +6 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.js +24 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/UserEmailProperty.d.ts +6 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/UserEmailProperty.js +21 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.d.ts +21 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.js +37 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.d.ts +10 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.js +31 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.d.ts +25 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.js +27 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.d.ts +22 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.js +60 -0
- package/lib/components/Catalog/CatalogEntityIcon.d.ts +5 -0
- package/lib/components/Catalog/CatalogEntityIcon.js +38 -0
- package/lib/components/Catalog/CatalogEntityTypeIcon.d.ts +5 -0
- package/lib/components/Catalog/CatalogEntityTypeIcon.js +42 -0
- package/lib/components/Catalog/CatalogHighlight.d.ts +4 -0
- package/lib/components/Catalog/CatalogHighlight.js +48 -0
- package/lib/components/Catalog/CatalogPageDescription.d.ts +9 -0
- package/lib/components/Catalog/CatalogPageDescription.js +52 -0
- package/lib/components/Catalog/CatalogSelector.d.ts +12 -0
- package/lib/components/Catalog/CatalogSelector.js +48 -0
- package/lib/components/Catalog/CatalogSortButton.d.ts +10 -0
- package/lib/components/Catalog/CatalogSortButton.js +71 -0
- package/lib/components/Catalog/CatalogTableView/CatalogDomainsCell.d.ts +5 -0
- package/lib/components/Catalog/CatalogTableView/CatalogDomainsCell.js +19 -0
- package/lib/components/Catalog/CatalogTableView/CatalogEntityCell.d.ts +6 -0
- package/lib/components/Catalog/CatalogTableView/CatalogEntityCell.js +63 -0
- package/lib/components/Catalog/CatalogTableView/CatalogOwnersCell.d.ts +5 -0
- package/lib/components/Catalog/CatalogTableView/CatalogOwnersCell.js +19 -0
- package/lib/components/Catalog/CatalogTableView/CatalogTableHeaderCell.d.ts +11 -0
- package/lib/components/Catalog/CatalogTableView/CatalogTableHeaderCell.js +101 -0
- package/lib/components/Catalog/CatalogTableView/CatalogTableView.d.ts +31 -0
- package/lib/components/Catalog/CatalogTableView/CatalogTableView.js +106 -0
- package/lib/components/Catalog/CatalogTableView/CatalogTableViewRow.d.ts +27 -0
- package/lib/components/Catalog/CatalogTableView/CatalogTableViewRow.js +127 -0
- package/lib/components/Catalog/CatalogTableView/CatalogTagsCell.d.ts +6 -0
- package/lib/components/Catalog/CatalogTableView/CatalogTagsCell.js +20 -0
- package/lib/components/Catalog/CatalogTableView/CatalogUserEntityCell.d.ts +7 -0
- package/lib/components/Catalog/CatalogTableView/CatalogUserEntityCell.js +66 -0
- package/lib/components/Catalog/CatalogTagsWithTooltip.d.ts +9 -0
- package/lib/components/Catalog/CatalogTagsWithTooltip.js +46 -0
- package/lib/components/Catalog/CatalogViewModeToggle.d.ts +7 -0
- package/lib/components/Catalog/CatalogViewModeToggle.js +67 -0
- package/lib/components/Catalog/variables.d.ts +1 -0
- package/lib/components/Catalog/variables.dark.d.ts +1 -0
- package/lib/components/Catalog/variables.dark.js +8 -0
- package/lib/components/Catalog/variables.js +354 -0
- package/lib/components/CatalogClassic/CatalogClassicHighlight.js +1 -1
- package/lib/components/Dropdown/variables.js +1 -1
- package/lib/components/Filter/Filter.d.ts +1 -1
- package/lib/components/Filter/Filter.js +2 -2
- package/lib/components/Filter/FilterCheckboxes.d.ts +1 -1
- package/lib/components/Filter/FilterCheckboxes.js +4 -4
- package/lib/components/Filter/FilterContent.d.ts +3 -1
- package/lib/components/Filter/FilterContent.js +34 -4
- package/lib/components/Filter/FilterInput.js +35 -3
- package/lib/components/Filter/FilterSelect.d.ts +1 -1
- package/lib/components/Filter/FilterSelect.js +4 -4
- package/lib/components/Image/Image.js +2 -2
- package/lib/components/LoadMore/LoadMore.d.ts +8 -0
- package/lib/components/LoadMore/LoadMore.js +18 -0
- package/lib/components/Markdown/Markdown.js +1 -1
- package/lib/components/Marker/Marker.d.ts +10 -0
- package/lib/components/Marker/Marker.js +62 -0
- package/lib/components/Menu/MenuItem.d.ts +1 -1
- package/lib/components/Menu/MenuItem.js +7 -3
- package/lib/components/PageNavigation/NavigationButton.d.ts +13 -0
- package/lib/components/PageNavigation/NavigationButton.js +32 -0
- package/lib/components/PageNavigation/NextButton.js +10 -29
- package/lib/components/PageNavigation/PageNavigation.js +1 -1
- package/lib/components/PageNavigation/PreviousButton.js +11 -27
- package/lib/components/Search/SearchAiConversationInput.js +2 -1
- package/lib/components/Select/Select.js +22 -6
- package/lib/components/Select/SelectInput.d.ts +1 -0
- package/lib/components/Select/SelectInput.js +7 -3
- package/lib/components/Select/variables.js +2 -2
- package/lib/components/Sidebar/Sidebar.d.ts +3 -0
- package/lib/components/Sidebar/Sidebar.js +3 -2
- package/lib/components/SkipContent/SkipContent.d.ts +2 -0
- package/lib/components/SkipContent/SkipContent.js +68 -0
- package/lib/components/SkipContent/variables.d.ts +1 -0
- package/lib/components/SkipContent/variables.js +23 -0
- package/lib/components/Tag/Tag.d.ts +3 -1
- package/lib/components/Tag/Tag.js +54 -2
- package/lib/components/Tag/variables.js +21 -0
- package/lib/components/Tooltip/Tooltip.d.ts +2 -1
- package/lib/components/Tooltip/Tooltip.js +26 -19
- package/lib/components/Tooltip/variables.js +17 -0
- package/lib/components/VersionPicker/VersionPicker.js +22 -3
- package/lib/components/VersionPicker/variables.js +1 -0
- package/lib/core/constants/catalog.d.ts +1 -0
- package/lib/core/constants/catalog.js +5 -0
- package/lib/core/constants/common.d.ts +1 -0
- package/lib/core/constants/common.js +2 -1
- package/lib/core/constants/index.d.ts +1 -0
- package/lib/core/constants/index.js +1 -0
- package/lib/core/constants/search.d.ts +1 -0
- package/lib/core/constants/search.js +2 -1
- package/lib/core/contexts/CodeWalkthrough/CodeWalkthroughStepsContext.d.ts +1 -1
- package/lib/core/contexts/CodeWalkthrough/CodeWalkthroughStepsContext.js +5 -2
- package/lib/core/hooks/__mocks__/use-theme-hooks.d.ts +1 -0
- package/lib/core/hooks/__mocks__/use-theme-hooks.js +1 -0
- package/lib/core/hooks/catalog/useCatalogEntities.d.ts +4 -0
- package/lib/core/hooks/catalog/useCatalogEntities.js +17 -0
- package/lib/core/hooks/catalog/useCatalogTableHeaderCellActions.d.ts +15 -0
- package/lib/core/hooks/catalog/useCatalogTableHeaderCellActions.js +23 -0
- package/lib/core/hooks/catalog/useCatalogTableViewRow.d.ts +11 -0
- package/lib/core/hooks/catalog/useCatalogTableViewRow.js +26 -0
- package/lib/core/hooks/code-walkthrough/use-code-walkthrough-steps.d.ts +17 -9
- package/lib/core/hooks/code-walkthrough/use-code-walkthrough-steps.js +242 -47
- package/lib/core/hooks/code-walkthrough/use-code-walkthrough.d.ts +9 -2
- package/lib/core/hooks/code-walkthrough/use-code-walkthrough.js +2 -2
- package/lib/core/hooks/index.d.ts +3 -1
- package/lib/core/hooks/index.js +3 -1
- package/lib/core/hooks/use-active-page-version.d.ts +1 -0
- package/lib/core/hooks/{use-page-active-version.js → use-active-page-version.js} +3 -3
- package/lib/core/hooks/use-user-teams.d.ts +1 -0
- package/lib/core/hooks/use-user-teams.js +10 -0
- package/lib/core/styles/dark.js +2 -0
- package/lib/core/styles/global.js +65 -60
- package/lib/core/types/catalog.d.ts +118 -5
- package/lib/core/types/code-walkthrough.d.ts +13 -0
- package/lib/core/types/code-walkthrough.js +3 -0
- package/lib/core/types/filter.d.ts +1 -0
- package/lib/core/types/hooks.d.ts +11 -4
- package/lib/core/types/index.d.ts +3 -0
- package/lib/core/types/index.js +3 -0
- package/lib/core/types/l10n.d.ts +1 -1
- package/lib/core/types/marker.d.ts +4 -0
- package/lib/core/types/marker.js +3 -0
- package/lib/core/types/telemetry.d.ts +32 -0
- package/lib/core/types/telemetry.js +3 -0
- package/lib/core/utils/index.d.ts +1 -0
- package/lib/core/utils/index.js +1 -0
- package/lib/core/utils/js-utils.d.ts +18 -0
- package/lib/core/utils/js-utils.js +31 -0
- package/lib/core/utils/parse-style-string.d.ts +1 -0
- package/lib/core/utils/parse-style-string.js +23 -0
- package/lib/icons/AscSortIcon/AscSortIcon.d.ts +9 -0
- package/lib/icons/AscSortIcon/AscSortIcon.js +25 -0
- package/lib/icons/CardsIcon/CardsIcon.d.ts +9 -0
- package/lib/icons/CardsIcon/CardsIcon.js +25 -0
- package/lib/icons/CaretDownIcon/CaretDownIcon.d.ts +9 -0
- package/lib/icons/CaretDownIcon/CaretDownIcon.js +22 -0
- package/lib/icons/CaretUpIcon/CaretUpIcon.d.ts +9 -0
- package/lib/icons/CaretUpIcon/CaretUpIcon.js +22 -0
- package/lib/icons/DescSortIcon/DescSortIcon.d.ts +9 -0
- package/lib/icons/DescSortIcon/DescSortIcon.js +25 -0
- package/lib/icons/EntityTypeIcon/EntityTypeIcon.d.ts +9 -0
- package/lib/icons/EntityTypeIcon/EntityTypeIcon.js +26 -0
- package/lib/icons/GithubIcon/GithubIcon.d.ts +9 -0
- package/lib/icons/GithubIcon/GithubIcon.js +22 -0
- package/lib/icons/GraphIcon/GraphIcon.d.ts +9 -0
- package/lib/icons/GraphIcon/GraphIcon.js +22 -0
- package/lib/icons/PeopleIcon/PeopleIcon.d.ts +9 -0
- package/lib/icons/PeopleIcon/PeopleIcon.js +27 -0
- package/lib/icons/SlackIcon/SlackIcon.d.ts +9 -0
- package/lib/icons/SlackIcon/SlackIcon.js +29 -0
- package/lib/icons/SortIcon/SortIcon.d.ts +9 -0
- package/lib/icons/SortIcon/SortIcon.js +25 -0
- package/lib/icons/TableIcon/TableIcon.d.ts +9 -0
- package/lib/icons/TableIcon/TableIcon.js +22 -0
- package/lib/icons/TagsIcon/TagsIcon.d.ts +9 -0
- package/lib/icons/TagsIcon/TagsIcon.js +24 -0
- package/lib/index.d.ts +19 -1
- package/lib/index.js +20 -1
- package/lib/layouts/PageLayout.js +2 -1
- package/lib/layouts/RootLayout.js +2 -0
- package/lib/markdoc/components/CodeWalkthrough/CodeStep.d.ts +1 -2
- package/lib/markdoc/components/CodeWalkthrough/CodeStep.js +26 -20
- package/lib/markdoc/components/CodeWalkthrough/CodeWalkthrough.js +32 -3
- package/lib/markdoc/components/Tabs/Tab.d.ts +2 -1
- package/lib/markdoc/components/Tabs/Tab.js +10 -2
- package/lib/markdoc/components/Tabs/TabList.d.ts +1 -4
- package/lib/markdoc/components/Tabs/TabList.js +18 -38
- package/lib/markdoc/components/Tabs/Tabs.d.ts +3 -1
- package/lib/markdoc/components/Tabs/Tabs.js +5 -9
- package/lib/markdoc/tags/code-step.js +0 -3
- package/lib/markdoc/tags/code-walkthrough.js +0 -1
- package/package.json +4 -3
- package/src/components/Admonition/Admonition.tsx +4 -0
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +7 -2
- package/src/components/Button/Button.tsx +1 -1
- package/src/components/Catalog/Catalog.tsx +235 -0
- package/src/components/Catalog/CatalogActionsRow.tsx +58 -0
- package/src/components/Catalog/CatalogCardView/CatalogCard.tsx +227 -0
- package/src/components/Catalog/CatalogCardView/CatalogCardView.tsx +29 -0
- package/src/components/Catalog/CatalogEntities.tsx +107 -0
- package/src/components/Catalog/CatalogEntitiesEmptyState.tsx +38 -0
- package/src/components/Catalog/CatalogEntity/CatalogEntity.tsx +207 -0
- package/src/components/Catalog/CatalogEntity/CatalogEntityInfoBar.tsx +60 -0
- package/src/components/Catalog/CatalogEntity/CatalogEntityLinks.tsx +67 -0
- package/src/components/Catalog/CatalogEntity/CatalogEntityMetadata.tsx +93 -0
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/ApiDescriptionProperty.tsx +35 -0
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.tsx +83 -0
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.tsx +62 -0
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/ContactProperty.tsx +36 -0
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.tsx +38 -0
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/EntityTypeProperty.tsx +33 -0
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/GitProperty.tsx +41 -0
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/OwnersProperty.tsx +42 -0
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.tsx +39 -0
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/UserEmailProperty.tsx +31 -0
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.tsx +97 -0
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.tsx +80 -0
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.tsx +92 -0
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.tsx +127 -0
- package/src/components/Catalog/CatalogEntityIcon.tsx +41 -0
- package/src/components/Catalog/CatalogEntityTypeIcon.tsx +48 -0
- package/src/components/Catalog/CatalogHighlight.tsx +56 -0
- package/src/components/Catalog/CatalogPageDescription.tsx +72 -0
- package/src/components/Catalog/CatalogSelector.tsx +67 -0
- package/src/components/Catalog/CatalogSortButton.tsx +78 -0
- package/src/components/Catalog/CatalogTableView/CatalogDomainsCell.tsx +26 -0
- package/src/components/Catalog/CatalogTableView/CatalogEntityCell.tsx +77 -0
- package/src/components/Catalog/CatalogTableView/CatalogOwnersCell.tsx +26 -0
- package/src/components/Catalog/CatalogTableView/CatalogTableHeaderCell.tsx +120 -0
- package/src/components/Catalog/CatalogTableView/CatalogTableView.tsx +176 -0
- package/src/components/Catalog/CatalogTableView/CatalogTableViewRow.tsx +180 -0
- package/src/components/Catalog/CatalogTableView/CatalogTagsCell.tsx +28 -0
- package/src/components/Catalog/CatalogTableView/CatalogUserEntityCell.tsx +77 -0
- package/src/components/Catalog/CatalogTagsWithTooltip.tsx +83 -0
- package/src/components/Catalog/CatalogViewModeToggle.tsx +65 -0
- package/src/components/Catalog/variables.dark.ts +5 -0
- package/src/components/Catalog/variables.ts +351 -0
- package/src/components/CatalogClassic/CatalogClassicHighlight.tsx +1 -1
- package/src/components/Dropdown/variables.ts +1 -1
- package/src/components/Filter/Filter.tsx +10 -2
- package/src/components/Filter/FilterCheckboxes.tsx +8 -4
- package/src/components/Filter/FilterContent.tsx +21 -5
- package/src/components/Filter/FilterInput.tsx +16 -4
- package/src/components/Filter/FilterSelect.tsx +8 -4
- package/src/components/Image/Image.tsx +5 -9
- package/src/components/LoadMore/LoadMore.tsx +38 -0
- package/src/components/Markdown/Markdown.tsx +1 -1
- package/src/components/Marker/Marker.tsx +53 -0
- package/src/components/Menu/MenuItem.tsx +11 -2
- package/src/components/PageNavigation/NavigationButton.tsx +68 -0
- package/src/components/PageNavigation/NextButton.tsx +20 -43
- package/src/components/PageNavigation/PageNavigation.tsx +1 -1
- package/src/components/PageNavigation/PreviousButton.tsx +20 -43
- package/src/components/Search/SearchAiConversationInput.tsx +3 -0
- package/src/components/Select/Select.tsx +29 -4
- package/src/components/Select/SelectInput.tsx +20 -1
- package/src/components/Select/variables.ts +2 -2
- package/src/components/Sidebar/Sidebar.tsx +1 -1
- package/src/components/SkipContent/SkipContent.tsx +47 -0
- package/src/components/SkipContent/variables.ts +20 -0
- package/src/components/Tag/Tag.tsx +67 -1
- package/src/components/Tag/variables.ts +21 -0
- package/src/components/Tooltip/Tooltip.tsx +31 -22
- package/src/components/Tooltip/variables.ts +17 -0
- package/src/components/VersionPicker/VersionPicker.tsx +32 -2
- package/src/components/VersionPicker/variables.ts +1 -0
- package/src/core/constants/catalog.ts +1 -0
- package/src/core/constants/common.ts +1 -0
- package/src/core/constants/index.ts +1 -0
- package/src/core/constants/search.ts +2 -0
- package/src/core/contexts/CodeWalkthrough/CodeWalkthroughStepsContext.tsx +6 -3
- package/src/core/hooks/__mocks__/use-theme-hooks.ts +1 -0
- package/src/core/hooks/catalog/useCatalogEntities.ts +16 -0
- package/src/core/hooks/catalog/useCatalogTableHeaderCellActions.ts +38 -0
- package/src/core/hooks/catalog/useCatalogTableViewRow.ts +40 -0
- package/src/core/hooks/code-walkthrough/use-code-walkthrough-steps.ts +326 -65
- package/src/core/hooks/code-walkthrough/use-code-walkthrough.ts +9 -6
- package/src/core/hooks/index.ts +3 -1
- package/src/core/hooks/{use-page-active-version.ts → use-active-page-version.ts} +1 -1
- package/src/core/hooks/use-user-teams.ts +8 -0
- package/src/core/styles/dark.ts +2 -0
- package/src/core/styles/global.ts +5 -0
- package/src/core/types/catalog.ts +143 -5
- package/src/core/types/code-walkthrough.ts +15 -0
- package/src/core/types/filter.ts +1 -0
- package/src/core/types/hooks.ts +32 -5
- package/src/core/types/index.ts +3 -0
- package/src/core/types/l10n.ts +22 -1
- package/src/core/types/marker.ts +4 -0
- package/src/core/types/telemetry.ts +36 -0
- package/src/core/utils/index.ts +1 -0
- package/src/core/utils/js-utils.ts +31 -0
- package/src/core/utils/load-and-navigate.ts +5 -4
- package/src/core/utils/parse-style-string.ts +21 -0
- package/src/icons/AscSortIcon/AscSortIcon.tsx +29 -0
- package/src/icons/CardsIcon/CardsIcon.tsx +38 -0
- package/src/icons/CaretDownIcon/CaretDownIcon.tsx +26 -0
- package/src/icons/CaretUpIcon/CaretUpIcon.tsx +26 -0
- package/src/icons/DescSortIcon/DescSortIcon.tsx +29 -0
- package/src/icons/EntityTypeIcon/EntityTypeIcon.tsx +49 -0
- package/src/icons/GithubIcon/GithubIcon.tsx +35 -0
- package/src/icons/GraphIcon/GraphIcon.tsx +26 -0
- package/src/icons/PeopleIcon/PeopleIcon.tsx +46 -0
- package/src/icons/SlackIcon/SlackIcon.tsx +61 -0
- package/src/icons/SortIcon/SortIcon.tsx +29 -0
- package/src/icons/TableIcon/TableIcon.tsx +26 -0
- package/src/icons/TagsIcon/TagsIcon.tsx +41 -0
- package/src/index.ts +21 -1
- package/src/layouts/PageLayout.tsx +4 -1
- package/src/layouts/RootLayout.tsx +2 -0
- package/src/markdoc/components/CodeWalkthrough/CodeStep.tsx +76 -36
- package/src/markdoc/components/CodeWalkthrough/CodeWalkthrough.tsx +8 -3
- package/src/markdoc/components/Tabs/Tab.tsx +12 -1
- package/src/markdoc/components/Tabs/TabList.tsx +40 -70
- package/src/markdoc/components/Tabs/Tabs.tsx +11 -10
- package/src/markdoc/tags/code-step.ts +0 -3
- package/src/markdoc/tags/code-walkthrough.ts +0 -1
- package/lib/components/OpenApiDocs/hooks/AfterOpenApiDescription.d.ts +0 -1
- package/lib/components/OpenApiDocs/hooks/AfterOpenApiDescription.js +0 -5
- package/lib/core/hooks/use-page-active-version.d.ts +0 -1
- package/lib/ext/process-scorecard.d.ts +0 -5
- package/lib/ext/process-scorecard.js +0 -11
- package/src/components/OpenApiDocs/hooks/AfterOpenApiDescription.tsx +0 -1
- package/src/ext/process-scorecard.ts +0 -13
|
@@ -1,5 +1,41 @@
|
|
|
1
|
+
import { InfiniteData, UseInfiniteQueryResult } from '@tanstack/react-query';
|
|
2
|
+
import { CatalogEntityConfig, LayoutVariant } from '@redocly/config';
|
|
3
|
+
|
|
1
4
|
import type { CatalogFilterConfig } from '@redocly/theme/config';
|
|
2
5
|
|
|
6
|
+
export type SortOption = 'title' | '-title' | 'type' | '-type';
|
|
7
|
+
|
|
8
|
+
export type UseCatalogResponse = {
|
|
9
|
+
filters: ResolvedFilter[];
|
|
10
|
+
filterQuery: string;
|
|
11
|
+
searchQuery: string;
|
|
12
|
+
setSearchQuery: (query: string) => void;
|
|
13
|
+
sortOption: SortOption | null;
|
|
14
|
+
setSortOption: (option: SortOption | null) => void;
|
|
15
|
+
handleSortClick: (sortKey: string, direction: 'asc' | 'desc') => void;
|
|
16
|
+
isColumnSorted: (sortKey: string, direction: 'asc' | 'desc') => boolean;
|
|
17
|
+
viewMode: CatalogViewMode;
|
|
18
|
+
setViewMode: (mode: CatalogViewMode) => void;
|
|
19
|
+
entitiesCounter: number;
|
|
20
|
+
setEntitiesCounter: (counter: number) => void;
|
|
21
|
+
onChangeViewClick: () => void;
|
|
22
|
+
onChangeCollapseSidebarClick: () => void;
|
|
23
|
+
layout: LayoutVariant;
|
|
24
|
+
collapsedSidebar: boolean;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export type UseCatalogSortResponse = {
|
|
28
|
+
sortOption: SortOption | null;
|
|
29
|
+
setSortOption: (option: SortOption | null) => void;
|
|
30
|
+
handleSortClick: (sortKey: string, direction: 'asc' | 'desc') => void;
|
|
31
|
+
isColumnSorted: (sortKey: string, direction: 'asc' | 'desc') => boolean;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export type UseCatalogSearchResponse = {
|
|
35
|
+
searchQuery: string;
|
|
36
|
+
setSearchQuery: (query: string) => void;
|
|
37
|
+
};
|
|
38
|
+
|
|
3
39
|
export type FilteredCatalog = {
|
|
4
40
|
groups: { title: string; items: CatalogItem[] }[];
|
|
5
41
|
filters: ResolvedFilter[];
|
|
@@ -12,10 +48,6 @@ export type ResolvedFilter = Omit<CatalogFilterConfig, 'options'> & {
|
|
|
12
48
|
value: string;
|
|
13
49
|
count: number;
|
|
14
50
|
}[];
|
|
15
|
-
filteredOptions: {
|
|
16
|
-
value: string;
|
|
17
|
-
count: number;
|
|
18
|
-
}[];
|
|
19
51
|
toggleOption: (option: string) => void;
|
|
20
52
|
selectOption: (option: string) => void;
|
|
21
53
|
parentUsed: boolean;
|
|
@@ -34,9 +66,115 @@ export type CatalogItem = {
|
|
|
34
66
|
scorecardLevelIdx?: number;
|
|
35
67
|
scorecardLevels?: Record<string, { uniqueErrors: number; uniqueWarnings: number }>;
|
|
36
68
|
scoreCardSlug?: string;
|
|
37
|
-
tags?:
|
|
69
|
+
tags?: string[];
|
|
38
70
|
versions?: CatalogItem[];
|
|
39
71
|
version?: string;
|
|
40
72
|
versionFolderId?: string;
|
|
41
73
|
[k: string]: unknown;
|
|
42
74
|
};
|
|
75
|
+
|
|
76
|
+
export type DefaultCatalogSlug =
|
|
77
|
+
| 'services'
|
|
78
|
+
| 'users'
|
|
79
|
+
| 'teams'
|
|
80
|
+
| 'domains'
|
|
81
|
+
| 'api-descriptions'
|
|
82
|
+
| 'all';
|
|
83
|
+
|
|
84
|
+
export type CatalogApiResults<T, L> = {
|
|
85
|
+
query: UseInfiniteQueryResult<InfiniteData<L, unknown>, Error>;
|
|
86
|
+
items: T[];
|
|
87
|
+
total: number;
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export type CatalogApiParams = {
|
|
91
|
+
limit?: number;
|
|
92
|
+
filter?: string;
|
|
93
|
+
sort?: string;
|
|
94
|
+
search?: string;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export type UseCatalogEntitiesProps = {
|
|
98
|
+
entitiesTypes: string[];
|
|
99
|
+
excludedEntities?: CatalogEntityConfig['excludes'];
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export type UseCatalogEntitiesResponse = {
|
|
103
|
+
setEntitiesCounter: (counter: number) => void;
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export type EntityType = 'service' | 'domain' | 'team' | 'user' | 'api-description';
|
|
107
|
+
|
|
108
|
+
export type CatalogViewMode = 'cards' | 'table';
|
|
109
|
+
|
|
110
|
+
export type CatalogSwitcherItem = {
|
|
111
|
+
labelTranslationKey: string;
|
|
112
|
+
slug: string;
|
|
113
|
+
selected: boolean;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
// TODO: remove this types after we make api-sdk package public and will be able import them from there
|
|
117
|
+
export type BffCatalogRelatedEntity = {
|
|
118
|
+
readonly id: string;
|
|
119
|
+
type: string;
|
|
120
|
+
key: string;
|
|
121
|
+
title: string;
|
|
122
|
+
summary?: string | null;
|
|
123
|
+
readonly source: 'api' | 'file';
|
|
124
|
+
sourceFile?: string | null;
|
|
125
|
+
metadata?: Record<string, any>;
|
|
126
|
+
readonly createdAt: string | null;
|
|
127
|
+
readonly updatedAt: string | null;
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
export type BffCatalogEntity = {
|
|
131
|
+
readonly id: string;
|
|
132
|
+
readonly organizationId: string;
|
|
133
|
+
readonly projectId: string;
|
|
134
|
+
key: string;
|
|
135
|
+
type: string;
|
|
136
|
+
title: string;
|
|
137
|
+
readonly source: 'api' | 'file';
|
|
138
|
+
domains?: Array<BffCatalogRelatedEntity>;
|
|
139
|
+
owners?: Array<BffCatalogRelatedEntity>;
|
|
140
|
+
summary?: string;
|
|
141
|
+
tags?: Array<string>;
|
|
142
|
+
metadata?: Record<string, any>;
|
|
143
|
+
git?: Array<string>;
|
|
144
|
+
contact?: {
|
|
145
|
+
slack?: {
|
|
146
|
+
channels?: Array<{
|
|
147
|
+
name: string;
|
|
148
|
+
}>;
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
links?: Array<{
|
|
152
|
+
label: string;
|
|
153
|
+
url: string;
|
|
154
|
+
}>;
|
|
155
|
+
sourceFile?: string;
|
|
156
|
+
readonly object: 'catalogEntityView';
|
|
157
|
+
readonly createdAt: string;
|
|
158
|
+
readonly updatedAt: string;
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
export type BffCatalogEntityList = {
|
|
162
|
+
object: 'list';
|
|
163
|
+
page: Page;
|
|
164
|
+
items: Array<BffCatalogEntity>;
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
export type BffCatalogRelatedEntityList = {
|
|
168
|
+
object: 'list';
|
|
169
|
+
page: Page;
|
|
170
|
+
items: Array<BffCatalogRelatedEntity>;
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
export type Page = {
|
|
174
|
+
endCursor: string | null;
|
|
175
|
+
startCursor: string | null;
|
|
176
|
+
hasNextPage: boolean;
|
|
177
|
+
hasPrevPage: boolean;
|
|
178
|
+
limit: number;
|
|
179
|
+
total: number;
|
|
180
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { MarkerArea } from '@redocly/theme/core/types';
|
|
2
|
+
|
|
3
|
+
export type ActiveStep = string | null;
|
|
4
|
+
|
|
5
|
+
export type WalkthroughStepsState = {
|
|
6
|
+
activeStep: ActiveStep;
|
|
7
|
+
setActiveStep: (stepId: ActiveStep) => void;
|
|
8
|
+
markers: Record<string, MarkerArea>;
|
|
9
|
+
registerMarker: (stepId: string, element: HTMLElement) => void;
|
|
10
|
+
removeMarker: (stepId: string, element: HTMLElement) => void;
|
|
11
|
+
registerStep: (stepId: string, element: HTMLElement) => void;
|
|
12
|
+
removeStep: (stepId: string) => void;
|
|
13
|
+
lockObserver?: React.RefObject<boolean>;
|
|
14
|
+
filtersElementRef?: React.RefObject<HTMLDivElement | null>;
|
|
15
|
+
};
|
package/src/core/types/filter.ts
CHANGED
|
@@ -4,6 +4,7 @@ import type { RedoclyConfig } from '@redocly/config';
|
|
|
4
4
|
export type FilterProps = {
|
|
5
5
|
filter: ResolvedFilter & { selectedOptions: any };
|
|
6
6
|
filterValuesCasing?: NonNullable<RedoclyConfig['catalog']>[string]['filterValuesCasing'];
|
|
7
|
+
showCounter?: boolean;
|
|
7
8
|
};
|
|
8
9
|
|
|
9
10
|
export type FilterTypes = NonNullable<FilterProps['filter']['type']>;
|
package/src/core/types/hooks.ts
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import type {
|
|
2
|
+
CatalogEntityConfig,
|
|
3
|
+
PageProps,
|
|
4
|
+
ResolvedNavItemWithLink,
|
|
5
|
+
Version,
|
|
6
|
+
} from '@redocly/config';
|
|
4
7
|
import type { ShikiTransformer } from '@shikijs/types';
|
|
5
8
|
import type { Callback, TFunction as TFunc } from 'i18next';
|
|
6
9
|
import type { To, Location, NavigateFunction } from 'react-router-dom';
|
|
7
10
|
import type { CatalogConfig, ProductUiConfig } from '@redocly/theme/config';
|
|
8
11
|
import type {
|
|
9
12
|
UserMenuData,
|
|
10
|
-
|
|
13
|
+
UseCatalogResponse,
|
|
11
14
|
ItemState,
|
|
12
15
|
SearchItemData,
|
|
13
16
|
SubmitFeedbackParams,
|
|
@@ -18,8 +21,21 @@ import type {
|
|
|
18
21
|
SearchFilterItem,
|
|
19
22
|
SearchFacetQuery,
|
|
20
23
|
AiSearchConversationItem,
|
|
24
|
+
CatalogApiResults,
|
|
25
|
+
CatalogApiParams,
|
|
26
|
+
FilteredCatalog,
|
|
27
|
+
UseCatalogSortResponse,
|
|
28
|
+
UseCatalogSearchResponse,
|
|
29
|
+
EventType,
|
|
30
|
+
SendEventParams,
|
|
21
31
|
} from '@redocly/theme/core/types';
|
|
22
32
|
|
|
33
|
+
import {
|
|
34
|
+
BffCatalogEntity,
|
|
35
|
+
BffCatalogEntityList,
|
|
36
|
+
BffCatalogRelatedEntity,
|
|
37
|
+
BffCatalogRelatedEntityList,
|
|
38
|
+
} from '@redocly/theme/core/types';
|
|
23
39
|
import { AiSearchError } from '@redocly/theme/core/constants';
|
|
24
40
|
|
|
25
41
|
export type ThemeHooks = {
|
|
@@ -118,9 +134,20 @@ export type ThemeHooks = {
|
|
|
118
134
|
nextPage?: ResolvedNavItemWithLink;
|
|
119
135
|
}
|
|
120
136
|
| undefined;
|
|
137
|
+
useCatalog: (config?: CatalogEntityConfig, entitiesCounterInitial?: number) => UseCatalogResponse;
|
|
138
|
+
useCatalogSort: () => UseCatalogSortResponse;
|
|
139
|
+
useCatalogSearch: () => UseCatalogSearchResponse;
|
|
140
|
+
useFetchCatalogEntities: (
|
|
141
|
+
params: CatalogApiParams,
|
|
142
|
+
initialData?: BffCatalogEntityList,
|
|
143
|
+
) => CatalogApiResults<BffCatalogEntity, BffCatalogEntityList>;
|
|
144
|
+
useFetchCatalogEntitiesRelations: (
|
|
145
|
+
params: CatalogApiParams & { entityKey: string },
|
|
146
|
+
initialData?: BffCatalogRelatedEntityList,
|
|
147
|
+
) => CatalogApiResults<BffCatalogRelatedEntity, BffCatalogRelatedEntityList>;
|
|
121
148
|
useCatalogClassic: (config: CatalogConfig) => FilteredCatalog;
|
|
122
149
|
useTelemetry: () => {
|
|
123
|
-
send(
|
|
150
|
+
send<TEventType extends EventType>(event: SendEventParams<TEventType>): void;
|
|
124
151
|
};
|
|
125
152
|
useUserTeams: () => string[];
|
|
126
153
|
usePageProps: <T extends Record<string, unknown>>() => PageProps & T;
|
package/src/core/types/index.ts
CHANGED
|
@@ -13,3 +13,6 @@ export * from '@redocly/theme/core/types/user-menu';
|
|
|
13
13
|
export * from '@redocly/theme/core/types/user-claims';
|
|
14
14
|
export * from '@redocly/theme/core/types/common';
|
|
15
15
|
export * from '@redocly/theme/core/types/open-api-server';
|
|
16
|
+
export * from '@redocly/theme/core/types/marker';
|
|
17
|
+
export * from '@redocly/theme/core/types/code-walkthrough';
|
|
18
|
+
export * from '@redocly/theme/core/types/telemetry';
|
package/src/core/types/l10n.ts
CHANGED
|
@@ -118,6 +118,26 @@ export type TranslationKey =
|
|
|
118
118
|
| 'catalog.filters.select.addFilter'
|
|
119
119
|
| 'catalog.filters.select.all'
|
|
120
120
|
| 'catalog.filters.done'
|
|
121
|
+
| 'catalog.catalogs.all.title'
|
|
122
|
+
| 'catalog.catalogs.all.description'
|
|
123
|
+
| 'catalog.catalogs.all.switcherLabel'
|
|
124
|
+
| 'catalog.catalogs.service.title'
|
|
125
|
+
| 'catalog.catalogs.service.description'
|
|
126
|
+
| 'catalog.catalogs.service.switcherLabel'
|
|
127
|
+
| 'catalog.catalogs.user.title'
|
|
128
|
+
| 'catalog.catalogs.user.description'
|
|
129
|
+
| 'catalog.catalogs.user.switcherLabel'
|
|
130
|
+
| 'catalog.catalogs.team.title'
|
|
131
|
+
| 'catalog.catalogs.team.description'
|
|
132
|
+
| 'catalog.catalogs.team.switcherLabel'
|
|
133
|
+
| 'catalog.catalogs.domain.title'
|
|
134
|
+
| 'catalog.catalogs.domain.description'
|
|
135
|
+
| 'catalog.catalogs.domain.switcherLabel'
|
|
136
|
+
| 'catalog.catalogs.apiDescription.title'
|
|
137
|
+
| 'catalog.catalogs.apiDescription.description'
|
|
138
|
+
| 'catalog.catalogs.apiDescription.switcherLabel'
|
|
139
|
+
| 'catalog.entity.metadata.title'
|
|
140
|
+
| 'catalog.entity.properties.apiDescription.title'
|
|
121
141
|
| 'sidebar.menu.backLabel'
|
|
122
142
|
| 'sidebar.menu.backToLabel'
|
|
123
143
|
| 'sidebar.actions.show'
|
|
@@ -287,7 +307,8 @@ export type TranslationKey =
|
|
|
287
307
|
| 'time.past.year'
|
|
288
308
|
| 'time.past.years'
|
|
289
309
|
| 'page.internalServerError.title'
|
|
290
|
-
| 'page.internalServerError.description'
|
|
310
|
+
| 'page.internalServerError.description'
|
|
311
|
+
| 'page.skipToContent.label';
|
|
291
312
|
|
|
292
313
|
export type Locale = { code: string; name: string };
|
|
293
314
|
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { AsyncApiRealm } from '@redocly/realm-asyncapi-sdk';
|
|
2
|
+
|
|
3
|
+
type ExtractEventType<T> = T extends {
|
|
4
|
+
span?: { attributes?: { 'cloudevents.event_type': infer EventType } };
|
|
5
|
+
}
|
|
6
|
+
? EventType
|
|
7
|
+
: never;
|
|
8
|
+
|
|
9
|
+
export type EventType = ExtractEventType<AsyncApiRealm.Messages>;
|
|
10
|
+
|
|
11
|
+
type GetMessageForEventType<TEventType extends EventType> = Extract<
|
|
12
|
+
AsyncApiRealm.Messages,
|
|
13
|
+
{ span?: { attributes?: { 'cloudevents.event_type': TEventType } } }
|
|
14
|
+
>;
|
|
15
|
+
|
|
16
|
+
type ExtractEventDataForType<TEventType extends EventType> =
|
|
17
|
+
GetMessageForEventType<TEventType> extends {
|
|
18
|
+
span?: { attributes?: infer Attrs };
|
|
19
|
+
}
|
|
20
|
+
? {
|
|
21
|
+
[K in keyof Attrs as K extends `cloudevents.event_data.${string}` ? K : never]: Attrs[K];
|
|
22
|
+
}
|
|
23
|
+
: never;
|
|
24
|
+
|
|
25
|
+
export type ConvertEventDataToPayload<T> = {
|
|
26
|
+
[K in keyof T as K extends `cloudevents.event_data.${infer FieldName}` ? FieldName : never]: T[K];
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export type EventPayload<TEventType extends EventType> = ConvertEventDataToPayload<
|
|
30
|
+
ExtractEventDataForType<TEventType>
|
|
31
|
+
>;
|
|
32
|
+
|
|
33
|
+
export interface SendEventParams<TEventType extends EventType> {
|
|
34
|
+
type: TEventType;
|
|
35
|
+
payload?: EventPayload<TEventType>;
|
|
36
|
+
}
|
package/src/core/utils/index.ts
CHANGED
|
@@ -32,3 +32,4 @@ export * from '@redocly/theme/core/utils/match-code-walkthrough-conditions';
|
|
|
32
32
|
export * from '@redocly/theme/core/utils/replace-inputs-with-value';
|
|
33
33
|
export * from '@redocly/theme/core/utils/find-closest-common-directory';
|
|
34
34
|
export * from '@redocly/theme/core/utils/get-user-agent';
|
|
35
|
+
export * from '@redocly/theme/core/utils/parse-style-string';
|
|
@@ -71,3 +71,34 @@ export function getAdjacentValues<T>(
|
|
|
71
71
|
|
|
72
72
|
return { prev: prevValue, next: nextValue };
|
|
73
73
|
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Inserts an element at a given index in an array. Returns a new array with the element inserted.
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* const array = [10, 20, 30, 40];
|
|
80
|
+
* insertAt(array, 2, 25);
|
|
81
|
+
* // returns: [10, 20, 25, 30, 40]
|
|
82
|
+
*/
|
|
83
|
+
export function insertAt<T>(array: T[], index: number, newElement: T): T[] {
|
|
84
|
+
const result = array.concat();
|
|
85
|
+
result.splice(index, 0, newElement);
|
|
86
|
+
return result;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Removes an element from an array. Returns a new array with the element removed.
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* const array = [10, 20, 30, 40];
|
|
94
|
+
* removeElement(array, 20);
|
|
95
|
+
* // returns: [10, 30, 40]
|
|
96
|
+
*/
|
|
97
|
+
export function removeElement<T>(array: T[], item: T): T[] {
|
|
98
|
+
const index = array.indexOf(item);
|
|
99
|
+
if (index === -1) return array;
|
|
100
|
+
|
|
101
|
+
const result = array.slice();
|
|
102
|
+
result.splice(index, 1);
|
|
103
|
+
return result;
|
|
104
|
+
}
|
|
@@ -32,10 +32,11 @@ export async function loadAndNavigate({
|
|
|
32
32
|
if (result && lastNavigatedPath === to) {
|
|
33
33
|
if (pathname !== window.location.pathname || search !== window.location.search) {
|
|
34
34
|
// origin is used to prevent infinite loop when navigating from post message (from wysiwyg)
|
|
35
|
-
navigate(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
navigate({ pathname, search, hash }, {
|
|
36
|
+
...options,
|
|
37
|
+
state: { origin },
|
|
38
|
+
unstable_flushSync: true,
|
|
39
|
+
} as NavigateOptions & { unstable_flushSync: boolean });
|
|
39
40
|
}
|
|
40
41
|
// @ts-ignore
|
|
41
42
|
if (result.props?.disableAutoScroll) return;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export function parseStyleString(styleString: string): React.CSSProperties {
|
|
2
|
+
return styleString
|
|
3
|
+
.split(';')
|
|
4
|
+
.filter((style) => style.trim().length)
|
|
5
|
+
.reduce((styleObj: React.CSSProperties, style) => {
|
|
6
|
+
const colonIndex = style.indexOf(':');
|
|
7
|
+
if (colonIndex === -1) return styleObj;
|
|
8
|
+
|
|
9
|
+
const key = style.substring(0, colonIndex).trim();
|
|
10
|
+
const value = style.substring(colonIndex + 1).trim();
|
|
11
|
+
|
|
12
|
+
if (key && value) {
|
|
13
|
+
const camelCaseKey = key.replace(/-[a-z]/g, (match) => {
|
|
14
|
+
return match[1].toUpperCase();
|
|
15
|
+
});
|
|
16
|
+
(styleObj as any)[camelCaseKey] = value;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return styleObj;
|
|
20
|
+
}, {});
|
|
21
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import type { IconProps } from '@redocly/theme/icons/types';
|
|
5
|
+
|
|
6
|
+
import { getCssColorVariable } from '@redocly/theme/core/utils';
|
|
7
|
+
|
|
8
|
+
const Icon = (props: IconProps) => (
|
|
9
|
+
<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
|
|
10
|
+
<path
|
|
11
|
+
d="M9 11L9.707 10.293L11.5 12.086V2H12.5V12.086L14.293 10.293L15 11L12 14L9 11Z"
|
|
12
|
+
fill="#22242B"
|
|
13
|
+
/>
|
|
14
|
+
<path d="M8 9H1V10H8V9Z" fill="#22242B" />
|
|
15
|
+
<path d="M8 6H3V7H8V6Z" fill="#22242B" />
|
|
16
|
+
<path d="M8 3H5V4H8V3Z" fill="#22242B" />
|
|
17
|
+
</svg>
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
export const AscSortIcon = styled(Icon).attrs(() => ({
|
|
21
|
+
'data-component-name': 'icons/AscSortIcon/AscSortIcon',
|
|
22
|
+
}))<IconProps>`
|
|
23
|
+
path {
|
|
24
|
+
fill: ${({ color }) => getCssColorVariable(color)};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
height: ${({ size }) => size || '16px'};
|
|
28
|
+
width: ${({ size }) => size || '16px'};
|
|
29
|
+
`;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import type { IconProps } from '@redocly/theme/icons/types';
|
|
5
|
+
|
|
6
|
+
import { getCssColorVariable } from '@redocly/theme/core/utils';
|
|
7
|
+
|
|
8
|
+
const Icon = (props: IconProps) => (
|
|
9
|
+
<svg viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
|
|
10
|
+
<path
|
|
11
|
+
d="M4 0H1C0.734784 0 0.48043 0.105357 0.292893 0.292893C0.105357 0.48043 0 0.734784 0 1V4C0 4.26522 0.105357 4.51957 0.292893 4.70711C0.48043 4.89464 0.734784 5 1 5H4C4.26522 5 4.51957 4.89464 4.70711 4.70711C4.89464 4.51957 5 4.26522 5 4V1C5 0.734784 4.89464 0.48043 4.70711 0.292893C4.51957 0.105357 4.26522 0 4 0ZM4 4H1V1H4V4Z"
|
|
12
|
+
fill="#22242B"
|
|
13
|
+
/>
|
|
14
|
+
<path
|
|
15
|
+
d="M11 0H8C7.73478 0 7.48043 0.105357 7.29289 0.292893C7.10536 0.48043 7 0.734784 7 1V4C7 4.26522 7.10536 4.51957 7.29289 4.70711C7.48043 4.89464 7.73478 5 8 5H11C11.2652 5 11.5196 4.89464 11.7071 4.70711C11.8946 4.51957 12 4.26522 12 4V1C12 0.734784 11.8946 0.48043 11.7071 0.292893C11.5196 0.105357 11.2652 0 11 0ZM11 4H8V1H11V4Z"
|
|
16
|
+
fill="#22242B"
|
|
17
|
+
/>
|
|
18
|
+
<path
|
|
19
|
+
d="M4 7H1C0.734784 7 0.48043 7.10536 0.292893 7.29289C0.105357 7.48043 0 7.73478 0 8V11C0 11.2652 0.105357 11.5196 0.292893 11.7071C0.48043 11.8946 0.734784 12 1 12H4C4.26522 12 4.51957 11.8946 4.70711 11.7071C4.89464 11.5196 5 11.2652 5 11V8C5 7.73478 4.89464 7.48043 4.70711 7.29289C4.51957 7.10536 4.26522 7 4 7ZM4 11H1V8H4V11Z"
|
|
20
|
+
fill="#22242B"
|
|
21
|
+
/>
|
|
22
|
+
<path
|
|
23
|
+
d="M11 7H8C7.73478 7 7.48043 7.10536 7.29289 7.29289C7.10536 7.48043 7 7.73478 7 8V11C7 11.2652 7.10536 11.5196 7.29289 11.7071C7.48043 11.8946 7.73478 12 8 12H11C11.2652 12 11.5196 11.8946 11.7071 11.7071C11.8946 11.5196 12 11.2652 12 11V8C12 7.73478 11.8946 7.48043 11.7071 7.29289C11.5196 7.10536 11.2652 7 11 7ZM11 11H8V8H11V11Z"
|
|
24
|
+
fill="#22242B"
|
|
25
|
+
/>
|
|
26
|
+
</svg>
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
export const CardsIcon = styled(Icon).attrs(() => ({
|
|
30
|
+
'data-component-name': 'icons/CardsIcon/CardsIcon',
|
|
31
|
+
}))<IconProps>`
|
|
32
|
+
path {
|
|
33
|
+
fill: ${({ color }) => getCssColorVariable(color)};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
height: ${({ size }) => size || '16px'};
|
|
37
|
+
width: ${({ size }) => size || '16px'};
|
|
38
|
+
`;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import type { IconProps } from '@redocly/theme/icons/types';
|
|
5
|
+
|
|
6
|
+
import { getCssColorVariable } from '@redocly/theme/core/utils';
|
|
7
|
+
|
|
8
|
+
const Icon = (props: IconProps) => (
|
|
9
|
+
<svg viewBox="0 0 8 4" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
|
|
10
|
+
<path
|
|
11
|
+
d="M6.77566 0C7.04293 0 7.17678 0.323143 6.98779 0.512132L4.21205 3.28787C4.0949 3.40503 3.90495 3.40503 3.78779 3.28787L1.01205 0.512132C0.823064 0.323142 0.956914 0 1.22419 0H6.77566Z"
|
|
12
|
+
fill="#6E6F7A"
|
|
13
|
+
/>
|
|
14
|
+
</svg>
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
export const CaretDownIcon = styled(Icon).attrs(() => ({
|
|
18
|
+
'data-component-name': 'icons/CaretDownIcon/CaretDownIcon',
|
|
19
|
+
}))<IconProps>`
|
|
20
|
+
path {
|
|
21
|
+
fill: ${({ color }) => getCssColorVariable(color)};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
height: ${({ size }) => size || '4px'};
|
|
25
|
+
width: ${({ size }) => size || '8px'};
|
|
26
|
+
`;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import type { IconProps } from '@redocly/theme/icons/types';
|
|
5
|
+
|
|
6
|
+
import { getCssColorVariable } from '@redocly/theme/core/utils';
|
|
7
|
+
|
|
8
|
+
const Icon = (props: IconProps) => (
|
|
9
|
+
<svg viewBox="0 0 8 4" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
|
|
10
|
+
<path
|
|
11
|
+
d="M1.22419 3.99573C0.956914 3.99573 0.823064 3.67259 1.01205 3.4836L3.78779 0.707863C3.90495 0.590706 4.0949 0.590706 4.21205 0.707863L6.98779 3.4836C7.17678 3.67259 7.04293 3.99573 6.77566 3.99573L1.22419 3.99573Z"
|
|
12
|
+
fill="#6E6F7A"
|
|
13
|
+
/>
|
|
14
|
+
</svg>
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
export const CaretUpIcon = styled(Icon).attrs(() => ({
|
|
18
|
+
'data-component-name': 'icons/CaretUpIcon/CaretUpIcon',
|
|
19
|
+
}))<IconProps>`
|
|
20
|
+
path {
|
|
21
|
+
fill: ${({ color }) => getCssColorVariable(color)};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
height: ${({ size }) => size || '4px'};
|
|
25
|
+
width: ${({ size }) => size || '8px'};
|
|
26
|
+
`;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import type { IconProps } from '@redocly/theme/icons/types';
|
|
5
|
+
|
|
6
|
+
import { getCssColorVariable } from '@redocly/theme/core/utils';
|
|
7
|
+
|
|
8
|
+
const Icon = (props: IconProps) => (
|
|
9
|
+
<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
|
|
10
|
+
<path
|
|
11
|
+
d="M9 11L9.707 10.293L11.5 12.086V2H12.5V12.086L14.293 10.293L15 11L12 14L9 11Z"
|
|
12
|
+
fill="#22242B"
|
|
13
|
+
/>
|
|
14
|
+
<path d="M8 3H1V4H8V3Z" fill="#22242B" />
|
|
15
|
+
<path d="M8 6H3V7H8V6Z" fill="#22242B" />
|
|
16
|
+
<path d="M8 9H5V10H8V9Z" fill="#22242B" />
|
|
17
|
+
</svg>
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
export const DescSortIcon = styled(Icon).attrs(() => ({
|
|
21
|
+
'data-component-name': 'icons/DescSortIcon/DescSortIcon',
|
|
22
|
+
}))<IconProps>`
|
|
23
|
+
path {
|
|
24
|
+
fill: ${({ color }) => getCssColorVariable(color)};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
height: ${({ size }) => size || '16px'};
|
|
28
|
+
width: ${({ size }) => size || '16px'};
|
|
29
|
+
`;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import type { IconProps } from '@redocly/theme/icons/types';
|
|
5
|
+
|
|
6
|
+
import { getCssColorVariable } from '@redocly/theme/core/utils';
|
|
7
|
+
|
|
8
|
+
const Icon = (props: IconProps) => (
|
|
9
|
+
<svg
|
|
10
|
+
width="18"
|
|
11
|
+
height="18"
|
|
12
|
+
viewBox="0 0 18 18"
|
|
13
|
+
fill="none"
|
|
14
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
15
|
+
{...props}
|
|
16
|
+
>
|
|
17
|
+
<path
|
|
18
|
+
d="M17.7501 8.375H9.62507V0.250001H8.37507V8.375H0.250073V9.625H8.37507V17.75H9.62507V9.625H17.7501V8.375Z"
|
|
19
|
+
fill="#555761"
|
|
20
|
+
/>
|
|
21
|
+
<path
|
|
22
|
+
d="M14.9913 11.5L15.8751 12.3837L13.6338 14.625L15.8751 16.8662L14.9913 17.75L11.8663 14.625L14.9913 11.5Z"
|
|
23
|
+
fill="#555761"
|
|
24
|
+
/>
|
|
25
|
+
<path
|
|
26
|
+
d="M5.87507 17.75H0.875073C0.768526 17.75 0.663745 17.7228 0.570682 17.6709C0.477618 17.619 0.399362 17.5442 0.343347 17.4536C0.287331 17.363 0.255415 17.2595 0.250631 17.1531C0.245846 17.0466 0.268352 16.9407 0.31601 16.8454L2.81601 11.8454C2.8737 11.7486 2.95556 11.6684 3.05356 11.6127C3.15156 11.557 3.26235 11.5277 3.37507 11.5277C3.48779 11.5277 3.59858 11.557 3.69659 11.6127C3.79459 11.6684 3.87644 11.7486 3.93413 11.8454L6.43413 16.8454C6.48179 16.9407 6.5043 17.0466 6.49951 17.1531C6.49473 17.2595 6.46281 17.363 6.4068 17.4536C6.35078 17.5442 6.27253 17.619 6.17946 17.6709C6.0864 17.7228 5.98162 17.75 5.87507 17.75ZM1.88645 16.5H4.8637L3.37507 13.5227L1.88645 16.5Z"
|
|
27
|
+
fill="#555761"
|
|
28
|
+
/>
|
|
29
|
+
<path
|
|
30
|
+
d="M16.5001 6.5H12.7501C12.4187 6.49962 12.1009 6.3678 11.8666 6.13346C11.6323 5.89913 11.5005 5.5814 11.5001 5.25V1.5C11.5005 1.1686 11.6323 0.850876 11.8666 0.616538C12.1009 0.3822 12.4187 0.250382 12.7501 0.250001H16.5001C16.8315 0.250382 17.1492 0.3822 17.3835 0.616538C17.6179 0.850876 17.7497 1.1686 17.7501 1.5V5.25C17.7497 5.5814 17.6179 5.89913 17.3835 6.13346C17.1492 6.3678 16.8315 6.49962 16.5001 6.5ZM12.7501 1.5V5.25H16.5007L16.5001 1.5H12.7501Z"
|
|
31
|
+
fill="#555761"
|
|
32
|
+
/>
|
|
33
|
+
<path
|
|
34
|
+
d="M3.37507 6.5C2.75701 6.5 2.15282 6.31672 1.63892 5.97334C1.12501 5.62996 0.724473 5.14191 0.487949 4.57089C0.251425 3.99987 0.18954 3.37153 0.310119 2.76534C0.430697 2.15915 0.728325 1.60233 1.16536 1.16529C1.6024 0.728254 2.15922 0.430626 2.76542 0.310047C3.37161 0.189469 3.99994 0.251354 4.57096 0.487878C5.14198 0.724402 5.63003 1.12494 5.97341 1.63884C6.31679 2.15275 6.50007 2.75693 6.50007 3.375C6.4991 4.2035 6.16954 4.99779 5.5837 5.58363C4.99786 6.16947 4.20357 6.49902 3.37507 6.5ZM3.37507 1.5C3.00423 1.5 2.64172 1.60997 2.33338 1.816C2.02504 2.02202 1.78471 2.31486 1.6428 2.65747C1.50088 3.00008 1.46375 3.37708 1.5361 3.7408C1.60845 4.10451 1.78702 4.4386 2.04925 4.70083C2.31147 4.96305 2.64556 5.14163 3.00928 5.21397C3.37299 5.28632 3.74999 5.24919 4.0926 5.10728C4.43522 4.96536 4.72805 4.72504 4.93408 4.4167C5.14011 4.10835 5.25007 3.74584 5.25007 3.375C5.24953 2.87789 5.05181 2.40129 4.70029 2.04978C4.34878 1.69827 3.87219 1.50055 3.37507 1.5Z"
|
|
35
|
+
fill="#555761"
|
|
36
|
+
/>
|
|
37
|
+
</svg>
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
export const EntityTypeIcon = styled(Icon).attrs(() => ({
|
|
41
|
+
'data-component-name': 'icons/EntityTypeIcon/EntityTypeIcon',
|
|
42
|
+
}))<IconProps>`
|
|
43
|
+
path {
|
|
44
|
+
fill: ${({ color }) => getCssColorVariable(color)};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
height: ${({ size }) => size || '16px'};
|
|
48
|
+
width: ${({ size }) => size || '18px'};
|
|
49
|
+
`;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import type { IconProps } from '@redocly/theme/icons/types';
|
|
5
|
+
|
|
6
|
+
import { getCssColorVariable } from '@redocly/theme/core/utils';
|
|
7
|
+
|
|
8
|
+
const Icon = (props: IconProps) => (
|
|
9
|
+
<svg
|
|
10
|
+
width="18"
|
|
11
|
+
height="18"
|
|
12
|
+
viewBox="0 0 18 18"
|
|
13
|
+
fill="none"
|
|
14
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
15
|
+
{...props}
|
|
16
|
+
>
|
|
17
|
+
<path
|
|
18
|
+
fillRule="evenodd"
|
|
19
|
+
clipRule="evenodd"
|
|
20
|
+
d="M8.99982 0.250052C6.9225 0.250332 4.91303 0.989665 3.33088 2.3358C1.74873 3.68193 0.697109 5.54705 0.364134 7.59751C0.0311591 9.64798 0.438552 11.75 1.51344 13.5276C2.58832 15.3052 4.26058 16.6424 6.23107 17.3001C6.66857 17.3813 6.85607 17.1126 6.85607 16.8813C6.85607 16.6501 6.85607 16.1251 6.85607 15.3938C4.42482 15.9188 3.91232 14.2188 3.91232 14.2188C3.74135 13.6831 3.38152 13.2277 2.89982 12.9376C2.10607 12.4001 2.96232 12.4063 2.96232 12.4063C3.23957 12.4455 3.50421 12.5475 3.73601 12.7045C3.96782 12.8616 4.16066 13.0696 4.29982 13.3126C4.54191 13.7468 4.94653 14.0671 5.42471 14.203C5.9029 14.339 6.4155 14.2794 6.84982 14.0376C6.88511 13.5941 7.08061 13.1786 7.39982 12.8688C5.46232 12.6438 3.41857 11.8938 3.41857 8.5438C3.4044 7.67374 3.72683 6.83182 4.31857 6.1938C4.05073 5.44017 4.08205 4.61254 4.40607 3.8813C4.40607 3.8813 5.13732 3.6438 6.81232 4.77505C8.24449 4.3844 9.75515 4.3844 11.1873 4.77505C12.8561 3.6438 13.5873 3.8813 13.5873 3.8813C13.9113 4.61254 13.9427 5.44017 13.6748 6.1938C14.2666 6.83182 14.589 7.67374 14.5748 8.5438C14.5748 11.9063 12.5311 12.6438 10.5811 12.8626C10.79 13.0743 10.951 13.3283 11.0535 13.6075C11.1559 13.8868 11.1973 14.1847 11.1748 14.4813C11.1748 15.6501 11.1748 16.5938 11.1748 16.8813C11.1748 17.1688 11.3311 17.3876 11.7998 17.3001C13.7729 16.6416 15.4469 15.3018 16.5216 13.521C17.5963 11.7401 18.0015 9.63459 17.6644 7.58204C17.3273 5.5295 16.2701 3.66416 14.6822 2.32053C13.0944 0.976903 11.0798 0.242866 8.99982 0.250052Z"
|
|
21
|
+
fill="#555761"
|
|
22
|
+
/>
|
|
23
|
+
</svg>
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
export const GithubIcon = styled(Icon).attrs(() => ({
|
|
27
|
+
'data-component-name': 'icons/GithubIcon/GithubIcon',
|
|
28
|
+
}))<IconProps>`
|
|
29
|
+
path {
|
|
30
|
+
fill: ${({ color }) => getCssColorVariable(color)};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
height: ${({ size }) => size || '16px'};
|
|
34
|
+
width: ${({ size }) => size || '18px'};
|
|
35
|
+
`;
|