Skip to content

Commit de5553c

Browse files
committed
Merge branch 'main' into tadeu/sd-3005-feature-bibliography
2 parents e883c50 + 7348c74 commit de5553c

553 files changed

Lines changed: 23113 additions & 3302 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/scripts/risk-label.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { readFileSync } from 'node:fs';
77
const CRITICAL_PATHS = [
88
'packages/layout-engine/style-engine/',
99
'packages/layout-engine/layout-engine/',
10-
'packages/layout-engine/pm-adapter/',
10+
'packages/pm-adapter/',
1111
'packages/layout-engine/layout-bridge/',
1212
'packages/layout-engine/measuring/',
1313
'packages/layout-engine/painters/',

.github/scripts/risk-label.test.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ describe('classify', () => {
8585

8686
it('critical: pm-adapter', () => {
8787
assert.equal(
88-
classify(['packages/layout-engine/pm-adapter/src/foo.js']).level,
88+
classify(['packages/pm-adapter/src/foo.js']).level,
8989
'critical',
9090
);
9191
});

AGENTS.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,31 @@ SuperDoc uses its own rendering pipeline. ProseMirror stores document state; it
99
```
1010
.docx
1111
→ super-converter parses OOXML into the hidden PM doc
12-
→ pm-adapter reads PM state and resolved styles
12+
→ v1 layout-adapter (super-editor: src/editors/v1/core/layout-adapter)
13+
reads PM state and resolved styles
1314
→ FlowBlock[]
1415
→ layout-engine paginates
1516
→ ResolvedLayout
1617
→ DomPainter paints DOM
1718
```
1819

20+
- The v1 ProseMirror → `FlowBlock[]` adapter is owned by `@superdoc/super-editor`
21+
(`src/editors/v1/core/layout-adapter`). It is v1 SuperEditor's projection from
22+
hidden ProseMirror state into layout data. v2 owns its own projection adapter.
23+
`layout-engine` runtime packages consume `FlowBlock[]` and layout contracts
24+
only; they must never import either concrete adapter.
1925
- `PresentationEditor` wraps a hidden ProseMirror `Editor`. Its contenteditable DOM is never shown. PresentationEditor bridges editor events into layout/paint state; do not resolve OOXML semantics there.
2026
- **DomPainter** (`layout-engine/painters/dom/`) owns all visual rendering.
21-
- Style-resolved properties flow `pm-adapter` → DomPainter. Do not style document content with PM decorations.
27+
- Style-resolved properties flow `layout-adapter` → DomPainter. Do not style document content with PM decorations.
2228

2329
### Where To Put Your Change
2430

2531
| Concern | Where | Rule |
2632
|---|---|---|
2733
| DOCX import/export | `super-editor/src/editors/v1/core/super-converter/` | Parse and preserve OOXML, style refs, inline properties. Do not bake resolved formatting into direct attrs. |
2834
| Style cascade | `layout-engine/style-engine/` | Single source of truth for defaults, styles, conditional formatting, inline overrides. |
29-
| Static document visuals | `pm-adapter/` data + `layout-engine/painters/dom/` rendering | Feed typed data into DomPainter. Do not style static content with PM decorations. |
30-
| Direction-aware properties | `layout-engine/painters/dom/` | DomPainter mirrors at paint time for `w:bidiVisual`. pm-adapter stores logical sides LTR-default. Pre-mirroring upstream is a double-swap. See `packages/layout-engine/pm-adapter/src/direction/README.md`. |
35+
| Static document visuals | v1 `core/layout-adapter/` data + `layout-engine/painters/dom/` rendering | Feed typed data into DomPainter. Do not style static content with PM decorations. |
36+
| Direction-aware properties | `layout-engine/painters/dom/` | DomPainter mirrors at paint time for `w:bidiVisual`. The v1 layout-adapter stores logical sides LTR-default. Pre-mirroring upstream is a double-swap. See `packages/super-editor/src/editors/v1/core/layout-adapter/direction/README.md`. |
3137
| Editing behavior | `super-editor/src/editors/v1/extensions/` | Commands, keybindings, editor plugins. Do not duplicate cascade or render document visuals here. |
3238
| Final DOM rendering | `layout-engine/painters/dom/` | Render `ResolvedLayout`. Paint-time transforms (e.g. RTL mirror) live here. |
3339
| New doc-api operation | `packages/document-api/src/contract/operation-definitions.ts` | Contract-first; touches 4 files. See `packages/document-api/README.md`. |
@@ -39,8 +45,8 @@ For specialized boundaries (interaction mapping, geometry/pagination, ephemeral
3945
Before adding a visual or direction-aware path, run:
4046

4147
```bash
42-
# Painter must not import upstream packages.
43-
rg "@superdoc/(pm-adapter|style-engine|layout-bridge|layout-resolved)" packages/layout-engine/painters/dom/src
48+
# Painter must not import upstream packages or the concrete v1 adapter.
49+
rg "@superdoc/(super-editor|style-engine|layout-bridge|layout-resolved)" packages/layout-engine/painters/dom/src
4450
```
4551

4652
More checks in `packages/layout-engine/AGENTS.md`.

CONTRIBUTING.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,17 @@ SuperDoc uses its own rendering pipeline -- ProseMirror is NOT used for visual o
4747
```
4848
DOCX File
4949
→ super-converter (parse OOXML into ProseMirror document)
50-
pm-adapter (convert PM nodes into FlowBlocks)
50+
v1 layout-adapter (super-editor: convert PM nodes into FlowBlocks)
5151
→ layout-engine (paginate FlowBlocks into Layouts)
5252
→ DomPainter (render Layouts to DOM)
5353
```
5454

5555
A hidden ProseMirror `Editor` instance manages document state and editing commands, but its DOM is never shown to the user. All visual rendering goes through DomPainter.
5656

57+
The PM → FlowBlock adapter is owned by `super-editor`
58+
(`src/editors/v1/core/layout-adapter`), not by `layout-engine`. The layout
59+
engine packages consume `FlowBlock[]` and shared layout contracts only.
60+
5761
### Project Structure
5862

5963
```
@@ -64,9 +68,9 @@ packages/
6468
src/editors/v1/
6569
core/
6670
super-converter/ DOCX import/export (OOXML ↔ ProseMirror)
71+
layout-adapter/ ProseMirror → FlowBlock[] projection (v1-owned)
6772
extensions/ Editing behaviors (bold, lists, tables, etc.)
6873
layout-engine/ Layout & pagination pipeline
69-
pm-adapter/ ProseMirror → Layout bridge
7074
layout-engine/ Pagination algorithms
7175
painters/dom/ DOM rendering (DomPainter)
7276
style-engine/ OOXML style resolution & cascade
@@ -84,7 +88,7 @@ tests/visual/ Visual regression tests (Playwright)
8488
|--------------------------|---------------|
8589
| How something looks (visual rendering) | `layout-engine/painters/dom/` |
8690
| Style resolution (fonts, colors, borders) | `layout-engine/style-engine/` |
87-
| Data flowing from editor to renderer | `layout-engine/pm-adapter/` |
91+
| Data flowing from editor to renderer | `super-editor/src/editors/v1/core/layout-adapter/` |
8892
| Editing behavior (keyboard, commands) | `super-editor/src/editors/v1/extensions/` |
8993
| DOCX import/export | `super-editor/src/editors/v1/core/super-converter/` |
9094
| React integration | `packages/react/` |

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,14 @@ const superdoc = new SuperDoc({
7272
});
7373
```
7474

75+
Optional layered CSS mode:
76+
77+
```css
78+
@layer reset, superdoc, app;
79+
@import 'superdoc/style.layered.css';
80+
@import 'your-app.css' layer(app);
81+
```
82+
7583
Or use the CDN:
7684

7785
```html

apps/cli/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@superdoc-dev/cli",
3-
"version": "0.13.1",
3+
"version": "0.15.0",
44
"type": "module",
55
"bin": {
66
"superdoc": "./dist/index.js"
@@ -46,7 +46,6 @@
4646
},
4747
"devDependencies": {
4848
"@superdoc/document-api": "workspace:*",
49-
"@superdoc/pm-adapter": "workspace:*",
5049
"@superdoc/super-editor": "workspace:*",
5150
"@types/bun": "catalog:",
5251
"@types/node": "catalog:",

apps/cli/platforms/cli-darwin-arm64/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@superdoc-dev/cli-darwin-arm64",
3-
"version": "0.13.1",
3+
"version": "0.15.0",
44
"os": [
55
"darwin"
66
],

apps/cli/platforms/cli-darwin-x64/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@superdoc-dev/cli-darwin-x64",
3-
"version": "0.13.1",
3+
"version": "0.15.0",
44
"os": [
55
"darwin"
66
],

apps/cli/platforms/cli-linux-arm64/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@superdoc-dev/cli-linux-arm64",
3-
"version": "0.13.1",
3+
"version": "0.15.0",
44
"os": [
55
"linux"
66
],

apps/cli/platforms/cli-linux-x64/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@superdoc-dev/cli-linux-x64",
3-
"version": "0.13.1",
3+
"version": "0.15.0",
44
"os": [
55
"linux"
66
],

0 commit comments

Comments
 (0)