@weasel-js/routing 1.15.0 → 1.15.1

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.
@@ -1,4 +1,4 @@
1
- import { NO_OVERRIDES, resolveParams, formatRoute, overriddenBindings, ActionDisabledReason, keySpecShortcut, actionBindings, canonicalModifiers, paramsMatch, VALID_MOD_NAMES, actionCursor, buildDepsFromRequires, resolveRoles, roleKeysOf, platformRoleKeys } from './chunk-A6MN3I6R.js';
1
+ import { NO_OVERRIDES, resolveParams, formatRoute, overriddenBindings, ActionDisabledReason, keySpecShortcut, actionBindings, canonicalModifiers, paramsMatch, VALID_MOD_NAMES, actionCursor, buildDepsFromRequires, resolveRoles, roleKeysOf, platformRoleKeys } from './chunk-Z2BZBJ7W.js';
2
2
  import { routeGestureForSpecKind, getGestureDescriptor, parseTargetSpec, matchSpec, UNKNOWN_MIME, specificity, formatShortcut, stylusOf } from '@weasel-js/gestures';
3
3
  export { GESTURE_DESCRIPTORS, LONG_PRESS_MS, activatesFocusedControl, focusedControlOwnsKey, getGestureDescriptor, isEditableTarget, isKnownGestureName, matchKey, matchModifiers, matchPhase, matchSpec, matchTarget, routeGestureForSpecKind, specKindForRouteGesture, specificity } from '@weasel-js/gestures';
4
4
  import { isDev } from '@weasel-js/react';
@@ -2197,7 +2197,7 @@ function findConflictsKeyed(entries, rules, modes = KIT_MODES) {
2197
2197
  const conflicts = /* @__PURE__ */ new Map();
2198
2198
  for (const { base, platform, members } of groups.values()) {
2199
2199
  const ties = (e, i, f, j) => i !== j && !(i < j ? e : f).yields && tie(e, f);
2200
- const bucket = members.filter((e, i) => members.some((f, j) => ties(e, i, f, j)));
2200
+ const bucket = foldPlatformCopies(members.filter((e, i) => members.some((f, j) => ties(e, i, f, j))));
2201
2201
  if (bucket.length < 2) continue;
2202
2202
  const first = bucket[0];
2203
2203
  const key = `${base}|${bucket.map((e) => `${objectId(e.spec)}:${canonicalModifiers(e.modifiers)}`).join(";")}`;
@@ -2221,6 +2221,18 @@ function findConflictsKeyed(entries, rules, modes = KIT_MODES) {
2221
2221
  }
2222
2222
  return [...conflicts].filter(([, c]) => c.platforms.size === PLATFORMS.length || !sameOutcome(c.bucket)).map(([key, { conflict }]) => ({ key, conflict }));
2223
2223
  }
2224
+ function platformBound(e) {
2225
+ return modifierTieKeys(e, "mac").join() !== modifierTieKeys(e, "other").join();
2226
+ }
2227
+ function foldPlatformCopies(bucket) {
2228
+ const out = [];
2229
+ for (const e of bucket) {
2230
+ const i = out.findIndex((k) => sameOutcome([k, e]) && (platformBound(k) || platformBound(e)));
2231
+ if (i === -1) out.push(e);
2232
+ else if (platformBound(out[i])) out[i] = e;
2233
+ }
2234
+ return out;
2235
+ }
2224
2236
  function rulesCanHoldTogether(a, b, modes) {
2225
2237
  if (rulesExclusive(a, b)) return false;
2226
2238
  return modes.some((m) => ruleCanHoldIn(a, m) && ruleCanHoldIn(b, m));
@@ -2455,5 +2467,5 @@ function dwarn(namespace, ...args) {
2455
2467
  }
2456
2468
 
2457
2469
  export { ALWAYS, COARSE_TARGET_SCALE, DEFAULT_ALLOWED_CAPABILITIES, DEFAULT_DEVICE_PROFILE, INGEST_STRING_MIMES, KEYMAP_HOLD, LONG_PRESS_HAPTIC_MS, NEVER, PREDICATE_TARGET, TOOL_OFFHAND_ID, addCarrySurface, admitIngestMime, anyBinding, assembleEntries, buildRouteRegistry, buildRuleCtx, buildToolOffhandBindings, carryGestureId, clientToCanvas, clientToCanvasRect, createDispatchTrace, createDispatcher, createKeymapStack, createLongPressStore, createTraceRing, describeKeymap, describeRule, dlog, dwarn, evaluate, findConflicts, heldKeySpec, historyKey, immediateParams, isDebugEnabled, isTool, itemTypesFromDataTransfer, itemsFromClipboardData, itemsFromDataTransfer, itemsFromFiles, keymapContribution, keymapLeaderBindingId, keymapLeaderId, keymapShortcuts, liveScope, makeToolOffhandAction, matchBest, matchSorted, matchSortedWithBarred, matchesKeyBinding, modifierStateOf, multiTouchGestureId, offhandKeyFor, openPointerSession, pendingKindOf, pointerGestureId, reportRouteConflicts, resolveDeviceProfile, routesForSpec, ruleCanHoldIn, rulesExclusive, scopeBindings, startCarry, targetConsultsAffordance };
2458
- //# sourceMappingURL=chunk-ZK72IBMI.js.map
2459
- //# sourceMappingURL=chunk-ZK72IBMI.js.map
2470
+ //# sourceMappingURL=chunk-ZUAFANMN.js.map
2471
+ //# sourceMappingURL=chunk-ZUAFANMN.js.map