Browse Source

Merge commit '3257b55e97dc4806446d4b6efa336fdbbc8e1742' into release

release
David Benson 3 months ago
parent
commit
69583ab743
  1. 4
      .gitignore
  2. 2
      drawio
  3. 5
      package.json
  4. 26
      src/main/electron.js
  5. 1057
      yarn.lock

4
.gitignore

@ -3,4 +3,6 @@ node_modules
.project
/dist/
/.classpath
/.settings
/.settings
package-lock.json
.DS_Store

2
drawio

@ -1 +1 @@
Subproject commit 026fbf558c40f1808254efdfa417d46c97a095c7
Subproject commit ccb8a8dece23add373cf1d4bb8ce913c95d7e970

5
package.json

@ -1,6 +1,6 @@
{
"name": "draw.io",
"version": "26.2.15",
"version": "27.0.2",
"description": "draw.io desktop",
"exports": "./src/main/electron.js",
"type": "module",
@ -35,6 +35,7 @@
},
"homepage": "https://github.com/jgraph/drawio",
"dependencies": {
"@cantoo/pdf-lib": "^2.3.2",
"commander": "^13.1.0",
"compression": "^1.8.0",
"crc": "^4.3.2",
@ -43,7 +44,7 @@
"electron-progressbar": "^2.2.1",
"electron-store": "^10.0.1",
"electron-updater": "^6.6.2",
"@cantoo/pdf-lib": "^2.3.2"
"tslib": "^2.8.1"
},
"devDependencies": {
"@electron/fuses": "^1.8.0",

26
src/main/electron.js

@ -437,9 +437,9 @@ app.whenReady().then(() =>
var themeRegExp = /^(dark|light)$/;
var linkTargetRegExp = /^(auto|new-win|same-win)$/;
function argsRange(val)
function argsRange(val)
{
return val.split('..').map(Number);
return val.split('..').map(n => parseInt(n, 10) - 1);
}
try
@ -481,11 +481,11 @@ app.whenReady().then(() =>
.option('-a, --all-pages',
'export all pages (for PDF format only)')
.option('-p, --page-index <pageIndex>',
'selects a specific page, if not specified and the format is an image, the first page is selected', parseInt)
'selects a specific page (1-based); if not specified and the format is an image, the first page is selected', (i) => parseInt(i) - 1)
.option('-l, --layers <comma separated layer indexes>',
'selects which layers to export (applies to all pages), if not specified, all layers are selected')
.option('-g, --page-range <from>..<to>',
'selects a page range (for PDF format only)', argsRange)
'selects a page range (1-based, for PDF format only)', argsRange)
.option('-u, --uncompressed',
'Uncompressed XML output (for XML format only)')
.option('-z, --zoom <zoom>',
@ -571,7 +571,7 @@ app.whenReady().then(() =>
format = options.format;
}
var from = null, to = null;
let from = null, to = null;
if (options.pageIndex != null && options.pageIndex >= 0)
{
@ -581,9 +581,19 @@ app.whenReady().then(() =>
}
else if (options.pageRange && options.pageRange.length == 2)
{
from = options.pageRange[0] >= 0 ? options.pageRange[0] : null;
to = options.pageRange[1] >= 0 ? options.pageRange[1] : null;
options.allPages = false;
const [rangeFrom, rangeTo] = options.pageRange;
if (rangeFrom >= 0 && rangeTo >= 0 && rangeFrom <= rangeTo)
{
from = rangeFrom;
to = rangeTo;
options.allPages = false;
}
else
{
console.error('Invalid page range: must be non-negative and from ≤ to');
process.exit(1);
}
}
var expArgs = {

1057
yarn.lock
File diff suppressed because it is too large
View File

Loading…
Cancel
Save