@bitclub.ai/opendesk-office
v0.3.1
Published
Embeddable, offline-capable presentation, document, and spreadsheet editors based on GenOffice
Readme
@bitclub.ai/opendesk-office
Embeddable, offline-capable presentation, Word document, and spreadsheet editors based on the Apache-2.0 GenOffice implementations.
Product boundary
- The default runtime contains no Genspark AI UI, account login, logo, or product title.
- Ribbon and canvas action locations are host-controlled extension slots.
- Upstream attribution is retained in
NOTICEand the source documentation, outside the product UI. - The npm package contains the Slides, Docs, and Sheets TypeScript/WASM dependency closures only.
- The HAP contract contains release artifacts only and has no Rust sidecar or
runtime
node_modulespayload.
See BRANDING.md for the exact upstream-brand and release boundary.
Host actions
await bootstrapOpenDeskOfficeSlidesEditor({
filePath: '/workspace/demo.pptx',
editor: {
productName: 'BitClub Slides',
extensionGroupLabel: 'BitClub AI',
extensionActions: [
{
id: 'beautify',
label: 'AI 美化',
icon: 'format-brush',
placements: ['home-ribbon', 'canvas-toolbar'],
},
],
onExtensionAction(action, placement, context) {
return hostBridge.runSlidesAction({ action, placement, context })
},
},
})The action callback receives the current file path, slide index, slide count, selected element ids and dirty state. Complex host panels can be layered on top of the same bridge without exposing editor-internal React state.
Word editor
The Word entrypoint embeds the DOCX editor without the upstream account-backed assistant surface. DOCX reading, editing, save, autosave and unsaved-change prompts remain in the packaged Docs runtime.
await bootstrapOpenDeskOfficeWordEditor({
filePath: '/workspace/report.docx',
})Spreadsheet editor
The Sheets entrypoint embeds the XLSX editor without the upstream account-backed assistant surface. XLSX files are read and saved by the portable JavaScript byte engine, while formulas are recalculated by IronCalc WASM. The release does not spawn or package the upstream Rust sidecar.
await bootstrapOpenDeskOfficeSheetsEditor({
filePath: '/workspace/budget.xlsx',
})The byte engine rewrites only changed OOXML entries and passes untouched ZIP entries through with their original compressed bytes.
Build boundaries
Electron Vite consumers should merge the package-owned renderer config into
their renderer config. It preserves the automatic JSX runtime used by the
upstream editor sources in both development dependency optimization and release
builds:
const slidesRendererConfig = createOpenDeskOfficeSlidesRendererViteConfig()
export default defineConfig({
renderer: {
...slidesRendererConfig,
// host renderer settings
},
})npm run build -w @bitclub.ai/opendesk-office
npm run test -w @bitclub.ai/opendesk-office
npm run pack:check -w @bitclub.ai/opendesk-officepack:check fails when native code, tests, development output, source maps, or
unexpected runtime packages enter the published package contract.
