2022-02-25 01:59:06 +01:00
|
|
|
// Copyright: Ankitects Pty Ltd and contributors
|
|
|
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
|
|
|
|
|
|
import { getRange, getSelection } from "../lib/cross-browser";
|
|
|
|
import { on } from "../lib/events";
|
2022-09-10 10:46:59 +02:00
|
|
|
import { isArrowDown, isArrowLeft, isArrowRight, isArrowUp } from "../lib/keys";
|
|
|
|
import { singleCallback } from "../lib/typing";
|
2022-02-25 01:59:06 +01:00
|
|
|
import { HandlerList } from "./handler-list";
|
|
|
|
|
|
|
|
const nbsp = "\xa0";
|
|
|
|
|
|
|
|
export type SetupInputHandlerAction = (element: HTMLElement) => { destroy(): void };
|
|
|
|
|
|
|
|
export interface InputEventParams {
|
|
|
|
event: InputEvent;
|
|
|
|
}
|
2022-09-10 10:46:59 +02:00
|
|
|
|
Fuzzy search in symbol insertion overlay (#2059)
* Add flag for enabling insert symbols feature
* Add symbols overlay directory
* Detect if :xy is inserted into editable
* Allow naive updating of overlay, and special handling of ':'
* First step towards better Virtual Element support
* Update floating to reference range on insert text
* Position SymbolsOverlay always on top or bottom
* Add a data-provider to emulate API
* Show correct suggestions in symbols overlay
* Rename to replacementLength
* Allow replacing via clicking in menu
* Optionally remove inline padding of Popover
* Hide Symbols overlay on blur of content editable
* Add specialKey to inputHandler and generalize how arrow movement is detected
- This way macOS users can use Ctrl-N to mean down, etc.
* Detect special key from within SymbolsOverlay
* Implement full backwards search while typing
* Allow navigating symbol menu and accepting with enter
* Add some entries to data-provider
* Satisfy eslint
* Generate symbolsTable from sources
* Use other github source, allow multiple names
In return, symbol must be unique
* Automatically scroll in symbols dropdown
* Use from npm packages rather than downloading from URL
* Remove console.log
* Remove print
Co-authored-by: Damien Elmes <dae@users.noreply.github.com>
* Add pointerDown event to input-handler
- so that SymbolsOverlay can reset on field click
* Make tab do the same as enter
* Make font a bit smaller but increase relative icon size
* Satisfy type requirement of handlerlist
* Revert changing default size of DropdownItems
* Remove some now unused code for bootstrap dropdowns
* Use fuse to allow fuzzy searching of symbols
* Remove unnecessary async handling in data-provider
I did that because at first I was still expecting to fetch the symbols
from the backend
* Apply field font family in symbol preview
* Remove inline padding from latex popover
* Rename data-provier to symbols-table
* Add some explaining comments to interface
* Allow for auto insertion symbols
* Use deleteData and after instead of replaceData
* Allow using html in symbols
* Show html symbols as html
* Add SymbolsEntry component
* Also include containshtml at low search precedence
* Put character entities and gemoji into their own files
* Factor out prepareInsertion method
* Allow deletion while searching for correct symbol
* Respect insertCompositionText
* Delete data-provider
* Restrict auto insert queries to max 5 characters
* Satisfy svelte check
* Fix the overlay sometimes not showing
This will make sure to always normalize text nodes before searching.
However it adjacent text is partially formatted, this will still not
find the whole query.
For example, currently, entering `<b>:for</b>al` and then inputting `l`,
will not trigger a search for `forall`, because of the <b> formatting
* Add empty line
* Do not trigger overlay, when last character is whitespace or colon
* Add missing fuse license
2022-09-13 06:19:19 +02:00
|
|
|
export interface EventParams {
|
|
|
|
event: Event;
|
|
|
|
}
|
|
|
|
|
2022-02-25 01:59:06 +01:00
|
|
|
export interface InsertTextParams {
|
|
|
|
event: InputEvent;
|
|
|
|
text: Text;
|
|
|
|
}
|
|
|
|
|
2022-09-10 10:46:59 +02:00
|
|
|
type SpecialKeyAction =
|
|
|
|
| "caretUp"
|
|
|
|
| "caretDown"
|
|
|
|
| "caretLeft"
|
|
|
|
| "caretRight"
|
|
|
|
| "enter"
|
|
|
|
| "tab";
|
|
|
|
|
|
|
|
export interface SpecialKeyParams {
|
|
|
|
event: KeyboardEvent;
|
|
|
|
action: SpecialKeyAction;
|
|
|
|
}
|
|
|
|
|
2022-02-25 01:59:06 +01:00
|
|
|
export interface InputHandlerAPI {
|
|
|
|
readonly beforeInput: HandlerList<InputEventParams>;
|
|
|
|
readonly insertText: HandlerList<InsertTextParams>;
|
Fuzzy search in symbol insertion overlay (#2059)
* Add flag for enabling insert symbols feature
* Add symbols overlay directory
* Detect if :xy is inserted into editable
* Allow naive updating of overlay, and special handling of ':'
* First step towards better Virtual Element support
* Update floating to reference range on insert text
* Position SymbolsOverlay always on top or bottom
* Add a data-provider to emulate API
* Show correct suggestions in symbols overlay
* Rename to replacementLength
* Allow replacing via clicking in menu
* Optionally remove inline padding of Popover
* Hide Symbols overlay on blur of content editable
* Add specialKey to inputHandler and generalize how arrow movement is detected
- This way macOS users can use Ctrl-N to mean down, etc.
* Detect special key from within SymbolsOverlay
* Implement full backwards search while typing
* Allow navigating symbol menu and accepting with enter
* Add some entries to data-provider
* Satisfy eslint
* Generate symbolsTable from sources
* Use other github source, allow multiple names
In return, symbol must be unique
* Automatically scroll in symbols dropdown
* Use from npm packages rather than downloading from URL
* Remove console.log
* Remove print
Co-authored-by: Damien Elmes <dae@users.noreply.github.com>
* Add pointerDown event to input-handler
- so that SymbolsOverlay can reset on field click
* Make tab do the same as enter
* Make font a bit smaller but increase relative icon size
* Satisfy type requirement of handlerlist
* Revert changing default size of DropdownItems
* Remove some now unused code for bootstrap dropdowns
* Use fuse to allow fuzzy searching of symbols
* Remove unnecessary async handling in data-provider
I did that because at first I was still expecting to fetch the symbols
from the backend
* Apply field font family in symbol preview
* Remove inline padding from latex popover
* Rename data-provier to symbols-table
* Add some explaining comments to interface
* Allow for auto insertion symbols
* Use deleteData and after instead of replaceData
* Allow using html in symbols
* Show html symbols as html
* Add SymbolsEntry component
* Also include containshtml at low search precedence
* Put character entities and gemoji into their own files
* Factor out prepareInsertion method
* Allow deletion while searching for correct symbol
* Respect insertCompositionText
* Delete data-provider
* Restrict auto insert queries to max 5 characters
* Satisfy svelte check
* Fix the overlay sometimes not showing
This will make sure to always normalize text nodes before searching.
However it adjacent text is partially formatted, this will still not
find the whole query.
For example, currently, entering `<b>:for</b>al` and then inputting `l`,
will not trigger a search for `forall`, because of the <b> formatting
* Add empty line
* Do not trigger overlay, when last character is whitespace or colon
* Add missing fuse license
2022-09-13 06:19:19 +02:00
|
|
|
readonly afterInput: HandlerList<EventParams>;
|
2022-09-10 10:46:59 +02:00
|
|
|
readonly pointerDown: HandlerList<{ event: PointerEvent }>;
|
|
|
|
readonly specialKey: HandlerList<SpecialKeyParams>;
|
2022-02-25 01:59:06 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* An interface that allows Svelte components to attach event listeners via triggers.
|
|
|
|
* They will be attached to the component(s) that install the manager.
|
|
|
|
* Prevents that too many event listeners are attached and allows for some
|
|
|
|
* coordination between them.
|
|
|
|
*/
|
|
|
|
function useInputHandler(): [InputHandlerAPI, SetupInputHandlerAction] {
|
|
|
|
const beforeInput = new HandlerList<InputEventParams>();
|
|
|
|
const insertText = new HandlerList<InsertTextParams>();
|
Fuzzy search in symbol insertion overlay (#2059)
* Add flag for enabling insert symbols feature
* Add symbols overlay directory
* Detect if :xy is inserted into editable
* Allow naive updating of overlay, and special handling of ':'
* First step towards better Virtual Element support
* Update floating to reference range on insert text
* Position SymbolsOverlay always on top or bottom
* Add a data-provider to emulate API
* Show correct suggestions in symbols overlay
* Rename to replacementLength
* Allow replacing via clicking in menu
* Optionally remove inline padding of Popover
* Hide Symbols overlay on blur of content editable
* Add specialKey to inputHandler and generalize how arrow movement is detected
- This way macOS users can use Ctrl-N to mean down, etc.
* Detect special key from within SymbolsOverlay
* Implement full backwards search while typing
* Allow navigating symbol menu and accepting with enter
* Add some entries to data-provider
* Satisfy eslint
* Generate symbolsTable from sources
* Use other github source, allow multiple names
In return, symbol must be unique
* Automatically scroll in symbols dropdown
* Use from npm packages rather than downloading from URL
* Remove console.log
* Remove print
Co-authored-by: Damien Elmes <dae@users.noreply.github.com>
* Add pointerDown event to input-handler
- so that SymbolsOverlay can reset on field click
* Make tab do the same as enter
* Make font a bit smaller but increase relative icon size
* Satisfy type requirement of handlerlist
* Revert changing default size of DropdownItems
* Remove some now unused code for bootstrap dropdowns
* Use fuse to allow fuzzy searching of symbols
* Remove unnecessary async handling in data-provider
I did that because at first I was still expecting to fetch the symbols
from the backend
* Apply field font family in symbol preview
* Remove inline padding from latex popover
* Rename data-provier to symbols-table
* Add some explaining comments to interface
* Allow for auto insertion symbols
* Use deleteData and after instead of replaceData
* Allow using html in symbols
* Show html symbols as html
* Add SymbolsEntry component
* Also include containshtml at low search precedence
* Put character entities and gemoji into their own files
* Factor out prepareInsertion method
* Allow deletion while searching for correct symbol
* Respect insertCompositionText
* Delete data-provider
* Restrict auto insert queries to max 5 characters
* Satisfy svelte check
* Fix the overlay sometimes not showing
This will make sure to always normalize text nodes before searching.
However it adjacent text is partially formatted, this will still not
find the whole query.
For example, currently, entering `<b>:for</b>al` and then inputting `l`,
will not trigger a search for `forall`, because of the <b> formatting
* Add empty line
* Do not trigger overlay, when last character is whitespace or colon
* Add missing fuse license
2022-09-13 06:19:19 +02:00
|
|
|
const afterInput = new HandlerList<EventParams>();
|
2022-02-25 01:59:06 +01:00
|
|
|
|
|
|
|
async function onBeforeInput(this: Element, event: InputEvent): Promise<void> {
|
|
|
|
const selection = getSelection(this)!;
|
|
|
|
const range = getRange(selection);
|
|
|
|
|
|
|
|
await beforeInput.dispatch({ event });
|
|
|
|
|
Fuzzy search in symbol insertion overlay (#2059)
* Add flag for enabling insert symbols feature
* Add symbols overlay directory
* Detect if :xy is inserted into editable
* Allow naive updating of overlay, and special handling of ':'
* First step towards better Virtual Element support
* Update floating to reference range on insert text
* Position SymbolsOverlay always on top or bottom
* Add a data-provider to emulate API
* Show correct suggestions in symbols overlay
* Rename to replacementLength
* Allow replacing via clicking in menu
* Optionally remove inline padding of Popover
* Hide Symbols overlay on blur of content editable
* Add specialKey to inputHandler and generalize how arrow movement is detected
- This way macOS users can use Ctrl-N to mean down, etc.
* Detect special key from within SymbolsOverlay
* Implement full backwards search while typing
* Allow navigating symbol menu and accepting with enter
* Add some entries to data-provider
* Satisfy eslint
* Generate symbolsTable from sources
* Use other github source, allow multiple names
In return, symbol must be unique
* Automatically scroll in symbols dropdown
* Use from npm packages rather than downloading from URL
* Remove console.log
* Remove print
Co-authored-by: Damien Elmes <dae@users.noreply.github.com>
* Add pointerDown event to input-handler
- so that SymbolsOverlay can reset on field click
* Make tab do the same as enter
* Make font a bit smaller but increase relative icon size
* Satisfy type requirement of handlerlist
* Revert changing default size of DropdownItems
* Remove some now unused code for bootstrap dropdowns
* Use fuse to allow fuzzy searching of symbols
* Remove unnecessary async handling in data-provider
I did that because at first I was still expecting to fetch the symbols
from the backend
* Apply field font family in symbol preview
* Remove inline padding from latex popover
* Rename data-provier to symbols-table
* Add some explaining comments to interface
* Allow for auto insertion symbols
* Use deleteData and after instead of replaceData
* Allow using html in symbols
* Show html symbols as html
* Add SymbolsEntry component
* Also include containshtml at low search precedence
* Put character entities and gemoji into their own files
* Factor out prepareInsertion method
* Allow deletion while searching for correct symbol
* Respect insertCompositionText
* Delete data-provider
* Restrict auto insert queries to max 5 characters
* Satisfy svelte check
* Fix the overlay sometimes not showing
This will make sure to always normalize text nodes before searching.
However it adjacent text is partially formatted, this will still not
find the whole query.
For example, currently, entering `<b>:for</b>al` and then inputting `l`,
will not trigger a search for `forall`, because of the <b> formatting
* Add empty line
* Do not trigger overlay, when last character is whitespace or colon
* Add missing fuse license
2022-09-13 06:19:19 +02:00
|
|
|
if (
|
|
|
|
!range ||
|
|
|
|
!event.inputType.startsWith("insert") ||
|
|
|
|
insertText.length === 0
|
|
|
|
) {
|
2022-02-25 01:59:06 +01:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
event.preventDefault();
|
|
|
|
|
|
|
|
const content = !event.data || event.data === " " ? nbsp : event.data;
|
|
|
|
const text = new Text(content);
|
|
|
|
|
|
|
|
range.deleteContents();
|
|
|
|
range.insertNode(text);
|
|
|
|
range.selectNode(text);
|
|
|
|
range.collapse(false);
|
|
|
|
|
|
|
|
await insertText.dispatch({ event, text });
|
|
|
|
|
|
|
|
range.commonAncestorContainer.normalize();
|
Fuzzy search in symbol insertion overlay (#2059)
* Add flag for enabling insert symbols feature
* Add symbols overlay directory
* Detect if :xy is inserted into editable
* Allow naive updating of overlay, and special handling of ':'
* First step towards better Virtual Element support
* Update floating to reference range on insert text
* Position SymbolsOverlay always on top or bottom
* Add a data-provider to emulate API
* Show correct suggestions in symbols overlay
* Rename to replacementLength
* Allow replacing via clicking in menu
* Optionally remove inline padding of Popover
* Hide Symbols overlay on blur of content editable
* Add specialKey to inputHandler and generalize how arrow movement is detected
- This way macOS users can use Ctrl-N to mean down, etc.
* Detect special key from within SymbolsOverlay
* Implement full backwards search while typing
* Allow navigating symbol menu and accepting with enter
* Add some entries to data-provider
* Satisfy eslint
* Generate symbolsTable from sources
* Use other github source, allow multiple names
In return, symbol must be unique
* Automatically scroll in symbols dropdown
* Use from npm packages rather than downloading from URL
* Remove console.log
* Remove print
Co-authored-by: Damien Elmes <dae@users.noreply.github.com>
* Add pointerDown event to input-handler
- so that SymbolsOverlay can reset on field click
* Make tab do the same as enter
* Make font a bit smaller but increase relative icon size
* Satisfy type requirement of handlerlist
* Revert changing default size of DropdownItems
* Remove some now unused code for bootstrap dropdowns
* Use fuse to allow fuzzy searching of symbols
* Remove unnecessary async handling in data-provider
I did that because at first I was still expecting to fetch the symbols
from the backend
* Apply field font family in symbol preview
* Remove inline padding from latex popover
* Rename data-provier to symbols-table
* Add some explaining comments to interface
* Allow for auto insertion symbols
* Use deleteData and after instead of replaceData
* Allow using html in symbols
* Show html symbols as html
* Add SymbolsEntry component
* Also include containshtml at low search precedence
* Put character entities and gemoji into their own files
* Factor out prepareInsertion method
* Allow deletion while searching for correct symbol
* Respect insertCompositionText
* Delete data-provider
* Restrict auto insert queries to max 5 characters
* Satisfy svelte check
* Fix the overlay sometimes not showing
This will make sure to always normalize text nodes before searching.
However it adjacent text is partially formatted, this will still not
find the whole query.
For example, currently, entering `<b>:for</b>al` and then inputting `l`,
will not trigger a search for `forall`, because of the <b> formatting
* Add empty line
* Do not trigger overlay, when last character is whitespace or colon
* Add missing fuse license
2022-09-13 06:19:19 +02:00
|
|
|
|
|
|
|
// We emulate the after input event here, because we prevent
|
|
|
|
// the default behavior earlier
|
|
|
|
await afterInput.dispatch({ event });
|
|
|
|
}
|
|
|
|
|
|
|
|
async function onInput(this: Element, event: Event): Promise<void> {
|
|
|
|
await afterInput.dispatch({ event });
|
2022-02-25 01:59:06 +01:00
|
|
|
}
|
|
|
|
|
2022-09-10 10:46:59 +02:00
|
|
|
const pointerDown = new HandlerList<{ event: PointerEvent }>();
|
|
|
|
|
2022-02-25 01:59:06 +01:00
|
|
|
function clearInsertText(): void {
|
|
|
|
insertText.clear();
|
|
|
|
}
|
|
|
|
|
2022-09-10 10:46:59 +02:00
|
|
|
function onPointerDown(event: PointerEvent): void {
|
|
|
|
pointerDown.dispatch({ event });
|
|
|
|
clearInsertText();
|
|
|
|
}
|
|
|
|
|
|
|
|
const specialKey = new HandlerList<SpecialKeyParams>();
|
|
|
|
|
|
|
|
async function onKeyDown(this: Element, event: KeyboardEvent): Promise<void> {
|
|
|
|
if (isArrowDown(event)) {
|
|
|
|
specialKey.dispatch({ event, action: "caretDown" });
|
|
|
|
} else if (isArrowUp(event)) {
|
|
|
|
specialKey.dispatch({ event, action: "caretUp" });
|
|
|
|
} else if (isArrowRight(event)) {
|
|
|
|
specialKey.dispatch({ event, action: "caretRight" });
|
|
|
|
} else if (isArrowLeft(event)) {
|
|
|
|
specialKey.dispatch({ event, action: "caretLeft" });
|
|
|
|
} else if (event.code === "Enter" || event.code === "NumpadEnter") {
|
|
|
|
specialKey.dispatch({ event, action: "enter" });
|
|
|
|
} else if (event.code === "Tab") {
|
|
|
|
specialKey.dispatch({ event, action: "tab" });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-02-25 01:59:06 +01:00
|
|
|
function setupHandler(element: HTMLElement): { destroy(): void } {
|
2022-09-10 10:46:59 +02:00
|
|
|
const destroy = singleCallback(
|
|
|
|
on(element, "beforeinput", onBeforeInput),
|
Fuzzy search in symbol insertion overlay (#2059)
* Add flag for enabling insert symbols feature
* Add symbols overlay directory
* Detect if :xy is inserted into editable
* Allow naive updating of overlay, and special handling of ':'
* First step towards better Virtual Element support
* Update floating to reference range on insert text
* Position SymbolsOverlay always on top or bottom
* Add a data-provider to emulate API
* Show correct suggestions in symbols overlay
* Rename to replacementLength
* Allow replacing via clicking in menu
* Optionally remove inline padding of Popover
* Hide Symbols overlay on blur of content editable
* Add specialKey to inputHandler and generalize how arrow movement is detected
- This way macOS users can use Ctrl-N to mean down, etc.
* Detect special key from within SymbolsOverlay
* Implement full backwards search while typing
* Allow navigating symbol menu and accepting with enter
* Add some entries to data-provider
* Satisfy eslint
* Generate symbolsTable from sources
* Use other github source, allow multiple names
In return, symbol must be unique
* Automatically scroll in symbols dropdown
* Use from npm packages rather than downloading from URL
* Remove console.log
* Remove print
Co-authored-by: Damien Elmes <dae@users.noreply.github.com>
* Add pointerDown event to input-handler
- so that SymbolsOverlay can reset on field click
* Make tab do the same as enter
* Make font a bit smaller but increase relative icon size
* Satisfy type requirement of handlerlist
* Revert changing default size of DropdownItems
* Remove some now unused code for bootstrap dropdowns
* Use fuse to allow fuzzy searching of symbols
* Remove unnecessary async handling in data-provider
I did that because at first I was still expecting to fetch the symbols
from the backend
* Apply field font family in symbol preview
* Remove inline padding from latex popover
* Rename data-provier to symbols-table
* Add some explaining comments to interface
* Allow for auto insertion symbols
* Use deleteData and after instead of replaceData
* Allow using html in symbols
* Show html symbols as html
* Add SymbolsEntry component
* Also include containshtml at low search precedence
* Put character entities and gemoji into their own files
* Factor out prepareInsertion method
* Allow deletion while searching for correct symbol
* Respect insertCompositionText
* Delete data-provider
* Restrict auto insert queries to max 5 characters
* Satisfy svelte check
* Fix the overlay sometimes not showing
This will make sure to always normalize text nodes before searching.
However it adjacent text is partially formatted, this will still not
find the whole query.
For example, currently, entering `<b>:for</b>al` and then inputting `l`,
will not trigger a search for `forall`, because of the <b> formatting
* Add empty line
* Do not trigger overlay, when last character is whitespace or colon
* Add missing fuse license
2022-09-13 06:19:19 +02:00
|
|
|
on(element, "input", onInput),
|
2022-09-10 10:46:59 +02:00
|
|
|
on(element, "blur", clearInsertText),
|
|
|
|
on(element, "pointerdown", onPointerDown),
|
|
|
|
on(element, "keydown", onKeyDown),
|
|
|
|
on(document, "selectionchange", clearInsertText),
|
|
|
|
);
|
|
|
|
|
|
|
|
return { destroy };
|
2022-02-25 01:59:06 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return [
|
|
|
|
{
|
|
|
|
beforeInput,
|
|
|
|
insertText,
|
Fuzzy search in symbol insertion overlay (#2059)
* Add flag for enabling insert symbols feature
* Add symbols overlay directory
* Detect if :xy is inserted into editable
* Allow naive updating of overlay, and special handling of ':'
* First step towards better Virtual Element support
* Update floating to reference range on insert text
* Position SymbolsOverlay always on top or bottom
* Add a data-provider to emulate API
* Show correct suggestions in symbols overlay
* Rename to replacementLength
* Allow replacing via clicking in menu
* Optionally remove inline padding of Popover
* Hide Symbols overlay on blur of content editable
* Add specialKey to inputHandler and generalize how arrow movement is detected
- This way macOS users can use Ctrl-N to mean down, etc.
* Detect special key from within SymbolsOverlay
* Implement full backwards search while typing
* Allow navigating symbol menu and accepting with enter
* Add some entries to data-provider
* Satisfy eslint
* Generate symbolsTable from sources
* Use other github source, allow multiple names
In return, symbol must be unique
* Automatically scroll in symbols dropdown
* Use from npm packages rather than downloading from URL
* Remove console.log
* Remove print
Co-authored-by: Damien Elmes <dae@users.noreply.github.com>
* Add pointerDown event to input-handler
- so that SymbolsOverlay can reset on field click
* Make tab do the same as enter
* Make font a bit smaller but increase relative icon size
* Satisfy type requirement of handlerlist
* Revert changing default size of DropdownItems
* Remove some now unused code for bootstrap dropdowns
* Use fuse to allow fuzzy searching of symbols
* Remove unnecessary async handling in data-provider
I did that because at first I was still expecting to fetch the symbols
from the backend
* Apply field font family in symbol preview
* Remove inline padding from latex popover
* Rename data-provier to symbols-table
* Add some explaining comments to interface
* Allow for auto insertion symbols
* Use deleteData and after instead of replaceData
* Allow using html in symbols
* Show html symbols as html
* Add SymbolsEntry component
* Also include containshtml at low search precedence
* Put character entities and gemoji into their own files
* Factor out prepareInsertion method
* Allow deletion while searching for correct symbol
* Respect insertCompositionText
* Delete data-provider
* Restrict auto insert queries to max 5 characters
* Satisfy svelte check
* Fix the overlay sometimes not showing
This will make sure to always normalize text nodes before searching.
However it adjacent text is partially formatted, this will still not
find the whole query.
For example, currently, entering `<b>:for</b>al` and then inputting `l`,
will not trigger a search for `forall`, because of the <b> formatting
* Add empty line
* Do not trigger overlay, when last character is whitespace or colon
* Add missing fuse license
2022-09-13 06:19:19 +02:00
|
|
|
afterInput,
|
2022-09-10 10:46:59 +02:00
|
|
|
specialKey,
|
|
|
|
pointerDown,
|
2022-02-25 01:59:06 +01:00
|
|
|
},
|
|
|
|
setupHandler,
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
export default useInputHandler;
|