Skip to content

API inventory

Use this page as a quick lookup for package entry points, primary exports, and related docs.

@sciflow/editor-start

  • Exports: registers <sciflow-editor> and <sciflow-formatbar> when imported.
  • Theming: setSciFlowThemeStyles() injects global styles into all component shadow roots.
  • Feature factories: createReadOnlyFeature(name, initialReadOnly?) and createRangeDecorationsFeature(name) — ready-made Features for a toggleable read-only mode and consumer-driven range decorations. Also available from @sciflow/editor-start/bundle, which bundle consumers must use instead of the bare package — see the dual-package hazard.
  • Bundle: @sciflow/editor-start/bundle (or dist/bundle/sciflow-editor.js).
  • Docs: Web Components Basics, Customization Recipes, Adding Custom ProseMirror Plugins.

@sciflow/editor-core

Export Description
Editor Factory for creating/mounting the editor runtime.
SyncStrategy Interface for persistence/collaboration.
CommandRunner Immediate + flow command API (accessible via editor.getCommands()).
runInsertCitation, runInsertFigure, runInsertMath, runInsertFootnote, list/blockquote/copy-paste helpers, and so on Helper functions exposed by individual features.
findCitationsByReferenceId Look up citation node positions in the document by the SnapshotReference.id they cite. Also re-exported from @sciflow/editor-start.
EXTERNAL_SYNC_TRANSACTION_META, isExternalSyncTransaction Transaction-meta contract marking a doc change that originated outside this client, as distinct from a user edit or a command's transaction. It covers both external sources: programmatic doc replacement (Editor.updateFromSync() / applyOps() / updateSelection(), via syncViewWithState()) and authority-confirmed collaborative steps (Editor.receiveSteps() / applyExternalOps()). A filterTransaction such as createReadOnlyFeature's lets both through while still blocking edits — which is what keeps a read-only collaborator receiving remote steps instead of silently freezing at its mount version.

The citation feature's selectCitation command is not a package export — it is registered on the command runner and reached via editor.commands.commands.selectCitation(pos), like any other editor command.

Relevant docs:

@sciflow/schema-prosemirror

Export Description
manuscript The ProseMirror Schema instance the editor runs on. This is the schema — there is no separate manuscriptSchema alias.
figure The figure NodeSpec, exported on its own so a host can inspect or extend that one node.
generateJsonSchema(schema): JsonSchema Derives a JSON Schema for the ProseMirror document tree from a live Schema, reading the description fields off each NodeSpec / MarkSpec / AttributeSpec.
generateSnapshotSchema(schema): JsonSchema Derives a JSON Schema for the whole snapshot wrapper (doc + files + references + selection state), embedding the document schema by $ref.
generateJatsBody(doc, options?): string Renders a JATS 1.4 <body> string. Takes document JSON (PMNodetype is a string, content an array), not a live ProseMirror node: pass snapshot.doc or pmDoc.toJSON().
JsonSchema, PMNode, PMMark, JatsBodyOptions Types for the generators above.
BlockquoteNodeAttrs, BookmarkNodeAttrs, CitationNodeAttrs, HeadingNodeAttrs, MathNodeAttrs, PoetryNodeAttrs, VerbatimNodeAttrs, … Per-node attribute types, plus the shared ManuscriptNodeAttrMap, NodeId, PartType, Placement and related enums. The full list is the package's src/index.ts.

Instantiating a node from stored JSON is ProseMirror's own API

This package exports no nodeFromJSON / marksFromJSON helpers. Use ProseMirror directly with the exported schema:

import { Node } from 'prosemirror-model';
import { manuscript } from '@sciflow/schema-prosemirror';

const doc = Node.fromJSON(manuscript, snapshot.doc);

Node.fromJSON does not validate content against the schema — a document that violates a content expression loads silently and fails at the first transform that re-validates it.

Feature modules

Features live under packages/editor/core/src/lib/features/*. Each folder typically exports:

  • Command helpers (runInsertFigure, runInsertCitation).
  • Types (InsertFigureOptions, and so on).
  • Node views when UI rendering is required.
  • Ready-made feature registrations (figureFeature, footnoteFeature, listFeature, blockquoteFeature, ...).

Import them directly from the package:

import { runInsertFigure } from '@sciflow/editor-core/features/figure';

Tree shaking

Feature modules are safe to import individually. They only register themselves when you call registerCommands, so bundlers can drop unused code paths.

Other published packages

Package Role
@sciflow/schema-core The ProseMirror-free half of the schema layer. Exports exactly two things: schemaVersion (a version string) and texToHeadingText(tex: string): string, which reduces a TeX string to a plain-text approximation for surfaces that can't render math (a TOC entry, a PDF bookmark, a plain-text title field). The JSON-schema and snapshot generators live in @sciflow/schema-prosemirror, not here — they need a live Schema.
@sciflow/pandoc-ast Pandoc AST → ProseMirror import. Entry points: parsePandocAST(), assignIds(), the pandocRenderers / render / renderContent renderer surface with its ImportError class, the SfNodeType / SfMarkType enums, and a re-exported manuscript schema.
@sciflow/pandoc-web Browser Pandoc-WASM wrapper. Entry points: loadPandoc(), convertFile(), convertAstToBlob(), and the <sciflow-pandoc-drop> element (SciflowPandocDropElement).

These six are the published set. The reader (<sfo-reader>) and its @sciflow/reader-* support libraries are not published to npm and are not part of this release.