Skip to content

Commit

Permalink
Merge pull request #4357 from serlo/enable-interactive-video
Browse files Browse the repository at this point in the history
feat(editor-package): enable interactive video
  • Loading branch information
elbotho authored Jan 27, 2025
2 parents 8daca5f + da784cc commit 5e1ef6f
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 1 deletion.
11 changes: 11 additions & 0 deletions packages/editor/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## Changelog for version 0.21.3

- fix(editor-help): content fixes, more videos. Thank you [@elbotho](https://github.com/elbotho) in https://github.com/serlo/frontend/pull/4423
- chore(deps): bump katex from 0.16.11 to 0.16.21. Thank you [@dependabot[bot]](https://github.com/dependabot[bot]) in https://github.com/serlo/frontend/pull/4421
- chore(deps-dev): bump vite from 5.4.11 to 5.4.12. Thank you [@dependabot[bot]](https://github.com/dependabot[bot]) in https://github.com/serlo/frontend/pull/4420
- feat(interactive-video): add basic privacy wrapper for serlo. Thank you [@elbotho](https://github.com/elbotho) in https://github.com/serlo/frontend/pull/4411
- fix(editor-help): small corrections. Thank you [@elbotho](https://github.com/elbotho) in https://github.com/serlo/frontend/pull/4408
- fix(interactive-video): another focus approach, remove rewind toggle. Thank you [@elbotho](https://github.com/elbotho) in https://github.com/serlo/frontend/pull/4400

**Full Changelog**: https://github.com/serlo/frontend/compare/v0.21.2-editor...v0.21.3-editor

## Changelog for version 0.21.2

- fix(editor-package): make testing secret optional & enable image (and related) plugins even if testing secret is missing. Thank you [@LarsTheGlidingSquirrel](https://github.com/LarsTheGlidingSquirrel) in https://github.com/serlo/frontend/pull/4405
Expand Down
2 changes: 1 addition & 1 deletion packages/editor/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@serlo/editor",
"version": "0.21.2",
"version": "0.21.3",
"homepage": "https://de.serlo.org/editor",
"bugs": {
"url": "https://github.com/serlo/frontend/issues"
Expand Down
20 changes: 20 additions & 0 deletions packages/editor/src/editor-integration/create-basic-plugins.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { geoGebraPlugin } from '@editor/plugins/geogebra'
import { createHighlightPlugin } from '@editor/plugins/highlight'
import { createImageGalleryPlugin } from '@editor/plugins/image-gallery'
import { createInputExercisePlugin } from '@editor/plugins/input-exercise'
import { interactiveVideoPlugin } from '@editor/plugins/interactive-video'
import { createMultimediaPlugin } from '@editor/plugins/multimedia'
import { createRowsPlugin } from '@editor/plugins/rows'
import { createScMcExercisePlugin } from '@editor/plugins/sc-mc-exercise'
Expand All @@ -26,6 +27,17 @@ import { TemplatePluginType } from '@editor/types/template-plugin-type'

import { createTestingImagePlugin } from './image-with-testing-config'

function isLocalOrDev() {
if (typeof window === 'undefined') return false
const host = window.location.hostname

return (
process.env.NODE_ENV === 'development' ||
host === 'editor.serlo.dev' ||
host === 'localhost'
)
}

export function createBasicPlugins(
plugins: (EditorPluginType | TemplatePluginType)[],
testingSecret?: string | null
Expand Down Expand Up @@ -114,6 +126,14 @@ export function createBasicPlugins(
type: EditorPluginType.DropzoneImage,
plugin: createDropzoneImagePlugin(),
},
...(isLocalOrDev()
? [
{
type: EditorPluginType.InteractiveVideo,
plugin: interactiveVideoPlugin,
},
]
: []),

// Special plugins, never visible in suggestions
// ===================================================
Expand Down
5 changes: 5 additions & 0 deletions packages/editor/src/editor-integration/create-renderers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { HighlightStaticRenderer } from '@editor/plugins/highlight/static'
import { ImageStaticRenderer } from '@editor/plugins/image/static'
import { ImageGalleryStaticRenderer } from '@editor/plugins/image-gallery/static'
import { InputExerciseStaticRenderer } from '@editor/plugins/input-exercise/static'
import { InteractiveVideoStaticRenderer } from '@editor/plugins/interactive-video/static'
import { MultimediaStaticRenderer } from '@editor/plugins/multimedia/static'
import { RowsStaticRenderer } from '@editor/plugins/rows/static'
import { ScMcExerciseStaticRenderer } from '@editor/plugins/sc-mc-exercise/static'
Expand Down Expand Up @@ -102,6 +103,10 @@ export function createRenderers(): InitRenderersArgs {
type: EditorPluginType.TextAreaExercise,
renderer: TextAreaExerciseStaticRenderer,
},
{
type: EditorPluginType.InteractiveVideo,
renderer: InteractiveVideoStaticRenderer,
},
{
type: EditorPluginType.EdusharingAsset,
renderer: EdusharingAssetStaticRenderer,
Expand Down
1 change: 1 addition & 0 deletions packages/editor/src/package/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export const defaultPlugins = [
EditorPluginType.ScMcExercise,
EditorPluginType.BlanksExercise,
EditorPluginType.DropzoneImage,
EditorPluginType.InteractiveVideo,
EditorPluginType.Solution,
EditorPluginType.Rows,
EditorPluginType.TextAreaExercise,
Expand Down

0 comments on commit 5e1ef6f

Please sign in to comment.