3672b0fe73
* Only collect card stats on the backend ... ... instead of rendering an HTML string using askama. * Add ts page Card Info * Update test for new `col.card_stats()` * Remove obsolete CardStats code * Use new ts page in `CardInfoDialog` * Align start and end instead of left and right Curiously, `text-align: start` does not work for `th` tags if assigned via classes. * Adopt ts refactorings after rebase #1405 and #1409 * Clean up `ts/card-info/BUILD.bazel` * Port card info logic from Rust to TS * Move repeated field to the top https://github.com/ankitects/anki/pull/1414#discussion_r725402730 * Convert pseudo classes to interfaces * CardInfoPage -> CardInfo * Make revlog in card info optional * Add legacy support for old card stats * Check for undefined instead of falsy * Make Revlog separate component * drop askama dependency (dae) * Fix nightmode for legacy card stats
70 lines
1.3 KiB
Python
70 lines
1.3 KiB
Python
load("//ts:prettier.bzl", "prettier_test")
|
|
load("//ts:eslint.bzl", "eslint_test")
|
|
load("//ts/svelte:svelte.bzl", "compile_svelte", "svelte_check")
|
|
load("//ts:esbuild.bzl", "esbuild")
|
|
load("//ts:compile_sass.bzl", "compile_sass")
|
|
load("//ts:typescript.bzl", "typescript")
|
|
|
|
compile_sass(
|
|
srcs = ["card-info-base.scss"],
|
|
group = "base_css",
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
"//sass:base_lib",
|
|
"//sass:scrollbar_lib",
|
|
"//sass/bootstrap",
|
|
],
|
|
)
|
|
|
|
compile_svelte()
|
|
|
|
typescript(
|
|
name = "index",
|
|
deps = [
|
|
":svelte",
|
|
"//ts/components",
|
|
"//ts/lib",
|
|
"@npm//@fluent",
|
|
],
|
|
)
|
|
|
|
esbuild(
|
|
name = "card-info",
|
|
args = {
|
|
"globalName": "anki",
|
|
"loader": {".svg": "text"},
|
|
},
|
|
entry_point = "index.ts",
|
|
output_css = "card-info.css",
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
":base_css",
|
|
":index",
|
|
":svelte",
|
|
"//ts/components",
|
|
"//ts/lib",
|
|
"@npm//protobufjs",
|
|
],
|
|
)
|
|
|
|
exports_files(["card-info.html"])
|
|
|
|
# Tests
|
|
################
|
|
|
|
prettier_test()
|
|
|
|
eslint_test()
|
|
|
|
svelte_check(
|
|
name = "svelte_check",
|
|
srcs = glob([
|
|
"*.ts",
|
|
"*.svelte",
|
|
]) + [
|
|
"//sass:button_mixins_lib",
|
|
"//sass/bootstrap",
|
|
"//ts/components",
|
|
],
|
|
)
|