@openpresentation/cli 0.1.1 → 0.2.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 CHANGED
@@ -4,23 +4,18 @@ A local CLI for agents and people working with `.opf.json` presentations. Create
4
4
 
5
5
  The CLI bundles its OPF schema, catalogs, and validator. It needs no separate core package, API key, or network connection at runtime. `opf --version` reports the CLI and bundled core versions. It does not render slides; successful validation is not visual verification.
6
6
 
7
- ## Install the current preview
7
+ ## Install
8
8
 
9
- This version is an installable npm tarball, **not yet published to the npm registry**. From the OPF checkout, build and verify it:
9
+ The CLI is published on npm. Install the current release:
10
10
 
11
11
  ```sh
12
- pnpm install
13
- pnpm test:cli:packed
14
- ```
15
-
16
- That creates `artifacts/cli/openpresentation-cli-0.1.0.tgz`. Install it globally using its absolute path:
17
-
18
- ```sh
19
- npm install -g /absolute/path/to/opf/artifacts/cli/openpresentation-cli-0.1.0.tgz
12
+ npm install -g @openpresentation/cli
20
13
  opf --version
21
14
  ```
22
15
 
23
- Or install the tarball as a development dependency and use `npx --no-install opf`. For source development, run `pnpm --filter @openpresentation/cli build` and `node packages/cli/dist/index.js --help` from the checkout. Publishing is a separate release step; the package metadata and `opf` binary are ready for it.
16
+ Or install it as a development dependency and use `npx --no-install opf`. This checkout prepares CLI 0.2.0 with bundled OPF 0.5.0; that version supports rich table cells and headers during validation and pagination. Until 0.2.0 is published, the registry's latest release has the previous schema.
17
+
18
+ To verify the standalone package from source, run `pnpm install` and `pnpm test:cli:packed`. This creates `artifacts/cli/openpresentation-cli-0.2.0.tgz`, which can be installed using its absolute path. For source development, run `pnpm --filter @openpresentation/cli build` and `node packages/cli/dist/index.js --help`.
24
19
 
25
20
  ## Create and validate
26
21
 
package/dist/index.js CHANGED
@@ -8163,7 +8163,7 @@ function createDataContent(input, options) {
8163
8163
  return { chart: { type: options.chartType ?? "column", data: { columns: names, rows: rows2 } } };
8164
8164
  }
8165
8165
 
8166
- // ../javascript/dist/chunk-HJNJHB5H.js
8166
+ // ../javascript/dist/chunk-WG5A4KZG.js
8167
8167
  var MAX_COMPOSITION_DEPTH = 32;
8168
8168
  function resolveFontFamilies(input) {
8169
8169
  const scheme = record(input);
@@ -8405,7 +8405,11 @@ function tableOverflows(value, box, scale, settings, options) {
8405
8405
  const columns2 = Math.max(1, ...allRows.map((row) => row.length));
8406
8406
  const width = box.width / columns2 - 20 * scale;
8407
8407
  const height = Math.min(54 * scale, box.height / Math.max(1, allRows.length)) - 12 * scale;
8408
- return width <= 0 || height <= 0 || allRows.some((row, index2) => row.some((value2) => fitText(flatten(value2), { width, height }, 15 * scale, (settings.minFontSize ?? 16) * scale, textWidthMeasurer(resolveTextStyle({ fontFamily: options.fonts?.body ?? "sans-serif", fontWeight: index2 === 0 && table.columns?.length ? 700 : 400 }, options.textMeasurement), options.textMeasurement)).overflow));
8408
+ return width <= 0 || height <= 0 || allRows.some((row, index2) => row.some((value2) => {
8409
+ const style = { fontFamily: options.fonts?.body ?? "sans-serif", fontWeight: index2 === 0 && table.columns?.length ? 700 : 400 };
8410
+ const cell2 = { width, height }, minimum = (settings.minFontSize ?? 16) * scale;
8411
+ return (Array.isArray(value2) ? fitRichText(value2, cell2, 15 * scale, minimum, { style, textMeasurement: options.textMeasurement }) : fitText(flatten(value2), cell2, 15 * scale, minimum, textWidthMeasurer(resolveTextStyle(style, options.textMeasurement), options.textMeasurement))).overflow;
8412
+ }));
8409
8413
  }
8410
8414
  function flatten(value) {
8411
8415
  if (value == null) return "";
@@ -8616,7 +8620,7 @@ function resolveCanvasDimensions(input) {
8616
8620
  return { width, height };
8617
8621
  }
8618
8622
 
8619
- // ../javascript/dist/chunk-GCXOU5MZ.js
8623
+ // ../javascript/dist/chunk-KSN6RQG2.js
8620
8624
  var presentation = {
8621
8625
  "$schema": "https://json-schema.org/draft/2020-12/schema",
8622
8626
  "$id": "https://openpresentation.org/schema/opf/v1",
@@ -12297,9 +12301,19 @@ Resolution order: inline catalogs.fontSchemes.records[] -> catalogs.fontSchemes.
12297
12301
  "columns": {
12298
12302
  "type": "array",
12299
12303
  "items": {
12300
- "type": "string"
12304
+ "oneOf": [
12305
+ {
12306
+ "type": "string"
12307
+ },
12308
+ {
12309
+ "type": "array",
12310
+ "items": {
12311
+ "$ref": "#/$defs/TextRun"
12312
+ }
12313
+ }
12314
+ ]
12301
12315
  },
12302
- "description": "Optional column labels rendered above table rows.",
12316
+ "description": "Optional column labels rendered above table rows. Each label is a string or an array of TextRun values for inline formatting.",
12303
12317
  "examples": [
12304
12318
  [
12305
12319
  "Region",
@@ -12482,9 +12496,15 @@ Resolution order: inline catalogs.fontSchemes.records[] -> catalogs.fontSchemes.
12482
12496
  },
12483
12497
  {
12484
12498
  "type": "null"
12499
+ },
12500
+ {
12501
+ "type": "array",
12502
+ "items": {
12503
+ "$ref": "#/$defs/TextRun"
12504
+ }
12485
12505
  }
12486
12506
  ],
12487
- "description": "A cell in table content."
12507
+ "description": "A cell in table content. Scalar values keep their text representation; TextRun arrays preserve inline formatting and use mixed-style text measurement."
12488
12508
  },
12489
12509
  "Catalogs": {
12490
12510
  "type": "object",
@@ -33678,7 +33698,7 @@ var catalogEntries = [
33678
33698
  ], records: fontSchemes, index: catalogIndexes.fontSchemes }
33679
33699
  ];
33680
33700
 
33681
- // ../javascript/dist/chunk-EMTMQRX4.js
33701
+ // ../javascript/dist/chunk-PFJE2IW4.js
33682
33702
  var import__ = __toESM(require__(), 1);
33683
33703
  var import_ajv_formats = __toESM(require_dist(), 1);
33684
33704
  var catalogIds = {
@@ -34672,7 +34692,7 @@ function assertValidPresentation(value) {
34672
34692
  assertValid(value, "presentation");
34673
34693
  }
34674
34694
 
34675
- // ../javascript/dist/chunk-75N5I6M4.js
34695
+ // ../javascript/dist/chunk-YLORKB63.js
34676
34696
  var OPFPaginationError = class extends Error {
34677
34697
  constructor(message, diagnostics = []) {
34678
34698
  super(message);
@@ -35112,7 +35132,7 @@ async function main(argv) {
35112
35132
  return;
35113
35133
  }
35114
35134
  if (argv.length === 1 && argv[0] === "--version") {
35115
- print({ cli: "0.1.1", opf: "0.4.1" });
35135
+ print({ cli: "0.2.0", opf: "0.5.0" });
35116
35136
  return;
35117
35137
  }
35118
35138
  const [command, ...args] = argv;