Skip to content

Commit 5c01c02

Browse files
authored
scribe build fix (#260)
1 parent b6daf82 commit 5c01c02

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

packages/scribe/src/components/Editor.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { Usj } from "@biblionexus-foundation/scripture-utilities";
2-
import { MarkNode } from "@lexical/mark";
32
import { AutoFocusPlugin } from "@lexical/react/LexicalAutoFocusPlugin";
43
import { LexicalComposer } from "@lexical/react/LexicalComposer";
54
import { ContentEditable } from "@lexical/react/LexicalContentEditable";
@@ -86,7 +85,7 @@ const Editor = forwardRef(function Editor(
8685
onError(error: Error) {
8786
throw error;
8887
},
89-
nodes: [MarkNode, ImmutableNoteCallerNode, ImmutableVerseNode, ...scriptureUsjNodes],
88+
nodes: [ImmutableNoteCallerNode, ImmutableVerseNode, ...scriptureUsjNodes],
9089
};
9190

9291
useImperativeHandle(ref, () => ({

packages/scribe/src/components/Toolbar.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ import "./Toolbar.css";
77
import { getUsjMarkerAction } from "../adaptors/usj-marker-action.utils";
88
import { InsertDialog } from "./Input/TextInput";
99
import { ScriptureReference } from "shared/utils/get-marker-action.model";
10+
import { ViewOptions } from "../adaptors/view-options.utils";
1011

1112
export const Toolbar = ({
1213
scrRef,
1314
viewOptions,
1415
autoNumbering = false,
1516
}: {
1617
scrRef: ScriptureReference;
17-
viewOptions?: any;
18+
viewOptions?: ViewOptions;
1819
autoNumbering?: boolean;
1920
}) => {
2021
const [modal, showModal] = useModal();
@@ -23,7 +24,14 @@ export const Toolbar = ({
2324
const [editor] = useLexicalComposerContext();
2425
const [isEditable, setIsEditable] = useState(true);
2526

26-
const insertOptions = [
27+
type InsertOption = {
28+
title: string;
29+
marker: string;
30+
requiresValue: boolean;
31+
placeholder?: string; // Optional since not all items have it
32+
};
33+
34+
const insertOptions: InsertOption[] = [
2735
{
2836
title: "Verse",
2937
marker: "v",
@@ -81,7 +89,7 @@ export const Toolbar = ({
8189
editor.dispatchCommand(REDO_COMMAND, undefined);
8290
};
8391

84-
const handleInsertOption = (option: any) => {
92+
const handleInsertOption = (option: InsertOption) => {
8593
setIsDropdownOpen(false);
8694

8795
if (option.requiresValue) {

0 commit comments

Comments
 (0)