document-cli 3.1.19 → 3.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/dist/cli.js CHANGED
@@ -1204,7 +1204,7 @@ function registerSetMetadataCommand(program) {
1204
1204
  }
1205
1205
  //#endregion
1206
1206
  //#region package.json
1207
- var version = "3.1.19";
1207
+ var version = "3.2.0";
1208
1208
  //#endregion
1209
1209
  //#region src/program.ts
1210
1210
  function createProgram() {
@@ -1232,7 +1232,7 @@ function createProgram() {
1232
1232
  //#region src/cli.ts
1233
1233
  async function launchTui(startPath, signal) {
1234
1234
  try {
1235
- const { runTui } = await import("./tui-tT3An-cI.js");
1235
+ const { runTui } = await import("./tui-DTdrH0Rm.js");
1236
1236
  await runTui({
1237
1237
  startPath,
1238
1238
  signal
package/dist/index.cjs CHANGED
@@ -1536,7 +1536,7 @@ function registerSetMetadataCommand(program) {
1536
1536
  }
1537
1537
  //#endregion
1538
1538
  //#region package.json
1539
- var version = "3.1.19";
1539
+ var version = "3.2.0";
1540
1540
  //#endregion
1541
1541
  //#region src/program.ts
1542
1542
  function createProgram() {
package/dist/index.js CHANGED
@@ -1535,7 +1535,7 @@ function registerSetMetadataCommand(program) {
1535
1535
  }
1536
1536
  //#endregion
1537
1537
  //#region package.json
1538
- var version = "3.1.19";
1538
+ var version = "3.2.0";
1539
1539
  //#endregion
1540
1540
  //#region src/program.ts
1541
1541
  function createProgram() {
@@ -606,6 +606,7 @@ const isPdfLineItem = (item) => item.kind === "line";
606
606
  const isPdfPathItem = (item) => item.kind === "path";
607
607
  const isPdfImageItem = (item) => item.kind === "image";
608
608
  const isPdfLinkItem = (item) => item.kind === "link";
609
+ const isPdfInternalLinkItem = (item) => item.kind === "internalLink";
609
610
  function vectorHostDocument(state) {
610
611
  const doc = state.openDocument;
611
612
  if (doc === void 0) return;
@@ -1325,6 +1326,15 @@ function appReducer(state, action) {
1325
1326
  item.widthPt = action.widthPt;
1326
1327
  item.heightPt = action.heightPt;
1327
1328
  });
1329
+ case "SET_PDF_INTERNAL_LINK_DESTINATION": return withPdfItemMatching(state, action.pageIndex, action.itemIndex, isPdfInternalLinkItem, "internalLink", (item) => {
1330
+ item.destination = action.destination;
1331
+ });
1332
+ case "SET_PDF_INTERNAL_LINK_FRAME": return withPdfItemMatching(state, action.pageIndex, action.itemIndex, isPdfInternalLinkItem, "internalLink", (item) => {
1333
+ item.xPt = action.xPt;
1334
+ item.yPt = action.yPt;
1335
+ item.widthPt = action.widthPt;
1336
+ item.heightPt = action.heightPt;
1337
+ });
1328
1338
  case "APPEND_DIAGNOSTIC": return {
1329
1339
  ...state,
1330
1340
  diagnostics: [...state.diagnostics, action.diagnostic]
@@ -7374,9 +7384,15 @@ function fieldsFor(item) {
7374
7384
  fields.push(["Position", formatPoint(item.xPt, item.yPt)]);
7375
7385
  fields.push(["Size", formatSize(item.widthPt, item.heightPt)]);
7376
7386
  break;
7387
+ case "internalLink":
7388
+ fields.push(["Destination", item.destination]);
7389
+ if (item.title !== void 0) fields.push(["Title", item.title]);
7390
+ fields.push(["Position", formatPoint(item.xPt, item.yPt)]);
7391
+ fields.push(["Size", formatSize(item.widthPt, item.heightPt)]);
7392
+ break;
7377
7393
  default: return item;
7378
7394
  }
7379
- if (item.sourcePath !== void 0) fields.push(["Source path", item.sourcePath]);
7395
+ if (item.kind !== "internalLink" && item.sourcePath !== void 0) fields.push(["Source path", item.sourcePath]);
7380
7396
  return fields;
7381
7397
  }
7382
7398
  function ReadOnlyItemDetail(props) {
@@ -7749,6 +7765,23 @@ function buildLinkRows(item, pageIndex, itemIndex, dispatch) {
7749
7765
  ...frame
7750
7766
  }))];
7751
7767
  }
7768
+ function buildInternalLinkRows(item, pageIndex, itemIndex, dispatch) {
7769
+ return [{
7770
+ label: `Destination: ${item.destination}`,
7771
+ currentValue: item.destination,
7772
+ commit: (raw) => dispatch({
7773
+ type: "SET_PDF_INTERNAL_LINK_DESTINATION",
7774
+ pageIndex,
7775
+ itemIndex,
7776
+ destination: raw
7777
+ })
7778
+ }, ...buildFrameRows(item, (frame) => dispatch({
7779
+ type: "SET_PDF_INTERNAL_LINK_FRAME",
7780
+ pageIndex,
7781
+ itemIndex,
7782
+ ...frame
7783
+ }))];
7784
+ }
7752
7785
  function buildRowsFor(item, pageIndex, itemIndex, dispatch, onReplaceImage) {
7753
7786
  switch (item.kind) {
7754
7787
  case "text": return buildTextRows(item, pageIndex, itemIndex, dispatch);
@@ -7758,6 +7791,7 @@ function buildRowsFor(item, pageIndex, itemIndex, dispatch, onReplaceImage) {
7758
7791
  case "path": return buildPathRows(item, pageIndex, itemIndex, dispatch);
7759
7792
  case "image": return buildImageRows(item, pageIndex, itemIndex, dispatch, onReplaceImage);
7760
7793
  case "link": return buildLinkRows(item, pageIndex, itemIndex, dispatch);
7794
+ case "internalLink": return buildInternalLinkRows(item, pageIndex, itemIndex, dispatch);
7761
7795
  }
7762
7796
  }
7763
7797
  function pathSummary(item) {
@@ -7972,6 +8006,7 @@ function previewFor(item) {
7972
8006
  switch (item.kind) {
7973
8007
  case "text": return truncate(item.text, TEXT_PREVIEW_MAX_CHARS);
7974
8008
  case "link": return item.uri;
8009
+ case "internalLink": return `→ ${item.destination}`;
7975
8010
  case "image":
7976
8011
  case "rect":
7977
8012
  case "ellipse": return formatSize(item.widthPt, item.heightPt);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "document-cli",
3
- "version": "3.1.19",
3
+ "version": "3.2.0",
4
4
  "description": "CLI and interactive Ink TUI for documents.js: every docx/pptx/odt/odp/ods/odg/odf/pdf/odm/odb/xlsx/csv/svg/markdown conversion, bridge, and editor as a scriptable command or a terminal app.",
5
5
  "type": "module",
6
6
  "repository": {
@@ -90,9 +90,9 @@
90
90
  "packageManager": "pnpm@11.6.0",
91
91
  "dependencies": {
92
92
  "commander": "^15.0.0",
93
- "document-outline.js": "^1.0.8",
94
- "document-schema.js": "^4.7.0",
95
- "documents.js": "^4.3.0",
93
+ "document-outline.js": "^1.0.9",
94
+ "document-schema.js": "^4.8.0",
95
+ "documents.js": "^4.4.0",
96
96
  "ink": "^7.1.1",
97
97
  "ink-text-input": "^6.0.0",
98
98
  "react": "^19.2.8"
@@ -114,8 +114,8 @@
114
114
  "husky": "^9.1.7",
115
115
  "ink-testing-library": "^4.0.0",
116
116
  "lint-staged": "^17.3.0",
117
- "odf.js": "^5.1.0",
118
- "pdf-codec": "^3.1.4",
117
+ "odf.js": "^5.1.1",
118
+ "pdf-codec": "^3.2.0",
119
119
  "publint": "^0.3.22",
120
120
  "semantic-release": "^25.0.8",
121
121
  "tsdown": "^0.22.14",