forked from Simon-Initiative/oli-torus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'Simon-Initiative:master' into master
- Loading branch information
Showing
92 changed files
with
4,982 additions
and
698 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports = { | ||
ReactMarkdown: function ({ children }) { | ||
return children; | ||
} | ||
} |
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,20 @@ | ||
@import "@uiw/react-md-editor/markdown-editor"; | ||
@import "@uiw/react-markdown-preview/markdown"; | ||
|
||
.wmde-markdown-color, | ||
textarea.w-md-editor-text-input { | ||
/* Really want a fixed-width font while editing */ | ||
--md-editor-font-family: Consolas, "Courier New", monospace; | ||
} | ||
|
||
.wmde-markdown ul { | ||
list-style: disc; | ||
} | ||
|
||
.wmde-markdown ol { | ||
list-style: decimal; | ||
} | ||
|
||
.w-md-editor .w-md-editor-content { | ||
min-height: 2.1rem; | ||
} |
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 was deleted.
Oops, something went wrong.
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
23 changes: 18 additions & 5 deletions
23
assets/src/components/activities/common/explanation/ExplanationAuthoring.tsx
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,19 +1,32 @@ | ||
import React from 'react'; | ||
import { useAuthoringElementContext } from 'components/activities/AuthoringElementProvider'; | ||
import { HasParts, RichText } from 'components/activities/types'; | ||
import { RichTextEditorConnected } from 'components/content/RichTextEditor'; | ||
import { getExplanationContent, setExplanationContent } from 'data/activities/model/explanation'; | ||
import { SlateOrMarkdownEditor } from 'components/editing/SlateOrMarkdownEditor'; | ||
import { | ||
getExplanationContent, | ||
getExplanationEditor, | ||
setExplanationContent, | ||
setExplanationEditor, | ||
} from 'data/activities/model/explanation'; | ||
import { EditorType } from 'data/content/resource'; | ||
|
||
interface Props { | ||
partId: string; | ||
} | ||
export const Explanation: React.FC<Props> = (props) => { | ||
const { dispatch, model } = useAuthoringElementContext<HasParts>(); | ||
const { dispatch, model, projectSlug } = useAuthoringElementContext<HasParts>(); | ||
return ( | ||
<RichTextEditorConnected | ||
<SlateOrMarkdownEditor | ||
placeholder="Explanation" | ||
value={getExplanationContent(model, props.partId)} | ||
content={getExplanationContent(model, props.partId)} | ||
onEdit={(content: RichText) => dispatch(setExplanationContent(props.partId, content))} | ||
onEditorTypeChange={(editor: EditorType) => | ||
dispatch(setExplanationEditor(props.partId, editor)) | ||
} | ||
editMode={true} | ||
editorType={getExplanationEditor(model, props.partId)} | ||
allowBlockElements={true} | ||
projectSlug={projectSlug} | ||
/> | ||
); | ||
}; |
Oops, something went wrong.