Digital Sovereignty for everyone

Architecture

Storage

A spreadsheet is a post of type lh_spreadsheet (filter lh_spreadsheets_return_post_type). Its post_content is a single lh-spreadsheets/sheet block whose workbook object attribute holds the Univer workbook snapshot (IWorkbookData). The title is post_title and the description post_excerpt. The post type registers that block as its locked template (template_lock: all), so a spreadsheet always contains exactly one grid.

Before 2.0.0 the workbook was a JSON string in a sheetData attribute, which stored every double quote as a six-character unicode escape and roughly doubled the size on disk. A block deprecation migrates it to workbook when the post is opened, and the REST API reads both forms.

The editor: Univer inside the canvas iframe

In the iframed block editor, block JavaScript runs in the parent admin window while the block’s DOM lives in the canvas iframe. Univer listens on, measures and portals into its own window and document, so run from the parent it renders nothing usable: menus and dropdowns land in the wrong document and its stylesheet never reaches the canvas. That was why 1.x never worked on WordPress 7.0.

  • build/univer-host.js bundles Univer with its own React and no WordPress externals, and exposes window.LHSpreadsheets.mount( element, workbook, onChange ).
  • It and build/univer-host.css are enqueued on enqueue_block_assets, only on the spreadsheet editor screen and only during core’s iframe pass (when wp_should_load_block_editor_scripts_and_styles() is false). Univer’s stylesheet has global resets that would restyle wp-admin if it reached the parent page.
  • The block’s edit component (build/index.js) is thin: it finds LHSpreadsheets on the iframe’s own window (waiting for the lh-spreadsheets-ready event if needed) and mounts the grid into its element.
  • Univer’s lazy chunks load on demand from build/univer-host-chunks/. The bundle is minified ASCII-only, so it parses whatever charset the server sends with .js files.
  • Theme styles are stripped from the spreadsheet editor canvas (block_editor_settings_all).

If you like this plugin please consider making a donation to further development

Install LHero.org

lhero.org

Open it straight from your home screen, full screen and quicker to load.

  1. Tap the Share button . If you cannot see it, tap ••• first.
  2. Scroll down and tap Add to Home Screen.
  3. Tap Add.
  1. Tap the browser menu â‹®.
  2. Tap Install app or Add to Home screen.
  1. In the menu bar, choose File, then Add to Dock.

Use your browser's menu to install this site or add it to your home screen.