merge main
This commit is contained in:
commit
528e24e772
8 changed files with 78 additions and 19 deletions
32
.storybook/add-ons/canvas-docs/Tab.tsx
Normal file
32
.storybook/add-ons/canvas-docs/Tab.tsx
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
import React from 'react';
|
||||
import { useParameter, useStorybookState } from '@storybook/manager-api';
|
||||
import { AddonPanel } from '@storybook/components';
|
||||
import { PARAM_KEY } from './constants.ts';
|
||||
import * as Blocks from '@storybook/blocks';
|
||||
|
||||
interface PanelProps {
|
||||
active: boolean | undefined;
|
||||
}
|
||||
|
||||
const Tab: React.FC<PanelProps> = (props) => {
|
||||
const { storyId } = useStorybookState(); // Get the current story ID
|
||||
const markdownContent = useParameter<Record<string, string>>(PARAM_KEY, {});
|
||||
|
||||
// Fetch Markdown content specific to the current story
|
||||
const content =
|
||||
markdownContent[storyId] || 'No documentation provided for this story.';
|
||||
|
||||
console.log('PROPS', props);
|
||||
|
||||
return (
|
||||
<AddonPanel active={!!props.active}>
|
||||
<Blocks.Wrapper>
|
||||
<div style={{ padding: '15px' }} className="sbdocs sbdocs-content">
|
||||
<Blocks.Markdown>{content}</Blocks.Markdown>
|
||||
</div>
|
||||
</Blocks.Wrapper>
|
||||
</AddonPanel>
|
||||
);
|
||||
};
|
||||
|
||||
export default Tab;
|
||||
3
.storybook/add-ons/canvas-docs/constants.ts
Normal file
3
.storybook/add-ons/canvas-docs/constants.ts
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
export const ADDON_ID = 'storybook/canvas-docs';
|
||||
export const PANEL_ID = `${ADDON_ID}/panel`;
|
||||
export const PARAM_KEY = 'canvasDocs';
|
||||
13
.storybook/add-ons/canvas-docs/index.tsx
Normal file
13
.storybook/add-ons/canvas-docs/index.tsx
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import React from 'react';
|
||||
import { addons, types } from '@storybook/manager-api';
|
||||
import { ADDON_ID, PANEL_ID } from './constants';
|
||||
import Tab from './Tab';
|
||||
|
||||
addons.register(ADDON_ID, () => {
|
||||
addons.add(PANEL_ID, {
|
||||
type: types.PANEL,
|
||||
title: 'Docs',
|
||||
match: ({ viewMode }) => viewMode === 'story',
|
||||
render: (props) => <Tab {...props} />,
|
||||
});
|
||||
});
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
import { addons } from '@storybook/manager-api';
|
||||
import theme from './Theme';
|
||||
import './add-ons/canvas-docs';
|
||||
|
||||
addons.setConfig({
|
||||
isFullscreen: false,
|
||||
|
|
|
|||
12
CHANGELOG.md
12
CHANGELOG.md
|
|
@ -1,5 +1,17 @@
|
|||
# @reuters-graphics/graphics-components
|
||||
|
||||
## 2.0.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 50f4320: Updates favicons for new kinesis
|
||||
|
||||
## 2.0.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 64b6d88: Fix for changed thumbnail API schema
|
||||
|
||||
## 2.0.1
|
||||
|
||||
### Patch Changes
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@reuters-graphics/graphics-components",
|
||||
"version": "2.0.1",
|
||||
"version": "2.0.3",
|
||||
"type": "module",
|
||||
"private": false,
|
||||
"homepage": "https://reuters-graphics.github.io/graphics-components",
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ importers:
|
|||
specifier: ^0.0.3
|
||||
version: 0.0.3(svelte@5.28.1)
|
||||
'@sveltejs/kit':
|
||||
specifier: ^2.20.7
|
||||
specifier: ^2.0.0
|
||||
version: 2.20.7(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.28.1)(vite@6.3.2(@types/node@22.14.1)(jiti@2.4.2)(sass@1.86.3)(yaml@2.7.1)))(svelte@5.28.1)(vite@6.3.2(@types/node@22.14.1)(jiti@2.4.2)(sass@1.86.3)(yaml@2.7.1))
|
||||
dayjs:
|
||||
specifier: ^1.11.13
|
||||
|
|
|
|||
|
|
@ -136,28 +136,26 @@
|
|||
<title>{seoTitle}</title>
|
||||
<meta name="description" content={seoDescription} />
|
||||
<link rel="canonical" href={canonicalUrl} />
|
||||
<link
|
||||
rel="icon"
|
||||
type="image/png"
|
||||
href="https://graphics.thomsonreuters.com/style-assets/images/logos/favicon/favicon-96x96.png"
|
||||
sizes="96x96"
|
||||
/>
|
||||
<link
|
||||
rel="icon"
|
||||
type="image/svg+xml"
|
||||
href="https://graphics.thomsonreuters.com/style-assets/images/logos/favicon/kinesis.svg"
|
||||
/>
|
||||
<link
|
||||
rel="shortcut icon"
|
||||
type="image/x-icon"
|
||||
href="https://s3.reutersmedia.net/resources_v2/images/favicon/favicon.ico"
|
||||
href="https://graphics.thomsonreuters.com/style-assets/images/logos/favicon/favicon.ico"
|
||||
/>
|
||||
<link
|
||||
rel="icon"
|
||||
type="image/png"
|
||||
href="https://s3.reutersmedia.net/resources_v2/images/favicon/favicon-16x16.png"
|
||||
sizes="16x16"
|
||||
/>
|
||||
<link
|
||||
rel="icon"
|
||||
type="image/png"
|
||||
href="https://s1.reutersmedia.net/resources_v2/images/favicon/favicon-32x32.png"
|
||||
sizes="32x32"
|
||||
/>
|
||||
<link
|
||||
rel="icon"
|
||||
type="image/png"
|
||||
href="https://s3.reutersmedia.net/resources_v2/images/favicon/favicon-96x96.png"
|
||||
sizes="96x96"
|
||||
rel="apple-touch-icon"
|
||||
sizes="180x180"
|
||||
href="https://graphics.thomsonreuters.com/style-assets/images/logos/favicon/apple-touch-icon.png"
|
||||
/>
|
||||
|
||||
<meta property="og:url" content={canonicalUrl} />
|
||||
|
|
|
|||
Loading…
Reference in a new issue