@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.
Files changed (113) hide show
  1. package/dist/cli.js +114 -23
  2. package/package.json +1 -1
  3. package/template/core/CHANGELOG.md +97 -1
  4. package/template/core/README.md +9 -5
  5. package/template/core/engine/cli.mjs +2 -5
  6. package/template/core/engine/commands/_shared.mjs +4 -4
  7. package/template/core/engine/commands/deploy.mjs +1 -1
  8. package/template/core/engine/commands/inspect.mjs +3 -3
  9. package/template/core/engine/commands/replace.mjs +1 -1
  10. package/template/core/engine/commands/search.mjs +1 -1
  11. package/template/core/engine/commands/validate.mjs +2 -2
  12. package/template/core/engine/document-export.mjs +1 -1
  13. package/template/core/engine/{chrome-pdf.mjs → output/chrome-pdf.mjs} +1 -2
  14. package/template/core/engine/{deploy-sync.mjs → output/deploy-sync.mjs} +2 -2
  15. package/template/core/engine/{fonts.mjs → output/fonts.mjs} +1 -1
  16. package/template/core/engine/{public-assets.mjs → output/public-assets.mjs} +2 -2
  17. package/template/core/engine/{static-server.mjs → output/static-server.mjs} +2 -2
  18. package/template/core/engine/react/caption-numbering.mjs +73 -0
  19. package/template/core/engine/react/comment-marker.mjs +54 -10
  20. package/template/core/engine/react/document-entry.mjs +124 -64
  21. package/template/core/engine/react/document-export.mjs +252 -311
  22. package/template/core/engine/react/mdx-compile.mjs +123 -3
  23. package/template/core/engine/react/measurement-css.mjs +3 -3
  24. package/template/core/engine/react/pagination/allocator.mjs +122 -0
  25. package/template/core/engine/react/pagination/regions.mjs +81 -0
  26. package/template/core/engine/react/pagination.mjs +9 -121
  27. package/template/core/engine/react/pipeline/allocate.mjs +248 -0
  28. package/template/core/engine/react/pipeline/final-render.mjs +94 -0
  29. package/template/core/engine/react/pipeline/frame-measurement.mjs +271 -0
  30. package/template/core/engine/react/pipeline/press-tree.mjs +135 -0
  31. package/template/core/engine/react/project-asset-endpoint.mjs +2 -2
  32. package/template/core/engine/react/{chapter-css.mjs → section-css.mjs} +12 -9
  33. package/template/core/engine/react/sources/heading-numbering.mjs +132 -0
  34. package/template/core/engine/react/sources/mdx-resolver.mjs +441 -0
  35. package/template/core/engine/react/{workspace-discovery.mjs → style-discovery.mjs} +29 -40
  36. package/template/core/engine/{config.mjs → runtime/config.mjs} +15 -0
  37. package/template/core/engine/{file-utils.mjs → runtime/file-utils.mjs} +1 -1
  38. package/template/core/engine/{inspection.mjs → runtime/inspection.mjs} +3 -4
  39. package/template/core/engine/{source-text-tools.mjs → runtime/source-text-tools.mjs} +24 -7
  40. package/template/core/engine/runtime/source-workspace.mjs +186 -0
  41. package/template/core/engine/{validation.mjs → runtime/validation.mjs} +19 -17
  42. package/template/core/package.json +5 -2
  43. package/template/core/src/openpress/anchorMap.ts +27 -0
  44. package/template/core/src/openpress/core/Frame.tsx +80 -0
  45. package/template/core/src/openpress/core/FrameContext.tsx +19 -0
  46. package/template/core/src/openpress/core/MdxArea.tsx +35 -0
  47. package/template/core/src/openpress/core/Press.tsx +34 -0
  48. package/template/core/src/openpress/core/index.tsx +34 -15
  49. package/template/core/src/openpress/core/primitives.tsx +23 -0
  50. package/template/core/src/openpress/core/types.ts +131 -19
  51. package/template/core/src/openpress/core/useSource.ts +28 -0
  52. package/template/core/src/openpress/manuscript/index.tsx +196 -0
  53. package/template/core/src/openpress/mdx/index.ts +88 -0
  54. package/template/core/src/openpress/numbering/index.ts +294 -0
  55. package/template/core/src/openpress/publicPage.tsx +4 -186
  56. package/template/core/src/openpress/reactDocumentMetadata.ts +2 -16
  57. package/template/core/src/openpress/types.ts +0 -16
  58. package/template/core/src/openpress/workbench.tsx +2 -36
  59. package/template/core/src/styles/openpress/responsive.css +0 -14
  60. package/template/core/tsconfig.json +4 -1
  61. package/template/core/vite.config.ts +10 -3
  62. package/template/packs/academic-paper/document/chapters/01-introduction/content/01-introduction.mdx +21 -0
  63. package/template/packs/academic-paper/document/chapters/02-methods/content/01-methods.mdx +30 -0
  64. package/template/packs/academic-paper/document/chapters/03-results-and-discussion/content/01-results.mdx +29 -0
  65. package/template/packs/academic-paper/document/chapters/04-acknowledgment/content/01-acknowledgment.mdx +12 -0
  66. package/template/packs/academic-paper/document/chapters/05-references/content/01-references.mdx +27 -0
  67. package/template/packs/academic-paper/document/components/ChapterOpenerVisual/index.tsx +76 -0
  68. package/template/packs/academic-paper/document/components/Page.tsx +37 -0
  69. package/template/packs/academic-paper/document/components/TokenSwatchGrid/index.tsx +46 -0
  70. package/template/packs/academic-paper/document/components/TokenSwatchGrid/style.css +63 -0
  71. package/template/packs/academic-paper/document/components/TypeSpecimen/index.tsx +38 -0
  72. package/template/packs/academic-paper/document/components/TypeSpecimen/style.css +111 -0
  73. package/template/packs/academic-paper/document/design.md +279 -0
  74. package/template/packs/academic-paper/document/index.tsx +131 -0
  75. package/template/packs/academic-paper/document/media/README.md +13 -0
  76. package/template/packs/academic-paper/document/openpress.config.mjs +26 -0
  77. package/template/packs/academic-paper/document/theme/README.md +11 -0
  78. package/template/packs/academic-paper/document/theme/base/page-contract.css +505 -0
  79. package/template/packs/academic-paper/document/theme/base/print.css +93 -0
  80. package/template/packs/academic-paper/document/theme/base/typography.css +336 -0
  81. package/template/packs/academic-paper/document/theme/fonts.css +3 -0
  82. package/template/packs/academic-paper/document/theme/page-surfaces/back-cover.css +43 -0
  83. package/template/packs/academic-paper/document/theme/page-surfaces/chapter-opener.css +205 -0
  84. package/template/packs/academic-paper/document/theme/page-surfaces/cover.css +267 -0
  85. package/template/packs/academic-paper/document/theme/page-surfaces/toc.css +149 -0
  86. package/template/packs/academic-paper/document/theme/patterns/_chart-frame.css +49 -0
  87. package/template/packs/academic-paper/document/theme/patterns/figure-grid.css +68 -0
  88. package/template/packs/academic-paper/document/theme/patterns/table-utilities.css +66 -0
  89. package/template/packs/academic-paper/document/theme/shell/reader-controls.css +761 -0
  90. package/template/packs/academic-paper/document/theme/tokens.css +80 -0
  91. package/template/packs/academic-paper/openpress.config.mjs +5 -0
  92. package/template/packs/claude-document/document/components/Page.tsx +24 -14
  93. package/template/packs/claude-document/document/design.md +2 -2
  94. package/template/packs/claude-document/document/index.tsx +67 -62
  95. package/template/packs/claude-document/document/theme/page-surfaces/toc.css +19 -7
  96. package/template/packs/editorial-monograph/document/components/Page.tsx +24 -14
  97. package/template/packs/editorial-monograph/document/design.md +2 -2
  98. package/template/packs/editorial-monograph/document/index.tsx +71 -47
  99. package/template/packs/editorial-monograph/document/theme/page-surfaces/toc.css +19 -9
  100. package/template/core/engine/commands/migrate-to-react.mjs +0 -27
  101. package/template/core/engine/page-renderer.mjs +0 -217
  102. package/template/core/engine/react/migrate-to-react.mjs +0 -355
  103. package/template/core/engine/source-workspace.mjs +0 -76
  104. package/template/core/src/openpress/core/basePages.tsx +0 -87
  105. package/template/core/src/openpress/pagination.ts +0 -845
  106. package/template/packs/claude-document/document/chapters/01-document-shape/chapter.tsx +0 -30
  107. package/template/packs/claude-document/document/chapters/02-review-loop/chapter.tsx +0 -30
  108. /package/template/core/engine/{chrome-pdf.d.mts → output/chrome-pdf.d.mts} +0 -0
  109. /package/template/core/engine/{katex-assets.mjs → output/katex-assets.mjs} +0 -0
  110. /package/template/core/engine/{page-block.mjs → output/page-block.mjs} +0 -0
  111. /package/template/core/engine/{pdf-media.mjs → output/pdf-media.mjs} +0 -0
  112. /package/template/core/engine/{config.d.mts → runtime/config.d.mts} +0 -0
  113. /package/template/core/engine/{issue-report.mjs → runtime/issue-report.mjs} +0 -0
@@ -33,18 +33,14 @@ import {
33
33
  ProjectEntryPanel,
34
34
  type ProjectMentionItem,
35
35
  } from "./projectWorkspace";
36
- import { paginateSourcePages, type PaginatedPage } from "./pagination";
36
+ import { createAnchorPageMap, resolveAnchorPageIndex } from "./anchorMap";
37
37
  import { scheduleBrowserFrame } from "./frameScheduler";
38
38
  import {
39
- createAnchorPageMap,
40
- numberSourceHeadings,
41
39
  PUBLIC_DRAWER_BREAKPOINT,
42
40
  PublicPage,
43
- resolveAnchorPageIndex,
44
41
  useViewMode,
45
42
  } from "./publicPage";
46
43
  import { getProjectIdentity } from "./projectIdentity";
47
- import { hasBuildTimePagination } from "./reactDocumentMetadata";
48
44
  import { buildPublicPreviewHref, isLocalWorkspaceHost } from "./runtimeMode";
49
45
  import { useReaderRuntime } from "./readerRuntime";
50
46
  import type { DeploymentInfo, ReaderDocument, HtmlPageBlock, SourceBlock } from "./types";
@@ -123,14 +119,9 @@ export function HtmlWorkbench({
123
119
  deploymentInfo: DeploymentInfo;
124
120
  }) {
125
121
  const sourceContainerRef = useRef<HTMLDivElement | null>(null);
126
- const numberedPages = useMemo(() => numberSourceHeadings(pages), [pages]);
122
+ const displayPages = pages;
127
123
  const viewModeState = useViewMode();
128
124
  const { viewMode } = viewModeState;
129
- const buildTimePaginated = hasBuildTimePagination(document);
130
- const [paginatedPages, setPaginatedPages] = useState<PaginatedPage[] | null>(null);
131
- const displayPages: DisplayPage[] = viewMode === "paged" && !buildTimePaginated
132
- ? (paginatedPages ?? numberedPages)
133
- : numberedPages;
134
125
  const mediaAssets = useMemo(() => collectMediaAssetIndex(displayPages), [displayPages]);
135
126
  const anchorPageMap = useMemo(() => createAnchorPageMap(displayPages), [displayPages]);
136
127
  const projectComponentUsages = useMemo(() => createProjectComponentUsages(displayPages), [displayPages]);
@@ -163,7 +154,6 @@ export function HtmlWorkbench({
163
154
  const pdfButtonText = workbenchPdfButtonText(localDeployEnabled, pdfActionStatus, staticPdfHref);
164
155
  const pdfStatusMessage = workbenchPdfStatusMessage(localDeployEnabled, pdfActionStatus);
165
156
  const pdfButtonDisabled = localDeployEnabled ? pdfActionStatus === "generating" || pdfActionStatus === "opening" : !staticPdfHref;
166
- const activePaginatedReady = viewMode === "reading" || buildTimePaginated || Boolean(paginatedPages);
167
157
  const inspectorSelectionLabel = formatInspectorSelection(inspector.selectedBlock);
168
158
  const activeInlineSavedComment = getInlineSavedCommentForTarget(inlineSavedComment, inspector.selectedTarget);
169
159
  const inspectorCommentDisabled = !inspector.selectedBlock || !inspectorCommentText.trim() || inspectorCommentStatus === "submitting";
@@ -392,10 +382,6 @@ export function HtmlWorkbench({
392
382
  scheduleBrowserFrame(() => reader.setPage(reader.currentPageIndex, { behavior: "auto" }));
393
383
  };
394
384
 
395
- useLayoutEffect(() => {
396
- setPaginatedPages(null);
397
- }, [numberedPages]);
398
-
399
385
  useEffect(() => {
400
386
  setInspectorCommentStatus("idle");
401
387
  setInspectorCommentError("");
@@ -407,24 +393,6 @@ export function HtmlWorkbench({
407
393
  void refreshPendingComments();
408
394
  }, [devMode, refreshPendingComments, workspaceView]);
409
395
 
410
- useLayoutEffect(() => {
411
- if (buildTimePaginated) return undefined;
412
- if (viewMode !== "paged" || paginatedPages) return undefined;
413
- const sourceContainer = sourceContainerRef.current;
414
- if (!sourceContainer) return undefined;
415
-
416
- let cancelled = false;
417
- const cancelFrame = scheduleBrowserFrame(() => {
418
- const nextPages = paginateSourcePages(sourceContainer, numberedPages);
419
- if (!cancelled) setPaginatedPages(nextPages);
420
- });
421
-
422
- return () => {
423
- cancelled = true;
424
- cancelFrame();
425
- };
426
- }, [buildTimePaginated, numberedPages, paginatedPages, viewMode]);
427
-
428
396
  const actionSection = (
429
397
  <section className="openpress-public-action-section" aria-label="輸出">
430
398
  <span className="openpress-public-action-heading">輸出</span>
@@ -512,7 +480,6 @@ export function HtmlWorkbench({
512
480
  className={`reader-app openpress-reader-app openpress-public-viewer openpress-dev-public-viewer is-ready${reader.rightPanelOpen ? "" : " is-closed-right"}`}
513
481
  data-openpress-react-runtime="true"
514
482
  data-openpress-view-mode={viewMode}
515
- data-openpress-pagination={activePaginatedReady ? "ready" : "pending"}
516
483
  data-openpress-inspector-mode={inspector.inspectorMode ? "on" : "off"}
517
484
  data-active-workspace={workspaceView}
518
485
  >
@@ -533,7 +500,6 @@ export function HtmlWorkbench({
533
500
  pages={displayPages}
534
501
  currentPageIndex={reader.currentPageIndex}
535
502
  devMode={devMode}
536
- paginatedReady={activePaginatedReady}
537
503
  sourceContainerRef={sourceContainerRef}
538
504
  registerPage={reader.registerPage}
539
505
  exposeSourceData={devMode}
@@ -269,12 +269,6 @@
269
269
  box-shadow: none;
270
270
  }
271
271
 
272
- .openpress-public-viewer.openpress-reader-app[data-openpress-pagination="pending"] .openpress-public-navigation {
273
- transform: translateX(-110%);
274
- pointer-events: none;
275
- box-shadow: none;
276
- }
277
-
278
272
  .openpress-public-viewer.openpress-reader-app .openpress-public-scrim {
279
273
  position: fixed;
280
274
  inset: 0;
@@ -309,14 +303,6 @@
309
303
  display: block;
310
304
  }
311
305
 
312
- .openpress-public-viewer.openpress-reader-app[data-openpress-pagination="pending"] .openpress-public-scrim {
313
- display: none;
314
- }
315
-
316
- .openpress-public-viewer.openpress-reader-app[data-openpress-pagination="pending"] .openpress-public-fab {
317
- display: flex;
318
- }
319
-
320
306
  .openpress-public-viewer[data-openpress-view-mode="paged"] .reader-pages {
321
307
  --openpress-public-page-width: min(
322
308
  var(--openpress-page-width),
@@ -17,7 +17,10 @@
17
17
  "noEmit": true,
18
18
  "jsx": "react-jsx",
19
19
  "paths": {
20
- "@openpress/core": ["./src/openpress/core/index.tsx"],
20
+ "@open-press/core": ["./src/openpress/core/index.tsx"],
21
+ "@open-press/core/mdx": ["./src/openpress/mdx/index.ts"],
22
+ "@open-press/core/manuscript": ["./src/openpress/manuscript/index.tsx"],
23
+ "@open-press/core/numbering": ["./src/openpress/numbering/index.ts"],
21
24
  "@/components": ["./document/components/index.ts", "./document/components/index.tsx"],
22
25
  "@/components/*": ["./document/components/*"],
23
26
  "@/*": ["./src/*"]
@@ -5,7 +5,7 @@ import path from "node:path";
5
5
  import type { IncomingMessage, ServerResponse } from "node:http";
6
6
  import { defineConfig } from "vite";
7
7
  import react from "@vitejs/plugin-react";
8
- import { loadConfig, publicPdfHref } from "./engine/config.mjs";
8
+ import { loadConfig, publicPdfHref } from "./engine/runtime/config.mjs";
9
9
  import { handleCommentRequest } from "./engine/react/comment-endpoint.mjs";
10
10
  import { handleProjectAssetRequest } from "./engine/react/project-asset-endpoint.mjs";
11
11
 
@@ -15,8 +15,11 @@ const workspaceRoot = process.env.OPENPRESS_WORKSPACE_ROOT
15
15
  : frameworkRoot;
16
16
  const sourceRoot = path.join(frameworkRoot, "src");
17
17
  const openpressCliPath = path.join(frameworkRoot, "engine", "cli.mjs");
18
- const staticServerPath = path.join(frameworkRoot, "engine", "static-server.mjs");
18
+ const staticServerPath = path.join(frameworkRoot, "engine", "output", "static-server.mjs");
19
19
  const openpressCoreEntry = path.join(frameworkRoot, "src", "openpress", "core", "index.tsx");
20
+ const openpressMdxEntry = path.join(frameworkRoot, "src", "openpress", "mdx", "index.ts");
21
+ const openpressManuscriptEntry = path.join(frameworkRoot, "src", "openpress", "manuscript", "index.tsx");
22
+ const openpressNumberingEntry = path.join(frameworkRoot, "src", "openpress", "numbering", "index.ts");
20
23
  const openpressConfig = await loadConfig(workspaceRoot);
21
24
  const outputDir = openpressConfig.paths.outputDir;
22
25
  const reactDocumentRoot = openpressConfig.paths.documentRoot;
@@ -55,7 +58,11 @@ export default defineConfig({
55
58
  resolve: {
56
59
  dedupe: ["react", "react-dom", "@mdx-js/react"],
57
60
  alias: {
58
- "@openpress/core": openpressCoreEntry,
61
+ // Subpaths must come before the base path so resolution matches longest first.
62
+ "@open-press/core/mdx": openpressMdxEntry,
63
+ "@open-press/core/manuscript": openpressManuscriptEntry,
64
+ "@open-press/core/numbering": openpressNumberingEntry,
65
+ "@open-press/core": openpressCoreEntry,
59
66
  "@/components": reactDocumentComponentsRoot,
60
67
  "@": sourceRoot,
61
68
  ...workspaceAliases,
@@ -0,0 +1,21 @@
1
+ ## Introduction
2
+
3
+ This document is a model and starting point for an academic paper drafted in open-press. The structure follows the IEEE conference template conventions where they make sense for screen-first reading: numbered sections, italic sub-sections, an abstract block, and a numbered references list. The two-column body of IEEEtran is not yet supported — single-column will land as the v0.8 paged.js migration arrives.
4
+
5
+ Use this pack for **drafting, iteration, and preprint distribution**. When the paper is ready for venue submission, export the prose into the publisher's required LaTeX class (`IEEEtran`, `acmart`, etc.). The pack does not replace LaTeX for camera-ready submission; it replaces the awkward iteration loop *before* submission.
6
+
7
+ ### Where to start
8
+
9
+ Each chapter directory under `document/chapters/` is one paper section:
10
+
11
+ - `01-introduction/` — motivate the work, state the contribution, summarise the structure.
12
+ - `02-methods/` — describe what you did, with enough detail to reproduce.
13
+ - `03-results-and-discussion/` — present results with figures and tables; interpret what they mean.
14
+ - `04-acknowledgment/` — acknowledge funding, collaborators, reviewers.
15
+ - `05-references/` — numbered `[1]`, `[2]` references.
16
+
17
+ Replace each chapter's MDX content with your own. The skeleton text below each `##` heading is illustrative — overwrite it.
18
+
19
+ ### Abstract and Index Terms
20
+
21
+ Edit the abstract and index terms inside `document/index.tsx` (the `cover` JSX export). They render on the title page above the body. Keep the abstract under 250 words and avoid abbreviations, symbols, or math in it.
@@ -0,0 +1,30 @@
1
+ ## Methods
2
+
3
+ Describe the materials, instruments, datasets, models, or procedures you used. Anyone familiar with the field should be able to reproduce your work from this section.
4
+
5
+ ### Apparatus and Materials
6
+
7
+ Specify hardware, software versions, datasets, and any pre-processing. Cite reused work using `[N]` numeric references (e.g. "we trained the encoder following the procedure of [3]").
8
+
9
+ ### Procedure
10
+
11
+ Describe the experimental procedure as steps a reader could follow:
12
+
13
+ 1. State the input data and pre-processing.
14
+ 2. State the model / algorithm / instrument settings.
15
+ 3. State the evaluation metric(s) and any held-out splits.
16
+ 4. State randomness control (seeds, repeats, confidence reporting).
17
+
18
+ ### Notation
19
+
20
+ Define notation early. Italicise Roman symbols for quantities and variables, but not Greek symbols. Use a long dash rather than a hyphen for a minus sign. Number equations consecutively:
21
+
22
+ $$a + b = \gamma \tag{1}$$
23
+
24
+ Refer to equations by `(1)`, not `Eq. (1)` or `equation (1)`, except at the start of a sentence: "Equation (1) shows ...".
25
+
26
+ ### Reporting Units
27
+
28
+ - Use SI (MKS) as primary units; English units only as secondary (in parentheses).
29
+ - Don't mix complete spellings and abbreviations: "Wb/m²" or "webers per square meter", not "webers/m²".
30
+ - Use a zero before decimal points: `0.25`, not `.25`.
@@ -0,0 +1,29 @@
1
+ ## Results and Discussion
2
+
3
+ Present the findings of your study, then interpret what they mean for the research question stated in the introduction.
4
+
5
+ ### Quantitative Results
6
+
7
+ Use a table to summarise results across conditions. Caption above the table.
8
+
9
+ <TableCaption>Sample comparison of conditions.</TableCaption>
10
+
11
+ | Condition | Metric A | Metric B | Notes |
12
+ | --- | --- | --- | --- |
13
+ | Baseline | 0.71 | 0.65 | Prior work [3] |
14
+ | Ours (v1) | 0.78 | 0.69 | This work |
15
+ | Ours (v2) | **0.83** | **0.72** | Best |
16
+
17
+ Cite figures and tables in the text the first time they appear: "Fig. 1 shows the architecture", "Table I summarises the conditions". Use `Fig.` even at the start of a sentence; spell out `Figure` only when it is the subject.
18
+
19
+ ### Qualitative Discussion
20
+
21
+ Discuss what the results mean. State the limitations honestly — if the experiment doesn't cover a case you'd like to claim, say so. Avoid the word "essentially" when you mean "approximately" or "effectively".
22
+
23
+ ### Threats to Validity
24
+
25
+ Briefly list what could invalidate the results: small sample size, single dataset, environmental drift, evaluator bias, etc. Reviewers will look for this section; pre-empt it.
26
+
27
+ ### Future Work
28
+
29
+ Indicate where the work goes next. Keep this to one short paragraph — over-claiming future scope hurts more than it helps in review.
@@ -0,0 +1,12 @@
1
+ ## Acknowledgment
2
+
3
+ The preferred American spelling is *acknowledgment* without an "e" after the "g". Avoid stilted constructions like "one of us (R. B. G.) thanks ...". Prefer "R. B. G. thanks ...".
4
+
5
+ Acknowledge:
6
+
7
+ - Funding sources (with grant numbers if applicable).
8
+ - Collaborators who contributed materially but are not listed as authors.
9
+ - Anonymous reviewers whose comments improved the paper.
10
+ - Institutional or computational resources.
11
+
12
+ Place sponsor acknowledgments in the unnumbered footnote on the first page of the published version. In this draft pack, keep them here until you migrate to a publisher's class file at submission time.
@@ -0,0 +1,27 @@
1
+ ## References
2
+
3
+ Number citations consecutively within square brackets `[1]`. Sentence punctuation follows the bracket. Refer simply to the reference number, as in `[3]` — do not use `Ref. [3]` or `reference [3]` except at the start of a sentence: "Reference [3] was the first ...".
4
+
5
+ Unless there are six authors or more, give all authors' names; do not use `et al.`. Papers not yet published should be cited as *unpublished*; accepted but not yet published as *in press*. Capitalize only the first word in a paper title, except for proper nouns and element symbols.
6
+
7
+ For papers published in translation journals, give the English citation first, followed by the original foreign-language citation.
8
+
9
+ ---
10
+
11
+ [1] G. Eason, B. Noble, and I. N. Sneddon, "On certain integrals of Lipschitz–Hankel type involving products of Bessel functions," *Phil. Trans. Roy. Soc. London*, vol. A247, pp. 529–551, April 1955.
12
+
13
+ [2] J. Clerk Maxwell, *A Treatise on Electricity and Magnetism*, 3rd ed., vol. 2. Oxford: Clarendon, 1892, pp. 68–73.
14
+
15
+ [3] I. S. Jacobs and C. P. Bean, "Fine particles, thin films and exchange anisotropy," in *Magnetism*, vol. III, G. T. Rado and H. Suhl, Eds. New York: Academic, 1963, pp. 271–350.
16
+
17
+ [4] K. Elissa, "Title of paper if known," unpublished.
18
+
19
+ [5] R. Nicole, "Title of paper with only first word capitalized," *J. Name Stand. Abbrev.*, in press.
20
+
21
+ [6] Y. Yorozu, M. Hirano, K. Oka, and Y. Tagawa, "Electron spectroscopy studies on magneto-optical media and plastic substrate interface," *IEEE Transl. J. Magn. Japan*, vol. 2, pp. 740–741, August 1987.
22
+
23
+ [7] M. Young, *The Technical Writer's Handbook*. Mill Valley, CA: University Science, 1989.
24
+
25
+ ---
26
+
27
+ > **Reminder**: replace the seven placeholder references above with your own bibliography before circulating the draft. They are the IEEE conference template's example citations and have nothing to do with your paper.
@@ -0,0 +1,76 @@
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
+ }
@@ -0,0 +1,37 @@
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
+ }
@@ -0,0 +1,46 @@
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
+ }
@@ -0,0 +1,63 @@
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
+ }
@@ -0,0 +1,38 @@
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
+ }