Anki/ts/editor
Henrik Giesel 739e286b0b
Fix some Mathjax issues (#1547)
* Move move-nodes logic into domlib

Refactor input-manager

Refactor out FocusTrap from EditingArea

Remove unnecessary selecting of node from surround

Add onInput interface to input-manager

Create MathjaxElement.svelte

- This should contain all the setup necessary for displaying
  <anki-mathjax> elements in the rich text input
- Does not contain setup necessary for Mathjax Overlay

Deal with backwards deletion, when caret inside anki-mathjax

Set mathjax elements contenteditable=false

Do not undecorate mathjaxx element on disconnect

- Fixes issues, where Mathjax might undecorate when it is moved into a
  different div

Add framed element custom element

Introduce iterateActions to allow global hooks for RichTextInput

Remove some old code

Deal with deletion of frame handles

Make Anki frame and frame handles restore each other

Make FrameElement restore its structure upon modification

Frame and strip off framing from MathjaxElement automatically

Move FrameHandle to separate FrameStart/FrameEnd

Refactor FrameHandle

Set data-frames on FrameElement

Fix logic error connected to FrameElement

Communicate frameHandle move{in,out} to anki-mathjax

Clear selection when blurring ContentEditable

Make sure frame is destroyed when undecorating Mathjax

Use Hairline space instead of zeroWidth

- it has better behavior in the contenteditable when placing the caret
  via clicking

Allow detection of block elements with `block` attribute

- This way, anki-mathjax block="true" will make field a
field be recognized to have block content

Make block frame element operater without handles

- Clicking on the left/right side of a block mathjax will insert a br
  element to that side

When deleting, remove mathajax-element not just image

Update MathjaxButtons to correctly show block state

SelectAll when moving into inline anki mathjax

Remove CodeMirror autofocus functionality

Move it to Mathjaxeditor directly

Fix getRangeAt throwing error

Update older code to use cross-browser

Fix issue with FrameHandles not being properyly removed

Satisfy formatting

Use === instead of node.isSameNode()

Fix issue of focusTrap not initialized

* Fix after rebasing

* Fix focus not being moved to first field

* Add documentation for input-manager and iterate-actions

* Export logic of ContentEditable to content-editable

* Fix issue with inserting newline right next to inline Mathjax

* Fix reframing issue of Mathjax Svelte component

* Allow for deletion of Inline Mathjax again

* Rename iterate-actions to action-list

* Add copyright header

* Split off frame-handle from frame-element

* Add some comments for framing process

* Add mising return types
2022-01-08 11:46:01 +10:00
..
image-overlay fix deprecation warning in latest svelte-preprocess 2021-10-26 08:43:02 +10:00
mathjax-overlay Fix some Mathjax issues (#1547) 2022-01-08 11:46:01 +10:00
AddonButtons.svelte fix deprecation warning in latest svelte-preprocess 2021-10-26 08:43:02 +10:00
AddTagBadge.svelte update to latest rules_nodejs & switch to ts_project 2021-10-01 12:52:53 +10:00
AutocompleteItem.svelte Live theme changes (#1497) 2021-11-25 07:17:41 +10:00
BoldButton.svelte Fix some issues with new surround buttons (#1505) 2021-11-24 10:33:14 +10:00
BUILD.bazel run buildifier/buildozer to tidy up BUILD files 2021-12-14 09:18:24 +10:00
change-timer.ts Add ChangeTimer.prototype.fireImmediately 2021-09-16 14:47:05 +02:00
ClozeButton.svelte Add back wrap function (#1551) 2021-12-13 14:00:35 +10:00
code-mirror.ts Fix some Mathjax issues (#1547) 2022-01-08 11:46:01 +10:00
CodeMirror.svelte Fix some Mathjax issues (#1547) 2022-01-08 11:46:01 +10:00
ColorButtons.svelte fix deprecation warning in latest svelte-preprocess 2021-10-26 08:43:02 +10:00
CommandIconButton.svelte Reverse-engineer surrounding with execCommand (#1377) 2021-11-18 19:18:39 +10:00
Components.svelte fix deprecation warning in latest svelte-preprocess 2021-10-26 08:43:02 +10:00
CustomStyles.svelte Translate Editor entirely to Svelte (#1403) 2021-10-18 22:01:15 +10:00
DecoratedElements.svelte Fix some Mathjax issues (#1547) 2022-01-08 11:46:01 +10:00
destroyable.ts Fix Cloze button (#1504) 2021-11-24 10:25:24 +10:00
DuplicateLink.svelte Reimplement "Show Duplicates" button in editor (#1550) 2021-12-13 14:06:12 +10:00
EditingArea.svelte Fix some Mathjax issues (#1547) 2022-01-08 11:46:01 +10:00
editor-base.scss Several CSS fixes - Editor Cleanup (#1470) 2021-10-31 08:29:22 +10:00
EditorField.svelte Editor Field Descriptions (#1476) 2021-11-06 09:42:48 +10:00
EditorToolbar.svelte Fix some issues with closing previewer (#1563) 2021-12-20 20:23:50 +10:00
Fields.svelte Translate Editor entirely to Svelte (#1403) 2021-10-18 22:01:15 +10:00
FieldsEditor.svelte Svelte Editor hotfixes (#1436) 2021-10-19 08:38:06 +10:00
FieldState.svelte Reimplement "Show Duplicates" button in editor (#1550) 2021-12-13 14:06:12 +10:00
FocusTrap.svelte Fix some Mathjax issues (#1547) 2022-01-08 11:46:01 +10:00
FormatBlockButtons.svelte Add shortcuts for list and indentation (#1546) 2021-12-10 17:54:31 +10:00
FormatInlineButtons.svelte Reverse-engineer surrounding with execCommand (#1377) 2021-11-18 19:18:39 +10:00
FrameElement.svelte Fix some Mathjax issues (#1547) 2022-01-08 11:46:01 +10:00
HandleBackground.svelte Always correctly update MathjaxHandle position 2021-09-15 17:05:43 +02:00
HandleControl.svelte Live theme changes (#1497) 2021-11-25 07:17:41 +10:00
HandleLabel.svelte Translate Editor entirely to Svelte (#1403) 2021-10-18 22:01:15 +10:00
HandleSelection.svelte Always correctly update MathjaxHandle position 2021-09-15 17:05:43 +02:00
helpers.ts Use trailingComma: all setting in .prettierrc (#1435) 2021-10-19 09:06:00 +10:00
icons.ts Editor Field Descriptions (#1476) 2021-11-06 09:42:48 +10:00
index.ts Add back wrap function (#1551) 2021-12-13 14:00:35 +10:00
index_wrapper.ts Export editor globals under anki namespace 2021-07-06 03:48:33 +02:00
ItalicButton.svelte Fix some issues with new surround buttons (#1505) 2021-11-24 10:33:14 +10:00
LabelContainer.svelte Translate Editor entirely to Svelte (#1403) 2021-10-18 22:01:15 +10:00
LabelDescription.svelte Editor Field Descriptions (#1476) 2021-11-06 09:42:48 +10:00
LabelName.svelte Editor Field Descriptions (#1476) 2021-11-06 09:42:48 +10:00
legacy.scss Decrease button and tag size for Linux and Windows (#1532) 2021-12-06 19:01:15 +10:00
MathjaxElement.svelte Fix some Mathjax issues (#1547) 2022-01-08 11:46:01 +10:00
NoteEditor.svelte Translate Editor entirely to Svelte (#1403) 2021-10-18 22:01:15 +10:00
NoteTypeButtons.svelte fix deprecation warning in latest svelte-preprocess 2021-10-26 08:43:02 +10:00
Notification.svelte Translate Editor entirely to Svelte (#1403) 2021-10-18 22:01:15 +10:00
OldEditorAdapter.svelte Fix some Mathjax issues (#1547) 2022-01-08 11:46:01 +10:00
PlainTextBadge.svelte Several editor fixes (#1478) 2021-11-05 11:29:02 +10:00
PlainTextInput.svelte Fix some Mathjax issues (#1547) 2022-01-08 11:46:01 +10:00
PreviewButton.svelte Fix some issues with closing previewer (#1563) 2021-12-20 20:23:50 +10:00
RichTextBadge.svelte Highlight field badges when toggled to non-default state (#1466) 2021-10-31 07:48:37 +10:00
RichTextInput.svelte Fix some Mathjax issues (#1547) 2022-01-08 11:46:01 +10:00
RichTextStyles.svelte Several CSS fixes - Editor Cleanup (#1470) 2021-10-31 08:29:22 +10:00
SelectedTagBadge.svelte update to latest rules_nodejs & switch to ts_project 2021-10-01 12:52:53 +10:00
SetContext.svelte Translate Editor entirely to Svelte (#1403) 2021-10-18 22:01:15 +10:00
StickyBadge.svelte Several editor fixes (#1478) 2021-11-05 11:29:02 +10:00
StyleLink.svelte Translate Editor entirely to Svelte (#1403) 2021-10-18 22:01:15 +10:00
StyleTag.svelte Translate Editor entirely to Svelte (#1403) 2021-10-18 22:01:15 +10:00
surround.ts Fix some Mathjax issues (#1547) 2022-01-08 11:46:01 +10:00
Tag.svelte Live theme changes (#1497) 2021-11-25 07:17:41 +10:00
TagDeleteBadge.svelte Several CSS fixes - Editor Cleanup (#1470) 2021-10-31 08:29:22 +10:00
TagEditMode.svelte fix deprecation warning in latest svelte-preprocess 2021-10-26 08:43:02 +10:00
TagEditor.svelte Introduce our own Container, Row, and Col components (#1495) 2021-11-17 13:49:52 +10:00
TagInput.svelte Several CSS fixes - Editor Cleanup (#1470) 2021-10-31 08:29:22 +10:00
TagOptionsBadge.svelte fix deprecation warning in latest svelte-preprocess 2021-10-26 08:43:02 +10:00
tags.ts add basic tag completion to backend 2021-09-09 15:38:08 +02:00
TagStickyBadge.svelte Fix some Mathjax issues (#1547) 2022-01-08 11:46:01 +10:00
TagWithTooltip.svelte Live theme changes (#1497) 2021-11-25 07:17:41 +10:00
TemplateButtons.svelte Add back wrap function (#1551) 2021-12-13 14:00:35 +10:00
tsconfig.json Reverse-engineer surrounding with execCommand (#1377) 2021-11-18 19:18:39 +10:00
UnderlineButton.svelte Fix some issues with new surround buttons (#1505) 2021-11-24 10:33:14 +10:00
WithAutocomplete.svelte fix deprecation warning in latest svelte-preprocess 2021-10-26 08:43:02 +10:00
WithColorHelper.svelte fix deprecation warning in latest svelte-preprocess 2021-10-26 08:43:02 +10:00