@open-press/cli 0.5.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +114 -23
- package/package.json +1 -1
- package/template/core/CHANGELOG.md +97 -1
- package/template/core/README.md +9 -5
- package/template/core/engine/cli.mjs +2 -5
- package/template/core/engine/commands/_shared.mjs +4 -4
- package/template/core/engine/commands/deploy.mjs +1 -1
- package/template/core/engine/commands/inspect.mjs +3 -3
- package/template/core/engine/commands/replace.mjs +1 -1
- package/template/core/engine/commands/search.mjs +1 -1
- package/template/core/engine/commands/validate.mjs +2 -2
- package/template/core/engine/document-export.mjs +1 -1
- package/template/core/engine/{chrome-pdf.mjs → output/chrome-pdf.mjs} +1 -2
- package/template/core/engine/{deploy-sync.mjs → output/deploy-sync.mjs} +2 -2
- package/template/core/engine/{fonts.mjs → output/fonts.mjs} +1 -1
- package/template/core/engine/{public-assets.mjs → output/public-assets.mjs} +2 -2
- package/template/core/engine/{static-server.mjs → output/static-server.mjs} +2 -2
- package/template/core/engine/react/caption-numbering.mjs +73 -0
- package/template/core/engine/react/comment-marker.mjs +54 -10
- package/template/core/engine/react/document-entry.mjs +124 -64
- package/template/core/engine/react/document-export.mjs +252 -311
- package/template/core/engine/react/mdx-compile.mjs +123 -3
- package/template/core/engine/react/measurement-css.mjs +3 -3
- package/template/core/engine/react/pagination/allocator.mjs +122 -0
- package/template/core/engine/react/pagination/regions.mjs +81 -0
- package/template/core/engine/react/pagination.mjs +9 -121
- package/template/core/engine/react/pipeline/allocate.mjs +248 -0
- package/template/core/engine/react/pipeline/final-render.mjs +94 -0
- package/template/core/engine/react/pipeline/frame-measurement.mjs +271 -0
- package/template/core/engine/react/pipeline/press-tree.mjs +135 -0
- package/template/core/engine/react/project-asset-endpoint.mjs +2 -2
- package/template/core/engine/react/{chapter-css.mjs → section-css.mjs} +12 -9
- package/template/core/engine/react/sources/heading-numbering.mjs +132 -0
- package/template/core/engine/react/sources/mdx-resolver.mjs +441 -0
- package/template/core/engine/react/{workspace-discovery.mjs → style-discovery.mjs} +29 -40
- package/template/core/engine/{config.mjs → runtime/config.mjs} +15 -0
- package/template/core/engine/{file-utils.mjs → runtime/file-utils.mjs} +1 -1
- package/template/core/engine/{inspection.mjs → runtime/inspection.mjs} +3 -4
- package/template/core/engine/{source-text-tools.mjs → runtime/source-text-tools.mjs} +24 -7
- package/template/core/engine/runtime/source-workspace.mjs +186 -0
- package/template/core/engine/{validation.mjs → runtime/validation.mjs} +19 -17
- package/template/core/package.json +5 -2
- package/template/core/src/openpress/anchorMap.ts +27 -0
- package/template/core/src/openpress/core/Frame.tsx +80 -0
- package/template/core/src/openpress/core/FrameContext.tsx +19 -0
- package/template/core/src/openpress/core/MdxArea.tsx +35 -0
- package/template/core/src/openpress/core/Press.tsx +34 -0
- package/template/core/src/openpress/core/index.tsx +34 -15
- package/template/core/src/openpress/core/primitives.tsx +23 -0
- package/template/core/src/openpress/core/types.ts +131 -19
- package/template/core/src/openpress/core/useSource.ts +28 -0
- package/template/core/src/openpress/manuscript/index.tsx +196 -0
- package/template/core/src/openpress/mdx/index.ts +88 -0
- package/template/core/src/openpress/numbering/index.ts +294 -0
- package/template/core/src/openpress/publicPage.tsx +4 -186
- package/template/core/src/openpress/reactDocumentMetadata.ts +2 -16
- package/template/core/src/openpress/types.ts +0 -16
- package/template/core/src/openpress/workbench.tsx +2 -36
- package/template/core/src/styles/openpress/responsive.css +0 -14
- package/template/core/tsconfig.json +4 -1
- package/template/core/vite.config.ts +10 -3
- package/template/packs/academic-paper/document/chapters/01-introduction/content/01-introduction.mdx +21 -0
- package/template/packs/academic-paper/document/chapters/02-methods/content/01-methods.mdx +30 -0
- package/template/packs/academic-paper/document/chapters/03-results-and-discussion/content/01-results.mdx +29 -0
- package/template/packs/academic-paper/document/chapters/04-acknowledgment/content/01-acknowledgment.mdx +12 -0
- package/template/packs/academic-paper/document/chapters/05-references/content/01-references.mdx +27 -0
- package/template/packs/academic-paper/document/components/ChapterOpenerVisual/index.tsx +76 -0
- package/template/packs/academic-paper/document/components/Page.tsx +37 -0
- package/template/packs/academic-paper/document/components/TokenSwatchGrid/index.tsx +46 -0
- package/template/packs/academic-paper/document/components/TokenSwatchGrid/style.css +63 -0
- package/template/packs/academic-paper/document/components/TypeSpecimen/index.tsx +38 -0
- package/template/packs/academic-paper/document/components/TypeSpecimen/style.css +111 -0
- package/template/packs/academic-paper/document/design.md +279 -0
- package/template/packs/academic-paper/document/index.tsx +131 -0
- package/template/packs/academic-paper/document/media/README.md +13 -0
- package/template/packs/academic-paper/document/openpress.config.mjs +26 -0
- package/template/packs/academic-paper/document/theme/README.md +11 -0
- package/template/packs/academic-paper/document/theme/base/page-contract.css +505 -0
- package/template/packs/academic-paper/document/theme/base/print.css +93 -0
- package/template/packs/academic-paper/document/theme/base/typography.css +336 -0
- package/template/packs/academic-paper/document/theme/fonts.css +3 -0
- package/template/packs/academic-paper/document/theme/page-surfaces/back-cover.css +43 -0
- package/template/packs/academic-paper/document/theme/page-surfaces/chapter-opener.css +205 -0
- package/template/packs/academic-paper/document/theme/page-surfaces/cover.css +267 -0
- package/template/packs/academic-paper/document/theme/page-surfaces/toc.css +149 -0
- package/template/packs/academic-paper/document/theme/patterns/_chart-frame.css +49 -0
- package/template/packs/academic-paper/document/theme/patterns/figure-grid.css +68 -0
- package/template/packs/academic-paper/document/theme/patterns/table-utilities.css +66 -0
- package/template/packs/academic-paper/document/theme/shell/reader-controls.css +761 -0
- package/template/packs/academic-paper/document/theme/tokens.css +80 -0
- package/template/packs/academic-paper/openpress.config.mjs +5 -0
- package/template/packs/claude-document/document/components/Page.tsx +24 -14
- package/template/packs/claude-document/document/design.md +2 -2
- package/template/packs/claude-document/document/index.tsx +67 -62
- package/template/packs/claude-document/document/theme/page-surfaces/toc.css +19 -7
- package/template/packs/editorial-monograph/document/components/Page.tsx +24 -14
- package/template/packs/editorial-monograph/document/design.md +2 -2
- package/template/packs/editorial-monograph/document/index.tsx +71 -47
- package/template/packs/editorial-monograph/document/theme/page-surfaces/toc.css +19 -9
- package/template/core/engine/commands/migrate-to-react.mjs +0 -27
- package/template/core/engine/page-renderer.mjs +0 -217
- package/template/core/engine/react/migrate-to-react.mjs +0 -355
- package/template/core/engine/source-workspace.mjs +0 -76
- package/template/core/src/openpress/core/basePages.tsx +0 -87
- package/template/core/src/openpress/pagination.ts +0 -845
- package/template/packs/claude-document/document/chapters/01-document-shape/chapter.tsx +0 -30
- package/template/packs/claude-document/document/chapters/02-review-loop/chapter.tsx +0 -30
- /package/template/core/engine/{chrome-pdf.d.mts → output/chrome-pdf.d.mts} +0 -0
- /package/template/core/engine/{katex-assets.mjs → output/katex-assets.mjs} +0 -0
- /package/template/core/engine/{page-block.mjs → output/page-block.mjs} +0 -0
- /package/template/core/engine/{pdf-media.mjs → output/pdf-media.mjs} +0 -0
- /package/template/core/engine/{config.d.mts → runtime/config.d.mts} +0 -0
- /package/template/core/engine/{issue-report.mjs → runtime/issue-report.mjs} +0 -0
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
BaseCalloutProps,
|
|
3
|
-
BaseFigureProps,
|
|
4
|
-
BasePageProps,
|
|
5
|
-
BaseContentPageProps,
|
|
6
|
-
BaseShellPageProps,
|
|
7
|
-
} from "./types";
|
|
8
|
-
|
|
9
|
-
function classNames(...values: Array<string | undefined>) {
|
|
10
|
-
const joined = values.filter(Boolean).join(" ");
|
|
11
|
-
return joined.length > 0 ? joined : undefined;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export function BasePage({ kind, footer = true, className, children, ...sectionProps }: BasePageProps) {
|
|
15
|
-
return (
|
|
16
|
-
<section
|
|
17
|
-
{...sectionProps}
|
|
18
|
-
className={classNames("reader-page", `reader-page--${kind}`, className)}
|
|
19
|
-
data-page-footer={footer ? "true" : "false"}
|
|
20
|
-
data-page-kind={kind}
|
|
21
|
-
>
|
|
22
|
-
{children}
|
|
23
|
-
</section>
|
|
24
|
-
);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export function BaseCoverPage(props: BaseShellPageProps) {
|
|
28
|
-
return <BasePage {...props} footer={false} kind="cover" />;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export function BaseTocPage(props: BaseShellPageProps) {
|
|
32
|
-
return <BasePage {...props} footer={false} kind="toc" />;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export function BaseContentPage({
|
|
36
|
-
pageIndex,
|
|
37
|
-
totalPages,
|
|
38
|
-
chapterSlug,
|
|
39
|
-
chapterTone,
|
|
40
|
-
runningHeader,
|
|
41
|
-
footerLeft,
|
|
42
|
-
footerRight,
|
|
43
|
-
children,
|
|
44
|
-
...sectionProps
|
|
45
|
-
}: BaseContentPageProps) {
|
|
46
|
-
return (
|
|
47
|
-
<BasePage
|
|
48
|
-
{...sectionProps}
|
|
49
|
-
data-chapter-slug={chapterSlug}
|
|
50
|
-
data-chapter-tone={chapterTone}
|
|
51
|
-
data-page-index={pageIndex}
|
|
52
|
-
data-total-pages={totalPages}
|
|
53
|
-
footer
|
|
54
|
-
kind="content"
|
|
55
|
-
>
|
|
56
|
-
{runningHeader === undefined ? null : <header data-page-running-header>{runningHeader}</header>}
|
|
57
|
-
{children}
|
|
58
|
-
{footerLeft === undefined && footerRight === undefined ? null : (
|
|
59
|
-
<footer data-page-footer-content>
|
|
60
|
-
{footerLeft === undefined ? null : <span data-page-footer-left>{footerLeft}</span>}
|
|
61
|
-
{footerRight === undefined ? null : <span data-page-footer-right>{footerRight}</span>}
|
|
62
|
-
</footer>
|
|
63
|
-
)}
|
|
64
|
-
</BasePage>
|
|
65
|
-
);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export function BaseBackCoverPage(props: BaseShellPageProps) {
|
|
69
|
-
return <BasePage {...props} footer={false} kind="back-cover" />;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export function BaseFigure({ caption, className, children, ...figureProps }: BaseFigureProps) {
|
|
73
|
-
return (
|
|
74
|
-
<figure {...figureProps} className={classNames("openpress-figure", className)}>
|
|
75
|
-
<div data-figure-body>{children}</div>
|
|
76
|
-
{caption === undefined ? null : <figcaption>{caption}</figcaption>}
|
|
77
|
-
</figure>
|
|
78
|
-
);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
export function BaseCallout({ kind = "info", className, children, ...calloutProps }: BaseCalloutProps) {
|
|
82
|
-
return (
|
|
83
|
-
<aside {...calloutProps} className={classNames("openpress-callout", className)} data-callout-kind={kind}>
|
|
84
|
-
{children}
|
|
85
|
-
</aside>
|
|
86
|
-
);
|
|
87
|
-
}
|