editor: fix circular import that dropped PubScript nodes from schema

The TipTap node definitions imported their node-name constants from
schema.ts, while schema.ts imported the nodes to build the schema. This
circular dependency evaluated the nodes before the constants were
assigned, leaving sceneBreak/footnote/footnoteArea/characterMention with
name 'undefined' — so they never registered in PubScriptSchema. As a
result <hr class="scene-break"> parsed as StarterKit's horizontalRule
instead of a scene break.

- Move node-name constants, groups, MentionAttrs, and colorAttribute into
  a new constants.ts module that both schema.ts and the node files import
  from, breaking the cycle.
- Remove the redundant separate History extension (already in StarterKit),
  which also silenced a TipTap 'Duplicate extension names: undoRedo' warn.
- Drop unused TipTap extension and prosemirror-* deps (all access goes
  through @tiptap/pm).
This commit is contained in:
Schwitzz
2026-10-25 02:37:05 -05:00
parent 1c9b531996
commit c95f5e485a
16 changed files with 1677 additions and 2 deletions
+36
View File
@@ -0,0 +1,36 @@
{
"name": "@pubscript/editor",
"version": "0.1.0",
"type": "module",
"main": "./src/index.ts",
"types": "./src/index.ts",
"exports": {
".": "./src/index.ts",
"./schema": "./src/schema.ts",
"./Editor": "./src/Editor.tsx",
"./markdown": "./src/markdown.ts",
"./styles": "./src/styles/editor.css"
},
"scripts": {
"dev": "echo \"@pubscript/editor has no dev server\" (exit 0)",
"build": "tsc --noEmit",
"test": "vitest run",
"lint": "eslint .",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@pubscript/core": "workspace:*",
"@tiptap/core": "3.32.0",
"@tiptap/pm": "3.32.0",
"@tiptap/react": "3.32.0",
"@tiptap/starter-kit": "3.32.0",
"@tiptap/extension-text-style": "3.32.0"
},
"devDependencies": {
"@types/node": "^22.10.2",
"@types/react": "^19.0.2",
"react": "^19.0.0",
"typescript": "^5.7.2",
"vitest": "^2.1.8"
}
}