wgsl-edit 0.0.14 → 0.0.16
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/dist/{WgslEdit-CWF7QS5Y.js → WgslEdit-mSpL7CXc.js} +34 -5
- package/dist/WgslEdit.js +1 -1
- package/dist/index.js +1 -1
- package/dist/wgsl-edit.js +3843 -4061
- package/package.json +5 -2
- package/src/WgslEdit.ts +58 -4
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { createWeslLinter, wesl } from "./Language.js";
|
|
2
|
-
import { HighlightStyle, syntaxHighlighting } from "@codemirror/language";
|
|
3
|
-
import { forceLinting } from "@codemirror/lint";
|
|
2
|
+
import { HighlightStyle, bracketMatching, defaultHighlightStyle, foldGutter, foldKeymap, indentOnInput, syntaxHighlighting } from "@codemirror/language";
|
|
3
|
+
import { forceLinting, lintKeymap } from "@codemirror/lint";
|
|
4
4
|
import { fileToModulePath, link } from "wesl";
|
|
5
|
+
import { autocompletion, closeBrackets, closeBracketsKeymap, completionKeymap } from "@codemirror/autocomplete";
|
|
6
|
+
import { defaultKeymap, history, historyKeymap } from "@codemirror/commands";
|
|
7
|
+
import { searchKeymap } from "@codemirror/search";
|
|
5
8
|
import { Compartment, EditorState, Text } from "@codemirror/state";
|
|
9
|
+
import { EditorView, crosshairCursor, drawSelection, dropCursor, gutters, highlightActiveLine, highlightActiveLineGutter, highlightSpecialChars, keymap, lineNumbers, rectangularSelection } from "@codemirror/view";
|
|
6
10
|
import { tags } from "@lezer/highlight";
|
|
7
|
-
import { EditorView, basicSetup } from "codemirror";
|
|
8
11
|
import { fetchPackagesByName } from "wesl-fetch";
|
|
9
12
|
|
|
10
13
|
//#region src/WgslEdit.css?inline
|
|
@@ -384,10 +387,36 @@ var WgslEdit = class extends HTMLElement {
|
|
|
384
387
|
buildExtensions() {
|
|
385
388
|
const baseTheme = EditorView.theme({
|
|
386
389
|
".cm-content": { padding: "0" },
|
|
387
|
-
".cm-line": { padding: "0" }
|
|
390
|
+
".cm-line": { padding: "0" },
|
|
391
|
+
".cm-panels": { position: "relative" }
|
|
388
392
|
});
|
|
389
393
|
return [
|
|
390
|
-
|
|
394
|
+
gutters({ fixed: false }),
|
|
395
|
+
lineNumbers(),
|
|
396
|
+
highlightActiveLineGutter(),
|
|
397
|
+
highlightSpecialChars(),
|
|
398
|
+
history(),
|
|
399
|
+
foldGutter(),
|
|
400
|
+
drawSelection(),
|
|
401
|
+
dropCursor(),
|
|
402
|
+
EditorState.allowMultipleSelections.of(true),
|
|
403
|
+
indentOnInput(),
|
|
404
|
+
syntaxHighlighting(defaultHighlightStyle, { fallback: true }),
|
|
405
|
+
bracketMatching(),
|
|
406
|
+
closeBrackets(),
|
|
407
|
+
autocompletion(),
|
|
408
|
+
rectangularSelection(),
|
|
409
|
+
crosshairCursor(),
|
|
410
|
+
highlightActiveLine(),
|
|
411
|
+
keymap.of([
|
|
412
|
+
...closeBracketsKeymap,
|
|
413
|
+
...defaultKeymap,
|
|
414
|
+
...searchKeymap,
|
|
415
|
+
...historyKeymap,
|
|
416
|
+
...foldKeymap,
|
|
417
|
+
...completionKeymap,
|
|
418
|
+
...lintKeymap
|
|
419
|
+
]),
|
|
391
420
|
wesl(),
|
|
392
421
|
baseTheme,
|
|
393
422
|
this.themeCompartment.of(this.resolveTheme()),
|
package/dist/WgslEdit.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { wesl, weslLanguage } from "./Language.js";
|
|
2
|
-
import { t as WgslEdit } from "./WgslEdit-
|
|
2
|
+
import { t as WgslEdit } from "./WgslEdit-mSpL7CXc.js";
|
|
3
3
|
|
|
4
4
|
//#region src/index.ts
|
|
5
5
|
if (!customElements.get("wgsl-edit")) customElements.define("wgsl-edit", WgslEdit);
|