@scalar/use-codemirror 0.10.4 → 0.11.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/dist/style.css CHANGED
@@ -1,25 +1 @@
1
-
2
- .codemirror-container[data-v-d760fe79] {
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-d760fe79] {
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.10.4",
19
+ "version": "0.11.0",
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.5.0",
55
+ "@vitest/coverage-v8": "^1.6.0",
56
56
  "tsc-alias": "^1.8.8",
57
57
  "vite": "^5.2.10",
58
- "vitest": "^1.5.0",
59
- "vue": "^3.4.21",
60
- "vue-tsc": "^1.8.19",
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.5"
63
64
  },
64
65
  "peerDependencies": {
65
66
  "vue": "^3.3.0",