feat: publish HoloLake model-native living system source
This commit is contained in:
parent
6ad10edde1
commit
c395dd3a99
2467 changed files with 615073 additions and 0 deletions
|
|
@ -0,0 +1,32 @@
|
|||
import type { InlineSelectionRange } from './inlineWikilinkDom'
|
||||
import { replaceInlineSelection } from './inlineWikilinkEdits'
|
||||
|
||||
export interface PendingPasteState {
|
||||
duplicatedValue: string
|
||||
expectedValue: string
|
||||
expectedSelection: InlineSelectionRange
|
||||
}
|
||||
|
||||
export function buildPendingPasteState(
|
||||
value: string,
|
||||
selectionRange: InlineSelectionRange,
|
||||
pastedText: string,
|
||||
): PendingPasteState {
|
||||
const nextState = replaceInlineSelection(value, selectionRange, pastedText)
|
||||
|
||||
return {
|
||||
duplicatedValue: replaceInlineSelection(nextState.value, nextState.selection, pastedText).value,
|
||||
expectedValue: nextState.value,
|
||||
expectedSelection: nextState.selection,
|
||||
}
|
||||
}
|
||||
|
||||
export function shouldRecoverPendingPaste(
|
||||
nextValue: string,
|
||||
pendingPaste: PendingPasteState,
|
||||
): boolean {
|
||||
return (
|
||||
nextValue === pendingPaste.expectedValue ||
|
||||
nextValue === pendingPaste.duplicatedValue
|
||||
)
|
||||
}
|
||||
Loading…
Reference in a new issue