@open-document/core 0.11.0 → 0.12.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/{build-BHFGY8eF.js → build-DfUfpeTR.js} +1 -1
- package/dist/{check-UEBmDfT_.js → check-CHxiOkQG.js} +3 -3
- package/dist/cli/bin.js +20 -33
- package/dist/{config-B_pdNbYg.js → config-9IdbhVuT.js} +1402 -675
- package/dist/{context-BM9_-u9P.js → context-BLI1-64_.js} +2 -2
- package/dist/{dev-DX3QMIRi.js → dev-yNYKv5mm.js} +1 -1
- package/dist/{diff-DayvbXfX.js → diff-Bs205mOx.js} +2 -2
- package/dist/{export-BPsXj1i6.js → export-tkquS5O5.js} +11 -4
- package/dist/{import-71wlAsrd.js → import-D1hIKIr3.js} +3 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +63 -28
- package/dist/ops/index.d.ts +111 -2
- package/dist/ops/index.js +3 -3
- package/dist/{ops-BUo67DaP.js → ops-Dgqujq5a.js} +85 -164
- package/dist/package-version-C89gtYSk.js +36 -0
- package/dist/{preview-D3m1-gUL.js → preview-BImdTH6K.js} +1 -1
- package/dist/{sdk-CpDEGRIo.d.ts → sdk-CHEGeINh.d.ts} +46 -1
- package/dist/templates-DT5zzqHq.js +34 -0
- package/dist/vite/index.js +1 -1
- package/package.json +2 -1
- package/skills/apply-comments/SKILL.md +3 -1
- package/skills/create-doc/SKILL.md +2 -0
- package/skills/doc-authoring/SKILL.md +2 -0
- package/src/app/components/browser/browser-ui.tsx +21 -0
- package/src/app/components/browser/new-document-dialog.tsx +208 -0
- package/src/app/components/changes/changes-overlay.tsx +68 -0
- package/src/app/components/changes/changes-panel.tsx +341 -0
- package/src/app/components/changes/use-changes.ts +85 -0
- package/src/app/components/comments/comments-overlay.tsx +50 -0
- package/src/app/components/comments/comments-panel.tsx +272 -0
- package/src/app/components/comments/use-comments.ts +61 -0
- package/src/app/components/doc-sidebar.tsx +32 -2
- package/src/app/components/inspector/field-source.tsx +41 -0
- package/src/app/components/inspector/inspector.tsx +64 -65
- package/src/app/components/overlay-frame.tsx +79 -0
- package/src/app/components/page-frame.tsx +4 -0
- package/src/app/components/page-placement.ts +68 -0
- package/src/app/components/record-picker.tsx +79 -0
- package/src/app/components/themes/theme-preview.tsx +5 -4
- package/src/app/lib/agent-bridge.ts +29 -1
- package/src/app/lib/docx/ooxml.test.ts +24 -1
- package/src/app/lib/docx/ooxml.ts +27 -1
- package/src/app/lib/export-docx.ts +3 -1
- package/src/app/lib/export-dom.ts +2 -1
- package/src/app/lib/export-html.ts +4 -2
- package/src/app/lib/export-image.ts +2 -1
- package/src/app/lib/flow-measure.test.ts +30 -0
- package/src/app/lib/flow-measure.ts +35 -10
- package/src/app/lib/i18n-ja/browser.ts +10 -0
- package/src/app/lib/i18n-ja/doc.ts +4 -0
- package/src/app/lib/i18n-ja/panels.ts +40 -0
- package/src/app/lib/i18n-ko/browser.ts +10 -0
- package/src/app/lib/i18n-ko/doc.ts +4 -0
- package/src/app/lib/i18n-ko/panels.ts +39 -0
- package/src/app/lib/i18n-zh-cn/browser.ts +10 -0
- package/src/app/lib/i18n-zh-cn/doc.ts +4 -0
- package/src/app/lib/i18n-zh-cn/panels.ts +38 -0
- package/src/app/lib/i18n-zh-tw/browser.ts +10 -0
- package/src/app/lib/i18n-zh-tw/doc.ts +4 -0
- package/src/app/lib/i18n-zh-tw/panels.ts +38 -0
- package/src/app/lib/records.test.ts +38 -0
- package/src/app/lib/records.ts +127 -0
- package/src/app/lib/sdk.ts +29 -0
- package/src/app/lib/use-doc-module.ts +7 -0
- package/src/app/lib/use-doc-pages.ts +15 -9
- package/src/app/routes/doc.tsx +274 -13
- package/src/app/routes/home.tsx +30 -5
- package/src/app/styles.css +23 -0
- package/templates/blank/index.tsx +63 -0
- package/templates/blank/template.json +6 -0
- package/templates/certificate/data/recipients.csv +4 -0
- package/templates/certificate/index.tsx +128 -0
- package/templates/certificate/template.json +6 -0
- package/templates/letter/index.tsx +106 -0
- package/templates/letter/template.json +5 -0
- package/templates/meeting-notes/index.tsx +194 -0
- package/templates/meeting-notes/template.json +6 -0
- package/templates/proposal/index.tsx +264 -0
- package/templates/proposal/template.json +6 -0
- package/templates/report/data/metrics.csv +5 -0
- package/templates/report/index.tsx +224 -0
- package/templates/report/template.json +6 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { t as cliContext } from "./context-
|
|
1
|
+
import { D as listDocIds } from "./config-9IdbhVuT.js";
|
|
2
|
+
import { n as closeRenderSession, t as checkLayout } from "./ops-Dgqujq5a.js";
|
|
3
|
+
import { t as cliContext } from "./context-BLI1-64_.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
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { i as ORIENTATIONS, o as PAGE_SIZE_NAMES, r as EXPORT_FORMATS } from "../sdk-CqNZzbkz.js";
|
|
3
|
+
import { n as readCoreVersion } from "../package-version-C89gtYSk.js";
|
|
3
4
|
import chalk from "chalk";
|
|
4
5
|
import path from "node:path";
|
|
5
6
|
import * as readline from "node:readline/promises";
|
|
6
7
|
import { fileURLToPath } from "node:url";
|
|
7
8
|
import { Command, Option } from "commander";
|
|
8
|
-
import fs
|
|
9
|
+
import fs from "node:fs/promises";
|
|
9
10
|
import { existsSync } from "node:fs";
|
|
10
11
|
//#region \0rolldown/runtime.js
|
|
11
12
|
var __defProp = Object.defineProperty;
|
|
@@ -19,28 +20,6 @@ var __exportAll = (all, no_symbols) => {
|
|
|
19
20
|
return target;
|
|
20
21
|
};
|
|
21
22
|
//#endregion
|
|
22
|
-
//#region src/cli/package-version.ts
|
|
23
|
-
const PACKAGE_NAME = "@open-document/core";
|
|
24
|
-
/**
|
|
25
|
-
* Walks up for this package's own `package.json` instead of assuming a fixed
|
|
26
|
-
* depth: the bundler decides which chunk a module lands in, so `../../` is
|
|
27
|
-
* right from `dist/cli/` and wrong from `dist/`. Getting that wrong is silent —
|
|
28
|
-
* it reports `0.0.0` rather than failing.
|
|
29
|
-
*/
|
|
30
|
-
async function readCoreVersion() {
|
|
31
|
-
let dir = path.dirname(fileURLToPath(import.meta.url));
|
|
32
|
-
for (let up = 0; up < 6; up += 1) {
|
|
33
|
-
try {
|
|
34
|
-
const pkg = JSON.parse(await readFile(path.join(dir, "package.json"), "utf8"));
|
|
35
|
-
if (pkg.name === PACKAGE_NAME && pkg.version !== void 0) return pkg.version;
|
|
36
|
-
} catch {}
|
|
37
|
-
const parent = path.dirname(dir);
|
|
38
|
-
if (parent === dir) break;
|
|
39
|
-
dir = parent;
|
|
40
|
-
}
|
|
41
|
-
return "0.0.0";
|
|
42
|
-
}
|
|
43
|
-
//#endregion
|
|
44
23
|
//#region src/cli/sync.ts
|
|
45
24
|
var sync_exports = /* @__PURE__ */ __exportAll({
|
|
46
25
|
detectSkillsDrift: () => detectSkillsDrift,
|
|
@@ -165,31 +144,39 @@ async function run(argv) {
|
|
|
165
144
|
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)"));
|
|
166
145
|
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) => {
|
|
167
146
|
if (flags.skillsCheck !== false) await runSkillsDriftCheck(resolveBuiltinSkillsDir());
|
|
168
|
-
const { dev } = await import("../dev-
|
|
147
|
+
const { dev } = await import("../dev-yNYKv5mm.js");
|
|
169
148
|
await dev(flags);
|
|
170
149
|
});
|
|
171
150
|
program.command("build").description("Build a static site").option("--out-dir <dir>", "output directory (defaults to `dist`)").action(async (flags) => {
|
|
172
|
-
const { build } = await import("../build-
|
|
151
|
+
const { build } = await import("../build-DfUfpeTR.js");
|
|
173
152
|
await build(flags);
|
|
174
153
|
});
|
|
175
154
|
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) => {
|
|
176
|
-
const { preview } = await import("../preview-
|
|
155
|
+
const { preview } = await import("../preview-BImdTH6K.js");
|
|
177
156
|
await preview(flags);
|
|
178
157
|
});
|
|
179
|
-
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/").action(async (docIds, flags) => {
|
|
180
|
-
const { exportDocs } = await import("../export-
|
|
158
|
+
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) => {
|
|
159
|
+
const { exportDocs } = await import("../export-tkquS5O5.js");
|
|
181
160
|
await exportDocs(docIds, flags);
|
|
182
161
|
});
|
|
183
162
|
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) => {
|
|
184
|
-
const { diffDoc } = await import("../diff-
|
|
163
|
+
const { diffDoc } = await import("../diff-Bs205mOx.js");
|
|
185
164
|
await diffDoc(docId, flags);
|
|
186
165
|
});
|
|
187
166
|
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) => {
|
|
188
|
-
const { checkDocs } = await import("../check-
|
|
167
|
+
const { checkDocs } = await import("../check-CHxiOkQG.js");
|
|
189
168
|
await checkDocs(docIds, flags);
|
|
190
169
|
});
|
|
191
|
-
program.command("
|
|
192
|
-
const {
|
|
170
|
+
program.command("templates").description("List the templates a new document can start from").option("--json", "print them as JSON").action(async (flags) => {
|
|
171
|
+
const { printTemplates } = await import("../templates-DT5zzqHq.js");
|
|
172
|
+
await printTemplates(flags);
|
|
173
|
+
});
|
|
174
|
+
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) => {
|
|
175
|
+
const { newDoc } = await import("../templates-DT5zzqHq.js");
|
|
176
|
+
await newDoc(docId, flags);
|
|
177
|
+
});
|
|
178
|
+
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) => {
|
|
179
|
+
const { importDoc } = await import("../import-D1hIKIr3.js");
|
|
193
180
|
await importDoc(file, flags);
|
|
194
181
|
});
|
|
195
182
|
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) => {
|
|
@@ -206,4 +193,4 @@ run(process.argv.slice(2)).catch((err) => {
|
|
|
206
193
|
process.exit(1);
|
|
207
194
|
});
|
|
208
195
|
//#endregion
|
|
209
|
-
export {
|
|
196
|
+
export {};
|