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.jsbundles Univer with its own React and no WordPress externals, and exposeswindow.LHSpreadsheets.mount( element, workbook, onChange ).- It and
build/univer-host.cssare enqueued onenqueue_block_assets, only on the spreadsheet editor screen and only during core’s iframe pass (whenwp_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 findsLHSpreadsheetson the iframe’s own window (waiting for thelh-spreadsheets-readyevent 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.jsfiles. - Theme styles are stripped from the spreadsheet editor canvas (
block_editor_settings_all).