@open-press/cli 0.8.0 → 1.1.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/README.md +33 -23
- package/dist/cli.js +320 -252
- package/package.json +9 -8
- package/template/core/AGENTS.md +0 -126
- package/template/core/CHANGELOG.md +0 -215
- package/template/core/README.md +0 -40
- package/template/core/engine/cli.mjs +0 -96
- package/template/core/engine/commands/_shared.mjs +0 -177
- package/template/core/engine/commands/deploy.mjs +0 -31
- package/template/core/engine/commands/dev.mjs +0 -49
- package/template/core/engine/commands/doctor.mjs +0 -229
- package/template/core/engine/commands/export.mjs +0 -8
- package/template/core/engine/commands/init.mjs +0 -24
- package/template/core/engine/commands/inspect.mjs +0 -35
- package/template/core/engine/commands/pdf.mjs +0 -26
- package/template/core/engine/commands/preview.mjs +0 -26
- package/template/core/engine/commands/render.mjs +0 -17
- package/template/core/engine/commands/replace.mjs +0 -41
- package/template/core/engine/commands/search.mjs +0 -33
- package/template/core/engine/commands/typecheck.mjs +0 -5
- package/template/core/engine/commands/upgrade.mjs +0 -159
- package/template/core/engine/commands/validate.mjs +0 -17
- package/template/core/engine/document-export.mjs +0 -15
- package/template/core/engine/init.mjs +0 -90
- package/template/core/engine/output/chrome-pdf.d.mts +0 -34
- package/template/core/engine/output/chrome-pdf.mjs +0 -358
- package/template/core/engine/output/deploy-sync.mjs +0 -15
- package/template/core/engine/output/fonts.mjs +0 -62
- package/template/core/engine/output/katex-assets.mjs +0 -45
- package/template/core/engine/output/page-block.mjs +0 -30
- package/template/core/engine/output/pdf-media.mjs +0 -45
- package/template/core/engine/output/public-assets.mjs +0 -19
- package/template/core/engine/output/static-server.mjs +0 -532
- package/template/core/engine/react/caption-numbering.mjs +0 -73
- package/template/core/engine/react/comment-endpoint.d.mts +0 -11
- package/template/core/engine/react/comment-endpoint.mjs +0 -102
- package/template/core/engine/react/comment-marker.mjs +0 -374
- package/template/core/engine/react/document-entry.mjs +0 -324
- package/template/core/engine/react/document-export.mjs +0 -373
- package/template/core/engine/react/http-json.mjs +0 -24
- package/template/core/engine/react/mdx-compile.mjs +0 -599
- package/template/core/engine/react/measurement-css.mjs +0 -136
- package/template/core/engine/react/object-entities.mjs +0 -119
- package/template/core/engine/react/pagination/allocator.mjs +0 -122
- package/template/core/engine/react/pagination/regions.mjs +0 -81
- package/template/core/engine/react/pagination-constants.mjs +0 -3
- package/template/core/engine/react/pagination.mjs +0 -9
- package/template/core/engine/react/pipeline/allocate.mjs +0 -251
- package/template/core/engine/react/pipeline/final-render.mjs +0 -94
- package/template/core/engine/react/pipeline/frame-measurement.mjs +0 -302
- package/template/core/engine/react/pipeline/press-tree.mjs +0 -135
- package/template/core/engine/react/project-asset-endpoint.d.mts +0 -10
- package/template/core/engine/react/project-asset-endpoint.mjs +0 -361
- package/template/core/engine/react/section-css.mjs +0 -56
- package/template/core/engine/react/source-edit-endpoint.d.mts +0 -10
- package/template/core/engine/react/source-edit-endpoint.mjs +0 -75
- package/template/core/engine/react/sources/heading-numbering.mjs +0 -132
- package/template/core/engine/react/sources/mdx-resolver.mjs +0 -439
- package/template/core/engine/react/style-discovery.mjs +0 -142
- package/template/core/engine/runtime/config.d.mts +0 -40
- package/template/core/engine/runtime/config.mjs +0 -175
- package/template/core/engine/runtime/file-utils.mjs +0 -106
- package/template/core/engine/runtime/file-walk.mjs +0 -22
- package/template/core/engine/runtime/inspection.mjs +0 -328
- package/template/core/engine/runtime/issue-report.mjs +0 -44
- package/template/core/engine/runtime/path-utils.mjs +0 -20
- package/template/core/engine/runtime/source-text-tools.d.mts +0 -102
- package/template/core/engine/runtime/source-text-tools.mjs +0 -832
- package/template/core/engine/runtime/source-workspace.mjs +0 -159
- package/template/core/engine/runtime/validation.mjs +0 -174
- package/template/core/index.html +0 -13
- package/template/core/openpress.config.mjs +0 -12
- package/template/core/package.json +0 -91
- package/template/core/src/main.tsx +0 -16
- package/template/core/src/openpress/app/OpenPressApp.tsx +0 -140
- package/template/core/src/openpress/app/OpenPressRuntime.tsx +0 -94
- package/template/core/src/openpress/app/index.ts +0 -2
- package/template/core/src/openpress/core/Frame.tsx +0 -78
- package/template/core/src/openpress/core/FrameContext.tsx +0 -24
- package/template/core/src/openpress/core/MdxArea.tsx +0 -34
- package/template/core/src/openpress/core/Press.tsx +0 -34
- package/template/core/src/openpress/core/cn.ts +0 -4
- package/template/core/src/openpress/core/index.tsx +0 -40
- package/template/core/src/openpress/core/primitives.tsx +0 -44
- package/template/core/src/openpress/core/types.ts +0 -191
- package/template/core/src/openpress/core/useSource.ts +0 -28
- package/template/core/src/openpress/document-model/anchorMapModel.ts +0 -27
- package/template/core/src/openpress/document-model/documentIndexes.ts +0 -329
- package/template/core/src/openpress/document-model/documentTypes.ts +0 -138
- package/template/core/src/openpress/document-model/index.ts +0 -6
- package/template/core/src/openpress/document-model/objectEntityModel.ts +0 -51
- package/template/core/src/openpress/document-model/projectIdentityModel.ts +0 -15
- package/template/core/src/openpress/document-model/reactDocumentMetadataModel.ts +0 -27
- package/template/core/src/openpress/manuscript/index.tsx +0 -238
- package/template/core/src/openpress/mdx/index.ts +0 -88
- package/template/core/src/openpress/numbering/index.ts +0 -294
- package/template/core/src/openpress/reader/PublicReaderPage.tsx +0 -267
- package/template/core/src/openpress/reader/ReaderNavigationPanel.tsx +0 -123
- package/template/core/src/openpress/reader/index.ts +0 -10
- package/template/core/src/openpress/reader/pageViewportScaleModel.ts +0 -73
- package/template/core/src/openpress/reader/readerPageRegistry.ts +0 -41
- package/template/core/src/openpress/reader/readerPageRoute.ts +0 -21
- package/template/core/src/openpress/reader/readerScroll.ts +0 -92
- package/template/core/src/openpress/reader/readerStateModel.ts +0 -15
- package/template/core/src/openpress/reader/readerTypes.ts +0 -4
- package/template/core/src/openpress/reader/usePageViewportScale.ts +0 -119
- package/template/core/src/openpress/reader/usePanelState.ts +0 -56
- package/template/core/src/openpress/reader/useReaderHashSync.ts +0 -61
- package/template/core/src/openpress/reader/useReaderKeyboardNav.ts +0 -48
- package/template/core/src/openpress/reader/useReaderRuntime.ts +0 -146
- package/template/core/src/openpress/reader/useReaderScrollAnchor.ts +0 -64
- package/template/core/src/openpress/shared/Panel.tsx +0 -77
- package/template/core/src/openpress/shared/frameScheduler.ts +0 -32
- package/template/core/src/openpress/shared/index.ts +0 -4
- package/template/core/src/openpress/shared/numberUtils.ts +0 -3
- package/template/core/src/openpress/shared/runtimeMode.ts +0 -11
- package/template/core/src/openpress/workbench/Workbench.tsx +0 -407
- package/template/core/src/openpress/workbench/actions/DeploymentControl.tsx +0 -157
- package/template/core/src/openpress/workbench/actions/PageZoomControl.tsx +0 -182
- package/template/core/src/openpress/workbench/actions/SearchControl.tsx +0 -345
- package/template/core/src/openpress/workbench/actions/deploymentStatusModel.ts +0 -112
- package/template/core/src/openpress/workbench/actions/index.ts +0 -5
- package/template/core/src/openpress/workbench/actions/useDeploymentWorkbench.ts +0 -136
- package/template/core/src/openpress/workbench/dialog/WorkbenchDialog.tsx +0 -72
- package/template/core/src/openpress/workbench/dialog/index.ts +0 -1
- package/template/core/src/openpress/workbench/document/components/DocumentPanel.tsx +0 -127
- package/template/core/src/openpress/workbench/document/components/InlineSourceEditorLayer.tsx +0 -207
- package/template/core/src/openpress/workbench/document/components/ReaderStage.tsx +0 -9
- package/template/core/src/openpress/workbench/document/hooks/useDocumentWorkbenchModel.ts +0 -34
- package/template/core/src/openpress/workbench/document/hooks/useInlineDocumentEditor.ts +0 -525
- package/template/core/src/openpress/workbench/document/index.ts +0 -10
- package/template/core/src/openpress/workbench/index.ts +0 -2
- package/template/core/src/openpress/workbench/inspector/InlineInspectorLayer.tsx +0 -459
- package/template/core/src/openpress/workbench/inspector/index.ts +0 -5
- package/template/core/src/openpress/workbench/inspector/inlineCommentModel.ts +0 -125
- package/template/core/src/openpress/workbench/inspector/inspectorGeometryModel.ts +0 -160
- package/template/core/src/openpress/workbench/inspector/inspectorModel.ts +0 -408
- package/template/core/src/openpress/workbench/inspector/useInspectorComments.ts +0 -248
- package/template/core/src/openpress/workbench/mentions/MentionSuggestionList.tsx +0 -41
- package/template/core/src/openpress/workbench/mentions/index.ts +0 -2
- package/template/core/src/openpress/workbench/mentions/useComposerMentions.ts +0 -185
- package/template/core/src/openpress/workbench/panels/Panel.tsx +0 -1
- package/template/core/src/openpress/workbench/panels/PendingCommentsPanel.tsx +0 -76
- package/template/core/src/openpress/workbench/panels/WorkbenchControlPanel.tsx +0 -29
- package/template/core/src/openpress/workbench/panels/index.ts +0 -3
- package/template/core/src/openpress/workbench/project/ProjectEntryPanel.tsx +0 -523
- package/template/core/src/openpress/workbench/project/ProjectPreviewDialog.tsx +0 -35
- package/template/core/src/openpress/workbench/project/index.ts +0 -2
- package/template/core/src/openpress/workbench/project/projectPreviewTypes.ts +0 -11
- package/template/core/src/openpress/workbench/project/projectSourceModel.ts +0 -24
- package/template/core/src/openpress/workbench/shell/WorkbenchShell.tsx +0 -167
- package/template/core/src/openpress/workbench/shell/index.ts +0 -1
- package/template/core/src/openpress/workbench/workbenchFormatters.ts +0 -120
- package/template/core/src/openpress/workbench/workbenchTypes.ts +0 -35
- package/template/core/src/styles/openpress/app-shell.css +0 -251
- package/template/core/src/styles/openpress/media-workspace.css +0 -230
- package/template/core/src/styles/openpress/print-route.css +0 -184
- package/template/core/src/styles/openpress/project-preview-panel.css +0 -924
- package/template/core/src/styles/openpress/public-viewer.css +0 -688
- package/template/core/src/styles/openpress/reader-runtime.css +0 -980
- package/template/core/src/styles/openpress/responsive.css +0 -245
- package/template/core/src/styles/openpress/workbench-panels.css +0 -594
- package/template/core/src/styles/openpress/workbench.css +0 -1255
- package/template/core/src/styles/openpress.css +0 -14
- package/template/core/src/vite-env.d.ts +0 -9
- package/template/core/tsconfig.json +0 -40
- package/template/core/vite.config.ts +0 -584
- package/template/packs/academic-paper/document/chapters/01-introduction/content/01-introduction.mdx +0 -35
- package/template/packs/academic-paper/document/chapters/02-methods/content/01-methods.mdx +0 -50
- package/template/packs/academic-paper/document/chapters/03-results-and-discussion/content/01-results.mdx +0 -47
- package/template/packs/academic-paper/document/chapters/04-acknowledgment/content/01-acknowledgment.mdx +0 -26
- package/template/packs/academic-paper/document/chapters/05-references/content/01-references.mdx +0 -32
- package/template/packs/academic-paper/document/components/ChapterOpenerVisual/index.tsx +0 -76
- package/template/packs/academic-paper/document/components/Page.tsx +0 -60
- package/template/packs/academic-paper/document/components/TokenSwatchGrid/index.tsx +0 -46
- package/template/packs/academic-paper/document/components/TokenSwatchGrid/style.css +0 -63
- package/template/packs/academic-paper/document/components/TypeSpecimen/index.tsx +0 -38
- package/template/packs/academic-paper/document/components/TypeSpecimen/style.css +0 -111
- package/template/packs/academic-paper/document/design.md +0 -279
- package/template/packs/academic-paper/document/index.tsx +0 -123
- package/template/packs/academic-paper/document/media/README.md +0 -13
- package/template/packs/academic-paper/document/media/figure-placeholder.svg +0 -9
- package/template/packs/academic-paper/document/openpress.config.mjs +0 -26
- package/template/packs/academic-paper/document/theme/README.md +0 -11
- package/template/packs/academic-paper/document/theme/base/page-contract.css +0 -522
- package/template/packs/academic-paper/document/theme/base/print.css +0 -93
- package/template/packs/academic-paper/document/theme/base/typography.css +0 -333
- package/template/packs/academic-paper/document/theme/fonts.css +0 -3
- package/template/packs/academic-paper/document/theme/page-surfaces/back-cover.css +0 -43
- package/template/packs/academic-paper/document/theme/page-surfaces/chapter-opener.css +0 -205
- package/template/packs/academic-paper/document/theme/page-surfaces/cover.css +0 -294
- package/template/packs/academic-paper/document/theme/page-surfaces/toc.css +0 -149
- package/template/packs/academic-paper/document/theme/patterns/_chart-frame.css +0 -49
- package/template/packs/academic-paper/document/theme/patterns/figure-grid.css +0 -68
- package/template/packs/academic-paper/document/theme/patterns/table-utilities.css +0 -66
- package/template/packs/academic-paper/document/theme/shell/reader-controls.css +0 -761
- package/template/packs/academic-paper/document/theme/tokens.css +0 -80
- package/template/packs/academic-paper/openpress.config.mjs +0 -5
- package/template/packs/claude-document/document/chapters/01-document-shape/content/01-document-shape.mdx +0 -51
- package/template/packs/claude-document/document/chapters/02-review-loop/content/01-review-loop.mdx +0 -31
- package/template/packs/claude-document/document/components/ChapterOpenerVisual.tsx +0 -96
- package/template/packs/claude-document/document/components/Page.tsx +0 -37
- package/template/packs/claude-document/document/design.md +0 -142
- package/template/packs/claude-document/document/index.tsx +0 -94
- package/template/packs/claude-document/document/media/README.md +0 -13
- package/template/packs/claude-document/document/openpress.config.mjs +0 -26
- package/template/packs/claude-document/document/theme/README.md +0 -15
- package/template/packs/claude-document/document/theme/base/page-contract.css +0 -525
- package/template/packs/claude-document/document/theme/base/print.css +0 -93
- package/template/packs/claude-document/document/theme/base/typography.css +0 -612
- package/template/packs/claude-document/document/theme/fonts.css +0 -4
- package/template/packs/claude-document/document/theme/page-surfaces/back-cover.css +0 -72
- package/template/packs/claude-document/document/theme/page-surfaces/chapter-opener.css +0 -236
- package/template/packs/claude-document/document/theme/page-surfaces/cover.css +0 -309
- package/template/packs/claude-document/document/theme/page-surfaces/toc.css +0 -225
- package/template/packs/claude-document/document/theme/patterns/_chart-frame.css +0 -53
- package/template/packs/claude-document/document/theme/patterns/figure-grid.css +0 -68
- package/template/packs/claude-document/document/theme/patterns/table-utilities.css +0 -66
- package/template/packs/claude-document/document/theme/shell/reader-controls.css +0 -789
- package/template/packs/claude-document/document/theme/tokens.css +0 -89
- package/template/packs/claude-document/openpress.config.mjs +0 -5
- package/template/packs/editorial-monograph/document/chapters/01-product-and-use-cases/content/01-product-and-use-cases.mdx +0 -31
- package/template/packs/editorial-monograph/document/chapters/02-workflow/content/01-workflow.mdx +0 -89
- package/template/packs/editorial-monograph/document/chapters/03-agent-skills-contributors/content/01-agent-skills-contributors.mdx +0 -51
- package/template/packs/editorial-monograph/document/chapters/04-validation-deploy/content/01-validation-deploy.mdx +0 -39
- package/template/packs/editorial-monograph/document/components/ChapterOpenerVisual/index.tsx +0 -76
- package/template/packs/editorial-monograph/document/components/Page.tsx +0 -37
- package/template/packs/editorial-monograph/document/components/TokenSwatchGrid/index.tsx +0 -46
- package/template/packs/editorial-monograph/document/components/TokenSwatchGrid/style.css +0 -63
- package/template/packs/editorial-monograph/document/components/TypeSpecimen/index.tsx +0 -38
- package/template/packs/editorial-monograph/document/components/TypeSpecimen/style.css +0 -111
- package/template/packs/editorial-monograph/document/design.md +0 -279
- package/template/packs/editorial-monograph/document/index.tsx +0 -97
- package/template/packs/editorial-monograph/document/media/README.md +0 -13
- package/template/packs/editorial-monograph/document/openpress.config.mjs +0 -26
- package/template/packs/editorial-monograph/document/theme/README.md +0 -11
- package/template/packs/editorial-monograph/document/theme/base/page-contract.css +0 -505
- package/template/packs/editorial-monograph/document/theme/base/print.css +0 -93
- package/template/packs/editorial-monograph/document/theme/base/typography.css +0 -336
- package/template/packs/editorial-monograph/document/theme/fonts.css +0 -3
- package/template/packs/editorial-monograph/document/theme/page-surfaces/back-cover.css +0 -43
- package/template/packs/editorial-monograph/document/theme/page-surfaces/chapter-opener.css +0 -205
- package/template/packs/editorial-monograph/document/theme/page-surfaces/cover.css +0 -147
- package/template/packs/editorial-monograph/document/theme/page-surfaces/toc.css +0 -149
- package/template/packs/editorial-monograph/document/theme/patterns/_chart-frame.css +0 -49
- package/template/packs/editorial-monograph/document/theme/patterns/figure-grid.css +0 -68
- package/template/packs/editorial-monograph/document/theme/patterns/table-utilities.css +0 -66
- package/template/packs/editorial-monograph/document/theme/shell/reader-controls.css +0 -761
- package/template/packs/editorial-monograph/document/theme/tokens.css +0 -80
- package/template/packs/editorial-monograph/openpress.config.mjs +0 -5
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
:root {
|
|
2
|
-
/* Workbench chrome */
|
|
3
|
-
--openpress-color-app-bg: #121a22;
|
|
4
|
-
--openpress-color-border-subtle: rgba(181, 174, 164, 0.22);
|
|
5
|
-
--openpress-color-border-strong: rgba(181, 174, 164, 0.44);
|
|
6
|
-
--openpress-color-text-on-dark: #f7f9fb;
|
|
7
|
-
--openpress-color-text-secondary: #d9dedf;
|
|
8
|
-
--openpress-color-text-placeholder: #9aa3a8;
|
|
9
|
-
--openpress-color-focus: #3e617a;
|
|
10
|
-
|
|
11
|
-
/* Claude-like warm document palette */
|
|
12
|
-
--openpress-color-document: #fbfaf5;
|
|
13
|
-
--openpress-color-paper: #fffdf8;
|
|
14
|
-
--openpress-color-paper-soft: #f2eee4;
|
|
15
|
-
--openpress-color-ink: #1d2832;
|
|
16
|
-
--openpress-color-body: #303235;
|
|
17
|
-
--openpress-color-muted: #63707b;
|
|
18
|
-
--openpress-color-subtle: #a9a092;
|
|
19
|
-
--openpress-color-line: #ddd5c8;
|
|
20
|
-
--openpress-color-line-strong: #b7ac9c;
|
|
21
|
-
--openpress-color-soft-line: #ece6da;
|
|
22
|
-
--openpress-color-block: #f7f3ea;
|
|
23
|
-
--openpress-color-grid: rgba(131, 113, 88, 0.055);
|
|
24
|
-
--openpress-color-grid-strong: rgba(82, 74, 62, 0.04);
|
|
25
|
-
--openpress-color-paper-grain: rgba(29, 40, 50, 0.018);
|
|
26
|
-
--openpress-color-paper-fiber: rgba(141, 128, 106, 0.022);
|
|
27
|
-
--openpress-color-paper-rhythm: rgba(29, 40, 50, 0.024);
|
|
28
|
-
--openpress-color-info: #3e617a;
|
|
29
|
-
--openpress-color-green: #617167;
|
|
30
|
-
|
|
31
|
-
/* Restrained chart/status accents on a warm paper base. */
|
|
32
|
-
--openpress-chart-gold: #8d806a;
|
|
33
|
-
--openpress-chart-coral: #756d66;
|
|
34
|
-
--openpress-chart-coral-deep: #526272;
|
|
35
|
-
--openpress-chart-dark: #1d2832;
|
|
36
|
-
--openpress-chart-cream: #fbfaf6;
|
|
37
|
-
--openpress-chart-warm-gray: #a9a092;
|
|
38
|
-
--openpress-chart-gold-bg: rgba(141, 128, 106, 0.12);
|
|
39
|
-
--openpress-chart-coral-bg: rgba(82, 98, 114, 0.1);
|
|
40
|
-
--openpress-chart-coral-deep-bg: rgba(82, 98, 114, 0.12);
|
|
41
|
-
--openpress-chart-dark-bg: rgba(29, 40, 50, 0.08);
|
|
42
|
-
--openpress-chart-gold-border: rgba(141, 128, 106, 0.32);
|
|
43
|
-
--openpress-chart-coral-border: rgba(82, 98, 114, 0.24);
|
|
44
|
-
--openpress-chart-coral-deep-border: rgba(82, 98, 114, 0.32);
|
|
45
|
-
--openpress-chart-dark-border: rgba(29, 40, 50, 0.22);
|
|
46
|
-
|
|
47
|
-
--openpress-status-warn: #8a6f5b;
|
|
48
|
-
--openpress-status-success: #617167;
|
|
49
|
-
--openpress-status-info: #3e617a;
|
|
50
|
-
|
|
51
|
-
/* Typography: warm editorial document with sans body and mono literals. */
|
|
52
|
-
--openpress-font-body: "Noto Sans TC", "PingFang TC", "Hiragino Sans", "Microsoft JhengHei", sans-serif;
|
|
53
|
-
--openpress-font-serif: Georgia, "Times New Roman", "Songti TC", "STSong", "Noto Serif TC", "PMingLiU", "MingLiU", serif;
|
|
54
|
-
--openpress-font-handwriting: var(--openpress-font-body);
|
|
55
|
-
--openpress-font-mono: "JetBrains Mono", "SFMono-Regular", "Menlo", "Consolas", monospace;
|
|
56
|
-
|
|
57
|
-
--openpress-type-step-down: 2px;
|
|
58
|
-
--openpress-text-sm: calc(9pt - var(--openpress-type-step-down));
|
|
59
|
-
--openpress-text-md: calc(11pt - var(--openpress-type-step-down));
|
|
60
|
-
--openpress-text-code: calc(10.5pt - var(--openpress-type-step-down));
|
|
61
|
-
|
|
62
|
-
--openpress-leading-body: 1.8;
|
|
63
|
-
--openpress-leading-table: 1.55;
|
|
64
|
-
|
|
65
|
-
/* Spacing system for A4 working documents */
|
|
66
|
-
--openpress-space-1: 2mm;
|
|
67
|
-
--openpress-space-2: 4mm;
|
|
68
|
-
--openpress-space-3: 6mm;
|
|
69
|
-
--openpress-space-4: 9mm;
|
|
70
|
-
--openpress-space-5: 13mm;
|
|
71
|
-
|
|
72
|
-
/* Paper surface: warm paper, low-noise fiber, and a very light vertical
|
|
73
|
-
* rhythm. This replaces visible notebook grid lines for long-form reading. */
|
|
74
|
-
--openpress-paper-texture:
|
|
75
|
-
radial-gradient(circle at 0.5px 0.5px, var(--openpress-color-paper-grain) 0.42px, transparent 0.62px),
|
|
76
|
-
radial-gradient(circle at 2.5px 1.5px, var(--openpress-color-paper-fiber) 0.34px, transparent 0.56px),
|
|
77
|
-
linear-gradient(90deg, var(--openpress-color-paper-rhythm) 1px, transparent 1px);
|
|
78
|
-
--openpress-paper-texture-size: 4px 4px, 9px 9px, 24mm 100%;
|
|
79
|
-
--openpress-paper-texture-position: 0 0, 1px 2px, 0 0;
|
|
80
|
-
|
|
81
|
-
/* Page geometry — A4 預設。
|
|
82
|
-
* 換成 B5 / Letter / 16:9 投影片時改這三條,其他 CSS 與 page-contract `@page`
|
|
83
|
-
* 都會跟著走。注意:@page size 改用 length pair 時,PDF 與瀏覽器 print 都會吃。 */
|
|
84
|
-
--openpress-page-width: 210mm;
|
|
85
|
-
--openpress-page-height: 297mm;
|
|
86
|
-
--openpress-page-aspect-ratio: 210 / 297;
|
|
87
|
-
--openpress-page-height-ratio: 1.4142857143;
|
|
88
|
-
--openpress-page-margin: 18mm;
|
|
89
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
## 產品定位與適用範圍
|
|
2
|
-
|
|
3
|
-
open-press 是一個為 AI 協作設計的固定版面文件工作區。它適合用在內容需要反覆修改、但視覺樣式與輸出格式必須穩定的長篇文件,例如計畫書、白皮書、研究報告、產品規格、書本章節、技術手冊、論文草稿與報章雜誌式專題。
|
|
4
|
-
|
|
5
|
-
一般聊天式寫作工具擅長產生段落,但不一定能穩定管理封面、章節、目錄、表格、圖表、頁碼與 PDF 輸出。open-press 把這些交付邊界明確化:文件來源維持在可讀、可版本化的 source files,視覺風格由 style pack 與 theme 承擔,最終輸出由 CLI 驗證與生成。
|
|
6
|
-
|
|
7
|
-
### 三方責任
|
|
8
|
-
|
|
9
|
-
| 角色 | 負責內容 | 不應負責 |
|
|
10
|
-
| --- | --- | --- |
|
|
11
|
-
| 使用者 | 目的、讀者、事實、限制、最終核准 | 每一頁的手動排版細節 |
|
|
12
|
-
| Agent | 章節整理、文字改寫、視覺元件、theme 調整 | 未確認數字、法律承諾、公開部署決策 |
|
|
13
|
-
| open-press | workspace 邊界、結構驗證、預覽、PDF 輸出 | 單一審美、固定語氣、文件意圖判斷 |
|
|
14
|
-
|
|
15
|
-
這個分工讓 AI 可以真正參與文件製作,同時避免在無邊界的設計畫布裡任意改動。使用者不需要把每個檔案的操作步驟說清楚,只要指定目標、讀者、風格與限制,Agent 就能在 open-press 的框架內完成內容與設計工作。
|
|
16
|
-
|
|
17
|
-
### 適用範圍
|
|
18
|
-
|
|
19
|
-
open-press 適合處理「長文內容」與「固定視覺樣式」同時存在的工作。這類文件通常不只是幾段文字,而是需要封面、目錄、章節、表格、圖表、註腳、頁面節奏與可交付輸出。
|
|
20
|
-
|
|
21
|
-
| 文件類型 | 典型需求 | open-press 提供的協助 |
|
|
22
|
-
| --- | --- | --- |
|
|
23
|
-
| 計畫書、提案書 | 目標、問題、方案、時程、預期成果 | 結構整理、章節節奏、PDF 交付 |
|
|
24
|
-
| 白皮書、研究報告 | 長段論述、表格、圖表、引用式說明 | 固定版面、圖表包裝、章節管理 |
|
|
25
|
-
| 書本、手冊、教材 | 章節連貫、段落密度、讀者導引 | 長文編輯、樣式一致、可反覆修訂 |
|
|
26
|
-
| 論文、技術報告 | 嚴謹語氣、術語一致、資料呈現 | 中文潤飾、表格密度、輸出驗證 |
|
|
27
|
-
| 報章雜誌、專刊 | 編輯風格、專題頁面、視覺節奏 | style pack、cover、章首與版面控制 |
|
|
28
|
-
|
|
29
|
-
若文件只是一次性的短文、聊天紀錄或不需要固定輸出的草稿,open-press 可能不是最輕量的選擇。它真正有價值的地方,是讓多輪 AI 編輯仍然保有一致的文件形狀,並且能在交付前檢查 source、預覽與 PDF。
|
|
30
|
-
|
|
31
|
-
目前內建的 `editorial-monograph` style pack 偏向 A4 嚴肅長文:細線、留白、章節清楚、表格與圖表克制。這種風格適合產品說明、研究報告、正式提案與技術文件,也適合作為公開 showcase 的起點。
|
package/template/packs/editorial-monograph/document/chapters/02-workflow/content/01-workflow.mdx
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
## User Guide:手把手上手 open-press
|
|
2
|
-
|
|
3
|
-
open-press 的使用方式不是先學會每個檔案怎麼改,而是用自然語言帶著 Agent 完成一份固定版面文件。User 負責說明目的、提供事實與做最後判斷;Agent 依照 skill 編輯 source files;open-press 負責預覽、驗證、PDF 與部署流程。
|
|
4
|
-
|
|
5
|
-
### Step 1:準備文件目標
|
|
6
|
-
|
|
7
|
-
開始前,User 只需要準備三件事:這份文件要給誰看、讀者看完要做什麼決策、哪些事實不能由 Agent 自行補充。若已有素材,可以上傳簡報、草稿、訪談逐字稿、研究筆記或既有文件;若還沒有素材,也可以先請 Agent 產生一份需要 User 補事實的草稿。
|
|
8
|
-
|
|
9
|
-
可以這樣說:
|
|
10
|
-
|
|
11
|
-
```txt
|
|
12
|
-
請參考這一份文件(自行上傳),使用 openpress-writing skill 幫我整理成一份產品說明文件。
|
|
13
|
-
讀者是第一次接觸 open-press 的使用者。保留既有事實,不要新增未確認的數字。
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
### Step 2:選擇文件風格
|
|
17
|
-
|
|
18
|
-
open-press 從 style pack 起手。Style pack 會提供可運行的 starter、版面節奏、字體、顏色、封面、章節、表格與 PDF 輸出規則。User 不需要先設計整套視覺系統,只要指定文件需要的風格方向。
|
|
19
|
-
|
|
20
|
-
如果是從 GitHub 開始,可以先取得 open-press framework:
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
git clone https://github.com/quan0715/openpress.git
|
|
24
|
-
cd openpress
|
|
25
|
-
npm install
|
|
26
|
-
npm run dev
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
例如:
|
|
30
|
-
|
|
31
|
-
```txt
|
|
32
|
-
請以 editorial-monograph skill 作為風格,使用 openpress-writing skill 建立文件。
|
|
33
|
-
我希望它像正式白皮書,不要像行銷 landing page。
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
### Step 3:讓 Agent 編輯 source files
|
|
37
|
-
|
|
38
|
-
| 位置 | 用途 | 常見 Agent 任務 |
|
|
39
|
-
| --- | --- | --- |
|
|
40
|
-
| `content/` | 正文、封面、目錄、章節、封底 | 重寫章節、調整順序、加入表格 |
|
|
41
|
-
| `design.md` | 文件風格說明,給 user 與 agent 共讀 | 說明風格規則、紀錄設計決策 |
|
|
42
|
-
| `theme/` | CSS tokens、版面、typography、print rules | 調整字體、顏色、頁面節奏 |
|
|
43
|
-
| `components/` | 文件專屬圖表或視覺元件 | 抽出可重用資料視覺 |
|
|
44
|
-
| `media/` | 圖片與二進位素材 | 整理封面圖、插圖、照片 |
|
|
45
|
-
|
|
46
|
-
User 可以直接描述想改什麼,不需要指定檔案路徑。Agent 會回到這些 source files 編輯,而不是手改生成產物。這讓文件能被版本控制、能被驗證,也能在多輪修改後維持同一套設計。
|
|
47
|
-
|
|
48
|
-
### Step 4:打開本機 workbench 一起看稿
|
|
49
|
-
|
|
50
|
-
open-press 本機 workbench 是 User 和 Agent 共同工作的預設入口。Agent 透過 `openpress` skill 打開本機 workbench,User 在瀏覽器裡檢查兩個視角:Document 看正式文件、Project 看來源與素材狀態。風格規則改在 `document/design.md`,編輯器或 GitHub 上直接讀。
|
|
51
|
-
|
|
52
|
-
可以這樣說:
|
|
53
|
-
|
|
54
|
-
```txt
|
|
55
|
-
請使用 openpress skill 打開本機 workbench。
|
|
56
|
-
我會看 Document 跟 Project,再告訴你要調整哪裡。
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
### Step 5:用回饋迭代到可交付
|
|
60
|
-
|
|
61
|
-
審稿時,User 可以用自然語言指出問題:某章太抽象、表格太密、語氣太像廣告、缺少新手指引、或部署設定還不清楚。Agent 會把回饋轉成內容、設計或 workflow 變更,完成後重新 export 與 validate。
|
|
62
|
-
|
|
63
|
-
常見回饋方式:
|
|
64
|
-
|
|
65
|
-
| User 想做的事 | 可以怎麼說 |
|
|
66
|
-
| --- | --- |
|
|
67
|
-
| 改寫章節 | 這章改成 user guide,請手把手帶新手上手。 |
|
|
68
|
-
| 調整語氣 | 這段不要像宣傳文,改成產品文件的語氣。 |
|
|
69
|
-
| 補工作流 | 加上我應該怎麼下 prompt、Agent 會做什麼、我需要確認什麼。 |
|
|
70
|
-
| 檢查交付 | 跑 export、validate 和 PDF,確認可以公開給其他 user 看。 |
|
|
71
|
-
|
|
72
|
-
### Step 6:輸出或部署
|
|
73
|
-
|
|
74
|
-
文件可交付前,Agent 應先跑 `openpress:export`、`openpress:validate`,必要時再跑 `openpress:pdf`。若要公開上線,改用 `openpress-deploy` 進入部署流程;部署前必須確認 target project、公開網址、授權素材與文件中的事實。
|
|
75
|
-
|
|
76
|
-
常見部署檢查如下:
|
|
77
|
-
|
|
78
|
-
```bash
|
|
79
|
-
npm run openpress:export
|
|
80
|
-
npm run openpress:validate
|
|
81
|
-
npm run openpress:pdf
|
|
82
|
-
npm run openpress:deploy:dry-run
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
真正公開發布時,再由 User 明確確認目標專案:
|
|
86
|
-
|
|
87
|
-
```bash
|
|
88
|
-
npm run openpress:deploy -- --confirm
|
|
89
|
-
```
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
## Agent 互動、Skill 分工與貢獻者
|
|
2
|
-
|
|
3
|
-
使用 Codex、CloudCode 或其他 CLI agent 時,建議直接要求它使用對應 skill。使用者不需要描述每一個檔案怎麼改,而是要說清楚文件目標、讀者、風格、限制,以及完成後要執行哪些驗證。
|
|
4
|
-
|
|
5
|
-
### 常用互動方式
|
|
6
|
-
|
|
7
|
-
| 目標 | 可以這樣說 |
|
|
8
|
-
| --- | --- |
|
|
9
|
-
| 檢查 open-press 狀態與工具 | 請使用 `openpress skill` 檢查目前 workspace,可用 inspect/search/validate 說明文件狀態。 |
|
|
10
|
-
| 從既有資料建立文件 | 請參考這一份文件(自行上傳),使用 `openpress-writing skill` 協助整理成 8 頁產品提案。保留既有事實,不要新增未確認的數字。 |
|
|
11
|
-
| 以風格起手建立新文件 | 請以 `editorial-monograph skill` 作為風格,使用 `openpress-writing skill` 建立一份研究報告。讀者是管理層,缺少的事實請標成 placeholder。 |
|
|
12
|
-
| 開啟本機審稿 | 請使用 `openpress skill` 打開本機 workbench,讓我檢查 Document、Design System 與 Project 狀態。 |
|
|
13
|
-
| 規劃長篇文件層級 | 請使用 `openpress-writing skill` 規劃 H2/H3/H4、目錄深度與附錄位置(已併入 writing skill 的 Hierarchy section)。 |
|
|
14
|
-
| 重寫章節 | 請使用 `openpress-writing skill` 重整章節,讓第一章先講問題、第二章講方案,語氣維持正式研究報告。 |
|
|
15
|
-
| 調整版面 | 請使用 `openpress-design skill` 調整 theme 與 components,讓文件維持 A4 長文閱讀節奏。 |
|
|
16
|
-
| 中文潤飾 | 請使用 `chinese-ai-writing-polish skill` 潤飾中文,保留原意,不要改成廣告文案。 |
|
|
17
|
-
| 部署檢查 | 請使用 `openpress-deploy skill` 檢查部署設定,先跑 dry run,不要直接公開部署。 |
|
|
18
|
-
|
|
19
|
-
好的指令通常包含四件事:文件要給誰看、讀完要做什麼決策、哪些事實不能改、完成後要跑哪些驗證。若文件會公開上線,還應明確要求 Agent 不要新增未確認的客戶案例、數字、法律承諾或發布日期。
|
|
20
|
-
|
|
21
|
-
### Skill 分工
|
|
22
|
-
|
|
23
|
-
open-press 使用 skill 讓 Agent 在不同層次工作。`openpress` 是 Core / CLI skill,負責工具入口與 source/generated 邊界;文件建立、層級規劃、審稿、部署、寫作、設計、風格與語言潤飾仍由專責 skill 承擔。這樣做可以避免把所有規則硬寫進框架,也讓每份文件保有自己的風格。
|
|
24
|
-
|
|
25
|
-
| Skill | 主要用途 | 使用時機 |
|
|
26
|
-
| --- | --- | --- |
|
|
27
|
-
| `openpress` | CLI、workspace inspect/search/replace、本機 workbench、驗證與輸出邊界 | Agent 不確定該用哪個 open-press 工具、要開本機審稿、或要選 specialist skill |
|
|
28
|
-
| `openpress-deploy` | 部署設定、preflight、dry run、公開發布確認 | 準備上線或接前端部署按鈕 |
|
|
29
|
-
| `openpress-writing` | 章節順序、敘事結構、表格與 caption 文案、**H1/H2/H3/H4 結構、TOC 深度、附錄位置** | 建立、重寫或重整內容;長文骨架調整 |
|
|
30
|
-
| `openpress-design` | theme、版面、page rhythm、components | 調整視覺系統與輸出穩定性 |
|
|
31
|
-
| `openpress-style-pack-contributor` | style pack 設計、starter 契約、貢獻驗證 | 新增或改良 `skills/<pack>/starter/` |
|
|
32
|
-
| `editorial-monograph` | A4 嚴肅長文風格 | 報告、提案、白皮書、產品說明 |
|
|
33
|
-
| `chinese-ai-writing-polish` | 繁體中文專業潤飾、去除 AI 腔 | 公開文件、提案、網站與報告文案 |
|
|
34
|
-
|
|
35
|
-
本機 workbench 是 open-press 與使用者互動的基本入口。Agent 透過 `openpress` skill 與 `npm run dev` 打開 workbench,讓使用者在 Document 與 Project 視角中檢查內容;風格規則寫在 `document/design.md`,編輯器內直接讀。部署則由 `openpress-deploy` 接手,先完成設定、preflight 與 dry run,再由使用者確認公開發布。
|
|
36
|
-
|
|
37
|
-
### Style pack 貢獻者
|
|
38
|
-
|
|
39
|
-
Style pack 是 open-press 的重要概念。它不是單純的 CSS,而是把設計規則、starter 內容、theme、`design.md` 與可運行範例包在一起。Agent 可以用 style pack 建立工作區,再依照文件目的調整細節。
|
|
40
|
-
|
|
41
|
-
新的貢獻者角色先聚焦在 style pack 的設計。這個角色不需要一開始修改 engine,而是要把一種清楚的文件風格轉成可被 Agent 使用、可被使用者預覽、可被 CLI 驗證的 starter workspace。
|
|
42
|
-
|
|
43
|
-
貢獻 style pack 時,可以這樣要求 Agent:
|
|
44
|
-
|
|
45
|
-
```txt
|
|
46
|
-
請使用 openpress-style-pack-contributor skill 設計一個新的 open-press style pack。
|
|
47
|
-
這個 pack 面向需要固定版面輸出的長篇文件,請先定義視覺哲學、
|
|
48
|
-
starter 結構、design.md、theme tokens、頁面樣式與驗證方式。
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
`editorial-monograph` 的風格特徵是細線、克制色彩、A4 固定版面、serif 章首、sans 正文、TOC 與 figure/table 編號。它適合正式、長篇、需要交付 PDF 的文件,也能讓讀者在 showcase 中看見 open-press 對固定版面文件的控制能力。
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
## 驗證、預覽與公開上線
|
|
2
|
-
|
|
3
|
-
open-press 把交付流程當成文件的一部分。內容或設計完成後,Agent 應先產生 document model,再檢查 workspace 結構,必要時輸出 PDF。公開上線前,使用者仍需要確認事實、授權素材與部署目標。
|
|
4
|
-
|
|
5
|
-
### 指令與產物
|
|
6
|
-
|
|
7
|
-
| 目的 | 指令 | 結果 |
|
|
8
|
-
| --- | --- | --- |
|
|
9
|
-
| 開發預覽 | `npm run dev` | 在本機 workbench 檢查文件與設計 |
|
|
10
|
-
| 匯出模型 | `npm run openpress:export` | 產生 `public/openpress/document.json` |
|
|
11
|
-
| 結構驗證 | `npm run openpress:validate` | 檢查 source、assets 與 open-press 邊界 |
|
|
12
|
-
| 建置輸出 | `npm run openpress:render` | 產生可部署的 `dist-react/` |
|
|
13
|
-
| PDF 交付 | `npm run openpress:pdf` | 輸出固定版面 PDF |
|
|
14
|
-
| 部署 dry run | `npm run openpress:deploy:dry-run` | 檢查部署步驟,不公開發布 |
|
|
15
|
-
| 公開部署 | `npm run openpress:deploy -- --confirm` | 經使用者確認後部署 |
|
|
16
|
-
|
|
17
|
-
公開文件需要特別注意三件事。第一,事實與數字必須由使用者核准;Agent 可以整理語氣,但不應自己創造商業成果。第二,圖片、字體與引用資料要確認授權。第三,公開部署需要明確同意,尤其是含有公司資料、客戶資訊或尚未發布功能的文件。
|
|
18
|
-
|
|
19
|
-
### 部署設定
|
|
20
|
-
|
|
21
|
-
open-press 的部署設定放在 `openpress.config.mjs`,而不是藏在前端按鈕裡。以 Cloudflare Pages 為例,文件需要明確的 adapter、輸出目錄與 project name:
|
|
22
|
-
|
|
23
|
-
```js
|
|
24
|
-
deploy: {
|
|
25
|
-
adapter: "cloudflare-pages",
|
|
26
|
-
source: ".deploy/openpress-showcase",
|
|
27
|
-
projectName: "openpress-showcase",
|
|
28
|
-
commitDirty: false,
|
|
29
|
-
requiresConfirmation: true,
|
|
30
|
-
}
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
未來前端介面的部署按鈕應該只是這套流程的視覺入口。按鈕可以顯示目標 project、部署狀態、PDF 連結與 dirty 狀態,但實際執行仍應走 open-press CLI 與 `openpress-deploy` 的安全檢查。缺少 `deploy.projectName` 或使用者尚未確認時,按鈕應停在 setup / review 狀態,而不是直接發布。
|
|
34
|
-
|
|
35
|
-
### Showcase 本身
|
|
36
|
-
|
|
37
|
-
這份 showcase 文件本身也展示了 open-press 的流程:它由 React/MDX source 組成,套用 `editorial-monograph` 風格,透過 open-press CLI 匯出與驗證,最後能以 workbench 或 PDF 形式交付給讀者。
|
|
38
|
-
|
|
39
|
-
它也示範了 open-press 的互動模型:使用者提出文件目的與調整方向,Agent 透過 skill 拆解工作,本機 workbench 讓雙方共同審稿,deploy workflow 則在公開發布前補上設定、dry run 與確認。
|
package/template/packs/editorial-monograph/document/components/ChapterOpenerVisual/index.tsx
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
const TONES = new Set(["sage", "lavender", "mint", "amber"]);
|
|
2
|
-
|
|
3
|
-
const VISUALS = {
|
|
4
|
-
"linked-list": `<svg viewBox="0 0 520 330" focusable="false" aria-hidden="true">
|
|
5
|
-
<rect class="chapter-opener-illustration__paper" x="42" y="96" width="116" height="82" rx="4" />
|
|
6
|
-
<rect class="chapter-opener-illustration__paper" x="204" y="96" width="116" height="82" rx="4" />
|
|
7
|
-
<rect class="chapter-opener-illustration__paper" x="366" y="96" width="116" height="82" rx="4" />
|
|
8
|
-
<path class="chapter-opener-illustration__stroke" d="M158 137 H204" />
|
|
9
|
-
<path class="chapter-opener-illustration__stroke" d="M320 137 H366" />
|
|
10
|
-
<path class="chapter-opener-illustration__arrow" d="M190 122 206 137 190 152" />
|
|
11
|
-
<path class="chapter-opener-illustration__arrow" d="M352 122 368 137 352 152" />
|
|
12
|
-
<path class="chapter-opener-illustration__thin" d="M72 128 H118 M72 150 H128 M234 128 H280 M234 150 H286 M396 128 H442 M396 150 H452" />
|
|
13
|
-
<circle class="chapter-opener-illustration__node" cx="144" cy="137" r="13" />
|
|
14
|
-
<circle class="chapter-opener-illustration__node" cx="306" cy="137" r="13" />
|
|
15
|
-
<circle class="chapter-opener-illustration__node" cx="468" cy="137" r="13" />
|
|
16
|
-
<path class="chapter-opener-illustration__stroke" d="M262 178 C262 222 220 244 158 244 C98 244 68 222 68 190" />
|
|
17
|
-
<path class="chapter-opener-illustration__arrow" d="M52 204 68 188 84 204" />
|
|
18
|
-
</svg>`,
|
|
19
|
-
tree: `<svg viewBox="0 0 520 330" focusable="false" aria-hidden="true">
|
|
20
|
-
<path class="chapter-opener-illustration__paper" d="M232 40 316 40 352 86 330 132 218 132 194 86Z" />
|
|
21
|
-
<path class="chapter-opener-illustration__paper" d="M88 198 170 178 228 218 204 288 100 288 58 240Z" />
|
|
22
|
-
<path class="chapter-opener-illustration__paper" d="M314 198 400 176 466 224 450 292 328 292 282 238Z" />
|
|
23
|
-
<path class="chapter-opener-illustration__stroke" d="M262 118 160 214 M270 118 374 214" />
|
|
24
|
-
<path class="chapter-opener-illustration__stroke" d="M160 214 122 258 M160 214 204 258 M374 214 330 258 M374 214 420 258" />
|
|
25
|
-
<circle class="chapter-opener-illustration__node" cx="266" cy="100" r="24" />
|
|
26
|
-
<circle class="chapter-opener-illustration__node" cx="160" cy="214" r="22" />
|
|
27
|
-
<circle class="chapter-opener-illustration__node" cx="374" cy="214" r="22" />
|
|
28
|
-
<circle class="chapter-opener-illustration__dot" cx="122" cy="258" r="13" />
|
|
29
|
-
<circle class="chapter-opener-illustration__dot" cx="204" cy="258" r="13" />
|
|
30
|
-
<circle class="chapter-opener-illustration__dot" cx="330" cy="258" r="13" />
|
|
31
|
-
<circle class="chapter-opener-illustration__dot" cx="420" cy="258" r="13" />
|
|
32
|
-
</svg>`,
|
|
33
|
-
code: `<svg viewBox="0 0 520 330" focusable="false" aria-hidden="true">
|
|
34
|
-
<path class="chapter-opener-illustration__paper" d="M92 52 338 52 386 104 386 286 92 286Z" />
|
|
35
|
-
<path class="chapter-opener-illustration__paper" d="M348 82 438 82 476 122 452 226 356 226 326 154Z" />
|
|
36
|
-
<path class="chapter-opener-illustration__thin" d="M132 112 H250 M132 146 H292 M132 180 H238 M132 214 H276" />
|
|
37
|
-
<path class="chapter-opener-illustration__stroke" d="M308 114 C340 122 356 148 356 180 C356 220 332 244 292 250" />
|
|
38
|
-
<path class="chapter-opener-illustration__arrow" d="M304 226 288 250 316 260" />
|
|
39
|
-
<path class="chapter-opener-illustration__stroke" d="M406 124 V202" />
|
|
40
|
-
<circle class="chapter-opener-illustration__node" cx="406" cy="124" r="17" />
|
|
41
|
-
<circle class="chapter-opener-illustration__node" cx="406" cy="202" r="17" />
|
|
42
|
-
</svg>`,
|
|
43
|
-
answers: `<svg viewBox="0 0 520 330" focusable="false" aria-hidden="true">
|
|
44
|
-
<path class="chapter-opener-illustration__paper" d="M128 44 396 44 440 90 418 292 104 292 82 86Z" />
|
|
45
|
-
<path class="chapter-opener-illustration__thin" d="M178 116 H350 M178 168 H350 M178 220 H322" />
|
|
46
|
-
<path class="chapter-opener-illustration__stroke" d="M128 112 148 134 190 88" />
|
|
47
|
-
<path class="chapter-opener-illustration__stroke" d="M128 164 148 186 190 140" />
|
|
48
|
-
<path class="chapter-opener-illustration__stroke" d="M128 216 148 238 190 192" />
|
|
49
|
-
<circle class="chapter-opener-illustration__node" cx="386" cy="92" r="18" />
|
|
50
|
-
<path class="chapter-opener-illustration__stroke" d="M386 92 C420 126 424 172 394 208" />
|
|
51
|
-
<path class="chapter-opener-illustration__arrow" d="M380 186 394 210 420 200" />
|
|
52
|
-
</svg>`,
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
export type ChapterOpenerVisualVariant = keyof typeof VISUALS;
|
|
56
|
-
|
|
57
|
-
export interface ChapterOpenerVisualProps {
|
|
58
|
-
variant?: ChapterOpenerVisualVariant;
|
|
59
|
-
tone?: string;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export default function ChapterOpenerVisual({
|
|
63
|
-
variant = "linked-list",
|
|
64
|
-
tone = "sage",
|
|
65
|
-
}: ChapterOpenerVisualProps) {
|
|
66
|
-
const visual = VISUALS[variant] ?? VISUALS["linked-list"];
|
|
67
|
-
const safeTone = TONES.has(tone) ? tone : "sage";
|
|
68
|
-
|
|
69
|
-
return (
|
|
70
|
-
<figure
|
|
71
|
-
className={`chapter-opener-illustration chapter-opener-illustration--${variant} chapter-opener-tone--${safeTone}`}
|
|
72
|
-
aria-hidden="true"
|
|
73
|
-
dangerouslySetInnerHTML={{ __html: visual }}
|
|
74
|
-
/>
|
|
75
|
-
);
|
|
76
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { Frame, MdxArea } from "@open-press/core";
|
|
2
|
-
import type { SectionsPageProps } from "@open-press/core/manuscript";
|
|
3
|
-
|
|
4
|
-
export default function Page({
|
|
5
|
-
frameKey,
|
|
6
|
-
chainId,
|
|
7
|
-
pageIndex,
|
|
8
|
-
totalPages,
|
|
9
|
-
sectionSlug,
|
|
10
|
-
sectionTitle,
|
|
11
|
-
sectionTone,
|
|
12
|
-
}: SectionsPageProps) {
|
|
13
|
-
return (
|
|
14
|
-
<Frame
|
|
15
|
-
frameKey={frameKey}
|
|
16
|
-
role="manuscript.content"
|
|
17
|
-
className="reader-page--content"
|
|
18
|
-
data-page-index={pageIndex}
|
|
19
|
-
data-total-pages={totalPages}
|
|
20
|
-
data-section-id={sectionSlug}
|
|
21
|
-
data-chapter-tone={sectionTone}
|
|
22
|
-
>
|
|
23
|
-
<div className="page-frame">
|
|
24
|
-
<header className="page-header" aria-hidden="true" />
|
|
25
|
-
<main className="page-body">
|
|
26
|
-
<MdxArea chainId={chainId} />
|
|
27
|
-
</main>
|
|
28
|
-
<footer className="page-footer" aria-hidden="true">
|
|
29
|
-
<span className="footer-left">{sectionTitle}</span>
|
|
30
|
-
<span className="footer-right">
|
|
31
|
-
{totalPages > 1 ? `${pageIndex + 1}/${totalPages}` : pageIndex + 1}
|
|
32
|
-
</span>
|
|
33
|
-
</footer>
|
|
34
|
-
</div>
|
|
35
|
-
</Frame>
|
|
36
|
-
);
|
|
37
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import type { CSSProperties } from "react";
|
|
2
|
-
|
|
3
|
-
export interface TokenSwatch {
|
|
4
|
-
name: string;
|
|
5
|
-
hex: string;
|
|
6
|
-
summary: string;
|
|
7
|
-
swatchVar: string;
|
|
8
|
-
swatchBorderVar?: string;
|
|
9
|
-
dark?: boolean;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface TokenSwatchGridProps {
|
|
13
|
-
ariaLabel?: string;
|
|
14
|
-
swatches: TokenSwatch[];
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export default function TokenSwatchGrid({
|
|
18
|
-
ariaLabel = "Color specimen",
|
|
19
|
-
swatches,
|
|
20
|
-
}: TokenSwatchGridProps) {
|
|
21
|
-
return (
|
|
22
|
-
<section className="token-swatch-grid" data-openpress-component="TokenSwatchGrid" aria-label={ariaLabel}>
|
|
23
|
-
{swatches.map((swatch) => (
|
|
24
|
-
<article
|
|
25
|
-
key={swatch.name}
|
|
26
|
-
className={swatch.dark ? "token-swatch token-swatch--dark" : "token-swatch"}
|
|
27
|
-
style={swatchStyle(swatch)}
|
|
28
|
-
>
|
|
29
|
-
<div className="token-swatch__sample" />
|
|
30
|
-
<div className="token-swatch__body">
|
|
31
|
-
<h4>{swatch.name}</h4>
|
|
32
|
-
<code>{swatch.hex}</code>
|
|
33
|
-
<p>{swatch.summary}</p>
|
|
34
|
-
</div>
|
|
35
|
-
</article>
|
|
36
|
-
))}
|
|
37
|
-
</section>
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function swatchStyle(swatch: TokenSwatch): CSSProperties {
|
|
42
|
-
return {
|
|
43
|
-
"--swatch": swatch.swatchVar,
|
|
44
|
-
...(swatch.swatchBorderVar ? { "--swatch-border": swatch.swatchBorderVar } : {}),
|
|
45
|
-
} as CSSProperties;
|
|
46
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
/* token-swatch-grid
|
|
2
|
-
* Color specimen grid referenced by design.md to display each color token with
|
|
3
|
-
* its sample, hex, and usage note.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
.token-swatch-grid {
|
|
7
|
-
display: grid;
|
|
8
|
-
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
9
|
-
gap: 3mm;
|
|
10
|
-
margin: var(--openpress-space-3) 0 var(--openpress-space-4);
|
|
11
|
-
break-inside: avoid;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.token-swatch {
|
|
15
|
-
min-height: 42mm;
|
|
16
|
-
overflow: hidden;
|
|
17
|
-
border: 1px solid var(--openpress-color-line);
|
|
18
|
-
border-radius: 6px;
|
|
19
|
-
background: var(--openpress-color-document);
|
|
20
|
-
box-sizing: border-box;
|
|
21
|
-
break-inside: avoid;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.token-swatch__sample {
|
|
25
|
-
height: 17mm;
|
|
26
|
-
background: var(--swatch);
|
|
27
|
-
border-bottom: 1px solid var(--swatch-border, var(--openpress-color-line));
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.token-swatch__body {
|
|
31
|
-
padding: 3mm;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.token-swatch h4 {
|
|
35
|
-
margin: 0;
|
|
36
|
-
color: var(--openpress-color-ink);
|
|
37
|
-
font-family: var(--openpress-font-body);
|
|
38
|
-
font-size: 9pt;
|
|
39
|
-
font-weight: 600;
|
|
40
|
-
line-height: 1.25;
|
|
41
|
-
letter-spacing: 0;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.token-swatch code {
|
|
45
|
-
display: block;
|
|
46
|
-
margin-top: 1mm;
|
|
47
|
-
color: var(--openpress-color-muted);
|
|
48
|
-
font-size: 8pt;
|
|
49
|
-
line-height: 1.35;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.token-swatch p {
|
|
53
|
-
margin: 2mm 0 0;
|
|
54
|
-
color: #333333;
|
|
55
|
-
font-size: 8.4pt;
|
|
56
|
-
line-height: 1.45;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
@media (max-width: 899px) {
|
|
60
|
-
.token-swatch-grid {
|
|
61
|
-
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
62
|
-
}
|
|
63
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
export type TypeSpecimenVariant =
|
|
2
|
-
| "metric"
|
|
3
|
-
| "cover-title"
|
|
4
|
-
| "chapter-title"
|
|
5
|
-
| "section-title"
|
|
6
|
-
| "body"
|
|
7
|
-
| "caption";
|
|
8
|
-
|
|
9
|
-
export interface TypeSpecimenRow {
|
|
10
|
-
name: string;
|
|
11
|
-
spec: string;
|
|
12
|
-
sample: string;
|
|
13
|
-
sampleVariant: TypeSpecimenVariant;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export interface TypeSpecimenProps {
|
|
17
|
-
ariaLabel?: string;
|
|
18
|
-
rows: TypeSpecimenRow[];
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export default function TypeSpecimen({
|
|
22
|
-
ariaLabel = "Typography specimen",
|
|
23
|
-
rows,
|
|
24
|
-
}: TypeSpecimenProps) {
|
|
25
|
-
return (
|
|
26
|
-
<section className="type-specimen" data-openpress-component="TypeSpecimen" aria-label={ariaLabel}>
|
|
27
|
-
{rows.map((row) => (
|
|
28
|
-
<div className="type-specimen__row" key={row.name}>
|
|
29
|
-
<div className="type-specimen__meta">
|
|
30
|
-
<strong>{row.name}</strong>
|
|
31
|
-
<span>{row.spec}</span>
|
|
32
|
-
</div>
|
|
33
|
-
<p className={`type-specimen__sample type-specimen__sample--${row.sampleVariant}`}>{row.sample}</p>
|
|
34
|
-
</div>
|
|
35
|
-
))}
|
|
36
|
-
</section>
|
|
37
|
-
);
|
|
38
|
-
}
|