@replit/codemirror-interact
Advanced tools
Comparing version 6.0.4 to 6.1.0
@@ -38,3 +38,3 @@ import * as _codemirror_state from '@codemirror/state'; | ||
declare const interactModKey: Facet<ModKey, ModKey>; | ||
declare type ModKey = "alt" | "shift" | "meta" | "ctrl"; | ||
declare type ModKey = "alt" | "shift" | "meta" | "ctrl" | "mod"; | ||
interface InteractConfig { | ||
@@ -41,0 +41,0 @@ rules?: InteractRule[]; |
@@ -135,2 +135,4 @@ import { EditorView, Decoration, ViewPlugin } from '@codemirror/view'; | ||
const modkey = view.state.facet(interactModKey); | ||
const isMac = Boolean(window.navigator) && | ||
window.navigator.userAgent.includes('Macintosh'); | ||
switch (modkey) { | ||
@@ -141,2 +143,3 @@ case "alt": return e.altKey; | ||
case "meta": return e.metaKey; | ||
case "mod": return isMac ? e.metaKey : e.ctrlKey; | ||
} | ||
@@ -143,0 +146,0 @@ throw new Error(`Invalid mod key: ${modkey}`); |
{ | ||
"name": "@replit/codemirror-interact", | ||
"description": "Interact with custom values", | ||
"version": "6.0.4", | ||
"version": "6.1.0", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -192,2 +192,5 @@ // TODO: custom style | ||
const isMac = Boolean(window.navigator) && | ||
window.navigator.userAgent.includes('Macintosh'); | ||
switch (modkey) { | ||
@@ -198,2 +201,3 @@ case "alt": return e.altKey; | ||
case "meta": return e.metaKey; | ||
case "mod": return isMac ? e.metaKey : e.ctrlKey; | ||
} | ||
@@ -304,2 +308,3 @@ | ||
| "ctrl" | ||
| "mod"; | ||
@@ -306,0 +311,0 @@ interface InteractConfig { |
Sorry, the diff of this file is not supported yet
26884
776