* fix select all and change ordinal in edit mode in io
* make ordinal undefined for all shapes in group/ungroup
* fix group shapes and some ui fixes
* Don't add node_modules/* to dprint deps
* use minimum ordinal when shape merged, use max ordinal++ when ungrouped, in add mode no ordinal preset so NaN
* use state for ungroup shape
* maintain existing ordinal in editing mode
* fix order of ordinal in ungroup shape
* refactor: remove for loop, use forEach
* Update to latest Node LTS
* Add sveltekit
* Split tslib into separate @generated and @tslib components
SvelteKit's path aliases don't support multiple locations, so our old
approach of using @tslib to refer to both ts/lib and out/ts/lib will no
longer work. Instead, all generated sources and their includes are
placed in a separate out/ts/generated folder, and imported via @generated
instead. This also allows us to generate .ts files, instead of needing
to output separate .d.ts and .js files.
* Switch package.json to module type
* Avoid usage of baseUrl
Incompatible with SvelteKit
* Move sass into ts; use relative links
SvelteKit's default sass support doesn't allow overriding loadPaths
* jest->vitest, graphs example working with yarn dev
* most pages working in dev mode
* Some fixes after rebasing
* Fix/silence some svelte-check errors
* Get image-occlusion working with Fabric types
* Post-rebase lock changes
* Editor is now checked
* SvelteKit build integrated into ninja
* Use the new SvelteKit entrypoint for pages like congrats/deck options/etc
* Run eslint once for ts/**; fix some tests
* Fix a bunch of issues introduced when rebasing over latest main
* Run eslint fix
* Fix remaining eslint+pylint issues; tests now all pass
* Fix some issues with a clean build
* Latest bufbuild no longer requires @__PURE__ hack
* Add a few missed dependencies
* Add yarn.bat to fix Windows build
* Fix pages failing to show when ANKI_API_PORT not defined
* Fix svelte-check and vitest on Windows
* Set node path in ./yarn
* Move svelte-kit output to ts/.svelte-kit
Sadly, I couldn't figure out a way to store it in out/ if out/ is
a symlink, as it breaks module resolution when SvelteKit is run.
* Allow HMR inside Anki
* Skip SvelteKit build when HMR is defined
* Fix some post-rebase issues
I should have done a normal merge instead.
* Simplify the offline build
The two environment variables OFFLINE_BUILD and NO_VENV jointly provide
the ability to build Anki fully offline. This commit boils them down
into just one, namely OFFLINE_BUILD.
The rationale being that first, OFFLINE_BUILD implies the use of
a custom non-networked Python environment.
Second, building Anki with a custom Python environment in a networked
setting is a use case, that we currently do not support.
Developers in need of such a solution may want to give containerized
development environments a try. Users could also look into building
Anki fully offline instead.
* Add documentation for offline builds.
* Add support for offline generation of Sphinx documentation.
Control installation of Sphinx dependencies via the network through the
OFFLINE_BUILD environment variable.
* Add documentation for offline generation of Sphinx documentation.
* CONTRIBUTORS: Add myself to the contributors list
* Add support for offline builds
Downloading files during build time is a non-starter for FreeBSD ports
(and presumably for other *BSD ports and some Linux distros as well).
In order to still be able to build Anki successfully, two new
environment variables have been added that can be set accordingly:
* NO_VENV: If set, the Python system environment is used instead of
a venv. This is necessary if there are no usable Python wheels for a
platform, e.g. PyQt6.
* OFFLINE_BUILD: If set, the git repository synchronization (translation
files, build hash, etc.) is skipped.
To successfully build Anki offline, following conditions must be met:
1. All required dependencies (node, Python, rust, yarn, etc.) must be
present in the build environment.
2. The offline repositories for the translation files must be
copied/linked to ftl/qt-repo and ftl/core-repo.
3. The Python pseudo venv needs to be setup:
$ mkdir out/pyenv/bin
$ ln -s /path/to/python out/pyenv/bin/python
$ ln -s /path/to/protoc-gen-mypy out/pyenv/bin/protoc-gen-mypy
4. Create the offline cache for yarn and use its own environment
variable YARN_CACHE_FOLDER to it:
YARN_CACHE_FOLDER=/path/to/the/yarn/cache
$ /path/to/yarn install --ignore-scripts
5. Build Anki:
$ /path/to/cargo build --package runner --release --verbose --verbose
$ OFFLINE_BUILD=1 \
NO_VENV=1 \
${WRKSRC}/out/rust/release/runner build wheels
This also fixes the Mac bundle using an old Qt version.
Linux held back due to ABI breakage; should be fixed in about a week
when PyQt 6.6.1 comes out. Windows build also fails to run - not sure
if it's the same issue or not.
* Replace css_browser_selector
* Add classes to root element instead of body
* Export addBrowserClasses() in reviewer_extras for mobile clients (dae)
* Avoid setting .mac on iOS devices (dae)
* Make enum selector generic
* Refactor ImportCsvPage to support tooltips
* Improve csv import defaults
* Unify import pages
* Improve import page styling
* Fix life cycle issue with import properties
* Remove size constraints to fix scrollbar styling
* Add help strings and urls to csv import page
* Show ErrorPage on ImportPage error
* Fix escaping of import path
* Unify ImportPage and ImportLogPage
* Apply suggestions from code review (dae)
* Fix import progress
* Fix preview overflowing container
* Don't include <br> in FileIoErrors (dae)
e.g. 500: Failed to read '/home/dae/foo2.csv':<br>stream did not contain valid UTF-8
I thought about using {@html ...} here, but that's a potential security issue,
as the filename is not something we control.
* Remember original id when importing notetype
* Reuse notetypes with matching original id
* Add field and template ids
* Enable merging imported notetypes
* Fix test
Note should be updated if the incoming note's notetype is
remapped to the existing note's notetype.
On the other hand, it should be skipped if its notetype id is mapped
to some new notetype.
* Change field and template ids to i32
* Add merge notetypes flag to proto message
* Add dialog for apkg import
* Move HelpModal into components
* Generalize import dialog
* Move SettingTitle into components
* Add help modal to ImportAnkiPackagePage
* Move SwitchRow into components
* Fix backend method import
* Make testable in browser
* Fix broken modal
* Wrap in container and fix margins
* Update commented Anki version of new proto fields
* Check ids when comparing notetype schemas
* Add tooltip for merging notetypes.
* Allow updating notes regardless of mtime
* Gitignore yarn-error.log
* Allow updating notetypes regardless of mtime
* Fix apkg help carousel
* Use i64s for template and field ids
* Add option to omit importing scheduling info
* Restore last settings in apkg import dialog
* Display error when getting metadata in webview
* Update manual links for apkg importing
* Apply suggestions from code review
Co-authored-by: Damien Elmes <dae@users.noreply.github.com>
* Omit schduling -> Import all cards as new cards
* Tweak importing-update-notes-help
* UpdateCondition → ImportAnkiPackageUpdateCondition
* Load keyboard.ftl
* Skip updating dupes in 'update alwyas' case
* Explain more when merging notetypes is required
* "omit scheduling" → "with scheduling"
* Skip updating notetype dupes if 'update always'
* Merge duplicated notetypes from previous imports
* Fix rebase aftermath
* Fix panic when merging
* Clarify 'update notetypes' help
* Mention 'merge notetypes' in the log
* Add a test which covers the previously panicking path
* Use nested ftl messages to ensure consistency
* Make order of merged fields deterministic
* Rewrite test to trigger panic
* Update version comment on new fields
- Fixes an issue where tasks would continue to appear active for a while
after they had finished on Unix platforms
- The latest n2 now behaves the same way as ninja when substituting
variables, so we no longer need to do the substitution ourselves.
* Implement import log screen in Svelte
* Show filename in import log screen title
* Remove unused NoteRow property
* Show number of imported notes
* Use a single nid expression
* Use 'count' as variable name for consistency
* Import from @tslib/backend instead
* Fix summary_template typing
* Fix clippy warning
* Apply suggestions from code review
* Fix imports
* Contents -> Fields
* Increase max length of browser search bar
https://github.com/ankitects/anki/pull/2568/files#r1255227035
* Fix race condition in Bootstrap tooltip destruction
https://github.com/twbs/bootstrap/issues/37474
* summary_template -> summaryTemplate
* Make show link a button
* Run import ops on Svelte side
* Fix geometry not being restored in CSV Import page
* Make VirtualTable fill available height
* Keep CSV dialog modal
* Reword importing-existing-notes-skipped
* Avoid mentioning matching based on first field
* Change tick and cross icons
* List skipped notes last
* Pure CSS spinner
* Move set_wants_abort() call to relevant dialogs
* Show number of imported cards
* Remove bold from first sentence and indent summaries
* Update UI after import operations
* Add close button to import log page
Also make virtual table react to resize event.
* Fix typing
* Make CSV dialog non-modal again
Otherwise user can't interact with browser window.
* Update window modality after import
* Commit DB and update undo actions after import op
* Split frontend proto into separate file, so backend can ignore it
Currently the automatically-generated frontend RPC methods get placed in
'backend.js' with all the backend methods; we could optionally split them
into a separate 'frontend.js' file in the future.
* Migrate import_done from a bridgecmd to a HTTP request
* Update plural form of importing-notes-added
* Move import response handling to mediasrv
* Move task callback to script section
* Avoid unnecessary :global()
* .log cannot be missing if result exists
* Move import log search handling to mediasrv
* Type common params of ImportLogDialog
* Use else if
* Remove console.log()
* Add way to test apkg imports in new log screen
* Remove unused import
* Get actual card count for CSV imports
* Use import type
* Fix typing error
* Ignore import log when checking for changes in Python layer
* Apply suggestions from code review
* Remove imported card count for now
* Avoid non-null assertion in assignment
* Change showInBrowser to take an array of notes
* Use dataclasses for import log args
* Simplify ResultWithChanges in TS
* Only abort import when window is modal
* Fix ResultWithChanges typing
* Fix Rust warnings
* Only log one duplicate per incoming note
* Update wording about note updates
* Remove caveat about found_notes
* Reduce font size
* Remove redundant map
* Give credit to loading.io
* Remove unused line
---------
Co-authored-by: RumovZ <gp5glkw78@relay.firefox.com>
Combined with the previous changes, this allows the mobile clients to
build the web components without having to set up a Python environment,
and should speed up AnkiDroid CI.