2020-09-25 04:40:19 -04:00
|
|
|
import React from 'react'
|
|
|
|
|
|
|
|
import OutlinePane from '../js/features/outline/components/outline-pane'
|
2020-12-14 06:44:10 -05:00
|
|
|
import { ContextRoot } from '../js/shared/context/root-context'
|
2021-01-21 07:22:28 -05:00
|
|
|
import { setupContext } from './fixtures/context'
|
2020-12-14 06:44:10 -05:00
|
|
|
|
2021-01-21 07:22:28 -05:00
|
|
|
setupContext()
|
2020-09-25 04:40:19 -04:00
|
|
|
|
|
|
|
export const Basic = args => <OutlinePane {...args} />
|
|
|
|
Basic.args = {
|
2021-04-27 03:52:58 -04:00
|
|
|
outline: [{ line: 1, title: 'Hello', level: 1 }],
|
2020-09-25 04:40:19 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
export const Nested = args => <OutlinePane {...args} />
|
|
|
|
Nested.args = {
|
|
|
|
outline: [
|
|
|
|
{
|
|
|
|
line: 1,
|
|
|
|
title: 'Section',
|
|
|
|
level: 1,
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
line: 2,
|
|
|
|
title: 'Subsection',
|
|
|
|
level: 2,
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
line: 3,
|
|
|
|
title: 'Subsubsection',
|
2021-04-27 03:52:58 -04:00
|
|
|
level: 3,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
2020-09-25 04:40:19 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
export const NoSections = args => <OutlinePane {...args} />
|
|
|
|
NoSections.args = {}
|
|
|
|
|
|
|
|
export const NonTexFile = args => <OutlinePane {...args} />
|
|
|
|
NonTexFile.args = {
|
2021-04-27 03:52:58 -04:00
|
|
|
isTexFile: false,
|
2020-09-25 04:40:19 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
export default {
|
|
|
|
title: 'Outline',
|
|
|
|
component: OutlinePane,
|
|
|
|
argTypes: {
|
2021-04-27 03:52:58 -04:00
|
|
|
jumpToLine: { action: 'jumpToLine' },
|
2020-09-25 04:40:19 -04:00
|
|
|
},
|
|
|
|
args: {
|
|
|
|
eventTracking: { sendMB: () => {} },
|
|
|
|
isTexFile: true,
|
|
|
|
outline: [],
|
|
|
|
jumpToLine: () => {},
|
2021-04-27 03:52:58 -04:00
|
|
|
onToggle: () => {},
|
2020-12-14 06:44:10 -05:00
|
|
|
},
|
|
|
|
decorators: [
|
|
|
|
Story => (
|
2021-04-28 04:46:39 -04:00
|
|
|
<ContextRoot ide={window._ide} settings={{}}>
|
2020-12-14 06:44:10 -05:00
|
|
|
<Story />
|
|
|
|
</ContextRoot>
|
2021-04-27 03:52:58 -04:00
|
|
|
),
|
|
|
|
],
|
2020-09-25 04:40:19 -04:00
|
|
|
}
|