### Univer CDN Installation Example Source: https://docs.univer.ai/guides/docs/getting-started/installation/cdn Include Univer's UMD builds via script tags in your HTML for CDN installation. This example demonstrates setting up Univer with React, RxJS, ECharts, and the core preset, including locale configuration. ```html
``` -------------------------------- ### Install All Skills Source: https://docs.univer.ai/guides/skills/installation Use this command to install all available AI skills for Univer with a single command. This is the recommended approach for a complete setup. ```bash npx skills add dream-num/univer-sdk-skills ``` -------------------------------- ### Minimal Example (Plugin Mode) Source: https://docs.univer.ai/showcase/docs/slim-via-preset Demonstrates the minimum configuration required to use Univer Docs in plugin mode. This setup initializes Univer with core docs presets and creates a new document. ```typescript import { UniverDocsCorePreset } from '@univerjs/preset-docs-core' import docsCoreEnUS from '@univerjs/preset-docs-core/locales/en-US' import { createUniver, LocaleType, mergeLocales } from '@univerjs/presets' import { DOCUMENT_DATA } from './data' import './styles.css' import '@univerjs/preset-docs-core/lib/index.css' const { univerAPI } = createUniver({ locale: LocaleType.EN_US, locales: { [LocaleType.EN_US]: mergeLocales( docsCoreEnUS, ), }, presets: [ UniverDocsCorePreset({ container: 'app', }), ], }) univerAPI.createUniverDoc(DOCUMENT_DATA) ``` -------------------------------- ### Start USIP Demo Service Source: https://docs.univer.ai/guides/pro/server Starts the USIP demo service after enabling it in the .env.custom file. ```bash bash run.sh start-demo-usip ``` -------------------------------- ### Install Web Component Adapter Source: https://docs.univer.ai/guides/docs/ui/components Install the necessary package for integrating Web Components with Univer. ```bash npm install @univerjs/ui-adapter-web-component ``` -------------------------------- ### Freeze Configuration Example Source: https://docs.univer.ai/guides/sheets/features/core/freeze Example of configuring freeze state with `xSplit`, `ySplit`, `startRow`, and `startColumn`. ```json { "xSplit": 1, // Freeze 1 column, which is column B "ySplit": 1, // Freeze 1 row, which is row 2 "startRow": 2, // The starting row that can be scrolled is row 3 "startColumn": 2 // The starting column that can be scrolled is column C } ``` -------------------------------- ### Manual Install: Clone Repository Source: https://docs.univer.ai/guides/skills/installation Manually install AI skills by cloning the repository. This method is useful for development or when automated installation is not feasible. ```bash git clone https://github.com/dream-num/univer-sdk-skills.git cd univer-sdk-skills ``` -------------------------------- ### Install Print Plugin Source: https://docs.univer.ai/guides/docs/features/print Install the Univer Docs Print plugin for standalone print functionality. ```bash npm install @univerjs-pro/docs-print ``` -------------------------------- ### Install Preset Dependencies Source: https://docs.univer.ai/guides/docs/features/print Install the necessary presets for advanced document features, including print functionality. ```bash npm install @univerjs/preset-docs-drawing @univerjs/preset-docs-advanced ``` -------------------------------- ### Install Callout Plugins Source: https://docs.univer.ai/guides/docs/features/callout Install the necessary callout plugins for Univer Docs using npm. ```bash npm install @univerjs-pro/docs-callout @univerjs-pro/docs-callout-ui ``` -------------------------------- ### Run Installation Script Source: https://docs.univer.ai/guides/pro/components Execute the installation script after creating the .env.custom file for Docker Compose deployments. ```bash run.sh ``` -------------------------------- ### Install @univerjs/sheets-sort and @univerjs/sheets-sort-ui Source: https://docs.univer.ai/guides/sheets/features/sort Install the plugin packages for sorting and its UI components. ```bash npm install @univerjs/sheets-sort @univerjs/sheets-sort-ui ``` -------------------------------- ### Install Enhanced List Plugins Source: https://docs.univer.ai/guides/docs/features/list Install the necessary plugins for the enhanced list feature using npm. Ensure you have Univer Pro installed. ```bash npm install @univerjs-pro/docs-list @univerjs-pro/docs-list-ui ``` -------------------------------- ### Install Preset Docs Drawing Source: https://docs.univer.ai/guides/docs/features/images Install the preset package for drawing features in Univer documents. ```bash npm install @univerjs/preset-docs-drawing ``` -------------------------------- ### Install Live Share Plugin Source: https://docs.univer.ai/guides/sheets/features/live-share Install the Live Share plugin using npm. This is the first step to enable collaborative features. ```bash npm install @univerjs-pro/live-share ``` -------------------------------- ### Install Quick Insert UI Plugin Source: https://docs.univer.ai/guides/docs/features/quick-insert Install the Quick Insert UI plugin using npm. This is the first step to enable the quick insert functionality. ```bash npm install @univerjs/docs-quick-insert-ui ``` -------------------------------- ### Install Quote Block Plugins Source: https://docs.univer.ai/guides/docs/features/quote Install the necessary quote block plugins for Univer Docs. ```bash npm install @univerjs-pro/docs-quote @univerjs-pro/docs-quote-ui ``` -------------------------------- ### Install Hyper Link Plugin Source: https://docs.univer.ai/guides/docs/features/hyper-link Install the core and UI packages for the Hyper Link plugin. ```bash npm install @univerjs/docs-hyper-link @univerjs/docs-hyper-link-ui ``` -------------------------------- ### Install @univerjs/preset-sheets-sort Source: https://docs.univer.ai/guides/sheets/features/sort Install the preset package for sorting functionality. ```bash npm install @univerjs/preset-sheets-sort ``` -------------------------------- ### Install Univer Server with Docker Compose Source: https://docs.univer.ai/guides/pro/server Installs the latest version of the Univer Server using a curl script. The script automatically installs Docker if it's not present. ```bash bash -c "$(curl -fsSL https://get.univer.ai)" ``` -------------------------------- ### Install Hyper Link Preset Source: https://docs.univer.ai/guides/docs/features/hyper-link Install the preset package for Hyper Link functionality. ```bash npm install @univerjs/preset-docs-hyper-link ``` -------------------------------- ### Install Pivot Table Plugin Packages Source: https://docs.univer.ai/guides/sheets/features/pivot-table Install the pivot table and pivot table UI plugins for Univer. ```bash npm install @univerjs-pro/sheets-pivot @univerjs-pro/sheets-pivot-ui ``` -------------------------------- ### Install and Register WebSocket Plugin Source: https://docs.univer.ai/guides/docs/features/core/general-api Demonstrates the necessary imports and plugin registration for using the WebSocket functionality with piecemeal installation. ```typescript // ... Omits other plugin imports import { UniverNetworkPlugin } from '@univerjs/network' // ... Omits other facade imports import '@univerjs/network/facade' // ... Omits other plugin registrations univer.registerPlugin(UniverNetworkPlugin) ``` -------------------------------- ### Install Univer Observability Components Source: https://docs.univer.ai/guides/pro/deploy/kubernetes Install Univer's configured observability components using Helm. Ensure the `global.univerNamespace` is set correctly. ```bash helm upgrade --install -n univer-observability --create-namespace \ --set global.univerNamespace="univer" \ univer-observability \ oci://univer-acr-registry.cn-shenzhen.cr.aliyuncs.com/helm-charts/univer-observability ``` -------------------------------- ### Install Preset Mode Source: https://docs.univer.ai/guides/sheets/features/conditional-formatting Install the conditional formatting preset package for Univer Sheets. ```bash npm install @univerjs/preset-sheets-conditional-formatting ``` -------------------------------- ### Install Univer Icons Source: https://docs.univer.ai/icons Install the official Univer icon package using npm. ```bash npm install @univerjs/icons ``` -------------------------------- ### Install Collaboration Plugins Source: https://docs.univer.ai/guides/docs/features/collaboration Install the necessary packages for the Univer Pro collaboration plugin mode. This includes the core collaboration package, the client, and the UI client. ```bash npm install @univerjs-pro/collaboration @univerjs-pro/collaboration-client @univerjs-pro/collaboration-client-ui ``` -------------------------------- ### Install Shape Plugins Source: https://docs.univer.ai/guides/docs/features/shape Install the necessary shape and shape UI plugins for Univer Docs using npm. ```bash npm install @univerjs-pro/docs-shape @univerjs-pro/docs-shape-ui ``` -------------------------------- ### Install Zen Editor Plugin Source: https://docs.univer.ai/guides/sheets/features/zen Install the Zen Editor plugin using npm. This is the first step for both Preset and Plugin modes. ```bash npm install @univerjs/sheets-zen-editor ``` -------------------------------- ### Install Univer Docs Core Preset Source: https://docs.univer.ai/guides/docs/features/core Install the necessary packages for Univer Docs core features using npm, pnpm, yarn, or bun. ```bash npm install @univerjs/presets @univerjs/preset-docs-core ``` -------------------------------- ### Install Advanced Formula Engine Preset Source: https://docs.univer.ai/guides/sheets/features/advanced-formula Install the necessary presets for the advanced formula engine, including drawing and advanced presets. Ensure the drawing preset is installed first as it's a runtime dependency. ```bash npm install @univerjs/preset-sheets-drawing @univerjs/preset-sheets-advanced ``` -------------------------------- ### Install Collaboration Presets Source: https://docs.univer.ai/guides/docs/features/collaboration Install the necessary presets for collaborative editing in Univer Docs. This includes drawing, advanced, and collaboration presets. ```bash npm install @univerjs/preset-docs-drawing @univerjs/preset-docs-advanced @univerjs/preset-docs-collaboration ``` -------------------------------- ### Install Data Validation Preset Source: https://docs.univer.ai/guides/sheets/features/data-validation Install the preset package for data validation using npm. ```bash npm install @univerjs/preset-sheets-data-validation ``` -------------------------------- ### Install Data Validation Plugins Source: https://docs.univer.ai/guides/sheets/features/data-validation Install the core, sheets, and UI plugins for data validation in plugin mode. ```bash npm install @univerjs/data-validation @univerjs/sheets-data-validation @univerjs/sheets-data-validation-ui ``` -------------------------------- ### Install Uniscript via npm Source: https://docs.univer.ai/guides/docs/features/uniscript Install the Uniscript package using npm. This is the first step for both Preset and Plugin modes. ```bash npm install @univerjs/uniscript ``` -------------------------------- ### Install Plugin Mode Packages Source: https://docs.univer.ai/guides/docs/features/images Install the necessary packages for using Univer in plugin mode with drawing and docs drawing features. ```bash npm install @univerjs/drawing @univerjs/drawing-ui @univerjs/docs-drawing @univerjs/docs-drawing-ui ``` -------------------------------- ### Install Skills Globally Source: https://docs.univer.ai/guides/skills/installation Install AI skills for Univer globally, making them accessible across all your projects. Use this for skills you frequently use. ```bash npx skills add dream-num/univer-sdk-skills --global ``` -------------------------------- ### Install and Run Univer Doc Starter Kit with npm Source: https://docs.univer.ai/guides/docs/getting-started/quickstart Use this command to set up a local Univer document project using npm. Ensure Node.js, npm, and Git are installed. ```bash npx degit dream-num/univer-doc-start-kit univer-doc-start-kit cd univer-doc-start-kit npm install npm run dev ``` -------------------------------- ### Install Univer Exchange Client Plugins Source: https://docs.univer.ai/guides/docs/features/import-export Install the necessary client-side plugins for Univer's exchange functionality, used in plugin mode. ```bash npm install @univerjs-pro/exchange-client @univerjs-pro/docs-exchange-client ``` -------------------------------- ### Install Plugin Mode Source: https://docs.univer.ai/guides/sheets/features/conditional-formatting Install the conditional formatting and UI packages for Univer Sheets plugin mode. ```bash npm install @univerjs/sheets-conditional-formatting @univerjs/sheets-conditional-formatting-ui ``` -------------------------------- ### Install Code Block Plugins Source: https://docs.univer.ai/guides/docs/features/code Install the necessary plugins for the code block feature using npm. ```bash npm install @univerjs-pro/docs-code @univerjs-pro/docs-code-ui ``` -------------------------------- ### Install and Run Univer Doc Starter Kit with pnpm Source: https://docs.univer.ai/guides/docs/getting-started/quickstart Use this command to set up a local Univer document project using pnpm. Ensure Node.js, pnpm, and Git are installed. ```bash pnpm dlx degit dream-num/univer-doc-start-kit univer-doc-start-kit cd univer-doc-start-kit pnpm install pnpm dev ``` -------------------------------- ### Install Advanced Formula Engine Plugin Source: https://docs.univer.ai/guides/sheets/features/advanced-formula Install the Univer Pro formula engine package for plugin-based integration. ```bash npm install @univerjs-pro/engine-formula ``` -------------------------------- ### Install Crosshair Highlight Plugin (npm) Source: https://docs.univer.ai/guides/sheets/features/crosshair-highlighting Install the crosshair highlighting plugin using npm. This is the first step for both preset and plugin modes. ```bash npm install @univerjs/sheets-crosshair-highlight ``` -------------------------------- ### Install Univer Pro Sheet Starter Kit with npm Source: https://docs.univer.ai/guides/pro Use this command to set up the Univer Pro sheet starter kit using npm. Ensure Node.js and npm are installed. ```bash npx degit dream-num/univer-pro-sheet-start-kit univer-pro-sheet-start-kit cd univer-pro-sheet-start-kit npm install npm run dev ``` -------------------------------- ### getRow Source: https://docs.univer.ai/reference/facade/range Gets the starting row index of the range. Indices are 0-based. ```APIDOC ## getRow ### Description Gets the starting row index of the range. index starts at 0. ### Method ``` getRow(): number ``` ### Returns #### Success Response - **number** - The starting row index of the range. ### Examples ```javascript const fWorkbook = univerAPI.getActiveWorkbook(); const fWorksheet = fWorkbook.getActiveSheet(); const fRange = fWorksheet.getRange('A1:B2'); console.log(fRange.getRow()); // 0 ``` ``` -------------------------------- ### getColumn Source: https://docs.univer.ai/reference/facade/range Gets the starting column index of the range. Indices are 0-based. ```APIDOC ## getColumn ### Description Gets the starting column index of the range. index starts at 0. ### Method ``` getColumn(): number ``` ### Returns #### Success Response - **number** - The starting column index of the range. ### Examples ```javascript const fWorkbook = univerAPI.getActiveWorkbook(); const fWorksheet = fWorkbook.getActiveSheet(); const fRange = fWorksheet.getRange('A1:B2'); console.log(fRange.getColumn()); // 0 ``` ``` -------------------------------- ### Install Univer Pro Sheet Starter Kit with pnpm Source: https://docs.univer.ai/guides/pro Use this command to set up the Univer Pro sheet starter kit using pnpm. Ensure Node.js and pnpm are installed. ```bash pnpm dlx degit dream-num/univer-pro-sheet-start-kit univer-pro-sheet-start-kit cd univer-pro-sheet-start-kit pnpm install pnpm dev ``` -------------------------------- ### Get Connector Start Connection Info Source: https://docs.univer.ai/reference/facade/shape Retrieves connection details for a connector shape's start point. Use this to find out which shape and connection site a connector is attached to. ```typescript const fWorkbook = univerAPI.getActiveWorkbook(); const fWorksheet = fWorkbook.getActiveSheet(); const shapes = fWorksheet.getShapes(); const connector = shapes.find((s) => s.isLineShape()); if (connector) { const startInfo = connector.getStartConnectInfo(); if (startInfo) { console.log(`Start connected to shape ${startInfo.shapeId} at site ${startInfo.cxnIndex}`); } } ``` -------------------------------- ### Install Vue 3 Adapter Plugin Source: https://docs.univer.ai/guides/docs/ui/components Install the necessary UI adapter plugin for Vue 3.x components. ```bash npm install @univerjs/ui-adapter-vue3 ``` -------------------------------- ### Install Specific Skill Source: https://docs.univer.ai/guides/skills/installation Install a particular AI skill for Univer by specifying its name. Useful when you only need a subset of the available skills. ```bash npx skills add dream-num/univer-sdk-skills --skill univer-integrate ``` ```bash npx skills add dream-num/univer-sdk-skills --skill univer-plugin-dev ``` ```bash npx skills add dream-num/univer-sdk-skills --skill univer-pro-integrate ``` ```bash npx skills add dream-num/univer-sdk-skills --skill univer-node-backend ``` -------------------------------- ### Get A1 Notation for a Range Source: https://docs.univer.ai/reference/facade/range Demonstrates how to get the A1 notation of a range with options to include the sheet name and specify absolute reference types for start and end cells. ```typescript const fWorkbook = univerAPI.getActiveWorkbook(); const fWorksheet = fWorkbook.getActiveSheet(); // By default, the A1 notation is returned without the sheet name and without absolute reference types. const fRange = fWorksheet.getRange('A1:B2'); console.log(fRange.getA1Notation()); // A1:B2 // By setting withSheet to true, the sheet name is included in the A1 notation. fWorksheet.setName('Sheet1'); console.log(fRange.getA1Notation(true)); // Sheet1!A1:B2 // By setting startAbsoluteRefType, the absolute reference type for the start cell is included in the A1 notation. console.log(fRange.getA1Notation(false, univerAPI.Enum.AbsoluteRefType.ROW)); // A$1:B2 console.log(fRange.getA1Notation(false, univerAPI.Enum.AbsoluteRefType.COLUMN)); // $A1:B2 console.log(fRange.getA1Notation(false, univerAPI.Enum.AbsoluteRefType.ALL)); // $A$1:B2 // By setting endAbsoluteRefType, the absolute reference type for the end cell is included in the A1 notation. console.log(fRange.getA1Notation(false, null, univerAPI.Enum.AbsoluteRefType.ROW)); // A1:B$2 console.log(fRange.getA1Notation(false, null, univerAPI.Enum.AbsoluteRefType.COLUMN)); // A1:$B2 console.log(fRange.getA1Notation(false, null, univerAPI.Enum.AbsoluteRefType.ALL)); // A1:$B$2 // By setting all parameters example console.log(fRange.getA1Notation(true, univerAPI.Enum.AbsoluteRefType.ALL, univerAPI.Enum.AbsoluteRefType.ALL)); // Sheet1!$A$1:$B$2 ``` -------------------------------- ### Get Table Info by Cell using Facade API Source: https://docs.univer.ai/guides/sheets/features/table Retrieve table information associated with a specific cell using `getTableByCell`. This example shows how to get table info for cell B2 before and after inserting a table. ```typescript const fWorkbook = univerAPI.getActiveWorkbook() const fWorksheet = fWorkbook.getActiveSheet() const cellB2 = fWorksheet.getRange('B2') const row = cellB2.getRow() const column = cellB2.getColumn() console.log('debugger tableInfo', fWorksheet.getTableByCell(row, column)) // Insert a table in the range B2:F11 const fRange = fWorksheet.getRange('B2:F11') const success = await fWorksheet.addTable( 'name-1', fRange.getRange(), 'id-1', { tableStyleId: 'table-default-4', }, ) console.log('debugger tableInfo2', fWorksheet.getTableByCell(row, column)) ``` -------------------------------- ### Install Univer Sheets Core Preset Source: https://docs.univer.ai/guides/sheets/features/core Install the necessary packages for Univer Sheets core functionality using npm. ```bash npm install @univerjs/presets @univerjs/preset-sheets-core ``` -------------------------------- ### Get Starting Row Index of a Range Source: https://docs.univer.ai/reference/facade/range Returns the zero-based index of the first row in the range. Useful for row-based operations. ```typescript const fWorkbook = univerAPI.getActiveWorkbook(); const fWorksheet = fWorkbook.getActiveSheet(); const fRange = fWorksheet.getRange('A1:B2'); console.log(fRange.getRow()); // 0 ``` -------------------------------- ### Comprehensive .env.custom Configuration Example Source: https://docs.univer.ai/guides/pro/deploy/docker-compose An example .env.custom file demonstrating advanced configurations for USIP integration, permission control, event synchronization, self-hosted PostgreSQL and S3, custom ports, and service scaling. ```shell # 1. enable USIP integration # usip about USIP_ENABLED=true USIP_URI_CREDENTIAL=https://usip-demo.univer.ai/usip/credential USIP_URI_USERINFO=https://usip-demo.univer.ai/usip/userinfo USIP_URI_ROLE=https://usip-demo.univer.ai/usip/role USIP_URI_COLLABORATORS=https://usip-demo.univer.ai/usip/collaborators USIP_URI_UNITEDITTIME=https://usip-demo.univer.ai/usip/unit-edit-time # 2. only owner can copy content and print AUTH_PERMISSION_CUSTOMER_STRATEGIES=[ {"action": 3, "role": 2}, {"action": 6, "role": 2} ] # 3. enable univer event sync EVENT_SYNC=true # Set to true to enable # 4. use owner RDS # postgresql config DISABLE_UNIVER_RDS=true # When using your own RDS, disable Univer's default PostgreSQL DATABASE_DRIVER=postgresql # Set to postgresql for PostgreSQL-compatible databases DATABASE_HOST=univer-postgresql DATABASE_PORT=5432 DATABASE_DBNAME=univer DATABASE_USERNAME=universer-biz DATABASE_PASSWORD=123456 # 5. use owner Object storage # s3 config DISABLE_UNIVER_S3=true # When using your own object storage, disable Univer's built-in MinIO S3_USER=universer-biz S3_PASSWORD=123456 S3_REGION=cn-sz S3_PATH_STYLE=true S3_ENDPOINT=univer-s3:9652 S3_ENDPOINT_PUBLIC=univer.ai:9653 S3_DEFAULT_BUCKET=univer # 6. change univer service Port HOST_NGINX_PORT=8010 # 7. set the service scale UNIVERSER_REPLICATION_CNT=4 # universer instance count COLLABORATION_SERVER_REPLICATION_CNT=5 # collaboration service instance count MAX_MEMORY_LIMIT=2048 # collaboration service max memory limit, in MB ``` -------------------------------- ### Get Starting Column Index of a Range Source: https://docs.univer.ai/reference/facade/range Returns the zero-based index of the first column in the range. Useful for column-based operations. ```typescript const fWorkbook = univerAPI.getActiveWorkbook(); const fWorksheet = fWorkbook.getActiveSheet(); const fRange = fWorksheet.getRange('A1:B2'); console.log(fRange.getColumn()); // 0 ``` -------------------------------- ### Get Row Outline Groups Source: https://docs.univer.ai/reference/facade/worksheet Retrieves all row outline groups from the current worksheet. Logs the ID, start, end, and collapsed state of each outline. ```typescript const fWorkbook = univerAPI.getActiveWorkbook(); const fWorksheet = fWorkbook.getActiveSheet(); const rowOutlines = fWorksheet.getDimensionOutlines(univerAPI.Enum.DimensionOutlineAxis.ROW); rowOutlines.forEach((outline) => { console.log(outline.id, outline.start, outline.end, outline.collapsed); }); ``` -------------------------------- ### Get Custom Meta Data Source: https://docs.univer.ai/reference/facade/range Returns the custom meta data associated with the cell at the start of the specified range. This is useful for storing and retrieving arbitrary data linked to a cell. ```typescript const fWorkbook = univerAPI.getActiveWorkbook(); const fWorksheet = fWorkbook.getActiveSheet(); const fRange = fWorksheet.getRange('A1:B2'); console.log(fRange.getCustomMetaData()); ``` -------------------------------- ### Get Freeze State using FWorksheet Source: https://docs.univer.ai/guides/sheets/features/core/freeze Retrieves the current freeze state of the worksheet, including frozen columns, rows, and scrollable starting points, using the `getFreeze` method. ```javascript const worksheet = univerAPI.getActiveWorkbook().getActiveSheet() const freezeState = worksheet.getFreeze() ``` -------------------------------- ### Start Univer Server Source: https://docs.univer.ai/guides/pro/troubleshooting Initiates the Univer server startup process using a local script. Useful for debugging demo UI accessibility. ```bash cd univer-server && bash run.sh start ``` -------------------------------- ### Get Used Theme Style of a Range Source: https://docs.univer.ai/reference/facade/range Retrieves the name of the theme style applied to a range. If no theme style is applied, it returns undefined. The example also shows how to apply a theme style. ```typescript const fWorkbook = univerAPI.getActiveWorkbook(); const fWorksheet = fWorkbook.getActiveSheet(); const fRange = fWorksheet.getRange('A1:E20'); console.log(fRange.getUsedThemeStyle()); // undefined fRange.useThemeStyle('default'); console.log(fRange.getUsedThemeStyle()); // 'default' ``` -------------------------------- ### Importing the Facade API Source: https://docs.univer.ai/guides/docs/features/core/general-api Demonstrates how to import and initialize the Univer Facade API. ```APIDOC ## Importing the Facade API ``` import { FUniver } from '@univerjs/core/facade' const univerAPI = FUniver.newAPI(univer) ``` ``` -------------------------------- ### Node.js Headless Univer Docs Setup Source: https://docs.univer.ai/showcase/docs/node-via-plugin This snippet shows the essential imports and setup for running Univer Docs in a Node.js environment. It includes registering necessary plugins like render, formula, and docs, and creating a new document instance with provided data. ```typescript import type { DocumentDataModel } from '@univerjs/core' import { IUniverInstanceService, LocaleType, Univer, UniverInstanceType } from '@univerjs/core' import { UniverDocsPlugin } from '@univerjs/docs' import { UniverFormulaEnginePlugin } from '@univerjs/formula-engine' import { UniverRenderEnginePlugin } from '@univerjs/engine-render' import { DOCUMENT_DATA } from '../code/data' const univer = new Univer({ locale: LocaleType.EN_US, locales: { [LocaleType.EN_US]: {}, }, }) univer.registerPlugin(UniverRenderEnginePlugin) univer.registerPlugin(UniverFormulaEnginePlugin) univer.registerPlugin(UniverDocsPlugin) univer.createUnit(UniverInstanceType.UNIVER_DOC, DOCUMENT_DATA) const injector = univer.__getInjector() const univerInstanceService = injector.get(IUniverInstanceService) const units = univerInstanceService.getAllUnitsForType