@components-kit/open-workbook-office-js-engine 0.1.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/LICENSE +21 -0
- package/README.md +13 -0
- package/dist/engine.d.ts +24 -0
- package/dist/engine.d.ts.map +1 -0
- package/dist/engine.js +64 -0
- package/dist/engine.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/package.json +49 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Open Workbook contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# @components-kit/open-workbook-office-js-engine
|
|
2
|
+
|
|
3
|
+
Office.js engine interface and defaults for Open Workbook.
|
|
4
|
+
|
|
5
|
+
The live Office.js execution currently lives in the Excel add-in runtime. This package defines engine contracts and default options that future host bindings can share.
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { DefaultOfficeJsEngineOptions, OfficeJsEngine } from "@components-kit/open-workbook-office-js-engine";
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Most users should install `@components-kit/open-workbook`. This package is published for engine integration work and tests.
|
package/dist/engine.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { BatchRequest, CompiledBatch, OperationResult, RuntimeCapabilities, WorkbookRef } from "@components-kit/open-workbook-protocol";
|
|
2
|
+
export interface ExcelEngine {
|
|
3
|
+
readonly name: string;
|
|
4
|
+
readonly version: string;
|
|
5
|
+
getCapabilities(): Promise<RuntimeCapabilities>;
|
|
6
|
+
getActiveWorkbook(): Promise<WorkbookRef | undefined>;
|
|
7
|
+
executeBatch(request: BatchRequest, compiled: CompiledBatch): Promise<OperationResult>;
|
|
8
|
+
}
|
|
9
|
+
export interface OfficeJsEngineOptions {
|
|
10
|
+
chunkCellLimit: number;
|
|
11
|
+
suspendCalculationCellThreshold: number;
|
|
12
|
+
suspendScreenUpdatingCellThreshold: number;
|
|
13
|
+
}
|
|
14
|
+
export declare const DefaultOfficeJsEngineOptions: OfficeJsEngineOptions;
|
|
15
|
+
export declare class OfficeJsEngine implements ExcelEngine {
|
|
16
|
+
private readonly options;
|
|
17
|
+
readonly name = "office-js";
|
|
18
|
+
readonly version = "0.1.0";
|
|
19
|
+
constructor(options?: OfficeJsEngineOptions);
|
|
20
|
+
getCapabilities(): Promise<RuntimeCapabilities>;
|
|
21
|
+
getActiveWorkbook(): Promise<WorkbookRef | undefined>;
|
|
22
|
+
executeBatch(request: BatchRequest, compiled: CompiledBatch): Promise<OperationResult>;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=engine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EACb,eAAe,EACf,mBAAmB,EACnB,WAAW,EACZ,MAAM,wCAAwC,CAAC;AAEhD,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,eAAe,IAAI,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAChD,iBAAiB,IAAI,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC,CAAC;IACtD,YAAY,CAAC,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;CACxF;AAED,MAAM,WAAW,qBAAqB;IACpC,cAAc,EAAE,MAAM,CAAC;IACvB,+BAA+B,EAAE,MAAM,CAAC;IACxC,kCAAkC,EAAE,MAAM,CAAC;CAC5C;AAED,eAAO,MAAM,4BAA4B,EAAE,qBAI1C,CAAC;AAEF,qBAAa,cAAe,YAAW,WAAW;IAIpC,OAAO,CAAC,QAAQ,CAAC,OAAO;IAHpC,QAAQ,CAAC,IAAI,eAAe;IAC5B,QAAQ,CAAC,OAAO,WAAW;gBAEE,OAAO,GAAE,qBAAoD;IAEpF,eAAe,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAuB/C,iBAAiB,IAAI,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC;IAIrD,YAAY,CAAC,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,GAAG,OAAO,CAAC,eAAe,CAAC;CA0B7F"}
|
package/dist/engine.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export const DefaultOfficeJsEngineOptions = {
|
|
2
|
+
chunkCellLimit: 50_000,
|
|
3
|
+
suspendCalculationCellThreshold: 10_000,
|
|
4
|
+
suspendScreenUpdatingCellThreshold: 10_000
|
|
5
|
+
};
|
|
6
|
+
export class OfficeJsEngine {
|
|
7
|
+
options;
|
|
8
|
+
name = "office-js";
|
|
9
|
+
version = "0.1.0";
|
|
10
|
+
constructor(options = DefaultOfficeJsEngineOptions) {
|
|
11
|
+
this.options = options;
|
|
12
|
+
}
|
|
13
|
+
async getCapabilities() {
|
|
14
|
+
return {
|
|
15
|
+
engine: {
|
|
16
|
+
name: this.name,
|
|
17
|
+
version: this.version,
|
|
18
|
+
platform: "unknown"
|
|
19
|
+
},
|
|
20
|
+
capabilities: [
|
|
21
|
+
{ name: "workbook.context", supported: true, platforms: ["mac", "windows"] },
|
|
22
|
+
{ name: "worksheet.copy", supported: true, platforms: ["mac", "windows"] },
|
|
23
|
+
{ name: "range.write.values", supported: true, platforms: ["mac", "windows"] },
|
|
24
|
+
{ name: "range.write.formulas", supported: true, platforms: ["mac", "windows"] },
|
|
25
|
+
{ name: "template.fingerprint", supported: true, platforms: ["mac", "windows"] },
|
|
26
|
+
{
|
|
27
|
+
name: "workbook.restore.full_file",
|
|
28
|
+
supported: false,
|
|
29
|
+
platforms: ["mac", "windows"],
|
|
30
|
+
notes: "Full file restore is coordinated by the backend and may require user or OS-level file replacement."
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
async getActiveWorkbook() {
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
async executeBatch(request, compiled) {
|
|
39
|
+
const started = Date.now();
|
|
40
|
+
return {
|
|
41
|
+
ok: false,
|
|
42
|
+
rollbackAvailable: compiled.requiredBackups.length > 0,
|
|
43
|
+
backups: [],
|
|
44
|
+
warnings: [
|
|
45
|
+
{
|
|
46
|
+
code: "ENGINE_NOT_BOUND",
|
|
47
|
+
message: "OfficeJsEngine is scaffolded but not yet bound to Excel.run in the add-in runtime."
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
telemetry: {
|
|
51
|
+
durationMs: Date.now() - started,
|
|
52
|
+
syncCount: 0,
|
|
53
|
+
payloadBytes: JSON.stringify(request).length,
|
|
54
|
+
cellsWritten: compiled.estimatedCellsTouched,
|
|
55
|
+
rangeCount: compiled.targetFingerprints.length,
|
|
56
|
+
chunkCount: Math.max(1, Math.ceil(compiled.estimatedCellsTouched / this.options.chunkCellLimit)),
|
|
57
|
+
engineName: this.name,
|
|
58
|
+
engineVersion: this.version,
|
|
59
|
+
warningCount: 1
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=engine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"engine.js","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAsBA,MAAM,CAAC,MAAM,4BAA4B,GAA0B;IACjE,cAAc,EAAE,MAAM;IACtB,+BAA+B,EAAE,MAAM;IACvC,kCAAkC,EAAE,MAAM;CAC3C,CAAC;AAEF,MAAM,OAAO,cAAc;IAII;IAHpB,IAAI,GAAG,WAAW,CAAC;IACnB,OAAO,GAAG,OAAO,CAAC;IAE3B,YAA6B,UAAiC,4BAA4B;QAA7D,YAAO,GAAP,OAAO,CAAsD;IAAG,CAAC;IAE9F,KAAK,CAAC,eAAe;QACnB,OAAO;YACL,MAAM,EAAE;gBACN,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,QAAQ,EAAE,SAAS;aACpB;YACD,YAAY,EAAE;gBACZ,EAAE,IAAI,EAAE,kBAAkB,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,KAAK,EAAE,SAAS,CAAC,EAAE;gBAC5E,EAAE,IAAI,EAAE,gBAAgB,EAAE,SAAS,EAAE,IAAI,E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AAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,qBAAqB,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;gBAChG,UAAU,EAAE,IAAI,CAAC,IAAI;gBACrB,aAAa,EAAE,IAAI,CAAC,OAAO;gBAC3B,YAAY,EAAE,CAAC;aAChB;SACF,CAAC;IACJ,CAAC;CACF"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@components-kit/open-workbook-office-js-engine",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Office.js engine interfaces and defaults for Open Workbook Excel execution.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"homepage": "https://github.com/components-kit/open-workbook#readme",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/components-kit/open-workbook.git",
|
|
11
|
+
"directory": "packages/office-js-engine"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/components-kit/open-workbook/issues"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"excel",
|
|
18
|
+
"office-js",
|
|
19
|
+
"spreadsheet",
|
|
20
|
+
"engine"
|
|
21
|
+
],
|
|
22
|
+
"main": "dist/index.js",
|
|
23
|
+
"types": "dist/index.d.ts",
|
|
24
|
+
"exports": {
|
|
25
|
+
".": {
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"default": "./dist/index.js"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"dist",
|
|
32
|
+
"README.md"
|
|
33
|
+
],
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"access": "public"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@components-kit/open-workbook-protocol": "0.1.0"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"typescript": "^5.7.3",
|
|
42
|
+
"vitest": "^2.1.8"
|
|
43
|
+
},
|
|
44
|
+
"scripts": {
|
|
45
|
+
"build": "tsc -p tsconfig.json",
|
|
46
|
+
"check": "tsc -p tsconfig.json --noEmit",
|
|
47
|
+
"test": "vitest run --passWithNoTests"
|
|
48
|
+
}
|
|
49
|
+
}
|