@aquera/nile-elements 0.0.33 → 0.0.34
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/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/nile-code-editor.js +2 -2
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-code-editor/nile-code-editor.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.d.ts +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.js +5 -3
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/index.iife.js +12 -12
- package/dist/nile-code-editor/nile-code-editor.cjs.js +2 -2
- package/dist/nile-code-editor/nile-code-editor.cjs.js.map +1 -1
- package/dist/nile-code-editor/nile-code-editor.esm.js +2 -2
- package/dist/nile-switcher/nile-switcher.cjs.js +1 -1
- package/dist/nile-switcher/nile-switcher.cjs.js.map +1 -1
- package/dist/nile-switcher/nile-switcher.esm.js +3 -3
- package/dist/src/nile-code-editor/nile-code-editor.js +2 -2
- package/dist/src/nile-code-editor/nile-code-editor.js.map +1 -1
- package/dist/src/nile-switcher/nile-switcher.d.ts +1 -0
- package/dist/src/nile-switcher/nile-switcher.js +5 -3
- package/dist/src/nile-switcher/nile-switcher.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -2
- package/src/nile-code-editor/nile-code-editor.ts +8 -3
- package/src/nile-switcher/nile-switcher.ts +6 -4
package/package.json
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
"description": "Webcomponent nile-elements following open-wc recommendations",
|
4
4
|
"license": "MIT",
|
5
5
|
"author": "nile-elements",
|
6
|
-
"version": "0.0.
|
6
|
+
"version": "0.0.34",
|
7
7
|
"main": "dist/src/index.js",
|
8
8
|
"type": "module",
|
9
9
|
"module": "dist/src/index.js",
|
@@ -34,7 +34,9 @@
|
|
34
34
|
"element-internals-polyfill": "^1.1.20",
|
35
35
|
"lit": "^2.0.2",
|
36
36
|
"@floating-ui/dom": "^1.2.1",
|
37
|
-
"composed-offset-position": "^0.0.4"
|
37
|
+
"composed-offset-position": "^0.0.4",
|
38
|
+
"@codemirror/lang-javascript": "6.2.1",
|
39
|
+
"codemirror": "6.0.1"
|
38
40
|
},
|
39
41
|
"devDependencies": {
|
40
42
|
"@custom-elements-manifest/analyzer": "^0.4.17",
|
@@ -17,9 +17,14 @@ import { styles } from './nile-code-editor.css';
|
|
17
17
|
import { EditorView } from 'codemirror';
|
18
18
|
import { ViewUpdate } from '@codemirror/view';
|
19
19
|
import { EditorState, Compartment } from '@codemirror/state';
|
20
|
-
import {
|
20
|
+
import {
|
21
|
+
javascript,
|
22
|
+
javascriptLanguage,
|
23
|
+
scopeCompletionSource,
|
24
|
+
completionPath,
|
25
|
+
} from '@codemirror/lang-javascript';
|
21
26
|
import { autocompletion } from '@codemirror/autocomplete';
|
22
|
-
import { CompletionContext } from '@codemirror/autocomplete';
|
27
|
+
import { CompletionContext, Completion } from '@codemirror/autocomplete';
|
23
28
|
import NileElement from '../internal/nile-element';
|
24
29
|
import { basicSetup } from './extensionSetup';
|
25
30
|
|
@@ -61,7 +66,7 @@ export class NileCodeEditor extends NileElement {
|
|
61
66
|
|
62
67
|
updated() {
|
63
68
|
const customAutoCompletions = javascriptLanguage.data.of({
|
64
|
-
autocomplete: this.customOptions,
|
69
|
+
autocomplete: scopeCompletionSource(this.customOptions),
|
65
70
|
});
|
66
71
|
let startState = EditorState.create({
|
67
72
|
doc: !this.multiline ? this.convertToSingleLine(this.value) : this.value,
|
@@ -59,6 +59,7 @@ export interface switchInputType {
|
|
59
59
|
error?: boolean;
|
60
60
|
errorMessage?: string;
|
61
61
|
options?: Array<any>;
|
62
|
+
customAutoCompletions?: any;
|
62
63
|
helperText?: string;
|
63
64
|
multiple?: boolean;
|
64
65
|
noborder?: boolean;
|
@@ -101,14 +102,12 @@ export class NileSwitcher extends NileElement {
|
|
101
102
|
static styles: CSSResultGroup = styles;
|
102
103
|
|
103
104
|
@property({ type: Object }) nileSwitchConfig: switchconfig;
|
104
|
-
|
105
105
|
@property({ type: Number }) current: Number = 0;
|
106
106
|
|
107
107
|
@property({ type: Object }) currentInput: switchInputType;
|
108
108
|
|
109
109
|
connectedCallback() {
|
110
110
|
super.connectedCallback();
|
111
|
-
this.setCurrentInput();
|
112
111
|
this.emit('nile-init');
|
113
112
|
}
|
114
113
|
|
@@ -300,7 +299,7 @@ export class NileSwitcher extends NileElement {
|
|
300
299
|
const {
|
301
300
|
value,
|
302
301
|
multiLine,
|
303
|
-
|
302
|
+
customAutoCompletions,
|
304
303
|
disabled,
|
305
304
|
readonly,
|
306
305
|
errorMessage,
|
@@ -319,7 +318,7 @@ export class NileSwitcher extends NileElement {
|
|
319
318
|
this.handleChange(e, INPUT_TYPE_NAMES.CODE_EDITOR)}"
|
320
319
|
.multiline="${multiLine}"
|
321
320
|
.value="${value}"
|
322
|
-
.customOptions="${
|
321
|
+
.customOptions="${customAutoCompletions}"
|
323
322
|
.showLineNumbers="false"
|
324
323
|
></nile-code-editor> `;
|
325
324
|
}
|
@@ -390,6 +389,9 @@ export class NileSwitcher extends NileElement {
|
|
390
389
|
}
|
391
390
|
|
392
391
|
singleFieldSwitcher() {
|
392
|
+
if (!this.currentInput) {
|
393
|
+
this.setCurrentInput();
|
394
|
+
}
|
393
395
|
return html`
|
394
396
|
${choose(
|
395
397
|
this.currentInput.inputType,
|