anki/ts/components
Henrik Giesel a981e56008
Improved add-on extension API (#1626)
* Add componentHook functionality

* Register package NoteEditor

* Rename OldEditorAdapter to NoteEditor

* Expose instances in component-hook as well

* Rename NoteTypeButtons to NotetypeButtons

* Move PreviewButton initialization to BrowserEditor.svelte

* Remove focusInRichText

- Same thing can be done by inspecting activeInput

* Satisfy formatter

* Fix remaining rebase issues

* Add .bazel to .prettierignore

* Rename currentField and activeInput to focused{Field,Input}

* Move identifier to lib and registration to sveltelib

* Fix Dynamic component insertion

* Simplify editingInputIsRichText

* Give extra warning in svelte/svelte.ts

- This was caused by doing a rename of a files, that only differed in
  case: NoteTypeButtons.svelte to NotetypeButtons.svelte
- It was quite tough to figure out, and this console.log might make it
  easier if it ever happens again

* Change signature of contextProperty

* Add ts/typings for add-on definition files

* Add Anki types in typings/common/index.d.ts

* Export without .svelte suffix

It conflicts with how Svelte types its packages

* Fix left over .svelte import from editor.py

* Rename NoteTypeButtons to unrelated to ensure case-only rename

* Rename back to NotetypeButtons.svelte

* Remove unused component-hook.ts, Fix typing in lifecycle-hooks

* Merge runtime-require and register-package into one file

+ Give some preliminary types to require

* Rename uiDidLoad to loaded

* Fix eslint / svelte-check

* Rename context imports to noteEditorContext

* Fix import name mismatch

- I wonder why these issues are not caught by svelte-check?

* Rename two missed usages of uiDidLoad

* Fix ButtonDropdown from having wrong border-radius

* Uniformly rename libraries to packages

- I don't have a strong opinion on whether to name them libraries or
  packages, I just think we should have a uniform name.
- JS/TS only uses the terms "module" and "namespace", however `package`
  is a reserved keyword for future use, whereas `library` is not.

* Refactor registration.ts into dynamic-slotting

- This is part of an effort to refactor the dynamic slotting (extending
  buttons) functionality out of components like ButtonGroup.

* Remove dynamically-slottable logic from ButtonToolbar

* Use DynamicallySlottable in editor-toolbar

* Fix no border radius on indentation button dropdown

* Fix AddonButtons

* Remove Item/ButtonGroupItem in deck-options, where it's not necessary

* Remove unnecessary uses of Item and ButtonGroupItem

* Fix remaining tests

* Fix relative imports

* Revert change return value of remapBinToSrcDir to ./bazel/out...

* Remove typings directory

* Adjust comments for dynamic-slottings
2022-02-03 14:52:11 +10:00
..
Absolute.svelte Translate Editor entirely to Svelte (#1403) 2021-10-18 22:01:15 +10:00
Badge.svelte Translate Editor entirely to Svelte (#1403) 2021-10-18 22:01:15 +10:00
BUILD.bazel Improved add-on extension API (#1626) 2022-02-03 14:52:11 +10:00
ButtonDropdown.svelte Improved add-on extension API (#1626) 2022-02-03 14:52:11 +10:00
ButtonGroup.svelte Improved add-on extension API (#1626) 2022-02-03 14:52:11 +10:00
ButtonGroupItem.svelte Improved add-on extension API (#1626) 2022-02-03 14:52:11 +10:00
ButtonToolbar.svelte Improved add-on extension API (#1626) 2022-02-03 14:52:11 +10:00
Col.svelte Introduce our own Container, Row, and Col components (#1495) 2021-11-17 13:49:52 +10:00
ColorPicker.svelte fix deprecation warning in latest svelte-preprocess 2021-10-26 08:43:02 +10:00
Container.svelte Improved add-on extension API (#1626) 2022-02-03 14:52:11 +10:00
context-keys.ts Live theme changes (#1497) 2021-11-25 07:17:41 +10:00
dropdown.ts handle changed aria-expanded typing 2021-09-29 12:20:27 +10:00
DropdownDivider.svelte WIP: Use our components in deckoptions sticky bar 2021-05-18 16:32:29 +02:00
DropdownItem.svelte Live theme changes (#1497) 2021-11-25 07:17:41 +10:00
DropdownMenu.svelte fix deprecation warning in latest svelte-preprocess 2021-10-26 08:43:02 +10:00
DynamicallySlottable.svelte Improved add-on extension API (#1626) 2022-02-03 14:52:11 +10:00
helpers.ts Use trailingComma: all setting in .prettierrc (#1435) 2021-10-19 09:06:00 +10:00
IconButton.svelte Live theme changes (#1497) 2021-11-25 07:17:41 +10:00
IconConstrain.svelte Translate Editor entirely to Svelte (#1403) 2021-10-18 22:01:15 +10:00
Item.svelte Improved add-on extension API (#1626) 2022-02-03 14:52:11 +10:00
LabelButton.svelte Live theme changes (#1497) 2021-11-25 07:17:41 +10:00
Row.svelte Improved add-on extension API (#1626) 2022-02-03 14:52:11 +10:00
SelectButton.svelte Show downwards arrow on SelectButton (#1521) 2021-12-04 08:08:20 +10:00
SelectOption.svelte Several CSS fixes - Editor Cleanup (#1470) 2021-10-31 08:29:22 +10:00
Shortcut.svelte Separate input components into their own directories / Remove WithShortcut (#1613) 2022-01-24 11:43:09 +10:00
Spacer.svelte Space out Sticky Bottom with Spacer component 2021-09-09 15:37:58 +02:00
StickyContainer.svelte Improved add-on extension API (#1626) 2022-02-03 14:52:11 +10:00
tsconfig.json update to latest rules_nodejs & switch to ts_project 2021-10-01 12:52:53 +10:00
types.ts Introduce our own Container, Row, and Col components (#1495) 2021-11-17 13:49:52 +10:00
WithContext.svelte fix deprecation warning in latest svelte-preprocess 2021-10-26 08:43:02 +10:00
WithDropdown.svelte Improved add-on extension API (#1626) 2022-02-03 14:52:11 +10:00
WithState.svelte Reverse-engineer surrounding with execCommand (#1377) 2021-11-18 19:18:39 +10:00
WithTooltip.svelte Editor Field Descriptions (#1476) 2021-11-06 09:42:48 +10:00