@redocly/theme 0.56.0-rc.2 → 0.56.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/Breadcrumbs/Breadcrumbs.js +1 -1
- package/lib/components/Button/Button.d.ts +1 -1
- package/lib/components/Button/Button.js +3 -1
- package/lib/components/Button/ButtonGroup.d.ts +12 -0
- package/lib/components/Button/ButtonGroup.js +38 -0
- package/lib/components/Button/variables.js +32 -5
- package/lib/components/Catalog/Catalog.d.ts +1 -1
- package/lib/components/Catalog/CatalogCardView/CatalogCard.js +11 -6
- package/lib/components/Catalog/CatalogEntitiesEmptyState.d.ts +5 -1
- package/lib/components/Catalog/CatalogEntitiesEmptyState.js +25 -4
- package/lib/components/Catalog/CatalogEntity/CatalogEntity.d.ts +1 -3
- package/lib/components/Catalog/CatalogEntity/CatalogEntity.js +17 -13
- package/lib/components/Catalog/CatalogEntity/CatalogEntityInfoBar.d.ts +4 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntityInfoBar.js +15 -7
- package/lib/components/Catalog/CatalogEntity/CatalogEntityLinks.js +6 -6
- package/lib/components/Catalog/CatalogEntity/CatalogEntityMetadata.js +18 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath.d.ts +6 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath.js +47 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/ApiDescriptionProperty.js +8 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.js +7 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.d.ts +2 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.js +12 -5
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/ContactProperty.js +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.js +3 -3
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/EntityTypeProperty.js +7 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/FormatProperty.d.ts +6 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/FormatProperty.js +19 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/GitProperty.js +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.js +2 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.d.ts +2 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.js +4 -10
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.d.ts +3 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.js +2 -6
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.d.ts +3 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.js +5 -5
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.js +3 -3
- package/lib/components/Catalog/CatalogEntity/CatalogEntitySchema.d.ts +6 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntitySchema.js +55 -0
- package/lib/components/Catalog/CatalogEntityIcon.d.ts +2 -1
- package/lib/components/Catalog/CatalogEntityIcon.js +22 -29
- package/lib/components/Catalog/CatalogEntityTypeIcon.d.ts +2 -1
- package/lib/components/Catalog/CatalogEntityTypeIcon.js +11 -23
- package/lib/components/Catalog/CatalogEntityTypeTag.d.ts +7 -0
- package/lib/components/Catalog/CatalogEntityTypeTag.js +40 -0
- package/lib/components/Catalog/CatalogPageDescription.js +3 -3
- package/lib/components/Catalog/CatalogSelector.d.ts +1 -1
- package/lib/components/Catalog/CatalogSelector.js +4 -3
- package/lib/components/Catalog/CatalogSortButton.js +6 -6
- package/lib/components/Catalog/CatalogTableView/CatalogDomainsCell.js +1 -0
- package/lib/components/Catalog/CatalogTableView/CatalogEntityCell.js +3 -15
- package/lib/components/Catalog/CatalogTableView/CatalogOwnersCell.js +1 -0
- package/lib/components/Catalog/CatalogTableView/CatalogTableHeaderCell.d.ts +1 -1
- package/lib/components/Catalog/CatalogTableView/CatalogTableHeaderCell.js +1 -5
- package/lib/components/Catalog/CatalogTableView/CatalogTableView.d.ts +3 -3
- package/lib/components/Catalog/CatalogTableView/CatalogTableView.js +5 -32
- package/lib/components/Catalog/CatalogTableView/CatalogTableViewRow.d.ts +0 -2
- package/lib/components/Catalog/CatalogTableView/CatalogTableViewRow.js +12 -37
- package/lib/components/Catalog/CatalogTableView/CatalogTagsCell.js +1 -0
- package/lib/components/Catalog/CatalogTableView/CatalogUserEntityCell.js +8 -4
- package/lib/components/Catalog/CatalogTagsWithTooltip.d.ts +1 -1
- package/lib/components/Catalog/CatalogTagsWithTooltip.js +4 -4
- package/lib/components/Catalog/CatalogViewModeToggle.d.ts +1 -1
- package/lib/components/Catalog/variables.js +42 -8
- package/lib/components/CodeBlock/CodeBlock.d.ts +16 -6
- package/lib/components/CodeBlock/CodeBlock.js +3 -2
- package/lib/components/CodeBlock/CodeBlockControls.d.ts +4 -3
- package/lib/components/CodeBlock/CodeBlockControls.js +35 -8
- package/lib/components/CodeBlock/CodeBlockDropdown.d.ts +3 -0
- package/lib/components/CodeBlock/CodeBlockDropdown.js +35 -0
- package/lib/components/CodeBlock/CodeBlockTabs.d.ts +2 -2
- package/lib/components/CodeBlock/CodeBlockTabs.js +18 -9
- package/lib/components/CodeBlock/variables.js +1 -1
- package/lib/components/Dropdown/Dropdown.js +1 -0
- package/lib/components/Dropdown/DropdownMenu.js +4 -0
- package/lib/components/Dropdown/variables.js +1 -0
- package/lib/components/Feedback/Feedback.js +1 -1
- package/lib/components/Filter/FilterCheckboxes.js +5 -2
- package/lib/components/Footer/FooterItem.js +4 -7
- package/lib/components/Footer/variables.js +2 -2
- package/lib/components/Image/Image.js +2 -0
- package/lib/components/Markdown/Markdown.js +9 -9
- package/lib/components/Markdown/styles/headingAnchor.js +0 -1
- package/lib/components/Menu/MenuItem.js +5 -5
- package/lib/components/Menu/variables.js +3 -1
- package/lib/components/Navbar/NavbarItem.js +8 -39
- package/lib/components/Navbar/variables.js +2 -2
- package/lib/components/PageActions/PageActions.d.ts +6 -0
- package/lib/components/PageActions/PageActions.js +104 -0
- package/lib/components/PageActions/PageActionsMenuItem.d.ts +7 -0
- package/lib/components/PageActions/PageActionsMenuItem.js +58 -0
- package/lib/components/PageActions/variables.d.ts +1 -0
- package/lib/components/PageActions/variables.dark.d.ts +1 -0
- package/lib/components/PageActions/variables.dark.js +9 -0
- package/lib/components/PageActions/variables.js +37 -0
- package/lib/components/Search/SearchDialog.js +2 -2
- package/lib/components/Select/variables.js +2 -2
- package/lib/components/TableOfContent/TableOfContent.js +15 -12
- package/lib/components/Tag/Tag.d.ts +2 -1
- package/lib/components/Tag/Tag.js +3 -3
- package/lib/components/Tag/variables.js +14 -0
- package/lib/core/constants/catalog.d.ts +1 -1
- package/lib/core/constants/common.d.ts +4 -0
- package/lib/core/constants/common.js +5 -1
- package/lib/core/contexts/CodeSnippetContext.d.ts +7 -0
- package/lib/core/contexts/CodeSnippetContext.js +23 -0
- package/lib/core/contexts/index.d.ts +1 -0
- package/lib/core/contexts/index.js +1 -0
- 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/code-walkthrough/use-renderable-files.d.ts +1 -2
- package/lib/core/hooks/code-walkthrough/use-renderable-files.js +2 -2
- package/lib/core/hooks/index.d.ts +1 -0
- package/lib/core/hooks/index.js +1 -0
- package/lib/core/hooks/use-active-heading.d.ts +7 -2
- package/lib/core/hooks/use-active-heading.js +160 -23
- package/lib/core/hooks/use-active-section-id.d.ts +1 -1
- package/lib/core/hooks/use-active-section-id.js +2 -2
- package/lib/core/hooks/use-codeblock-tabs-controls.d.ts +2 -2
- package/lib/core/hooks/use-codeblock-tabs-controls.js +6 -6
- package/lib/core/hooks/use-local-state.d.ts +1 -0
- package/lib/core/hooks/use-local-state.js +32 -0
- package/lib/core/hooks/use-page-actions.d.ts +2 -0
- package/lib/core/hooks/use-page-actions.js +101 -0
- package/lib/core/hooks/use-theme-hooks.js +2 -0
- package/lib/core/styles/dark.js +2 -0
- package/lib/core/styles/global.js +2 -0
- package/lib/core/types/catalog.d.ts +5 -1
- package/lib/core/types/hooks.d.ts +2 -1
- package/lib/core/types/index.d.ts +1 -0
- package/lib/core/types/index.js +1 -0
- package/lib/core/types/l10n.d.ts +1 -1
- package/lib/core/types/page-actions.d.ts +15 -0
- package/lib/core/types/page-actions.js +3 -0
- package/lib/core/types/sidebar.d.ts +1 -0
- package/lib/core/types/telemetry.d.ts +5 -20
- package/lib/core/utils/download-code-walkthrough.js +27 -7
- package/lib/core/utils/enhanced-smoothstep.d.ts +5 -0
- package/lib/core/utils/enhanced-smoothstep.js +15 -0
- package/lib/core/utils/get-file-icon.d.ts +3 -2
- package/lib/core/utils/get-file-icon.js +109 -29
- package/lib/core/utils/icon-resolver.d.ts +28 -0
- package/lib/core/utils/icon-resolver.js +52 -0
- package/lib/core/utils/index.d.ts +4 -1
- package/lib/core/utils/index.js +4 -1
- package/lib/core/utils/lang-to-name.d.ts +1 -0
- package/lib/core/utils/lang-to-name.js +37 -0
- package/lib/core/utils/{text-transform.js → string.js} +1 -1
- package/lib/ext/configure.d.ts +1 -1
- package/lib/icons/CDNIcon/CDNIcon.d.ts +14 -0
- package/lib/icons/CDNIcon/CDNIcon.js +48 -0
- package/lib/icons/ChatGptIcon/ChatGptIcon.d.ts +9 -0
- package/lib/icons/ChatGptIcon/ChatGptIcon.js +22 -0
- package/lib/icons/CheckmarkOutlineIcon/CheckmarkOutlineIcon.d.ts +9 -0
- package/lib/icons/CheckmarkOutlineIcon/CheckmarkOutlineIcon.js +23 -0
- package/lib/icons/ClaudeIcon/ClaudeIcon.d.ts +9 -0
- package/lib/icons/ClaudeIcon/ClaudeIcon.js +22 -0
- package/lib/icons/GenericIcon/GenericIcon.d.ts +11 -0
- package/lib/icons/GenericIcon/GenericIcon.js +61 -0
- package/lib/icons/GraphqlIcon/GraphqlIcon.d.ts +9 -0
- package/lib/icons/GraphqlIcon/GraphqlIcon.js +36 -0
- package/lib/icons/GraphqlIcon/index.d.ts +1 -0
- package/lib/icons/GraphqlIcon/index.js +6 -0
- package/lib/icons/HexagonIcon/HexagonIcon.d.ts +9 -0
- package/lib/icons/HexagonIcon/HexagonIcon.js +22 -0
- package/lib/icons/MarkdownFullIcon/MarkdownFullIcon.d.ts +9 -0
- package/lib/icons/MarkdownFullIcon/MarkdownFullIcon.js +23 -0
- package/lib/icons/MoleculesIcon/MoleculesIcon.d.ts +9 -0
- package/lib/icons/MoleculesIcon/MoleculesIcon.js +22 -0
- package/lib/icons/NetworkIcon/NetworkIcon.d.ts +9 -0
- package/lib/icons/NetworkIcon/NetworkIcon.js +23 -0
- package/lib/icons/NoneIcon/NoneIcon.d.ts +9 -0
- package/lib/icons/NoneIcon/NoneIcon.js +17 -0
- package/lib/icons/NotesIcon/NotesIcon.d.ts +9 -0
- package/lib/icons/NotesIcon/NotesIcon.js +26 -0
- package/lib/icons/types.d.ts +6 -0
- package/lib/index.d.ts +7 -1
- package/lib/index.js +7 -1
- package/lib/layouts/CodeWalkthroughLayout.js +2 -2
- package/lib/layouts/DocumentationLayout.js +14 -10
- package/lib/markdoc/components/Cards/CardIcon.js +7 -19
- package/lib/markdoc/components/CodeGroup/CodeGroup.d.ts +4 -0
- package/lib/markdoc/components/CodeGroup/CodeGroup.js +72 -0
- package/lib/markdoc/components/CodeWalkthrough/CodePanelHeader.js +7 -4
- package/lib/markdoc/components/Heading/Heading.d.ts +2 -1
- package/lib/markdoc/components/Heading/Heading.js +21 -3
- package/lib/markdoc/components/Icon/Icon.d.ts +3 -0
- package/lib/markdoc/components/Icon/Icon.js +29 -0
- package/lib/markdoc/components/Tabs/Tab.d.ts +2 -1
- package/lib/markdoc/components/Tabs/Tab.js +5 -2
- package/lib/markdoc/components/Tabs/Tabs.d.ts +1 -1
- package/lib/markdoc/components/Tabs/variables.js +2 -0
- package/lib/markdoc/components/default.d.ts +2 -0
- package/lib/markdoc/components/default.js +2 -0
- package/lib/markdoc/default.js +4 -0
- package/lib/markdoc/tags/card.js +1 -1
- package/lib/markdoc/tags/code-group.d.ts +2 -0
- package/lib/markdoc/tags/code-group.js +23 -0
- package/lib/markdoc/tags/code-snippet.js +1 -1
- package/lib/markdoc/tags/icon.d.ts +2 -0
- package/lib/markdoc/tags/icon.js +16 -0
- package/lib/markdoc/tags/tab.js +1 -0
- package/package.json +4 -4
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +1 -1
- package/src/components/Button/Button.tsx +4 -2
- package/src/components/Button/ButtonGroup.tsx +53 -0
- package/src/components/Button/variables.ts +32 -5
- package/src/components/Catalog/Catalog.tsx +1 -1
- package/src/components/Catalog/CatalogCardView/CatalogCard.tsx +12 -6
- package/src/components/Catalog/CatalogEntitiesEmptyState.tsx +38 -4
- package/src/components/Catalog/CatalogEntity/CatalogEntity.tsx +25 -17
- package/src/components/Catalog/CatalogEntity/CatalogEntityInfoBar.tsx +25 -9
- package/src/components/Catalog/CatalogEntity/CatalogEntityLinks.tsx +12 -15
- package/src/components/Catalog/CatalogEntity/CatalogEntityMetadata.tsx +39 -2
- package/src/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath.tsx +61 -0
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/ApiDescriptionProperty.tsx +12 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.tsx +7 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.tsx +15 -4
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/ContactProperty.tsx +5 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.tsx +2 -3
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/EntityTypeProperty.tsx +11 -3
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/FormatProperty.tsx +37 -0
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/GitProperty.tsx +1 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.tsx +2 -0
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.tsx +7 -23
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.tsx +5 -6
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.tsx +21 -13
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.tsx +9 -2
- package/src/components/Catalog/CatalogEntity/CatalogEntitySchema.tsx +52 -0
- package/src/components/Catalog/CatalogEntityIcon.tsx +33 -33
- package/src/components/Catalog/CatalogEntityTypeIcon.tsx +23 -28
- package/src/components/Catalog/CatalogEntityTypeTag.tsx +49 -0
- package/src/components/Catalog/CatalogPageDescription.tsx +5 -4
- package/src/components/Catalog/CatalogSelector.tsx +3 -1
- package/src/components/Catalog/CatalogSortButton.tsx +19 -20
- package/src/components/Catalog/CatalogTableView/CatalogDomainsCell.tsx +1 -0
- package/src/components/Catalog/CatalogTableView/CatalogEntityCell.tsx +3 -17
- package/src/components/Catalog/CatalogTableView/CatalogOwnersCell.tsx +1 -0
- package/src/components/Catalog/CatalogTableView/CatalogTableHeaderCell.tsx +5 -8
- package/src/components/Catalog/CatalogTableView/CatalogTableView.tsx +6 -36
- package/src/components/Catalog/CatalogTableView/CatalogTableViewRow.tsx +18 -46
- package/src/components/Catalog/CatalogTableView/CatalogTagsCell.tsx +1 -0
- package/src/components/Catalog/CatalogTableView/CatalogUserEntityCell.tsx +9 -4
- package/src/components/Catalog/CatalogTagsWithTooltip.tsx +9 -5
- package/src/components/Catalog/CatalogViewModeToggle.tsx +1 -1
- package/src/components/Catalog/variables.ts +42 -8
- package/src/components/CodeBlock/CodeBlock.tsx +15 -5
- package/src/components/CodeBlock/CodeBlockControls.tsx +67 -26
- package/src/components/CodeBlock/CodeBlockDropdown.tsx +53 -0
- package/src/components/CodeBlock/CodeBlockTabs.tsx +29 -20
- package/src/components/CodeBlock/variables.ts +1 -1
- package/src/components/Dropdown/Dropdown.tsx +1 -0
- package/src/components/Dropdown/DropdownMenu.tsx +4 -0
- package/src/components/Dropdown/variables.ts +1 -0
- package/src/components/Feedback/Feedback.tsx +1 -1
- package/src/components/Filter/FilterCheckboxes.tsx +9 -2
- package/src/components/Footer/FooterItem.tsx +5 -12
- package/src/components/Footer/variables.ts +2 -2
- package/src/components/Image/Image.tsx +2 -0
- package/src/components/Markdown/Markdown.tsx +3 -3
- package/src/components/Markdown/styles/headingAnchor.ts +0 -1
- package/src/components/Menu/MenuItem.tsx +5 -5
- package/src/components/Menu/variables.ts +3 -1
- package/src/components/Navbar/NavbarItem.tsx +8 -17
- package/src/components/Navbar/variables.ts +2 -2
- package/src/components/PageActions/PageActions.tsx +110 -0
- package/src/components/PageActions/PageActionsMenuItem.tsx +73 -0
- package/src/components/PageActions/variables.dark.ts +6 -0
- package/src/components/PageActions/variables.ts +34 -0
- package/src/components/Search/SearchDialog.tsx +2 -2
- package/src/components/Select/variables.ts +2 -2
- package/src/components/TableOfContent/TableOfContent.tsx +33 -36
- package/src/components/Tag/Tag.tsx +11 -2
- package/src/components/Tag/variables.ts +14 -0
- package/src/core/constants/catalog.ts +1 -1
- package/src/core/constants/common.ts +4 -0
- package/src/core/contexts/CodeSnippetContext.tsx +31 -0
- package/src/core/contexts/index.ts +1 -0
- package/src/core/hooks/__mocks__/use-theme-hooks.ts +1 -0
- package/src/core/hooks/code-walkthrough/use-renderable-files.ts +3 -4
- package/src/core/hooks/index.ts +1 -0
- package/src/core/hooks/use-active-heading.ts +199 -28
- package/src/core/hooks/use-active-section-id.ts +2 -1
- package/src/core/hooks/use-codeblock-tabs-controls.ts +8 -8
- package/src/core/hooks/use-local-state.ts +30 -0
- package/src/core/hooks/use-page-actions.ts +115 -0
- package/src/core/hooks/use-theme-hooks.ts +2 -0
- package/src/core/styles/dark.ts +2 -1
- package/src/core/styles/global.ts +2 -0
- package/src/core/types/catalog.ts +5 -1
- package/src/core/types/hooks.ts +2 -0
- package/src/core/types/index.ts +1 -0
- package/src/core/types/l10n.ts +21 -0
- package/src/core/types/page-actions.ts +18 -0
- package/src/core/types/sidebar.ts +1 -0
- package/src/core/types/telemetry.ts +5 -13
- package/src/core/utils/download-code-walkthrough.ts +5 -4
- package/src/core/utils/enhanced-smoothstep.ts +14 -0
- package/src/core/utils/get-file-icon.tsx +94 -0
- package/src/core/utils/icon-resolver.ts +57 -0
- package/src/core/utils/index.ts +4 -1
- package/src/core/utils/lang-to-name.ts +35 -0
- package/src/ext/configure.ts +1 -1
- package/src/icons/CDNIcon/CDNIcon.tsx +47 -0
- package/src/icons/ChatGptIcon/ChatGptIcon.tsx +23 -0
- package/src/icons/CheckmarkOutlineIcon/CheckmarkOutlineIcon.tsx +24 -0
- package/src/icons/ClaudeIcon/ClaudeIcon.tsx +23 -0
- package/src/icons/GenericIcon/GenericIcon.tsx +69 -0
- package/src/icons/GraphqlIcon/GraphqlIcon.tsx +81 -0
- package/src/icons/GraphqlIcon/index.ts +1 -0
- package/src/icons/HexagonIcon/HexagonIcon.tsx +23 -0
- package/src/icons/MarkdownFullIcon/MarkdownFullIcon.tsx +24 -0
- package/src/icons/MoleculesIcon/MoleculesIcon.tsx +23 -0
- package/src/icons/NetworkIcon/NetworkIcon.tsx +31 -0
- package/src/icons/NoneIcon/NoneIcon.tsx +17 -0
- package/src/icons/NotesIcon/NotesIcon.tsx +43 -0
- package/src/icons/types.ts +7 -0
- package/src/index.ts +7 -1
- package/src/layouts/CodeWalkthroughLayout.tsx +1 -1
- package/src/layouts/DocumentationLayout.tsx +23 -13
- package/src/markdoc/components/Cards/CardIcon.tsx +6 -21
- package/src/markdoc/components/CodeGroup/CodeGroup.tsx +78 -0
- package/src/markdoc/components/CodeWalkthrough/CodePanelHeader.tsx +7 -4
- package/src/markdoc/components/Heading/Heading.tsx +22 -3
- package/src/markdoc/components/Icon/Icon.tsx +16 -0
- package/src/markdoc/components/Tabs/Tab.tsx +6 -1
- package/src/markdoc/components/Tabs/Tabs.tsx +1 -1
- package/src/markdoc/components/Tabs/variables.ts +2 -0
- package/src/markdoc/components/default.ts +2 -0
- package/src/markdoc/default.ts +4 -0
- package/src/markdoc/tags/card.ts +1 -1
- package/src/markdoc/tags/code-group.ts +21 -0
- package/src/markdoc/tags/code-snippet.ts +1 -1
- package/src/markdoc/tags/icon.ts +14 -0
- package/src/markdoc/tags/tab.ts +1 -0
- package/lib/components/OpenApiDocs/hooks/AfterOpenApiDescription.d.ts +0 -1
- package/lib/components/OpenApiDocs/hooks/AfterOpenApiDescription.js +0 -5
- 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/core/utils/get-file-icon.ts +0 -42
- package/src/ext/process-scorecard.ts +0 -13
- /package/lib/core/utils/{text-transform.d.ts → string.d.ts} +0 -0
- /package/src/core/utils/{text-transform.ts → string.ts} +0 -0
|
@@ -13,13 +13,13 @@ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElemen
|
|
|
13
13
|
size?: ButtonSize;
|
|
14
14
|
extraClass?: string;
|
|
15
15
|
to?: string;
|
|
16
|
+
external?: boolean;
|
|
16
17
|
icon?: JSX.Element;
|
|
17
18
|
iconPosition?: 'left' | 'right';
|
|
18
19
|
title?: string;
|
|
19
20
|
tabIndex?: number;
|
|
20
21
|
onClick?: (e?: any) => void;
|
|
21
22
|
ref?: React.Ref<HTMLButtonElement>;
|
|
22
|
-
type?: 'button' | 'submit' | 'reset';
|
|
23
23
|
}
|
|
24
24
|
export declare function generateClassName({ variant, tone, size, extraClass, }: ButtonProps): string;
|
|
25
25
|
export declare const Button: import("styled-components").StyledComponent<React.FC<ButtonProps>, any, ButtonProps, never>;
|
|
@@ -55,6 +55,7 @@ const StyledButtonLink = (0, styled_components_1.default)(Link_1.Link) `
|
|
|
55
55
|
`;
|
|
56
56
|
function generateClassName({ variant = 'secondary', tone = 'default', size = 'medium', extraClass = '', }) {
|
|
57
57
|
const classNames = [
|
|
58
|
+
'button',
|
|
58
59
|
extraClass,
|
|
59
60
|
`button-tone-${tone}`,
|
|
60
61
|
`button-variant-${variant}`,
|
|
@@ -82,6 +83,7 @@ const StyledButton = styled_components_1.default.button.attrs((props) => ({
|
|
|
82
83
|
background-color: var(--button-bg-color);
|
|
83
84
|
border: var(--button-border-width) var(--button-border-style) var(--button-border-color);
|
|
84
85
|
box-shadow: var(--button-box-shadow);
|
|
86
|
+
backdrop-filter: var(--button-backdrop-filter, none);
|
|
85
87
|
|
|
86
88
|
font-weight: var(--button-font-weight);
|
|
87
89
|
font-size: var(--button-font-size);
|
|
@@ -160,7 +162,7 @@ const ButtonComponent = (props) => {
|
|
|
160
162
|
props.children,
|
|
161
163
|
props.icon && props.iconPosition === 'right' && props.icon));
|
|
162
164
|
if (props.to) {
|
|
163
|
-
return (react_1.default.createElement(StyledButtonLink, { to: props.to, onClick: props.onClick }, button));
|
|
165
|
+
return (react_1.default.createElement(StyledButtonLink, { to: props.to, external: props.external, onClick: props.onClick }, button));
|
|
164
166
|
}
|
|
165
167
|
else {
|
|
166
168
|
return button;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { JSX } from 'react';
|
|
3
|
+
import type { ButtonSize } from '../../components/Button/Button';
|
|
4
|
+
type ButtonGroupVariant = 'outlined';
|
|
5
|
+
type ButtonGroupProps = {
|
|
6
|
+
variant?: ButtonGroupVariant;
|
|
7
|
+
size?: ButtonSize;
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
className?: string;
|
|
10
|
+
};
|
|
11
|
+
export declare function ButtonGroup(props: ButtonGroupProps): JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ButtonGroup = ButtonGroup;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
+
function ButtonGroup(props) {
|
|
10
|
+
const { variant = 'outlined', className = '', children, size = 'medium' } = props;
|
|
11
|
+
return (react_1.default.createElement(ButtonGroupWrapper, { "data-component-name": "Button/ButtonGroup", className: `button-group-${variant} button-group-size-${size} ${className}` }, children));
|
|
12
|
+
}
|
|
13
|
+
const ButtonGroupWrapper = styled_components_1.default.div `
|
|
14
|
+
display: flex;
|
|
15
|
+
line-height: var(--button-line-height);
|
|
16
|
+
|
|
17
|
+
.button {
|
|
18
|
+
border-radius: 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
& > .button:first-child,
|
|
22
|
+
*:first-child > .button {
|
|
23
|
+
border-top-left-radius: var(--button-border-radius);
|
|
24
|
+
border-bottom-left-radius: var(--button-border-radius);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
& > .button:last-child,
|
|
28
|
+
*:last-child > .button {
|
|
29
|
+
border-top-right-radius: var(--button-border-radius);
|
|
30
|
+
border-bottom-right-radius: var(--button-border-radius);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
& > .button:not(:first-child),
|
|
34
|
+
*:not(:first-child) > .button {
|
|
35
|
+
border-left: none;
|
|
36
|
+
}
|
|
37
|
+
`;
|
|
38
|
+
//# sourceMappingURL=ButtonGroup.js.map
|
|
@@ -93,9 +93,12 @@ exports.button = (0, styled_components_1.css) `
|
|
|
93
93
|
* @tokens Button size
|
|
94
94
|
*/
|
|
95
95
|
|
|
96
|
-
.button-size-small
|
|
96
|
+
.button-size-small,
|
|
97
|
+
.button-group-size-small .button {
|
|
98
|
+
--button-font-size: var(--font-size-base);
|
|
97
99
|
--button-border-radius: var(--border-radius);
|
|
98
100
|
--button-padding: 1px var(--spacing-sm);
|
|
101
|
+
--button-line-height: var(--line-height-base);
|
|
99
102
|
|
|
100
103
|
--button-icon-size: 14px;
|
|
101
104
|
--button-icon-padding: 5px; /* Padding for small buttons with only icon */
|
|
@@ -103,11 +106,25 @@ exports.button = (0, styled_components_1.css) `
|
|
|
103
106
|
--button-icon-right-padding: 1px 10px 1px var(--spacing-sm); /* Padding for small buttons with icon on the right */
|
|
104
107
|
}
|
|
105
108
|
|
|
106
|
-
.button-size-
|
|
109
|
+
.button-size-medium,
|
|
110
|
+
.button-group-size-medium .button {
|
|
111
|
+
--button-font-size: var(--font-size-base);
|
|
112
|
+
--button-border-radius: var(--border-radius-md);
|
|
113
|
+
--button-padding: 5px var(--spacing-sm);
|
|
114
|
+
--button-line-height: var(--line-height-base);
|
|
115
|
+
|
|
116
|
+
--button-icon-size: 16px;
|
|
117
|
+
--button-icon-padding: var(--spacing-xs); /* Padding for buttons with only icon */
|
|
118
|
+
--button-icon-left-padding: 5px var(--spacing-base) 5px 14px; /* Padding for buttons with icon on the left */
|
|
119
|
+
--button-icon-right-padding: 5px 14px 5px var(--spacing-base); /* Padding for buttons with icon on the right */
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.button-size-large,
|
|
123
|
+
.button-group-size-large .button {
|
|
107
124
|
--button-font-size: var(--font-size-lg); // @presenter FontSize
|
|
108
|
-
--button-
|
|
109
|
-
--border-radius: var(--border-radius-lg);
|
|
125
|
+
--button-border-radius: var(--border-radius-md);
|
|
110
126
|
--button-padding: var(--spacing-xs) var(--spacing-md);
|
|
127
|
+
--button-line-height: var(--line-height-lg); // @presenter LineHeight
|
|
111
128
|
|
|
112
129
|
--button-icon-size: 18px;
|
|
113
130
|
--button-icon-padding: 11px; /* Padding for large buttons with only icon */
|
|
@@ -155,7 +172,8 @@ exports.button = (0, styled_components_1.css) `
|
|
|
155
172
|
--button-border-color-danger-pressed: transparent;
|
|
156
173
|
}
|
|
157
174
|
|
|
158
|
-
.button-variant-outlined
|
|
175
|
+
.button-variant-outlined,
|
|
176
|
+
.button-group-outlined .button {
|
|
159
177
|
--button-color: var(--button-content-color-custom); // @presenter Color
|
|
160
178
|
--button-color-hover: var(--button-content-color-custom-hover); // @presenter Color
|
|
161
179
|
--button-color-active: var(--button-content-color-custom-hover); // @presenter Color
|
|
@@ -165,6 +183,15 @@ exports.button = (0, styled_components_1.css) `
|
|
|
165
183
|
--button-bg-color-disabled: transparent; // @presenter Color
|
|
166
184
|
--button-border-width: 1px;
|
|
167
185
|
--button-border-width-disabled: 1px;
|
|
186
|
+
--button-bg-color: transparent; // @presenter Color
|
|
187
|
+
--button-border-color-disabled: var(--color-warm-grey-2); // @presenter Color
|
|
188
|
+
--button-border-color-danger: var(--color-raspberry-6); // @presenter Color
|
|
189
|
+
--button-border-color-danger-hover: var(--color-raspberry-7); // @presenter Color
|
|
190
|
+
--button-border-color-danger-pressed: var(--color-raspberry-8); // @presenter Color
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.button-group-outlined .button {
|
|
194
|
+
--button-bg-color-hover: var(--color-hover-base); // @presenter Color
|
|
168
195
|
}
|
|
169
196
|
|
|
170
197
|
.button-variant-text {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { JSX } from 'react';
|
|
2
2
|
import { CatalogEntityConfig } from '@redocly/config';
|
|
3
3
|
import { BffCatalogEntityList } from '../../core/types';
|
|
4
|
-
import { CatalogSwitcherItem } from '../../core';
|
|
4
|
+
import { CatalogSwitcherItem } from '../../core/types/catalog';
|
|
5
5
|
export type CatalogProps = {
|
|
6
6
|
catalogConfig: CatalogEntityConfig;
|
|
7
7
|
entitiesTypes: string[];
|
|
@@ -13,20 +13,22 @@ const ArrowRightIcon_1 = require("../../../icons/ArrowRightIcon/ArrowRightIcon")
|
|
|
13
13
|
const ArrowUpRightIcon_1 = require("../../../icons/ArrowUpRightIcon/ArrowUpRightIcon");
|
|
14
14
|
const CatalogTagsWithTooltip_1 = require("../../../components/Catalog/CatalogTagsWithTooltip");
|
|
15
15
|
const CatalogEntityIcon_1 = require("../../../components/Catalog/CatalogEntityIcon");
|
|
16
|
-
const
|
|
16
|
+
const utils_1 = require("../../../core/utils");
|
|
17
|
+
const Tooltip_1 = require("../../../components/Tooltip/Tooltip");
|
|
17
18
|
function CatalogCard({ entity, catalogConfig }) {
|
|
18
19
|
var _a, _b, _c;
|
|
19
20
|
const { useTelemetry } = (0, hooks_1.useThemeHooks)();
|
|
20
21
|
const telemetry = useTelemetry();
|
|
21
|
-
const pathPrefix = (0,
|
|
22
|
+
const pathPrefix = (0, utils_1.getPathPrefix)();
|
|
22
23
|
return (react_1.default.createElement(CatalogCardWrapper, { "data-component-name": "Catalog/CatalogCardView/CatalogCard", onClick: () => {
|
|
23
24
|
window.location.assign(`${pathPrefix}/catalogs/${catalogConfig.slug}/entities/${entity.key}`);
|
|
24
25
|
telemetry.send({ type: 'catalog_item.clicked' });
|
|
25
26
|
} },
|
|
26
27
|
react_1.default.createElement(CardContent, null,
|
|
27
28
|
react_1.default.createElement(CardHeader, null,
|
|
28
|
-
react_1.default.createElement(
|
|
29
|
-
react_1.default.createElement(
|
|
29
|
+
react_1.default.createElement(Tooltip_1.TooltipComponent, { tip: entity.type, placement: "bottom", className: "catalog" },
|
|
30
|
+
react_1.default.createElement(HeaderIconWrapper, null,
|
|
31
|
+
react_1.default.createElement(CatalogEntityIcon_1.CatalogEntityIcon, { entityType: entity.type, defaultColor: true }))),
|
|
30
32
|
react_1.default.createElement(CardTitle, null,
|
|
31
33
|
react_1.default.createElement(CatalogHighlight_1.CatalogHighlight, null, entity.title))),
|
|
32
34
|
react_1.default.createElement(CardDescription, null,
|
|
@@ -40,6 +42,7 @@ function CatalogCard({ entity, catalogConfig }) {
|
|
|
40
42
|
backgroundColor: 'var(--catalog-card-icon-bg-color)',
|
|
41
43
|
},
|
|
42
44
|
icon: react_1.default.createElement(GraphIcon_1.GraphIcon, { color: "var(--color-green-8)" }),
|
|
45
|
+
textTransform: 'none',
|
|
43
46
|
} })),
|
|
44
47
|
react_1.default.createElement(MetadataColumn, null,
|
|
45
48
|
react_1.default.createElement(MetadataLabel, null, "Owners:"),
|
|
@@ -49,6 +52,7 @@ function CatalogCard({ entity, catalogConfig }) {
|
|
|
49
52
|
backgroundColor: 'var(--catalog-card-icon-bg-color)',
|
|
50
53
|
borderRadius: 'var(--border-radius-xl)',
|
|
51
54
|
},
|
|
55
|
+
textTransform: 'none',
|
|
52
56
|
} })))),
|
|
53
57
|
react_1.default.createElement(Divider, null),
|
|
54
58
|
react_1.default.createElement(CardFooter, null,
|
|
@@ -59,6 +63,7 @@ function CatalogCard({ entity, catalogConfig }) {
|
|
|
59
63
|
},
|
|
60
64
|
borderless: true,
|
|
61
65
|
color: 'grey',
|
|
66
|
+
textTransform: 'none',
|
|
62
67
|
}, itemsToShow: 3 }),
|
|
63
68
|
react_1.default.createElement(ArrowCircle, null,
|
|
64
69
|
react_1.default.createElement(ArrowRightIcon_1.ArrowRightIcon, { size: "16px" }),
|
|
@@ -118,6 +123,7 @@ const CardContent = styled_components_1.default.div `
|
|
|
118
123
|
padding: var(--catalog-card-padding-vertical) var(--catalog-card-padding-horizontal);
|
|
119
124
|
`;
|
|
120
125
|
const CardFooter = styled_components_1.default.div `
|
|
126
|
+
height: var(--catalog-card-footer-height);
|
|
121
127
|
display: flex;
|
|
122
128
|
align-items: center;
|
|
123
129
|
justify-content: space-between;
|
|
@@ -129,8 +135,7 @@ const Divider = styled_components_1.default.div `
|
|
|
129
135
|
background-color: var(--catalog-card-divider-color);
|
|
130
136
|
`;
|
|
131
137
|
const CatalogCardWrapper = styled_components_1.default.div `
|
|
132
|
-
|
|
133
|
-
height: 100%;
|
|
138
|
+
height: var(--catalog-card-height);
|
|
134
139
|
color: var(--catalog-card-text-color);
|
|
135
140
|
font-size: var(--catalog-card-font-size);
|
|
136
141
|
font-weight: var(--catalog-card-font-weight);
|
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
import { JSX } from 'react';
|
|
2
|
-
|
|
2
|
+
interface CatalogEntitiesEmptyStateProps {
|
|
3
|
+
listType?: 'default' | 'team';
|
|
4
|
+
}
|
|
5
|
+
export declare function CatalogEntitiesEmptyState({ listType, }: CatalogEntitiesEmptyStateProps): JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -6,11 +6,22 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.CatalogEntitiesEmptyState = CatalogEntitiesEmptyState;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
-
|
|
9
|
+
const HexagonIcon_1 = require("../../icons/HexagonIcon/HexagonIcon");
|
|
10
|
+
function CatalogEntitiesEmptyState({ listType = 'default', }) {
|
|
11
|
+
if (listType === 'team') {
|
|
12
|
+
return (react_1.default.createElement(EmptyStateWrapper, { "data-component-name": "Catalog/CatalogEntitiesEmptyState" },
|
|
13
|
+
react_1.default.createElement(EmptyStateIconWrapper, null,
|
|
14
|
+
react_1.default.createElement(HexagonIcon_1.HexagonIcon, { size: "21px", color: "var(--color-warm-grey-7)" })),
|
|
15
|
+
react_1.default.createElement(EmptyStateHeader, null, "No team members yet"),
|
|
16
|
+
react_1.default.createElement(EmptyStateText, null, "Your team members will appear here"),
|
|
17
|
+
react_1.default.createElement(EmptyStateText, null, "once they've been added to the team.")));
|
|
18
|
+
}
|
|
10
19
|
return (react_1.default.createElement(EmptyStateWrapper, { "data-component-name": "Catalog/CatalogEntitiesEmptyState" },
|
|
11
|
-
react_1.default.createElement(
|
|
12
|
-
|
|
13
|
-
react_1.default.createElement(
|
|
20
|
+
react_1.default.createElement(EmptyStateIconWrapper, null,
|
|
21
|
+
react_1.default.createElement(HexagonIcon_1.HexagonIcon, { size: "21px", color: "var(--color-warm-grey-7)" })),
|
|
22
|
+
react_1.default.createElement(EmptyStateHeader, null, "No entities found"),
|
|
23
|
+
react_1.default.createElement(EmptyStateText, null, "Try adjusting your search criteria or"),
|
|
24
|
+
react_1.default.createElement(EmptyStateText, null, "check back later for new additions.")));
|
|
14
25
|
}
|
|
15
26
|
const EmptyStateWrapper = styled_components_1.default.div `
|
|
16
27
|
display: flex;
|
|
@@ -21,6 +32,16 @@ const EmptyStateWrapper = styled_components_1.default.div `
|
|
|
21
32
|
text-align: center;
|
|
22
33
|
min-height: var(--catalog-empty-state-min-height);
|
|
23
34
|
`;
|
|
35
|
+
const EmptyStateIconWrapper = styled_components_1.default.div `
|
|
36
|
+
display: flex;
|
|
37
|
+
align-items: center;
|
|
38
|
+
justify-content: center;
|
|
39
|
+
background-color: var(--color-warm-grey-2);
|
|
40
|
+
width: 40px;
|
|
41
|
+
height: 40px;
|
|
42
|
+
border-radius: 50%;
|
|
43
|
+
margin-bottom: var(--spacing-xxs);
|
|
44
|
+
`;
|
|
24
45
|
const EmptyStateHeader = styled_components_1.default.p `
|
|
25
46
|
color: var(--catalog-empty-state-header-text-color);
|
|
26
47
|
font-size: var(--catalog-empty-state-header-font-size);
|
|
@@ -6,7 +6,5 @@ export type CatalogEntityProps = {
|
|
|
6
6
|
entitiesCatalogConfig: EntitiesCatalogConfig;
|
|
7
7
|
catalogConfig: CatalogEntityConfig;
|
|
8
8
|
initialRelations: BffCatalogRelatedEntityList;
|
|
9
|
-
mainCatalogLabelTranslationKey?: string;
|
|
10
|
-
mainCatalogSlug?: string;
|
|
11
9
|
};
|
|
12
|
-
export declare function CatalogEntity({ entity, entitiesCatalogConfig, catalogConfig, initialRelations,
|
|
10
|
+
export declare function CatalogEntity({ entity, entitiesCatalogConfig, catalogConfig, initialRelations, }: CatalogEntityProps): React.JSX.Element;
|
|
@@ -18,14 +18,26 @@ const Menu_1 = require("../../../components/Menu/Menu");
|
|
|
18
18
|
const Button_1 = require("../../../components/Button/Button");
|
|
19
19
|
const CatalogEntityRelations_1 = require("../../../components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations");
|
|
20
20
|
const hooks_1 = require("../../../core/hooks");
|
|
21
|
-
const SidebarActions_1 = require("
|
|
22
|
-
|
|
21
|
+
const SidebarActions_1 = require("../../../components/SidebarActions/SidebarActions");
|
|
22
|
+
const CatalogEntitySchema_1 = require("../../../components/Catalog/CatalogEntity/CatalogEntitySchema");
|
|
23
|
+
const CatalogEntityMethodAndPath_1 = require("../../../components/Catalog/CatalogEntity/CatalogEntityMethodAndPath");
|
|
24
|
+
function CatalogEntity({ entity, entitiesCatalogConfig, catalogConfig, initialRelations, }) {
|
|
23
25
|
var _a;
|
|
24
26
|
const { useTranslate, useCatalog } = (0, hooks_1.useThemeHooks)();
|
|
25
27
|
const { translate } = useTranslate();
|
|
26
28
|
const linkToMainCatalog = `catalogs/${catalogConfig.slug}`;
|
|
27
29
|
const linkToMainCatalogLabel = translate(catalogConfig.titleTranslationKey);
|
|
28
|
-
const { layout, collapsedSidebar, onChangeViewClick, onChangeCollapseSidebarClick } = useCatalog();
|
|
30
|
+
const { layout, collapsedSidebar, onChangeViewClick, onChangeCollapseSidebarClick, searchQuery, setSearchQuery, } = useCatalog();
|
|
31
|
+
const renderEntityContent = () => {
|
|
32
|
+
switch (entity.type) {
|
|
33
|
+
case 'data-schema':
|
|
34
|
+
return react_1.default.createElement(CatalogEntitySchema_1.CatalogEntitySchema, { entity: entity });
|
|
35
|
+
case 'api-operation':
|
|
36
|
+
return react_1.default.createElement(CatalogEntityMethodAndPath_1.CatalogEntityMethodAndPath, { entity: entity });
|
|
37
|
+
default:
|
|
38
|
+
return react_1.default.createElement(CatalogEntityMetadata_1.CatalogEntityMetadata, { entity: entity });
|
|
39
|
+
}
|
|
40
|
+
};
|
|
29
41
|
return (react_1.default.createElement(CatalogPageWrapper, { "data-component-name": "Catalog/CatalogEntity/CatalogEntity" },
|
|
30
42
|
react_1.default.createElement(CatalogSidebar, { collapsed: collapsedSidebar, header: react_1.default.createElement(BackLink, { icon: react_1.default.createElement(ArrowLeftIcon_1.ArrowLeftIcon, null), iconPosition: "left", variant: "ghost", size: "medium", "data-component-name": "Sidebar/BackButton", to: linkToMainCatalog }, collapsedSidebar ? ('') : (react_1.default.createElement("div", { "data-translation-key": "sidebar.menu.backLabel" }, translate('sidebar.menu.backLabel')))), menu: react_1.default.createElement(Menu_1.Menu, { items: [
|
|
31
43
|
{
|
|
@@ -38,14 +50,6 @@ function CatalogEntity({ entity, entitiesCatalogConfig, catalogConfig, initialRe
|
|
|
38
50
|
] }), footer: react_1.default.createElement(SidebarActions_1.SidebarActions, { layout: layout, collapsedSidebar: collapsedSidebar, isApiDocs: false, onChangeViewClick: onChangeViewClick, onChangeCollapseSidebarClick: onChangeCollapseSidebarClick }) }),
|
|
39
51
|
react_1.default.createElement(CatalogPageContent, null,
|
|
40
52
|
react_1.default.createElement(Breadcrumbs_1.Breadcrumbs, { additionalBreadcrumbs: [
|
|
41
|
-
...(mainCatalogLabelTranslationKey
|
|
42
|
-
? [
|
|
43
|
-
{
|
|
44
|
-
label: translate(mainCatalogLabelTranslationKey),
|
|
45
|
-
link: `catalogs/${mainCatalogSlug}`,
|
|
46
|
-
},
|
|
47
|
-
]
|
|
48
|
-
: []),
|
|
49
53
|
{ label: linkToMainCatalogLabel, link: linkToMainCatalog },
|
|
50
54
|
{ label: entity.title },
|
|
51
55
|
] }),
|
|
@@ -53,9 +57,9 @@ function CatalogEntity({ entity, entitiesCatalogConfig, catalogConfig, initialRe
|
|
|
53
57
|
react_1.default.createElement(CatalogPageDescription_1.CatalogPageDescription, { title: entity.title, description: (_a = entity.summary) !== null && _a !== void 0 ? _a : '', tag: entity.key }),
|
|
54
58
|
react_1.default.createElement(CatalogEntityProperties_1.CatalogEntityProperties, { entity: entity }),
|
|
55
59
|
react_1.default.createElement(CatalogTwoColumnsSection, null,
|
|
56
|
-
|
|
60
|
+
renderEntityContent(),
|
|
57
61
|
react_1.default.createElement(CatalogEntityLinks_1.CatalogEntityLinks, { entity: entity })),
|
|
58
|
-
react_1.default.createElement(CatalogEntityRelations_1.CatalogEntityRelations, { entity: entity, entitiesCatalogConfig: entitiesCatalogConfig, catalogConfig: catalogConfig, initialRelations: initialRelations })))));
|
|
62
|
+
react_1.default.createElement(CatalogEntityRelations_1.CatalogEntityRelations, { entity: entity, entitiesCatalogConfig: entitiesCatalogConfig, catalogConfig: catalogConfig, initialRelations: initialRelations, searchQuery: searchQuery, setSearchQuery: setSearchQuery })))));
|
|
59
63
|
}
|
|
60
64
|
const CatalogPageWrapper = styled_components_1.default.div `
|
|
61
65
|
--sidebar-width: var(--catalog-sidebar-width);
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { ReactNode, JSX } from 'react';
|
|
2
2
|
export type CatalogEntityInfoBarProps = {
|
|
3
3
|
leftContent: ReactNode;
|
|
4
|
-
rightContent
|
|
4
|
+
rightContent?: ReactNode;
|
|
5
5
|
withSeparator?: boolean;
|
|
6
|
+
hoverEffect?: boolean;
|
|
7
|
+
isCodeBlock?: boolean;
|
|
6
8
|
};
|
|
7
|
-
export declare function CatalogEntityInfoBar({ leftContent, rightContent, withSeparator, }: CatalogEntityInfoBarProps): JSX.Element;
|
|
9
|
+
export declare function CatalogEntityInfoBar({ leftContent, rightContent, withSeparator, hoverEffect, isCodeBlock, }: CatalogEntityInfoBarProps): JSX.Element;
|
|
@@ -6,10 +6,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.CatalogEntityInfoBar = CatalogEntityInfoBar;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
-
function CatalogEntityInfoBar({ leftContent, rightContent, withSeparator = true, }) {
|
|
10
|
-
return (react_1.default.createElement(InfoBarWrapper, { "data-component-name": "Catalog/CatalogEntity/CatalogEntityInfoBar" },
|
|
9
|
+
function CatalogEntityInfoBar({ leftContent, rightContent, withSeparator = true, hoverEffect = true, isCodeBlock = false, }) {
|
|
10
|
+
return (react_1.default.createElement(InfoBarWrapper, { "data-component-name": "Catalog/CatalogEntity/CatalogEntityInfoBar", hoverEffect: hoverEffect },
|
|
11
11
|
react_1.default.createElement(LeftColumn, { withSeparator: withSeparator }, leftContent),
|
|
12
|
-
react_1.default.createElement(RightColumn,
|
|
12
|
+
rightContent && react_1.default.createElement(RightColumn, { isCodeBlock: isCodeBlock }, rightContent)));
|
|
13
13
|
}
|
|
14
14
|
const InfoBarWrapper = styled_components_1.default.div `
|
|
15
15
|
display: grid;
|
|
@@ -18,7 +18,7 @@ const InfoBarWrapper = styled_components_1.default.div `
|
|
|
18
18
|
align-items: center;
|
|
19
19
|
|
|
20
20
|
color: var(--catalog-card-text-color, inherit);
|
|
21
|
-
background-color: var(--catalog-card-bg-color
|
|
21
|
+
background-color: var(--catalog-card-bg-color);
|
|
22
22
|
border: var(--catalog-card-border-width, 1px) var(--catalog-card-border-style)
|
|
23
23
|
var(--catalog-card-border-color);
|
|
24
24
|
border-radius: var(--catalog-card-border-radius);
|
|
@@ -26,9 +26,13 @@ const InfoBarWrapper = styled_components_1.default.div `
|
|
|
26
26
|
height: 100%;
|
|
27
27
|
padding: var(--catalog-card-gap);
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
${({ hoverEffect }) => hoverEffect &&
|
|
30
|
+
`
|
|
31
|
+
&:hover {
|
|
32
|
+
border-color: var(--catalog-card-border-color-hover);
|
|
33
|
+
background-color: var(--bg-color-active);
|
|
34
|
+
}
|
|
35
|
+
`}
|
|
32
36
|
`;
|
|
33
37
|
const LeftColumn = styled_components_1.default.div `
|
|
34
38
|
font-weight: var(--font-weight-medium);
|
|
@@ -38,6 +42,9 @@ const LeftColumn = styled_components_1.default.div `
|
|
|
38
42
|
justify-self: start;
|
|
39
43
|
text-align: left;
|
|
40
44
|
border-right: ${({ withSeparator }) => withSeparator ? '1px solid var(--border-color-primary)' : 'none'};
|
|
45
|
+
height: 100%;
|
|
46
|
+
display: flex;
|
|
47
|
+
align-items: center;
|
|
41
48
|
`;
|
|
42
49
|
const RightColumn = styled_components_1.default.div `
|
|
43
50
|
color: var(--catalog-metadata-value-color);
|
|
@@ -45,5 +52,6 @@ const RightColumn = styled_components_1.default.div `
|
|
|
45
52
|
grid-area: right;
|
|
46
53
|
justify-self: end;
|
|
47
54
|
text-align: right;
|
|
55
|
+
width: ${({ isCodeBlock }) => (isCodeBlock ? '100%' : 'auto')};
|
|
48
56
|
`;
|
|
49
57
|
//# sourceMappingURL=CatalogEntityInfoBar.js.map
|
|
@@ -7,7 +7,7 @@ exports.CatalogEntityLinks = CatalogEntityLinks;
|
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
9
|
const LaunchIcon_1 = require("../../../icons/LaunchIcon/LaunchIcon");
|
|
10
|
-
const
|
|
10
|
+
const LinkIcon_1 = require("../../../icons/LinkIcon/LinkIcon");
|
|
11
11
|
const CatalogEntityInfoBar_1 = require("../../../components/Catalog/CatalogEntity/CatalogEntityInfoBar");
|
|
12
12
|
const Link_1 = require("../../../components/Link/Link");
|
|
13
13
|
function CatalogEntityLinks({ entity }) {
|
|
@@ -17,11 +17,11 @@ function CatalogEntityLinks({ entity }) {
|
|
|
17
17
|
}
|
|
18
18
|
return (react_1.default.createElement(LinksWrapper, { "data-component-name": "Catalog/CatalogEntity/CatalogEntityLinks" },
|
|
19
19
|
react_1.default.createElement(Heading, null, "Links"),
|
|
20
|
-
links.map(([key, value]) => (react_1.default.createElement(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
links.map(([key, value]) => (react_1.default.createElement(Link_1.Link, { key: key, color: "var(--catalog-metadata-link-color)", to: value.url, target: "_blank" },
|
|
21
|
+
react_1.default.createElement(CatalogEntityInfoBar_1.CatalogEntityInfoBar, { leftContent: react_1.default.createElement(Label, null,
|
|
22
|
+
react_1.default.createElement(LinkIcon_1.LinkIcon, null),
|
|
23
|
+
" ",
|
|
24
|
+
value.label), rightContent: react_1.default.createElement(LaunchIcon_1.LaunchIcon, null), withSeparator: false }))))));
|
|
25
25
|
}
|
|
26
26
|
const LinksWrapper = styled_components_1.default.div `
|
|
27
27
|
display: flex;
|
|
@@ -41,10 +41,20 @@ exports.CatalogEntityMetadata = CatalogEntityMetadata;
|
|
|
41
41
|
const react_1 = __importStar(require("react"));
|
|
42
42
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
43
43
|
const ChevronDownIcon_1 = require("../../../icons/ChevronDownIcon/ChevronDownIcon");
|
|
44
|
+
const JsonViewer_1 = require("../../../components/JsonViewer/JsonViewer");
|
|
44
45
|
const utils_1 = require("../../../core/utils");
|
|
45
46
|
const hooks_1 = require("../../../core/hooks");
|
|
46
47
|
const CatalogEntityInfoBar_1 = require("../../../components/Catalog/CatalogEntity/CatalogEntityInfoBar");
|
|
47
48
|
const MAX_INITIAL_ITEMS = 4;
|
|
49
|
+
function renderMetadataValue(value) {
|
|
50
|
+
if ((0, utils_1.isPlainObject)(value)) {
|
|
51
|
+
return react_1.default.createElement(JsonViewerWrapper, { data: value, expandLevel: 3, hideHeader: true });
|
|
52
|
+
}
|
|
53
|
+
if (Array.isArray(value)) {
|
|
54
|
+
return (react_1.default.createElement(ArrayWrapper, null, value.map((item, index) => (react_1.default.createElement("div", { key: index }, (0, utils_1.isPlainObject)(item) ? (react_1.default.createElement(JsonViewerWrapper, { data: item, expandLevel: 3, hideHeader: true })) : (react_1.default.createElement("span", null, String(item))))))));
|
|
55
|
+
}
|
|
56
|
+
return react_1.default.createElement("span", null, String(value));
|
|
57
|
+
}
|
|
48
58
|
function CatalogEntityMetadata({ entity }) {
|
|
49
59
|
const { useTranslate } = (0, hooks_1.useThemeHooks)();
|
|
50
60
|
const { translate } = useTranslate();
|
|
@@ -60,12 +70,15 @@ function CatalogEntityMetadata({ entity }) {
|
|
|
60
70
|
react_1.default.createElement(Heading, null, translate('catalog.entity.metadata.title')),
|
|
61
71
|
visibleMetadata.map(([key, value]) => (react_1.default.createElement(CatalogEntityInfoBar_1.CatalogEntityInfoBar, { key: key, leftContent: react_1.default.createElement(Label, null,
|
|
62
72
|
(0, utils_1.capitalize)(key),
|
|
63
|
-
":"), rightContent: react_1.default.createElement(Value, null, value) }))),
|
|
73
|
+
":"), rightContent: react_1.default.createElement(Value, null, renderMetadataValue(value)), hoverEffect: false, isCodeBlock: (0, utils_1.isPlainObject)(value) || Array.isArray(value) }))),
|
|
64
74
|
hasMoreItems && (react_1.default.createElement(ShowMoreButton, { onClick: () => setIsOn(!isOn) },
|
|
65
75
|
isOn ? 'Show less' : 'Show more',
|
|
66
76
|
" ",
|
|
67
77
|
react_1.default.createElement(ChevronIcon, { "$isExpanded": isOn })))));
|
|
68
78
|
}
|
|
79
|
+
const JsonViewerWrapper = (0, styled_components_1.default)(JsonViewer_1.JsonViewer) `
|
|
80
|
+
text-align: left;
|
|
81
|
+
`;
|
|
69
82
|
const MetadataWrapper = styled_components_1.default.div `
|
|
70
83
|
display: flex;
|
|
71
84
|
flex-direction: column;
|
|
@@ -83,6 +96,10 @@ const Value = styled_components_1.default.span `
|
|
|
83
96
|
color: var(--catalog-metadata-value-color);
|
|
84
97
|
font-weight: var(--font-weight-medium);
|
|
85
98
|
`;
|
|
99
|
+
const ArrayWrapper = styled_components_1.default.div `
|
|
100
|
+
display: flex;
|
|
101
|
+
flex-direction: column;
|
|
102
|
+
`;
|
|
86
103
|
const Heading = styled_components_1.default.h2 `
|
|
87
104
|
margin-bottom: var(--spacing-base);
|
|
88
105
|
margin-top: 0;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BffCatalogEntity } from '../../../core/types';
|
|
3
|
+
export type CatalogEntityMethodAndPathProps = {
|
|
4
|
+
entity: BffCatalogEntity;
|
|
5
|
+
};
|
|
6
|
+
export declare function CatalogEntityMethodAndPath({ entity }: CatalogEntityMethodAndPathProps): React.JSX.Element | null;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.CatalogEntityMethodAndPath = CatalogEntityMethodAndPath;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
+
const CatalogEntityInfoBar_1 = require("../../../components/Catalog/CatalogEntity/CatalogEntityInfoBar");
|
|
10
|
+
const HttpTag_1 = require("../../../components/Tags/HttpTag");
|
|
11
|
+
function CatalogEntityMethodAndPath({ entity }) {
|
|
12
|
+
var _a, _b;
|
|
13
|
+
const method = (_a = entity.metadata) === null || _a === void 0 ? void 0 : _a.method;
|
|
14
|
+
const path = (_b = entity.metadata) === null || _b === void 0 ? void 0 : _b.path;
|
|
15
|
+
if (!method || !path) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
return (react_1.default.createElement(LinksWrapper, { "data-component-name": "Catalog/CatalogEntity/CatalogEntityMethodAndPath" },
|
|
19
|
+
react_1.default.createElement(Heading, null, "Method & Path"),
|
|
20
|
+
react_1.default.createElement(CatalogEntityInfoBar_1.CatalogEntityInfoBar, { leftContent: react_1.default.createElement(Label, null,
|
|
21
|
+
react_1.default.createElement(MethodTag, { color: method.toLowerCase() }, method),
|
|
22
|
+
path), withSeparator: false })));
|
|
23
|
+
}
|
|
24
|
+
const MethodTag = (0, styled_components_1.default)(HttpTag_1.HttpTag) `
|
|
25
|
+
width: auto;
|
|
26
|
+
justify-content: start;
|
|
27
|
+
margin-right: var(--spacing-xxs);
|
|
28
|
+
`;
|
|
29
|
+
const LinksWrapper = styled_components_1.default.div `
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-direction: column;
|
|
32
|
+
gap: var(--spacing-xs);
|
|
33
|
+
border-radius: var(--border-radius);
|
|
34
|
+
background-color: var(--catalog-metadata-bg-color);
|
|
35
|
+
transition: all 0.2s ease-in-out;
|
|
36
|
+
margin: var(--spacing-lg) 0;
|
|
37
|
+
`;
|
|
38
|
+
const Label = styled_components_1.default.div `
|
|
39
|
+
display: flex;
|
|
40
|
+
`;
|
|
41
|
+
const Heading = styled_components_1.default.h2 `
|
|
42
|
+
margin-bottom: var(--spacing-sm);
|
|
43
|
+
margin-top: 0;
|
|
44
|
+
font-size: var(--font-size-md);
|
|
45
|
+
color: var(--catalog-metadata-heading-color);
|
|
46
|
+
`;
|
|
47
|
+
//# sourceMappingURL=CatalogEntityMethodAndPath.js.map
|
package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/ApiDescriptionProperty.js
CHANGED
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.ApiDescriptionProperty = ApiDescriptionProperty;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const react_router_dom_1 = require("react-router-dom");
|
|
9
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
10
|
const theme_1 = require("../../../../index.js");
|
|
10
11
|
const CatalogEntityPropertyCard_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard");
|
|
11
12
|
function ApiDescriptionProperty({ entity }) {
|
|
@@ -18,8 +19,14 @@ function ApiDescriptionProperty({ entity }) {
|
|
|
18
19
|
return (react_1.default.createElement("div", { "data-component-name": "Catalog/CatalogEntity/CatalogEntityProperties/ApiDescriptionProperty" },
|
|
19
20
|
react_1.default.createElement(CatalogEntityPropertyCard_1.CatalogEntityPropertyCard, { header: react_1.default.createElement(react_1.default.Fragment, null,
|
|
20
21
|
react_1.default.createElement(theme_1.DocumentIcon, null),
|
|
21
|
-
translate('catalog.entity.properties.apiDescription.title')), content: react_1.default.createElement(theme_1.Tag,
|
|
22
|
+
translate('catalog.entity.properties.apiDescription.title')), content: react_1.default.createElement(theme_1.Tag, { textTransform: "none" },
|
|
23
|
+
react_1.default.createElement(DescriptionFile, null, descriptionFile)), onClick: () => {
|
|
22
24
|
navigate(`${pathPrefix}/${descriptionFile}`);
|
|
23
25
|
} })));
|
|
24
26
|
}
|
|
27
|
+
const DescriptionFile = styled_components_1.default.span `
|
|
28
|
+
word-break: break-all;
|
|
29
|
+
overflow-wrap: break-word;
|
|
30
|
+
white-space: normal;
|
|
31
|
+
`;
|
|
25
32
|
//# sourceMappingURL=ApiDescriptionProperty.js.map
|
package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.js
CHANGED
|
@@ -14,12 +14,18 @@ const UserEmailProperty_1 = require("../../../../components/Catalog/CatalogEntit
|
|
|
14
14
|
const DomainsProperty_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty");
|
|
15
15
|
const OwnersProperty_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityProperties/OwnersProperty");
|
|
16
16
|
const ContactProperty_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityProperties/ContactProperty");
|
|
17
|
+
const FormatProperty_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityProperties/FormatProperty");
|
|
17
18
|
const propertyRenderers = [
|
|
18
19
|
{
|
|
19
20
|
key: 'type',
|
|
20
21
|
condition: (entity) => !!entity.type,
|
|
21
22
|
component: EntityTypeProperty_1.EntityTypeProperty,
|
|
22
23
|
},
|
|
24
|
+
{
|
|
25
|
+
key: 'format',
|
|
26
|
+
condition: (entity) => { var _a; return entity.type === 'data-schema' && !!((_a = entity.metadata) === null || _a === void 0 ? void 0 : _a.specType); },
|
|
27
|
+
component: FormatProperty_1.FormatProperty,
|
|
28
|
+
},
|
|
23
29
|
{
|
|
24
30
|
key: 'contact',
|
|
25
31
|
condition: (entity) => { var _a, _b; return !!((_b = (_a = entity.contact) === null || _a === void 0 ? void 0 : _a.slack) === null || _b === void 0 ? void 0 : _b.channels); },
|
|
@@ -32,7 +38,7 @@ const propertyRenderers = [
|
|
|
32
38
|
},
|
|
33
39
|
{
|
|
34
40
|
key: 'tags',
|
|
35
|
-
condition: (entity) => !!entity.tags,
|
|
41
|
+
condition: (entity) => { var _a; return !!((_a = entity.tags) === null || _a === void 0 ? void 0 : _a.length); },
|
|
36
42
|
component: TagsProperty_1.TagsProperty,
|
|
37
43
|
},
|
|
38
44
|
{
|
package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.d.ts
CHANGED
|
@@ -3,5 +3,6 @@ export type CatalogEntityPropertyCardProps = {
|
|
|
3
3
|
header: ReactNode;
|
|
4
4
|
content: ReactNode;
|
|
5
5
|
onClick?: () => void;
|
|
6
|
+
hoverEffect?: boolean;
|
|
6
7
|
};
|
|
7
|
-
export declare function CatalogEntityPropertyCard({ header, content, onClick, }: CatalogEntityPropertyCardProps): JSX.Element;
|
|
8
|
+
export declare function CatalogEntityPropertyCard({ header, content, onClick, hoverEffect, }: CatalogEntityPropertyCardProps): JSX.Element;
|