logisheets-runtime 1.11.0 → 1.12.1
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/index.d.ts +8 -2
- package/dist/index.js +10 -4
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -59,13 +59,19 @@ export declare class Workbook {
|
|
|
59
59
|
* @param appData opaque per-document JSON the host owns (craft state and
|
|
60
60
|
* friends). It round-trips through the file; pass what the
|
|
61
61
|
* engine's `getAppData` gave you, or nothing.
|
|
62
|
+
* @param resolveBlockRefs write block formulas as ordinary A1 references
|
|
63
|
+
* instead of `BLOCKREF(...)`. Off by default: the named form
|
|
64
|
+
* is readable and reopens here intact, but no other
|
|
65
|
+
* spreadsheet knows those functions, so a file Excel has to
|
|
66
|
+
* recalculate needs coordinates. One-way — see the note on
|
|
67
|
+
* the engine's `FormulaFormat`.
|
|
62
68
|
*/
|
|
63
|
-
save(appData?: string): Uint8Array;
|
|
69
|
+
save(appData?: string, resolveBlockRefs?: boolean): Uint8Array;
|
|
64
70
|
/**
|
|
65
71
|
* Serialize and write the workbook to `path`. Defaults to the path it was
|
|
66
72
|
* loaded from, so a load -> edit -> `saveAs()` round-trip needs no argument.
|
|
67
73
|
*/
|
|
68
|
-
saveAs(path?: string, appData?: string): Promise<void>;
|
|
74
|
+
saveAs(path?: string, appData?: string, resolveBlockRefs?: boolean): Promise<void>;
|
|
69
75
|
/** Undo the most recent transaction. Returns whether anything was undone. */
|
|
70
76
|
undo(): Promise<boolean>;
|
|
71
77
|
/** Redo the most recently undone transaction. Returns whether anything was redone. */
|
package/dist/index.js
CHANGED
|
@@ -108,9 +108,15 @@ export class Workbook {
|
|
|
108
108
|
* @param appData opaque per-document JSON the host owns (craft state and
|
|
109
109
|
* friends). It round-trips through the file; pass what the
|
|
110
110
|
* engine's `getAppData` gave you, or nothing.
|
|
111
|
+
* @param resolveBlockRefs write block formulas as ordinary A1 references
|
|
112
|
+
* instead of `BLOCKREF(...)`. Off by default: the named form
|
|
113
|
+
* is readable and reopens here intact, but no other
|
|
114
|
+
* spreadsheet knows those functions, so a file Excel has to
|
|
115
|
+
* recalculate needs coordinates. One-way — see the note on
|
|
116
|
+
* the engine's `FormulaFormat`.
|
|
111
117
|
*/
|
|
112
|
-
save(appData = '') {
|
|
113
|
-
const r = handle({ method: 'saveWorkbook', value: { appData } }, this.id);
|
|
118
|
+
save(appData = '', resolveBlockRefs = false) {
|
|
119
|
+
const r = handle({ method: 'saveWorkbook', value: { appData, resolveBlockRefs } }, this.id);
|
|
114
120
|
if (r.code !== 0) {
|
|
115
121
|
throw new Error(`failed to save workbook (code ${r.code})`);
|
|
116
122
|
}
|
|
@@ -123,12 +129,12 @@ export class Workbook {
|
|
|
123
129
|
* Serialize and write the workbook to `path`. Defaults to the path it was
|
|
124
130
|
* loaded from, so a load -> edit -> `saveAs()` round-trip needs no argument.
|
|
125
131
|
*/
|
|
126
|
-
async saveAs(path, appData = '') {
|
|
132
|
+
async saveAs(path, appData = '', resolveBlockRefs = false) {
|
|
127
133
|
const target = path ?? this.path;
|
|
128
134
|
if (target === undefined) {
|
|
129
135
|
throw new Error('saveAs: no path given and this workbook was not loaded from one');
|
|
130
136
|
}
|
|
131
|
-
await writeFile(resolve(target), this.save(appData));
|
|
137
|
+
await writeFile(resolve(target), this.save(appData, resolveBlockRefs));
|
|
132
138
|
}
|
|
133
139
|
/** Undo the most recent transaction. Returns whether anything was undone. */
|
|
134
140
|
async undo() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "logisheets-runtime",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.12.1",
|
|
4
4
|
"description": "Headless LogiSheets spreadsheet runtime for Node — logisheets-core wired to the Node WASM engine. The Node counterpart of the browser app.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
},
|
|
40
40
|
"homepage": "https://github.com/logisky/LogiSheets",
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"logisheets": "^1.
|
|
43
|
-
"logisheets-core": "^1.
|
|
42
|
+
"logisheets": "^1.12.1",
|
|
43
|
+
"logisheets-core": "^1.12.1"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/node": "^18",
|