sia-reactor 0.0.48 → 0.0.49
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/adapters/react.cjs +6 -6
- package/dist/adapters/react.cjs.map +1 -1
- package/dist/adapters/react.js +3 -3
- package/dist/adapters/vanilla.cjs +6 -6
- package/dist/adapters/vanilla.cjs.map +1 -1
- package/dist/adapters/vanilla.js +3 -3
- package/dist/{chunk-U4SR3CZF.js → chunk-2EAHPVH6.js} +7 -7
- package/dist/chunk-2EAHPVH6.js.map +1 -0
- package/dist/{chunk-3IIYJ6B4.js → chunk-GC754LMW.js} +2 -2
- package/dist/{chunk-IYAWNLD2.js → chunk-ZTUAHMMN.js} +3 -3
- package/dist/modules.js +2 -2
- package/dist/super.d.ts +3 -1
- package/dist/super.global.js +6 -6
- package/dist/super.global.js.map +1 -1
- package/dist/utils.cjs +6 -6
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +3 -1
- package/dist/utils.d.ts +3 -1
- package/dist/utils.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-U4SR3CZF.js.map +0 -1
- /package/dist/{chunk-3IIYJ6B4.js.map → chunk-GC754LMW.js.map} +0 -0
- /package/dist/{chunk-IYAWNLD2.js.map → chunk-ZTUAHMMN.js.map} +0 -0
package/dist/utils.cjs
CHANGED
|
@@ -1201,29 +1201,29 @@ function cleanKeyCombo(combo, mods = KEYS_MODS) {
|
|
|
1201
1201
|
};
|
|
1202
1202
|
return Array.isArray(combo) ? combo.map(clean) : clean(combo);
|
|
1203
1203
|
}
|
|
1204
|
-
function matchKeys(required, actual, strict = false, clean = true) {
|
|
1204
|
+
function matchKeys(required, actual, strict = false, clean = true, allowedMods) {
|
|
1205
1205
|
if (clean) actual = cleanKeyCombo(actual);
|
|
1206
1206
|
const match = (req, actual2) => {
|
|
1207
1207
|
req = cleanKeyCombo(req);
|
|
1208
1208
|
if (strict) return req === actual2;
|
|
1209
1209
|
const reqs = req.split("+"), reals = actual2.split("+");
|
|
1210
|
-
for (const mod of KEYS_CMODS) if (reals.includes(mod) && !reqs.includes(mod)) return false;
|
|
1210
|
+
for (const mod of KEYS_CMODS) if (reals.includes(mod) && !reqs.includes(mod) && !allowedMods?.includes(mod)) return false;
|
|
1211
1211
|
return reqs.every((k) => reals.includes(k));
|
|
1212
1212
|
};
|
|
1213
1213
|
return Array.isArray(required) ? required.some((req) => match(req, actual)) : match(required, actual);
|
|
1214
1214
|
}
|
|
1215
1215
|
function getTermsForKey(combo, settings) {
|
|
1216
|
-
const terms = { override: false, block: false, whitelisted: false, action: null }, { overrides = [], shortcuts = {}, blocks = [], strictMatch: stm = false, rankedMatch: ram = true, whitelist = [] } = settings || {};
|
|
1216
|
+
const terms = { override: false, block: false, whitelisted: false, action: null }, { overrides = [], shortcuts = {}, blocks = [], strictMatch: stm = false, rankedMatch: ram = true, whitelist = [], moddedlist = [] } = settings || {};
|
|
1217
1217
|
combo = cleanKeyCombo(combo);
|
|
1218
1218
|
if (matchKeys(overrides, combo, stm, false)) terms.override = true;
|
|
1219
1219
|
if (matchKeys(blocks, combo, stm, false)) terms.block = true;
|
|
1220
|
-
if (matchKeys(
|
|
1221
|
-
if (!ram) return terms.action = Object.keys(shortcuts).find((id) => shortcuts[id] && matchKeys(shortcuts[id], combo, stm, false)) || null, terms;
|
|
1220
|
+
if (whitelist.some((w) => matchKeys(w, combo, false, true, moddedlist.includes(cleanKeyCombo(w)) ? KEYS_CMODS : void 0))) terms.whitelisted = true;
|
|
1221
|
+
if (!ram) return terms.action = Object.keys(shortcuts).find((id) => shortcuts[id] && matchKeys(shortcuts[id], combo, stm, false, moddedlist.includes(id) ? KEYS_CMODS : void 0)) || null, terms;
|
|
1222
1222
|
let bestA = null, bestE = false, bestL = 0;
|
|
1223
1223
|
for (const id of Object.keys(shortcuts))
|
|
1224
1224
|
for (const c of Array.isArray(shortcuts[id]) ? shortcuts[id] : [shortcuts[id]]) {
|
|
1225
1225
|
const req = c && cleanKeyCombo(c), isE = req === combo, len = req ? req.split("+").length : 0;
|
|
1226
|
-
if (c && matchKeys(req, combo, stm, false) && (!bestA || isE && !bestE || isE === bestE && len > bestL)) bestA = id, bestE = isE, bestL = len;
|
|
1226
|
+
if (c && matchKeys(req, combo, stm, false, moddedlist.includes(id) ? KEYS_CMODS : void 0) && (!bestA || isE && !bestE || isE === bestE && len > bestL)) bestA = id, bestE = isE, bestL = len;
|
|
1227
1227
|
}
|
|
1228
1228
|
return terms.action = bestA, terms;
|
|
1229
1229
|
}
|