1.6.5 • Published 4 years ago

ace-custom-element v1.6.5

Weekly downloads
749
License
Apache-2.0
Repository
github
Last release
4 years ago

Ace Custom Element

npm version Published on webcomponents.org

This is a custom element wrapper for the Ace code editor.

The primary reason for this package over other similar packages is to make it easier to use with by including a single script resource so that it can be accessed using services like unpkg.com.

Usage

CDN

Using a CDN like unpkg.com:

<!-- pin to a specific version if required -->
<script type="module" src="https://unpkg.com/ace-custom-element@latest/dist/index.min.js"></script>

<ace-editor theme="ace/theme/monokai" value="console.log('hello world');"></ace-editor>

Try it out on JSFiddle.

Locally

Using a local file:

npm install ace-custom-element
<script type="module" src="./node_modules/ace-custom-element/dist/index.min.js"></script>

<ace-editor theme="ace/theme/monokai" value="console.log('hello world');"></ace-editor>

Supported properties

PropertyAttributeTypeDefault valueDescription
editor-Ace.Editor-A reference to the ace editor.
valuevaluestring""Editor text value.
modemodestringace/mode/javascriptEditor mode.
themethemestringace/theme/eclipseEditor theme.
tabSizetab-sizenumber2Editor tab size.
readonlyreadonlybooleanfalsePlaces editor in readonly mode.
softTabssoft-tabsbooleanfalseSets editor to use soft tabs.
wrapwrapbooleanfalseSets editor to wrap text.
wrapwrapbooleanfalseSets editor to wrap text.
valueUpdateModevalue-update-mode"start", "end", or "select""select"Specifies the selection behavior after the value has been updated.
hideGutterhide-gutterbooleanfalseHides the editor gutter.
hideGutterLineHighlighthide-gutter-line-highlightbooleanfalseHides gutter highlight for the current line.
hidePrintMarginhide-print-marginbooleanfalseHides the print margin (vertical ruler).
basePathbase-pathstringace/ folder relative to module import path.Specifies the location to load additional ACE resources.

Supported events

EventDescription
changeTriggered when the editor's value changes (will trigger for each keystroke).
readyTriggered after the ace editor has been initialized.
blurTriggered when the editor loses focus.
1.6.5

4 years ago

1.6.4

4 years ago

1.6.3

4 years ago

1.6.2

4 years ago

1.6.1

4 years ago

1.6.0

4 years ago

1.5.0

4 years ago

1.4.0

4 years ago

1.3.4

4 years ago

1.3.2

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.0.2

4 years ago

1.1.0

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago