68092082f2
* Enable access to old notetype name * Set minimum height for ChangeNotetypeDialog * Add bootstrap icons to change-notetype * Move alert up and make it collapsible * Tweak some CSS - Add variables --sticky-bg and --sticky-border to StickyContainer - Tweak base.css * Add translatable string "(Nothing)" * Rework ChangeNotetype screen * Initially load option at newIndex and remaining options on focus Optimization for big notetypes: Should increase efficiency from O(n²) to O(n). Test on notetype with 500 templates shows significant improvement in load time (~10s down to ~1s). * Try to satisfy rust test * Change arrow direction depending on reading direction + add 0.5em top padding to main * Create Alert.svelte * Introduce CSS variable --pane-bg * Revert "Initially load option at newIndex and remaining options on focus" This reverts commit f42beee45c27dba9433d76217fb583b117fb5231. * Final cleanup * Refine padding/gutter
88 lines
1.7 KiB
Python
88 lines
1.7 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:vendor.bzl", "copy_bootstrap_icons")
|
|
load("//ts:compile_sass.bzl", "compile_sass")
|
|
load("//ts:typescript.bzl", "typescript")
|
|
load("//ts:jest.bzl", "jest_test")
|
|
|
|
compile_sass(
|
|
srcs = ["change-notetype-base.scss"],
|
|
group = "base_css",
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
"//sass:base_lib",
|
|
"//sass:scrollbar_lib",
|
|
"//sass/bootstrap",
|
|
],
|
|
)
|
|
|
|
_ts_deps = [
|
|
"//ts/components",
|
|
"//ts/lib",
|
|
"//ts/sveltelib",
|
|
"@npm//@fluent",
|
|
"@npm//@types/jest",
|
|
"@npm//lodash-es",
|
|
"@npm//svelte",
|
|
"@npm//marked",
|
|
]
|
|
|
|
compile_svelte(deps = _ts_deps)
|
|
|
|
typescript(
|
|
name = "index",
|
|
deps = _ts_deps + [
|
|
":svelte",
|
|
],
|
|
)
|
|
|
|
esbuild(
|
|
name = "change-notetype",
|
|
args = {
|
|
"globalName": "anki",
|
|
"loader": {".svg": "text"},
|
|
},
|
|
entry_point = "index.ts",
|
|
output_css = "change-notetype.css",
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
":base_css",
|
|
"@npm//bootstrap-icons",
|
|
":index",
|
|
":svelte",
|
|
],
|
|
)
|
|
|
|
exports_files(["change-notetype.html"])
|
|
|
|
# Tests
|
|
################
|
|
|
|
prettier_test()
|
|
|
|
eslint_test()
|
|
|
|
svelte_check(
|
|
name = "svelte_check",
|
|
srcs = glob([
|
|
"*.ts",
|
|
"*.svelte",
|
|
]) + [
|
|
"//sass:button_mixins_lib",
|
|
"//sass/bootstrap",
|
|
"@npm//@types/bootstrap",
|
|
"@npm//@types/lodash-es",
|
|
"@npm//@types/marked",
|
|
"//ts/components",
|
|
],
|
|
)
|
|
|
|
jest_test(
|
|
protobuf = True,
|
|
deps = [
|
|
":index",
|
|
],
|
|
)
|