Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { DeprecatedPlugin, string } from '@edtr-io/plugin'
import { createIcon, faCubes } from '@edtr-io/ui'
import * as React from 'react'
import { GeogebraEditor } from './editor'
import { GeogebraRenderer } from './renderer'
export const geogebraState = string()
export const geogebraPlugin: DeprecatedPlugin = {
//eslint-disable-next-line react/display-name
Component: props =>
props.editable ? (
) : (
),
state: geogebraState,
title: 'Geogebra Applet',
description: 'Binde Applets von Geogebratube via Link oder ID ein.',
icon: createIcon(faCubes),
onPaste(clipboardData: DataTransfer) {
const value = clipboardData.getData('text')
if (/geogebra\.org\/m\/(.+)/.test(value)) {
import { Plugin, string } from '@edtr-io/plugin'
import { createIcon, faNewspaper } from '@edtr-io/ui'
import { SerloInjectionEditor } from './editor'
export const serloInjectionState = string()
export const serloInjectionPlugin: Plugin = {
Component: SerloInjectionEditor,
state: serloInjectionState,
title: 'Serlo Inhalt',
description: 'Binde einen Inhalt von serlo.org via ID ein',
icon: createIcon(faNewspaper)
}
import { Plugin, string, object, migratable } from '@edtr-io/plugin'
import { createIcon, faFilm } from '@edtr-io/ui'
import * as React from 'react'
import { VideoEditor } from './editor'
import { VideoRenderer } from './renderer'
const stateV0 = string()
const stateV1 = object({ src: string(), alt: string() })
export const videoState = migratable(stateV0).migrate(stateV1, src => {
return { src, alt: '' }
})
export const videoPlugin: Plugin = {
//eslint-disable-next-line react/display-name
Component: props =>
props.editable ? : ,
state: videoState,
title: 'Video',
description: 'Binde Videos von Youtube, Vimeo, Wikimedia und BR ein.',
icon: createIcon(faFilm),
onPaste(clipboardData: DataTransfer) {
const value = clipboardData.getData('text')
import { child, object, list, Plugin, string, boolean } from '@edtr-io/plugin'
import { createIcon, faCheckSquare } from '@edtr-io/ui'
import { SolutionStepsEditor } from './editor'
export const solutionStep = object({
type: string('step'),
isHalf: boolean(),
content: child('rows')
})
export const solutionStepsState = object({
introduction: child('text'),
strategy: child('rows'),
hasStrategy: boolean(),
solutionSteps: list(solutionStep),
additionals: child('rows'),
hasAdditionals: boolean()
})
export const solutionStepsPlugin: Plugin = {
Component: SolutionStepsEditor,
state: solutionStepsState,
import { Plugin, string } from '@edtr-io/plugin'
import * as React from 'react'
import ReactMarkdown from 'react-markdown'
import { createTableEditor } from './editor'
export const tableState = string()
export function createTablePlugin(
config: TablePluginConfig
): Plugin {
return {
Component: createTableEditor(config),
state: tableState,
title: 'Tabelle',
description: 'Erstelle eine Tabelle mit Markdown.'
}
}
export const tablePlugin = createTablePlugin({
renderMarkdown: function RenderMarkdown(markdown) {
return
}
import { string, StatefulPlugin } from '@edtr-io/plugin'
import * as React from 'react'
import ReactMarkdown from 'react-markdown'
import { createTableEditor } from './editor'
export const tableState = string()
export function createTablePlugin(
config: TablePluginConfig
): StatefulPlugin {
return {
Component: createTableEditor(config),
state: tableState,
title: 'Tabelle',
description: 'Erstelle eine Tabelle mit Markdown.'
}
}
export const tablePlugin = createTablePlugin({
renderMarkdown: function RenderMarkdown(markdown) {
return
}