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
76 changes: 76 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
## Description

<!-- Provide a brief description of the changes in this PR -->

## Type of Change

<!-- Mark the relevant option with an "x" -->

- [ ] 🐛 Bug fix (non-breaking change which fixes an issue)
- [ ] ✨ New feature (non-breaking change which adds functionality)
- [ ] 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] 📝 Documentation update
- [ ] 🎨 Style/UI update (no functional changes)
- [ ] ♻️ Code refactoring (no functional changes)
- [ ] ⚡ Performance improvement
- [ ] ✅ Test update
- [ ] 🔧 Configuration change
- [ ] 🏗️ Build/CI update

## Related Issues

<!-- Link to related issues using #issue_number -->

Closes #
Related to #

## Changes Made

<!-- List the main changes made in this PR -->

-
-
-

## Screenshots (if applicable)

<!-- Add screenshots to help explain your changes -->

## Testing

<!-- Describe the tests you ran and how to reproduce them -->

### Unit Tests

- [ ] All existing unit tests pass
- [ ] Added new unit tests for new functionality

### E2E Tests

- [ ] All existing e2e tests pass
- [ ] Added new e2e tests for new functionality

### Manual Testing

<!-- Describe manual testing steps -->

1.
2.
3.

## Checklist

<!-- Mark completed items with an "x" -->

- [ ] My code follows the project's style guidelines
- [ ] I have performed a self-review of my code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings or errors
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published

## Additional Notes

<!-- Add any additional notes or context about the PR -->
14 changes: 7 additions & 7 deletions AGENTS.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/web/src/Landing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export function Landing() {
<span className="border-l border-line px-6 py-3 text-muted">Sheet 03</span>
</div>
<p className="max-w-[70ch] px-6 pt-5 text-[15px] leading-relaxed text-muted">
Open your browser's developer tools and watch the Network tab while a tool runs. Your file never appears there. The one request Ream can make is Download free fonts in the PDF tool (shown in Edit PDF, Excel to PDF and PowerPoint to PDF), which sends font names only, on your click.
Open your browser's developer tools and watch the Network tab while a tool runs. Your file never appears there. The one request Ream can make is Download free fonts in the PDF tool (shown in Edit PDF, Word to PDF, Excel to PDF and PowerPoint to PDF), which sends font names only, on your click.
</p>
<div className="overflow-x-auto px-6 pb-3 pt-4">
<table className="w-full min-w-md text-left">
Expand Down
77 changes: 56 additions & 21 deletions apps/web/src/Marketing.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
import type { ReactNode } from 'react'
import { Logo } from '@ream/ui'
import { ThemeToggle } from './ThemeToggle'
import { focus } from './TopBar'
import { Link } from './router'
import type { ReactNode } from "react";
import { Logo } from "@ream/ui";
import { ThemeToggle } from "./ThemeToggle";
import { focus } from "./TopBar";
import { Link } from "./router";

const action = `inline-flex min-h-11 items-center justify-center px-5 font-heading text-[17px] font-semibold tracking-wide transition-colors duration-150 ${focus}`
const action = `inline-flex min-h-11 items-center justify-center px-5 font-heading text-[17px] font-semibold tracking-wide transition-colors duration-150 ${focus}`;
/** the one solid object on a page: an accent fill wearing the corner marks */
export const primary = `${action} blueprint border border-accent bg-accent text-on-accent hover:border-accent-hover hover:bg-accent-hover`
export const secondary = `${action} border border-line hover:bg-ink/7`
export const primary = `${action} blueprint border border-accent bg-accent text-on-accent hover:border-accent-hover hover:bg-accent-hover`;
export const secondary = `${action} border border-line hover:bg-ink/7`;
/** a section's label: small caps in the deep steel, sitting over a hairline */
export const kicker = 'block border-b border-line pb-2 font-sans text-[13px] font-semibold tracking-widest text-accent-ink uppercase tabular-nums'
export const wrap = 'mx-auto max-w-[1600px] px-4 sm:px-8'
export const kicker =
"block border-b border-line pb-2 font-sans text-[13px] font-semibold tracking-widest text-accent-ink uppercase tabular-nums";
export const wrap = "mx-auto max-w-[1600px] px-4 sm:px-8";

/** Frame of the landing, licence and notices pages: their own nav and footer, not the app's bar. */
export function Marketing({ children }: { children: ReactNode }) {
return (
// a column at least the window's height: the content takes the free space, so a short page still ends in its footer
<div className="flex min-h-screen flex-col">
<header>
<div className={`${wrap} flex flex-wrap items-center justify-between gap-4 py-4`}>
<Link to="/" className={`flex items-center gap-2 font-heading text-[22px] font-semibold tracking-wide uppercase ${focus}`}>
<div
className={`${wrap} flex flex-wrap items-center justify-between gap-4 py-4`}
>
<Link
to="/"
className={`flex items-center gap-2 font-heading text-[22px] font-semibold tracking-wide uppercase ${focus}`}
>
<Logo size={24} /> Ream
</Link>
<nav className="flex flex-wrap items-center gap-x-6 gap-y-2 text-[15px] font-medium">
Expand All @@ -29,18 +35,47 @@ export function Marketing({ children }: { children: ReactNode }) {
</header>
<main className="flex-1">{children}</main>
<footer className="mt-24">
<div className={`${wrap} flex flex-wrap items-center justify-between gap-4 border-t border-line py-7 text-sm text-muted`}>
<span className="flex items-center gap-2 font-heading text-lg font-semibold tracking-wide text-ink uppercase">
<Logo size={20} /> Ream
</span>
<div
className={`${wrap} flex flex-wrap items-center justify-between gap-4 border-t border-line py-7 text-sm text-muted`}
>
<div className="flex items-center gap-2">
<span className="flex items-center gap-2 font-heading text-lg font-semibold tracking-wide text-ink uppercase">
<Logo size={20} /> Ream
</span>
<Link
className={`underline hover:text-ink ${focus}`}
target="__blank"
to="https://github.com/Deityhub/ream"
>
(v{__APP_VERSION__})
</Link>
</div>
<span className="flex flex-wrap gap-x-4 gap-y-1 text-[13px] text-muted">
<span>© 2026 Chizoba Jude Ojini</span>
<span className="tabular-nums">Version {__APP_VERSION__}</span>
<Link className={`underline hover:text-ink ${focus}`} to="/licence/">MIT licence</Link>
<Link className={`underline hover:text-ink ${focus}`} to="/notices/">Third-party notices</Link>
<span className="flex items-center gap-2">
<span>© {new Date().getFullYear()} </span>
<Link
className={`underline hover:text-ink ${focus}`}
target="__blank"
to="https://judeojini.com"
>
Chizoba Jude Ojini
</Link>
</span>
<Link
className={`underline hover:text-ink ${focus}`}
to="/licence/"
>
[MIT licence]
</Link>
<Link
className={`underline hover:text-ink ${focus}`}
to="/notices/"
>
[Third-party notices]
</Link>
</span>
</div>
</footer>
</div>
)
);
}
87 changes: 85 additions & 2 deletions packages/office-core/src/docx-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ export type Run = {
/** reading: RRGGBB behind the text, raised (super) or lowered (sub) */
highlight?: string
vertAlign?: 'super' | 'sub'
/** reading: a web or mail address the text links to */
link?: string
/** reading: the text is the page number ('page'), the page count ('pages') or the page a bookmark is on ('pageref', with `ref`); `text` is what the file saved, to be replaced */
field?: 'page' | 'pages' | 'pageref'
/** reading: the bookmark a 'pageref' field is about */
ref?: string
/** reading: a link to a bookmark in this document */
anchor?: string
/** reading: the mark of a footnote or endnote (`text` is its number, already worked out) */
note?: { id: string; kind: 'foot' | 'end' }
/** reading: a picture in the line, like a character (`text` is empty): it sits on the baseline, grows the line, and goes where the paragraph's alignment puts it */
picture?: Picture
}

export type Paragraph = {
Expand All @@ -35,20 +47,39 @@ export type Paragraph = {
/** first line, relative to the left indent; negative hangs */
indentFirst?: number
pageBreakBefore?: boolean
/** reading: keep with the next paragraph, keep all lines on one page, widow and orphan control (on unless `false`) */
keepNext?: boolean
keepLines?: boolean
widowControl?: boolean
/** reading: names of the bookmarks that start in this paragraph */
bookmarks?: string[]
/** reading: every tab stop of the paragraph (its style's included), by position from the left margin; a tab goes to the next one after where the text is */
tabStops?: { pos: number; align: 'left' | 'center' | 'right' | 'decimal'; leader?: 'dot' | 'hyphen' | 'underscore' }[]
/** reading: one entry for each tab character in the runs, in order; null when no stop is known there. `pos` counts from the left margin (missing: the margins themselves) */
tabs?: ({ pos?: number; align: 'left' | 'center' | 'right' } | null)[]
/**
* placed in a text box at a spot on the page, points from its top left, instead of in the flow; paragraphs that share one
* `frame` object (the same object, one after the other) share the box. `h` is a first guess: the box grows to its text.
*/
frame?: { x: number; y: number; w: number; h?: number; /** reading: what x and y count from (default the page) */ from?: { h: 'page' | 'margin'; v: 'page' | 'margin' | 'paragraph' } }
}

/** a line of a cell's border: points wide, RRGGBB */
export type CellLine = { w: number; color: string } | null

export type TableCell = {
paragraphs: Paragraph[]
/** columns covered */
cols?: number
/** 'restart' starts a cell that continues down; 'continue' is a part under it */
vMerge?: 'restart' | 'continue'
fill?: string
/** reading: where the text sits in a cell that is taller than it (default the top) */
vAlign?: 'center' | 'bottom'
/** reading: the lines on the cell's four sides, worked out from the table, its style and the cell (null: none); missing means the table's `borders` apply */
border?: { top: CellLine; right: CellLine; bottom: CellLine; left: CellLine }
/** reading: room between the cell's edges and its text, points (Word's default: 5.4 at the sides, none above and below) */
pad?: { top: number; right: number; bottom: number; left: number }
}

export type Table = {
Expand All @@ -62,6 +93,13 @@ export type Table = {
rowHeights?: number[]
/** space below the table, points */
after?: number
/** reading: where the table sits across the page: as aligned, or from the left margin by `indent` (the cell margin Word outdents it by in older documents included) */
align?: 'left' | 'center' | 'right'
indent?: number
/** reading: rows that must stay on one page (cantSplit); the others are split between lines when a page ends in them */
noSplit?: boolean[]
/** reading: the first rows are headings that repeat at the top of every page the table continues on */
headerRows?: number
}

export type Picture = {
Expand All @@ -76,15 +114,60 @@ export type Picture = {
front?: boolean
/** reading: what `at` counts from (default the page) */
from?: { h: 'page' | 'margin'; v: 'page' | 'margin' | 'paragraph' }
/** reading: placed by alignment (in what `from` names) instead of by `at` */
align?: { h?: 'left' | 'center' | 'right'; v?: 'top' | 'center' | 'bottom' }
/**
* reading: how text goes around a placed picture: 'square' (also what tight and through wrapping become: the picture's box),
* or 'topBottom' (no text beside it). Missing: text ignores it and the picture is drawn behind it, or in front when `front`.
*/
wrap?: 'square' | 'topBottom'
/** reading: with 'square', the side text may use: both (the wider piece of each line), only the left or right, or the largest */
wrapText?: 'both' | 'left' | 'right' | 'largest'
/** reading: room kept clear around it, points */
dist?: { top: number; bottom: number; left: number; right: number }
/**
* reading: what part of the picture shows in its box, as shares of the picture cut from each side. A negative share is
* empty room added there (a thin line picture in a tall box, as Google Docs makes for dividers).
*/
crop?: { l: number; t: number; r: number; b: number }
}

export type Block = Paragraph | Table | Picture

export type Section = {
width: number
height: number
margins: { top: number; right: number; bottom: number; left: number }
/** `header` and `footer` are the distances from the page's edge to the header and footer */
margins: { top: number; right: number; bottom: number; left: number; header?: number; footer?: number }
blocks: Block[]
/** reading: what repeats at the top and bottom of every page of the section; `first*` is for its first page when `titlePg` */
header?: Block[]
footer?: Block[]
firstHeader?: Block[]
firstFooter?: Block[]
/** reading: for even-numbered pages when the document says odd and even pages differ */
evenHeader?: Block[]
evenFooter?: Block[]
titlePg?: boolean
/** reading: how the section starts (default on a new page) */
type?: 'continuous' | 'nextPage' | 'evenPage' | 'oddPage'
/** reading: the number of its first page when it restarts the numbering, and the look of the numbers */
pageStart?: number
pageFormat?: 'decimal' | 'lowerRoman' | 'upperRoman' | 'lowerLetter' | 'upperLetter'
/** reading: text in columns: their widths (points) and the space between, and a line between them */
columns?: { widths: number[]; space: number[]; line: boolean }
}

export type DocModel = { sections: Section[]; title?: string }
/** reading: a font file the document carries, for the family, weight and slant it is for */
export type EmbeddedFont = { name: string; bold: boolean; italic: boolean; bytes: Uint8Array }

export type DocModel = {
sections: Section[]
title?: string
/** reading: even pages have their own headers and footers */
evenAndOdd?: boolean
/** reading: where a tab goes when no stop is set, points */
defaultTab?: number
/** reading: the text of footnotes (`foot:2`) and endnotes (`end:2`), by kind and id */
notes?: Record<string, Paragraph[]>
/** reading: fonts stored in the file (Google Docs saves the ones it uses) */ fonts?: EmbeddedFont[] }
Loading
Loading