mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 15:02:21 -04:00
More uniform file naming
kebap-case for .ts, .scss, .html, and directories
This commit is contained in:
parent
3581ee8f95
commit
24af5bada3
101 changed files with 100 additions and 144 deletions
|
@ -52,7 +52,7 @@ class ChangeNotetypeDialog(QDialog):
|
||||||
|
|
||||||
self.web = AnkiWebView(title=self.TITLE)
|
self.web = AnkiWebView(title=self.TITLE)
|
||||||
self.web.setVisible(False)
|
self.web.setVisible(False)
|
||||||
self.web.load_ts_page("ChangeNotetype")
|
self.web.load_ts_page("change-notetype")
|
||||||
layout = QVBoxLayout()
|
layout = QVBoxLayout()
|
||||||
layout.setContentsMargins(0, 0, 0, 0)
|
layout.setContentsMargins(0, 0, 0, 0)
|
||||||
layout.addWidget(self.web)
|
layout.addWidget(self.web)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/* Copyright: Ankitects Pty Ltd and contributors
|
/* Copyright: Ankitects Pty Ltd and contributors
|
||||||
* License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html */
|
* License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html */
|
||||||
|
|
||||||
@use 'ts/sass/card_counts';
|
@use 'ts/sass/card-counts';
|
||||||
|
|
||||||
a.deck {
|
a.deck {
|
||||||
color: var(--text-fg);
|
color: var(--text-fg);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/* Copyright: Ankitects Pty Ltd and contributors
|
/* Copyright: Ankitects Pty Ltd and contributors
|
||||||
* License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html */
|
* License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html */
|
||||||
|
|
||||||
@use 'ts/sass/card_counts';
|
@use 'ts/sass/card-counts';
|
||||||
|
|
||||||
.smallLink {
|
.smallLink {
|
||||||
font-size: 10px;
|
font-size: 10px;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/* Copyright: Ankitects Pty Ltd and contributors
|
/* Copyright: Ankitects Pty Ltd and contributors
|
||||||
* License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html */
|
* License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html */
|
||||||
|
|
||||||
@use 'ts/sass/card_counts';
|
@use 'ts/sass/card-counts';
|
||||||
|
|
||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
|
|
@ -3,8 +3,8 @@ load("//ts:copy.bzl", "copy_files_into_group")
|
||||||
_pages = [
|
_pages = [
|
||||||
"graphs",
|
"graphs",
|
||||||
"congrats",
|
"congrats",
|
||||||
"deckoptions",
|
"deck-options",
|
||||||
"ChangeNotetype",
|
"change-notetype",
|
||||||
]
|
]
|
||||||
|
|
||||||
[copy_files_into_group(
|
[copy_files_into_group(
|
||||||
|
|
|
@ -46,7 +46,7 @@ class DeckOptionsDialog(QDialog):
|
||||||
|
|
||||||
self.web = AnkiWebView(title=self.TITLE)
|
self.web = AnkiWebView(title=self.TITLE)
|
||||||
self.web.setVisible(False)
|
self.web.setVisible(False)
|
||||||
self.web.load_ts_page("deckoptions")
|
self.web.load_ts_page("deck-options")
|
||||||
layout = QVBoxLayout()
|
layout = QVBoxLayout()
|
||||||
layout.setContentsMargins(0, 0, 0, 0)
|
layout.setContentsMargins(0, 0, 0, 0)
|
||||||
layout.addWidget(self.web)
|
layout.addWidget(self.web)
|
||||||
|
|
|
@ -7,7 +7,7 @@ load("//ts:compile_sass.bzl", "compile_sass")
|
||||||
load("//ts:jest.bzl", "jest_test")
|
load("//ts:jest.bzl", "jest_test")
|
||||||
|
|
||||||
compile_sass(
|
compile_sass(
|
||||||
srcs = ["ChangeNotetype-base.scss"],
|
srcs = ["change-notetype-base.scss"],
|
||||||
group = "base_css",
|
group = "base_css",
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
deps = [
|
deps = [
|
||||||
|
@ -48,7 +48,7 @@ ts_library(
|
||||||
srcs = [
|
srcs = [
|
||||||
"lib.ts",
|
"lib.ts",
|
||||||
],
|
],
|
||||||
module_name = "ChangeNotetype",
|
module_name = "change-notetype",
|
||||||
deps = [
|
deps = [
|
||||||
"//ts/components",
|
"//ts/components",
|
||||||
"//ts/lib",
|
"//ts/lib",
|
||||||
|
@ -60,7 +60,7 @@ ts_library(
|
||||||
)
|
)
|
||||||
|
|
||||||
esbuild(
|
esbuild(
|
||||||
name = "ChangeNotetype",
|
name = "change-notetype",
|
||||||
srcs = [
|
srcs = [
|
||||||
"//ts:protobuf-shim.js",
|
"//ts:protobuf-shim.js",
|
||||||
],
|
],
|
||||||
|
@ -75,22 +75,22 @@ esbuild(
|
||||||
external = [
|
external = [
|
||||||
"protobufjs/light",
|
"protobufjs/light",
|
||||||
],
|
],
|
||||||
output_css = "ChangeNotetype.css",
|
output_css = "change-notetype.css",
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
deps = [
|
deps = [
|
||||||
"index",
|
"index",
|
||||||
|
":base_css",
|
||||||
|
"@npm//bootstrap",
|
||||||
|
"@npm//marked",
|
||||||
"//ts/lib",
|
"//ts/lib",
|
||||||
"//ts/lib:backend_proto",
|
"//ts/lib:backend_proto",
|
||||||
"@npm//bootstrap",
|
|
||||||
":base_css",
|
|
||||||
"//ts/sveltelib",
|
"//ts/sveltelib",
|
||||||
"@npm//marked",
|
|
||||||
"//ts/components",
|
"//ts/components",
|
||||||
"//ts/components:svelte_components",
|
"//ts/components:svelte_components",
|
||||||
] + svelte_names,
|
] + svelte_names,
|
||||||
)
|
)
|
||||||
|
|
||||||
exports_files(["ChangeNotetype.html"])
|
exports_files(["change-notetype.html"])
|
||||||
|
|
||||||
# Tests
|
# Tests
|
||||||
################
|
################
|
|
@ -3,11 +3,11 @@
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" id="viewport" content="width=device-width" />
|
<meta name="viewport" id="viewport" content="width=device-width" />
|
||||||
<link href="ChangeNotetype-base.css" rel="stylesheet" />
|
<link href="change-notetype-base.css" rel="stylesheet" />
|
||||||
<link href="ChangeNotetype.css" rel="stylesheet" />
|
<link href="change-notetype.css" rel="stylesheet" />
|
||||||
<script src="../js/vendor/protobuf.min.js"></script>
|
<script src="../js/vendor/protobuf.min.js"></script>
|
||||||
<script src="../js/vendor/bootstrap.bundle.min.js"></script>
|
<script src="../js/vendor/bootstrap.bundle.min.js"></script>
|
||||||
<script src="ChangeNotetype.js"></script>
|
<script src="change-notetype.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="main"></div>
|
<div id="main"></div>
|
|
@ -9,7 +9,7 @@ import { ChangeNotetypeState, getChangeNotetypeInfo, getNotetypeNames } from "./
|
||||||
import { setupI18n, ModuleName } from "lib/i18n";
|
import { setupI18n, ModuleName } from "lib/i18n";
|
||||||
import { checkNightMode } from "lib/nightmode";
|
import { checkNightMode } from "lib/nightmode";
|
||||||
import ChangeNotetypePage from "./ChangeNotetypePage.svelte";
|
import ChangeNotetypePage from "./ChangeNotetypePage.svelte";
|
||||||
import { nightModeKey } from "components/contextKeys";
|
import { nightModeKey } from "components/context-keys";
|
||||||
|
|
||||||
export async function changeNotetypePage(
|
export async function changeNotetypePage(
|
||||||
target: HTMLDivElement,
|
target: HTMLDivElement,
|
|
@ -4,7 +4,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
-->
|
-->
|
||||||
<script lang="typescript">
|
<script lang="typescript">
|
||||||
import { setContext } from "svelte";
|
import { setContext } from "svelte";
|
||||||
import { dropdownKey } from "./contextKeys";
|
import { dropdownKey } from "./context-keys";
|
||||||
|
|
||||||
import ButtonToolbar from "./ButtonToolbar.svelte";
|
import ButtonToolbar from "./ButtonToolbar.svelte";
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
import ButtonGroupItem from "./ButtonGroupItem.svelte";
|
import ButtonGroupItem from "./ButtonGroupItem.svelte";
|
||||||
import { setContext } from "svelte";
|
import { setContext } from "svelte";
|
||||||
import { writable } from "svelte/store";
|
import { writable } from "svelte/store";
|
||||||
import { buttonGroupKey } from "./contextKeys";
|
import { buttonGroupKey } from "./context-keys";
|
||||||
import type { Identifier } from "./identifier";
|
import type { Identifier } from "./identifier";
|
||||||
import { insertElement, appendElement } from "./identifier";
|
import { insertElement, appendElement } from "./identifier";
|
||||||
import type { ButtonRegistration } from "./buttons";
|
import type { ButtonRegistration } from "./buttons";
|
||||||
|
|
|
@ -11,7 +11,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
import type { Register } from "./registration";
|
import type { Register } from "./registration";
|
||||||
|
|
||||||
import { getContext, hasContext } from "svelte";
|
import { getContext, hasContext } from "svelte";
|
||||||
import { buttonGroupKey } from "./contextKeys";
|
import { buttonGroupKey } from "./context-keys";
|
||||||
|
|
||||||
export let id: string | undefined = undefined;
|
export let id: string | undefined = undefined;
|
||||||
export let registration: ButtonRegistration | undefined = undefined;
|
export let registration: ButtonRegistration | undefined = undefined;
|
||||||
|
|
|
@ -6,7 +6,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
import { setContext } from "svelte";
|
import { setContext } from "svelte";
|
||||||
import { writable } from "svelte/store";
|
import { writable } from "svelte/store";
|
||||||
import Item from "./Item.svelte";
|
import Item from "./Item.svelte";
|
||||||
import { sectionKey } from "./contextKeys";
|
import { sectionKey } from "./context-keys";
|
||||||
import type { Identifier } from "./identifier";
|
import type { Identifier } from "./identifier";
|
||||||
import { insertElement, appendElement } from "./identifier";
|
import { insertElement, appendElement } from "./identifier";
|
||||||
import type { SvelteComponent, Registration } from "./registration";
|
import type { SvelteComponent, Registration } from "./registration";
|
||||||
|
|
|
@ -4,7 +4,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
-->
|
-->
|
||||||
<script lang="typescript">
|
<script lang="typescript">
|
||||||
import { onMount, createEventDispatcher, getContext } from "svelte";
|
import { onMount, createEventDispatcher, getContext } from "svelte";
|
||||||
import { nightModeKey } from "./contextKeys";
|
import { nightModeKey } from "./context-keys";
|
||||||
|
|
||||||
export let id: string | undefined = undefined;
|
export let id: string | undefined = undefined;
|
||||||
let className = "";
|
let className = "";
|
||||||
|
@ -34,7 +34,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@use 'ts/sass/button_mixins' as button;
|
@use 'ts/sass/button-mixins' as button;
|
||||||
|
|
||||||
button {
|
button {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
|
@ -4,7 +4,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
-->
|
-->
|
||||||
<script lang="typescript">
|
<script lang="typescript">
|
||||||
import { setContext } from "svelte";
|
import { setContext } from "svelte";
|
||||||
import { dropdownKey } from "./contextKeys";
|
import { dropdownKey } from "./context-keys";
|
||||||
|
|
||||||
export let id: string | undefined = undefined;
|
export let id: string | undefined = undefined;
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
-->
|
-->
|
||||||
<script lang="typescript">
|
<script lang="typescript">
|
||||||
import { getContext, onMount, createEventDispatcher } from "svelte";
|
import { getContext, onMount, createEventDispatcher } from "svelte";
|
||||||
import { nightModeKey, dropdownKey } from "./contextKeys";
|
import { nightModeKey, dropdownKey } from "./context-keys";
|
||||||
import type { DropdownProps } from "./dropdown";
|
import type { DropdownProps } from "./dropdown";
|
||||||
|
|
||||||
export let id: string | undefined = undefined;
|
export let id: string | undefined = undefined;
|
||||||
|
@ -49,7 +49,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@use "ts/sass/button_mixins" as button;
|
@use "ts/sass/button-mixins" as button;
|
||||||
|
|
||||||
button {
|
button {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
|
|
@ -8,7 +8,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
import type { Register, Registration } from "./registration";
|
import type { Register, Registration } from "./registration";
|
||||||
|
|
||||||
import { getContext, hasContext } from "svelte";
|
import { getContext, hasContext } from "svelte";
|
||||||
import { sectionKey } from "./contextKeys";
|
import { sectionKey } from "./context-keys";
|
||||||
|
|
||||||
export let id: string | undefined = undefined;
|
export let id: string | undefined = undefined;
|
||||||
export let registration: Registration | undefined = undefined;
|
export let registration: Registration | undefined = undefined;
|
||||||
|
|
|
@ -5,7 +5,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
<script lang="typescript">
|
<script lang="typescript">
|
||||||
import type { Readable } from "svelte/store";
|
import type { Readable } from "svelte/store";
|
||||||
import { onMount, createEventDispatcher, getContext } from "svelte";
|
import { onMount, createEventDispatcher, getContext } from "svelte";
|
||||||
import { disabledKey, nightModeKey, dropdownKey } from "./contextKeys";
|
import { disabledKey, nightModeKey, dropdownKey } from "./context-keys";
|
||||||
import type { DropdownProps } from "./dropdown";
|
import type { DropdownProps } from "./dropdown";
|
||||||
|
|
||||||
export let id: string | undefined = undefined;
|
export let id: string | undefined = undefined;
|
||||||
|
@ -53,7 +53,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@use "ts/sass/button_mixins" as button;
|
@use "ts/sass/button-mixins" as button;
|
||||||
|
|
||||||
button {
|
button {
|
||||||
padding: 0 calc(var(--buttons-size) / 3);
|
padding: 0 calc(var(--buttons-size) / 3);
|
||||||
|
|
|
@ -6,7 +6,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
import { setContext } from "svelte";
|
import { setContext } from "svelte";
|
||||||
import { writable } from "svelte/store";
|
import { writable } from "svelte/store";
|
||||||
import Item from "./Item.svelte";
|
import Item from "./Item.svelte";
|
||||||
import { sectionKey } from "./contextKeys";
|
import { sectionKey } from "./context-keys";
|
||||||
import type { Identifier } from "./identifier";
|
import type { Identifier } from "./identifier";
|
||||||
import { insertElement, appendElement } from "./identifier";
|
import { insertElement, appendElement } from "./identifier";
|
||||||
import type { SvelteComponent, Registration } from "./registration";
|
import type { SvelteComponent, Registration } from "./registration";
|
||||||
|
|
|
@ -5,7 +5,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
<script lang="typescript">
|
<script lang="typescript">
|
||||||
import type { Readable } from "svelte/store";
|
import type { Readable } from "svelte/store";
|
||||||
import { onMount, createEventDispatcher, getContext } from "svelte";
|
import { onMount, createEventDispatcher, getContext } from "svelte";
|
||||||
import { disabledKey, nightModeKey } from "./contextKeys";
|
import { disabledKey, nightModeKey } from "./context-keys";
|
||||||
|
|
||||||
export let id: string | undefined = undefined;
|
export let id: string | undefined = undefined;
|
||||||
let className = "";
|
let className = "";
|
||||||
|
@ -43,7 +43,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@use "ts/sass/button_mixins" as button;
|
@use "ts/sass/button-mixins" as button;
|
||||||
|
|
||||||
select {
|
select {
|
||||||
height: var(--buttons-size);
|
height: var(--buttons-size);
|
||||||
|
|
|
@ -6,7 +6,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
import Dropdown from "bootstrap/js/dist/dropdown";
|
import Dropdown from "bootstrap/js/dist/dropdown";
|
||||||
|
|
||||||
import { setContext, onDestroy } from "svelte";
|
import { setContext, onDestroy } from "svelte";
|
||||||
import { dropdownKey } from "./contextKeys";
|
import { dropdownKey } from "./context-keys";
|
||||||
|
|
||||||
setContext(dropdownKey, {
|
setContext(dropdownKey, {
|
||||||
dropdown: true,
|
dropdown: true,
|
||||||
|
|
|
@ -1,27 +0,0 @@
|
||||||
<!--
|
|
||||||
Copyright: Ankitects Pty Ltd and contributors
|
|
||||||
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
||||||
-->
|
|
||||||
<script lang="typescript">
|
|
||||||
import type { ToolbarItem } from "./types";
|
|
||||||
|
|
||||||
export let id: string;
|
|
||||||
export let className = "";
|
|
||||||
|
|
||||||
export let label: string;
|
|
||||||
export let button: ToolbarItem;
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<!-- svelte-ignore a11y-label-has-associated-control -->
|
|
||||||
|
|
||||||
<label {id} class={className}>
|
|
||||||
<span class="me-1">{label}</span>
|
|
||||||
<svelte:component this={button.component} {...button} />
|
|
||||||
</label>
|
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
label {
|
|
||||||
display: flex;
|
|
||||||
padding: 0 calc(var(--buttons-size) / 10);
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -1,17 +0,0 @@
|
||||||
// Copyright: Ankitects Pty Ltd and contributors
|
|
||||||
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
||||||
import type { DynamicSvelteComponent } from "sveltelib/dynamicComponent";
|
|
||||||
import type { SvelteComponentDev } from "svelte/internal";
|
|
||||||
|
|
||||||
export interface ToolbarItem<
|
|
||||||
T extends typeof SvelteComponentDev = typeof SvelteComponentDev
|
|
||||||
> extends DynamicSvelteComponent<T> {
|
|
||||||
id?: string;
|
|
||||||
hidden?: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IterableToolbarItem<
|
|
||||||
T extends typeof SvelteComponentDev = typeof SvelteComponentDev
|
|
||||||
> extends ToolbarItem<T> {
|
|
||||||
items: ToolbarItem[];
|
|
||||||
}
|
|
|
@ -8,7 +8,7 @@ load("//ts:compile_sass.bzl", "compile_sass")
|
||||||
load("//ts:jest.bzl", "jest_test")
|
load("//ts:jest.bzl", "jest_test")
|
||||||
|
|
||||||
compile_sass(
|
compile_sass(
|
||||||
srcs = ["deckoptions-base.scss"],
|
srcs = ["deck-options-base.scss"],
|
||||||
group = "base_css",
|
group = "base_css",
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
deps = [
|
deps = [
|
||||||
|
@ -76,7 +76,7 @@ ts_library(
|
||||||
)
|
)
|
||||||
|
|
||||||
esbuild(
|
esbuild(
|
||||||
name = "deckoptions",
|
name = "deck-options",
|
||||||
srcs = [
|
srcs = [
|
||||||
"//ts:protobuf-shim.js",
|
"//ts:protobuf-shim.js",
|
||||||
],
|
],
|
||||||
|
@ -91,23 +91,23 @@ esbuild(
|
||||||
external = [
|
external = [
|
||||||
"protobufjs/light",
|
"protobufjs/light",
|
||||||
],
|
],
|
||||||
output_css = "deckoptions.css",
|
output_css = "deck-options.css",
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
deps = [
|
deps = [
|
||||||
"index",
|
"index",
|
||||||
|
":bootstrap-icons",
|
||||||
|
":base_css",
|
||||||
|
"@npm//bootstrap",
|
||||||
|
"@npm//marked",
|
||||||
"//ts/lib",
|
"//ts/lib",
|
||||||
"//ts/lib:backend_proto",
|
"//ts/lib:backend_proto",
|
||||||
":bootstrap-icons",
|
|
||||||
"@npm//bootstrap",
|
|
||||||
":base_css",
|
|
||||||
"//ts/sveltelib",
|
"//ts/sveltelib",
|
||||||
"@npm//marked",
|
|
||||||
"//ts/components",
|
"//ts/components",
|
||||||
"//ts/components:svelte_components",
|
"//ts/components:svelte_components",
|
||||||
] + svelte_names,
|
] + svelte_names,
|
||||||
)
|
)
|
||||||
|
|
||||||
exports_files(["deckoptions.html"])
|
exports_files(["deck-options.html"])
|
||||||
|
|
||||||
# Tests
|
# Tests
|
||||||
################
|
################
|
|
@ -4,7 +4,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
-->
|
-->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { DropdownProps } from "components/dropdown";
|
import type { DropdownProps } from "components/dropdown";
|
||||||
import { dropdownKey } from "components/contextKeys";
|
import { dropdownKey } from "components/context-keys";
|
||||||
import { onMount, createEventDispatcher, getContext } from "svelte";
|
import { onMount, createEventDispatcher, getContext } from "svelte";
|
||||||
|
|
||||||
let className = "";
|
let className = "";
|
|
@ -5,7 +5,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import * as tr from "lib/i18n";
|
import * as tr from "lib/i18n";
|
||||||
import { getContext } from "svelte";
|
import { getContext } from "svelte";
|
||||||
import { modalsKey } from "components/contextKeys";
|
import { modalsKey } from "components/context-keys";
|
||||||
import type { DeckOptionsState, ConfigListEntry } from "./lib";
|
import type { DeckOptionsState, ConfigListEntry } from "./lib";
|
||||||
import type Modal from "bootstrap/js/dist/modal";
|
import type Modal from "bootstrap/js/dist/modal";
|
||||||
|
|
|
@ -4,7 +4,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
-->
|
-->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { getContext } from "svelte";
|
import { getContext } from "svelte";
|
||||||
import { nightModeKey } from "components/contextKeys";
|
import { nightModeKey } from "components/context-keys";
|
||||||
|
|
||||||
export let choices: string[];
|
export let choices: string[];
|
||||||
export let value: number = 0;
|
export let value: number = 0;
|
||||||
|
@ -24,8 +24,8 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@use "ts/sass/night_mode" as nightmode;
|
@use "ts/sass/night-mode" as nightmode;
|
||||||
@use "ts/sass/button_mixins" as button;
|
@use "ts/sass/button-mixins" as button;
|
||||||
|
|
||||||
.nightMode {
|
.nightMode {
|
||||||
@include nightmode.input;
|
@include nightmode.input;
|
|
@ -11,7 +11,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
import Badge from "./Badge.svelte";
|
import Badge from "./Badge.svelte";
|
||||||
import { revertIcon } from "./icons";
|
import { revertIcon } from "./icons";
|
||||||
import { isEqual as isEqualLodash, cloneDeep } from "lodash-es";
|
import { isEqual as isEqualLodash, cloneDeep } from "lodash-es";
|
||||||
import { touchDeviceKey } from "components/contextKeys";
|
import { touchDeviceKey } from "components/context-keys";
|
||||||
import { getContext } from "svelte";
|
import { getContext } from "svelte";
|
||||||
|
|
||||||
type T = unknown;
|
type T = unknown;
|
|
@ -4,7 +4,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
-->
|
-->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { getContext } from "svelte";
|
import { getContext } from "svelte";
|
||||||
import { nightModeKey } from "components/contextKeys";
|
import { nightModeKey } from "components/context-keys";
|
||||||
|
|
||||||
export let value: number;
|
export let value: number;
|
||||||
export let min = 1;
|
export let min = 1;
|
||||||
|
@ -34,7 +34,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@use "ts/sass/night_mode" as nightmode;
|
@use "ts/sass/night-mode" as nightmode;
|
||||||
|
|
||||||
.nightMode {
|
.nightMode {
|
||||||
@include nightmode.input;
|
@include nightmode.input;
|
|
@ -4,7 +4,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
-->
|
-->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { getContext } from "svelte";
|
import { getContext } from "svelte";
|
||||||
import { nightModeKey } from "components/contextKeys";
|
import { nightModeKey } from "components/context-keys";
|
||||||
|
|
||||||
export let value: number;
|
export let value: number;
|
||||||
export let min = 1;
|
export let min = 1;
|
||||||
|
@ -34,7 +34,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@use "ts/sass/night_mode" as nightmode;
|
@use "ts/sass/night-mode" as nightmode;
|
||||||
|
|
||||||
.nightMode {
|
.nightMode {
|
||||||
@include nightmode.input;
|
@include nightmode.input;
|
|
@ -4,7 +4,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
-->
|
-->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { getContext } from "svelte";
|
import { getContext } from "svelte";
|
||||||
import { nightModeKey } from "components/contextKeys";
|
import { nightModeKey } from "components/context-keys";
|
||||||
import { stepsToString, stringToSteps } from "./steps";
|
import { stepsToString, stringToSteps } from "./steps";
|
||||||
|
|
||||||
export let value: number[];
|
export let value: number[];
|
||||||
|
@ -28,7 +28,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@use "ts/sass/night_mode" as nightmode;
|
@use "ts/sass/night-mode" as nightmode;
|
||||||
|
|
||||||
.nightMode {
|
.nightMode {
|
||||||
@include nightmode.input;
|
@include nightmode.input;
|
|
@ -4,7 +4,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
-->
|
-->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { getContext } from "svelte";
|
import { getContext } from "svelte";
|
||||||
import { nightModeKey } from "components/contextKeys";
|
import { nightModeKey } from "components/context-keys";
|
||||||
|
|
||||||
export let id: string | undefined;
|
export let id: string | undefined;
|
||||||
export let value: boolean;
|
export let value: boolean;
|
|
@ -7,7 +7,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
@typescript-eslint/no-non-null-assertion: "off",
|
@typescript-eslint/no-non-null-assertion: "off",
|
||||||
*/
|
*/
|
||||||
import { onMount, onDestroy, getContext } from "svelte";
|
import { onMount, onDestroy, getContext } from "svelte";
|
||||||
import { nightModeKey, modalsKey } from "components/contextKeys";
|
import { nightModeKey, modalsKey } from "components/context-keys";
|
||||||
import Modal from "bootstrap/js/dist/modal";
|
import Modal from "bootstrap/js/dist/modal";
|
||||||
|
|
||||||
export let title: string;
|
export let title: string;
|
||||||
|
@ -96,7 +96,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@use "ts/sass/night_mode" as nightmode;
|
@use "ts/sass/night-mode" as nightmode;
|
||||||
|
|
||||||
.nightMode {
|
.nightMode {
|
||||||
@include nightmode.input;
|
@include nightmode.input;
|
|
@ -3,11 +3,11 @@
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" id="viewport" content="width=device-width" />
|
<meta name="viewport" id="viewport" content="width=device-width" />
|
||||||
<link href="deckoptions-base.css" rel="stylesheet" />
|
<link href="deck-options-base.css" rel="stylesheet" />
|
||||||
<link href="deckoptions.css" rel="stylesheet" />
|
<link href="deck-options.css" rel="stylesheet" />
|
||||||
<script src="../js/vendor/protobuf.min.js"></script>
|
<script src="../js/vendor/protobuf.min.js"></script>
|
||||||
<script src="../js/vendor/bootstrap.bundle.min.js"></script>
|
<script src="../js/vendor/bootstrap.bundle.min.js"></script>
|
||||||
<script src="deckoptions.js"></script>
|
<script src="deck-options.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="main"></div>
|
<div id="main"></div>
|
|
@ -14,7 +14,7 @@ import SpinBoxFloat from "./SpinBoxFloat.svelte";
|
||||||
import EnumSelector from "./EnumSelector.svelte";
|
import EnumSelector from "./EnumSelector.svelte";
|
||||||
import CheckBox from "./CheckBox.svelte";
|
import CheckBox from "./CheckBox.svelte";
|
||||||
|
|
||||||
import { nightModeKey, touchDeviceKey, modalsKey } from "components/contextKeys";
|
import { nightModeKey, touchDeviceKey, modalsKey } from "components/context-keys";
|
||||||
|
|
||||||
export async function deckOptions(
|
export async function deckOptions(
|
||||||
target: HTMLDivElement,
|
target: HTMLDivElement,
|
|
@ -4,8 +4,8 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
-->
|
-->
|
||||||
<script lang="typescript">
|
<script lang="typescript">
|
||||||
import * as tr from "lib/i18n";
|
import * as tr from "lib/i18n";
|
||||||
import { disabledKey } from "components/contextKeys";
|
import { disabledKey } from "components/context-keys";
|
||||||
import { inCodableKey } from "./contextKeys";
|
import { inCodableKey } from "./context-keys";
|
||||||
|
|
||||||
import IconButton from "components/IconButton.svelte";
|
import IconButton from "components/IconButton.svelte";
|
||||||
import WithShortcut from "components/WithShortcut.svelte";
|
import WithShortcut from "components/WithShortcut.svelte";
|
||||||
|
|
|
@ -3,7 +3,7 @@ Copyright: Ankitects Pty Ltd and contributors
|
||||||
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
-->
|
-->
|
||||||
<script lang="typescript">
|
<script lang="typescript">
|
||||||
import type { EditingArea } from "./editingArea";
|
import type { EditingArea } from "./editing-area";
|
||||||
import * as tr from "lib/i18n";
|
import * as tr from "lib/i18n";
|
||||||
|
|
||||||
import ButtonGroup from "components/ButtonGroup.svelte";
|
import ButtonGroup from "components/ButtonGroup.svelte";
|
||||||
|
|
|
@ -4,8 +4,8 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
-->
|
-->
|
||||||
<script lang="typescript">
|
<script lang="typescript">
|
||||||
import WithContext from "components/WithContext.svelte";
|
import WithContext from "components/WithContext.svelte";
|
||||||
import { disabledKey } from "components/contextKeys";
|
import { disabledKey } from "components/context-keys";
|
||||||
import { inCodableKey } from "./contextKeys";
|
import { inCodableKey } from "./context-keys";
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<WithContext key={disabledKey} let:context={disabled}>
|
<WithContext key={disabledKey} let:context={disabled}>
|
||||||
|
|
|
@ -5,8 +5,8 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
<script lang="typescript">
|
<script lang="typescript">
|
||||||
import * as tr from "lib/i18n";
|
import * as tr from "lib/i18n";
|
||||||
import { bridgeCommand } from "lib/bridgecommand";
|
import { bridgeCommand } from "lib/bridgecommand";
|
||||||
import { disabledKey } from "components/contextKeys";
|
import { disabledKey } from "components/context-keys";
|
||||||
import { inCodableKey } from "./contextKeys";
|
import { inCodableKey } from "./context-keys";
|
||||||
|
|
||||||
import ButtonGroup from "components/ButtonGroup.svelte";
|
import ButtonGroup from "components/ButtonGroup.svelte";
|
||||||
import ButtonGroupItem from "components/ButtonGroupItem.svelte";
|
import ButtonGroupItem from "components/ButtonGroupItem.svelte";
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
// Copyright: Ankitects Pty Ltd and contributors
|
// Copyright: Ankitects Pty Ltd and contributors
|
||||||
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
import type { EditingArea } from "./editingArea";
|
import type { EditingArea } from "./editing-area";
|
||||||
|
|
||||||
import { getCurrentField } from ".";
|
import { getCurrentField } from ".";
|
||||||
import { bridgeCommand } from "./lib";
|
import { bridgeCommand } from "./lib";
|
||||||
import { getNoteId } from "./noteId";
|
import { getNoteId } from "./note-id";
|
||||||
|
|
||||||
let changeTimer: number | null = null;
|
let changeTimer: number | null = null;
|
||||||
|
|
|
@ -10,8 +10,8 @@ import type { Codable } from "./codable";
|
||||||
|
|
||||||
import { updateActiveButtons } from "./toolbar";
|
import { updateActiveButtons } from "./toolbar";
|
||||||
import { bridgeCommand } from "./lib";
|
import { bridgeCommand } from "./lib";
|
||||||
import { onInput, onKey, onKeyUp } from "./inputHandlers";
|
import { onInput, onKey, onKeyUp } from "./input-handlers";
|
||||||
import { onFocus, onBlur } from "./focusHandlers";
|
import { onFocus, onBlur } from "./focus-handlers";
|
||||||
|
|
||||||
function onCutOrCopy(): void {
|
function onCutOrCopy(): void {
|
||||||
bridgeCommand("cutOrCopy");
|
bridgeCommand("cutOrCopy");
|
|
@ -1,8 +1,8 @@
|
||||||
// Copyright: Ankitects Pty Ltd and contributors
|
// Copyright: Ankitects Pty Ltd and contributors
|
||||||
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
import type { EditingArea } from "./editingArea";
|
import type { EditingArea } from "./editing-area";
|
||||||
import type { LabelContainer } from "./labelContainer";
|
import type { LabelContainer } from "./label-container";
|
||||||
|
|
||||||
export class EditorField extends HTMLDivElement {
|
export class EditorField extends HTMLDivElement {
|
||||||
labelContainer: LabelContainer;
|
labelContainer: LabelContainer;
|
|
@ -2,9 +2,9 @@
|
||||||
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
import { enableButtons, disableButtons } from "./toolbar";
|
import { enableButtons, disableButtons } from "./toolbar";
|
||||||
import type { EditingArea } from "./editingArea";
|
import type { EditingArea } from "./editing-area";
|
||||||
|
|
||||||
import { saveField } from "./changeTimer";
|
import { saveField } from "./change-timer";
|
||||||
import { bridgeCommand } from "./lib";
|
import { bridgeCommand } from "./lib";
|
||||||
|
|
||||||
export function onFocus(evt: FocusEvent): void {
|
export function onFocus(evt: FocusEvent): void {
|
|
@ -11,17 +11,17 @@ import { setupI18n, ModuleName } from "lib/i18n";
|
||||||
|
|
||||||
import "./fields.css";
|
import "./fields.css";
|
||||||
|
|
||||||
import { saveField } from "./changeTimer";
|
import { saveField } from "./change-timer";
|
||||||
|
|
||||||
import { EditorField } from "./editorField";
|
import { EditorField } from "./editor-field";
|
||||||
import { LabelContainer } from "./labelContainer";
|
import { LabelContainer } from "./label-container";
|
||||||
import { EditingArea } from "./editingArea";
|
import { EditingArea } from "./editing-area";
|
||||||
import { Editable } from "./editable";
|
import { Editable } from "./editable";
|
||||||
import { Codable } from "./codable";
|
import { Codable } from "./codable";
|
||||||
import { initToolbar } from "./toolbar";
|
import { initToolbar } from "./toolbar";
|
||||||
|
|
||||||
export { setNoteId, getNoteId } from "./noteId";
|
export { setNoteId, getNoteId } from "./note-id";
|
||||||
export { saveNow } from "./changeTimer";
|
export { saveNow } from "./change-timer";
|
||||||
export { wrap, wrapIntoText } from "./wrap";
|
export { wrap, wrapIntoText } from "./wrap";
|
||||||
export { editorToolbar } from "./toolbar";
|
export { editorToolbar } from "./toolbar";
|
||||||
|
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { updateActiveButtons } from "./toolbar";
|
import { updateActiveButtons } from "./toolbar";
|
||||||
import { EditingArea } from "./editingArea";
|
import { EditingArea } from "./editing-area";
|
||||||
import { nodeIsElement } from "./helpers";
|
import { nodeIsElement } from "./helpers";
|
||||||
import { triggerChangeTimer } from "./changeTimer";
|
import { triggerChangeTimer } from "./change-timer";
|
||||||
import { registerShortcut } from "lib/shortcuts";
|
import { registerShortcut } from "lib/shortcuts";
|
||||||
|
|
||||||
export function onInput(event: Event): void {
|
export function onInput(event: Event): void {
|
|
@ -6,8 +6,8 @@
|
||||||
@typescript-eslint/no-explicit-any: "off",
|
@typescript-eslint/no-explicit-any: "off",
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { disabledKey, nightModeKey } from "components/contextKeys";
|
import { disabledKey, nightModeKey } from "components/context-keys";
|
||||||
import { inCodableKey } from "./contextKeys";
|
import { inCodableKey } from "./context-keys";
|
||||||
import { writable } from "svelte/store";
|
import { writable } from "svelte/store";
|
||||||
|
|
||||||
import EditorToolbar from "./EditorToolbar.svelte";
|
import EditorToolbar from "./EditorToolbar.svelte";
|
||||||
|
|
|
@ -14,7 +14,7 @@ sass_library(
|
||||||
sass_library(
|
sass_library(
|
||||||
name = "buttons_lib",
|
name = "buttons_lib",
|
||||||
srcs = [
|
srcs = [
|
||||||
"_fusion_vars.scss",
|
"_fusion-vars.scss",
|
||||||
"buttons.scss",
|
"buttons.scss",
|
||||||
],
|
],
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
|
@ -23,7 +23,7 @@ sass_library(
|
||||||
sass_library(
|
sass_library(
|
||||||
name = "card_counts_lib",
|
name = "card_counts_lib",
|
||||||
srcs = [
|
srcs = [
|
||||||
"card_counts.scss",
|
"card-counts.scss",
|
||||||
],
|
],
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
|
@ -48,7 +48,7 @@ sass_library(
|
||||||
sass_library(
|
sass_library(
|
||||||
name = "button_mixins_lib",
|
name = "button_mixins_lib",
|
||||||
srcs = [
|
srcs = [
|
||||||
"button_mixins.scss",
|
"button-mixins.scss",
|
||||||
],
|
],
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
|
@ -56,7 +56,7 @@ sass_library(
|
||||||
sass_library(
|
sass_library(
|
||||||
name = "night_mode_lib",
|
name = "night_mode_lib",
|
||||||
srcs = [
|
srcs = [
|
||||||
"night_mode.scss",
|
"night-mode.scss",
|
||||||
],
|
],
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
|
|
2
ts/sass/bootstrap-dark.scss
vendored
2
ts/sass/bootstrap-dark.scss
vendored
|
@ -2,7 +2,7 @@
|
||||||
* License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html */
|
* License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html */
|
||||||
|
|
||||||
@use 'vars';
|
@use 'vars';
|
||||||
@use 'fusion_vars';
|
@use 'fusion-vars';
|
||||||
|
|
||||||
@mixin night-mode {
|
@mixin night-mode {
|
||||||
input,
|
input,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
@use 'fusion_vars';
|
@use 'fusion-vars';
|
||||||
|
|
||||||
.isWin {
|
.isWin {
|
||||||
button {
|
button {
|
||||||
|
@ -31,11 +31,11 @@
|
||||||
/* match the fusion button gradient */
|
/* match the fusion button gradient */
|
||||||
background: linear-gradient(
|
background: linear-gradient(
|
||||||
0deg,
|
0deg,
|
||||||
fusion_vars.$button-gradient-start 0%,
|
fusion-vars.$button-gradient-start 0%,
|
||||||
fusion_vars.$button-gradient-end 100%
|
fusion-vars.$button-gradient-end 100%
|
||||||
);
|
);
|
||||||
box-shadow: 0 0 3px fusion_vars.$button-outline;
|
box-shadow: 0 0 3px fusion-vars.$button-outline;
|
||||||
border: 1px solid fusion_vars.$button-border;
|
border: 1px solid fusion-vars.$button-border;
|
||||||
|
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
|
@ -44,7 +44,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
button:hover {
|
button:hover {
|
||||||
background: fusion_vars.$button-hover-bg;
|
background: fusion-vars.$button-hover-bg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue