refactor: move svg rendering related code into separate module (#4588)

Co-authored-by: Alexandr <qwerty541zxc@gmail.com>
This commit is contained in:
Alexandr Garbuzov
2025-10-16 23:44:17 +03:00
committed by GitHub
co-authored by Alexandr
parent 33f6276b0b
commit c43fd65bdd
22 changed files with 22 additions and 22 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ import {
flexLayout,
iconWithLabel,
createLanguageNode,
} from "../common/utils.js";
} from "../common/render.js";
import Card from "../common/Card.js";
import { getCardColors } from "../common/color.js";
import { kFormatter, wrapTextMultiline } from "../common/fmt.js";
+1 -1
View File
@@ -12,7 +12,7 @@ import {
measureText,
iconWithLabel,
createLanguageNode,
} from "../common/utils.js";
} from "../common/render.js";
import { repoCardLocales } from "../translations.js";
const ICON_SIZE = 16;
+1 -1
View File
@@ -7,7 +7,7 @@ import { kFormatter } from "../common/fmt.js";
import { I18n } from "../common/I18n.js";
import { icons, rankIcon } from "../common/icons.js";
import { clampValue } from "../common/ops.js";
import { flexLayout, measureText } from "../common/utils.js";
import { flexLayout, measureText } from "../common/render.js";
import { statCardLocales, wakatimeCardLocales } from "../translations.js";
const CARD_MIN_WIDTH = 287;
+1 -1
View File
@@ -6,7 +6,7 @@ import { createProgressNode } from "../common/createProgressNode.js";
import { formatBytes } from "../common/fmt.js";
import { I18n } from "../common/I18n.js";
import { chunkArray, clampValue, lowercaseTrim } from "../common/ops.js";
import { flexLayout, measureText } from "../common/utils.js";
import { flexLayout, measureText } from "../common/render.js";
import { langCardLocales } from "../translations.js";
const DEFAULT_CARD_WIDTH = 300;
+1 -1
View File
@@ -5,7 +5,7 @@ import { getCardColors } from "../common/color.js";
import { createProgressNode } from "../common/createProgressNode.js";
import { I18n } from "../common/I18n.js";
import { clampValue, lowercaseTrim } from "../common/ops.js";
import { flexLayout } from "../common/utils.js";
import { flexLayout } from "../common/render.js";
import { wakatimeCardLocales } from "../translations.js";
/** Import language colors.
+1 -1
View File
@@ -1,4 +1,4 @@
import { encodeHTML, flexLayout } from "./utils.js";
import { encodeHTML, flexLayout } from "./render.js";
class Card {
/**
+1 -1
View File
@@ -1,6 +1,6 @@
// @ts-check
import { renderError } from "./utils.js";
import { renderError } from "./render.js";
import { blacklist } from "./blacklist.js";
import { whitelist, gistWhitelist } from "./envs.js";
+1 -1
View File
@@ -1,7 +1,7 @@
// @ts-check
import wrap from "word-wrap";
import { encodeHTML } from "./utils.js";
import { encodeHTML } from "./render.js";
/**
* Retrieves num with suffix k(thousands) precise to given decimal places.
+1 -1
View File
@@ -12,4 +12,4 @@ export {
encodeHTML,
flexLayout,
measureText,
} from "./utils.js";
} from "./render.js";
+1 -1
View File
@@ -1,6 +1,6 @@
// @ts-check
import { encodeHTML } from "./common/utils.js";
import { encodeHTML } from "./common/render.js";
/**
* Retrieves stat card labels in the available locales.