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.
@@ -3,9 +3,9 @@ import {
3
3
  TimeTravelConsole,
4
4
  effect,
5
5
  withTracker
6
- } from "../chunk-IYAWNLD2.js";
7
- import "../chunk-3IIYJ6B4.js";
8
- import "../chunk-U4SR3CZF.js";
6
+ } from "../chunk-ZTUAHMMN.js";
7
+ import "../chunk-GC754LMW.js";
8
+ import "../chunk-2EAHPVH6.js";
9
9
  import "../chunk-YHGYHYEE.js";
10
10
  export {
11
11
  Autotracker,
@@ -82,29 +82,29 @@ function cleanKeyCombo(combo, mods = KEYS_MODS) {
82
82
  };
83
83
  return Array.isArray(combo) ? combo.map(clean) : clean(combo);
84
84
  }
85
- function matchKeys(required, actual, strict = false, clean = true) {
85
+ function matchKeys(required, actual, strict = false, clean = true, allowedMods) {
86
86
  if (clean) actual = cleanKeyCombo(actual);
87
87
  const match = (req, actual2) => {
88
88
  req = cleanKeyCombo(req);
89
89
  if (strict) return req === actual2;
90
90
  const reqs = req.split("+"), reals = actual2.split("+");
91
- for (const mod of KEYS_CMODS) if (reals.includes(mod) && !reqs.includes(mod)) return false;
91
+ for (const mod of KEYS_CMODS) if (reals.includes(mod) && !reqs.includes(mod) && !allowedMods?.includes(mod)) return false;
92
92
  return reqs.every((k) => reals.includes(k));
93
93
  };
94
94
  return Array.isArray(required) ? required.some((req) => match(req, actual)) : match(required, actual);
95
95
  }
96
96
  function getTermsForKey(combo, settings) {
97
- const terms = { override: false, block: false, whitelisted: false, action: null }, { overrides = [], shortcuts = {}, blocks = [], strictMatch: stm = false, rankedMatch: ram = true, whitelist = [] } = settings || {};
97
+ const terms = { override: false, block: false, whitelisted: false, action: null }, { overrides = [], shortcuts = {}, blocks = [], strictMatch: stm = false, rankedMatch: ram = true, whitelist = [], moddedlist = [] } = settings || {};
98
98
  combo = cleanKeyCombo(combo);
99
99
  if (matchKeys(overrides, combo, stm, false)) terms.override = true;
100
100
  if (matchKeys(blocks, combo, stm, false)) terms.block = true;
101
- if (matchKeys(whitelist, combo, false)) terms.whitelisted = true;
102
- if (!ram) return terms.action = Object.keys(shortcuts).find((id) => shortcuts[id] && matchKeys(shortcuts[id], combo, stm, false)) || null, terms;
101
+ if (whitelist.some((w) => matchKeys(w, combo, false, true, moddedlist.includes(cleanKeyCombo(w)) ? KEYS_CMODS : void 0))) terms.whitelisted = true;
102
+ 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;
103
103
  let bestA = null, bestE = false, bestL = 0;
104
104
  for (const id of Object.keys(shortcuts))
105
105
  for (const c of Array.isArray(shortcuts[id]) ? shortcuts[id] : [shortcuts[id]]) {
106
106
  const req = c && cleanKeyCombo(c), isE = req === combo, len = req ? req.split("+").length : 0;
107
- if (c && matchKeys(req, combo, stm, false) && (!bestA || isE && !bestE || isE === bestE && len > bestL)) bestA = id, bestE = isE, bestL = len;
107
+ 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;
108
108
  }
109
109
  return terms.action = bestA, terms;
110
110
  }
@@ -156,4 +156,4 @@ export {
156
156
  formatKeyShortcutsTooltip,
157
157
  parseForARIAKS
158
158
  };
159
- //# sourceMappingURL=chunk-U4SR3CZF.js.map
159
+ //# sourceMappingURL=chunk-2EAHPVH6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/ts/utils/methd.ts","../src/ts/utils/dom.ts","../src/ts/utils/keys.ts"],"sourcesContent":["// \"THE METHODIST\": A mixin method expert often used to manipulate or bind all methods of a class to an instance\n\n/**\n * Walks an instance and its prototype chain, invoking a callback for each callable method.\n * @param owner Instance whose methods are inspected.\n * @param callback Invoked for each method name found.\n * @param skipOwn Skips owner-level methods when traversing own or parent prototypes.\n * @param nested Internal traversal flag, Override to `true` to avoid skipping own methods when `skipOwn` is `true`.\n */\nexport function onAllMethods(owner: any, callback: (method: string, owner: any) => void, skipOwn = true, nested = false): void {\n let proto = owner;\n while (proto && proto !== Object.prototype) {\n for (const method of Object.getOwnPropertyNames(proto)) {\n if (method === \"constructor\") continue;\n if (nested && skipOwn && Object.prototype.hasOwnProperty.call(owner, method)) continue;\n if (\"function\" === typeof Object.getOwnPropertyDescriptor(proto, method)?.value) callback(method, owner);\n }\n (proto = Object.getPrototypeOf(proto)), (nested = true);\n }\n}\n\n/**\n * Binds all discovered methods on an owner to the owner instance.\n * @param owner Instance whose methods should be bound.\n */\nexport function bindAllMethods(owner: any): void {\n onAllMethods(owner, (method: string, owner: any) => {\n owner[method] = owner[method].bind(owner);\n });\n}\n\n/**\n * Wraps all discovered methods in a guard function, optionally binding before wrapping.\n * @param owner Instance whose methods should be wrapped.\n * @param guardFn Wrapper factory used for each method.\n * @param bound Binds methods to owner before wrapping when true.\n */\nexport function guardAllMethods(owner: any, guardFn: (fn: Function) => Function = guardMethod, bound = true): void {\n onAllMethods(owner, (method: string, owner: any) => {\n owner[method] = guardFn(bound ? owner[method].bind(owner) : owner[method]);\n });\n}\n\n/**\n * Wraps a function with try/catch and async rejection handling.\n * @template T Function type to preserve.\n * @param fn Function to wrap.\n * @param onError Error handler for sync throws and async rejections.\n * @returns Guarded function with the same call signature.\n */\nexport function guardMethod<T extends Function>(fn: T, onError: (e: any) => void = (e) => console.error(e)): T {\n return ((...args: any[]) => {\n try {\n const result = fn(...args);\n return result instanceof Promise ? result.catch((e) => onError(e)) : result;\n } catch (e) {\n onError(e);\n }\n }) as unknown as T;\n}\n","// Types\ntype Dataset = Record<string, string | number>;\ntype Style = Partial<CSSStyleDeclaration>;\n\n// Element Factory\n\n/**\n * Creates an HTML element with the specified tag and properties.\n * @param tag The tag name of the element to create.\n * @param props Optional properties to set on the element.\n * @param dataset Optional dataset attributes for the element.\n * @param styles Optional CSS styles for the element.\n * @returns The created HTML element.\n */\nexport function createEl<K extends keyof HTMLElementTagNameMap>(tag: K, props?: Partial<HTMLElementTagNameMap[K]>, dataset?: Dataset, styles?: Style): HTMLElementTagNameMap[K];\nexport function createEl(tag: string, props?: Partial<HTMLElement>, dataset?: Dataset, styles?: Style): HTMLElement | null;\nexport function createEl(tag: string, props?: Record<string, unknown>, dataset?: Dataset, styles?: Style, el = tag ? document?.createElement(tag) : null): HTMLElement | null {\n return assignEl(el, props, dataset, styles);\n}\n\n/**\n * Assigns properties, dataset attributes, and styles to an HTML element.\n * @param el The HTML element to assign properties to.\n * @param props Optional properties to set on the element.\n * @param dataset Optional dataset attributes for the element.\n * @param styles Optional CSS styles for the element.\n * @return The modified HTML element to allow signature swaps with `createEl()`.\n */\nexport function assignEl<El extends HTMLElement>(el?: El | null, props?: Partial<El>, dataset?: Dataset, styles?: Style, nodiff?: boolean): El | null;\nexport function assignEl<El extends HTMLElement>(el?: El | null, props?: Partial<El>, dataset?: Dataset, styles?: Style, nodiff?: boolean): El | null;\nexport function assignEl(el?: HTMLElement | null, props?: Record<string, unknown>, dataset?: Dataset, styles?: Style, nodiff = true): HTMLElement | null {\n if (!el) return null;\n if (props) for (const k of Object.keys(props)) if (props[k] !== undefined) if (nodiff || (el as any)[k] !== props[k]) (el as unknown as Record<string, unknown>)[k] = props[k];\n if (dataset) for (const k of Object.keys(dataset)) if (dataset[k] !== undefined) if (nodiff || (el.dataset as any)[k] !== dataset[k]) (el.dataset as DOMStringMap)[k] = String(dataset[k]);\n if (styles) for (const k of Object.keys(styles)) if (styles[k as keyof Style] !== undefined) if (nodiff || (el.style as any)[k] !== styles[k as any]) (el.style as unknown as Record<string, unknown>)[k] = styles[k as keyof Style];\n return el;\n}\n\n/** Get the currently active element, traversing into shadow roots if necessary.\n * @param root Root node to start searching from, defaults to the main document.\n * @param noBody If `true`, will return `null` if the active element is the body element.\n * @returns The active element or null if none found.\n */\nexport function getActiveEl(root?: Document | ShadowRoot | null, noBody = true): Element | null {\n const activeEl = (root ?? document).activeElement;\n return !activeEl || (noBody && activeEl === document.body) ? null : activeEl.shadowRoot ? getActiveEl(activeEl.shadowRoot) : activeEl;\n}\n","import { getActiveEl } from \"./dom\";\n\n/** Keyboard matching configuration used by utility helpers. */\nexport interface KeysSettings {\n /** Disables key handling when true. */\n disabled?: boolean;\n /** Combos that should call `preventDefault` when matched. */\n overrides?: string[];\n /** Action map from action id to combo or combo list. */\n shortcuts?: Record<string, string | string[]>;\n /** Combos that should be rejected immediately. */\n blocks?: string[];\n /** Enables exact combo matching instead of subset matching. */\n strictMatch?: boolean;\n /** Ranks shortcut matches by exactness before insertion order. Enabled by default. */\n rankedMatch?: boolean;\n /** Combos that are allowed as pass-through key actions. */\n whitelist?: string[];\n /** Actions permitted to match base keys even when heavy modifiers are held. */\n moddedlist?: string[];\n}\n\n/** Canonical key-combo structure used by parser and serializer helpers. */\nexport type KeyStruct = Record<\"ctrlKey\" | \"shiftKey\" | \"altKey\" | \"metaKey\", boolean> & { key: string };\n\n/**\n * Global registry of native browser hotkeys and shortcut combinations, pass as `.blocks` in `Settings` config for `keyEventAllowed()` for better UX.\n * Used by the system to prevent default browser behaviors (e.g., zooming, tab switching, refreshing, or opening dev tools) inside the listener context.\n */\n// prettier-ignore\nexport const KEYS_BLOCKS = [\"Ctrl+Tab\", \"Ctrl+Shift+Tab\", \"Ctrl+PageUp\", \"Ctrl+PageDown\", \"Cmd+Option+ArrowRight\", \"Cmd+Option+ArrowLeft\", \"Ctrl+1\", \"Ctrl+2\", \"Ctrl+3\", \"Ctrl+4\", \"Ctrl+5\", \"Ctrl+6\", \"Ctrl+7\", \"Ctrl+8\", \"Ctrl+9\", \"Cmd+1\", \"Cmd+2\", \"Cmd+3\", \"Cmd+4\", \"Cmd+5\", \"Cmd+6\", \"Cmd+7\", \"Cmd+8\", \"Cmd+9\", \"Alt+ArrowLeft\", \"Alt+ArrowRight\", \"Cmd+ArrowLeft\", \"Cmd+ArrowRight\", \"Ctrl+r\", \"Ctrl+Shift+r\", \"F5\", \"Shift+F5\", \"Cmd+r\", \"Cmd+Shift+r\", \"Ctrl+h\", \"Ctrl+j\", \"Ctrl+d\", \"Ctrl+f\", \"Cmd+y\", \"Cmd+Option+b\", \"Cmd+d\", \"Cmd+f\", \"Ctrl+Shift+i\", \"Ctrl+Shift+j\", \"Ctrl+Shift+c\", \"Ctrl+u\", \"F12\", \"Cmd+Option+i\", \"Cmd+Option+j\", \"Cmd+Option+c\", \"Cmd+Option+u\", \"Ctrl+=\", \"Ctrl+-\", \"Ctrl+0\", \"Cmd+=\", \"Cmd+-\", \"Cmd+0\", \"Ctrl+p\", \"Ctrl+s\", \"Ctrl+o\", \"Cmd+p\", \"Cmd+s\", \"Cmd+o\"], // JIT eats loops :)\n KEYS_MODS = [\"ctrl\", \"shift\", \"alt\", \"meta\"] as const,\n KEYS_CMODS = [\"ctrl\", \"alt\", \"meta\"] as const,\n KEYS_ALIAS: Record<string, string> = { cmd: \"meta\", space: \" \" };\n\n/**\n * Parses a combo string into modifier flags + terminal key.\n * @param combo Key combo string (for example: `\"ctrl+shift+z\"`).\n * @returns Parsed key structure with boolean modifier flags.\n * @example\n * parseKeyCombo(\"ctrl+shift+z\")\n * // => { ctrlKey: true, shiftKey: true, altKey: false, metaKey: false, key: \"z\" }\n */\nexport function parseKeyCombo(combo: string): KeyStruct {\n const parts = cleanKeyCombo(combo).toLowerCase().split(\"+\");\n return { ctrlKey: parts.includes(\"ctrl\"), shiftKey: parts.includes(\"shift\"), altKey: parts.includes(\"alt\"), metaKey: parts.includes(\"meta\") || parts.includes(\"cmd\"), key: parts.find((p) => !/^(ctrl|shift|alt|meta|cmd)$/.test(p)) || \"\" };\n}\n\n/**\n * Serializes a key structure or keyboard event into canonical combo form.\n * @param e KeyboardEvent-like object or parsed key structure.\n * @returns Canonical combo string (for example: `\"ctrl+shift+z\"`).\n */\nexport function stringifyKeyEvent(e: KeyStruct | KeyboardEvent): string {\n const parts: string[] = [];\n e.ctrlKey && parts.push(\"ctrl\"), e.altKey && parts.push(\"alt\"), e.shiftKey && parts.push(\"shift\"), e.metaKey && parts.push(\"meta\"), parts.push(e.key?.toLowerCase() ?? \"\");\n return parts.join(\"+\");\n}\n\n/**\n * Normalizes combo(s) by:\n * - lowercasing,\n * - aliasing `cmd -> meta`, `space -> \" \"`,\n * - preserving literal space/plus edge cases,\n * - sorting modifiers as `ctrl, alt, shift, meta`.\n * @param combo Raw combo or list of combos.\n * @param mods Optional list of modifier keys to sort and filter by (default: `[\"ctrl\", \"shift\", \"alt\", \"meta\"]`).\n * @returns Canonical combo string or list.\n * @example\n * cleanKeyCombo([\"Shift+Alt+Ctrl+Z\", \"cmd+y\"])\n * // => [\"ctrl+shift+alt+z\", \"meta+y\"]\n */\nexport function cleanKeyCombo(combo: string, mods?: string[]): string;\nexport function cleanKeyCombo(combo: string[], mods?: string[]): string[];\nexport function cleanKeyCombo(combo: string | string[], mods: string[] = KEYS_MODS as any): string | string[] {\n const clean = (combo: string): string => {\n if (combo === \" \" || combo === \"+\") return combo;\n combo = combo.replace(/\\+\\s*\\+$/, \"+plus\");\n const p = combo\n .toLowerCase()\n .split(\"+\")\n .filter((k) => k !== \"\")\n .map((k, _, __, tk = k.trim()) => KEYS_ALIAS[tk] || (tk === \"plus\" ? \"+\" : tk || \" \"));\n return [...p.filter((k) => mods.includes(k)).sort((a, b) => mods.indexOf(a) - mods.indexOf(b)), ...(p.filter((k) => !mods.includes(k)) || \"\")].join(\"+\");\n };\n return Array.isArray(combo) ? combo.map(clean) : clean(combo);\n}\n\n/**\n * Determines if actual combo satisfies required combo rule(s).\n * Non-strict mode performs subset matching (required keys must all be present).\n * Strict mode requires exact canonical equality.\n * @param required Required combo or combo list.\n * @param actual Actual combo string.\n * @param strict Whether to require exact match.\n * @param clean Whether to clean the actual combo.\n * @returns `true` when match succeeds.\n */\nexport function matchKeys(required: string | string[], actual: string, strict = false, clean = true, allowedMods?: string[] | readonly string[]): boolean {\n if (clean) actual = cleanKeyCombo(actual);\n const match = (req: string, actual: string): boolean => {\n req = cleanKeyCombo(req);\n if (strict) return req === actual;\n const reqs = req.split(\"+\"),\n reals = actual.split(\"+\");\n for (const mod of KEYS_CMODS) if (reals.includes(mod) && !reqs.includes(mod) && !allowedMods?.includes(mod)) return false; // no unrequested heavy mods\n return reqs.every((k) => reals.includes(k));\n };\n return Array.isArray(required) ? required.some((req) => match(req, actual)) : match(required, actual);\n}\n\n/**\n * Resolves key-combo terms against settings:\n * - override, block, whitelist, and matched action id.\n * @param combo Canonical combo string.\n * @param settings Matching settings.\n * @returns Match resolution record.\n */\nexport function getTermsForKey(combo: string, settings: KeysSettings): { override: boolean; block: boolean; whitelisted: boolean; action: string | null } {\n const terms = { override: false, block: false, whitelisted: false, action: null as string | null },\n { overrides = [], shortcuts = {}, blocks = [], strictMatch: stm = false, rankedMatch: ram = true, whitelist = [], moddedlist = [] } = settings || {};\n combo = cleanKeyCombo(combo);\n if (matchKeys(overrides, combo, stm, false)) terms.override = true;\n if (matchKeys(blocks, combo, stm, false)) terms.block = true;\n if (whitelist.some((w) => matchKeys(w, combo, false, true, moddedlist.includes(cleanKeyCombo(w)) ? KEYS_CMODS : undefined))) terms.whitelisted = true;\n if (!ram) return (terms.action = Object.keys(shortcuts).find((id) => shortcuts[id] && matchKeys(shortcuts[id], combo, stm, false, moddedlist.includes(id) ? KEYS_CMODS : undefined)) || null), terms;\n // prettier-ignore\n let bestA: string | null = null, bestE = false, bestL = 0;\n for (const id of Object.keys(shortcuts))\n for (const c of Array.isArray(shortcuts[id]) ? shortcuts[id] : [shortcuts[id]]) {\n // prettier-ignore\n const req = c && cleanKeyCombo(c), isE = req === combo, len = req ? req.split(\"+\").length : 0;\n if (c && matchKeys(req, combo, stm, false, moddedlist.includes(id) ? KEYS_CMODS : undefined) && (!bestA || (isE && !bestE) || (isE === bestE && len > bestL))) (bestA = id), (bestE = isE), (bestL = len);\n }\n return (terms.action = bestA), terms;\n}\n\n/**\n * Evaluates whether a keyboard event is allowed and maps it to an action id.\n * Behavior order:\n * 1. hard gate checks (`disabled`, focused editable, button-space/enter),\n * 2. blocked combos,\n * 3. override combos (`preventDefault`),\n * 4. shortcut action match,\n * 5. whitelist pass-through.\n * @param e Browser keyboard event.\n * @param settings Matching settings.\n * @returns Action id, pass-through key, or `false` when denied.\n */\nexport function keyEventAllowed<const S extends KeysSettings>(e: KeyboardEvent, settings: S): false | (S[\"shortcuts\"] extends object ? keyof S[\"shortcuts\"] : never) | (S[\"whitelist\"] extends readonly string[] ? (string[] extends S[\"whitelist\"] ? never : S[\"whitelist\"][number]) : never) {\n if (settings.disabled) return false;\n const activeEl = getActiveEl((e.target as Node)?.ownerDocument); // shadow DOM proof\n if ((e.key === \" \" || e.key === \"Enter\") && activeEl?.matches(\"button,input[type='button'],input[type='submit']\")) return false;\n if (e.currentTarget !== activeEl && activeEl?.matches(\"input,textarea,[contenteditable],[role]\") && !(e.key === \"Escape\" && !e.ctrlKey && !e.shiftKey && !e.altKey && !e.metaKey)) return false;\n const combo = stringifyKeyEvent(e),\n { override, block, action, whitelisted } = getTermsForKey(combo, settings);\n if (block) return false;\n if (override) e.preventDefault();\n if (action) return action as any;\n if (whitelisted) return e.key.toLowerCase() as any;\n return false;\n}\n\n/**\n * Formats one or many combos for human-readable UI labels, prepends \" \" for fluid appending.\n * @param combo Combo or combo list.\n * @param keyFn Function to format each combo.\n * @returns Display label (for example: `\" (ctrl+z) or (meta+z)\"`).\n */\nexport const formatKeyTooltip = (combo: string | string[] = \"\", keyFn = (c = \"\") => cleanKeyCombo(c).replace(\" \", \"space\")): string => {\n const combined = combo?.length ? (Array.isArray(combo) ? combo.map(keyFn).join(\" or \") : keyFn(combo)) : \"\";\n return combined ? ` (${combined})` : \"\";\n};\n\n/**\n * Formats an action-shortcuts map for display labels.\n * @param keyShortcuts Action to combo(s) map.\n * @returns Action to display-label map.\n */\nexport function formatKeyShortcutsTooltip(keyShortcuts: Record<string, string | string[]> = {}, formatter = formatKeyTooltip): Record<string, string> {\n const shortcuts: Record<string, string> = {};\n for (const action of Object.keys(keyShortcuts)) shortcuts[action] = formatter(keyShortcuts[action]);\n return shortcuts;\n}\n\n/**\n * Converts combo text into WAI-ARIA `aria-keyshortcuts` format.\n * @param s Combo text or combo list.\n * @param format Whether to format to tooltip first.\n * @returns Normalized aria-keyshortcuts string.\n * @example\n * parseForARIAKS(\" (ctrl+z) or (meta+z)\")\n * // => \"Control+z Meta+z\"\n * @example\n * parseForARIAKS([\"ctrl+z\", \"meta+z\"], false)\n * // => \"Control+z Meta+z\"\n */\nexport function parseForARIAKS(s: string | string[] = \"\", format = true) {\n const m = { ctrl: \"Control\", cmd: \"Meta\", space: \"Space\", plus: \"+\" };\n return (!format && !Array.isArray(s) ? s : formatKeyTooltip(s))\n .toLowerCase()\n .replace(/[()]/g, \"\") // 1. Remove parens\n .replace(/\\bor\\b/g, \" \") // 2. Replace \"or\" with the REQUIRED space\n .replace(/\\w+/g, (k: any) => m[k as keyof typeof m] || k) // 3. Map keys (ctrl -> Control)\n .replace(/\\s+/g, \" \")\n .trim(); // 4. Cleanup extra spaces\n} // W3 ARIA Key Shortcut\n"],"mappings":";AASO,SAAS,aAAa,OAAY,UAAgD,UAAU,MAAM,SAAS,OAAa;AAC7H,MAAI,QAAQ;AACZ,SAAO,SAAS,UAAU,OAAO,WAAW;AAC1C,eAAW,UAAU,OAAO,oBAAoB,KAAK,GAAG;AACtD,UAAI,WAAW,cAAe;AAC9B,UAAI,UAAU,WAAW,OAAO,UAAU,eAAe,KAAK,OAAO,MAAM,EAAG;AAC9E,UAAI,eAAe,OAAO,OAAO,yBAAyB,OAAO,MAAM,GAAG,MAAO,UAAS,QAAQ,KAAK;AAAA,IACzG;AACA,IAAC,QAAQ,OAAO,eAAe,KAAK,GAAK,SAAS;AAAA,EACpD;AACF;AAMO,SAAS,eAAe,OAAkB;AAC/C,eAAa,OAAO,CAAC,QAAgBA,WAAe;AAClD,IAAAA,OAAM,MA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I,MAAM,KAAK,IAAK;AACzG,SAAO,WAAW,KAAK,QAAQ,MAAM;AACvC;AAOO,SAAS,0BAA0B,eAAkD,CAAC,GAAG,YAAY,kBAA0C;AACpJ,QAAM,YAAoC,CAAC;AAC3C,aAAW,UAAU,OAAO,KAAK,YAAY,EAAG,WAAU,MAAM,IAAI,UAAU,aAAa,MAAM,CAAC;AAClG,SAAO;AACT;AAcO,SAAS,eAAe,IAAuB,IAAI,SAAS,MAAM;AACvE,QAAM,IAAI,EAAE,MAAM,WAAW,KAAK,QAAQ,OAAO,SAAS,MAAM,IAAI;AACpE,UAAQ,CAAC,UAAU,CAAC,MAAM,QAAQ,CAAC,IAAI,IAAI,iBAAiB,CAAC,GAC1D,YAAY,EACZ,QAAQ,SAAS,EAAE,EACnB,QAAQ,WAAW,GAAG,EACtB,QAAQ,QAAQ,CAAC,MAAW,EAAE,CAAmB,KAAK,CAAC,EACvD,QAAQ,QAAQ,GAAG,EACnB,KAAK;AACV;","names":["owner","combo","actual"]}
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  guardAllMethods,
3
3
  guardMethod
4
- } from "./chunk-U4SR3CZF.js";
4
+ } from "./chunk-2EAHPVH6.js";
5
5
  import {
6
6
  getPath,
7
7
  getReactor,
@@ -144,4 +144,4 @@ export {
144
144
  BaseReactorModule,
145
145
  wpArr
146
146
  };
147
- //# sourceMappingURL=chunk-3IIYJ6B4.js.map
147
+ //# sourceMappingURL=chunk-GC754LMW.js.map
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  wpArr
3
- } from "./chunk-3IIYJ6B4.js";
3
+ } from "./chunk-GC754LMW.js";
4
4
  import {
5
5
  KEYS_BLOCKS,
6
6
  createEl,
7
7
  formatKeyTooltip,
8
8
  keyEventAllowed,
9
9
  parseForARIAKS
10
- } from "./chunk-U4SR3CZF.js";
10
+ } from "./chunk-2EAHPVH6.js";
11
11
  import {
12
12
  CTX,
13
13
  NIL,
@@ -287,4 +287,4 @@ export {
287
287
  effect,
288
288
  TimeTravelConsole
289
289
  };
290
- //# sourceMappingURL=chunk-IYAWNLD2.js.map
290
+ //# sourceMappingURL=chunk-ZTUAHMMN.js.map
package/dist/modules.js CHANGED
@@ -5,8 +5,8 @@ import {
5
5
  } from "./chunk-IZK2TOJP.js";
6
6
  import {
7
7
  BaseReactorModule
8
- } from "./chunk-3IIYJ6B4.js";
9
- import "./chunk-U4SR3CZF.js";
8
+ } from "./chunk-GC754LMW.js";
9
+ import "./chunk-2EAHPVH6.js";
10
10
  import {
11
11
  CTX,
12
12
  NIL,
package/dist/super.d.ts CHANGED
@@ -1380,6 +1380,8 @@ interface KeysSettings {
1380
1380
  rankedMatch?: boolean;
1381
1381
  /** Combos that are allowed as pass-through key actions. */
1382
1382
  whitelist?: string[];
1383
+ /** Actions permitted to match base keys even when heavy modifiers are held. */
1384
+ moddedlist?: string[];
1383
1385
  }
1384
1386
  /** Canonical key-combo structure used by parser and serializer helpers. */
1385
1387
  type KeyStruct = Record<"ctrlKey" | "shiftKey" | "altKey" | "metaKey", boolean> & {
@@ -1434,7 +1436,7 @@ declare function cleanKeyCombo(combo: string[], mods?: string[]): string[];
1434
1436
  * @param clean Whether to clean the actual combo.
1435
1437
  * @returns `true` when match succeeds.
1436
1438
  */
1437
- declare function matchKeys(required: string | string[], actual: string, strict?: boolean, clean?: boolean): boolean;
1439
+ declare function matchKeys(required: string | string[], actual: string, strict?: boolean, clean?: boolean, allowedMods?: string[] | readonly string[]): boolean;
1438
1440
  /**
1439
1441
  * Resolves key-combo terms against settings:
1440
1442
  * - override, block, whitelist, and matched action id.
@@ -1291,29 +1291,29 @@ var sia = (() => {
1291
1291
  };
1292
1292
  return Array.isArray(combo) ? combo.map(clean) : clean(combo);
1293
1293
  }
1294
- function matchKeys(required, actual, strict = false, clean = true) {
1294
+ function matchKeys(required, actual, strict = false, clean = true, allowedMods) {
1295
1295
  if (clean) actual = cleanKeyCombo(actual);
1296
1296
  const match = (req, actual2) => {
1297
1297
  req = cleanKeyCombo(req);
1298
1298
  if (strict) return req === actual2;
1299
1299
  const reqs = req.split("+"), reals = actual2.split("+");
1300
- for (const mod of KEYS_CMODS) if (reals.includes(mod) && !reqs.includes(mod)) return false;
1300
+ for (const mod of KEYS_CMODS) if (reals.includes(mod) && !reqs.includes(mod) && !allowedMods?.includes(mod)) return false;
1301
1301
  return reqs.every((k) => reals.includes(k));
1302
1302
  };
1303
1303
  return Array.isArray(required) ? required.some((req) => match(req, actual)) : match(required, actual);
1304
1304
  }
1305
1305
  function getTermsForKey(combo, settings) {
1306
- const terms = { override: false, block: false, whitelisted: false, action: null }, { overrides = [], shortcuts = {}, blocks = [], strictMatch: stm = false, rankedMatch: ram = true, whitelist = [] } = settings || {};
1306
+ const terms = { override: false, block: false, whitelisted: false, action: null }, { overrides = [], shortcuts = {}, blocks = [], strictMatch: stm = false, rankedMatch: ram = true, whitelist = [], moddedlist = [] } = settings || {};
1307
1307
  combo = cleanKeyCombo(combo);
1308
1308
  if (matchKeys(overrides, combo, stm, false)) terms.override = true;
1309
1309
  if (matchKeys(blocks, combo, stm, false)) terms.block = true;
1310
- if (matchKeys(whitelist, combo, false)) terms.whitelisted = true;
1311
- if (!ram) return terms.action = Object.keys(shortcuts).find((id) => shortcuts[id] && matchKeys(shortcuts[id], combo, stm, false)) || null, terms;
1310
+ if (whitelist.some((w) => matchKeys(w, combo, false, true, moddedlist.includes(cleanKeyCombo(w)) ? KEYS_CMODS : void 0))) terms.whitelisted = true;
1311
+ 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;
1312
1312
  let bestA = null, bestE = false, bestL = 0;
1313
1313
  for (const id of Object.keys(shortcuts))
1314
1314
  for (const c of Array.isArray(shortcuts[id]) ? shortcuts[id] : [shortcuts[id]]) {
1315
1315
  const req = c && cleanKeyCombo(c), isE = req === combo, len = req ? req.split("+").length : 0;
1316
- if (c && matchKeys(req, combo, stm, false) && (!bestA || isE && !bestE || isE === bestE && len > bestL)) bestA = id, bestE = isE, bestL = len;
1316
+ 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;
1317
1317
  }
1318
1318
  return terms.action = bestA, terms;
1319
1319
  }