@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,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useCodeWalkthroughSteps = useCodeWalkthroughSteps;
|
|
4
|
+
exports.getGroupMarkers = getGroupMarkers;
|
|
4
5
|
const react_1 = require("react");
|
|
5
6
|
const react_router_dom_1 = require("react-router-dom");
|
|
6
7
|
const utils_1 = require("../../../core/utils");
|
|
7
8
|
const constants_1 = require("../../../core/constants");
|
|
8
|
-
function useCodeWalkthroughSteps(steps, enableDeepLink) {
|
|
9
|
+
function useCodeWalkthroughSteps({ steps, enableDeepLink, root, }) {
|
|
9
10
|
const location = (0, react_router_dom_1.useLocation)();
|
|
10
11
|
const navigate = (0, react_router_dom_1.useNavigate)();
|
|
11
12
|
const searchParams = (0, react_1.useMemo)(() => new URLSearchParams(location.search), [location.search]);
|
|
@@ -15,56 +16,122 @@ function useCodeWalkthroughSteps(steps, enableDeepLink) {
|
|
|
15
16
|
// Track observed elements in case new observer needs to be created
|
|
16
17
|
const observedElementsRef = (0, react_1.useRef)(new Set());
|
|
17
18
|
const [activeStep, setActiveStep] = (0, react_1.useState)(enableDeepLink ? searchParams.get(constants_1.ACTIVE_STEP_QUERY_PARAM) : null);
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
19
|
+
const stepsMap = (0, react_1.useMemo)(() => {
|
|
20
|
+
const map = new Map();
|
|
21
|
+
steps.forEach((step, index) => {
|
|
22
|
+
map.set(step.id, Object.assign(Object.assign({}, step), { index }));
|
|
23
|
+
});
|
|
24
|
+
return map;
|
|
25
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
26
|
+
}, [JSON.stringify(steps)]);
|
|
27
|
+
const options = (0, react_1.useMemo)(() => {
|
|
28
|
+
var _a, _b;
|
|
29
|
+
if (!(0, utils_1.isBrowser)()) {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
const filtersElementHeight = ((_a = filtersElementRef.current) === null || _a === void 0 ? void 0 : _a.clientHeight) || 0;
|
|
33
|
+
const navbarHeight = ((_b = document.querySelector('nav')) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect().height) || 0;
|
|
34
|
+
return {
|
|
35
|
+
filtersElementHeight,
|
|
36
|
+
navbarHeight,
|
|
37
|
+
};
|
|
38
|
+
}, []);
|
|
39
|
+
const [visibleSteps, setVisibleSteps] = (0, react_1.useState)([]);
|
|
40
|
+
const [markers, setMarkers] = (0, react_1.useState)({});
|
|
41
|
+
(0, react_1.useEffect)(() => {
|
|
42
|
+
var _a, _b, _c, _d, _e;
|
|
43
|
+
if (!root.current || !visibleSteps.length || !options) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const markersMinTopOffset = options.filtersElementHeight + options.navbarHeight;
|
|
47
|
+
const rootHeight = (_b = (_a = root.current) === null || _a === void 0 ? void 0 : _a.clientHeight) !== null && _b !== void 0 ? _b : 0;
|
|
48
|
+
const lastStepOffset = (_e = (_d = (_c = visibleSteps[visibleSteps.length - 1]) === null || _c === void 0 ? void 0 : _c.compRef) === null || _d === void 0 ? void 0 : _d.offsetTop) !== null && _e !== void 0 ? _e : 0;
|
|
49
|
+
const deficit = Math.max(lastStepOffset - (rootHeight - window.innerHeight), 0);
|
|
50
|
+
const groups = getGroups(visibleSteps);
|
|
51
|
+
let markers = groups.flatMap((group) => getGroupMarkers(group));
|
|
52
|
+
if (deficit) {
|
|
53
|
+
const startOffset = markersMinTopOffset;
|
|
54
|
+
const endOffset = Math.max(rootHeight - window.innerHeight, 0);
|
|
55
|
+
markers = distributeMarkers({
|
|
56
|
+
endOffset,
|
|
57
|
+
markers,
|
|
58
|
+
startOffset: markersMinTopOffset < endOffset ? startOffset : 0,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
setMarkers(markers.reduce((acc, marker, index) => {
|
|
62
|
+
var _a;
|
|
63
|
+
const step = visibleSteps[index];
|
|
64
|
+
acc[step.id] = {
|
|
65
|
+
offset: marker,
|
|
66
|
+
height: markers[index + 1] || !step.compRef
|
|
67
|
+
? ((_a = markers[index + 1]) !== null && _a !== void 0 ? _a : rootHeight) - marker
|
|
68
|
+
: step.compRef.clientHeight,
|
|
69
|
+
};
|
|
70
|
+
return acc;
|
|
71
|
+
}, {}));
|
|
72
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
73
|
+
}, [visibleSteps, root.current, options]);
|
|
74
|
+
const registerMarker = (0, react_1.useCallback)((stepId, element) => {
|
|
75
|
+
if (observerRef.current) {
|
|
76
|
+
const step = stepsMap.get(stepId);
|
|
77
|
+
if (step) {
|
|
78
|
+
step.markerRef = element;
|
|
30
79
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
80
|
+
observerRef.current.observe(element);
|
|
81
|
+
observedElementsRef.current.add(element);
|
|
82
|
+
}
|
|
83
|
+
}, [stepsMap]);
|
|
84
|
+
const removeMarker = (0, react_1.useCallback)((stepId, element) => {
|
|
34
85
|
if (observerRef.current) {
|
|
35
|
-
const
|
|
36
|
-
if (
|
|
37
|
-
|
|
86
|
+
const step = stepsMap.get(stepId);
|
|
87
|
+
if (step) {
|
|
88
|
+
step.markerRef = undefined;
|
|
38
89
|
}
|
|
39
90
|
observerRef.current.unobserve(element);
|
|
40
91
|
observedElementsRef.current.delete(element);
|
|
41
92
|
}
|
|
42
|
-
}, [
|
|
93
|
+
}, [stepsMap]);
|
|
94
|
+
const registerStep = (0, react_1.useCallback)((stepId, element) => {
|
|
95
|
+
const step = stepsMap.get(stepId);
|
|
96
|
+
if (!step) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
step.compRef = element;
|
|
100
|
+
setVisibleSteps((prevSteps) => (0, utils_1.insertAt)(prevSteps, step.index, step));
|
|
101
|
+
}, [stepsMap]);
|
|
102
|
+
const removeStep = (0, react_1.useCallback)((stepId) => {
|
|
103
|
+
const step = stepsMap.get(stepId);
|
|
104
|
+
if (!step) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
step.compRef = undefined;
|
|
108
|
+
setVisibleSteps((prevSteps) => (0, utils_1.removeElement)(prevSteps, step));
|
|
109
|
+
setActiveStep((prevStep) => (prevStep === stepId ? null : prevStep));
|
|
110
|
+
}, [stepsMap]);
|
|
43
111
|
const observerCallback = (0, react_1.useCallback)((entries) => {
|
|
44
112
|
var _a, _b, _c;
|
|
45
|
-
if (lockObserver.current) {
|
|
113
|
+
if (lockObserver.current || !visibleSteps.length) {
|
|
46
114
|
return;
|
|
47
115
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
setActiveStep(((_a = renderedSteps[0]) === null || _a === void 0 ? void 0 : _a.id) || null);
|
|
116
|
+
if (visibleSteps.length < 2) {
|
|
117
|
+
setActiveStep(((_a = visibleSteps[0]) === null || _a === void 0 ? void 0 : _a.id) || null);
|
|
51
118
|
return;
|
|
52
119
|
}
|
|
53
120
|
for (const entry of entries) {
|
|
54
|
-
const
|
|
55
|
-
if (!
|
|
121
|
+
const stepId = (_c = (_b = entry.target) === null || _b === void 0 ? void 0 : _b.dataset) === null || _c === void 0 ? void 0 : _c.stepId;
|
|
122
|
+
if (!stepId) {
|
|
56
123
|
continue;
|
|
57
124
|
}
|
|
58
125
|
const { intersectionRatio, boundingClientRect, rootBounds, isIntersecting } = entry;
|
|
59
|
-
const step =
|
|
60
|
-
|
|
61
|
-
|
|
126
|
+
const step = stepsMap.get(stepId);
|
|
127
|
+
if (!step) {
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
const stepIndex = visibleSteps.findIndex((renderedStep) => renderedStep.id === stepId);
|
|
131
|
+
const { next } = (0, utils_1.getAdjacentValues)(visibleSteps, stepIndex);
|
|
62
132
|
const intersectionAtTop = (rootBounds === null || rootBounds === void 0 ? void 0 : rootBounds.bottom) !== undefined && boundingClientRect.top < rootBounds.top;
|
|
63
133
|
const stepGoesIn = isIntersecting;
|
|
64
|
-
if (intersectionRatio > 0.8 &&
|
|
65
|
-
intersectionRatio < 1 &&
|
|
66
|
-
intersectionAtTop &&
|
|
67
|
-
activeStep === null) {
|
|
134
|
+
if (intersectionRatio > 0.8 && intersectionRatio < 1 && intersectionAtTop) {
|
|
68
135
|
setActiveStep(step.id);
|
|
69
136
|
break;
|
|
70
137
|
}
|
|
@@ -76,28 +143,37 @@ function useCodeWalkthroughSteps(steps, enableDeepLink) {
|
|
|
76
143
|
else if (next) {
|
|
77
144
|
newStep = next.id;
|
|
78
145
|
}
|
|
79
|
-
|
|
80
|
-
setActiveStep(newStep);
|
|
81
|
-
}
|
|
146
|
+
setActiveStep((prevStep) => newStep || prevStep);
|
|
82
147
|
break;
|
|
83
148
|
}
|
|
84
149
|
}
|
|
85
|
-
}, [
|
|
150
|
+
}, [stepsMap, visibleSteps]);
|
|
86
151
|
(0, react_1.useEffect)(() => {
|
|
87
|
-
var _a
|
|
88
|
-
|
|
89
|
-
|
|
152
|
+
var _a;
|
|
153
|
+
if (!options) {
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
90
156
|
const newObserver = new IntersectionObserver(observerCallback, {
|
|
91
|
-
threshold: [0.
|
|
92
|
-
rootMargin: `-${filtersElementHeight + navbarHeight}px 0px 0px 0px`,
|
|
157
|
+
threshold: [0.3, 0.8, 0.9, 0.95],
|
|
158
|
+
rootMargin: `-${options.filtersElementHeight + options.navbarHeight}px 0px 0px 0px`,
|
|
93
159
|
});
|
|
94
|
-
for (const observedElement of observedElementsRef.current) {
|
|
160
|
+
for (const observedElement of observedElementsRef.current.values()) {
|
|
95
161
|
newObserver.observe(observedElement);
|
|
96
162
|
}
|
|
97
|
-
|
|
98
|
-
(_c = observerRef.current) === null || _c === void 0 ? void 0 : _c.disconnect();
|
|
163
|
+
(_a = observerRef.current) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
99
164
|
observerRef.current = newObserver;
|
|
100
|
-
}, [observerCallback]);
|
|
165
|
+
}, [observerCallback, markers, options]);
|
|
166
|
+
(0, react_1.useEffect)(() => {
|
|
167
|
+
var _a, _b, _c;
|
|
168
|
+
if (!options) {
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
const rootTopOffset = (_b = (_a = root.current) === null || _a === void 0 ? void 0 : _a.offsetTop) !== null && _b !== void 0 ? _b : 0;
|
|
172
|
+
if (!activeStep && rootTopOffset <= options.navbarHeight) {
|
|
173
|
+
setActiveStep(((_c = visibleSteps[0]) === null || _c === void 0 ? void 0 : _c.id) || null);
|
|
174
|
+
}
|
|
175
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
176
|
+
}, [activeStep, root.current, options, visibleSteps]);
|
|
101
177
|
/**
|
|
102
178
|
* Update the URL search params with the current state of the filters and inputs
|
|
103
179
|
*/
|
|
@@ -118,6 +194,125 @@ function useCodeWalkthroughSteps(steps, enableDeepLink) {
|
|
|
118
194
|
navigate({ search: newSearch }, { replace: true });
|
|
119
195
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
120
196
|
}, [activeStep]);
|
|
121
|
-
return {
|
|
197
|
+
return {
|
|
198
|
+
registerStep,
|
|
199
|
+
removeStep,
|
|
200
|
+
markers,
|
|
201
|
+
registerMarker,
|
|
202
|
+
removeMarker,
|
|
203
|
+
lockObserver,
|
|
204
|
+
filtersElementRef,
|
|
205
|
+
activeStep,
|
|
206
|
+
setActiveStep,
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* This function analyzes the offset and height of each step to determine
|
|
211
|
+
* when a new group should be created. A new group is started when there is a free space
|
|
212
|
+
* between the two steps, treating it as the content of the next group header.
|
|
213
|
+
*
|
|
214
|
+
* @param steps - An array of `CodeWalkthroughStep` objects
|
|
215
|
+
*
|
|
216
|
+
* @returns An array of `StepsGroup` objects, each containing the offset from the top of the relative
|
|
217
|
+
* block, the free space at the top of the group, the total space used by the steps within the group
|
|
218
|
+
* and the steps themselves with relative offset and height.
|
|
219
|
+
*/
|
|
220
|
+
function getGroups(steps) {
|
|
221
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
222
|
+
if (!steps.length) {
|
|
223
|
+
return [];
|
|
224
|
+
}
|
|
225
|
+
const firstStepOffset = (_c = (_b = (_a = steps[0]) === null || _a === void 0 ? void 0 : _a.compRef) === null || _b === void 0 ? void 0 : _b.offsetTop) !== null && _c !== void 0 ? _c : 0;
|
|
226
|
+
const firstStepHeight = (_f = (_e = (_d = steps[0]) === null || _d === void 0 ? void 0 : _d.compRef) === null || _e === void 0 ? void 0 : _e.clientHeight) !== null && _f !== void 0 ? _f : 0;
|
|
227
|
+
const secondStepOffset = (_j = (_h = (_g = steps[1]) === null || _g === void 0 ? void 0 : _g.compRef) === null || _h === void 0 ? void 0 : _h.offsetTop) !== null && _j !== void 0 ? _j : 0;
|
|
228
|
+
const margin = Math.max(secondStepOffset - firstStepOffset - firstStepHeight, 0);
|
|
229
|
+
let groupIndex = 0;
|
|
230
|
+
const groups = [
|
|
231
|
+
{
|
|
232
|
+
offset: 0,
|
|
233
|
+
freeSpace: firstStepOffset,
|
|
234
|
+
usedSpace: 0,
|
|
235
|
+
steps: [],
|
|
236
|
+
},
|
|
237
|
+
];
|
|
238
|
+
for (let i = 0; i < steps.length; i++) {
|
|
239
|
+
let currentGroup = groups[groupIndex];
|
|
240
|
+
const step = steps[i];
|
|
241
|
+
const stepHeight = (_l = (_k = step.compRef) === null || _k === void 0 ? void 0 : _k.clientHeight) !== null && _l !== void 0 ? _l : 0;
|
|
242
|
+
const stepOffset = (_o = (_m = step.compRef) === null || _m === void 0 ? void 0 : _m.offsetTop) !== null && _o !== void 0 ? _o : 0;
|
|
243
|
+
const prevStepOffset = currentGroup.freeSpace + currentGroup.usedSpace;
|
|
244
|
+
if (prevStepOffset !== Math.max(stepOffset - currentGroup.offset, 0)) {
|
|
245
|
+
const offset = currentGroup.offset + currentGroup.freeSpace + currentGroup.usedSpace;
|
|
246
|
+
groupIndex++;
|
|
247
|
+
groups[groupIndex] = {
|
|
248
|
+
offset,
|
|
249
|
+
freeSpace: Math.max(stepOffset - offset, 0),
|
|
250
|
+
usedSpace: 0,
|
|
251
|
+
steps: [],
|
|
252
|
+
};
|
|
253
|
+
currentGroup = groups[groupIndex];
|
|
254
|
+
}
|
|
255
|
+
currentGroup.steps.push({
|
|
256
|
+
offset: stepOffset - currentGroup.offset,
|
|
257
|
+
height: stepHeight,
|
|
258
|
+
ref: step.compRef,
|
|
259
|
+
});
|
|
260
|
+
currentGroup.usedSpace += stepHeight + margin;
|
|
261
|
+
}
|
|
262
|
+
return groups;
|
|
263
|
+
}
|
|
264
|
+
function getGroupMarkers(group) {
|
|
265
|
+
if (!group.steps.length) {
|
|
266
|
+
return [];
|
|
267
|
+
}
|
|
268
|
+
if (group.steps.length === 1) {
|
|
269
|
+
return [group.offset + group.steps[0].offset - group.freeSpace];
|
|
270
|
+
}
|
|
271
|
+
const availableFreeSpace = group.freeSpace > 0.3 * window.innerHeight ? 0.3 * window.innerHeight : group.freeSpace;
|
|
272
|
+
const unusedFreeSpace = group.freeSpace - availableFreeSpace;
|
|
273
|
+
const lastStepOffset = group.steps[group.steps.length - 1].offset;
|
|
274
|
+
// distribute group free space between steps
|
|
275
|
+
return distributeMarkers({
|
|
276
|
+
startOffset: 0,
|
|
277
|
+
endOffset: lastStepOffset - unusedFreeSpace,
|
|
278
|
+
markers: group.steps.map((step) => step.offset),
|
|
279
|
+
additionalSteps: [(marker) => group.offset + unusedFreeSpace + marker],
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Distribute markers preserving the relationship throughout the available space
|
|
284
|
+
* @param startOffset - the starting point of the available space
|
|
285
|
+
* @param endOffset - the end point of the available space
|
|
286
|
+
* @param markers - the markers to distribute
|
|
287
|
+
* @param additionalSteps - additional steps to apply to the markers
|
|
288
|
+
*
|
|
289
|
+
* @returns array of markers positions
|
|
290
|
+
*/
|
|
291
|
+
function distributeMarkers({ endOffset, markers, startOffset, additionalSteps = [], }) {
|
|
292
|
+
return markers.map((marker) => {
|
|
293
|
+
const normalizedOffset = getNormalizedNumber({
|
|
294
|
+
min: markers[0],
|
|
295
|
+
max: markers[markers.length - 1],
|
|
296
|
+
value: marker,
|
|
297
|
+
});
|
|
298
|
+
const availableSpace = endOffset - startOffset;
|
|
299
|
+
let result = startOffset + normalizedOffset * availableSpace;
|
|
300
|
+
for (const additionalStep of additionalSteps) {
|
|
301
|
+
result = additionalStep(result);
|
|
302
|
+
}
|
|
303
|
+
return result;
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Normalize a number between a min and max value
|
|
308
|
+
* @param min - the minimum value of the distribution
|
|
309
|
+
* @param max - the maximum value of the distribution
|
|
310
|
+
* @param value - the value to normalize
|
|
311
|
+
*
|
|
312
|
+
* @returns normalized number between 0 and 1
|
|
313
|
+
*/
|
|
314
|
+
function getNormalizedNumber(options) {
|
|
315
|
+
const { min, max, value } = options;
|
|
316
|
+
return (value - min) / (max - min);
|
|
122
317
|
}
|
|
123
318
|
//# sourceMappingURL=use-code-walkthrough-steps.js.map
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import type { CodeWalkthroughFile, CodeWalkthroughStepAttr, CodeWalkthroughAttr } from '@redocly/config';
|
|
2
|
-
import
|
|
2
|
+
import type { WalkthroughStepsState } from '../../../core/types';
|
|
3
|
+
import { type WalkthroughControlsState } from '../../../core/hooks';
|
|
3
4
|
export type WalkthroughState = {
|
|
4
5
|
stepsState: WalkthroughStepsState;
|
|
5
6
|
controlsState: WalkthroughControlsState;
|
|
6
7
|
downloadAssociatedFiles: CodeWalkthroughFile[];
|
|
7
8
|
files: CodeWalkthroughFile[];
|
|
8
9
|
};
|
|
9
|
-
|
|
10
|
+
type Params = {
|
|
11
|
+
steps: CodeWalkthroughStepAttr[];
|
|
12
|
+
attributes: Omit<CodeWalkthroughAttr, 'steps' | 'preview'>;
|
|
13
|
+
root: React.RefObject<HTMLDivElement | null>;
|
|
14
|
+
};
|
|
15
|
+
export declare function useCodeWalkthrough({ steps, attributes, root }: Params): WalkthroughState;
|
|
16
|
+
export {};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useCodeWalkthrough = useCodeWalkthrough;
|
|
4
4
|
const hooks_1 = require("../../../core/hooks");
|
|
5
|
-
function useCodeWalkthrough(steps, attributes) {
|
|
5
|
+
function useCodeWalkthrough({ steps, attributes, root }) {
|
|
6
6
|
const { filters, filesets, inputs, toggles, __idx } = attributes;
|
|
7
7
|
/*
|
|
8
8
|
We only enable deep linking for the first CodeWalkthrough,
|
|
@@ -11,7 +11,7 @@ function useCodeWalkthrough(steps, attributes) {
|
|
|
11
11
|
collisions/conflicts in the URL.
|
|
12
12
|
*/
|
|
13
13
|
const enableDeepLink = __idx === 1;
|
|
14
|
-
const stepsState = (0, hooks_1.useCodeWalkthroughSteps)(steps, enableDeepLink);
|
|
14
|
+
const stepsState = (0, hooks_1.useCodeWalkthroughSteps)({ steps, enableDeepLink, root });
|
|
15
15
|
const controlsState = (0, hooks_1.useCodeWalkthroughControls)(filters, inputs, toggles, enableDeepLink);
|
|
16
16
|
const files = filesets
|
|
17
17
|
.filter((fileset) => controlsState.areConditionsMet(fileset))
|
|
@@ -36,5 +36,7 @@ export * from '../../core/hooks/code-walkthrough/use-renderable-files';
|
|
|
36
36
|
export * from '../../core/hooks/use-element-size';
|
|
37
37
|
export * from '../../core/hooks/use-time-ago';
|
|
38
38
|
export * from '../../core/hooks/use-input-key-commands';
|
|
39
|
-
export * from '../../core/hooks/
|
|
39
|
+
export * from '../../core/hooks/catalog/useCatalogEntities';
|
|
40
|
+
export * from '../../core/hooks/use-active-page-version';
|
|
40
41
|
export * from '../../core/hooks/use-page-versions';
|
|
42
|
+
export * from '../../core/hooks/use-user-teams';
|
package/lib/core/hooks/index.js
CHANGED
|
@@ -52,6 +52,8 @@ __exportStar(require("../../core/hooks/code-walkthrough/use-renderable-files"),
|
|
|
52
52
|
__exportStar(require("../../core/hooks/use-element-size"), exports);
|
|
53
53
|
__exportStar(require("../../core/hooks/use-time-ago"), exports);
|
|
54
54
|
__exportStar(require("../../core/hooks/use-input-key-commands"), exports);
|
|
55
|
-
__exportStar(require("../../core/hooks/
|
|
55
|
+
__exportStar(require("../../core/hooks/catalog/useCatalogEntities"), exports);
|
|
56
|
+
__exportStar(require("../../core/hooks/use-active-page-version"), exports);
|
|
56
57
|
__exportStar(require("../../core/hooks/use-page-versions"), exports);
|
|
58
|
+
__exportStar(require("../../core/hooks/use-user-teams"), exports);
|
|
57
59
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useActivePageVersion(): string | undefined;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.useActivePageVersion = useActivePageVersion;
|
|
4
4
|
const hooks_1 = require("../../core/hooks");
|
|
5
|
-
function
|
|
5
|
+
function useActivePageVersion() {
|
|
6
6
|
const { usePageVersions } = (0, hooks_1.useThemeHooks)();
|
|
7
7
|
const { versions } = usePageVersions();
|
|
8
8
|
const activeVersion = versions.find((version) => version.active);
|
|
9
9
|
return activeVersion === null || activeVersion === void 0 ? void 0 : activeVersion.version;
|
|
10
10
|
}
|
|
11
|
-
//# sourceMappingURL=use-page-
|
|
11
|
+
//# sourceMappingURL=use-active-page-version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useUserTeams(): string[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useUserTeams = useUserTeams;
|
|
4
|
+
const hooks_1 = require("../../core/hooks");
|
|
5
|
+
function useUserTeams() {
|
|
6
|
+
const { useUserTeams } = (0, hooks_1.useThemeHooks)();
|
|
7
|
+
const userTeams = useUserTeams();
|
|
8
|
+
return userTeams;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=use-user-teams.js.map
|
package/lib/core/styles/dark.js
CHANGED
|
@@ -12,6 +12,7 @@ const variables_dark_7 = require("../../components/Tag/variables.dark");
|
|
|
12
12
|
const variables_dark_8 = require("../../components/StatusCode/variables.dark");
|
|
13
13
|
const variables_dark_9 = require("../../components/Switch/variables.dark");
|
|
14
14
|
const variables_dark_10 = require("../../markdoc/components/Cards/variables.dark");
|
|
15
|
+
const variables_dark_11 = require("../../components/Catalog/variables.dark");
|
|
15
16
|
const replayDarkMode = (0, styled_components_1.css) `
|
|
16
17
|
/**
|
|
17
18
|
* @tokens Replay Colors
|
|
@@ -314,6 +315,7 @@ exports.darkMode = (0, styled_components_1.css) `
|
|
|
314
315
|
${replayDarkMode}
|
|
315
316
|
${variables_dark_9.switcherDarkMode}
|
|
316
317
|
${variables_dark_10.cardsDarkMode}
|
|
318
|
+
${variables_dark_11.catalogDarkMode}
|
|
317
319
|
|
|
318
320
|
/**
|
|
319
321
|
* @tokens Dark Theme Scrollbar Config
|
|
@@ -10,35 +10,37 @@ const variables_4 = require("../../components/Sidebar/variables");
|
|
|
10
10
|
const variables_5 = require("../../components/Breadcrumbs/variables");
|
|
11
11
|
const variables_6 = require("../../components/Tag/variables");
|
|
12
12
|
const variables_7 = require("../../components/TableOfContent/variables");
|
|
13
|
-
const variables_8 = require("../../components/
|
|
14
|
-
const variables_9 = require("../../components/
|
|
15
|
-
const variables_10 = require("../../components/
|
|
16
|
-
const variables_11 = require("../../components/
|
|
17
|
-
const variables_12 = require("../../components/
|
|
18
|
-
const variables_13 = require("../../components/
|
|
19
|
-
const variables_14 = require("../../
|
|
20
|
-
const variables_15 = require("../../
|
|
21
|
-
const variables_16 = require("../../components/
|
|
22
|
-
const variables_17 = require("../../components/
|
|
23
|
-
const variables_18 = require("../../components/
|
|
24
|
-
const variables_19 = require("../../components/
|
|
25
|
-
const variables_20 = require("../../components/
|
|
26
|
-
const variables_21 = require("../../components/
|
|
27
|
-
const variables_22 = require("../../components/
|
|
28
|
-
const variables_23 = require("../../components/
|
|
29
|
-
const variables_24 = require("../../
|
|
30
|
-
const variables_25 = require("../../markdoc/components/
|
|
31
|
-
const variables_26 = require("../../components/
|
|
32
|
-
const variables_27 = require("../../components/
|
|
33
|
-
const variables_28 = require("../../components/
|
|
34
|
-
const variables_29 = require("../../components/
|
|
35
|
-
const variables_30 = require("../../components/
|
|
36
|
-
const variables_31 = require("../../components/
|
|
37
|
-
const variables_32 = require("../../components/
|
|
38
|
-
const variables_33 = require("../../components/
|
|
39
|
-
const variables_34 = require("../../components/
|
|
40
|
-
const variables_35 = require("../../
|
|
41
|
-
const variables_36 = require("../../markdoc/components/
|
|
13
|
+
const variables_8 = require("../../components/Catalog/variables");
|
|
14
|
+
const variables_9 = require("../../components/Filter/variables");
|
|
15
|
+
const variables_10 = require("../../components/CatalogClassic/variables");
|
|
16
|
+
const variables_11 = require("../../components/Panel/variables");
|
|
17
|
+
const variables_12 = require("../../components/Select/variables");
|
|
18
|
+
const variables_13 = require("../../components/Dropdown/variables");
|
|
19
|
+
const variables_14 = require("../../components/Tooltip/variables");
|
|
20
|
+
const variables_15 = require("../../icons/CheckboxIcon/variables");
|
|
21
|
+
const variables_16 = require("../../components/Admonition/variables");
|
|
22
|
+
const variables_17 = require("../../components/Footer/variables");
|
|
23
|
+
const variables_18 = require("../../components/Button/variables");
|
|
24
|
+
const variables_19 = require("../../components/Navbar/variables");
|
|
25
|
+
const variables_20 = require("../../components/Search/variables");
|
|
26
|
+
const variables_21 = require("../../components/Menu/variables");
|
|
27
|
+
const variables_22 = require("../../components/CodeBlock/variables");
|
|
28
|
+
const variables_23 = require("../../components/Product/variables");
|
|
29
|
+
const variables_24 = require("../../components/Markdown/variables");
|
|
30
|
+
const variables_25 = require("../../markdoc/components/Tabs/variables");
|
|
31
|
+
const variables_26 = require("../../markdoc/components/Mermaid/variables");
|
|
32
|
+
const variables_27 = require("../../components/LastUpdated/variables");
|
|
33
|
+
const variables_28 = require("../../components/Logo/variables");
|
|
34
|
+
const variables_29 = require("../../components/StatusCode/variables");
|
|
35
|
+
const variables_30 = require("../../components/Segmented/variables");
|
|
36
|
+
const variables_31 = require("../../components/UserMenu/variables");
|
|
37
|
+
const variables_32 = require("../../components/Tags/variables");
|
|
38
|
+
const variables_33 = require("../../components/VersionPicker/variables");
|
|
39
|
+
const variables_34 = require("../../components/DatePicker/variables");
|
|
40
|
+
const variables_35 = require("../../components/Switch/variables");
|
|
41
|
+
const variables_36 = require("../../markdoc/components/Cards/variables");
|
|
42
|
+
const variables_37 = require("../../markdoc/components/CodeWalkthrough/variables");
|
|
43
|
+
const variables_38 = require("../../components/SkipContent/variables");
|
|
42
44
|
const themeColors = (0, styled_components_1.css) `
|
|
43
45
|
/* === Palette === */
|
|
44
46
|
/**
|
|
@@ -367,6 +369,7 @@ const typography = (0, styled_components_1.css) `
|
|
|
367
369
|
--font-size-base: 14px; // Base font size of the entire system.
|
|
368
370
|
--font-size-sm: 12px;
|
|
369
371
|
--font-size-lg: 16px;
|
|
372
|
+
--font-size-md: 18px;
|
|
370
373
|
--font-size-xl: 20px;
|
|
371
374
|
|
|
372
375
|
/**
|
|
@@ -1181,65 +1184,67 @@ const replay = (0, styled_components_1.css) `
|
|
|
1181
1184
|
`;
|
|
1182
1185
|
exports.styles = (0, styled_components_1.css) `
|
|
1183
1186
|
:root {
|
|
1184
|
-
${
|
|
1187
|
+
${variables_16.admonition}
|
|
1185
1188
|
${apiReferenceDocs}
|
|
1186
|
-
${
|
|
1189
|
+
${variables_11.apiReferencePanels}
|
|
1187
1190
|
${badges}
|
|
1188
1191
|
${borders}
|
|
1189
1192
|
${variables_5.breadcrumbs}
|
|
1190
|
-
${
|
|
1191
|
-
${
|
|
1192
|
-
${
|
|
1193
|
-
${
|
|
1194
|
-
${
|
|
1193
|
+
${variables_18.button}
|
|
1194
|
+
${variables_36.cards}
|
|
1195
|
+
${variables_8.catalog}
|
|
1196
|
+
${variables_10.catalogClassic}
|
|
1197
|
+
${variables_22.code}
|
|
1198
|
+
${variables_37.codeWalkthrough}
|
|
1195
1199
|
${docsDropdown}
|
|
1196
|
-
${
|
|
1200
|
+
${variables_13.dropdown}
|
|
1197
1201
|
${error}
|
|
1198
|
-
${
|
|
1199
|
-
${
|
|
1202
|
+
${variables_9.filter}
|
|
1203
|
+
${variables_17.footer}
|
|
1200
1204
|
${headingsTypography}
|
|
1201
|
-
${
|
|
1205
|
+
${variables_32.httpTag}
|
|
1202
1206
|
${inputs}
|
|
1203
1207
|
${variables_1.languagePicker}
|
|
1204
|
-
${
|
|
1208
|
+
${variables_27.lastUpdated}
|
|
1205
1209
|
${links}
|
|
1206
1210
|
${loadProgressBar}
|
|
1207
|
-
${
|
|
1208
|
-
${
|
|
1209
|
-
${
|
|
1210
|
-
${
|
|
1211
|
-
${
|
|
1212
|
-
${
|
|
1211
|
+
${variables_28.logo}
|
|
1212
|
+
${variables_24.markdown}
|
|
1213
|
+
${variables_25.markdownTabs}
|
|
1214
|
+
${variables_26.mermaid}
|
|
1215
|
+
${variables_21.menu}
|
|
1216
|
+
${variables_21.mobileMenu}
|
|
1213
1217
|
${modal}
|
|
1214
|
-
${
|
|
1218
|
+
${variables_19.navbar}
|
|
1215
1219
|
${pages}
|
|
1216
|
-
${
|
|
1217
|
-
${
|
|
1218
|
-
${
|
|
1219
|
-
${
|
|
1220
|
+
${variables_23.productPicker}
|
|
1221
|
+
${variables_11.responsePanelColors}
|
|
1222
|
+
${variables_20.search}
|
|
1223
|
+
${variables_12.select}
|
|
1220
1224
|
${variables_4.sidebar}
|
|
1221
1225
|
${sizeAndSpace}
|
|
1222
1226
|
${variables_6.tag}
|
|
1223
1227
|
${themeColors}
|
|
1224
1228
|
${tile}
|
|
1225
1229
|
${variables_7.toc}
|
|
1226
|
-
${
|
|
1230
|
+
${variables_14.tooltip}
|
|
1227
1231
|
${typography}
|
|
1228
|
-
${
|
|
1229
|
-
${
|
|
1232
|
+
${variables_31.userMenu}
|
|
1233
|
+
${variables_33.versionPicker}
|
|
1230
1234
|
${zIndexDepth}
|
|
1231
1235
|
${scorecardColors}
|
|
1232
|
-
${
|
|
1236
|
+
${variables_29.statusCode}
|
|
1233
1237
|
${tab}
|
|
1234
1238
|
${icon}
|
|
1235
1239
|
${tree}
|
|
1236
|
-
${
|
|
1237
|
-
${
|
|
1238
|
-
${
|
|
1240
|
+
${variables_30.segmented}
|
|
1241
|
+
${variables_35.switcher}
|
|
1242
|
+
${variables_15.checkbox}
|
|
1239
1243
|
${variables_3.feedback}
|
|
1240
1244
|
${variables_2.scorecard}
|
|
1241
|
-
${
|
|
1245
|
+
${variables_34.datePicker}
|
|
1242
1246
|
${replay}
|
|
1247
|
+
${variables_38.skipContent}
|
|
1243
1248
|
|
|
1244
1249
|
background-color: var(--bg-color);
|
|
1245
1250
|
color: var(--text-color-primary);
|