@redocly/theme 0.69.0 → 0.70.0-next.1
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/Button/Button.js +5 -2
- package/lib/components/Button/variables.js +14 -5
- package/lib/components/Buttons/DownloadButton.js +13 -3
- package/lib/components/Catalog/Catalog.d.ts +2 -2
- package/lib/components/Catalog/CatalogActionsRow.d.ts +3 -2
- package/lib/components/Catalog/CatalogCardView/CatalogCard.d.ts +2 -2
- package/lib/components/Catalog/CatalogEntities.d.ts +2 -2
- package/lib/components/Catalog/CatalogEntitiesEmptyState.d.ts +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsGraph.d.ts +2 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsGraph.js +1 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistoryButton.d.ts +3 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistoryButton.js +45 -23
- package/lib/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistorySidebar.js +67 -33
- package/lib/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityRevisionItem.d.ts +3 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityRevisionItem.js +15 -3
- package/lib/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityVersionItem.d.ts +3 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityVersionItem.js +48 -57
- package/lib/components/Catalog/CatalogEntity/CatalogEntityInfoBar.d.ts +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityLinks.d.ts +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityMetadata.d.ts +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath.d.ts +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.d.ts +2 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.d.ts +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/ContactProperty.d.ts +2 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.d.ts +2 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/EntityTypeProperty.d.ts +2 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/FormatProperty.d.ts +2 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/GitProperty.d.ts +2 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/OwnersProperty.d.ts +2 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/OwnersProperty.js +1 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.d.ts +2 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/UserEmailProperty.d.ts +2 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations.d.ts +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.d.ts +2 -3
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.d.ts +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.d.ts +3 -4
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTableContent.d.ts +3 -4
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.d.ts +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntitySchema.js +1 -2
- package/lib/components/Catalog/CatalogEntityIcon.d.ts +1 -1
- package/lib/components/Catalog/CatalogEntityTypeTag.d.ts +2 -2
- package/lib/components/Catalog/CatalogFilter/CatalogFilterContent.d.ts +1 -1
- package/lib/components/Catalog/CatalogFilter/CatalogFilterContent.js +1 -2
- package/lib/components/Catalog/CatalogHighlight.d.ts +2 -1
- package/lib/components/Catalog/CatalogMobileFiltersPanel/CatalogMobileFiltersPanel.d.ts +2 -1
- package/lib/components/Catalog/CatalogMobileFiltersPanel/CatalogMobileFiltersPanelHeader.d.ts +1 -1
- package/lib/components/Catalog/CatalogMobileFiltersPanel/CatalogMobileFiltersPanelOverlay.d.ts +2 -1
- package/lib/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBar.d.ts +2 -2
- package/lib/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBarControls.d.ts +2 -2
- package/lib/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBarFiltersButton.d.ts +1 -1
- package/lib/components/Catalog/CatalogSelector.d.ts +3 -2
- package/lib/components/Catalog/CatalogTableView/CatalogEntityCell.d.ts +1 -1
- package/lib/components/Catalog/CatalogTableView/CatalogTableHeaderCell.d.ts +1 -1
- package/lib/components/Catalog/CatalogTableView/CatalogTableView.d.ts +2 -1
- package/lib/components/Catalog/CatalogTableView/CatalogTableViewRow.d.ts +2 -1
- package/lib/components/Catalog/CatalogTableView/CatalogTagsCell.d.ts +1 -1
- package/lib/components/Catalog/CatalogTags.d.ts +2 -2
- package/lib/components/Catalog/CatalogViewModeToggle.d.ts +1 -1
- package/lib/components/Catalog/variables.js +24 -33
- package/lib/components/CatalogClassic/CatalogClassicInfoBlock.d.ts +1 -1
- package/lib/components/CatalogClassic/CatalogClassicInfoBlock.js +1 -2
- package/lib/components/CatalogClassic/CatalogClassicVirtualizedGroups.d.ts +1 -1
- package/lib/components/CodeBlock/CodeBlockControls.d.ts +1 -1
- package/lib/components/Dropdown/Dropdown.js +7 -8
- package/lib/components/Filter/FilterOptionLabel.d.ts +1 -1
- package/lib/components/LoadMore/LoadMore.d.ts +1 -1
- package/lib/components/MCP/McpConnectionTabs.js +2 -2
- package/lib/components/PageActions/PageActions.d.ts +1 -1
- package/lib/components/ReplaySecuritySchemeActions/ReplaySecuritySchemeActions.d.ts +11 -0
- package/lib/components/ReplaySecuritySchemeActions/ReplaySecuritySchemeActions.js +7 -0
- package/lib/components/Search/SearchAiDialog.d.ts +1 -1
- package/lib/components/Search/SearchAiMessage.d.ts +1 -2
- package/lib/components/Search/SearchAiMessage.js +8 -10
- package/lib/components/Search/SearchAiResponse.d.ts +1 -1
- package/lib/components/Search/SearchGroups.d.ts +1 -1
- package/lib/components/SplitButton/SplitButton.d.ts +1 -0
- package/lib/components/SplitButton/SplitButton.js +2 -2
- package/lib/components/Tooltip/AnchorTooltip.js +17 -27
- package/lib/components/Tooltip/JsTooltip.js +34 -46
- package/lib/components/Tooltip/Tooltip.js +1 -2
- package/lib/core/constants/markdown.d.ts +2 -0
- package/lib/core/constants/markdown.js +3 -1
- package/lib/core/hooks/catalog/use-catalog-entity-schema.d.ts +1 -1
- package/lib/core/hooks/catalog/use-catalog-entity-schema.js +2 -2
- package/lib/core/hooks/catalog/use-catalog-table-header-cell-actions.d.ts +1 -1
- package/lib/core/hooks/catalog/use-graph.d.ts +3 -3
- package/lib/core/hooks/code-walkthrough/use-code-walkthrough-controls.js +1 -1
- package/lib/core/hooks/index.d.ts +1 -0
- package/lib/core/hooks/index.js +1 -0
- package/lib/core/hooks/menu/use-nested-menu.js +2 -2
- package/lib/core/hooks/use-active-section-id.js +6 -0
- package/lib/core/hooks/use-anchor-positioning.d.ts +3 -0
- package/lib/core/hooks/use-anchor-positioning.js +21 -0
- package/lib/core/hooks/use-element-size.d.ts +1 -1
- package/lib/core/hooks/use-theme-hooks.js +0 -1
- package/lib/core/types/catalog.d.ts +2 -3
- package/lib/core/types/common.d.ts +1 -1
- package/lib/core/types/hooks.d.ts +4 -10
- package/lib/core/utils/load-and-navigate.js +3 -3
- package/lib/core/utils/mcp.d.ts +0 -1
- package/lib/core/utils/mcp.js +0 -13
- package/lib/core/utils/menu.d.ts +2 -2
- package/lib/core/utils/urls.js +1 -3
- package/lib/ext/use-configure-replay.d.ts +1 -1
- package/lib/layouts/OIDCForbidden.js +1 -1
- package/lib/markdoc/components/CodeWalkthrough/CodePanelPreview.d.ts +1 -2
- package/lib/markdoc/components/Diagram/Diagram.d.ts +1 -1
- package/lib/markdoc/components/Diagram/Diagram.js +1 -2
- package/lib/markdoc/components/Tabs/Tab.d.ts +1 -1
- package/lib/markdoc/components/Tabs/TabList.d.ts +1 -1
- package/lib/markdoc/tags/code-walkthrough.d.ts +1 -1
- package/lib/markdoc/tags/markdoc-example.js +34 -22
- package/package.json +4 -4
- package/src/components/Button/Button.tsx +5 -2
- package/src/components/Button/variables.ts +14 -5
- package/src/components/Buttons/DownloadButton.tsx +16 -8
- package/src/components/Catalog/Catalog.tsx +4 -4
- package/src/components/Catalog/CatalogActionsRow.tsx +3 -2
- package/src/components/Catalog/CatalogCardView/CatalogCard.tsx +3 -2
- package/src/components/Catalog/CatalogEntities.tsx +3 -2
- package/src/components/Catalog/CatalogEntitiesEmptyState.tsx +2 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntity.tsx +6 -2
- package/src/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsGraph.tsx +4 -5
- package/src/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistoryButton.tsx +56 -35
- package/src/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistorySidebar.tsx +80 -42
- package/src/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityRevisionItem.tsx +18 -2
- package/src/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityVersionItem.tsx +61 -75
- package/src/components/Catalog/CatalogEntity/CatalogEntityInfoBar.tsx +2 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityLinks.tsx +1 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityMetadata.tsx +1 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath.tsx +1 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.tsx +3 -2
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.tsx +2 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/ContactProperty.tsx +3 -2
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.tsx +3 -2
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/EntityTypeProperty.tsx +3 -2
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/FormatProperty.tsx +3 -2
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/GitProperty.tsx +3 -2
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/OwnersProperty.tsx +3 -4
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.tsx +3 -2
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/UserEmailProperty.tsx +3 -2
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations.tsx +2 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.tsx +7 -4
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.tsx +2 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.tsx +7 -4
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTableContent.tsx +3 -4
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.tsx +3 -2
- package/src/components/Catalog/CatalogEntity/CatalogEntitySchema.tsx +1 -2
- package/src/components/Catalog/CatalogEntityIcon.tsx +3 -2
- package/src/components/Catalog/CatalogEntityTypeTag.tsx +3 -2
- package/src/components/Catalog/CatalogFilter/CatalogFilterContent.tsx +2 -4
- package/src/components/Catalog/CatalogHighlight.tsx +2 -1
- package/src/components/Catalog/CatalogMobileFiltersPanel/CatalogMobileFiltersPanel.tsx +2 -1
- package/src/components/Catalog/CatalogMobileFiltersPanel/CatalogMobileFiltersPanelHeader.tsx +2 -1
- package/src/components/Catalog/CatalogMobileFiltersPanel/CatalogMobileFiltersPanelOverlay.tsx +2 -1
- package/src/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBar.tsx +3 -2
- package/src/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBarControls.tsx +3 -2
- package/src/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBarFiltersButton.tsx +2 -1
- package/src/components/Catalog/CatalogSelector.tsx +3 -2
- package/src/components/Catalog/CatalogTableView/CatalogEntityCell.tsx +1 -1
- package/src/components/Catalog/CatalogTableView/CatalogTableHeaderCell.tsx +1 -1
- package/src/components/Catalog/CatalogTableView/CatalogTableView.tsx +2 -1
- package/src/components/Catalog/CatalogTableView/CatalogTableViewRow.tsx +2 -1
- package/src/components/Catalog/CatalogTableView/CatalogTagsCell.tsx +1 -1
- package/src/components/Catalog/CatalogTags.tsx +4 -2
- package/src/components/Catalog/CatalogViewModeToggle.tsx +1 -1
- package/src/components/Catalog/variables.ts +24 -33
- package/src/components/CatalogClassic/CatalogClassicInfoBlock.tsx +2 -5
- package/src/components/CatalogClassic/CatalogClassicVirtualizedGroups.tsx +1 -1
- package/src/components/CodeBlock/CodeBlockControls.tsx +2 -1
- package/src/components/Dropdown/Dropdown.tsx +5 -8
- package/src/components/Filter/FilterOptionLabel.tsx +1 -1
- package/src/components/LoadMore/LoadMore.tsx +2 -1
- package/src/components/MCP/McpConnectionTabs.tsx +3 -4
- package/src/components/PageActions/PageActions.tsx +2 -1
- package/src/components/ReplaySecuritySchemeActions/ReplaySecuritySchemeActions.tsx +19 -0
- package/src/components/Search/SearchAiDialog.tsx +1 -1
- package/src/components/Search/SearchAiMessage.tsx +3 -6
- package/src/components/Search/SearchAiResponse.tsx +2 -4
- package/src/components/Search/SearchGroups.tsx +1 -5
- package/src/components/SplitButton/SplitButton.tsx +3 -0
- package/src/components/Tooltip/AnchorTooltip.tsx +17 -27
- package/src/components/Tooltip/JsTooltip.tsx +55 -62
- package/src/components/Tooltip/Tooltip.tsx +1 -2
- package/src/core/constants/markdown.ts +4 -0
- package/src/core/hooks/__mocks__/index.ts +1 -0
- package/src/core/hooks/__mocks__/use-anchor-positioning.ts +3 -0
- package/src/core/hooks/__mocks__/use-theme-hooks.ts +0 -3
- package/src/core/hooks/catalog/use-catalog-entity-schema.ts +3 -3
- package/src/core/hooks/catalog/use-catalog-table-header-cell-actions.ts +1 -1
- package/src/core/hooks/catalog/use-graph.ts +4 -4
- package/src/core/hooks/code-walkthrough/__mocks__/MockIntersectionObserver.ts +1 -1
- package/src/core/hooks/code-walkthrough/__mocks__/mock-intersection-observer.ts +1 -1
- package/src/core/hooks/code-walkthrough/use-code-walkthrough-controls.ts +1 -1
- package/src/core/hooks/index.ts +1 -0
- package/src/core/hooks/menu/__mocks__/use-mobile-menu-items.ts +1 -1
- package/src/core/hooks/menu/use-nested-menu.ts +2 -2
- package/src/core/hooks/use-active-section-id.ts +8 -0
- package/src/core/hooks/use-anchor-positioning.ts +22 -0
- package/src/core/hooks/use-element-size.ts +2 -1
- package/src/core/hooks/use-theme-hooks.ts +0 -1
- package/src/core/types/catalog.ts +7 -3
- package/src/core/types/common.ts +1 -1
- package/src/core/types/hooks.ts +15 -14
- package/src/core/utils/load-and-navigate.ts +3 -3
- package/src/core/utils/mcp.ts +0 -17
- package/src/core/utils/menu.ts +2 -2
- package/src/core/utils/urls.ts +1 -3
- package/src/ext/use-configure-replay.ts +3 -3
- package/src/layouts/OIDCForbidden.tsx +1 -1
- package/src/markdoc/components/CodeWalkthrough/CodePanelPreview.tsx +2 -2
- package/src/markdoc/components/CodeWalkthrough/CodeWalkthrough.tsx +2 -4
- package/src/markdoc/components/Diagram/Diagram.tsx +2 -5
- package/src/markdoc/components/Tabs/Tab.tsx +1 -1
- package/src/markdoc/components/Tabs/TabList.tsx +1 -1
- package/src/markdoc/tags/code-walkthrough.ts +2 -1
- package/src/markdoc/tags/markdoc-example.ts +45 -28
|
@@ -125,15 +125,20 @@ function TooltipComponent({
|
|
|
125
125
|
|
|
126
126
|
export const Tooltip = memo<PropsWithChildren<TooltipProps>>(TooltipComponent);
|
|
127
127
|
|
|
128
|
+
type TooltipArrowProps = {
|
|
129
|
+
$withArrow: boolean;
|
|
130
|
+
$arrowPosition: NonNullable<TooltipProps['arrowPosition']>;
|
|
131
|
+
};
|
|
132
|
+
|
|
128
133
|
const PLACEMENTS = {
|
|
129
|
-
top: css<
|
|
130
|
-
${({ withArrow, arrowPosition }) =>
|
|
131
|
-
withArrow && arrowPosition === 'left'
|
|
134
|
+
top: css<TooltipArrowProps>`
|
|
135
|
+
${({ $withArrow, $arrowPosition }) =>
|
|
136
|
+
$withArrow && $arrowPosition === 'left'
|
|
132
137
|
? css`
|
|
133
138
|
transform: translate(0, -100%);
|
|
134
139
|
margin-top: -10px;
|
|
135
140
|
`
|
|
136
|
-
: arrowPosition === 'right'
|
|
141
|
+
: $arrowPosition === 'right'
|
|
137
142
|
? css`
|
|
138
143
|
transform: translate(-100%, -100%);
|
|
139
144
|
margin-top: -10px;
|
|
@@ -143,30 +148,28 @@ const PLACEMENTS = {
|
|
|
143
148
|
margin-top: -10px;
|
|
144
149
|
`}
|
|
145
150
|
|
|
146
|
-
${({ withArrow, arrowPosition }) =>
|
|
147
|
-
withArrow &&
|
|
151
|
+
${({ $withArrow, $arrowPosition }) =>
|
|
152
|
+
$withArrow &&
|
|
148
153
|
css`
|
|
149
154
|
&::after {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
border-top-style: solid;
|
|
154
|
-
border-radius: 2px;
|
|
155
|
+
width: 16px;
|
|
156
|
+
height: 8px;
|
|
157
|
+
clip-path: path('M0 0H16L9.414 6.586A2 2 0 0 1 6.586 6.586Z');
|
|
155
158
|
bottom: 0;
|
|
156
|
-
${arrowPosition === 'left' && 'left:
|
|
157
|
-
${arrowPosition === 'center' && 'left: 50%; transform: translate(-50%, 99%);'}
|
|
158
|
-
${arrowPosition === 'right' && 'right:
|
|
159
|
+
${$arrowPosition === 'left' && 'left: 22px; transform: translateY(99%);'}
|
|
160
|
+
${$arrowPosition === 'center' && 'left: 50%; transform: translate(-50%, 99%);'}
|
|
161
|
+
${$arrowPosition === 'right' && 'right: 22px; transform: translateY(99%);'}
|
|
159
162
|
}
|
|
160
163
|
`}
|
|
161
164
|
`,
|
|
162
|
-
bottom: css<
|
|
163
|
-
${({ withArrow, arrowPosition }) =>
|
|
164
|
-
withArrow && arrowPosition === 'left'
|
|
165
|
+
bottom: css<TooltipArrowProps>`
|
|
166
|
+
${({ $withArrow, $arrowPosition }) =>
|
|
167
|
+
$withArrow && $arrowPosition === 'left'
|
|
165
168
|
? css`
|
|
166
169
|
transform: translate(0, 10px);
|
|
167
170
|
margin-top: 0;
|
|
168
171
|
`
|
|
169
|
-
: arrowPosition === 'right'
|
|
172
|
+
: $arrowPosition === 'right'
|
|
170
173
|
? css`
|
|
171
174
|
transform: translate(-100%, 10px);
|
|
172
175
|
margin-top: 0;
|
|
@@ -176,61 +179,55 @@ const PLACEMENTS = {
|
|
|
176
179
|
margin-top: 0;
|
|
177
180
|
`}
|
|
178
181
|
|
|
179
|
-
${({ withArrow, arrowPosition }) =>
|
|
180
|
-
withArrow &&
|
|
182
|
+
${({ $withArrow, $arrowPosition }) =>
|
|
183
|
+
$withArrow &&
|
|
181
184
|
css`
|
|
182
185
|
&::after {
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
border-bottom-style: solid;
|
|
187
|
-
border-radius: 0 0 2px 2px;
|
|
186
|
+
width: 16px;
|
|
187
|
+
height: 8px;
|
|
188
|
+
clip-path: path('M0 8H16L9.414 1.414A2 2 0 0 0 6.586 1.414Z');
|
|
188
189
|
top: 0;
|
|
189
|
-
${arrowPosition === 'left' && 'left:
|
|
190
|
-
${arrowPosition === 'center' && 'left: 50%; transform: translate(-50%, -99%);'}
|
|
191
|
-
${arrowPosition === 'right' && 'right:
|
|
190
|
+
${$arrowPosition === 'left' && 'left: 22px; transform: translateY(-99%);'}
|
|
191
|
+
${$arrowPosition === 'center' && 'left: 50%; transform: translate(-50%, -99%);'}
|
|
192
|
+
${$arrowPosition === 'right' && 'right: 22px; transform: translateY(-99%);'}
|
|
192
193
|
}
|
|
193
194
|
`}
|
|
194
195
|
`,
|
|
195
|
-
left: css<
|
|
196
|
+
left: css<TooltipArrowProps>`
|
|
196
197
|
transform: translate(-100%, -50%);
|
|
197
198
|
margin-left: -10px;
|
|
198
199
|
|
|
199
|
-
${({ withArrow, arrowPosition }) =>
|
|
200
|
-
withArrow &&
|
|
200
|
+
${({ $withArrow, $arrowPosition }) =>
|
|
201
|
+
$withArrow &&
|
|
201
202
|
css`
|
|
202
203
|
&::after {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
border-left-style: solid;
|
|
207
|
-
border-radius: 2px 0 0 2px;
|
|
204
|
+
width: 8px;
|
|
205
|
+
height: 16px;
|
|
206
|
+
clip-path: path('M0 0V16L6.586 9.414A2 2 0 0 0 6.586 6.586Z');
|
|
208
207
|
top: 50%;
|
|
209
208
|
right: 0;
|
|
210
|
-
${arrowPosition === 'top' && 'top:
|
|
211
|
-
${arrowPosition === 'center' && 'top: 50%; transform: translate(99%, -50%);'}
|
|
212
|
-
${arrowPosition === 'bottom' && 'bottom:
|
|
209
|
+
${$arrowPosition === 'top' && 'top: 22px; transform: translateX(99%);'}
|
|
210
|
+
${$arrowPosition === 'center' && 'top: 50%; transform: translate(99%, -50%);'}
|
|
211
|
+
${$arrowPosition === 'bottom' && 'bottom: 22px; transform: translateX(99%);'}
|
|
213
212
|
}
|
|
214
213
|
`}
|
|
215
214
|
`,
|
|
216
|
-
right: css<
|
|
215
|
+
right: css<TooltipArrowProps>`
|
|
217
216
|
transform: translate(0, -50%);
|
|
218
217
|
margin-left: 10px;
|
|
219
218
|
|
|
220
|
-
${({ withArrow, arrowPosition }) =>
|
|
221
|
-
withArrow &&
|
|
219
|
+
${({ $withArrow, $arrowPosition }) =>
|
|
220
|
+
$withArrow &&
|
|
222
221
|
css`
|
|
223
222
|
&::after {
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
border-right-style: solid;
|
|
228
|
-
border-radius: 0 2px 2px 0;
|
|
223
|
+
width: 8px;
|
|
224
|
+
height: 16px;
|
|
225
|
+
clip-path: path('M8 0V16L1.414 9.414A2 2 0 0 1 1.414 6.586Z');
|
|
229
226
|
top: 50%;
|
|
230
227
|
left: 0;
|
|
231
|
-
${arrowPosition === 'top' && 'top:
|
|
232
|
-
${arrowPosition === 'center' && 'top: 50%; transform: translate(-99%, -50%);'}
|
|
233
|
-
${arrowPosition === 'bottom' && 'bottom:
|
|
228
|
+
${$arrowPosition === 'top' && 'top: 22px; transform: translateX(-99%);'}
|
|
229
|
+
${$arrowPosition === 'center' && 'top: 50%; transform: translate(-99%, -50%);'}
|
|
230
|
+
${$arrowPosition === 'bottom' && 'bottom: 22px; transform: translateX(-99%);'}
|
|
234
231
|
}
|
|
235
232
|
`}
|
|
236
233
|
`,
|
|
@@ -240,12 +237,12 @@ const TooltipWrapper = styled.div`
|
|
|
240
237
|
position: relative;
|
|
241
238
|
display: flex;
|
|
242
239
|
`;
|
|
243
|
-
const TooltipBody = styled.span<
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
240
|
+
const TooltipBody = styled.span<
|
|
241
|
+
TooltipArrowProps & {
|
|
242
|
+
$placement: NonNullable<TooltipProps['placement']>;
|
|
243
|
+
$width?: string;
|
|
244
|
+
}
|
|
245
|
+
>`
|
|
249
246
|
display: inline-block;
|
|
250
247
|
|
|
251
248
|
padding: var(--tooltip-padding);
|
|
@@ -267,9 +264,7 @@ const TooltipBody = styled.span<{
|
|
|
267
264
|
|
|
268
265
|
content: ' ';
|
|
269
266
|
display: inline-block;
|
|
270
|
-
|
|
271
|
-
height: 0;
|
|
272
|
-
border-color: var(--tooltip-arrow-color, var(--tooltip-bg-color));
|
|
267
|
+
background: var(--tooltip-arrow-color, var(--tooltip-bg-color));
|
|
273
268
|
}
|
|
274
269
|
|
|
275
270
|
background: var(--tooltip-bg-color);
|
|
@@ -279,7 +274,5 @@ const TooltipBody = styled.span<{
|
|
|
279
274
|
box-shadow: var(--bg-raised-shadow);
|
|
280
275
|
|
|
281
276
|
width: ${({ $width }) => $width || 'max-content'};
|
|
282
|
-
${({ $placement }) =>
|
|
283
|
-
${PLACEMENTS[$placement]};
|
|
284
|
-
`}
|
|
277
|
+
${({ $placement }) => PLACEMENTS[$placement]}
|
|
285
278
|
`;
|
|
@@ -4,11 +4,10 @@ import type { TooltipProps } from '@redocly/theme/core/types';
|
|
|
4
4
|
|
|
5
5
|
import { Tooltip as AnchorTooltip } from '@redocly/theme/components/Tooltip/AnchorTooltip';
|
|
6
6
|
import { Tooltip as JsTooltip } from '@redocly/theme/components/Tooltip/JsTooltip';
|
|
7
|
-
import {
|
|
7
|
+
import { useAnchorPositioning } from '@redocly/theme/core/hooks';
|
|
8
8
|
import { getDefaultFallbackPlacements } from '@redocly/theme/core/utils';
|
|
9
9
|
|
|
10
10
|
function TooltipComponent(props: TooltipProps): React.ReactElement {
|
|
11
|
-
const { useAnchorPositioning } = useThemeHooks();
|
|
12
11
|
const { isSupported } = useAnchorPositioning();
|
|
13
12
|
|
|
14
13
|
const fallbackPlacements =
|
|
@@ -3,9 +3,6 @@ import { vi, type MockedFunction } from 'vitest';
|
|
|
3
3
|
import type { ThemeHooks } from '../../types/hooks';
|
|
4
4
|
|
|
5
5
|
export const useThemeHooks = vi.fn(() => ({
|
|
6
|
-
useAnchorPositioning: vi.fn(() => ({
|
|
7
|
-
isSupported: true,
|
|
8
|
-
})),
|
|
9
6
|
useTranslate: vi.fn(() => ({
|
|
10
7
|
translate: vi.fn((key: string, defaultValue: string | { defaultValue: string }) =>
|
|
11
8
|
defaultValue
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BffCatalogEntity, BffCatalogRelatedEntity } from '../../types';
|
|
1
|
+
import type { BffCatalogEntity, BffCatalogRelatedEntity } from '../../types';
|
|
2
2
|
|
|
3
3
|
type CatalogEntitySchemaProps = {
|
|
4
4
|
entity: BffCatalogEntity;
|
|
@@ -12,7 +12,7 @@ export function useCatalogEntitySchema({ entity, relatedEntity }: CatalogEntityS
|
|
|
12
12
|
|
|
13
13
|
try {
|
|
14
14
|
parsedSchema = JSON.parse(schema);
|
|
15
|
-
} catch
|
|
15
|
+
} catch {
|
|
16
16
|
parsedSchema = undefined;
|
|
17
17
|
}
|
|
18
18
|
|
|
@@ -22,7 +22,7 @@ export function useCatalogEntitySchema({ entity, relatedEntity }: CatalogEntityS
|
|
|
22
22
|
parsedApiDefinition = relatedEntity?.metadata?.schema
|
|
23
23
|
? (JSON.parse(relatedEntity.metadata.schema) as Record<string, unknown>)
|
|
24
24
|
: undefined;
|
|
25
|
-
} catch
|
|
25
|
+
} catch {
|
|
26
26
|
parsedApiDefinition = undefined;
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { useCallback, useEffect, useMemo } from 'react';
|
|
2
2
|
import {
|
|
3
|
+
type OnNodesChange,
|
|
4
|
+
type OnEdgesChange,
|
|
3
5
|
addEdge,
|
|
4
6
|
type Node,
|
|
5
7
|
type Edge,
|
|
@@ -7,13 +9,11 @@ import {
|
|
|
7
9
|
useNodesState,
|
|
8
10
|
useEdgesState,
|
|
9
11
|
Position,
|
|
10
|
-
OnNodesChange,
|
|
11
|
-
OnEdgesChange,
|
|
12
12
|
} from '@xyflow/react';
|
|
13
13
|
|
|
14
|
-
import {
|
|
14
|
+
import type { CatalogEntityNodeData } from '@redocly/theme/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsNode';
|
|
15
15
|
|
|
16
|
-
import { BffCatalogEntity, BffCatalogRelatedEntity } from '../../types';
|
|
16
|
+
import type { BffCatalogEntity, BffCatalogRelatedEntity } from '../../types';
|
|
17
17
|
import {
|
|
18
18
|
GraphCustomEdgeType,
|
|
19
19
|
GraphCustomNodeType,
|
|
@@ -8,7 +8,7 @@ export class MockIntersectionObserver {
|
|
|
8
8
|
unobserve: (target: HTMLElement) => void;
|
|
9
9
|
disconnect: () => void;
|
|
10
10
|
|
|
11
|
-
// @ts-
|
|
11
|
+
// @ts-expect-error
|
|
12
12
|
constructor(callback: IntersectionObserverCallback, options?: IntersectionObserverInit) {
|
|
13
13
|
this.root = null;
|
|
14
14
|
this.rootMargin = '0px';
|
|
@@ -9,7 +9,7 @@ export class MockIntersectionObserver {
|
|
|
9
9
|
unobserve: (target: HTMLElement) => void;
|
|
10
10
|
disconnect: () => void;
|
|
11
11
|
|
|
12
|
-
// @ts-
|
|
12
|
+
// @ts-expect-error
|
|
13
13
|
constructor(callback: IntersectionObserverCallback, options?: IntersectionObserverInit) {
|
|
14
14
|
this.root = null;
|
|
15
15
|
this.rootMargin = '0px';
|
|
@@ -98,7 +98,7 @@ export function useCodeWalkthroughControls(
|
|
|
98
98
|
Object.entries(newState).forEach(([id, control]) => {
|
|
99
99
|
const existingControl = controlsState[id];
|
|
100
100
|
if (existingControl && existingControl.type === control.type) {
|
|
101
|
-
// @ts-
|
|
101
|
+
// @ts-expect-error
|
|
102
102
|
newState[id] = {
|
|
103
103
|
...control,
|
|
104
104
|
value: existingControl.value,
|
package/src/core/hooks/index.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { vi, type MockedFunction } from 'vitest';
|
|
|
2
2
|
|
|
3
3
|
import type { ResolvedNavItem } from '@redocly/config';
|
|
4
4
|
|
|
5
|
-
import { MobileMenuType } from '../../../constants/common';
|
|
5
|
+
import type { MobileMenuType } from '../../../constants/common';
|
|
6
6
|
|
|
7
7
|
export const useMobileMenuItems: MockedFunction<
|
|
8
8
|
(menuType: MobileMenuType) => {
|
|
@@ -47,9 +47,9 @@ export function useNestedMenu({ item, labelRef, nestedMenuRef }: NestedMenuProps
|
|
|
47
47
|
rect.right <= (window.innerWidth || document.documentElement.clientWidth);
|
|
48
48
|
|
|
49
49
|
// Only scroll if element is in viewport to prevent page jumping
|
|
50
|
-
// @ts-
|
|
50
|
+
// @ts-expect-error
|
|
51
51
|
if (isInViewport && typeof el.scrollIntoViewIfNeeded === 'function') {
|
|
52
|
-
// @ts-
|
|
52
|
+
// @ts-expect-error
|
|
53
53
|
el.scrollIntoViewIfNeeded(centerIfNeeded);
|
|
54
54
|
}
|
|
55
55
|
}
|
|
@@ -43,6 +43,7 @@ export function useActiveSectionId(
|
|
|
43
43
|
const section = sections[i];
|
|
44
44
|
const rect = section.getBoundingClientRect();
|
|
45
45
|
if (rect.y < heightOffset && rect.bottom > heightOffset) {
|
|
46
|
+
if (isSkippedContent(section)) continue;
|
|
46
47
|
setItemId(section.getAttribute('data-section-id') || '');
|
|
47
48
|
return;
|
|
48
49
|
}
|
|
@@ -73,3 +74,10 @@ export function useActiveSectionId(
|
|
|
73
74
|
|
|
74
75
|
return itemId;
|
|
75
76
|
}
|
|
77
|
+
|
|
78
|
+
function isSkippedContent(element: Element): boolean {
|
|
79
|
+
return (
|
|
80
|
+
typeof element.checkVisibility === 'function' &&
|
|
81
|
+
!element.checkVisibility({ contentVisibilityAuto: true })
|
|
82
|
+
);
|
|
83
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
export const useAnchorPositioning = (): { isSupported: boolean } => {
|
|
4
|
+
const [isSupported, setIsSupported] = useState(false);
|
|
5
|
+
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
setIsSupported(isAnchorPositioningSupported());
|
|
8
|
+
}, []);
|
|
9
|
+
|
|
10
|
+
return { isSupported };
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
function isAnchorPositioningSupported(): boolean {
|
|
14
|
+
if (typeof CSS === 'undefined' || typeof CSS.supports !== 'function') {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
return (
|
|
18
|
+
CSS.supports('anchor-name: --a') &&
|
|
19
|
+
CSS.supports('position-anchor: --a') &&
|
|
20
|
+
CSS.supports('top: anchor(top)')
|
|
21
|
+
);
|
|
22
|
+
}
|
|
@@ -6,7 +6,6 @@ import { ThemeDataContext } from '../contexts/ThemeDataContext';
|
|
|
6
6
|
import { useTelemetryFallback } from './use-telemetry-fallback';
|
|
7
7
|
|
|
8
8
|
const fallbacks = {
|
|
9
|
-
useAnchorPositioning: () => ({ isSupported: false }),
|
|
10
9
|
useTranslate: () => ({
|
|
11
10
|
translate: (value?: string, options?: { defaultValue: string } | string) =>
|
|
12
11
|
(typeof options === 'string' ? options : options?.defaultValue) || value || '',
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import { InfiniteData, UseInfiniteQueryResult } from '@tanstack/react-query';
|
|
2
|
-
import {
|
|
1
|
+
import type { InfiniteData, UseInfiniteQueryResult } from '@tanstack/react-query';
|
|
2
|
+
import type {
|
|
3
|
+
ENTITY_RELATION_TYPES,
|
|
4
|
+
CatalogEntityConfig,
|
|
5
|
+
EntitiesCatalogConfig,
|
|
6
|
+
LayoutVariant,
|
|
7
|
+
} from '@redocly/config';
|
|
3
8
|
|
|
4
|
-
import type { CatalogEntityConfig, EntitiesCatalogConfig, LayoutVariant } from '@redocly/config';
|
|
5
9
|
import type { CatalogFilterConfig } from '@redocly/theme/config';
|
|
6
10
|
|
|
7
11
|
export type FilterResult = {
|
package/src/core/types/common.ts
CHANGED
package/src/core/types/hooks.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
ResolvedBannerConfig,
|
|
3
|
+
PageData,
|
|
4
|
+
PageProps,
|
|
5
|
+
ResolvedNavItemWithLink,
|
|
6
|
+
Version,
|
|
7
|
+
} from '@redocly/config';
|
|
2
8
|
import type { AsyncApiRealmUI } from '@redocly/realm-asyncapi-sdk';
|
|
3
|
-
import type { PageData, PageProps, ResolvedNavItemWithLink, Version } from '@redocly/config';
|
|
4
9
|
import type { ShikiTransformer } from '@shikijs/types';
|
|
5
10
|
import type { Callback, TFunction as TFunc } from 'i18next';
|
|
6
11
|
import type { To, Location, NavigateFunction } from 'react-router';
|
|
@@ -14,9 +19,15 @@ import type {
|
|
|
14
19
|
UseCatalogProps,
|
|
15
20
|
CatalogApiParams,
|
|
16
21
|
CatalogApiResults,
|
|
22
|
+
BffCatalogEntity,
|
|
23
|
+
BffCatalogEntityList,
|
|
24
|
+
BffCatalogRelatedEntity,
|
|
25
|
+
BffCatalogRelatedEntityList,
|
|
26
|
+
BffCatalogEntityRevision,
|
|
27
|
+
BffCatalogEntityRevisionList,
|
|
17
28
|
} from './catalog';
|
|
18
29
|
import type { UserMenuData } from './user-menu';
|
|
19
|
-
import type { ItemState } from './sidebar';
|
|
30
|
+
import type { ItemState, DrilldownMenuItemDetails } from './sidebar';
|
|
20
31
|
import type {
|
|
21
32
|
SearchItemData,
|
|
22
33
|
SearchFacet,
|
|
@@ -29,20 +40,10 @@ import type {
|
|
|
29
40
|
import type { SubmitFeedbackParams } from './feedback';
|
|
30
41
|
import type { TFunction } from './l10n';
|
|
31
42
|
import type { BreadcrumbItem } from './breadcrumb';
|
|
32
|
-
import type { DrilldownMenuItemDetails } from './sidebar';
|
|
33
43
|
|
|
34
|
-
import {
|
|
35
|
-
BffCatalogEntity,
|
|
36
|
-
BffCatalogEntityList,
|
|
37
|
-
BffCatalogRelatedEntity,
|
|
38
|
-
BffCatalogRelatedEntityList,
|
|
39
|
-
BffCatalogEntityRevision,
|
|
40
|
-
BffCatalogEntityRevisionList,
|
|
41
|
-
} from './catalog';
|
|
42
|
-
import { AiSearchError } from '../constants/search';
|
|
44
|
+
import type { AiSearchError } from '../constants/search';
|
|
43
45
|
|
|
44
46
|
export type ThemeHooks = {
|
|
45
|
-
useAnchorPositioning: () => { isSupported: boolean };
|
|
46
47
|
useTranslate: () => { translate: TFunction };
|
|
47
48
|
useTranslationKeys: () => string[];
|
|
48
49
|
/**
|
|
@@ -25,9 +25,9 @@ export async function loadAndNavigate({
|
|
|
25
25
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
26
26
|
const loader = (window as any)['__LOADER'];
|
|
27
27
|
const result = await withLoadProgress(loader.tryLoad(pathname));
|
|
28
|
-
// @ts-
|
|
28
|
+
// @ts-expect-error
|
|
29
29
|
if (result?.redirectTo) {
|
|
30
|
-
// @ts-
|
|
30
|
+
// @ts-expect-error
|
|
31
31
|
return loadAndNavigate({ navigate, to: result.redirectTo, origin, options });
|
|
32
32
|
}
|
|
33
33
|
|
|
@@ -40,7 +40,7 @@ export async function loadAndNavigate({
|
|
|
40
40
|
unstable_flushSync: true,
|
|
41
41
|
} as NavigateOptions & { unstable_flushSync: boolean });
|
|
42
42
|
}
|
|
43
|
-
// @ts-
|
|
43
|
+
// @ts-expect-error
|
|
44
44
|
if (result.props?.disableAutoScroll) return;
|
|
45
45
|
|
|
46
46
|
if (hash) {
|
package/src/core/utils/mcp.ts
CHANGED
|
@@ -42,23 +42,6 @@ export function slugifyMcpServerName(name: string): string {
|
|
|
42
42
|
.replace(/^-+|-+$/g, '');
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
// Claude Desktop's config file only launches stdio commands, so remote servers
|
|
46
|
-
// connect through the mcp-remote bridge.
|
|
47
|
-
export function generateClaudeDesktopConfig(config: McpConnectionParams): string {
|
|
48
|
-
return JSON.stringify(
|
|
49
|
-
{
|
|
50
|
-
mcpServers: {
|
|
51
|
-
[slugifyMcpServerName(config.serverName)]: {
|
|
52
|
-
command: 'npx',
|
|
53
|
-
args: ['-y', 'mcp-remote', config.url],
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
null,
|
|
58
|
-
2,
|
|
59
|
-
);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
45
|
export function generateClaudeCodeCommand(config: McpConnectionParams): string {
|
|
63
46
|
return `claude mcp add --transport http ${slugifyMcpServerName(config.serverName)} ${config.url}`;
|
|
64
47
|
}
|
package/src/core/utils/menu.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { ResolvedNavItem, Version } from '@redocly/config';
|
|
2
2
|
import type { Location } from 'react-router';
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import type { Locale, TFunction } from '../types/l10n';
|
|
5
|
+
import type { ItemState } from '../types/sidebar';
|
|
6
6
|
import { MenuItemType } from '../constants/common';
|
|
7
7
|
import { getPathnameForLocale, withoutPathPrefix, withPathPrefix } from './urls';
|
|
8
8
|
|
package/src/core/utils/urls.ts
CHANGED
|
@@ -5,9 +5,7 @@ import { DEFAULT_LOCALE_PLACEHOLDER } from '../constants/common';
|
|
|
5
5
|
export function combineUrls(baseURL: string, ...relativeURLs: (string | undefined)[]) {
|
|
6
6
|
let res = baseURL;
|
|
7
7
|
for (let relativeURL of relativeURLs) {
|
|
8
|
-
res = relativeURL
|
|
9
|
-
? res.replace(/[\/\\]+$/, '') + '/' + relativeURL.replace(/^[\/\\]+/, '')
|
|
10
|
-
: res;
|
|
8
|
+
res = relativeURL ? res.replace(/[/\\]+$/, '') + '/' + relativeURL.replace(/^[/\\]+/, '') : res;
|
|
11
9
|
}
|
|
12
10
|
|
|
13
11
|
return res;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useEffect, useState, useCallback, useRef } from 'react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import type {
|
|
4
|
+
ConfigureRequestValues,
|
|
5
|
+
ConfigureServerRequestValues,
|
|
6
6
|
} from '@redocly/theme/ext/configure';
|
|
7
7
|
import type { UserClaims, OpenAPIServer, OpenAPIInfo } from '@redocly/theme/core/types';
|
|
8
8
|
|
|
@@ -14,7 +14,7 @@ export function OIDCForbidden(): JSX.Element {
|
|
|
14
14
|
|
|
15
15
|
// use whatever you want here
|
|
16
16
|
const URL_REGEX =
|
|
17
|
-
/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._
|
|
17
|
+
/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/;
|
|
18
18
|
|
|
19
19
|
const renderText = (text: string) =>
|
|
20
20
|
text.split(' ').map((part: string) =>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
|
|
4
|
-
import type { JSX } from 'react';
|
|
4
|
+
import type { JSX, PropsWithChildren } from 'react';
|
|
5
5
|
|
|
6
6
|
import { useThemeHooks } from '@redocly/theme/core/hooks';
|
|
7
7
|
import { ChevronUpIcon } from '@redocly/theme/icons/ChevronUpIcon/ChevronUpIcon';
|
|
@@ -9,10 +9,8 @@ import {
|
|
|
9
9
|
} from '@redocly/theme/core/contexts';
|
|
10
10
|
import { CodePanel } from '@redocly/theme/markdoc/components/CodeWalkthrough/CodePanel';
|
|
11
11
|
import { useCodeWalkthrough } from '@redocly/theme/core/hooks';
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
GetFilterState,
|
|
15
|
-
} from '@redocly/theme/markdoc/components/CodeWalkthrough/CodeFilters';
|
|
12
|
+
import type { GetFilterState } from '@redocly/theme/markdoc/components/CodeWalkthrough/CodeFilters';
|
|
13
|
+
import { CodeFilters } from '@redocly/theme/markdoc/components/CodeWalkthrough/CodeFilters';
|
|
16
14
|
|
|
17
15
|
export type CodeWalkthroughProps = PropsWithChildren<CodeWalkthroughAttr>;
|
|
18
16
|
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
1
|
+
import React, { useState, type JSX } from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
|
|
4
|
-
import type { JSX } from 'react';
|
|
5
|
-
|
|
6
4
|
import { concatClassNames } from '@redocly/theme/core/utils';
|
|
7
|
-
import { useColorSwitcher } from '@redocly/theme/core/hooks';
|
|
8
|
-
import { useThemeHooks } from '@redocly/theme/core/hooks';
|
|
5
|
+
import { useColorSwitcher, useThemeHooks } from '@redocly/theme/core/hooks';
|
|
9
6
|
import { SvgViewer } from '@redocly/theme/components/SvgViewer/SvgViewer';
|
|
10
7
|
|
|
11
8
|
type DiagramProps = {
|
|
@@ -3,7 +3,7 @@ import styled from 'styled-components';
|
|
|
3
3
|
|
|
4
4
|
import type { JSX } from 'react';
|
|
5
5
|
|
|
6
|
-
import { TabsSize } from '@redocly/theme/markdoc/components/Tabs/Tabs';
|
|
6
|
+
import type { TabsSize } from '@redocly/theme/markdoc/components/Tabs/Tabs';
|
|
7
7
|
import { TabButtonLink, TabItem } from '@redocly/theme/markdoc/components/Tabs/TabList';
|
|
8
8
|
import { GenericIcon } from '@redocly/theme/icons/GenericIcon/GenericIcon';
|
|
9
9
|
|
|
@@ -5,7 +5,7 @@ import type { JSX } from 'react';
|
|
|
5
5
|
import type { TabItemProps } from '@redocly/theme/markdoc/components/Tabs/TabItemFragment';
|
|
6
6
|
|
|
7
7
|
import { Tab } from '@redocly/theme/markdoc/components/Tabs/Tab';
|
|
8
|
-
import { TabsSize } from '@redocly/theme/markdoc/components/Tabs/Tabs';
|
|
8
|
+
import type { TabsSize } from '@redocly/theme/markdoc/components/Tabs/Tabs';
|
|
9
9
|
import { Dropdown } from '@redocly/theme/components/Dropdown/Dropdown';
|
|
10
10
|
import { DropdownMenu } from '@redocly/theme/components/Dropdown/DropdownMenu';
|
|
11
11
|
import { DropdownMenuItem } from '@redocly/theme/components/Dropdown/DropdownMenuItem';
|