@scalar/use-codemirror 0.14.10 → 0.14.11
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
CHANGED
|
@@ -25,8 +25,8 @@ type BaseParameters = {
|
|
|
25
25
|
disableCloseBrackets?: MaybeRefOrGetter<boolean | undefined>;
|
|
26
26
|
/** Option to lint and show error in the editor */
|
|
27
27
|
lint?: MaybeRefOrGetter<boolean | undefined>;
|
|
28
|
-
onBlur?: (v: string) => void;
|
|
29
|
-
onFocus?: (v: string) => void;
|
|
28
|
+
onBlur?: (v: string, event: FocusEvent) => void;
|
|
29
|
+
onFocus?: (v: string, event: FocusEvent) => void;
|
|
30
30
|
placeholder?: MaybeRefOrGetter<string | undefined>;
|
|
31
31
|
};
|
|
32
32
|
export type UseCodeMirrorParameters = (BaseParameters & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCodeMirror.d.ts","sourceRoot":"","sources":["../../src/hooks/useCodeMirror.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,KAAK,SAAS,EAAe,MAAM,mBAAmB,CAAA;AAC/D,OAAO,EACL,UAAU,EAMX,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,GAAG,EAAkD,MAAM,KAAK,CAAA;AAQrG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"useCodeMirror.d.ts","sourceRoot":"","sources":["../../src/hooks/useCodeMirror.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,KAAK,SAAS,EAAe,MAAM,mBAAmB,CAAA;AAC/D,OAAO,EACL,UAAU,EAMX,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,GAAG,EAAkD,MAAM,KAAK,CAAA;AAQrG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;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AChD,WAAW,CAAC,EAAE,gBAAgB,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;CACnD,CAAA;AAED,MAAM,MAAM,uBAAuB,GAC/B,CAAC,cAAc,GAAG;IAChB,qEAAqE;IACrE,OAAO,EAAE,gBAAgB,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAC7C,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;CAC/B,CAAC,GACF,CAAC,cAAc,GAAG;IAChB,QAAQ,EAAE,gBAAgB,CAAC,SAAS,GAAG,IAAI,CAAC,CAAA;IAC5C,OAAO,CAAC,EAAE,gBAAgB,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAC9C,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;CAC/B,CAAC,CAAA;AAsBN,sCAAsC;AACtC,eAAO,MAAM,aAAa,GACxB,QAAQ,uBAAuB,KAC9B;IACD,oBAAoB,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IAChD,UAAU,EAAE,GAAG,CAAC,UAAU,GAAG,IAAI,CAAC,CAAA;CA4InC,CAAA"}
|
|
@@ -14,6 +14,17 @@ const CHEVRON_DOWN = '<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.
|
|
|
14
14
|
const CHEVRON_RIGHT = '<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="m9 18 6-6-6-6" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/></svg>';
|
|
15
15
|
import { customTheme } from '../themes/index.js';
|
|
16
16
|
import { variables } from './variables.js';
|
|
17
|
+
/**
|
|
18
|
+
* This was an insane bug that only exists in chrome
|
|
19
|
+
*
|
|
20
|
+
* Found these issues which may be related, it says che chrome one is fixed, they possibly had a regression?
|
|
21
|
+
*
|
|
22
|
+
* @see https://issues.chromium.org/issues/375711382
|
|
23
|
+
* @see https://discuss.codemirror.net/t/experimental-support-for-editcontext/8144
|
|
24
|
+
* @see https://github.com/codemirror/dev/issues/1458
|
|
25
|
+
*/
|
|
26
|
+
// @ts-expect-error this is the workaround suggested by codemirror
|
|
27
|
+
EditorView.EDIT_CONTEXT = false;
|
|
17
28
|
/** Check if the hook has a provider. In provider mode we ignore the content variable */
|
|
18
29
|
const hasProvider = (params) => 'provider' in params && !!toValue(params.provider);
|
|
19
30
|
const selectAllKeyBinding = {
|
|
@@ -183,11 +194,11 @@ function getCodeMirrorExtensions({ onChange, onBlur, onFocus, provider, language
|
|
|
183
194
|
onChange?.(v.state.doc.toString());
|
|
184
195
|
}),
|
|
185
196
|
EditorView.domEventHandlers({
|
|
186
|
-
blur: (
|
|
187
|
-
onBlur?.(view.state.doc.toString());
|
|
197
|
+
blur: (event, view) => {
|
|
198
|
+
onBlur?.(view.state.doc.toString(), event);
|
|
188
199
|
},
|
|
189
|
-
focus: (
|
|
190
|
-
onFocus?.(view.state.doc.toString());
|
|
200
|
+
focus: (event, view) => {
|
|
201
|
+
onFocus?.(view.state.doc.toString(), event);
|
|
191
202
|
},
|
|
192
203
|
}),
|
|
193
204
|
// Add Classes
|
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"vue",
|
|
17
17
|
"vue3"
|
|
18
18
|
],
|
|
19
|
-
"version": "0.14.
|
|
19
|
+
"version": "0.14.11",
|
|
20
20
|
"engines": {
|
|
21
21
|
"node": ">=22"
|
|
22
22
|
},
|
|
@@ -54,15 +54,15 @@
|
|
|
54
54
|
"@lezer/common": "^1.2.3",
|
|
55
55
|
"@lezer/highlight": "^1.2.1",
|
|
56
56
|
"@replit/codemirror-css-color-picker": "^6.3.0",
|
|
57
|
-
"vue": "^3.5.
|
|
57
|
+
"vue": "^3.5.30"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@vitejs/plugin-vue": "^6.0.3",
|
|
61
61
|
"vite": "8.0.0",
|
|
62
62
|
"vitest": "4.1.0",
|
|
63
|
-
"vue": "^3.5.
|
|
63
|
+
"vue": "^3.5.30",
|
|
64
64
|
"vue-tsc": "^3.2.4",
|
|
65
|
-
"@scalar/themes": "0.15.
|
|
65
|
+
"@scalar/themes": "0.15.2"
|
|
66
66
|
},
|
|
67
67
|
"scripts": {
|
|
68
68
|
"build": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
|