Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ updates:
open-pull-requests-limit: 0
exclude-paths:
# Copied in from another repo and only used for testing when running the demo
- "/demos/platform/lib/**"
- "demos/platform/lib/**"
12 changes: 6 additions & 6 deletions demos/perf-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
"react-dom": ">=18.3.1"
},
"dependencies": {
"@lexical/headless": "^0.40.0",
"@lexical/html": "^0.40.0",
"@lexical/react": "^0.40.0",
"@lexical/selection": "^0.40.0",
"@lexical/utils": "^0.40.0",
"@lexical/headless": "^0.41.0",
"@lexical/html": "^0.41.0",
"@lexical/react": "^0.41.0",
"@lexical/selection": "^0.41.0",
"@lexical/utils": "^0.41.0",
"base-64": "^1.0.0",
"epitelete-html": "^0.2.21-beta.2",
"json-difference": "^1.16.1",
"lexical": "^0.40.0",
"lexical": "^0.41.0",
"open-patcher": "1.0.0-beta.1",
"proskomma-core": "^0.11.3",
"pure-uuid": "^1.8.1"
Expand Down
4 changes: 2 additions & 2 deletions demos/perf-vanilla/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"dev": "vite"
},
"dependencies": {
"@lexical/rich-text": "^0.40.0",
"lexical": "^0.40.0"
"@lexical/rich-text": "^0.41.0",
"lexical": "^0.41.0"
},
"devDependencies": {
"shared": "workspace:~",
Expand Down
6 changes: 3 additions & 3 deletions demos/platform/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
"dependencies": {
"@eten-tech-foundation/platform-editor": "workspace:~",
"@eten-tech-foundation/scripture-utilities": "workspace:~",
"@sillsdev/scripture": "^2.0.3",
"lucide-react": "^0.475.0"
"@sillsdev/scripture": "^2.0.4",
"lucide-react": "^0.577.0"
},
"devDependencies": {
"platform-bible-react": "file:./lib/platform-bible-react",
"platform-bible-utils": "file:./lib/platform-bible-utils",
"tailwindcss": "4.1.18",
"tailwindcss": "4.2.1",
"tailwindcss-animate": "1.0.7",
"test-data": "workspace:~"
},
Expand Down
16 changes: 3 additions & 13 deletions demos/platform/src/app/DropDown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,21 +105,11 @@ function DropDownItems({
}
};

const contextValue = useMemo(
() => ({
registerItem,
}),
[registerItem],
);
const contextValue = useMemo(() => ({ registerItem }), [registerItem]);

useEffect(() => {
if (items && !highlightedItem) {
setHighlightedItem(items[0]);
}

if (highlightedItem && highlightedItem.current) {
highlightedItem.current.focus();
}
const activeItem = highlightedItem ?? items?.[0];
if (activeItem?.current) activeItem.current.focus();
}, [items, highlightedItem]);

return (
Expand Down
8 changes: 2 additions & 6 deletions demos/platform/src/app/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,7 @@ export default function App() {
if (viewMode === UNDEFINED_VIEW_MODE) return undefined;
if (viewMode === CUSTOM_VIEW_MODE) return { markerMode, noteMode, hasSpacing, isFormattedFont };

const _viewOptions = getViewOptions(viewMode);
setMarkerMode(_viewOptions?.markerMode ?? "hidden");
setNoteMode(_viewOptions?.noteMode ?? "collapsed");
setHasSpacing(_viewOptions?.hasSpacing ?? true);
setIsFormattedFont(_viewOptions?.isFormattedFont ?? true);
return _viewOptions;
return getViewOptions(viewMode);
}, [viewMode, markerMode, noteMode, hasSpacing, isFormattedFont]);

const customNodeOptions = useMemo<UsjNodeOptions>(
Expand Down Expand Up @@ -205,6 +200,7 @@ export default function App() {

const formattedNodeOptions = useMemo(
() =>
// eslint-disable-next-line react-hooks/refs -- Debug-only serialization must reflect the live nodeOptions object, including callable fields.
JSON.stringify(nodeOptions, (_key, value) =>
typeof value === "function" ? "<Function>" : value,
)
Expand Down
10 changes: 5 additions & 5 deletions libs/shared-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@
},
"dependencies": {
"@eten-tech-foundation/scripture-utilities": "workspace:~",
"@floating-ui/dom": "^1.7.5",
"@lexical/react": "^0.40.0",
"@lexical/utils": "^0.40.0",
"fast-equals": "^5.2.2",
"lexical": "^0.40.0",
"@floating-ui/dom": "^1.7.6",
"@lexical/react": "^0.41.0",
"@lexical/utils": "^0.41.0",
"fast-equals": "^5.4.0",
"lexical": "^0.41.0",
"quill-delta": "^5.1.0"
},
"devDependencies": {
Expand Down
2 changes: 2 additions & 0 deletions libs/shared-react/src/plugins/usj/ContextMenuPlugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ function ContextMenuItem({
onMouseEnter: () => void;
option: ContextMenuOption;
}) {
/* eslint-disable react-hooks/refs -- Lexical MenuOption API stores interaction fields on option instances consumed during render. */
let className = "item";
if (isSelected) {
className += " selected";
Expand All @@ -60,6 +61,7 @@ function ContextMenuItem({
<span className="text">{option.title}</span>
</li>
);
/* eslint-enable react-hooks/refs */
}

function ContextMenu({
Expand Down
9 changes: 7 additions & 2 deletions libs/shared-react/src/plugins/usj/react-test.utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
LexicalNode,
SerializedEditorState,
} from "lexical";
import { ReactNode } from "react";
import { ReactNode, useEffect } from "react";
import { segmentState, SerializedNoteNode, SerializedParaNode, TypedMarkNode } from "shared";

export async function baseTestEnvironment(
Expand All @@ -36,7 +36,12 @@ export async function baseTestEnvironment(
let editor: LexicalEditor;

function GrabEditor() {
[editor] = useLexicalComposerContext();
const [composerEditor] = useLexicalComposerContext();

useEffect(() => {
editor = composerEditor;
}, [composerEditor]);

return null;
}

Expand Down
8 changes: 4 additions & 4 deletions libs/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
},
"dependencies": {
"@eten-tech-foundation/scripture-utilities": "workspace:~",
"@lexical/mark": "^0.40.0",
"@lexical/utils": "^0.40.0",
"@sillsdev/scripture": "^2.0.3",
"lexical": "^0.40.0",
"@lexical/mark": "^0.41.0",
"@lexical/utils": "^0.41.0",
"@sillsdev/scripture": "^2.0.4",
"lexical": "^0.41.0",
"tslib": "^2.8.1"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion libs/test-data/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"dependencies": {
"@eten-tech-foundation/scripture-utilities": "workspace:~",
"lexical": "^0.40.0",
"lexical": "^0.41.0",
"tslib": "^2.8.1"
}
}
65 changes: 32 additions & 33 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,63 +13,62 @@
"devDependencies": {
"@babel/core": "^7.29.0",
"@babel/preset-react": "^7.28.5",
"@eslint/js": "^9.39.2",
"@lexical/eslint-plugin": "^0.40.0",
"@microsoft/api-extractor": "^7.56.3",
"@nx/eslint": "22.5.1",
"@nx/eslint-plugin": "22.5.1",
"@nx/js": "22.5.1",
"@nx/plugin": "22.5.1",
"@nx/react": "22.5.1",
"@nx/vite": "22.5.1",
"@nx/vitest": "22.5.1",
"@nx/web": "22.5.1",
"@eslint/js": "^9.39.4",
"@lexical/eslint-plugin": "^0.41.0",
"@microsoft/api-extractor": "^7.57.6",
"@nx/eslint": "22.5.4",
"@nx/eslint-plugin": "22.5.4",
"@nx/js": "22.5.4",
"@nx/plugin": "22.5.4",
"@nx/react": "22.5.4",
"@nx/vite": "22.5.4",
"@nx/vitest": "22.5.4",
"@nx/web": "22.5.4",
"@swc-node/register": "1.11.1",
"@swc/cli": "0.7.10",
"@swc/core": "1.15.8",
"@swc/helpers": "0.5.18",
"@swc/core": "1.15.18",
"@swc/helpers": "0.5.19",
"@testing-library/dom": "10.4.1",
"@testing-library/react": "^16.3.2",
"@types/node": "^22.19.11",
"@types/react": "^18.3.24",
"@types/node": "^22.19.15",
"@types/react": "^18.3.28",
"@types/react-dom": "^18.3.7",
"@typescript-eslint/eslint-plugin": "^8.55.0",
"@typescript-eslint/parser": "^8.55.0",
"@typescript-eslint/eslint-plugin": "^8.56.1",
"@typescript-eslint/parser": "^8.56.1",
"@vitejs/plugin-react-swc": "^4.2.3",
"@vitest/coverage-v8": "4.0.18",
"@vitest/ui": "4.0.18",
"ajv": "^8.18.0",
"cross-env": "^10.1.0",
"eslint": "^9.39.2",
"eslint": "^9.39.4",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "5.2.0",
"eslint-plugin-react-refresh": "^0.4.20",
"eslint-plugin-react-hooks": "^7.0.1",
"eslint-plugin-react-refresh": "^0.5.2",
"husky": "^9.1.7",
"jiti": "2.6.1",
"jsdom": "~26.1.0",
"jsonc-eslint-parser": "^2.4.2",
"lint-staged": "^16.2.7",
"nx": "22.5.1",
"jsdom": "~28.1.0",
"jsonc-eslint-parser": "^3.1.0",
"lint-staged": "^16.3.2",
"nx": "22.5.4",
"nx-cloud": "19.1.0",
"prettier": "^3.8.1",
"prettier-plugin-tailwindcss": "^0.6.14",
"prettier-plugin-tailwindcss": "^0.7.2",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"rollup-plugin-visualizer": "^6.0.5",
"rollup-plugin-visualizer": "^7.0.1",
"tslib": "^2.8.1",
"tsx": "^4.21.0",
"typescript": "~5.8.3",
"typescript-eslint": "^8.55.0",
"vite": "^6.4.1",
"vite-plugin-dts": "4.5.3",
"typescript": "~5.9.3",
"typescript-eslint": "^8.56.1",
"vite": "^7.3.1",
"vite-plugin-dts": "4.5.4",
"vitest": "4.0.18",
"yalc": "1.0.0-pre.53"
},
"volta": {
"node": "22.20.0",
"pnpm": "10.29.3"
"node": "22.22.0",
"pnpm": "10.31.0"
}
}
6 changes: 3 additions & 3 deletions packages/platform/config/api-extractor.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,12 @@
*
* DEFAULT VALUE: no overrideTsconfig section
*
* Module Resolution Inconsistency: The main issue was a mismatch between the base TypeScript configuration (moduleResolution: "nodenext") and API Extractor's expectations. I configured API Extractor to use its own TypeScript compiler options with moduleResolution: "node" and module: "commonjs".
* API Extractor uses a compiler override to keep module settings aligned with modern ESM packages.
*/
"overrideTsconfig": {
"compilerOptions": {
"module": "commonjs",
"moduleResolution": "node"
"module": "esnext",
"moduleResolution": "bundler"
}
}

Expand Down
18 changes: 9 additions & 9 deletions packages/platform/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@
},
"dependencies": {
"@eten-tech-foundation/scripture-utilities": "workspace:~",
"@floating-ui/dom": "^1.7.5",
"@lexical/react": "^0.40.0",
"@lexical/selection": "^0.40.0",
"@lexical/text": "^0.40.0",
"@lexical/utils": "^0.40.0",
"@lexical/yjs": "^0.40.0",
"@sillsdev/scripture": "^2.0.3",
"fast-equals": "^5.2.2",
"lexical": "^0.40.0",
"@floating-ui/dom": "^1.7.6",
"@lexical/react": "^0.41.0",
"@lexical/selection": "^0.41.0",
"@lexical/text": "^0.41.0",
"@lexical/utils": "^0.41.0",
"@lexical/yjs": "^0.41.0",
"@sillsdev/scripture": "^2.0.4",
"fast-equals": "^5.4.0",
"lexical": "^0.41.0",
"quill-delta": "^5.1.0"
},
"devDependencies": {
Expand Down
23 changes: 17 additions & 6 deletions packages/platform/src/editor/ScriptureReferencePlugin.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
$createTextNode,
LexicalEditor,
} from "lexical";
import { useState } from "react";
import { useEffect, useState } from "react";
import { $createBookNode, $createImmutableChapterNode, $createParaNode } from "shared";
import { $createImmutableVerseNode, usjReactNodes } from "shared-react";

Expand Down Expand Up @@ -147,17 +147,28 @@ async function testEnvironment(
onScrRefChange: (scrRef: SerializedVerseRef) => void = () => undefined,
$initialEditorState: () => void = $defaultInitialEditorState,
) {
let editor: LexicalEditor;
let _setScrRef: (scrRef: SerializedVerseRef) => void;
let editor: LexicalEditor | undefined;
const setScrRefRef: { current: ((scrRef: SerializedVerseRef) => void) | undefined } = {
current: undefined,
};

function GrabEditor() {
[editor] = useLexicalComposerContext();
const [composerEditor] = useLexicalComposerContext();

useEffect(() => {
editor = composerEditor;
}, [composerEditor]);

return null;
}

function App() {
const [internalScrRef, setInternalScrRef] = useState<SerializedVerseRef>(scrRef);
_setScrRef = setInternalScrRef;

useEffect(() => {
setScrRefRef.current = setInternalScrRef;
}, [setInternalScrRef]);

return (
<LexicalComposer
initialConfig={{
Expand All @@ -183,7 +194,7 @@ async function testEnvironment(

async function setScrRef(newScrRef: SerializedVerseRef) {
await act(async () => {
_setScrRef(newScrRef);
setScrRefRef.current?.(newScrRef);
});
}

Expand Down
16 changes: 3 additions & 13 deletions packages/platform/src/editor/toolbar/DropDown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,21 +105,11 @@ function DropDownItems({
}
};

const contextValue = useMemo(
() => ({
registerItem,
}),
[registerItem],
);
const contextValue = useMemo(() => ({ registerItem }), [registerItem]);

useEffect(() => {
if (items && !highlightedItem) {
setHighlightedItem(items[0]);
}

if (highlightedItem && highlightedItem.current) {
highlightedItem.current.focus();
}
const activeItem = highlightedItem ?? items?.[0];
if (activeItem?.current) activeItem.current.focus();
}, [items, highlightedItem]);

return (
Expand Down
Loading
Loading