2020-11-26 04:58:42 -05:00
|
|
|
|
import PreviewLogsPaneEntry from '../js/features/preview/components/preview-logs-pane-entry.js'
|
2021-01-21 07:21:22 -05:00
|
|
|
|
import Icon from '../js/shared/components/icon.js'
|
2020-11-05 05:22:05 -05:00
|
|
|
|
|
2021-01-21 07:21:22 -05:00
|
|
|
|
export const EntryWithCompilerOutput = args => (
|
2020-11-26 04:58:42 -05:00
|
|
|
|
<PreviewLogsPaneEntry {...args} />
|
|
|
|
|
)
|
2021-01-21 07:21:22 -05:00
|
|
|
|
EntryWithCompilerOutput.args = {
|
|
|
|
|
title: 'PreviewLogsPaneEntry/bar/baz',
|
2021-04-27 03:52:58 -04:00
|
|
|
|
level: 'error',
|
2020-11-05 05:22:05 -05:00
|
|
|
|
}
|
|
|
|
|
|
2021-01-21 07:21:22 -05:00
|
|
|
|
export const EntryWithCompilerOutputAndHumanReadableHint = args => (
|
2020-11-26 04:58:42 -05:00
|
|
|
|
<PreviewLogsPaneEntry {...args} />
|
2020-11-05 05:22:05 -05:00
|
|
|
|
)
|
2021-01-21 07:21:22 -05:00
|
|
|
|
EntryWithCompilerOutputAndHumanReadableHint.args = {
|
2020-11-05 05:22:05 -05:00
|
|
|
|
level: 'error',
|
2020-11-26 04:58:42 -05:00
|
|
|
|
formattedContent: <SampleHumanReadableHintComponent />,
|
2020-11-05 05:22:05 -05:00
|
|
|
|
extraInfoURL:
|
2021-04-27 03:52:58 -04:00
|
|
|
|
'https://www.overleaf.com/learn/latex/Errors/Extra_alignment_tab_has_been_changed_to_%5Ccr',
|
2020-11-05 05:22:05 -05:00
|
|
|
|
}
|
|
|
|
|
|
2021-01-21 07:21:22 -05:00
|
|
|
|
export const EntryWithoutCompilerOutput = args => (
|
2020-11-26 04:58:42 -05:00
|
|
|
|
<PreviewLogsPaneEntry {...args} />
|
|
|
|
|
)
|
2021-01-21 07:21:22 -05:00
|
|
|
|
EntryWithoutCompilerOutput.args = {
|
2020-11-05 05:22:05 -05:00
|
|
|
|
level: 'error',
|
2021-04-27 03:52:58 -04:00
|
|
|
|
rawContent: null,
|
2020-11-05 05:22:05 -05:00
|
|
|
|
}
|
|
|
|
|
|
2021-01-21 07:21:22 -05:00
|
|
|
|
export const EntryWithoutSourceLocationLink = args => (
|
2020-11-26 04:58:42 -05:00
|
|
|
|
<PreviewLogsPaneEntry {...args} />
|
|
|
|
|
)
|
2021-01-21 07:21:22 -05:00
|
|
|
|
EntryWithoutSourceLocationLink.args = {
|
|
|
|
|
level: 'error',
|
2021-04-27 03:52:58 -04:00
|
|
|
|
showSourceLocationLink: false,
|
2021-01-21 07:21:22 -05:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const EntryWithLevelError = args => <PreviewLogsPaneEntry {...args} />
|
|
|
|
|
EntryWithLevelError.args = {
|
2021-04-27 03:52:58 -04:00
|
|
|
|
level: 'error',
|
2021-01-21 07:21:22 -05:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const EntryWithLevelWarning = args => <PreviewLogsPaneEntry {...args} />
|
|
|
|
|
EntryWithLevelWarning.args = {
|
2021-04-27 03:52:58 -04:00
|
|
|
|
level: 'warning',
|
2020-11-05 05:22:05 -05:00
|
|
|
|
}
|
|
|
|
|
|
2021-01-21 07:21:22 -05:00
|
|
|
|
export const EntryWithLevelTypesetting = args => (
|
2020-11-26 04:58:42 -05:00
|
|
|
|
<PreviewLogsPaneEntry {...args} />
|
2020-11-05 05:22:05 -05:00
|
|
|
|
)
|
2021-01-21 07:21:22 -05:00
|
|
|
|
EntryWithLevelTypesetting.args = {
|
2021-04-27 03:52:58 -04:00
|
|
|
|
level: 'typesetting',
|
2020-11-05 05:22:05 -05:00
|
|
|
|
}
|
|
|
|
|
|
2021-01-21 07:21:22 -05:00
|
|
|
|
export const EntryWithLevelRaw = args => <PreviewLogsPaneEntry {...args} />
|
|
|
|
|
EntryWithLevelRaw.args = {
|
2021-04-27 03:52:58 -04:00
|
|
|
|
level: 'raw',
|
2020-11-05 05:22:05 -05:00
|
|
|
|
}
|
|
|
|
|
|
2021-01-21 07:21:22 -05:00
|
|
|
|
export const EntryWithLevelSuccess = args => <PreviewLogsPaneEntry {...args} />
|
|
|
|
|
EntryWithLevelSuccess.args = {
|
2021-04-27 03:52:58 -04:00
|
|
|
|
level: 'success',
|
2020-11-05 05:22:05 -05:00
|
|
|
|
}
|
|
|
|
|
|
2021-01-21 07:21:22 -05:00
|
|
|
|
export const EntryWithButtonToClose = args => <PreviewLogsPaneEntry {...args} />
|
|
|
|
|
EntryWithButtonToClose.args = {
|
|
|
|
|
level: 'error',
|
|
|
|
|
showCloseButton: true,
|
2021-04-27 03:52:58 -04:00
|
|
|
|
onClose: () => window.alert('You clicked "×"'),
|
2020-11-05 05:22:05 -05:00
|
|
|
|
}
|
|
|
|
|
|
2021-01-21 07:21:22 -05:00
|
|
|
|
export const EntryWithIcon = args => <PreviewLogsPaneEntry {...args} />
|
|
|
|
|
EntryWithIcon.args = {
|
|
|
|
|
level: 'error',
|
2021-04-27 03:52:58 -04:00
|
|
|
|
headerIcon: <Icon type="taxi" />,
|
2021-01-21 07:21:22 -05:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const EntryWithBetaIcon = args => <PreviewLogsPaneEntry {...args} />
|
|
|
|
|
EntryWithBetaIcon.args = {
|
2020-11-05 05:22:05 -05:00
|
|
|
|
level: 'typesetting',
|
2021-04-27 03:52:58 -04:00
|
|
|
|
headerIcon: <span className="beta-badge" />,
|
2020-11-05 05:22:05 -05:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function SampleHumanReadableHintComponent() {
|
|
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
Human-readable hint to help LaTeX newbies. Supports <b>mark-up</b> for
|
|
|
|
|
e.g.{' '}
|
|
|
|
|
<a
|
|
|
|
|
target="_blank"
|
|
|
|
|
rel="noopener noreferrer"
|
|
|
|
|
href="https://www.overleaf.com/learn/latex/Errors/Extra_alignment_tab_has_been_changed_to_%5Ccr"
|
|
|
|
|
>
|
|
|
|
|
inline links
|
|
|
|
|
</a>
|
|
|
|
|
.
|
|
|
|
|
</>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default {
|
2021-04-30 16:20:16 -04:00
|
|
|
|
title: 'Preview Logs / Entry',
|
2020-11-26 04:58:42 -05:00
|
|
|
|
component: PreviewLogsPaneEntry,
|
2020-11-05 05:22:05 -05:00
|
|
|
|
args: {
|
2020-11-26 04:58:42 -05:00
|
|
|
|
sourceLocation: {
|
|
|
|
|
file: 'foo/bar.tex',
|
|
|
|
|
line: 10,
|
2021-04-27 03:52:58 -04:00
|
|
|
|
column: 20,
|
2020-11-26 04:58:42 -05:00
|
|
|
|
},
|
2021-01-21 07:21:22 -05:00
|
|
|
|
headerTitle: 'Entry title',
|
2020-11-26 04:58:42 -05:00
|
|
|
|
rawContent: `
|
2020-11-05 05:22:05 -05:00
|
|
|
|
The LaTeX compiler output
|
|
|
|
|
* With a lot of details
|
|
|
|
|
|
2021-04-30 16:20:16 -04:00
|
|
|
|
Wrapped in an HTML <pre> element with
|
2020-11-05 05:22:05 -05:00
|
|
|
|
preformatted text which is to be presented exactly
|
|
|
|
|
as written in the HTML file
|
|
|
|
|
|
|
|
|
|
(whitespace included™)
|
|
|
|
|
|
|
|
|
|
The text is typically rendered using a non-proportional ("monospace") font.
|
|
|
|
|
|
|
|
|
|
LaTeX Font Info: External font \`cmex10' loaded for size
|
|
|
|
|
(Font) <7> on input line 18.
|
|
|
|
|
LaTeX Font Info: External font \`cmex10' loaded for size
|
|
|
|
|
(Font) <5> on input line 18.
|
|
|
|
|
! Undefined control sequence.
|
|
|
|
|
<recently read> \\Zlpha
|
|
|
|
|
|
|
|
|
|
main.tex, line 23
|
2021-04-30 16:20:16 -04:00
|
|
|
|
|
2021-04-27 03:52:58 -04:00
|
|
|
|
`,
|
|
|
|
|
},
|
2020-11-05 05:22:05 -05:00
|
|
|
|
}
|