Rename anki/ to lib/ for export

import _ from "anki/x";

will become

import _ from "lib/x";

to fit the directory name.
This commit is contained in:
Henrik Giesel 2021-04-22 19:55:26 +02:00 committed by Damien Elmes
parent 8b4446d044
commit 1d72599a37
51 changed files with 94 additions and 94 deletions

View file

@ -3,12 +3,12 @@ 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="ts"> <script lang="ts">
import type pb from "anki/backend_proto"; import type pb from "lib/backend_proto";
import { buildNextLearnMsg } from "./lib"; import { buildNextLearnMsg } from "./lib";
import { bridgeLink } from "anki/bridgecommand"; import { bridgeLink } from "lib/bridgecommand";
export let info: pb.BackendProto.CongratsInfoOut; export let info: pb.BackendProto.CongratsInfoOut;
import * as tr from "anki/i18n"; import * as tr from "lib/i18n";
const congrats = tr.schedulingCongratulationsFinished(); const congrats = tr.schedulingCongratulationsFinished();
const nextLearnMsg = buildNextLearnMsg(info); const nextLearnMsg = buildNextLearnMsg(info);

View file

@ -2,8 +2,8 @@
// 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 { getCongratsInfo } from "./lib"; import { getCongratsInfo } from "./lib";
import { setupI18n, ModuleName } from "anki/i18n"; import { setupI18n, ModuleName } from "lib/i18n";
import { checkNightMode } from "anki/nightmode"; import { checkNightMode } from "lib/nightmode";
import CongratsPage from "./CongratsPage.svelte"; import CongratsPage from "./CongratsPage.svelte";

View file

@ -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 pb from "anki/backend_proto"; import pb from "lib/backend_proto";
import { postRequest } from "anki/postrequest"; import { postRequest } from "lib/postrequest";
import { naturalUnit, unitAmount, unitName } from "anki/time"; import { naturalUnit, unitAmount, unitName } from "lib/time";
import * as tr from "anki/i18n"; import * as tr from "lib/i18n";
export async function getCongratsInfo(): Promise<pb.BackendProto.CongratsInfoOut> { export async function getCongratsInfo(): Promise<pb.BackendProto.CongratsInfoOut> {
return pb.BackendProto.CongratsInfoOut.decode( return pb.BackendProto.CongratsInfoOut.decode(

View file

@ -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="ts"> <script lang="ts">
import * as tr from "anki/i18n"; import * as tr from "lib/i18n";
import type { DeckConfigState, ConfigListEntry } from "./lib"; import type { DeckConfigState, ConfigListEntry } from "./lib";
import OptionsDropdown from "./OptionsDropdown.svelte"; import OptionsDropdown from "./OptionsDropdown.svelte";

View file

@ -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="ts"> <script lang="ts">
import * as tr from "anki/i18n"; import * as tr from "lib/i18n";
import SpinBox from "./SpinBox.svelte"; import SpinBox from "./SpinBox.svelte";
import type { DeckConfigState } from "./lib"; import type { DeckConfigState } from "./lib";

View file

@ -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="ts"> <script lang="ts">
import * as tr from "anki/i18n"; import * as tr from "lib/i18n";
import SpinBox from "./SpinBox.svelte"; import SpinBox from "./SpinBox.svelte";
import CheckBox from "./CheckBox.svelte"; import CheckBox from "./CheckBox.svelte";
import type { DeckConfigState } from "./lib"; import type { DeckConfigState } from "./lib";

View file

@ -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="ts"> <script lang="ts">
import * as tr from "anki/i18n"; import * as tr from "lib/i18n";
import SpinBox from "./SpinBox.svelte"; import SpinBox from "./SpinBox.svelte";
import SpinBoxFloat from "./SpinBoxFloat.svelte"; import SpinBoxFloat from "./SpinBoxFloat.svelte";
import StepsInput from "./StepsInput.svelte"; import StepsInput from "./StepsInput.svelte";

View file

@ -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="ts"> <script lang="ts">
import * as tr from "anki/i18n"; import * as tr from "lib/i18n";
import SpinBox from "./SpinBox.svelte"; import SpinBox from "./SpinBox.svelte";
import SpinBoxFloat from "./SpinBoxFloat.svelte"; import SpinBoxFloat from "./SpinBoxFloat.svelte";
import CheckBox from "./CheckBox.svelte"; import CheckBox from "./CheckBox.svelte";

View file

@ -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="ts"> <script lang="ts">
import * as tr from "anki/i18n"; import * as tr from "lib/i18n";
import { textInputModal } from "./textInputModal"; import { textInputModal } from "./textInputModal";
import type { DeckConfigState } from "./lib"; import type { DeckConfigState } from "./lib";

View file

@ -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="ts"> <script lang="ts">
import * as tr from "anki/i18n"; import * as tr from "lib/i18n";
import SpinBox from "./SpinBox.svelte"; import SpinBox from "./SpinBox.svelte";
import SpinBoxFloat from "./SpinBoxFloat.svelte"; import SpinBoxFloat from "./SpinBoxFloat.svelte";
import CheckBox from "./CheckBox.svelte"; import CheckBox from "./CheckBox.svelte";

View file

@ -2,8 +2,8 @@
// 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 { getDeckConfigInfo, DeckConfigState } from "./lib"; import { getDeckConfigInfo, DeckConfigState } from "./lib";
import { setupI18n, ModuleName } from "anki/i18n"; import { setupI18n, ModuleName } from "lib/i18n";
import { checkNightMode } from "anki/nightmode"; import { checkNightMode } from "lib/nightmode";
import DeckConfigPage from "./DeckConfigPage.svelte"; import DeckConfigPage from "./DeckConfigPage.svelte";
export async function deckConfig( export async function deckConfig(

View file

@ -5,7 +5,7 @@
@typescript-eslint/no-explicit-any: "off", @typescript-eslint/no-explicit-any: "off",
*/ */
import * as pb from "anki/backend_proto"; import * as pb from "lib/backend_proto";
import { DeckConfigState } from "./lib"; import { DeckConfigState } from "./lib";
import { get } from "svelte/store"; import { get } from "svelte/store";

View file

@ -5,11 +5,11 @@
@typescript-eslint/no-non-null-assertion: "off", @typescript-eslint/no-non-null-assertion: "off",
*/ */
import pb from "anki/backend_proto"; import pb from "lib/backend_proto";
import { postRequest } from "anki/postrequest"; import { postRequest } from "lib/postrequest";
import { Writable, writable, get, Readable, readable } from "svelte/store"; import { Writable, writable, get, Readable, readable } from "svelte/store";
import { isEqual, cloneDeep } from "lodash-es"; import { isEqual, cloneDeep } from "lodash-es";
import * as tr from "anki/i18n"; import * as tr from "lib/i18n";
export async function getDeckConfigInfo( export async function getDeckConfigInfo(
deckId: number deckId: number

View file

@ -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
import { TimespanUnit, naturalWholeUnit, unitAmount, unitSeconds } from "anki/time"; import { TimespanUnit, naturalWholeUnit, unitAmount, unitSeconds } from "lib/time";
function unitSuffix(unit: TimespanUnit): string { function unitSuffix(unit: TimespanUnit): string {
switch (unit) { switch (unit) {

View file

@ -4,7 +4,7 @@ import type WithShortcut from "editor-toolbar/WithShortcut.svelte";
import type { WithShortcutProps } from "editor-toolbar/WithShortcut"; import type { WithShortcutProps } from "editor-toolbar/WithShortcut";
import type { DynamicSvelteComponent } from "sveltelib/dynamicComponent"; import type { DynamicSvelteComponent } from "sveltelib/dynamicComponent";
import * as tr from "anki/i18n"; import * as tr from "lib/i18n";
import { iconButton, withShortcut } from "editor-toolbar/dynamicComponents"; import { iconButton, withShortcut } from "editor-toolbar/dynamicComponents";
import bracketsIcon from "./code-brackets.svg"; import bracketsIcon from "./code-brackets.svg";

View file

@ -10,7 +10,7 @@ import {
buttonGroup, buttonGroup,
withShortcut, withShortcut,
} from "editor-toolbar/dynamicComponents"; } from "editor-toolbar/dynamicComponents";
import * as tr from "anki/i18n"; import * as tr from "lib/i18n";
import squareFillIcon from "./square-fill.svg"; import squareFillIcon from "./square-fill.svg";
import "./color.css"; import "./color.css";

View file

@ -8,7 +8,7 @@ import type { DynamicSvelteComponent } from "sveltelib/dynamicComponent";
import type { EditingArea } from "./editingArea"; import type { EditingArea } from "./editingArea";
import * as tr from "anki/i18n"; import * as tr from "lib/i18n";
import { import {
commandIconButton, commandIconButton,
iconButton, iconButton,

View file

@ -4,7 +4,7 @@ import type ButtonGroup from "editor-toolbar/ButtonGroup.svelte";
import type { ButtonGroupProps } from "editor-toolbar/ButtonGroup"; import type { ButtonGroupProps } from "editor-toolbar/ButtonGroup";
import type { DynamicSvelteComponent } from "sveltelib/dynamicComponent"; import type { DynamicSvelteComponent } from "sveltelib/dynamicComponent";
import * as tr from "anki/i18n"; import * as tr from "lib/i18n";
import { import {
commandIconButton, commandIconButton,
iconButton, iconButton,

View file

@ -3,7 +3,7 @@
import { filterHTML } from "html-filter"; import { filterHTML } from "html-filter";
import { updateActiveButtons, disableButtons } from "editor-toolbar"; import { updateActiveButtons, disableButtons } from "editor-toolbar";
import { setupI18n, ModuleName } from "anki/i18n"; import { setupI18n, ModuleName } from "lib/i18n";
import "./fields.css"; import "./fields.css";

View file

@ -5,7 +5,7 @@ import type { ButtonGroupProps } from "editor-toolbar/ButtonGroup";
import type { DynamicSvelteComponent } from "sveltelib/dynamicComponent"; import type { DynamicSvelteComponent } from "sveltelib/dynamicComponent";
import { bridgeCommand } from "anki/bridgecommand"; import { bridgeCommand } from "anki/bridgecommand";
import * as tr from "anki/i18n"; import * as tr from "lib/i18n";
import { import {
labelButton, labelButton,
buttonGroup, buttonGroup,

View file

@ -6,7 +6,7 @@ import type ButtonGroup from "editor-toolbar/ButtonGroup.svelte";
import type { ButtonGroupProps } from "editor-toolbar/ButtonGroup"; import type { ButtonGroupProps } from "editor-toolbar/ButtonGroup";
import type { DynamicSvelteComponent } from "sveltelib/dynamicComponent"; import type { DynamicSvelteComponent } from "sveltelib/dynamicComponent";
import { bridgeCommand } from "anki/bridgecommand"; import { bridgeCommand } from "lib/bridgecommand";
import { import {
iconButton, iconButton,
withDropdownMenu, withDropdownMenu,
@ -15,7 +15,7 @@ import {
buttonGroup, buttonGroup,
withShortcut, withShortcut,
} from "editor-toolbar/dynamicComponents"; } from "editor-toolbar/dynamicComponents";
import * as tr from "anki/i18n"; import * as tr from "lib/i18n";
import { wrap } from "./wrap"; import { wrap } from "./wrap";

View file

@ -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 pb from "anki/backend_proto"; import type pb from "lib/backend_proto";
import type { PreferenceStore } from "sveltelib/preferences"; import type { PreferenceStore } from "sveltelib/preferences";
import { createEventDispatcher } from "svelte"; import { createEventDispatcher } from "svelte";
@ -20,7 +20,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import type { GraphData } from "./added"; import type { GraphData } from "./added";
export let sourceData: pb.BackendProto.GraphsOut | null = null; export let sourceData: pb.BackendProto.GraphsOut | null = null;
import * as tr from "anki/i18n"; import * as tr from "lib/i18n";
export let preferences: PreferenceStore<pb.BackendProto.GraphPreferences>; export let preferences: PreferenceStore<pb.BackendProto.GraphPreferences>;
let histogramData = null as HistogramData | null; let histogramData = null as HistogramData | null;

View file

@ -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 pb from "anki/backend_proto"; import type pb from "lib/backend_proto";
import Graph from "./Graph.svelte"; import Graph from "./Graph.svelte";
import InputBox from "./InputBox.svelte"; import InputBox from "./InputBox.svelte";
@ -15,7 +15,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import { defaultGraphBounds, GraphRange, RevlogRange } from "./graph-helpers"; import { defaultGraphBounds, GraphRange, RevlogRange } from "./graph-helpers";
export let sourceData: pb.BackendProto.GraphsOut | null = null; export let sourceData: pb.BackendProto.GraphsOut | null = null;
import * as tr from "anki/i18n"; import * as tr from "lib/i18n";
export let revlogRange: RevlogRange; export let revlogRange: RevlogRange;
let graphRange: GraphRange = GraphRange.Year; let graphRange: GraphRange = GraphRange.Year;

View file

@ -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 pb from "anki/backend_proto"; import type pb from "lib/backend_proto";
import type { PreferenceStore } from "sveltelib/preferences"; import type { PreferenceStore } from "sveltelib/preferences";
import { createEventDispatcher } from "svelte"; import { createEventDispatcher } from "svelte";
@ -21,7 +21,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
export let sourceData: pb.BackendProto.GraphsOut; export let sourceData: pb.BackendProto.GraphsOut;
export let preferences: PreferenceStore<pb.BackendProto.GraphPreferences>; export let preferences: PreferenceStore<pb.BackendProto.GraphPreferences>;
export let revlogRange: RevlogRange; export let revlogRange: RevlogRange;
import * as tr from "anki/i18n"; import * as tr from "lib/i18n";
export let nightMode: boolean; export let nightMode: boolean;
let { calendarFirstDayOfWeek } = preferences; let { calendarFirstDayOfWeek } = preferences;

View file

@ -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 { createEventDispatcher } from "svelte"; import { createEventDispatcher } from "svelte";
import type pb from "anki/backend_proto"; import type pb from "lib/backend_proto";
import type { PreferenceStore } from "sveltelib/preferences"; import type { PreferenceStore } from "sveltelib/preferences";
import Graph from "./Graph.svelte"; import Graph from "./Graph.svelte";
@ -16,7 +16,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import type { GraphData, TableDatum } from "./card-counts"; import type { GraphData, TableDatum } from "./card-counts";
export let sourceData: pb.BackendProto.GraphsOut; export let sourceData: pb.BackendProto.GraphsOut;
import * as tr2 from "anki/i18n"; import * as tr2 from "lib/i18n";
export let preferences: PreferenceStore<pb.BackendProto.GraphPreferences>; export let preferences: PreferenceStore<pb.BackendProto.GraphPreferences>;
let { cardCountsSeparateInactive, browserLinksSupported } = preferences; let { cardCountsSeparateInactive, browserLinksSupported } = preferences;

View file

@ -3,8 +3,8 @@ 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 pb from "anki/backend_proto"; import type pb from "lib/backend_proto";
import * as tr from "anki/i18n"; import * as tr from "lib/i18n";
import type { PreferenceStore } from "sveltelib/preferences"; import type { PreferenceStore } from "sveltelib/preferences";
import { createEventDispatcher } from "svelte"; import { createEventDispatcher } from "svelte";

View file

@ -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 { createEventDispatcher } from "svelte"; import { createEventDispatcher } from "svelte";
import type pb from "anki/backend_proto"; import type pb from "lib/backend_proto";
import Graph from "./Graph.svelte"; import Graph from "./Graph.svelte";
import InputBox from "./InputBox.svelte"; import InputBox from "./InputBox.svelte";
@ -21,7 +21,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import type { GraphData } from "./future-due"; import type { GraphData } from "./future-due";
export let sourceData: pb.BackendProto.GraphsOut | null = null; export let sourceData: pb.BackendProto.GraphsOut | null = null;
import * as tr from "anki/i18n"; import * as tr from "lib/i18n";
export let preferences: PreferenceStore<pb.BackendProto.GraphPreferences>; export let preferences: PreferenceStore<pb.BackendProto.GraphPreferences>;
const dispatch = createEventDispatcher<SearchEventMap>(); const dispatch = createEventDispatcher<SearchEventMap>();

View file

@ -4,9 +4,9 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
--> -->
<script lang="typescript"> <script lang="typescript">
import { RevlogRange, GraphRange } from "./graph-helpers"; import { RevlogRange, GraphRange } from "./graph-helpers";
import { timeSpan, MONTH, YEAR } from "anki/time"; import { timeSpan, MONTH, YEAR } from "lib/time";
import * as tr from "anki/i18n"; import * as tr from "lib/i18n";
export let revlogRange: RevlogRange; export let revlogRange: RevlogRange;
export let graphRange: GraphRange; export let graphRange: GraphRange;
export let followRevlog: boolean = false; export let followRevlog: boolean = false;

View file

@ -6,7 +6,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import type { SvelteComponent } from "svelte/internal"; import type { SvelteComponent } from "svelte/internal";
import { writable } from "svelte/store"; import { writable } from "svelte/store";
import { bridgeCommand } from "anki/bridgecommand"; import { bridgeCommand } from "lib/bridgecommand";
import WithGraphData from "./WithGraphData.svelte"; import WithGraphData from "./WithGraphData.svelte";

View file

@ -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 pb from "anki/backend_proto"; import type pb from "lib/backend_proto";
import Graph from "./Graph.svelte"; import Graph from "./Graph.svelte";
import InputBox from "./InputBox.svelte"; import InputBox from "./InputBox.svelte";
@ -16,7 +16,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import { renderHours } from "./hours"; import { renderHours } from "./hours";
export let sourceData: pb.BackendProto.GraphsOut | null = null; export let sourceData: pb.BackendProto.GraphsOut | null = null;
import * as tr from "anki/i18n"; import * as tr from "lib/i18n";
export let revlogRange: RevlogRange; export let revlogRange: RevlogRange;
let graphRange: GraphRange = GraphRange.Year; let graphRange: GraphRange = GraphRange.Year;

View file

@ -3,9 +3,9 @@ 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 { timeSpan, MONTH } from "anki/time"; import { timeSpan, MONTH } from "lib/time";
import type pb from "anki/backend_proto"; import type pb from "lib/backend_proto";
import type { PreferenceStore } from "sveltelib/preferences"; import type { PreferenceStore } from "sveltelib/preferences";
import { createEventDispatcher } from "svelte"; import { createEventDispatcher } from "svelte";
@ -24,7 +24,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import type { TableDatum, SearchEventMap } from "./graph-helpers"; import type { TableDatum, SearchEventMap } from "./graph-helpers";
export let sourceData: pb.BackendProto.GraphsOut | null = null; export let sourceData: pb.BackendProto.GraphsOut | null = null;
import * as tr from "anki/i18n"; import * as tr from "lib/i18n";
export let preferences: PreferenceStore<pb.BackendProto.GraphPreferences>; export let preferences: PreferenceStore<pb.BackendProto.GraphPreferences>;
const dispatch = createEventDispatcher<SearchEventMap>(); const dispatch = createEventDispatcher<SearchEventMap>();

View file

@ -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 { GraphBounds } from "./graph-helpers"; import type { GraphBounds } from "./graph-helpers";
export let bounds: GraphBounds; export let bounds: GraphBounds;
import * as tr from "anki/i18n"; import * as tr from "lib/i18n";
const noData = tr.statisticsNoData(); const noData = tr.statisticsNoData();
</script> </script>

View file

@ -7,7 +7,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import InputBox from "./InputBox.svelte"; import InputBox from "./InputBox.svelte";
import * as tr from "anki/i18n"; import * as tr from "lib/i18n";
import { RevlogRange, daysToRevlogRange } from "./graph-helpers"; import { RevlogRange, daysToRevlogRange } from "./graph-helpers";
enum SearchRange { enum SearchRange {

View file

@ -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 pb from "anki/backend_proto"; import type pb from "lib/backend_proto";
import Graph from "./Graph.svelte"; import Graph from "./Graph.svelte";
import InputBox from "./InputBox.svelte"; import InputBox from "./InputBox.svelte";
@ -21,7 +21,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
export let sourceData: pb.BackendProto.GraphsOut | null = null; export let sourceData: pb.BackendProto.GraphsOut | null = null;
export let revlogRange: RevlogRange; export let revlogRange: RevlogRange;
import * as tr from "anki/i18n"; import * as tr from "lib/i18n";
let graphData: GraphData | null = null; let graphData: GraphData | null = null;

View file

@ -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 type { TableDatum } from "./graph-helpers"; import type { TableDatum } from "./graph-helpers";
import { i18n } from "anki/i18n"; import { i18n } from "lib/i18n";
export let tableData: TableDatum[]; export let tableData: TableDatum[];
</script> </script>

View file

@ -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 pb from "anki/backend_proto"; import type pb from "lib/backend_proto";
import Graph from "./Graph.svelte"; import Graph from "./Graph.svelte";

View file

@ -6,8 +6,8 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import type { Writable } from "svelte/store"; import type { Writable } from "svelte/store";
import type { PreferenceRaw, PreferencePayload } from "sveltelib/preferences"; import type { PreferenceRaw, PreferencePayload } from "sveltelib/preferences";
import pb from "anki/backend_proto"; import pb from "lib/backend_proto";
import { postRequest } from "anki/postrequest"; import { postRequest } from "lib/postrequest";
import useAsync from "sveltelib/async"; import useAsync from "sveltelib/async";
import useAsyncReactive from "sveltelib/asyncReactive"; import useAsyncReactive from "sveltelib/asyncReactive";

View file

@ -6,7 +6,7 @@
@typescript-eslint/no-explicit-any: "off", @typescript-eslint/no-explicit-any: "off",
*/ */
import type pb from "anki/backend_proto"; import type pb from "lib/backend_proto";
import { import {
extent, extent,
@ -19,10 +19,10 @@ import {
import type { Bin } from "d3"; import type { Bin } from "d3";
import type { HistogramData } from "./histogram-graph"; import type { HistogramData } from "./histogram-graph";
import { dayLabel } from "anki/time"; import { dayLabel } from "lib/time";
import { GraphRange } from "./graph-helpers"; import { GraphRange } from "./graph-helpers";
import type { TableDatum, SearchDispatch } from "./graph-helpers"; import type { TableDatum, SearchDispatch } from "./graph-helpers";
import * as tr from "anki/i18n"; import * as tr from "lib/i18n";
export interface GraphData { export interface GraphData {
daysAdded: number[]; daysAdded: number[];

View file

@ -6,7 +6,7 @@
@typescript-eslint/no-explicit-any: "off", @typescript-eslint/no-explicit-any: "off",
*/ */
import pb from "anki/backend_proto"; import pb from "lib/backend_proto";
import { import {
interpolateRdYlGn, interpolateRdYlGn,
@ -26,7 +26,7 @@ import {
GraphRange, GraphRange,
millisecondCutoffForRange, millisecondCutoffForRange,
} from "./graph-helpers"; } from "./graph-helpers";
import * as tr from "anki/i18n"; import * as tr from "lib/i18n";
type ButtonCounts = [number, number, number, number]; type ButtonCounts = [number, number, number, number];

View file

@ -5,7 +5,7 @@
@typescript-eslint/no-non-null-assertion: "off", @typescript-eslint/no-non-null-assertion: "off",
*/ */
import pb from "anki/backend_proto"; import pb from "lib/backend_proto";
import { import {
interpolateBlues, interpolateBlues,
select, select,
@ -29,8 +29,8 @@ import {
SearchDispatch, SearchDispatch,
} from "./graph-helpers"; } from "./graph-helpers";
import { clickableClass } from "./graph-styles"; import { clickableClass } from "./graph-styles";
import { i18n } from "anki/i18n"; import { i18n } from "lib/i18n";
import * as tr from "anki/i18n"; import * as tr from "lib/i18n";
export interface GraphData { export interface GraphData {
// indexed by day, where day is relative to today // indexed by day, where day is relative to today

View file

@ -6,8 +6,8 @@
@typescript-eslint/no-explicit-any: "off", @typescript-eslint/no-explicit-any: "off",
*/ */
import { CardQueue, CardType } from "anki/cards"; import { CardQueue, CardType } from "lib/cards";
import type pb from "anki/backend_proto"; import type pb from "lib/backend_proto";
import { import {
schemeGreens, schemeGreens,
schemeBlues, schemeBlues,
@ -22,7 +22,7 @@ import {
} from "d3"; } from "d3";
import type { GraphBounds } from "./graph-helpers"; import type { GraphBounds } from "./graph-helpers";
import * as tr from "anki/i18n"; import * as tr from "lib/i18n";
type Count = [string, number, boolean, string]; type Count = [string, number, boolean, string];
export interface GraphData { export interface GraphData {

View file

@ -6,7 +6,7 @@
@typescript-eslint/no-explicit-any: "off", @typescript-eslint/no-explicit-any: "off",
*/ */
import type pb from "anki/backend_proto"; import type pb from "lib/backend_proto";
import { import {
extent, extent,
histogram, histogram,
@ -16,11 +16,11 @@ import {
interpolateRdYlGn, interpolateRdYlGn,
} from "d3"; } from "d3";
import type { Bin, ScaleLinear } from "d3"; import type { Bin, ScaleLinear } from "d3";
import { CardType } from "anki/cards"; import { CardType } from "lib/cards";
import type { HistogramData } from "./histogram-graph"; import type { HistogramData } from "./histogram-graph";
import type { TableDatum, SearchDispatch } from "./graph-helpers"; import type { TableDatum, SearchDispatch } from "./graph-helpers";
import * as tr from "anki/i18n"; import * as tr from "lib/i18n";
export interface GraphData { export interface GraphData {
eases: number[]; eases: number[];

View file

@ -6,7 +6,7 @@
@typescript-eslint/no-explicit-any: "off", @typescript-eslint/no-explicit-any: "off",
*/ */
import type pb from "anki/backend_proto"; import type pb from "lib/backend_proto";
import { import {
extent, extent,
histogram, histogram,
@ -17,13 +17,13 @@ import {
interpolateGreens, interpolateGreens,
} from "d3"; } from "d3";
import type { Bin } from "d3"; import type { Bin } from "d3";
import { CardQueue } from "anki/cards"; import { CardQueue } from "lib/cards";
import type { HistogramData } from "./histogram-graph"; import type { HistogramData } from "./histogram-graph";
import { dayLabel } from "anki/time"; import { dayLabel } from "lib/time";
import { GraphRange } from "./graph-helpers"; import { GraphRange } from "./graph-helpers";
import type { TableDatum, SearchDispatch } from "./graph-helpers"; import type { TableDatum, SearchDispatch } from "./graph-helpers";
import * as tr from "anki/i18n"; import * as tr from "lib/i18n";
export interface GraphData { export interface GraphData {
dueCounts: Map<number, number>; dueCounts: Map<number, number>;

View file

@ -6,7 +6,7 @@
@typescript-eslint/no-explicit-any: "off", @typescript-eslint/no-explicit-any: "off",
@typescript-eslint/ban-ts-comment: "off" */ @typescript-eslint/ban-ts-comment: "off" */
import type pb from "anki/backend_proto"; import type pb from "lib/backend_proto";
import type { Selection } from "d3"; import type { Selection } from "d3";
// amount of data to fetch from backend // amount of data to fetch from backend

View file

@ -6,7 +6,7 @@
@typescript-eslint/no-explicit-any: "off", @typescript-eslint/no-explicit-any: "off",
*/ */
import pb from "anki/backend_proto"; import pb from "lib/backend_proto";
import { import {
interpolateBlues, interpolateBlues,
select, select,
@ -29,7 +29,7 @@ import {
millisecondCutoffForRange, millisecondCutoffForRange,
} from "./graph-helpers"; } from "./graph-helpers";
import { oddTickClass } from "./graph-styles"; import { oddTickClass } from "./graph-styles";
import * as tr from "anki/i18n"; import * as tr from "lib/i18n";
interface Hour { interface Hour {
hour: number; hour: number;

View file

@ -3,8 +3,8 @@
import type { SvelteComponent } from "svelte/internal"; import type { SvelteComponent } from "svelte/internal";
import { setupI18n, ModuleName } from "anki/i18n"; import { setupI18n, ModuleName } from "lib/i18n";
import { checkNightMode } from "anki/nightmode"; import { checkNightMode } from "lib/nightmode";
import GraphsPage from "./GraphsPage.svelte"; import GraphsPage from "./GraphsPage.svelte";

View file

@ -6,7 +6,7 @@
@typescript-eslint/no-explicit-any: "off", @typescript-eslint/no-explicit-any: "off",
*/ */
import type pb from "anki/backend_proto"; import type pb from "lib/backend_proto";
import { import {
extent, extent,
histogram, histogram,
@ -18,12 +18,12 @@ import {
interpolateBlues, interpolateBlues,
} from "d3"; } from "d3";
import type { Bin } from "d3"; import type { Bin } from "d3";
import { CardType } from "anki/cards"; import { CardType } from "lib/cards";
import type { HistogramData } from "./histogram-graph"; import type { HistogramData } from "./histogram-graph";
import type { TableDatum, SearchDispatch } from "./graph-helpers"; import type { TableDatum, SearchDispatch } from "./graph-helpers";
import { timeSpan } from "anki/time"; import { timeSpan } from "lib/time";
import * as tr from "anki/i18n"; import * as tr from "lib/i18n";
export interface IntervalGraphData { export interface IntervalGraphData {
intervals: number[]; intervals: number[];

View file

@ -6,9 +6,9 @@
@typescript-eslint/no-explicit-any: "off", @typescript-eslint/no-explicit-any: "off",
*/ */
import pb from "anki/backend_proto"; import pb from "lib/backend_proto";
import { timeSpan, dayLabel } from "anki/time"; import { timeSpan, dayLabel } from "lib/time";
import { import {
interpolateGreens, interpolateGreens,
interpolateReds, interpolateReds,
@ -34,7 +34,7 @@ import type { Bin } from "d3";
import type { TableDatum } from "./graph-helpers"; import type { TableDatum } from "./graph-helpers";
import { GraphBounds, setDataAvailable, GraphRange } from "./graph-helpers"; import { GraphBounds, setDataAvailable, GraphRange } from "./graph-helpers";
import { showTooltip, hideTooltip } from "./tooltip"; import { showTooltip, hideTooltip } from "./tooltip";
import * as tr from "anki/i18n"; import * as tr from "lib/i18n";
interface Reviews { interface Reviews {
learn: number; learn: number;

View file

@ -1,10 +1,10 @@
// 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 pb from "anki/backend_proto"; import pb from "lib/backend_proto";
import { studiedToday } from "anki/time"; import { studiedToday } from "lib/time";
import * as tr from "anki/i18n"; import * as tr from "lib/i18n";
export interface TodayData { export interface TodayData {
title: string; title: string;

View file

@ -52,7 +52,7 @@ ts_library(
data = [ data = [
"backend_proto", "backend_proto",
], ],
module_name = "anki", module_name = "lib",
tsconfig = "//:tsconfig.json", tsconfig = "//:tsconfig.json",
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
deps = [ deps = [

View file

@ -6,7 +6,7 @@
"lib": ["es2017", "es2019.array", "es2018.promise", "dom", "dom.iterable"], "lib": ["es2017", "es2019.array", "es2018.promise", "dom", "dom.iterable"],
"baseUrl": ".", "baseUrl": ".",
"paths": { "paths": {
"anki/*": ["../bazel-bin/ts/lib/*"], "lib/*": ["../bazel-bin/ts/lib/*"],
"sveltelib/*": ["../bazel-bin/ts/sveltelib/*"], "sveltelib/*": ["../bazel-bin/ts/sveltelib/*"],
"html-filter/*": ["../bazel-bin/ts/html-filter/*"], "html-filter/*": ["../bazel-bin/ts/html-filter/*"],
"editor-toolbar/*": ["../bazel-bin/ts/editor-toolbar/*"] "editor-toolbar/*": ["../bazel-bin/ts/editor-toolbar/*"]