@scalar/use-codemirror 0.1.1
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/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13348 -0
- package/dist/useCodeMirror.d.ts +31 -0
- package/dist/useCodeMirror.d.ts.map +1 -0
- package/package.json +54 -0
- package/src/index.ts +1 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type Extension } from '@codemirror/state';
|
|
2
|
+
import { EditorView } from 'codemirror';
|
|
3
|
+
import { type Ref } from 'vue';
|
|
4
|
+
type UseCodeMirrorParameters = {
|
|
5
|
+
/**
|
|
6
|
+
* Some additional CodeMirror extensions.
|
|
7
|
+
*/
|
|
8
|
+
extensions: Extension[];
|
|
9
|
+
/**
|
|
10
|
+
* Prefill the content. Will be ignored when a provider is given.
|
|
11
|
+
*/
|
|
12
|
+
content?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Inverse the dark mode.
|
|
15
|
+
*/
|
|
16
|
+
forceDarkMode?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Whether to load a theme.
|
|
19
|
+
*/
|
|
20
|
+
withoutTheme?: boolean;
|
|
21
|
+
};
|
|
22
|
+
export declare const useCodeMirror: (parameters: UseCodeMirrorParameters) => {
|
|
23
|
+
value: Ref<string>;
|
|
24
|
+
codeMirrorRef: Ref<HTMLDivElement | null>;
|
|
25
|
+
codeMirror: Ref<EditorView | null>;
|
|
26
|
+
setCodeMirrorContent: (content: string) => void;
|
|
27
|
+
reconfigureCodeMirror: (newExtensions: Extension[]) => void;
|
|
28
|
+
restartCodeMirror: (newExtensions: Extension[]) => void;
|
|
29
|
+
};
|
|
30
|
+
export {};
|
|
31
|
+
//# sourceMappingURL=useCodeMirror.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCodeMirror.d.ts","sourceRoot":"","sources":["../src/useCodeMirror.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAe,MAAM,mBAAmB,CAAA;AAG/D,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,EAAE,KAAK,GAAG,EAAc,MAAM,KAAK,CAAA;AAK1C,KAAK,uBAAuB,GAAG;IAC7B;;OAEG;IACH,UAAU,EAAE,SAAS,EAAE,CAAA;IACvB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB,CAAA;AAED,eAAO,MAAM,aAAa,eACZ,uBAAuB;WAE5B,IAAI,MAAM,CAAC;mBACH,IAAI,cAAc,GAAG,IAAI,CAAC;gBAC7B,IAAI,UAAU,GAAG,IAAI,CAAC;oCACF,MAAM,KAAK,IAAI;2CACR,SAAS,EAAE,KAAK,IAAI;uCACxB,SAAS,EAAE,KAAK,IAAI;CA6HxD,CAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@scalar/use-codemirror",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"author": "Scalar",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"engines": {
|
|
7
|
+
"node": ">=18"
|
|
8
|
+
},
|
|
9
|
+
"type": "module",
|
|
10
|
+
"main": "src/index.ts",
|
|
11
|
+
"files": [
|
|
12
|
+
"dist"
|
|
13
|
+
],
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@codemirror/lang-javascript": "6.1.9",
|
|
16
|
+
"@codemirror/lang-json": "6.0.1",
|
|
17
|
+
"@codemirror/state": "6.2.1",
|
|
18
|
+
"@codemirror/view": "6.16.0",
|
|
19
|
+
"@headlessui/vue": "1.7.14",
|
|
20
|
+
"@lezer/highlight": "1.1.6",
|
|
21
|
+
"@types/nunjucks": "3.2.2",
|
|
22
|
+
"@uiw/codemirror-theme-duotone": "4.21.3",
|
|
23
|
+
"@uiw/codemirror-themes": "4.21.3",
|
|
24
|
+
"@vueuse/core": "10.1.2",
|
|
25
|
+
"axios": "1.4.0",
|
|
26
|
+
"codemirror": "6.0.1",
|
|
27
|
+
"javascript-time-ago": "2.5.9",
|
|
28
|
+
"nanoid": "4.0.2",
|
|
29
|
+
"nunjucks": "3.2.4",
|
|
30
|
+
"pretty-bytes": "6.1.0",
|
|
31
|
+
"pretty-ms": "8.0.0",
|
|
32
|
+
"tippy.js": "6.3.7"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@vitejs/plugin-vue": "4.2.3",
|
|
36
|
+
"tsc-alias": "1.8.6",
|
|
37
|
+
"vite": "4.4.8",
|
|
38
|
+
"vitest": "0.34.1",
|
|
39
|
+
"vue-tsc": "1.8.8"
|
|
40
|
+
},
|
|
41
|
+
"peerDependencies": {
|
|
42
|
+
"vue": "3.3.4"
|
|
43
|
+
},
|
|
44
|
+
"scripts": {
|
|
45
|
+
"build": "vite build && pnpm types:build && tsc-alias -p tsconfig.build.json",
|
|
46
|
+
"dev": "vite",
|
|
47
|
+
"lint:check": "eslint .",
|
|
48
|
+
"lint:fix": "eslint . --fix",
|
|
49
|
+
"preview": "vite preview",
|
|
50
|
+
"test": "vitest",
|
|
51
|
+
"types:build": "vue-tsc -p tsconfig.build.json",
|
|
52
|
+
"types:check": "vue-tsc --noEmit --skipLibCheck"
|
|
53
|
+
}
|
|
54
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useCodeMirror'
|