UNPKG

@react-querybuilder/dnd

Version:

Drag-and-drop-enabled version of react-querybuilder (DnD-library-agnostic)

1 lines 17.9 kB
{"version":3,"file":"dndLogic-Cg0Rq-DI.mjs","names":[],"sources":["../src/isHotkeyPressed.ts","../src/dndLogic.ts"],"sourcesContent":["/* oxlint-disable prefer-global-this */\n\n/**\n * Adapted from\n * https://github.com/JohannesKlauss/react-hotkeys-hook/blob/bc55a281f1d212d09de786aeb5cd236c58d9531d/src/isHotkeyPressed.ts\n * and\n * https://github.com/JohannesKlauss/react-hotkeys-hook/blob/bc55a281f1d212d09de786aeb5cd236c58d9531d/src/parseHotkey.ts\n */\n\nimport { lc } from 'react-querybuilder';\n\ntype ModifierKey = 'shift' | 'alt' | 'meta' | 'mod' | 'ctrl';\n\n// #region parseHotkey.ts\nconst reservedModifierKeywords = new Set<ModifierKey>(['shift', 'alt', 'meta', 'mod', 'ctrl']);\n\nconst mappedKeys: Record<string, string> = {\n esc: 'escape',\n return: 'enter',\n '.': 'period',\n ',': 'comma',\n '-': 'slash',\n ' ': 'space',\n '`': 'backquote',\n '#': 'backslash',\n '+': 'bracketright',\n ShiftLeft: 'shift',\n ShiftRight: 'shift',\n AltLeft: 'alt',\n AltRight: 'alt',\n MetaLeft: 'meta',\n MetaRight: 'meta',\n OSLeft: 'meta',\n OSRight: 'meta',\n ControlLeft: 'ctrl',\n ControlRight: 'ctrl',\n};\n\nconst mapKey = (key?: string) =>\n lc(((key && mappedKeys[key]) || key || '').trim()).replace(/key|digit|numpad|arrow/, '');\n\nconst isHotkeyModifier = (key: string) => reservedModifierKeywords.has(key as ModifierKey);\n// #endregion parseHotkey.ts\n\nconst keyAliases: Record<string, string> = {\n '⌘': 'meta',\n cmd: 'meta',\n command: 'meta',\n '⊞': 'meta',\n win: 'meta',\n windows: 'meta',\n '⇧': 'shift',\n '⌥': 'alt',\n '⌃': 'ctrl',\n control: 'ctrl',\n};\n\n// #region isHotkeyPressed.ts\n(() => {\n if (typeof document !== 'undefined') {\n document.addEventListener('keydown', e => {\n if (e.key === undefined) {\n // Synthetic event (e.g., Chrome autofill). Ignore.\n return;\n }\n\n pushToCurrentlyPressedKeys([mapKey(e.key), mapKey(e.code)]);\n });\n\n document.addEventListener('keyup', e => {\n if (e.key === undefined) {\n // Synthetic event (e.g., Chrome autofill). Ignore.\n return;\n }\n\n removeFromCurrentlyPressedKeys([mapKey(e.key), mapKey(e.code)]);\n });\n }\n\n if (typeof window !== 'undefined') {\n window.addEventListener('blur', () => {\n currentlyPressedKeys.clear();\n });\n }\n})();\n\nconst currentlyPressedKeys: Set<string> = new Set<string>();\n\n// https://github.com/microsoft/TypeScript/issues/17002\nconst isReadonlyArray = (value: unknown): value is readonly unknown[] => Array.isArray(value);\n\nexport const isHotkeyPressed = (key: string | readonly string[], splitKey = ','): boolean =>\n (isReadonlyArray(key) ? key : key.split(splitKey)).every(hotkey => {\n const hk = lc(hotkey.trim());\n return currentlyPressedKeys.has(keyAliases[hk] ?? hk);\n });\n\nconst pushToCurrentlyPressedKeys = (key: string | string[]) => {\n const hotkeyArray = Array.isArray(key) ? key : [key];\n\n /*\n Due to a weird behavior on macOS we need to clear the set if the user pressed down the meta key and presses another key.\n https://stackoverflow.com/questions/11818637/why-does-javascript-drop-keyup-events-when-the-metakey-is-pressed-on-mac-browser\n Otherwise the set will hold all ever pressed keys while the meta key is down which leads to wrong results.\n */\n if (currentlyPressedKeys.has('meta')) {\n for (const k of currentlyPressedKeys) {\n if (!isHotkeyModifier(k)) {\n currentlyPressedKeys.delete(lc(k));\n }\n }\n }\n\n for (const hotkey of hotkeyArray) currentlyPressedKeys.add(lc(hotkey));\n};\n\nconst removeFromCurrentlyPressedKeys = (key: string | string[]) => {\n const hotkeyArray = Array.isArray(key) ? key : [key];\n\n /*\n Due to a weird behavior on macOS we need to clear the set if the user pressed down the meta key and presses another key.\n https://stackoverflow.com/questions/11818637/why-does-javascript-drop-keyup-events-when-the-metakey-is-pressed-on-mac-browser\n Otherwise the set will hold all ever pressed keys while the meta key is down which leads to wrong results.\n */\n if (key === 'meta') {\n currentlyPressedKeys.clear();\n } else {\n for (const hotkey of hotkeyArray) currentlyPressedKeys.delete(lc(hotkey));\n }\n};\n// #endregion isHotkeyPressed.ts\n","import type {\n DndDropTargetType,\n DraggedItem,\n DropEffect,\n DropResult,\n Path,\n QueryActions,\n RuleGroupTypeAny,\n RuleType,\n Schema,\n} from 'react-querybuilder';\nimport {\n add,\n findPath,\n getParentPath,\n group,\n insert,\n isAncestor,\n pathsAreEqual,\n} from 'react-querybuilder';\nimport { isHotkeyPressed } from './isHotkeyPressed';\nimport type { CustomCanDropParams, OnRuleDropCallback } from './types';\n\n// #region canDrop validators\n\n/**\n * Determines whether a drag item can be dropped on a rule target.\n */\nexport const canDropOnRule = ({\n dragging,\n path,\n schema,\n canDrop,\n groupModeModifierKey,\n disabled,\n rule,\n}: {\n dragging: DraggedItem;\n path: Path;\n // oxlint-disable-next-line typescript/no-explicit-any\n schema: Schema<any, any>;\n canDrop?: (params: CustomCanDropParams) => boolean;\n groupModeModifierKey: string;\n disabled: boolean;\n rule: RuleType;\n}): boolean => {\n if (\n (isHotkeyPressed(groupModeModifierKey) && disabled) ||\n (dragging &&\n typeof canDrop === 'function' &&\n !canDrop({ dragging, hovering: { ...rule, path, qbId: schema.qbId } }))\n ) {\n return false;\n }\n\n if (schema.qbId !== dragging.qbId) return true;\n\n const parentHoverPath = getParentPath(path);\n const parentItemPath = getParentPath(dragging.path);\n const hoverIndex = path.at(-1);\n const itemIndex = dragging.path.at(-1)!;\n\n // Disallow drop if...\n // prettier-ignore\n return !(\n // 1) item is ancestor of drop target, OR\n isAncestor(dragging.path, path) ||\n // 2) item is hovered over itself, OR\n (pathsAreEqual(path, dragging.path)) ||\n // 3) item is hovered over the previous item AND this is a move, not a group\n (!isHotkeyPressed(groupModeModifierKey) && pathsAreEqual(parentHoverPath, parentItemPath) &&\n (hoverIndex === itemIndex - 1 ||\n (schema.independentCombinators && hoverIndex === itemIndex - 2)))\n );\n};\n\n/**\n * Determines whether a drag item can be dropped on a rule group target.\n */\nexport const canDropOnRuleGroup = ({\n dragging,\n path,\n schema,\n canDrop,\n disabled,\n ruleGroup,\n}: {\n dragging: DraggedItem;\n path: Path;\n // oxlint-disable-next-line typescript/no-explicit-any\n schema: Schema<any, any>;\n canDrop?: (params: CustomCanDropParams) => boolean;\n disabled: boolean;\n ruleGroup: RuleGroupTypeAny;\n}): boolean => {\n if (\n disabled ||\n (dragging &&\n typeof canDrop === 'function' &&\n !canDrop({ dragging, hovering: { ...ruleGroup, path, qbId: schema.qbId } }))\n ) {\n return false;\n }\n\n if (schema.qbId !== dragging.qbId) return true;\n\n const parentItemPath = getParentPath(dragging.path);\n const itemIndex = dragging.path.at(-1);\n // Disallow drop if...\n // prettier-ignore\n return !(\n // 1) item is ancestor of drop target, OR\n isAncestor(dragging.path, path) ||\n // 2) item is first child and is dropped on its own group header, OR\n (pathsAreEqual(path, parentItemPath) && itemIndex === 0) ||\n // 3) the group is dropped on itself\n pathsAreEqual(path, dragging.path)\n );\n};\n\n/**\n * Determines whether a drag item can be dropped on an inline combinator target.\n */\nexport const canDropOnInlineCombinator = ({\n dragging,\n path,\n schema,\n canDrop,\n groupModeModifierKey,\n hoveringItem,\n}: {\n dragging: DraggedItem;\n path: Path;\n // oxlint-disable-next-line typescript/no-explicit-any\n schema: Schema<any, any>;\n canDrop?: (params: CustomCanDropParams) => boolean;\n groupModeModifierKey: string;\n hoveringItem: RuleType | RuleGroupTypeAny;\n}): boolean => {\n const { path: itemPath } = dragging;\n if (\n isHotkeyPressed(groupModeModifierKey) ||\n (dragging &&\n typeof canDrop === 'function' &&\n !canDrop({ dragging, hovering: { ...hoveringItem, path, qbId: schema.qbId } }))\n ) {\n return false;\n }\n const parentHoverPath = getParentPath(path);\n const parentItemPath = getParentPath(itemPath);\n const hoverIndex = path.at(-1)!;\n const itemIndex = itemPath.at(-1)!;\n\n // Disallow drop if...\n // prettier-ignore\n return !(\n // 1) the item is an ancestor of the drop target,\n isAncestor(itemPath, path) ||\n // 2) the item is hovered over itself (which should never\n // happen since combinators don't have drag handles),\n pathsAreEqual(itemPath, path) ||\n (pathsAreEqual(parentHoverPath, parentItemPath) && hoverIndex - 1 === itemIndex) ||\n // 3) independentCombinators is true and the drop target is just above the hovering item\n (schema.independentCombinators &&\n pathsAreEqual(parentHoverPath, parentItemPath) &&\n hoverIndex === itemIndex - 1)\n );\n};\n\n// #endregion\n\n// #region Drop result builders\n\n/**\n * Builds a {@link DropResult} for a given target.\n */\nexport const buildDropResult = ({\n type,\n path,\n schema,\n copyModeModifierKey,\n groupModeModifierKey,\n copyModeOverride,\n groupModeOverride,\n}: {\n type: DndDropTargetType;\n path: Path;\n // oxlint-disable-next-line typescript/no-explicit-any\n schema: Schema<any, any>;\n copyModeModifierKey: string;\n groupModeModifierKey: string;\n copyModeOverride?: boolean;\n groupModeOverride?: boolean;\n}): DropResult => {\n const { qbId, getQuery, dispatchQuery } = schema;\n return {\n type,\n path,\n qbId,\n getQuery,\n dispatchQuery,\n groupItems: groupModeOverride || isHotkeyPressed(groupModeModifierKey),\n dropEffect: copyModeOverride || isHotkeyPressed(copyModeModifierKey) ? 'copy' : 'move',\n };\n};\n\n/**\n * Collects the current drop state from modifier keys.\n */\nexport const collectDropState = (\n copyModeModifierKey: string,\n groupModeModifierKey: string,\n copyModeOverride?: boolean,\n groupModeOverride?: boolean\n): { dropEffect: DropEffect; groupItems: boolean } => ({\n dropEffect: copyModeOverride || isHotkeyPressed(copyModeModifierKey) ? 'copy' : 'move',\n groupItems: groupModeOverride || isHotkeyPressed(groupModeModifierKey),\n});\n\n// #endregion\n\n// #region Drop handling\n\n/**\n * Computes the destination path for a drop operation based on the drop target\n * type and whether grouping mode is active.\n */\nexport const getDestinationPath = (dropResult: DropResult, groupItems: boolean): Path => {\n const parentHoverPath = getParentPath(dropResult.path);\n const hoverIndex = dropResult.path.at(-1)!;\n\n if (groupItems) {\n return dropResult.path;\n }\n if (dropResult.type === 'ruleGroup') {\n return [...dropResult.path, 0];\n }\n if (dropResult.type === 'inlineCombinator') {\n return [...parentHoverPath, hoverIndex];\n }\n // rule\n return [...parentHoverPath, hoverIndex + 1];\n};\n\n/**\n * Handles the actual query mutation when a drop completes.\n * Supports move, copy, group, and cross-query-builder operations.\n */\nexport const handleDrop = ({\n item,\n dropResult,\n schema,\n actions,\n copyModeModifierKey,\n groupModeModifierKey,\n copyModeOverride,\n groupModeOverride,\n onRuleDrop,\n}: {\n item: DraggedItem;\n dropResult: DropResult | null;\n // oxlint-disable-next-line typescript/no-explicit-any\n schema: Schema<any, any>;\n actions: QueryActions;\n copyModeModifierKey: string;\n groupModeModifierKey: string;\n copyModeOverride?: boolean;\n groupModeOverride?: boolean;\n onRuleDrop?: OnRuleDropCallback;\n}): void => {\n if (!dropResult) return;\n\n const dropEffect = copyModeOverride || isHotkeyPressed(copyModeModifierKey) ? 'copy' : 'move';\n const groupItems = groupModeOverride || isHotkeyPressed(groupModeModifierKey);\n const destinationPath = getDestinationPath(dropResult, groupItems);\n const isCrossBuilder = schema.qbId !== dropResult.qbId;\n\n if (!isCrossBuilder) {\n if (groupItems) {\n actions.groupRule(item.path, destinationPath, dropEffect === 'copy');\n } else {\n actions.moveRule(item.path, destinationPath, dropEffect === 'copy');\n }\n } else {\n const otherBuilderQuery = dropResult.getQuery();\n // v8 ignore else\n if (otherBuilderQuery) {\n if (groupItems) {\n dropResult.dispatchQuery(\n group(\n add(otherBuilderQuery, item, []),\n [otherBuilderQuery.rules.length],\n destinationPath,\n { clone: false }\n )\n );\n } else {\n dropResult.dispatchQuery(insert(otherBuilderQuery, item, destinationPath));\n }\n // v8 ignore else\n if (dropEffect !== 'copy') {\n actions.onRuleRemove(item.path);\n }\n }\n }\n\n onRuleDrop?.({\n draggedItem: item,\n sourceQbId: schema.qbId,\n targetQbId: dropResult.qbId,\n sourcePath: item.path,\n targetPath: destinationPath,\n dropEffect: dropEffect as DropEffect,\n groupItems,\n isCrossBuilder,\n });\n};\n\n/**\n * Creates the drag item from the current path and schema, used by\n * drag-start callbacks.\n */\nexport const getDragItem = (\n path: Path,\n // oxlint-disable-next-line typescript/no-explicit-any\n schema: Schema<any, any>\n): DraggedItem => ({\n ...findPath(path, schema.getQuery())!,\n path,\n qbId: schema.qbId,\n});\n\n// #endregion\n"],"mappings":";;;;;;;;AAcA,MAAM,2BAA2B,IAAI,IAAiB;CAAC;CAAS;CAAO;CAAQ;CAAO;AAAM,CAAC;AAE7F,MAAM,aAAqC;CACzC,KAAK;CACL,QAAQ;CACR,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,WAAW;CACX,YAAY;CACZ,SAAS;CACT,UAAU;CACV,UAAU;CACV,WAAW;CACX,QAAQ;CACR,SAAS;CACT,aAAa;CACb,cAAc;AAChB;AAEA,MAAM,UAAU,QACd,IAAK,OAAO,WAAW,QAAS,OAAO,GAAA,CAAI,KAAK,CAAC,CAAC,CAAC,QAAQ,0BAA0B,EAAE;AAEzF,MAAM,oBAAoB,QAAgB,yBAAyB,IAAI,GAAkB;AAGzF,MAAM,aAAqC;CACzC,KAAK;CACL,KAAK;CACL,SAAS;CACT,KAAK;CACL,KAAK;CACL,SAAS;CACT,KAAK;CACL,KAAK;CACL,KAAK;CACL,SAAS;AACX;OAGO;CACL,IAAI,OAAO,aAAa,aAAa;EACnC,SAAS,iBAAiB,YAAW,MAAK;GACxC,IAAI,EAAE,QAAQ,KAAA,GAEZ;GAGF,2BAA2B,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO,EAAE,IAAI,CAAC,CAAC;EAC5D,CAAC;EAED,SAAS,iBAAiB,UAAS,MAAK;GACtC,IAAI,EAAE,QAAQ,KAAA,GAEZ;GAGF,+BAA+B,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO,EAAE,IAAI,CAAC,CAAC;EAChE,CAAC;CACH;CAEA,IAAI,OAAO,WAAW,aACpB,OAAO,iBAAiB,cAAc;EACpC,qB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