0.1.9 • Published 10 days ago

@univerjs/uniscript v0.1.9

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
10 days ago

@univerjs/uniscript

npm version license CSS Included i18n

Introduction

npm.io

@univerjs/uniscript uses the DSL (Domain-Specific Language) provided by @univerjs/facade and creates a code editor for Users to write code for operating Univer's data structures and business logic.

Users can write business logic in the code editor to meet more flexible business requirements. For instance, as shown in the illustration, users can write a Uniscript to read identity card numbers from a selected area and validate their legality, and mark the background of invalid identity card numbers with red.

:::caution The Uniscript is currently in the experimental stage, and it is not recommended to use it in production environments. You can refer to the Roadmap to understand the iteration plan of Uniscript. :::

:::tip Indeed, Uniscript's Domain-Specific Language (DSL) is a set of Facade APIs that encapsulate the internal implementation details of Univer. This API is defined here. :::

Usage

Installation

# Using npm
npm install @univerjs/uniscript

# Using pnpm
pnpm add @univerjs/uniscript

Get the Editor Instance

The @univerjs/uniscript uses Monaco Editor as its code editor. You can obtain an instance of the editor through the following method:

const editor = univer.__getInjector().get(ScriptEditorService).getEditorInstance();

Or inject ScriptEditorService into your module to obtain the editor instance.

export class YourModule {
  constructor(
    @Inject(ScriptEditorService) private readonly _scriptEditorService
  ) {}

  private _getEditor() {
    return this._scriptEditorService.getEditorInstance();
  }
}
0.1.9

10 days ago

0.1.8

13 days ago

0.1.7

27 days ago

0.1.6

1 month ago

0.1.5

1 month ago

0.1.4

2 months ago

0.1.3

2 months ago

0.1.2

2 months ago

0.1.1

2 months ago

0.1.0-beta.5

3 months ago

0.1.0-beta.4

3 months ago

0.1.0-beta.3

3 months ago

0.1.0-beta.2

4 months ago

0.1.0-beta.1

4 months ago

0.1.0-beta.0

5 months ago

0.1.0-alpha.3

5 months ago

0.1.0-alpha.2

5 months ago

0.1.0-alpha.1

5 months ago