@univerjs/presets 1.3.1 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,52 @@
1
+ # @univerjs/presets
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@univerjs/presets?style=flat-square)](https://npmjs.com/package/@univerjs/presets)
4
+ [![license](https://img.shields.io/npm/l/@univerjs/presets?style=flat-square)](https://npmjs.com/package/@univerjs/presets)
5
+ [![downloads](https://img.shields.io/npm/dm/@univerjs/presets?style=flat-square)](https://npmjs.com/package/@univerjs/presets)
6
+
7
+ `@univerjs/presets` provides `createUniver` to compose plugin presets and return a Univer instance with its Facade API.
8
+
9
+ ## Package Overview
10
+
11
+ | Package | UMD global | CSS | Locales | Facade entry | Worker entry |
12
+ | --- | --- | :---: | :---: | :---: | :---: |
13
+ | `@univerjs/presets` | — | No | No | No | No |
14
+
15
+ ## Installation
16
+
17
+ ```sh
18
+ pnpm add @univerjs/presets
19
+ # or
20
+ npm install @univerjs/presets
21
+ ```
22
+
23
+ ## Usage
24
+
25
+ Install `@univerjs/preset-sheets-core` for this example and provide an HTML element with the ID `app`.
26
+
27
+ ```ts
28
+ import { UniverSheetsCorePreset } from '@univerjs/preset-sheets-core';
29
+ import SheetsCoreEnUS from '@univerjs/preset-sheets-core/locales/en-US';
30
+ import { createUniver, LocaleType } from '@univerjs/presets';
31
+ import '@univerjs/preset-sheets-core/lib/index.css';
32
+
33
+ const { univerAPI } = createUniver({
34
+ locale: LocaleType.EN_US,
35
+ locales: { [LocaleType.EN_US]: SheetsCoreEnUS },
36
+ presets: [UniverSheetsCorePreset({ container: 'app' })],
37
+ });
38
+
39
+ univerAPI.createWorkbook({ name: 'Workbook' });
40
+ ```
41
+
42
+ ## Integration Notes
43
+
44
+ - Install the presets needed by your document type and merge their locale resources for each enabled language.
45
+ - Import styles from the selected presets. This composition package has no stylesheet or independent Facade/Worker subpath.
46
+ - Register each plugin through either a preset or the `plugins` option; do not register the same plugin through both.
47
+
48
+ ## Resources
49
+
50
+ - [Documentation](https://docs.univer.ai/guides/sheets/getting-started/installation)
51
+ - [NPM package](https://npmjs.com/package/@univerjs/presets)
52
+ - [GitHub repository](https://github.com/dream-num/univer)
package/lib/cjs/index.js CHANGED
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  let _univerjs_core = require("@univerjs/core");
3
3
  let _univerjs_core_facade = require("@univerjs/core/facade");
4
4
 
5
- //#region src/preset.ts
5
+ // src/preset.ts
6
6
  function createUniver(options) {
7
7
  const { presets, plugins, collaboration, override = [], ...univerOptions } = options;
8
8
  if (collaboration) {
@@ -44,7 +44,6 @@ function createUniver(options) {
44
44
  };
45
45
  }
46
46
 
47
- //#endregion
48
47
  exports.createUniver = createUniver;
49
48
  Object.keys(_univerjs_core).forEach(function (k) {
50
49
  if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
package/lib/es/index.js CHANGED
@@ -7,7 +7,7 @@ export * from "@univerjs/core/facade"
7
7
 
8
8
  export * from "@univerjs/themes"
9
9
 
10
- //#region src/preset.ts
10
+ // src/preset.ts
11
11
  function createUniver(options) {
12
12
  const { presets, plugins, collaboration, override = [], ...univerOptions } = options;
13
13
  if (collaboration) {
@@ -49,5 +49,4 @@ function createUniver(options) {
49
49
  };
50
50
  }
51
51
 
52
- //#endregion
53
52
  export { createUniver };
package/lib/index.js CHANGED
@@ -7,7 +7,7 @@ export * from "@univerjs/core/facade"
7
7
 
8
8
  export * from "@univerjs/themes"
9
9
 
10
- //#region src/preset.ts
10
+ // src/preset.ts
11
11
  function createUniver(options) {
12
12
  const { presets, plugins, collaboration, override = [], ...univerOptions } = options;
13
13
  if (collaboration) {
@@ -49,5 +49,4 @@ function createUniver(options) {
49
49
  };
50
50
  }
51
51
 
52
- //#endregion
53
52
  export { createUniver };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@univerjs/presets",
3
- "version": "1.3.1",
3
+ "version": "1.5.0",
4
4
  "private": false,
5
5
  "description": "Build Univer apps faster and easier with pre-configured plugin collections.",
6
6
  "author": "DreamNum Co., Ltd. <developer@univer.ai>",
@@ -45,25 +45,25 @@
45
45
  "lib"
46
46
  ],
47
47
  "dependencies": {
48
- "@univerjs/core": "1.3.1",
49
- "@univerjs/drawing": "1.3.1",
50
- "@univerjs/engine-formula": "1.3.1",
51
- "@univerjs/engine-render": "1.3.1",
52
- "@univerjs/network": "1.3.1",
53
- "@univerjs/protocol": "1.3.1",
54
- "@univerjs/rpc": "1.3.1",
55
- "@univerjs/telemetry": "1.3.1",
56
- "@univerjs/themes": "1.3.1"
48
+ "@univerjs/core": "1.5.0",
49
+ "@univerjs/drawing": "1.5.0",
50
+ "@univerjs/engine-formula": "1.5.0",
51
+ "@univerjs/engine-render": "1.5.0",
52
+ "@univerjs/network": "1.5.0",
53
+ "@univerjs/protocol": "1.5.0",
54
+ "@univerjs/rpc": "1.5.0",
55
+ "@univerjs/telemetry": "1.5.0",
56
+ "@univerjs/themes": "1.5.0"
57
57
  },
58
58
  "devDependencies": {
59
- "@univerjs-infra/shared": "1.3.1",
59
+ "@univerjs-infra/shared": "1.5.0",
60
60
  "@wendellhu/redi": "1.1.3",
61
- "typescript": "^6.0.3"
61
+ "tsrs": "0.23.0-ts7.1.0-beta"
62
62
  },
63
63
  "scripts": {
64
- "typecheck": "tsc --noEmit",
64
+ "typecheck": "tsrs --noEmit",
65
65
  "build:bundle": "univer-cli preset build --cleanup",
66
- "build:types": "tsc -p tsconfig.node.json",
66
+ "build:types": "tsrs -p tsconfig.node.json",
67
67
  "build": "pnpm run build:bundle && pnpm run build:types"
68
68
  },
69
69
  "module": "./lib/es/index.js"