# @univerjs/preset-sheets-advanced

[![npm version](https://img.shields.io/npm/v/@univerjs/preset-sheets-advanced?style=flat-square)](https://npmjs.com/package/@univerjs/preset-sheets-advanced)
[![license](https://img.shields.io/npm/l/@univerjs/preset-sheets-advanced?style=flat-square)](https://npmjs.com/package/@univerjs/preset-sheets-advanced)
[![downloads](https://img.shields.io/npm/dm/@univerjs/preset-sheets-advanced?style=flat-square)](https://npmjs.com/package/@univerjs/preset-sheets-advanced)

`@univerjs/preset-sheets-advanced` provides a preset for advanced Univer Sheets with charts, pivot tables, and print capabilities.

## Package Overview

| Package | UMD global | CSS | Locales | Facade entry | Worker entry |
| --- | --- | :---: | :---: | :---: | :---: |
| `@univerjs/preset-sheets-advanced` | — | Yes | Yes | No | Yes |

## Installation

```sh
pnpm add @univerjs/preset-sheets-advanced
# or
npm install @univerjs/preset-sheets-advanced
```

## Usage

Start with the [integration setup](https://docs.univer.ai/) for the required core preset, styles, and locale resources.

```ts
import { UniverSheetsAdvancedPreset } from '@univerjs/preset-sheets-advanced';

// Use with createUniver:
// createUniver({ presets: [UniverSheetsAdvancedPreset()] });
```

### Worker usage

On the main thread, import `UniverSheetsAdvancedPreset` from `@univerjs/preset-sheets-advanced`. Set `useWorker: true` and configure `workerURL` on `UniverSheetsCorePreset`.

In the worker entry, import `UniverSheetsAdvancedWorkerPreset` from `@univerjs/preset-sheets-advanced/worker`:

```ts
import { UniverSheetsAdvancedWorkerPreset } from '@univerjs/preset-sheets-advanced/worker';
import { UniverSheetsCoreWorkerPreset } from '@univerjs/preset-sheets-core/worker';
import { createUniver } from '@univerjs/presets';

createUniver({ presets: [UniverSheetsCoreWorkerPreset(), UniverSheetsAdvancedWorkerPreset()] });
```

## Integration Notes

- For formula reference selection, explicitly register `UniverEmbedUIPlugin` from [`@univerjs-pro/embed-ui`](../../../packages/embed-ui/README.md) in the application and load its stylesheet and locale resources. The preview plugin is not included in this preset.

## Resources

- [Documentation](https://docs.univer.ai)
- [NPM package](https://npmjs.com/package/@univerjs/preset-sheets-advanced)
- [GitHub repository](https://github.com/dream-num/univer-pro)
