Skip to content
Open
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
11 changes: 3 additions & 8 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ volta run pnpm nx test shared # nx via project-pinned pnpm/node

```bash
# Start development server for specific package
nx dev <package-name> # e.g., nx dev perf-react, nx dev platform, nx dev scribe
nx dev <package-name> # e.g., nx dev perf-react, nx dev platform

# Build packages
nx build <package-name> # Build specific package
Expand Down Expand Up @@ -80,7 +80,6 @@ nx run-many -t extract-api # Update API reports for all packages
nx dev perf-react # React-based PERF editor
nx dev perf-vanilla # Vanilla JS PERF editor
nx dev platform # Platform.Bible scripture editor
nx dev scribe # Scribe scripture editor
```

### Package-specific Commands
Expand All @@ -90,9 +89,6 @@ nx dev scribe # Scribe scripture editor
nx dev platform # Development server
nx dev:test platform # Development with testing environment

# Scribe package
nx dev scribe # Development server

# PERF packages
nx dev perf-react # React PERF editor
nx dev perf-vanilla # Vanilla JS PERF editor
Expand All @@ -107,7 +103,6 @@ This is an Nx monorepo containing multiple scripture editor packages that share
- **`libs/shared`**: Core framework-agnostic editor functionality (nodes, plugins, converters)
- **`libs/shared-react`**: React-specific components and plugins extending shared functionality
- **`packages/platform`**: Scripture editor for Platform.Bible with commenting and collaboration features
- **`packages/scribe`**: Lightweight scripture editor for Scribe application. **Not currently maintained** — do NOT use it as a reference for existing patterns or conventions when investigating the codebase (prefer `platform`, `shared`, `shared-react`). Touch it only when a change explicitly targets scribe.
- **`demos/perf-react`**: React-based editor for PERF format with performance optimizations
- **`demos/perf-vanilla`**: Vanilla JS editor for PERF format
- **`packages/utilities`**: Data format conversion utilities (USJ/USX/USFM)
Expand Down Expand Up @@ -171,7 +166,7 @@ shared (core editor functionality)
shared-react (React-specific extensions)
[platform, scribe, perf-react] (application-specific implementations)
[platform, perf-react] (application-specific implementations)
```

### Development Workflow
Expand Down Expand Up @@ -272,7 +267,7 @@ Note `.prettierignore` excludes some files that are otherwise staged, notably `p
- Order `<*Plugin />` children in `packages/platform/src/editor/Editor.tsx` alphabetically by component name. The alphabetical block starts partway through — initial plugins in the setup section (`OnSelectionChangePlugin`, `DeltaOnChangePlugin`, `ActiveTextPlugin`, …) intentionally precede it.
- To find text or marker nodes in a Lexical tree, use `$getRoot().getAllTextNodes()` (`MarkerNode` extends `TextNode`, so markers are included) — the pattern the marker tests already use. For a whole-tree walk that must include element nodes (e.g. `NoteNode`, which extends `ElementNode`), use `$dfs()` from `@lexical/utils`, or `$isElementNode(node)` to type-narrow before `node.getChildren()`. Never duck-type with `typeof node.getChildren === "function"` / `as unknown as { getChildren?: ... }`. To find "the node the caret is in", read the selection's `focus` point (the live cursor end — correct even for a backward range selection), not its `anchor`.
- Type Lexical values by their real exported types (`LexicalEditor`, `TextNode`, …) instead of reinventing ad-hoc structural types (e.g. `{ getEditorState: () => { read: ... } }`) that capture only the shape you happen to touch.
- In tests that render the black-box `platform` `<Editor>`, get its `LexicalEditor` by passing Lexical's `<EditorRefPlugin editorRef={ref} />` as a child (`<Editor>` renders `children` inside its composer) and reading `ref.current` after the render flushes — do NOT reach for `.__lexicalEditor` off the `.editor-input` DOM node. Where the child-plugin handle isn't available — tests that deliberately go end-to-end through the public `<Editorial>` wrapper (it strips `children`), or scribe's `<Editor>` (no children slot) — fall back to the shared `getEmbeddedLexicalEditor(container)` helper (in `libs/shared-react` `react-test.utils.tsx`), which centralizes the `.__lexicalEditor` DOM reach-in in one place; note at the call site why the child-plugin route wasn't used. Tests that own their composer should instead use `baseTestEnvironment`, which captures the editor via composer context.
- In tests that render the black-box `platform` `<Editor>`, get its `LexicalEditor` by passing Lexical's `<EditorRefPlugin editorRef={ref} />` as a child (`<Editor>` renders `children` inside its composer) and reading `ref.current` after the render flushes — do NOT reach for `.__lexicalEditor` off the `.editor-input` DOM node. Where the child-plugin handle isn't available — tests that deliberately go end-to-end through the public `<Editorial>` wrapper, which strips `children` — fall back to the shared `getEmbeddedLexicalEditor(container)` helper (in `libs/shared-react` `react-test.utils.tsx`), which centralizes the `.__lexicalEditor` DOM reach-in in one place; note at the call site why the child-plugin route wasn't used. Tests that own their composer should instead use `baseTestEnvironment`, which captures the editor via composer context.
- Keep issue-tracker references out of code and comments: no Jira IDs (e.g. `PT-4187`), internal task/QA labels (`Task 8`), or spec section numbers (`§5.5`). Code must stand on its own — those belong in PR descriptions and commit messages. When a comment needs a term of art (e.g. "yank" for a programmatic caret move), define it inline at first use.

# Context 7 Library Documentation
Expand Down
23 changes: 5 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,23 +76,17 @@ NOTE: there is a [known limitation using PNPM with Volta](https://docs.volta.sh/

## Nx Monorepo Build System

| Source | Demo App |
| ----------------------------------- | ---------------------- |
| [perf-vanilla](/demos/perf-vanilla) | `nx dev perf-vanilla` |
| [perf-react](/demos/perf-react) | `nx dev perf-react` |
| [platform](/demos/platform) | `nx dev platform` |
| [scribe-editor](/packages/scribe)\* | `nx dev scribe-editor` |

\* This item appears in 2 lists as it has both the Demo App and Package in the same source folder.
| Source | Demo App |
| ----------------------------------- | --------------------- |
| [perf-vanilla](/demos/perf-vanilla) | `nx dev perf-vanilla` |
| [perf-react](/demos/perf-react) | `nx dev perf-react` |
| [platform](/demos/platform) | `nx dev platform` |

| Source | Package |
| ------------------------------------- | ----------------------------------------------------------------------- |
| [platform-editor](/packages/platform) | [![Github Tag][npm-platform-version-image]][npm-platform-version-url] |
| [scribe-editor](/packages/scribe) | [![Github Tag][npm-scribe-version-image]][npm-scribe-version-url]\* |
| [utilities](/packages/utilities) | [![Github Tag][npm-utilities-version-image]][npm-utilities-version-url] |

\* This package has not yet been published to the new NPM organization. The previous version of `scribe-editor` is here [![Github Tag][npm-bnf-scribe-version-image]][npm-bnf-scribe-version-url].

| Source | Library |
| ---------------------------------- | ---------------------- |
| [shared-react](/libs/shared-react) | internal non-published |
Expand All @@ -113,9 +107,6 @@ graph TB
R --> SR(shared-react)
SR --> S
SR --> U
SB(scribe-editor) --> SR
SB --> S
SB --> U
P(platform) --> PE(platform-editor)
P --> T
P --> U
Expand Down Expand Up @@ -504,10 +495,6 @@ to [`eten-tech-foundation/scripture-editors`][eten-repo] possible.

[npm-platform-version-image]: https://img.shields.io/github/v/tag/paranext/scripture-editors
[npm-platform-version-url]: https://github.com/paranext/scripture-editors/releases
[npm-scribe-version-image]: https://img.shields.io/npm/v/@eten-tech-foundation/scribe-editor
[npm-scribe-version-url]: https://www.npmjs.com/package/@eten-tech-foundation/scribe-editor
[npm-bnf-scribe-version-image]: https://img.shields.io/npm/v/@biblionexus-foundation/scribe-editor
[npm-bnf-scribe-version-url]: https://www.npmjs.com/package/@biblionexus-foundation/scribe-editor
[npm-utilities-version-image]: https://img.shields.io/github/v/tag/paranext/scripture-editors
[npm-utilities-version-url]: https://github.com/paranext/scripture-editors/releases
[github-license]: https://github.com/paranext/scripture-editors/blob/main/LICENSE
Expand Down
1 change: 0 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ export default [
"demos/platform/**",
"libs/shared-react/**",
"packages/platform/**",
"packages/scribe/**",
].flatMap((projectDir) => (config.files ?? ["**/*"]).map((pattern) => [projectDir, pattern])),
})),
{
Expand Down
2 changes: 1 addition & 1 deletion libs/shared-react/src/plugins/usj/UsjNodesMenuPlugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ function toHarnessOptionItem(
* The IN-EDITOR marker menu for editable marker modes (standard view): a document-first
* `\`/Enter menu mounted by `UsjNodesMenuPlugin` in place of the legacy typeahead when
* `editableHarness` is supplied. This is the real marker menu for every host that does not
* bring its own UI — the repo's demos and the scribe package. A host that does
* bring its own UI — the repo's demos. A host that does
* (`EditorOptions.hasExternalUI`, e.g. Platform.Bible, which renders marker menus through its
* own overlay service) never mounts the plugin, so none of this runs there.
*
Expand Down
5 changes: 2 additions & 3 deletions libs/shared/src/nodes/usj/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,8 @@ export const usjBaseNodes: readonly (Klass<LexicalNode> | LexicalNodeReplacement
// display runs as AttributeRunNode wrappers, and this package's own self-healing sync
// (displayRunSync.utils.ts's shared $syncDisplayRun driver, parameterized by each kind's own
// descriptor) constructs one whenever it heals a run forward from a loose or missing shape —
// every USJ-shaped editor needs the class registered, not only shared-react's (a non-react host,
// e.g. packages/scribe's NoteEditor, builds its editor straight from usjBaseNodes with no
// react-specific node list).
// every USJ-shaped editor needs the class registered, not only shared-react's (a non-react host
// builds its editor straight from usjBaseNodes with no react-specific node list).
AttributeRunNode,
{
replace: ParagraphNode,
Expand Down
12 changes: 0 additions & 12 deletions packages/scribe/.babelrc

This file was deleted.

24 changes: 0 additions & 24 deletions packages/scribe/.gitignore

This file was deleted.

21 changes: 0 additions & 21 deletions packages/scribe/LICENSE

This file was deleted.

Loading
Loading