本文へ移動
cccskills
無料GitHub で公開

univer-pro-integrate

Integrate current Univer Pro features into browser applications. Use for licensed Sheets, Docs, Slides, Bases, Boards, or PDFs; advanced Sheets presets; collaboration and edit history; Office import/export; printing; pivot tables; charts; sparklines; shapes; Pro workers; license ordering; or Pro Facade APIs.

インストール方法を見る

含まれるファイル(8)

  • SKILL.md8.1 KB
  • agents/openai.yaml254 B
  • references/collaboration-guide.md6.3 KB
  • references/exchange-guide.md6.9 KB
  • references/facade-extension-pro.md9.3 KB
  • references/license-guide.md2.9 KB
  • references/print-guide.md5.3 KB
  • references/pro-features-guide.md18.2 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Univer Pro Integrate

Add licensed Univer Pro capabilities to an existing Univer application.

Source baseline: Univer and Univer Pro 1.0.0-beta.0, synchronized with the current dream-num/univer and dream-num/univer-pro sources. Inspect the target project's installed versions first and preserve that exact release line.

Prerequisite: Use univer-integrate for the base application, container, locale, unit creation, and ordinary Facade patterns. Use univer-customize-theme for application palettes, dark mode, and the separate Pro Chart theme registry.

Choose the integration path

  • Use @univerjs/preset-sheets-advanced for ordinary Pro Sheets integration. It composes the license, Pro formula, pivot table, print, chart, outline, shape, sparkline, and Sheets exchange plugins plus their Facade extensions.
  • Add @univerjs/preset-sheets-collaboration for collaboration and edit history. Register it after the Advanced preset.
  • Use @univerjs/preset-docs-advanced and @univerjs/preset-docs-collaboration for ordinary Pro Docs integration.
  • Use Plugin Mode only for custom loading, exact bundle composition, or hosts without a matching Pro preset, such as Slides, Bases, Boards, and PDFs.
  • Never register both a preset and a plugin already owned by that preset.

In 1.0.0-beta.0, Slides, Bases, Boards, and PDFs are real Pro product hosts with their own runtime/UI packages, host /facade entry, and creation method (createPresentation, createBase, createBoard, and createPdf). They do not have unified Pro presets. Follow the product matrix and Plugin Mode chains in references/pro-features-guide.md; do not infer a preset merely because a product or Facade exists.

Version policy

  1. Read package.json, the lockfile, or an installed Univer package manifest.
  2. Keep every @univerjs/*, @univerjs-pro/*, and @univerjs/preset-* package on the same exact Univer version.
  3. For a new project targeting this source baseline, use 1.0.0-beta.0.
  4. Treat a package-version mismatch as an integration error; Univer validates plugin versions at runtime.

Quick start: add Pro Sheets to the base preset

Install the Pro preset at the same version as the base preset:

npm install @univerjs/preset-sheets-advanced@1.0.0-beta.0

Extend the univer-integrate Sheets preset example with the Advanced locale, stylesheet, and preset:

import { UniverSheetsAdvancedPreset } from '@univerjs/preset-sheets-advanced';
import UniverPresetSheetsAdvancedEnUS from '@univerjs/preset-sheets-advanced/locales/en-US';

import '@univerjs/preset-sheets-advanced/lib/index.css';

declare const clientLicense: string;

const { univer, univerAPI } = createUniver({
  locale: LocaleType.EN_US,
  locales: {
    [LocaleType.EN_US]: mergeLocales(
      UniverPresetSheetsCoreEnUS,
      UniverPresetSheetsAdvancedEnUS,
    ),
  },
  theme: defaultTheme,
  presets: [
    UniverSheetsCorePreset({ container: 'app' }),
    UniverSheetsAdvancedPreset({
      license: clientLicense,
      universerEndpoint: 'https://your-universer.example.com',
    }),
  ],
});

Keep the license outside source control. universerEndpoint is the Universer origin; the preset derives the upload, import, export, task, sign, and download routes from it.

Add collaboration

npm install @univerjs/preset-sheets-collaboration@1.0.0-beta.0
import { UniverSheetsCollaborationPreset } from '@univerjs/preset-sheets-collaboration';
import UniverPresetSheetsCollaborationEnUS from '@univerjs/preset-sheets-collaboration/locales/en-US';

import '@univerjs/preset-sheets-collaboration/lib/index.css';

const collaborationPreset = UniverSheetsCollaborationPreset({
  universerEndpoint: 'https://your-universer.example.com',
  univerContainerId: 'app',
  enableOfflineEditing: true,
});

Set collaboration: true in the top-level createUniver options, merge the collaboration locale, and append collaborationPreset after UniverSheetsAdvancedPreset(...). Pass collaboration: true to OSS feature presets that expose that option, such as the Drawing preset. Load a shared server unit with univerAPI.loadServerUnit(unitId, type) rather than creating a blank local workbook with the same ID.

Plugin Mode rules

Register a configured license before every Pro plugin:

import { UniverLicensePlugin } from '@univerjs-pro/license';
import { UniverSheetsPrintPlugin } from '@univerjs-pro/sheets-print';

import '@univerjs-pro/sheets-print/facade';

univer.registerPlugin(UniverLicensePlugin, { license: clientLicense });
univer.registerPlugin(UniverSheetsPrintPlugin);

Many Pro plugins declare UniverLicensePlugin as a dependency. If a dependent plugin runs first, Univer can auto-register the license plugin with default empty configuration; a later explicit registration is then a duplicate. Configure dependencies before dependents, register all plugins before creating units, and import each required /facade side-effect entry before calling its Facade methods.

Plugin registration, Facade side-effect imports, CSS, and locales are independent requirements. In particular, importing @univerjs-pro/<package>/facade does not register its plugin or load its stylesheet. Import each selected CSS-owning package's /lib/index.css in Plugin Mode; a preset integration instead imports that preset's aggregate /lib/index.css.

Current Facade examples

Import and export Sheets:

const unitId = await univerAPI.importSheetToUnitIdAsync(file);
if (!unitId) throw new Error('The workbook could not be imported');

const exported = await univerAPI.exportSheetByUnitIdAsync(unitId);
if (!exported) throw new Error('The workbook could not be exported');

univerAPI.downloadFile(exported, 'report', 'xlsx');

Print the active workbook:

const workbook = univerAPI.getActiveWorkbook();
if (!workbook) throw new Error('No active workbook');

workbook.openPrintDialog();

Insert a chart:

const worksheet = workbook.getActiveSheet();
if (!worksheet) throw new Error('No active worksheet');

const chartInfo = worksheet
  .newChart(univerAPI.Enum.ChartTypeString.Column)
  .setSource({
    range: 'A1:D8',
    orientation: univerAPI.Enum.ChartSourceOrientation.Columns,
  })
  .setPosition('F2')
  .setSize(640, 360)
  .setTitle('Quarterly sales')
  .build();

await worksheet.insertChart(chartInfo);

Feature routing

  • Read references/pro-features-guide.md for presets, worker composition, and the current package families.
  • Read references/collaboration-guide.md for server routes, loading shared units, status, collaborators, and flushing pending changes.
  • Read references/exchange-guide.md for Sheets, Docs, Slides, Bases, Boards, and PDFs exchange methods and snapshot conversion.
  • Read references/print-guide.md for Sheets print configuration, range screenshots, and Slides print.
  • Read references/license-guide.md for registration order and worker-license propagation.
  • Read references/facade-extension-pro.md for current pivot, chart, shape, sparkline, and collaboration Facade methods.

Anti-patterns

  • Do not migrate a 0.25.0 entry by changing only version strings. Current presets, aggregate CSS, Facade export surfaces, product hosts, and registration composition differ; use the verified comparison in pro-features-guide.md.
  • Do not copy 0.x method names such as importXLSXToUnitIdAsync, newChart() without a type, setChartType, newShape, or PrintOrientation into a 1.0.0-beta.0 project.
  • Do not put Sheets-specific exchange options on UniverExchangeClientPlugin; configure UniverSheetsExchangeClientPlugin instead.
  • Do not instantiate or mutate internal models for an operation that has a Facade or Command API.
  • Do not commit client licenses or embed server-license files in frontend bundles.
  • Do not omit Pro locale bundles or package styles in browser integrations.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Build applications with Univer Office SDK, covering the Web SDK (embedded Sheets, Docs, Slides, Boards, Bases and PDFs editors), Server SDK (self-hosted OT collaboration, storage, auth, Office import/export), AI SDK (agent-operated Office CLIs, reviewable Worktrees), and Binding SDK (plain HTML pages bound to live Sheet data). Use when starting or designing any Univer-based app or choosing Univer packages, including when the user describes a spreadsheet, document, collaboration, or AI-office need without naming a Univer package.

日本語の概要は準備中です。原文の説明を表示しています。

dream-num/skills772026年10月12日 更新

Use when installing or operating Univer CLI for .univer files, spreadsheets, documents, slides, Base databases, Board canvases, cross-Unit embedding, worktrees, Facade authoring, inspection, verification, import/export, screenshots, or viewer handoff.

日本語の概要は準備中です。原文の説明を表示しています。

dream-num/skills772026年10月12日 更新

Customize Univer color themes, branded palettes, dark mode, and theme-aware plugin styles across Sheets, Docs, Slides, Bases, Boards, and PDFs. Use when setting an initial or runtime Theme, consuming ThemeService or --univer-* CSS variables, keeping custom UI or canvas code theme-aware, registering a separate Univer Pro chart theme, or migrating theme code from Univer 0.25.0 to current 1.0 source.

日本語の概要は準備中です。原文の説明を表示しています。

dream-num/skills772026年10月12日 更新

Integrate Univer Sheets, Docs, or Slides into React, Vue 3, HTML, or Node.js projects. Use when embedding Univer, choosing preset or plugin mode, initializing instances, configuring themes/locales/workers, or manipulating workbooks, worksheets, ranges, formulas, permissions, and events through the Facade API.

日本語の概要は準備中です。原文の説明を表示しています。

dream-num/skills772026年10月12日 更新

Run Univer Sheets, Docs, Slides, Bases, Boards, or PDFs in Node.js without browser UI. Use for server-side or backend Univer, OSS Sheets or Docs Node presets, Pro product Facades and collaboration, JSON snapshot processing, formula or Base child-process workers, or automated unit manipulation with @univerjs/rpc-node.

日本語の概要は準備中です。原文の説明を表示しています。

dream-num/skills772026年10月12日 更新

Develop custom plugins for Univer sheets, docs, slides, bases, boards, and PDFs. Use when implementing a Plugin lifecycle, dependency injection, commands/mutations/operations, undo/redo, Facade extensions or custom events, toolbar/context-menu items, shortcuts, icons, popups, or when diagnosing plugin API and registration errors.

日本語の概要は準備中です。原文の説明を表示しています。

dream-num/skills772026年10月12日 更新

dream-num のスキルをすべて見る

このスキルの問題を報告する