@scalar/use-codemirror 0.11.46 → 0.11.47
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 +8 -0
- package/dist/hooks/useDropdown.d.ts.map +1 -1
- package/dist/hooks/useDropdown.js +11 -8
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDropdown.d.ts","sourceRoot":"","sources":["../../src/hooks/useDropdown.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAE,KAAK,GAAG,EAAS,MAAM,KAAK,CAAA;AAErC,8DAA8D;AAC9D,wBAAgB,WAAW,CAAC,MAAM,EAAE;IAClC,UAAU,EAAE,GAAG,CAAC,UAAU,GAAG,IAAI,CAAC,CAAA;IAClC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IACjC,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAClB,YAAY,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;IAC1B,gBAAgB,EAAE,GAAG,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACrD;
|
|
1
|
+
{"version":3,"file":"useDropdown.d.ts","sourceRoot":"","sources":["../../src/hooks/useDropdown.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAE,KAAK,GAAG,EAAS,MAAM,KAAK,CAAA;AAErC,8DAA8D;AAC9D,wBAAgB,WAAW,CAAC,MAAM,EAAE;IAClC,UAAU,EAAE,GAAG,CAAC,UAAU,GAAG,IAAI,CAAC,CAAA;IAClC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IACjC,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAClB,YAAY,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;IAC1B,gBAAgB,EAAE,GAAG,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACrD;iCA6BqC,MAAM;;EAqC3C"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { watch as v } from "vue";
|
|
2
|
-
function x(
|
|
3
|
-
const { codeMirror: e, query: n, showDropdown: r, dropdownPosition: u } =
|
|
2
|
+
function x(m) {
|
|
3
|
+
const { codeMirror: e, query: n, showDropdown: r, dropdownPosition: u } = m;
|
|
4
4
|
function c() {
|
|
5
5
|
var t;
|
|
6
6
|
return ((t = e.value) == null ? void 0 : t.state.selection.main.head) || 0;
|
|
@@ -10,14 +10,17 @@ function x(h) {
|
|
|
10
10
|
return (o = e.value) == null ? void 0 : o.coordsAtPos(t);
|
|
11
11
|
}
|
|
12
12
|
function d() {
|
|
13
|
-
const t = c()
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
const t = c();
|
|
14
|
+
requestAnimationFrame(() => {
|
|
15
|
+
const o = i(t - n.value.length - 2);
|
|
16
|
+
o && (u.value = {
|
|
17
|
+
left: o.left,
|
|
18
|
+
top: Math.max(o.bottom)
|
|
19
|
+
});
|
|
17
20
|
});
|
|
18
21
|
}
|
|
19
22
|
v(n, d);
|
|
20
|
-
function
|
|
23
|
+
function h(t) {
|
|
21
24
|
var p;
|
|
22
25
|
const o = `{{${t}}}`, s = c(), l = Math.max(0, s - n.value.length - 2), a = s;
|
|
23
26
|
(p = e.value) == null || p.dispatch({
|
|
@@ -33,7 +36,7 @@ function x(h) {
|
|
|
33
36
|
var t;
|
|
34
37
|
return (t = e.value) == null ? void 0 : t.state.doc.toString();
|
|
35
38
|
}, f), {
|
|
36
|
-
handleDropdownSelect:
|
|
39
|
+
handleDropdownSelect: h,
|
|
37
40
|
updateDropdownVisibility: f
|
|
38
41
|
};
|
|
39
42
|
}
|
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"vue",
|
|
17
17
|
"vue3"
|
|
18
18
|
],
|
|
19
|
-
"version": "0.11.
|
|
19
|
+
"version": "0.11.47",
|
|
20
20
|
"engines": {
|
|
21
21
|
"node": ">=18"
|
|
22
22
|
},
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@uiw/codemirror-themes": "^4.21.21",
|
|
54
54
|
"codemirror": "^6.0.0",
|
|
55
55
|
"vue": "^3.5.12",
|
|
56
|
-
"@scalar/components": "0.13.
|
|
56
|
+
"@scalar/components": "0.13.3"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@vitejs/plugin-vue": "^5.0.4",
|