@nsis/dent-ui 0.2.0 → 0.2.2

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.
@@ -1,10 +1,10 @@
1
1
  $ vite build
2
- 8:42:00 PM [vite-plugin-svelte] no Svelte config found at /home/runner/work/nsis-javascript-tools/nsis-javascript-tools/packages/dent-ui - using default configuration.
2
+ 10:30:39 PM [vite-plugin-svelte] no Svelte config found at /home/runner/work/nsis-javascript-tools/nsis-javascript-tools/packages/dent-ui - using default configuration.
3
3
  vite v8.1.3 building client environment for production...
4
4
  
5
5
  rendering chunks...
6
6
  computing gzip size...
7
7
  dist/index.html 0.30 kB │ gzip: 0.22 kB
8
- dist/assets/index-COUmeiB0.js 404.01 kB │ gzip: 132.90 kB
8
+ dist/assets/index-D2jIzksy.js 404.99 kB │ gzip: 133.27 kB
9
9
 
10
- ✓ built in 218ms
10
+ ✓ built in 321ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @nsis/dent-ui
2
2
 
3
+ ## 0.2.2
4
+
5
+ ### Patch Changes
6
+
7
+ - a3fc38e: fix intendation of block keywords
8
+ - Updated dependencies [a3fc38e]
9
+ - @nsis/codemirror@0.14.1
10
+
11
+ ## 0.2.1
12
+
13
+ ### Patch Changes
14
+
15
+ - 952f39c: fix: expose `strict` prop on exported component
16
+
3
17
  ## 0.2.0
4
18
 
5
19
  ### Minor Changes
package/README.md CHANGED
@@ -12,27 +12,14 @@
12
12
 
13
13
  ```svelte
14
14
  <script>
15
- import Editor from '@nsis/dent-ui/Editor.svelte';
15
+ import DentUI from '@nsis/dent-ui/DentUI.svelte';
16
16
  </script>
17
17
 
18
- <Editor
19
- dark={true}
20
- label="NSIS editor"
21
- oncreate={(view) => view.focus()}
22
- />
18
+ <DentUI strict={true} />
23
19
  ```
24
20
 
25
- ### Props
26
-
27
- | Prop | Type | Default | Description |
28
- | ------------ | --------------------------- | ------- | -------------------------------------- |
29
- | `dark` | `boolean` | `true` | Use dark theme |
30
- | `extensions` | `Extension[]` | `[]` | Additional CodeMirror extensions |
31
- | `label` | `string` | `''` | Accessible label for the editor |
32
- | `strict` | `boolean` | `false` | Case-sensitive NSIS keyword matching |
33
- | `oncreate` | `(view: EditorView) => void`| — | Callback when the editor view is ready |
34
-
35
- By default, NSIS keywords are matched case-insensitively (e.g. `messagebox` and `MessageBox` are both highlighted). Set `strict` to `true` to require canonical casing.
21
+ > [!NOTE]
22
+ > By default, NSIS keywords are matched case-insensitively (e.g. `messagebox` and `MessageBox` are both highlighted). Set `strict` to `true` to require canonical casing.
36
23
 
37
24
  ## License
38
25
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nsis/dent-ui",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Web UI for the Dent NSIS code formatter",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -28,7 +28,7 @@
28
28
  "@codemirror/view": "^6.43.5",
29
29
  "@lezer/highlight": "^1.2.3",
30
30
  "svelte": "^5.56.4",
31
- "@nsis/codemirror": "0.14.0",
31
+ "@nsis/codemirror": "0.14.1",
32
32
  "@nsis/dent": "0.13.0"
33
33
  },
34
34
  "devDependencies": {
package/src/App.svelte CHANGED
@@ -1,11 +1,14 @@
1
1
  <script lang="ts">
2
2
  import { defaultKeymap, history, historyKeymap } from '@codemirror/commands';
3
+ import { indentOnInput } from '@codemirror/language';
3
4
  import { EditorState } from '@codemirror/state';
4
5
  import { EditorView, keymap } from '@codemirror/view';
5
6
  import { createFormatter } from '@nsis/dent';
6
7
  import { onDestroy, onMount } from 'svelte';
7
8
  import Editor from './Editor.svelte';
8
9
 
10
+ let { strict = false }: { strict?: boolean } = $props();
11
+
9
12
  let dark = $state(document.documentElement.dataset.theme !== 'light');
10
13
  let themePreference = $state(localStorage.getItem('theme') || 'system');
11
14
 
@@ -122,6 +125,7 @@ function clear() {
122
125
  const inputExtensions = [
123
126
  history(),
124
127
  keymap.of([...defaultKeymap, ...historyKeymap]),
128
+ indentOnInput(),
125
129
  EditorView.lineWrapping,
126
130
  EditorView.updateListener.of((update) => {
127
131
  if (update.docChanged) scheduleAutoFormat();
@@ -199,15 +203,20 @@ const outputExtensions = [EditorState.readOnly.of(true), EditorView.editable.of(
199
203
  <div class="pane-header">Input</div>
200
204
  <Editor
201
205
  {dark}
206
+ {strict}
202
207
  extensions={inputExtensions}
203
208
  label="NSIS input editor"
204
- oncreate={(v) => { inputView = v; v.focus(); }}
209
+ oncreate={(v) => {
210
+ inputView = v;
211
+ v.focus();
212
+ }}
205
213
  />
206
214
  </div>
207
215
  <div class="editor-pane">
208
216
  <div class="pane-header">Output</div>
209
217
  <Editor
210
218
  {dark}
219
+ {strict}
211
220
  extensions={outputExtensions}
212
221
  label="Formatted output editor"
213
222
  oncreate={(v) => (outputView = v)}