refactor(es modules): move all files to src, try vite 3.0

This commit is contained in:
Azgaar 2022-06-27 01:07:42 +03:00
parent 4feed39d5c
commit 0d05e1b250
119 changed files with 8218 additions and 139 deletions

View file

@ -1,8 +1,8 @@
import {dragLegendBox} from "../modules/legend";
import {findCell, findGridCell} from "../utils/graphUtils";
import {tip, showMainTip} from "./tooltips";
import {si, convertTemperature} from "/src/utils/unitUtils";
import {debounce} from "/src/utils/functionUtils";
import {si, convertTemperature} from "../utils/unitUtils";
import {debounce} from "../utils/functionUtils";
export function restoreDefaultEvents() {
Zoom.setZoomBehavior();
@ -51,7 +51,7 @@ function handleMouseMove() {
}
// show note box on hover (if any)
function showNotes(event: Event) {
function showNotes(event) {
if (notesEditor?.offsetParent) return;
let id = event.target.id || event.target.parentNode.id || event.target.parentNode.parentNode.id;
if (event.target.parentNode.parentNode.id === "burgLabels") id = "burg" + event.target.dataset.id;
@ -70,7 +70,7 @@ function showNotes(event: Event) {
}
// show viewbox tooltip if main tooltip is blank
function showMapTooltip(point: number[], event: Event, packCellId: number, gridCellId: number) {
function showMapTooltip(point, event, packCellId, gridCellId) {
tip(""); // clear tip
const path = event.composedPath();
if (!path[path.length - 8]) return;

View file

@ -23,7 +23,8 @@ function addInstallationPrompt() {
"beforeinstallprompt",
async event => {
event.preventDefault();
const Installation = await import("../../modules/dynamic/installation.js");
// @ts-ignore
const Installation = await import("../modules/dynamic/installation.js");
Installation.init(event);
},
{once: true}

View file

@ -1,4 +1,4 @@
import {ERROR} from "/src/config/logging";
import {ERROR} from "../config/logging";
// prompt replacer (prompt does not work in Electron)
const $prompt: HTMLElement = document.getElementById("prompt")!;