@mpeggroup/mpeg-sdl-editor 1.4.2 → 1.4.3

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,14 +1,8 @@
1
- import {
2
- CompletionContext,
3
- type CompletionResult,
4
- } from "@codemirror/autocomplete";
1
+ import { CompletionContext, type CompletionResult } from "@codemirror/autocomplete";
5
2
  import type { SyntaxNode } from "@lezer/common";
6
3
  import { syntaxTree } from "@codemirror/language";
7
4
  import { foldNodeProp } from "@codemirror/language";
8
- import {
9
- getPotentialSyntacticTokens,
10
- TokenTypeId,
11
- } from "@mpeggroup/mpeg-sdl-parser";
5
+ import { getPotentialSyntacticTokens, TokenTypeId } from "@mpeggroup/mpeg-sdl-parser";
12
6
 
13
7
  function isCommentCompletion(lastNode: SyntaxNode): boolean {
14
8
  return lastNode.type.id === TokenTypeId.Comment;
@@ -37,10 +31,7 @@ function isBlockScopeCompletion(lastNode: SyntaxNode): boolean {
37
31
  return parentNode.type.prop(foldNodeProp) !== undefined;
38
32
  }
39
33
 
40
- function getCompletionResult(
41
- completionOptions: string[],
42
- from: number,
43
- ): CompletionResult {
34
+ function getCompletionResult(completionOptions: string[], from: number): CompletionResult {
44
35
  return {
45
36
  from,
46
37
  options: completionOptions.map((label) => ({ label })),
@@ -73,11 +64,8 @@ function sdlComplete(context: CompletionContext): CompletionResult | null {
73
64
 
74
65
  const completions = getPotentialSyntacticTokens(lastNode.cursor());
75
66
 
76
- if (completions && (completions.length > 0)) {
77
- return getCompletionResult(
78
- completions,
79
- lastTag ? lastNode.from + lastTag.index : context.pos,
80
- );
67
+ if (completions && completions.length > 0) {
68
+ return getCompletionResult(completions, lastTag ? lastNode.from + lastTag.index : context.pos);
81
69
  }
82
70
 
83
71
  return null;
@@ -1,10 +1,5 @@
1
1
  import { syntaxTree } from "@codemirror/language";
2
- import {
3
- type Diagnostic,
4
- forEachDiagnostic,
5
- linter,
6
- setDiagnostics,
7
- } from "@codemirror/lint";
2
+ import { type Diagnostic, forEachDiagnostic, linter, setDiagnostics } from "@codemirror/lint";
8
3
  import { type Extension } from "@codemirror/state";
9
4
  import { EditorView, ViewPlugin, type ViewUpdate } from "@codemirror/view";
10
5
  import {
@@ -1,13 +1,9 @@
1
1
  const tailwindConfig: import("tailwindcss").Config & { daisyui?: any } = {
2
- content: [
3
- "./src/**/*.{html,js,jsx,ts,tsx}",
4
- ],
2
+ content: ["./src/**/*.{html,js,jsx,ts,tsx}"],
5
3
  theme: {
6
4
  extend: {},
7
5
  },
8
- plugins: [
9
- require("daisyui"),
10
- ],
6
+ plugins: [require("daisyui")],
11
7
  daisyui: {
12
8
  themes: ["light", "dark"],
13
9
  },
@@ -21,9 +21,7 @@ describe("Editor component", () => {
21
21
  const textboxes = getAllByRole("textbox");
22
22
 
23
23
  // Check that at least one textbox contains the expected content
24
- const found = textboxes.some(
25
- (el) => el.textContent && el.textContent.includes("int a;"),
26
- );
24
+ const found = textboxes.some((el) => el.textContent && el.textContent.includes("int a;"));
27
25
  expect(found).toBe(true);
28
26
  });
29
27
  });
package/tsconfig.json CHANGED
@@ -22,6 +22,10 @@
22
22
  // Some stricter flags (disabled by default)
23
23
  "noUnusedLocals": false,
24
24
  "noUnusedParameters": false,
25
- "noPropertyAccessFromIndexSignature": false
26
- }
25
+ "noPropertyAccessFromIndexSignature": false,
26
+
27
+ // Type definitions
28
+ "types": ["bun", "node"]
29
+ },
30
+ "exclude": ["dist"]
27
31
  }