2021-03-18 05:52:36 -04:00
|
|
|
import FileTreeCreateNameInput from '../../../js/features/file-tree/components/file-tree-create/file-tree-create-name-input'
|
|
|
|
import FileTreeCreateNameProvider from '../../../js/features/file-tree/contexts/file-tree-create-name'
|
|
|
|
import {
|
|
|
|
BlockedFilenameError,
|
2021-04-27 03:52:58 -04:00
|
|
|
DuplicateFilenameError,
|
2021-03-18 05:52:36 -04:00
|
|
|
} from '../../../js/features/file-tree/errors'
|
|
|
|
import { ModalBodyDecorator, ModalContentDecorator } from '../modal-decorators'
|
|
|
|
|
|
|
|
export const DefaultLabel = args => (
|
|
|
|
<FileTreeCreateNameProvider initialName="example.tex">
|
|
|
|
<FileTreeCreateNameInput {...args} />
|
|
|
|
</FileTreeCreateNameProvider>
|
|
|
|
)
|
|
|
|
|
|
|
|
export const CustomLabel = args => (
|
|
|
|
<FileTreeCreateNameProvider initialName="example.tex">
|
|
|
|
<FileTreeCreateNameInput {...args} />
|
|
|
|
</FileTreeCreateNameProvider>
|
|
|
|
)
|
|
|
|
CustomLabel.args = {
|
2021-04-27 03:52:58 -04:00
|
|
|
label: 'File Name in this Project',
|
2021-03-18 05:52:36 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
export const FocusName = args => (
|
|
|
|
<FileTreeCreateNameProvider initialName="example.tex">
|
|
|
|
<FileTreeCreateNameInput {...args} />
|
|
|
|
</FileTreeCreateNameProvider>
|
|
|
|
)
|
|
|
|
FocusName.args = {
|
2021-04-27 03:52:58 -04:00
|
|
|
focusName: true,
|
2021-03-18 05:52:36 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
export const CustomPlaceholder = args => (
|
|
|
|
<FileTreeCreateNameProvider>
|
|
|
|
<FileTreeCreateNameInput {...args} />
|
|
|
|
</FileTreeCreateNameProvider>
|
|
|
|
)
|
|
|
|
CustomPlaceholder.args = {
|
2021-04-27 03:52:58 -04:00
|
|
|
placeholder: 'Enter a file name…',
|
2021-03-18 05:52:36 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
export const DuplicateError = args => (
|
|
|
|
<FileTreeCreateNameProvider initialName="main.tex">
|
|
|
|
<FileTreeCreateNameInput {...args} />
|
|
|
|
</FileTreeCreateNameProvider>
|
|
|
|
)
|
|
|
|
DuplicateError.args = {
|
2021-04-27 03:52:58 -04:00
|
|
|
error: new DuplicateFilenameError(),
|
2021-03-18 05:52:36 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
export const BlockedError = args => (
|
|
|
|
<FileTreeCreateNameProvider initialName="main.tex">
|
|
|
|
<FileTreeCreateNameInput {...args} />
|
|
|
|
</FileTreeCreateNameProvider>
|
|
|
|
)
|
|
|
|
BlockedError.args = {
|
2021-04-27 03:52:58 -04:00
|
|
|
error: new BlockedFilenameError(),
|
2021-03-18 05:52:36 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
export default {
|
2022-03-28 06:23:21 -04:00
|
|
|
title: 'Editor / Modals / Create File / File Name Input',
|
2021-03-18 05:52:36 -04:00
|
|
|
component: FileTreeCreateNameInput,
|
2021-04-27 03:52:58 -04:00
|
|
|
decorators: [ModalBodyDecorator, ModalContentDecorator],
|
2021-03-18 05:52:36 -04:00
|
|
|
}
|