@scalar/use-codemirror 0.10.5 → 0.11.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/CHANGELOG.md +17 -0
- package/dist/_virtual/_plugin-vue_export-helper.js +9 -0
- package/dist/components/CodeMirror/CodeMirror.vue.d.ts +12 -11
- package/dist/components/CodeMirror/CodeMirror.vue.d.ts.map +1 -1
- package/dist/components/CodeMirror/CodeMirror.vue.js +8 -0
- package/dist/components/CodeMirror/CodeMirror.vue2.js +37 -0
- package/dist/components/CodeMirror/CodeMirror.vue3.js +4 -0
- package/dist/components/CodeMirror/CodeMirror.vue4.js +4 -0
- package/dist/components/CodeMirror/index.d.ts +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/useCodeMirror.js +184 -0
- package/dist/hooks/variables.js +37 -0
- package/dist/index.js +8 -23461
- package/dist/style.css +1 -25
- package/dist/themes/index.js +92 -0
- package/package.json +7 -6
package/dist/style.css
CHANGED
|
@@ -1,25 +1 @@
|
|
|
1
|
-
|
|
2
|
-
.codemirror-container[data-v-067a1dab] {
|
|
3
|
-
width: 100%;
|
|
4
|
-
height: 100%;
|
|
5
|
-
min-height: 76px;
|
|
6
|
-
color: var(--scalar-color-1);
|
|
7
|
-
display: flex;
|
|
8
|
-
align-items: stretch;
|
|
9
|
-
}
|
|
10
|
-
.copy-to-clipboard-button[data-v-067a1dab] {
|
|
11
|
-
background: red;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.codemirror {
|
|
15
|
-
flex-grow: 1;
|
|
16
|
-
max-width: 100%;
|
|
17
|
-
cursor: text;
|
|
18
|
-
font-size: var(--scalar-small);
|
|
19
|
-
/* Don't scale wide text on mobile because we let it scroll */
|
|
20
|
-
-webkit-text-size-adjust: 100%;
|
|
21
|
-
background: transparent;
|
|
22
|
-
}
|
|
23
|
-
.cm-focused {
|
|
24
|
-
outline: none !important;
|
|
25
|
-
}
|
|
1
|
+
.codemirror-container[data-v-f74951d5]{width:100%;height:100%;min-height:76px;color:var(--scalar-color-1);display:flex;align-items:stretch}.copy-to-clipboard-button[data-v-f74951d5]{background:red}.codemirror{flex-grow:1;max-width:100%;cursor:text;font-size:var(--scalar-small);-webkit-text-size-adjust:100%;background:transparent}.cm-focused{outline:none!important}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { tags as a } from "@lezer/highlight";
|
|
2
|
+
import { createTheme as r } from "@uiw/codemirror-themes";
|
|
3
|
+
const c = r({
|
|
4
|
+
theme: "light",
|
|
5
|
+
settings: {
|
|
6
|
+
background: "var(--scalar-background-2)",
|
|
7
|
+
foreground: "var(--scalar-color-1)",
|
|
8
|
+
caret: "var(--scalar-color-1)",
|
|
9
|
+
// Selection likely needs a hardcoded color due to it not accepting variables
|
|
10
|
+
selection: "rgba(151, 183, 205, 0.2)",
|
|
11
|
+
selectionMatch: "#e3dcce",
|
|
12
|
+
gutterBackground: "var(--scalar-background-2)",
|
|
13
|
+
gutterForeground: "var(--scalar-color-3)",
|
|
14
|
+
gutterBorder: "transparent",
|
|
15
|
+
lineHighlight: "var(--scalar-background-3)",
|
|
16
|
+
fontFamily: "var(--scalar-font-code)"
|
|
17
|
+
},
|
|
18
|
+
styles: [
|
|
19
|
+
{
|
|
20
|
+
tag: [a.standard(a.tagName), a.tagName],
|
|
21
|
+
color: "var(--scalar-color-purple)"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
tag: [a.comment],
|
|
25
|
+
color: "var(--scalar-color-3)"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
tag: [a.className],
|
|
29
|
+
color: "var(--scalar-color-orange)"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
tag: [a.variableName, a.propertyName, a.attributeName],
|
|
33
|
+
color: "var(--scalar-color-1)"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
tag: [a.operator],
|
|
37
|
+
color: "var(--scalar-color-2)"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
tag: [a.keyword, a.typeName, a.typeOperator],
|
|
41
|
+
color: "var(--scalar-color-green)"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
tag: [a.string],
|
|
45
|
+
color: "var(--scalar-color-blue)"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
tag: [a.bracket, a.regexp, a.meta],
|
|
49
|
+
color: "var(--scalar-color-3)"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
tag: [a.number],
|
|
53
|
+
color: "var(--scalar-color-blue)"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
tag: [a.name, a.quote],
|
|
57
|
+
color: "var(--scalar-color-3)"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
tag: [a.heading],
|
|
61
|
+
color: "var(--scalar-color-3)",
|
|
62
|
+
fontWeight: "bold"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
tag: [a.emphasis],
|
|
66
|
+
color: "var(--scalar-color-3)",
|
|
67
|
+
fontStyle: "italic"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
tag: [a.deleted],
|
|
71
|
+
color: "var(--scalar-color-3)",
|
|
72
|
+
backgroundColor: "transparent"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
tag: [a.atom, a.bool, a.special(a.variableName)],
|
|
76
|
+
color: "var(--scalar-color-3)"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
tag: [a.url, a.escape, a.regexp, a.link],
|
|
80
|
+
color: "var(--scalar-color-1)"
|
|
81
|
+
},
|
|
82
|
+
{ tag: a.link, textDecoration: "underline" },
|
|
83
|
+
{ tag: a.strikethrough, textDecoration: "line-through" },
|
|
84
|
+
{
|
|
85
|
+
tag: a.invalid,
|
|
86
|
+
color: "var(--scalar-color-3)"
|
|
87
|
+
}
|
|
88
|
+
]
|
|
89
|
+
});
|
|
90
|
+
export {
|
|
91
|
+
c as customTheme
|
|
92
|
+
};
|
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"vue",
|
|
17
17
|
"vue3"
|
|
18
18
|
],
|
|
19
|
-
"version": "0.
|
|
19
|
+
"version": "0.11.1",
|
|
20
20
|
"engines": {
|
|
21
21
|
"node": ">=18"
|
|
22
22
|
},
|
|
@@ -52,14 +52,15 @@
|
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@vitejs/plugin-vue": "^5.0.4",
|
|
55
|
-
"@vitest/coverage-v8": "^1.
|
|
55
|
+
"@vitest/coverage-v8": "^1.6.0",
|
|
56
56
|
"tsc-alias": "^1.8.8",
|
|
57
57
|
"vite": "^5.2.10",
|
|
58
|
-
"vitest": "^1.
|
|
59
|
-
"vue": "^3.4.
|
|
60
|
-
"vue-tsc": "^
|
|
58
|
+
"vitest": "^1.6.0",
|
|
59
|
+
"vue": "^3.4.22",
|
|
60
|
+
"vue-tsc": "^2.0.13",
|
|
61
61
|
"y-codemirror.next": "^0.3.2",
|
|
62
|
-
"yjs": "^13.6.0"
|
|
62
|
+
"yjs": "^13.6.0",
|
|
63
|
+
"@scalar/build-tooling": "0.1.6"
|
|
63
64
|
},
|
|
64
65
|
"peerDependencies": {
|
|
65
66
|
"vue": "^3.3.0",
|