0.4.57 • Published 8 months ago

@kong-ui-public/expressions v0.4.57

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
8 months ago

@kong-ui-public/expressions

Reusable components to support Kong's expressions language.

Features

  • Provides a Monaco-based editor with autocomplete and syntax highlighting support for the expressions language.

Requirements

  • vue must be initialized in the host application
  • monaco-editor is required as a dependency in the host application
  • vite-plugin-monaco-editor is a required Vite plugin to bundle the Monaco Editor and its web workers
  • @kong-ui-public/forms is an optional dependency required for the RouterPlaygroundModal component

Usage

Install

Install required devDependencies in your host application:

yarn add -D vite-plugin-monaco-editor

Enable the vite-plugin-monaco-editor plugin. Your Vite config should look like this:

import monacoEditorPlugin from 'vite-plugin-monaco-editor'

export default defineConfig({
  // ...
  plugins: [
    monacoEditorPlugin({}),
  ],
  // ...
}

For more information on configuring the vite-plugin-monaco-editor plugin, you should refer to their readme docs.

Import and use

Import the component(s) in your host application as well as the package styles:

import { asyncInit, ExpressionsEditor } from '@kong-ui-public/expressions'
import '@kong-ui-public/expressions/dist/style.css'

This package utilizes vite-plugin-top-level-await to transform code in order to use top-level await on older browsers. To load the WASM correctly, you must use await or Promise.then to wait the imported asyncInit before using any other imported values.

For example:

const editorInitialized = ref(false)

asyncInit.then(() => {
  editorInitialized.value = true
  // use the editor and other imported values
})

You can also make use of Vue's experimental Suspense component to load async components that use this package.

Individual component documentation

0.4.57

8 months ago

0.4.55

8 months ago

0.4.56

8 months ago

0.4.53

8 months ago

0.4.54

8 months ago

0.4.51

8 months ago

0.4.52

8 months ago

0.4.50

8 months ago

0.4.49

8 months ago

0.4.42

9 months ago

0.4.43

9 months ago

0.4.40

9 months ago

0.4.41

9 months ago

0.4.48

8 months ago

0.4.46

8 months ago

0.4.47

8 months ago

0.4.44

9 months ago

0.4.45

9 months ago

0.4.31

9 months ago

0.4.32

9 months ago

0.4.30

9 months ago

0.4.39

9 months ago

0.4.37

9 months ago

0.4.38

9 months ago

0.4.35

9 months ago

0.4.36

9 months ago

0.4.33

9 months ago

0.4.34

9 months ago

0.4.29

9 months ago

0.4.28

9 months ago

0.4.26

9 months ago

0.4.27

9 months ago

0.4.24

9 months ago

0.4.25

9 months ago

0.4.20

9 months ago

0.4.21

9 months ago

0.4.22

9 months ago

0.4.23

9 months ago

0.4.19

9 months ago

0.4.17

9 months ago

0.4.18

9 months ago

0.4.16

9 months ago

0.4.15

9 months ago

0.4.14

9 months ago

0.4.13

10 months ago

0.4.10

10 months ago

0.4.11

10 months ago

0.4.12

10 months ago

0.4.9

10 months ago

0.4.8

10 months ago

0.2.12

1 year ago

0.2.11

1 year ago

0.2.10

1 year ago

0.3.0

1 year ago

0.3.6

12 months ago

0.3.5

1 year ago

0.3.8

12 months ago

0.3.7

12 months ago

0.3.2

1 year ago

0.3.1

1 year ago

0.3.4

1 year ago

0.3.3

1 year ago

0.4.5

10 months ago

0.4.4

10 months ago

0.4.7

10 months ago

0.4.6

10 months ago

0.4.1

11 months ago

0.4.0

11 months ago

0.4.3

10 months ago

0.4.2

11 months ago

0.3.9

12 months ago

0.3.14

11 months ago

0.3.13

11 months ago

0.3.12

11 months ago

0.3.11

12 months ago

0.3.10

12 months ago

0.2.9

1 year ago

0.2.8

1 year ago

0.2.7

1 year ago

0.2.6

1 year ago

0.2.5

1 year ago

0.2.4

1 year ago

0.2.3

1 year ago

0.2.2

1 year ago

0.1.7

1 year ago

0.2.1

1 year ago

0.2.0

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.1.4

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.3

1 year ago

0.1.0

1 year ago