Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | 1x 1x 22x 11x | import type { GetSourceFunction, GetSourceInputParams } from './getDocumentSource';
const ShadowWorkbookClipboardType = 'web data/shadow-workbook';
/**
* @internal
* When the clipboard content is retrieved programatically, the clipboard html does not contain the usual
* attributes we use to determine if the content is from Excel. This function is used to handle that case.
*/
export const isExcelNotNativeEvent: GetSourceFunction = (props: GetSourceInputParams) => {
const { clipboardItemTypes, htmlFirstLevelChildTags } = props;
return !!(
clipboardItemTypes &&
clipboardItemTypes.includes(ShadowWorkbookClipboardType) &&
htmlFirstLevelChildTags?.length == 1 &&
htmlFirstLevelChildTags[0] == 'TABLE'
);
};
|