@open-document/core 0.13.0 → 0.13.2
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/{build-CbgIk6bA.js → build-CvsOak5B.js} +1 -1
- package/dist/{check-BTroj-5Z.js → check-CbUBwYmf.js} +3 -3
- package/dist/cli/bin.js +9 -9
- package/dist/{config-DKKNIbvO.js → config-CltJJVsw.js} +337 -180
- package/dist/{context-DXNP8v9I.js → context-CWgfsHoE.js} +1 -1
- package/dist/{dev-YXumw5iX.js → dev-B8H2qT6G.js} +1 -1
- package/dist/{diff-CTFfU4Tz.js → diff-BvIjjgnc.js} +2 -2
- package/dist/{export-D2QLtF84.js → export-DX30_s2q.js} +3 -3
- package/dist/{import-CcmrFetU.js → import-DgsdJT5e.js} +2 -2
- package/dist/index.js +3 -0
- package/dist/ops/index.d.ts +96 -11
- package/dist/ops/index.js +3 -3
- package/dist/{ops-DmEecq1k.js → ops-CSR5RlrE.js} +1 -1
- package/dist/{preview-_mHpBhMk.js → preview-DYMUNjXL.js} +1 -1
- package/dist/{templates-MMblHwmT.js → templates-B5Tz0AKb.js} +3 -3
- package/dist/vite/index.js +1 -1
- package/package.json +1 -1
- package/src/app/components/code-block.tsx +4 -0
- package/src/app/lib/docx/from-dom.ts +292 -15
- package/src/app/lib/docx/ooxml.test.ts +88 -0
- package/src/app/lib/docx/ooxml.ts +118 -27
- package/src/app/lib/export-docx.ts +31 -2
- package/src/app/lib/export-dom.ts +10 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as closeRenderSession, t as checkLayout } from "./ops-
|
|
3
|
-
import { t as cliContext } from "./context-
|
|
1
|
+
import { j as listDocIds } from "./config-CltJJVsw.js";
|
|
2
|
+
import { n as closeRenderSession, t as checkLayout } from "./ops-CSR5RlrE.js";
|
|
3
|
+
import { t as cliContext } from "./context-CWgfsHoE.js";
|
|
4
4
|
import chalk from "chalk";
|
|
5
5
|
//#region src/cli/check.ts
|
|
6
6
|
function line(finding) {
|
package/dist/cli/bin.js
CHANGED
|
@@ -154,39 +154,39 @@ async function run(argv) {
|
|
|
154
154
|
program.name("open-doc").description("Author documents — we handle the Vite/React stack, pagination, and export.").version(version, "-v, --version", "print version").helpOption("-h, --help", "show help").showHelpAfterError(chalk.dim("(run `open-doc --help` for usage)"));
|
|
155
155
|
program.command("dev").description("Start the dev server").addOption(new Option("-p, --port <port>", "port to listen on").argParser(parsePort)).addOption(new Option("--host [host]", "expose on the network (optional host)")).option("--open", "open the browser on start").option("--no-skills-check", "skip the built-in skills drift check").option("--mcp", "serve an MCP endpoint at /mcp (requires @open-document/mcp)").action(async (flags) => {
|
|
156
156
|
if (flags.skillsCheck !== false) await runSkillsDriftCheck(resolveBuiltinSkillsDir());
|
|
157
|
-
const { dev } = await import("../dev-
|
|
157
|
+
const { dev } = await import("../dev-B8H2qT6G.js");
|
|
158
158
|
await dev(flags);
|
|
159
159
|
});
|
|
160
160
|
program.command("build").description("Build a static site").option("--out-dir <dir>", "output directory (defaults to `dist`)").action(async (flags) => {
|
|
161
|
-
const { build } = await import("../build-
|
|
161
|
+
const { build } = await import("../build-CvsOak5B.js");
|
|
162
162
|
await build(flags);
|
|
163
163
|
});
|
|
164
164
|
program.command("preview").description("Preview the production build").addOption(new Option("-p, --port <port>", "port to listen on").argParser(parsePort)).addOption(new Option("--host [host]", "expose on the network (optional host)")).option("--open", "open the browser on start").action(async (flags) => {
|
|
165
|
-
const { preview } = await import("../preview-
|
|
165
|
+
const { preview } = await import("../preview-DYMUNjXL.js");
|
|
166
166
|
await preview(flags);
|
|
167
167
|
});
|
|
168
168
|
program.command("export [docIds...]").description("Render documents headlessly to PDF, HTML, PNG, or DOCX").addOption(new Option("-f, --format <format>", "output format").choices([...EXPORT_FORMATS])).option("-o, --out-dir <dir>", "directory to write into (defaults to `out`)").option("--all", "export every document under docs/").option("--each", "one copy per row of the document's `records`").option("--name <pattern>", "with --each: file name, e.g. \"certificate-{name}\" ({#} is the row number)").action(async (docIds, flags) => {
|
|
169
|
-
const { exportDocs } = await import("../export-
|
|
169
|
+
const { exportDocs } = await import("../export-DX30_s2q.js");
|
|
170
170
|
await exportDocs(docIds, flags);
|
|
171
171
|
});
|
|
172
172
|
program.command("diff <docId>").description("Show what changed in a document since a git revision, page by page").option("-s, --since <rev>", "revision to compare against (defaults to HEAD)").option("-o, --out-dir <dir>", "directory to write the report into (defaults to `out`)").option("--json", "print the result as JSON").action(async (docId, flags) => {
|
|
173
|
-
const { diffDoc } = await import("../diff-
|
|
173
|
+
const { diffDoc } = await import("../diff-BvIjjgnc.js");
|
|
174
174
|
await diffDoc(docId, flags);
|
|
175
175
|
});
|
|
176
176
|
program.command("check [docIds...]").description("Report layout faults — clipped content, blank sheets, stranded headings").option("--json", "print the full report as JSON").action(async (docIds, flags) => {
|
|
177
|
-
const { checkDocs } = await import("../check-
|
|
177
|
+
const { checkDocs } = await import("../check-CbUBwYmf.js");
|
|
178
178
|
await checkDocs(docIds, flags);
|
|
179
179
|
});
|
|
180
180
|
program.command("templates").description("List the templates a new document can start from").option("--json", "print them as JSON").action(async (flags) => {
|
|
181
|
-
const { printTemplates } = await import("../templates-
|
|
181
|
+
const { printTemplates } = await import("../templates-B5Tz0AKb.js");
|
|
182
182
|
await printTemplates(flags);
|
|
183
183
|
});
|
|
184
184
|
program.command("new [docId]").description("Create a document under docs/ from a template (see `open-doc templates`)").option("-t, --template <name>", "template to start from (defaults to blank)").option("--title <title>", "title of the new document").action(async (docId, flags) => {
|
|
185
|
-
const { newDoc } = await import("../templates-
|
|
185
|
+
const { newDoc } = await import("../templates-B5Tz0AKb.js");
|
|
186
186
|
await newDoc(docId, flags);
|
|
187
187
|
});
|
|
188
188
|
program.command("import <file>").description("Turn a Markdown file into a document under docs/").option("--id <id>", "document id (defaults to a slug of the title)").option("--title <title>", "override the title").option("--subtitle <subtitle>", "subtitle, also used as the cover eyebrow").option("--lang <tag>", "language of the text, e.g. zh-Hant-TW (detected for CJK when omitted)").option("--author <author>", "author line on the cover").option("--theme <theme>", "theme id to back-link from meta.theme").addOption(new Option("--page-size <size>", "page size").choices(PAGE_SIZE_NAMES)).addOption(new Option("--orientation <orientation>", "page orientation").choices(ORIENTATIONS)).option("--no-cover", "skip the title page").option("--contents", "add a self-filling contents page").action(async (file, flags) => {
|
|
189
|
-
const { importDoc } = await import("../import-
|
|
189
|
+
const { importDoc } = await import("../import-DgsdJT5e.js");
|
|
190
190
|
await importDoc(file, flags);
|
|
191
191
|
});
|
|
192
192
|
program.command("sync:skills").description("Sync built-in skills from @open-document/core into this workspace").option("--dry-run", "show what would change without writing").action(async (flags) => {
|