+ ];
+}
+
+/**
+ * @returns {({extension: Extension}|readonly Extension[])[]}
+ */
+function getDynamicActiveLineHighlighter() {
+ const highlightingCompartment = new Compartment();
+ const domEvents = {
+ focus(event, view) {
+ view.dispatch({
+ effects: highlightingCompartment.reconfigure([
+ highlightActiveLineGutter(),
+ highlightActiveLine(),
+ ]),
+ });
+ },
+ blur(event, view) {
+ view.dispatch({
+ effects: highlightingCompartment.reconfigure([]),
+ });
+ },
+ };
+
+ return [
+ highlightingCompartment.of([]),
+ EditorView.domEventHandlers(domEvents),
+ ];
+}
+
+/**
+ * @param {Element} parentEl
+ * @return {*[]}
+ */
+export function viewerExtensions(parentEl) {
+ return [
+ ...common(parentEl),
+ getDynamicActiveLineHighlighter(),
+ keymap.of([
+ ...defaultKeymap,
+ ]),
+ EditorState.readOnly.of(true),
+ ];
+}
+
+/**
+ * @param {Element} parentEl
+ * @return {*[]}
+ */
+export function editorExtensions(parentEl) {
+ return [
+ ...common(parentEl),
+ highlightActiveLineGutter(),