-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from Zero-True/text-components
Markdown and Text cells
- Loading branch information
Showing
16 changed files
with
540 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from .request import Request, ComponentRequest, DeleteRequest | ||
from .request import Request, ComponentRequest, DeleteRequest, CreateRequest | ||
from .response import Response | ||
from .notebook import Notebook | ||
from .components.slider import Slider | ||
|
||
__all__ = ['Request', 'Response', 'Slider', 'Notebook', 'ComponentRequest', 'DeleteRequest'] | ||
__all__ = ['Request', 'Response', 'Slider', 'Notebook', 'ComponentRequest', 'DeleteRequest', 'CreateRequest'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<template> | ||
<v-card flat> | ||
<quill-editor toolbar="essential" :options="options"/> | ||
<v-toolbar> | ||
<v-spacer/> | ||
<v-btn small color="primary" @click="deleteCell">Delete Cell</v-btn> | ||
</v-toolbar> | ||
</v-card> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import type { PropType } from 'vue' | ||
import { QuillEditor } from '@vueup/vue-quill' | ||
import '@vueup/vue-quill/dist/vue-quill.snow.css'; | ||
import { CodeCell } from '@/types/notebook'; | ||
export default { | ||
components: { | ||
'quill-editor': QuillEditor | ||
}, | ||
props: { | ||
cellData: { | ||
type: Object as PropType<CodeCell>, | ||
required: true, | ||
}, | ||
}, | ||
data() { | ||
return { | ||
options: { | ||
placeholder: this.cellData.code, | ||
theme: 'snow' | ||
} | ||
} | ||
}, | ||
methods: { | ||
deleteCell(){ | ||
this.$emit('deleteCell', this.cellData.id); | ||
} | ||
}, | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
.ql-container.ql-snow{ border: none !important;} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<template> | ||
<v-card flat> | ||
<ace-editor | ||
v-model:value="cellData.code" | ||
ref="editor" | ||
class="editor" | ||
theme="dracula" | ||
lang="markdown" | ||
:options="{ | ||
showPrintMargin: false, | ||
enableBasicAutocompletion: true, | ||
enableSnippets: true, | ||
enableLiveAutocompletion: true | ||
}" | ||
> | ||
</ace-editor> | ||
<Markdown :source="cellData.code" /> | ||
<v-toolbar> | ||
<v-spacer/> | ||
<v-btn small color="primary" @click="deleteCell">Delete Cell</v-btn> | ||
</v-toolbar> | ||
</v-card> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import type { PropType } from 'vue' | ||
import Markdown from 'vue3-markdown-it'; | ||
import { VAceEditor } from 'vue3-ace-editor'; | ||
import 'ace-builds/src-noconflict/mode-markdown'; | ||
import 'ace-builds/src-noconflict/snippets/markdown'; | ||
import 'ace-builds/src-noconflict/ext-language_tools'; | ||
import 'ace-builds/src-noconflict/theme-dracula'; | ||
import { CodeCell } from '@/types/notebook'; | ||
export default { | ||
components: { | ||
'ace-editor': VAceEditor, | ||
Markdown | ||
}, | ||
props: { | ||
cellData: { | ||
type: Object as PropType<CodeCell>, | ||
required: true, | ||
}, | ||
}, | ||
methods: { | ||
deleteCell(){ | ||
this.$emit('deleteCell', this.cellData.id); | ||
} | ||
}, | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
.editor { | ||
filter: none; | ||
height: 300px; | ||
width: 100%; | ||
margin-bottom: 20px; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* eslint-disable */ | ||
/** | ||
* This file was automatically generated by json-schema-to-typescript. | ||
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, | ||
* and run json-schema-to-typescript to regenerate this file. | ||
*/ | ||
|
||
export type Celltype = "code" | "markdown" | "text"; | ||
|
||
export interface CreateRequest { | ||
cellType: Celltype; | ||
[k: string]: unknown; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.