@aquera/nile-elements 1.6.4 → 1.6.6

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.
Files changed (40) hide show
  1. package/README.md +11 -0
  2. package/demo/index.js +2 -0
  3. package/dist/index.js +208 -203
  4. package/dist/nile-code-editor/nile-code-editor.cjs.js +2 -2
  5. package/dist/nile-code-editor/nile-code-editor.cjs.js.map +1 -1
  6. package/dist/nile-code-editor/nile-code-editor.esm.js +2 -2
  7. package/dist/nile-code-editor/theme.cjs.js +1 -1
  8. package/dist/nile-code-editor/theme.cjs.js.map +1 -1
  9. package/dist/nile-code-editor/theme.esm.js +1 -1
  10. package/dist/nile-inline-edit/nile-inline-edit.css.cjs.js +1 -1
  11. package/dist/nile-inline-edit/nile-inline-edit.css.cjs.js.map +1 -1
  12. package/dist/nile-inline-edit/nile-inline-edit.css.esm.js +1 -0
  13. package/dist/nile-slide-toggle/nile-slide-toggle.css.cjs.js +1 -1
  14. package/dist/nile-slide-toggle/nile-slide-toggle.css.cjs.js.map +1 -1
  15. package/dist/nile-slide-toggle/nile-slide-toggle.css.esm.js +8 -4
  16. package/dist/nile-tag/nile-tag.css.cjs.js +1 -1
  17. package/dist/nile-tag/nile-tag.css.cjs.js.map +1 -1
  18. package/dist/nile-tag/nile-tag.css.esm.js +13 -13
  19. package/dist/src/nile-code-editor/nile-code-editor.d.ts +2 -1
  20. package/dist/src/nile-code-editor/nile-code-editor.js +19 -2
  21. package/dist/src/nile-code-editor/nile-code-editor.js.map +1 -1
  22. package/dist/src/nile-code-editor/theme.d.ts +5 -0
  23. package/dist/src/nile-code-editor/theme.js +5 -0
  24. package/dist/src/nile-code-editor/theme.js.map +1 -1
  25. package/dist/src/nile-inline-edit/nile-inline-edit.css.js +1 -0
  26. package/dist/src/nile-inline-edit/nile-inline-edit.css.js.map +1 -1
  27. package/dist/src/nile-slide-toggle/nile-slide-toggle.css.js +6 -2
  28. package/dist/src/nile-slide-toggle/nile-slide-toggle.css.js.map +1 -1
  29. package/dist/src/nile-tag/nile-tag.css.js +13 -13
  30. package/dist/src/nile-tag/nile-tag.css.js.map +1 -1
  31. package/dist/src/version.js +1 -1
  32. package/dist/src/version.js.map +1 -1
  33. package/dist/tsconfig.tsbuildinfo +1 -1
  34. package/package.json +1 -1
  35. package/src/nile-code-editor/nile-code-editor.ts +19 -2
  36. package/src/nile-code-editor/theme.ts +6 -0
  37. package/src/nile-inline-edit/nile-inline-edit.css.ts +1 -0
  38. package/src/nile-slide-toggle/nile-slide-toggle.css.ts +6 -2
  39. package/src/nile-tag/nile-tag.css.ts +13 -13
  40. package/vscode-html-custom-data.json +6 -1
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": "1.6.4",
6
+ "version": "1.6.6",
7
7
  "main": "dist/src/index.js",
8
8
  "type": "module",
9
9
  "module": "dist/src/index.js",
@@ -39,7 +39,7 @@ import { autocompletion,acceptCompletion, closeCompletion,CompletionContext,Comp
39
39
  import NileElement from '../internal/nile-element';
40
40
  import { basicSetup } from './extensionSetup';
41
41
  import { classMap } from 'lit/directives/class-map.js';
42
- import { Theme as DefaultTheme, customisedThemeCss, fontFamily } from './theme';
42
+ import { Theme as DefaultTheme, customisedThemeCss, fontFamily, readOnlyTheme } from './theme';
43
43
  import { keymap } from '@codemirror/view';
44
44
 
45
45
  // Choose the appropriate mode for your use case
@@ -109,6 +109,8 @@ export class NileCodeEditor extends NileElement {
109
109
 
110
110
  @property({ type: Object, attribute: false }) autoCompleteStyle: { width?: string; multiline?: boolean } | undefined = undefined;
111
111
 
112
+ @property({ type: Boolean, reflect: true, attribute: true }) hideReadOnlyCursor: boolean = false;
113
+
112
114
  public view: EditorView;
113
115
  public viewState:EditorState;
114
116
  private timeOut: any = null;
@@ -586,7 +588,22 @@ export class NileCodeEditor extends NileElement {
586
588
  }
587
589
 
588
590
  getReadOnlyExtension() {
589
- return (this.readonly || this.disabled) ? EditorState.readOnly.of(true) : [];
591
+ if (this.disabled) {
592
+ return [
593
+ EditorState.readOnly.of(true),
594
+ EditorView.editable.of(false),
595
+ ];
596
+ }
597
+
598
+ if (this.readonly) {
599
+ const extensions = [EditorState.readOnly.of(true)];
600
+ if (this.hideReadOnlyCursor) {
601
+ extensions.push(EditorView.theme(readOnlyTheme));
602
+ }
603
+ return extensions;
604
+ }
605
+
606
+ return [];
590
607
  }
591
608
 
592
609
  getSingleLineExtension() {
@@ -164,3 +164,9 @@ export const customisedThemeCss = {
164
164
  marginLeft: '18px',
165
165
  }
166
166
  };
167
+
168
+ export const readOnlyTheme = {
169
+ '.cm-cursor': {
170
+ display: 'none !important'
171
+ },
172
+ };
@@ -64,6 +64,7 @@ export const styles = css`
64
64
  background-color: var(--nile-colors-dark-200, var(--ng-colors-bg-disabled-subtle));
65
65
  color: var(--nile-colors-dark-500, var(--ng-colors-text-disabled));
66
66
  cursor: not-allowed;
67
+ user-select: none;
67
68
  }
68
69
 
69
70
  `;
@@ -94,7 +94,7 @@ export default css`
94
94
 
95
95
  .nile-slide-toggle__slider:hover {
96
96
  &:not(.nile-slide--disabled) {
97
- background-color: var(--nile-slide-toggle-color-background-inactive, var(--ng-colors-bg-quaternary-alt));
97
+ background-color: var(--nile-colors-neutral-700, var(--ng-colors-bg-quaternary-alt));
98
98
  }
99
99
  }
100
100
 
@@ -115,6 +115,10 @@ export default css`
115
115
  background-color: var(--nile-slide-toggle-color-background-active, var(--ng-colors-bg-brand-solid));
116
116
  }
117
117
 
118
+ .nile-slide-toggle__switch:hover input:checked + .nile-slide-toggle__slider {
119
+ background-color: var(--nile-colors-primary-700, var(--ng-colors-bg-brand-solid-hover));
120
+ }
121
+
118
122
  .nile-slide-toggle__switch input:focus + .nile-slide-toggle__slider {
119
123
  --focus-shadow-glow: 0 0 1px var(--nile-slide-toggle-color-background-active);
120
124
  --focus-shadow-ring: 0px 0px 0px 2px var(--ng-colors-bg-primary-alt), 0px 0px 0px 4px var(--ng-colors-effects-focus-ring);
@@ -134,7 +138,7 @@ export default css`
134
138
  }
135
139
 
136
140
  .nile-slide--disabled .nile-slide-toggle__slider {
137
- background-color: var(--nile-colors-dark-200, var(--ng-colors-bg-disabled));
141
+ background-color: var(--nile-colors-neutral-400, var(--ng-colors-bg-disabled));
138
142
  }
139
143
 
140
144
  .nile-slide--disabled .nile-slide-toggle__switch {
@@ -61,13 +61,13 @@ export const styles = css`
61
61
  }
62
62
 
63
63
  .tag--success {
64
- background: var(--nile-colors-green-400);
65
- border: 2px solid var(--nile-colors-green-400, var(--ng-colors-border-primary));
66
- color: var(--nile-colors-dark-900);
64
+ background: var(--nile-colors-green-400,var(--ng-componentcolors-utility-success-50));
65
+ border: 2px solid var(--nile-colors-green-400, var(--ng-componentcolors-utility-success-200));
66
+ color: var(--nile-colors-dark-900,var(--ng--componentcolors-utility-success-700));
67
67
  }
68
68
 
69
69
  .tag--success:hover {
70
- border: 2px solid var(--nile-colors-green-500, var(--ng-colors-border-primary));
70
+ border: 2px solid var(--nile-colors-green-500, var(--ng-componentcolors-utility-success-300));
71
71
  }
72
72
 
73
73
  .tag--success:active > nile-icon-button {
@@ -79,7 +79,7 @@ export const styles = css`
79
79
  border: var(--nile-border-size-2, var(--ng-border-width-1)) solid var(--nile-colors-neutral-400 , var(--ng-colors-border-primary));
80
80
  color: var(--nile-colors-dark-900 , var(--ng-colors-text-secondary-700));
81
81
  }
82
-
82
+
83
83
  .tag--normal:hover {
84
84
  border: var(--nile-border-size-2, var(--ng-border-width-1)) solid var(--nile-colors-neutral-500 , var(--ng-colors-border-primary));
85
85
  }
@@ -89,13 +89,13 @@ export const styles = css`
89
89
  }
90
90
 
91
91
  .tag--warning {
92
- background: var(--nile-colors-yellow-400);
93
- border: 2px solid var(--nile-colors-yellow-400, var(--ng-colors-border-primary));
94
- color: var(--nile-colors-dark-900);
92
+ background: var(--nile-colors-yellow-400, var(--ng-componentcolors-utility-warning-50));
93
+ border: 2px solid var(--nile-colors-yellow-400, var(--ng-componentcolors-utility-warning-200));
94
+ color: var(--nile-colors-dark-900, var(--ng-componentcolors-utility-warning-700));
95
95
  }
96
96
 
97
97
  .tag--warning:hover {
98
- border: 2px solid var(--nile-colors-yellow-500, var(--ng-colors-border-primary));
98
+ border: 2px solid var(--nile-colors-yellow-500, var(--ng-componentcolors-utility-warning-300));
99
99
  }
100
100
 
101
101
  .tag--warning:active > nile-icon-button {
@@ -104,13 +104,13 @@ export const styles = css`
104
104
 
105
105
 
106
106
  .tag--error {
107
- background: var(--nile-colors-red-400);
108
- border: 2px solid var(--nile-colors-red-400, var(--ng-colors-border-primary));
109
- color: var(--nile-colors-dark-900);
107
+ background: var(--nile-colors-red-400, var(--ng-componentcolors-utility-error-50));
108
+ border: 2px solid var(--nile-colors-red-400, var(--ng-componentcolors-utility-error-200));
109
+ color: var(--nile-colors-dark-900, var(--ng-componentcolors-utility-error-700));
110
110
  }
111
111
 
112
112
  .tag--error:hover {
113
- border: 2px solid var(--nile-colors-red-500, var(--ng-colors-border-primary));
113
+ border: 2px solid var(--nile-colors-red-500, var(--ng-componentcolors-utility-error-300));
114
114
  }
115
115
 
116
116
  .tag--error:active > nile-icon-button {
@@ -1081,7 +1081,7 @@
1081
1081
  },
1082
1082
  {
1083
1083
  "name": "nile-code-editor",
1084
- "description": "Nile icon component.\n\nEvents:\n\n * `nile-focus` {`Event`} - \n\n * `nile-blur` {`Event`} - \n\nAttributes:\n\n * `value` {`string`} - \n\n * `expandIcon` {`string`} - \n\n * `placeholder` {`string`} - \n\n * `customAutoCompletions` - \n\n * `customCompletionsPaths` {`string[]`} - \n\n * `language` {`\"html\" | \"javascript\" | \"sql\" | \"json\"`} - \n\n * `error-message` {`string`} - \n\n * `error` {`boolean`} - \n\n * `enableSearch` {`boolean`} - \n\n * `noborder` {`boolean`} - \n\n * `multiline` {`boolean`} - \n\n * `enableFoldGutters` {`boolean`} - \n\n * `allowVariableInCustomSuggestion` {`boolean`} - \n\n * `lineNumbers` {`boolean`} - \n\n * `lineNumbersMultiline` {`boolean`} - \n\n * `hasScroller` {`boolean`} - \n\n * `expandable` {`boolean`} - \n\n * `readonly` {`boolean`} - \n\n * `disabled` {`boolean`} - \n\n * `debounce` {`boolean`} - \n\n * `debounceTimeout` {`number`} - \n\n * `aboveCursor` {`boolean`} - \n\n * `tabCompletion` {`boolean`} - \n\n * `defaultFont` {`boolean`} - \n\nProperties:\n\n * `codeEditor` {`HTMLInputElement`} - \n\n * `value` {`string`} - \n\n * `expandIcon` {`string`} - \n\n * `placeholder` {`string`} - \n\n * `customAutoCompletions` - \n\n * `customCompletionsPaths` {`string[]`} - \n\n * `language` {`\"html\" | \"javascript\" | \"sql\" | \"json\"`} - \n\n * `errorMessage` {`string`} - \n\n * `error` {`boolean`} - \n\n * `enableSearch` {`boolean`} - \n\n * `noborder` {`boolean`} - \n\n * `multiline` {`boolean`} - \n\n * `enableFoldGutters` {`boolean`} - \n\n * `allowVariableInCustomSuggestion` {`boolean`} - \n\n * `lineNumbers` {`boolean`} - \n\n * `disableSyntaxHighlighting` {`boolean`} - \n\n * `customThemeCSS` {`object | null`} - \n\n * `lineNumbersMultiline` {`boolean`} - \n\n * `hasScroller` {`boolean`} - \n\n * `expandable` {`boolean`} - \n\n * `readonly` {`boolean`} - \n\n * `disabled` {`boolean`} - \n\n * `debounce` {`boolean`} - \n\n * `debounceTimeout` {`number`} - \n\n * `aboveCursor` {`boolean`} - \n\n * `tabCompletion` {`boolean`} - \n\n * `defaultFont` {`boolean`} - \n\n * `autoCompleteStyle` {`{ width?: string | undefined; multiline?: boolean | undefined; } | undefined`} - \n\n * `view` - \n\n * `viewState` - \n\n * `timeOut` - \n\n * `resizeObserver` - \n\n * `lineNumbersComp` - \n\n * `restrictSingleLineComp` - \n\n * `readOnlyComp` - \n\n * `customCompletionComp` - \n\n * `placeholderComp` - \n\n * `defaultSyntaxHighlightingComp` - \n\n * `themeComp` - \n\n * `autoCompletionComp` - \n\n * `autoCompleteStyleComp` - \n\n * `isSpacePressed` {`boolean`} - \n\n * `customAutocomplete` - Custom autocomplete handler for code editor suggestions\n\n * `insertBetweenCode` - \n\n * `BUBBLES` {`boolean`} - \n\n * `COMPOSED` {`boolean`} - \n\n * `CANCELABLE` {`boolean`} - ",
1084
+ "description": "Nile icon component.\n\nEvents:\n\n * `nile-focus` {`Event`} - \n\n * `nile-blur` {`Event`} - \n\nAttributes:\n\n * `value` {`string`} - \n\n * `expandIcon` {`string`} - \n\n * `placeholder` {`string`} - \n\n * `customAutoCompletions` - \n\n * `customCompletionsPaths` {`string[]`} - \n\n * `language` {`\"html\" | \"javascript\" | \"sql\" | \"json\"`} - \n\n * `error-message` {`string`} - \n\n * `error` {`boolean`} - \n\n * `enableSearch` {`boolean`} - \n\n * `noborder` {`boolean`} - \n\n * `multiline` {`boolean`} - \n\n * `enableFoldGutters` {`boolean`} - \n\n * `allowVariableInCustomSuggestion` {`boolean`} - \n\n * `lineNumbers` {`boolean`} - \n\n * `lineNumbersMultiline` {`boolean`} - \n\n * `hasScroller` {`boolean`} - \n\n * `expandable` {`boolean`} - \n\n * `readonly` {`boolean`} - \n\n * `disabled` {`boolean`} - \n\n * `debounce` {`boolean`} - \n\n * `debounceTimeout` {`number`} - \n\n * `aboveCursor` {`boolean`} - \n\n * `tabCompletion` {`boolean`} - \n\n * `defaultFont` {`boolean`} - \n\n * `hideReadOnlyCursor` {`boolean`} - \n\nProperties:\n\n * `codeEditor` {`HTMLInputElement`} - \n\n * `value` {`string`} - \n\n * `expandIcon` {`string`} - \n\n * `placeholder` {`string`} - \n\n * `customAutoCompletions` - \n\n * `customCompletionsPaths` {`string[]`} - \n\n * `language` {`\"html\" | \"javascript\" | \"sql\" | \"json\"`} - \n\n * `errorMessage` {`string`} - \n\n * `error` {`boolean`} - \n\n * `enableSearch` {`boolean`} - \n\n * `noborder` {`boolean`} - \n\n * `multiline` {`boolean`} - \n\n * `enableFoldGutters` {`boolean`} - \n\n * `allowVariableInCustomSuggestion` {`boolean`} - \n\n * `lineNumbers` {`boolean`} - \n\n * `disableSyntaxHighlighting` {`boolean`} - \n\n * `customThemeCSS` {`object | null`} - \n\n * `lineNumbersMultiline` {`boolean`} - \n\n * `hasScroller` {`boolean`} - \n\n * `expandable` {`boolean`} - \n\n * `readonly` {`boolean`} - \n\n * `disabled` {`boolean`} - \n\n * `debounce` {`boolean`} - \n\n * `debounceTimeout` {`number`} - \n\n * `aboveCursor` {`boolean`} - \n\n * `tabCompletion` {`boolean`} - \n\n * `defaultFont` {`boolean`} - \n\n * `autoCompleteStyle` {`{ width?: string | undefined; multiline?: boolean | undefined; } | undefined`} - \n\n * `hideReadOnlyCursor` {`boolean`} - \n\n * `view` - \n\n * `viewState` - \n\n * `timeOut` - \n\n * `resizeObserver` - \n\n * `lineNumbersComp` - \n\n * `restrictSingleLineComp` - \n\n * `readOnlyComp` - \n\n * `customCompletionComp` - \n\n * `placeholderComp` - \n\n * `defaultSyntaxHighlightingComp` - \n\n * `themeComp` - \n\n * `autoCompletionComp` - \n\n * `autoCompleteStyleComp` - \n\n * `isSpacePressed` {`boolean`} - \n\n * `customAutocomplete` - Custom autocomplete handler for code editor suggestions\n\n * `insertBetweenCode` - \n\n * `BUBBLES` {`boolean`} - \n\n * `COMPOSED` {`boolean`} - \n\n * `CANCELABLE` {`boolean`} - ",
1085
1085
  "attributes": [
1086
1086
  {
1087
1087
  "name": "value",
@@ -1209,6 +1209,11 @@
1209
1209
  "description": "`defaultFont` {`boolean`} - \n\nProperty: defaultFont\n\nDefault: false",
1210
1210
  "valueSet": "v"
1211
1211
  },
1212
+ {
1213
+ "name": "hideReadOnlyCursor",
1214
+ "description": "`hideReadOnlyCursor` {`boolean`} - \n\nProperty: hideReadOnlyCursor\n\nDefault: false",
1215
+ "valueSet": "v"
1216
+ },
1212
1217
  {
1213
1218
  "name": "onnile-focus",
1214
1219
  "description": "`nile-focus` {`Event`} - "