bugfix: utils file
This commit is contained in:
+1
-1
@@ -58,7 +58,7 @@ export const baseConfig = ({ mainFile = pkg.main, moduleFile = pkg.module, injec
|
|||||||
babel({
|
babel({
|
||||||
extensions: [...DEFAULT_BABEL_EXTENSIONS, '.ts', '.tsx'],
|
extensions: [...DEFAULT_BABEL_EXTENSIONS, '.ts', '.tsx'],
|
||||||
exclude: 'node_modules/**',
|
exclude: 'node_modules/**',
|
||||||
babelHelpers: 'inline'
|
babelHelpers: 'bundled'
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|||||||
+3
-3
@@ -1,9 +1,9 @@
|
|||||||
import { Dimensions, XYPosition, NodeExtent } from '../types';
|
import { Dimensions, XYPosition, NodeExtent } from '../types';
|
||||||
|
|
||||||
export const isInputDOMNode = (e: MouseEvent | /* DraggableEvent | */ KeyboardEvent): boolean => {
|
export const isInputDOMNode = (e: MouseEvent | /* DraggableEvent | */ KeyboardEvent): boolean => {
|
||||||
const target = e?.target as HTMLElement;
|
const target = e.target as HTMLElement;
|
||||||
|
|
||||||
return ['INPUT', 'SELECT', 'TEXTAREA', 'BUTTON'].includes(target?.nodeName) || target?.hasAttribute('contenteditable');
|
return ['INPUT', 'SELECT', 'TEXTAREA', 'BUTTON'].includes(target?.nodeName) || target.hasAttribute('contenteditable');
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getDimensions = (node: HTMLDivElement): Dimensions => ({
|
export const getDimensions = (node: HTMLDivElement): Dimensions => ({
|
||||||
@@ -19,4 +19,4 @@ export const clampPosition = (position: XYPosition, extent: NodeExtent) => ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
export const getHostForElement = (element: HTMLElement): Document | ShadowRoot =>
|
export const getHostForElement = (element: HTMLElement): Document | ShadowRoot =>
|
||||||
(element.getRootNode?.() as Document | ShadowRoot) || window?.document;
|
(element.getRootNode() as Document | ShadowRoot) || window.document;
|
||||||
|
|||||||
Reference in New Issue
Block a user