@actis/codemirror 26.9.0
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/LICENSE +674 -0
- package/README.md +23 -0
- package/dist/index.cjs +731 -0
- package/dist/index.d.cts +54 -0
- package/dist/index.d.mts +54 -0
- package/dist/index.mjs +715 -0
- package/package.json +68 -0
- package/styles.css +79 -0
package/README.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# @actis/codemirror
|
|
2
|
+
|
|
3
|
+
Reusable CodeMirror extensions for Actis GLSL shader editors.
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import { glslEditorExtensions } from '@actis/codemirror'
|
|
7
|
+
import { EditorState } from '@codemirror/state'
|
|
8
|
+
import { EditorView } from '@codemirror/view'
|
|
9
|
+
import '@actis/codemirror/styles.css'
|
|
10
|
+
|
|
11
|
+
const view = new EditorView({
|
|
12
|
+
state: EditorState.create({
|
|
13
|
+
doc: fragmentShader,
|
|
14
|
+
extensions: glslEditorExtensions({
|
|
15
|
+
webgl2: true,
|
|
16
|
+
onChange: value => console.warn(value),
|
|
17
|
+
}),
|
|
18
|
+
}),
|
|
19
|
+
parent: document.querySelector('#editor')!,
|
|
20
|
+
})
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Wrap the editor host with `cm-actis-editor` when using the bundled stylesheet.
|