Detalhes do pacote

@bpmn-io/feel-editor

bpmn-io108.6kMIT1.10.1

Editor for FEEL expressions.

bpmn-io, feel, editor

readme (leia-me)

@bpmn-io/feel-editor

Embeddable Editor for FEEL expressions.

Usage

To get started, create a feel-editor instance:

import FeelEditor from '@bpmn-io/feel-editor';

const editor = new FeelEditor({
  container
});

Configure the FEEL dialect (expression or unary tests):

const editor = new FeelEditor({
  container,
  dialect: 'unaryTests' // defaults to 'expression'
});

You can provide a starting document and listen for changes:

const editor = new FeelEditor({
  container,
  onChange,
  onKeyDown,
  onLint,
  value
});

Variables

You can provide a variables array that will be used for auto completion. Nested structures are supported. The Variables need to be in the following format:

const editor = new FeelEditor({
  container,
  variables: [
    {
      name: 'variablename to match',
      detail: 'optional inline info',
      info: 'optional pop-out info',
      entries: [
        {
          name: 'nested variable',
          ...
        }
      ]
    }
  ]
});

The variables can be updated on the instance via FeelEditor#setVariables():

editor.setVariables([
  {
    name: 'newName',
    detail: 'new variable inline info',
    info: 'new pop-out info'
  }
]);

Content attributes

You can provide attributes which will be set on the content editable div:

const editor = new FeelEditor({
  container,
  contentAttributes: {
    'aria-label': 'Expression editor'
  }
});

Hacking the Project

To get the development setup make sure to have NodeJS installed. As soon as you are set up, clone the project and execute

npm install
npm start

License

MIT

changelog (log de mudanças)

Changelog

All notable changes to @bpmn-io/feel-editor are documented here. We use semantic versioning for releases.

Unreleased

_Note: Yet to be released changes appear here._

1.10.1

  • FIX: correct completion of lang-feel snippets (#70)

1.10.0

  • FEAT: update camunda built-is (#65)
  • FEAT: support configuration of parserDialect (#68, nikku/lezer-feel#37)
  • FEAT: support backtick identifies in camunda mode (#68)
  • DEPS: update to @bpmn-io/feel-lint@1.4.0
  • DEPS: update to lang-feel@2.3.0
  • DEPS: update to lezer-feel@1.7.0
  • DEPS: update codemirror*
  • DEPS: update to lezer*

1.9.1

  • FIX: correct completion of parameterless built-ins (#63)

1.9.0

  • FEAT: offer Camunda 8.6 built-ins for completion (#62)

1.8.0

  • FEAT: make editor use full container height (#61)

1.7.0

1.6.1

  • FIX: ensure editor can be used without unsafe-eval (#59)

1.6.0

  • FEAT: allow to provide custom built-ins (293d1ae)
  • FEAT: allow to configure dialect (c0aaf53)
  • FEAT: attach aria-language to editor
  • FIX: recognize built-ins and global variables with spaces
  • FIX: do not complete snippets in PathExpression
  • FIX: correct completion inside positional arguments
  • CHORE: update built-ins (8bc2194)
  • DEPS: update @codemirror/*
  • DEPS: update to lezer-feel@1.2.9
  • DEPS: update to lang-feel@2.1.1

1.5.0

  • FEAT: support placeholder configuration (#52)

1.4.0

  • FEAT: allow to provide functions with snippet autocompletion as variables (#50)

1.3.0

  • FEAT: allow to pass content attributes

1.2.0

  • FEAT: make error messages contextual
  • DEPS: update to feel-lint@1.2.0
  • DEPS: update codemirror dependencies

1.1.0

  • FEAT: add contextual keyword completion
  • FIX: correct parsing of nested lists
  • FIX: correct parsing of incomplete QuantifiedExpression
  • FIX: only allow legal Name start characters
  • DEPS: update to feel-lint@1.1.0
  • DEPS: update to lang-feel@2.0.0
  • DEPS: update to lezer-feel@1.2.4
  • DEPS: update codemirror dependencies

1.0.1

  • FIX: fix keyboard navigation for builtin functions (#46)

1.0.0

  • FEAT: update list of builtin functions (#45)

0.9.1

  • DEPS: update to feel-lint@1.0.0

0.9.0

  • FEAT: allow extensions to be passed to the editor (#41)

0.8.1

  • FIX: correctly flag dev dependencies

0.8.0

  • DEPS: update to lang-feel@1.0.0
  • DEPS: update to feel-lint@0.2.0

Breaking Changes

  • We now support single expressions per input only, not a list of expressions. This more closely aligns with the DMN FEEL spec.

0.7.1

  • FIX: keep line breaks and hide overflow in info box (#37)

0.7.0

  • FEAT: support nested variables (#34)
  • DEPS: use @bpmn-io/feel-lint for syntax validation (#35)

0.6.0

  • FEAT: allow to set variables dynamically (#33)
  • FEAT: allow to configure tooltip container (#32)
  • DEPS: update dependencies (lang-feel, codemirror)

0.5.0

  • FEAT: scroll into view when focused (#30)
  • CHORE: update documentation for built-in functions (#27)

0.4.1

Re-release of 0.4.1 with external dependencies removed from bundle.

0.4.0

  • FEAT: support automatic indentation (#13)
  • FEAT: suggest built-in functions (#11)
  • FEAT: suggest built-in snippets (#14)
  • DEPS: update to lezer-feel@0.13.1 (9333aa8)

0.3.0

  • FEAT: add onLint callback (#10)
  • FEAT: set caret position in editor.focus (#15)

0.2.0

  • FEAT: add variable suggestion (#9)

0.1.0

  • FEAT: initial release, create a FEEL editor with Code highlighting (#4)
  • FEAT: highlight syntax errors (#7)