+ Ein neues Tool in der Editor-Toolbar um direkt Anker-Links auf + Editor-Plugins in die Zwischenablage zu kopieren. Wichtig: + Funktioniert nur, wenn der Inhalt ab Juli 2023 eine neue Revision + erhalten hat. +
+
- {mathStrings.fraction}:
- {mathStrings.superscript}:
- {mathStrings.subscript}:
- π, α, β, γ:
- ≤, ≥:
- {mathStrings.root}:
- {mathStrings.mathSymbols}:
- {mathStrings.functions}:
+ {hasError ? mathStrings.onlyLatex : mathStrings.latexEditorTitle} +
+ {!useVisualEditor && ( +- {editorStrings.plugins.box.anchorId}: #{anchorId.value} -
- )} - > - ) - } - function renderSettingsLis() { return types.map((boxType) => { const typedBoxType = boxType as BoxType diff --git a/src/serlo-editor/plugins/box/renderer.tsx b/src/serlo-editor/plugins/box/renderer.tsx index 41e4170b38..75fc250fc7 100644 --- a/src/serlo-editor/plugins/box/renderer.tsx +++ b/src/serlo-editor/plugins/box/renderer.tsx @@ -46,7 +46,7 @@ interface BoxProps { title?: JSX.Element | string } -export function Renderer({ boxType, title, anchorId, children }: BoxProps) { +export function BoxRenderer({ boxType, title, anchorId, children }: BoxProps) { const { strings } = useInstanceData() if (!children || !boxType) return null diff --git a/src/serlo-editor/plugins/box/toolbar.tsx b/src/serlo-editor/plugins/box/toolbar.tsx new file mode 100644 index 0000000000..9fa508dc1e --- /dev/null +++ b/src/serlo-editor/plugins/box/toolbar.tsx @@ -0,0 +1,47 @@ +import { BoxProps } from '.' +import { BoxType, types } from './renderer' +import { useInstanceData } from '@/contexts/instance-context' +import { useEditorStrings } from '@/contexts/logged-in-data-context' +import { tw } from '@/helper/tw' +import { EditorTooltip } from '@/serlo-editor/editor-ui/editor-tooltip' +import { PluginToolbar } from '@/serlo-editor/editor-ui/plugin-toolbar' +import { PluginDefaultTools } from '@/serlo-editor/editor-ui/plugin-toolbar/plugin-tool-menu/plugin-default-tools' +import { EditorPluginType } from '@/serlo-editor-integration/types/editor-plugin-type' + +export const BoxToolbar = ({ id, state }: BoxProps) => { + const boxStrings = useEditorStrings().plugins.box + const { strings } = useInstanceData() + + return ( +{step.explanation.render({ config: { + isInlineChildEditor: true, placeholder: row === 0 && transformationTarget === TransformationTarget.Term @@ -268,7 +262,7 @@ export function EquationsEditor(props: EquationsProps) { {renderAddButton()} - > + ) function renderFirstExplanation() { @@ -281,6 +275,7 @@ export function EquationsEditor(props: EquationsProps) { {state.firstExplanation.render({ config: { placeholder: equationsStrings.firstExplanation, + isInlineChildEditor: true, }, })} | @@ -355,262 +350,13 @@ export function EquationsEditor(props: EquationsProps) { } } -interface StepEditorProps { - gridFocus: GridFocus - row: number - state: StateTypeReturnType gridFocus.setFocus({ row, column: StepSegment.Left })}
- >
- |
- )}
- - {(transformationTarget === 'equation' || row !== 0) && ( - - )} - | - gridFocus.setFocus({ row, column: StepSegment.Right })}
- >
- |
- {transformationTarget === TransformationTarget.Equation && (
-
- gridFocus.setFocus({ row, column: StepSegment.Transform })
- }
- >
- |{' '}
- |
- )}
- >
- )
-}
-
-interface InlineMathProps {
- state: StateTypeReturnType gridFocus.setFocus({ row, column: StepSegment.Left })}
+ >
+ |
+ )}
+ + {(transformationTarget === 'equation' || row !== 0) && ( + + )} + | + gridFocus.setFocus({ row, column: StepSegment.Right })}
+ >
+ |
+ {transformationTarget === TransformationTarget.Equation && (
+
+ gridFocus.setFocus({ row, column: StepSegment.Transform })
+ }
+ >
+ |{' '}
+ |
+ )}
+ >
+ )
+}
diff --git a/src/serlo-editor/plugins/equations/index.ts b/src/serlo-editor/plugins/equations/index.ts
index 050cfdf10f..a8a82e5442 100644
--- a/src/serlo-editor/plugins/equations/index.ts
+++ b/src/serlo-editor/plugins/equations/index.ts
@@ -1,4 +1,4 @@
-import { EquationsEditor } from './editor'
+import { EquationsEditor } from './editor/editor'
import { Sign } from './sign'
import {
child,
diff --git a/src/serlo-editor/plugins/equations/toolbar.tsx b/src/serlo-editor/plugins/equations/toolbar.tsx
new file mode 100644
index 0000000000..87682d7def
--- /dev/null
+++ b/src/serlo-editor/plugins/equations/toolbar.tsx
@@ -0,0 +1,36 @@
+import { EquationsProps } from '.'
+import { TransformationTarget } from './editor/editor-renderer'
+import { useEditorStrings } from '@/contexts/logged-in-data-context'
+import { tw } from '@/helper/tw'
+import { PluginToolbar } from '@/serlo-editor/editor-ui/plugin-toolbar'
+import { PluginDefaultTools } from '@/serlo-editor/editor-ui/plugin-toolbar/plugin-tool-menu/plugin-default-tools'
+import { EditorPluginType } from '@/serlo-editor-integration/types/editor-plugin-type'
+
+export const EquationsToolbar = ({ id, state }: EquationsProps) => {
+ const equationsStrings = useEditorStrings().plugins.equations
+
+ return (
+