From c71e530f3f5bd6284d66ac402d8d246eae8e54e5 Mon Sep 17 00:00:00 2001 From: Kitteh Date: Sun, 16 May 2021 18:17:12 +0100 Subject: [PATCH] Move makeElement to z-makeelement library. --- package.json | 1 + src/elements/CopyableInputBox.ts | 2 +- src/elements/CopyableModal.ts | 2 +- src/elements/FileUploadInput.ts | 2 +- src/elements/ListItem.ts | 2 +- src/elements/Margin.ts | 2 +- src/elements/MarginInline.ts | 2 +- src/elements/NavBar.ts | 2 +- src/elements/Option.ts | 2 +- src/elements/QRScanner.ts | 2 +- src/elements/SecretTitleElement.ts | 2 +- src/elements/Tile.ts | 2 +- src/htmlUtils.ts | 67 ----------------------- src/main.ts | 2 +- src/pages/Home.ts | 2 +- src/pages/KeyValue/KeyValueDelete.ts | 2 +- src/pages/KeyValue/KeyValueNew.ts | 2 +- src/pages/KeyValue/KeyValueSecret.ts | 2 +- src/pages/KeyValue/KeyValueSecretsEdit.ts | 2 +- src/pages/KeyValue/KeyValueVersions.ts | 2 +- src/pages/KeyValue/KeyValueView.ts | 2 +- src/pages/Login.ts | 2 +- src/pages/Me.ts | 2 +- src/pages/NewEngines/NewKVEngine.ts | 2 +- src/pages/NewEngines/NewTOTPEngine.ts | 2 +- src/pages/NewEngines/NewTransitEngine.ts | 2 +- src/pages/NewSecretsEngine.ts | 2 +- src/pages/PwGen.ts | 2 +- src/pages/SetLanguage.ts | 2 +- src/pages/SetVaultURL.ts | 2 +- src/pages/TOTP/NewTOTP.ts | 2 +- src/pages/TOTP/TOTPView.ts | 2 +- src/pages/Transit/NewTransitKey.ts | 2 +- src/pages/Transit/TransitDecrypt.ts | 3 +- src/pages/Transit/TransitEncrypt.ts | 3 +- src/pages/Transit/TransitRewrap.ts | 2 +- src/pages/Transit/TransitView.ts | 2 +- src/pages/Transit/TransitViewSecret.ts | 2 +- src/pages/Unseal.ts | 2 +- 39 files changed, 40 insertions(+), 104 deletions(-) diff --git a/package.json b/package.json index 869fcc7..4a96b38 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,7 @@ "webpack": "^5.37.0", "webpack-cli": "^4.7.0", "webpack-dev-server": "^3.11.2", + "z-makeelement": "^1.0.1", "z-pagerouter": "^1.0.1" } } diff --git a/src/elements/CopyableInputBox.ts b/src/elements/CopyableInputBox.ts index 71fdd84..6f6a19e 100644 --- a/src/elements/CopyableInputBox.ts +++ b/src/elements/CopyableInputBox.ts @@ -1,6 +1,6 @@ import { MarginInline } from "./MarginInline"; import { addClipboardNotifications } from "../pageUtils"; -import { makeElement } from "../htmlUtils"; +import { makeElement } from "z-makeelement"; import ClipboardJS from "clipboard"; import i18next from "i18next"; diff --git a/src/elements/CopyableModal.ts b/src/elements/CopyableModal.ts index 71271ad..37e5af5 100644 --- a/src/elements/CopyableModal.ts +++ b/src/elements/CopyableModal.ts @@ -1,5 +1,5 @@ import { addClipboardNotifications } from "../pageUtils"; -import { makeElement } from "../htmlUtils"; +import { makeElement } from "z-makeelement"; import ClipboardJS from "clipboard"; import FileSaver from "file-saver"; import UIkit from "uikit"; diff --git a/src/elements/FileUploadInput.ts b/src/elements/FileUploadInput.ts index 2d2390d..8774678 100644 --- a/src/elements/FileUploadInput.ts +++ b/src/elements/FileUploadInput.ts @@ -1,4 +1,4 @@ -import { makeElement } from "../htmlUtils"; +import { makeElement } from "z-makeelement"; import i18next from "i18next"; export function FileUploadInput(name: string): Element { diff --git a/src/elements/ListItem.ts b/src/elements/ListItem.ts index 7139d50..b63d19f 100644 --- a/src/elements/ListItem.ts +++ b/src/elements/ListItem.ts @@ -1,4 +1,4 @@ -import { makeElement } from "../htmlUtils"; +import { makeElement } from "z-makeelement"; export function ListItem(children: Element[] | Element): HTMLElement { return makeElement({ diff --git a/src/elements/Margin.ts b/src/elements/Margin.ts index 390e965..5f8629d 100644 --- a/src/elements/Margin.ts +++ b/src/elements/Margin.ts @@ -1,4 +1,4 @@ -import { makeElement } from "../htmlUtils"; +import { makeElement } from "z-makeelement"; export function Margin(children: Element | Element[]): Element { return makeElement({ diff --git a/src/elements/MarginInline.ts b/src/elements/MarginInline.ts index ea1247a..644d55f 100644 --- a/src/elements/MarginInline.ts +++ b/src/elements/MarginInline.ts @@ -1,4 +1,4 @@ -import { makeElement } from "../htmlUtils"; +import { makeElement } from "z-makeelement"; export function MarginInline(children: Element | Element[]): Element { return makeElement({ diff --git a/src/elements/NavBar.ts b/src/elements/NavBar.ts index 28eccae..032d0e8 100644 --- a/src/elements/NavBar.ts +++ b/src/elements/NavBar.ts @@ -1,6 +1,6 @@ import { ListItem } from "./ListItem"; import { PageRouter } from "z-pagerouter"; -import { makeElement } from "../htmlUtils"; +import { makeElement } from "z-makeelement"; import i18next from "i18next"; export function NavBar(router: PageRouter): HTMLElement { diff --git a/src/elements/Option.ts b/src/elements/Option.ts index 5f30a1a..7bcb6b3 100644 --- a/src/elements/Option.ts +++ b/src/elements/Option.ts @@ -1,4 +1,4 @@ -import { makeElement } from "../htmlUtils"; +import { makeElement } from "z-makeelement"; export function Option(label: string, value: string): HTMLElement { return makeElement({ diff --git a/src/elements/QRScanner.ts b/src/elements/QRScanner.ts index 8c8b99a..0426de8 100644 --- a/src/elements/QRScanner.ts +++ b/src/elements/QRScanner.ts @@ -1,5 +1,5 @@ import { Margin } from "./Margin"; -import { makeElement } from "../htmlUtils"; +import { makeElement } from "z-makeelement"; import QrScanner from "qr-scanner"; /* eslint-disable import/no-unresolved */ diff --git a/src/elements/SecretTitleElement.ts b/src/elements/SecretTitleElement.ts index e746b78..ba510c0 100644 --- a/src/elements/SecretTitleElement.ts +++ b/src/elements/SecretTitleElement.ts @@ -1,6 +1,6 @@ import { PageRouter } from "z-pagerouter"; import { PageState } from "../PageState"; -import { makeElement } from "../htmlUtils"; +import { makeElement } from "z-makeelement"; function currentTitleSecretText(state: PageState, suffix = ""): string { let currentSecretText = state.currentSecret; diff --git a/src/elements/Tile.ts b/src/elements/Tile.ts index b141452..f7eb5e7 100644 --- a/src/elements/Tile.ts +++ b/src/elements/Tile.ts @@ -1,4 +1,4 @@ -import { makeElement } from "../htmlUtils"; +import { makeElement } from "z-makeelement"; type TileParams = { condition?: boolean; diff --git a/src/htmlUtils.ts b/src/htmlUtils.ts index cd847d9..2efd7df 100644 --- a/src/htmlUtils.ts +++ b/src/htmlUtils.ts @@ -1,70 +1,3 @@ -import { getObjectKeys } from "./utils"; - -type optionsFunctionsObject = { - [key: string]: (e: Element, arg: unknown) => void; -}; - -const optionsFunctions: optionsFunctionsObject = { - class: (e: Element, arg: string | string[]) => { - if (!Array.isArray(arg)) { - arg = String(arg).split(" "); - } - e.classList.add(...arg); - }, - id: (e: Element, arg: string) => (e.id = arg), - html: (e: Element, arg: string) => (e.innerHTML = arg), - onclick: (e: Element, arg: () => void) => ((e as HTMLButtonElement).onclick = arg), - attributes: setElementAttributes, - text: (e: Element, arg: string) => ((e as HTMLParagraphElement).innerText = arg), - children: (e: Element, arg: Element | Element[]) => { - if (Array.isArray(arg)) { - arg.forEach((child) => { - if (child != null) e.appendChild(child); - }); - } else { - if (arg != null) e.appendChild(arg); - } - }, - thenRun: (e: Element, arg: (e: Element) => void) => arg(e), -}; - -interface ElementInfo { - condition?: boolean; - tag: string; - class?: string | string[]; - id?: string; - html?: string; - attributes?: Record; - children?: Element | Element[]; - text?: string; - thenRun?: (e: Element) => void; - onclick?: () => void; - [propName: string]: unknown; -} - -export function makeElement(elementInfo: ElementInfo): HTMLElement { - if ("condition" in elementInfo) { - if (!elementInfo.condition) { - return null; - } - } - const element = document.createElement(elementInfo.tag); - - for (const key of Object.getOwnPropertyNames(elementInfo)) { - if (getObjectKeys(optionsFunctions).includes(key)) { - optionsFunctions[key](element, elementInfo[key]); - } - } - - return element; -} - -export function setElementAttributes(element: Element, attributes: Record): void { - for (const key of Object.getOwnPropertyNames(attributes)) { - element.setAttribute(key, attributes[key]); - } -} - export const fileToBase64 = (file: File): Promise => new Promise((resolve, reject) => { const reader = new FileReader(); diff --git a/src/main.ts b/src/main.ts index 8677d9d..0cc0a84 100644 --- a/src/main.ts +++ b/src/main.ts @@ -23,7 +23,7 @@ import { NavBar } from "./elements/NavBar"; import { PageRouter } from "z-pagerouter"; import { formatDistance } from "./formatDistance"; import { getSealStatus } from "./api/sys/getSealStatus"; -import { makeElement } from "./htmlUtils"; +import { makeElement } from "z-makeelement"; import { pageList } from "./allPages"; import { pageState } from "./globalPageState"; import { playground } from "./playground"; diff --git a/src/pages/Home.ts b/src/pages/Home.ts index b9edc6a..5fed347 100644 --- a/src/pages/Home.ts +++ b/src/pages/Home.ts @@ -2,7 +2,7 @@ import { MountType, getMounts } from "../api/sys/getMounts"; import { Page } from "../types/Page"; import { getCapabilitiesPath } from "../api/sys/getCapabilities"; import { lookupSelf } from "../api/sys/lookupSelf"; -import { makeElement } from "../htmlUtils"; +import { makeElement } from "z-makeelement"; import { prePageChecks, setErrorText } from "../pageUtils"; import { sortedObjectMap } from "../utils"; import i18next from "i18next"; diff --git a/src/pages/KeyValue/KeyValueDelete.ts b/src/pages/KeyValue/KeyValueDelete.ts index 3f52ffd..7472555 100644 --- a/src/pages/KeyValue/KeyValueDelete.ts +++ b/src/pages/KeyValue/KeyValueDelete.ts @@ -1,7 +1,7 @@ import { Page } from "../../types/Page"; import { SecretTitleElement } from "../../elements/SecretTitleElement"; import { deleteSecret } from "../../api/kv/deleteSecret"; -import { makeElement } from "../../htmlUtils"; +import { makeElement } from "z-makeelement"; import i18next from "i18next"; export class KeyValueDeletePage extends Page { diff --git a/src/pages/KeyValue/KeyValueNew.ts b/src/pages/KeyValue/KeyValueNew.ts index 93ecd41..d2370e5 100644 --- a/src/pages/KeyValue/KeyValueNew.ts +++ b/src/pages/KeyValue/KeyValueNew.ts @@ -1,7 +1,7 @@ import { Page } from "../../types/Page"; import { SecretTitleElement } from "../../elements/SecretTitleElement"; import { createOrUpdateSecret } from "../../api/kv/createOrUpdateSecret"; -import { makeElement } from "../../htmlUtils"; +import { makeElement } from "z-makeelement"; import { setErrorText } from "../../pageUtils"; import i18next from "i18next"; diff --git a/src/pages/KeyValue/KeyValueSecret.ts b/src/pages/KeyValue/KeyValueSecret.ts index e19024a..d411ef5 100644 --- a/src/pages/KeyValue/KeyValueSecret.ts +++ b/src/pages/KeyValue/KeyValueSecret.ts @@ -3,7 +3,7 @@ import { Page } from "../../types/Page"; import { SecretTitleElement } from "../../elements/SecretTitleElement"; import { getCapabilities } from "../../api/sys/getCapabilities"; import { getSecret } from "../../api/kv/getSecret"; -import { makeElement } from "../../htmlUtils"; +import { makeElement } from "z-makeelement"; import { sortedObjectMap } from "../../utils"; import { undeleteSecret } from "../../api/kv/undeleteSecret"; import Prism from "prismjs"; diff --git a/src/pages/KeyValue/KeyValueSecretsEdit.ts b/src/pages/KeyValue/KeyValueSecretsEdit.ts index 52e8b5f..d5b35a3 100644 --- a/src/pages/KeyValue/KeyValueSecretsEdit.ts +++ b/src/pages/KeyValue/KeyValueSecretsEdit.ts @@ -3,7 +3,7 @@ import { Page } from "../../types/Page"; import { SecretTitleElement } from "../../elements/SecretTitleElement"; import { createOrUpdateSecret } from "../../api/kv/createOrUpdateSecret"; import { getSecret } from "../../api/kv/getSecret"; -import { makeElement } from "../../htmlUtils"; +import { makeElement } from "z-makeelement"; import { setErrorText } from "../../pageUtils"; import { sortedObjectMap, verifyJSONString } from "../../utils"; import i18next from "i18next"; diff --git a/src/pages/KeyValue/KeyValueVersions.ts b/src/pages/KeyValue/KeyValueVersions.ts index bbd15de..1bba1cb 100644 --- a/src/pages/KeyValue/KeyValueVersions.ts +++ b/src/pages/KeyValue/KeyValueVersions.ts @@ -1,7 +1,7 @@ import { Page } from "../../types/Page"; import { SecretTitleElement } from "../../elements/SecretTitleElement"; import { getSecretMetadata } from "../../api/kv/getSecretMetadata"; -import { makeElement } from "../../htmlUtils"; +import { makeElement } from "z-makeelement"; import { objectToMap } from "../../utils"; import i18next from "i18next"; diff --git a/src/pages/KeyValue/KeyValueView.ts b/src/pages/KeyValue/KeyValueView.ts index 71f34ba..d8fe49e 100644 --- a/src/pages/KeyValue/KeyValueView.ts +++ b/src/pages/KeyValue/KeyValueView.ts @@ -2,7 +2,7 @@ import { DoesNotExistError } from "../../types/internalErrors"; import { Page } from "../../types/Page"; import { SecretTitleElement } from "../../elements/SecretTitleElement"; import { getSecrets } from "../../api/kv/getSecrets"; -import { makeElement } from "../../htmlUtils"; +import { makeElement } from "z-makeelement"; import { setErrorText } from "../../pageUtils"; import i18next from "i18next"; diff --git a/src/pages/Login.ts b/src/pages/Login.ts index b588e85..99c4aff 100644 --- a/src/pages/Login.ts +++ b/src/pages/Login.ts @@ -2,7 +2,7 @@ import { Margin } from "../elements/Margin"; import { MarginInline } from "../elements/MarginInline"; import { Page } from "../types/Page"; import { lookupSelf } from "../api/sys/lookupSelf"; -import { makeElement } from "../htmlUtils"; +import { makeElement } from "z-makeelement"; import { setErrorText } from "../pageUtils"; import { usernameLogin } from "../api/auth/usernameLogin"; import i18next from "i18next"; diff --git a/src/pages/Me.ts b/src/pages/Me.ts index 3bd6ba5..ddddc19 100644 --- a/src/pages/Me.ts +++ b/src/pages/Me.ts @@ -1,7 +1,7 @@ import { Page } from "../types/Page"; import { addClipboardNotifications, prePageChecks, setErrorText } from "../pageUtils"; import { getCapabilitiesPath } from "../api/sys/getCapabilities"; -import { makeElement } from "../htmlUtils"; +import { makeElement } from "z-makeelement"; import { renewSelf } from "../api/sys/renewSelf"; import { sealVault } from "../api/sys/sealVault"; import ClipboardJS from "clipboard"; diff --git a/src/pages/NewEngines/NewKVEngine.ts b/src/pages/NewEngines/NewKVEngine.ts index 306c6dc..4aa8caa 100644 --- a/src/pages/NewEngines/NewKVEngine.ts +++ b/src/pages/NewEngines/NewKVEngine.ts @@ -1,7 +1,7 @@ import { Margin } from "../../elements/Margin"; import { Option } from "../../elements/Option"; import { Page } from "../../types/Page"; -import { makeElement } from "../../htmlUtils"; +import { makeElement } from "z-makeelement"; import { newMount } from "../../api/sys/newMount"; import { setErrorText } from "../../pageUtils"; import i18next from "i18next"; diff --git a/src/pages/NewEngines/NewTOTPEngine.ts b/src/pages/NewEngines/NewTOTPEngine.ts index 382064d..3bfcad8 100644 --- a/src/pages/NewEngines/NewTOTPEngine.ts +++ b/src/pages/NewEngines/NewTOTPEngine.ts @@ -1,6 +1,6 @@ import { Margin } from "../../elements/Margin"; import { Page } from "../../types/Page"; -import { makeElement } from "../../htmlUtils"; +import { makeElement } from "z-makeelement"; import { newMount } from "../../api/sys/newMount"; import { setErrorText } from "../../pageUtils"; import i18next from "i18next"; diff --git a/src/pages/NewEngines/NewTransitEngine.ts b/src/pages/NewEngines/NewTransitEngine.ts index 0566932..c92d466 100644 --- a/src/pages/NewEngines/NewTransitEngine.ts +++ b/src/pages/NewEngines/NewTransitEngine.ts @@ -1,6 +1,6 @@ import { Margin } from "../../elements/Margin"; import { Page } from "../../types/Page"; -import { makeElement } from "../../htmlUtils"; +import { makeElement } from "z-makeelement"; import { newMount } from "../../api/sys/newMount"; import { setErrorText } from "../../pageUtils"; import i18next from "i18next"; diff --git a/src/pages/NewSecretsEngine.ts b/src/pages/NewSecretsEngine.ts index cc0776f..f5b38e8 100644 --- a/src/pages/NewSecretsEngine.ts +++ b/src/pages/NewSecretsEngine.ts @@ -1,6 +1,6 @@ import { Page } from "../types/Page"; import { Tile } from "../elements/Tile"; -import { makeElement } from "../htmlUtils"; +import { makeElement } from "z-makeelement"; import i18next from "i18next"; export class NewSecretsEnginePage extends Page { diff --git a/src/pages/PwGen.ts b/src/pages/PwGen.ts index b72e48f..27daa95 100644 --- a/src/pages/PwGen.ts +++ b/src/pages/PwGen.ts @@ -2,7 +2,7 @@ import { CopyableInputBox, CopyableInputBoxType } from "../elements/CopyableInpu import { Margin } from "../elements/Margin"; import { Option } from "../elements/Option"; import { Page } from "../types/Page"; -import { makeElement } from "../htmlUtils"; +import { makeElement } from "z-makeelement"; import i18next from "i18next"; const passwordLengthMin = 1; diff --git a/src/pages/SetLanguage.ts b/src/pages/SetLanguage.ts index 7d5d0ef..ada13c1 100644 --- a/src/pages/SetLanguage.ts +++ b/src/pages/SetLanguage.ts @@ -1,6 +1,6 @@ import { Margin } from "../elements/Margin"; import { Page } from "../types/Page"; -import { makeElement } from "../htmlUtils"; +import { makeElement } from "z-makeelement"; import { reloadNavBar } from "../elements/NavBar"; import i18next from "i18next"; diff --git a/src/pages/SetVaultURL.ts b/src/pages/SetVaultURL.ts index e4d8d83..d1b3d91 100644 --- a/src/pages/SetVaultURL.ts +++ b/src/pages/SetVaultURL.ts @@ -1,5 +1,5 @@ import { Page } from "../types/Page"; -import { makeElement } from "../htmlUtils"; +import { makeElement } from "z-makeelement"; export class SetVaultURLPage extends Page { constructor() { diff --git a/src/pages/TOTP/NewTOTP.ts b/src/pages/TOTP/NewTOTP.ts index 17623b9..1756ef0 100644 --- a/src/pages/TOTP/NewTOTP.ts +++ b/src/pages/TOTP/NewTOTP.ts @@ -3,7 +3,7 @@ import { MarginInline } from "../../elements/MarginInline"; import { Page } from "../../types/Page"; import { SecretTitleElement } from "../../elements/SecretTitleElement"; import { addNewTOTP } from "../../api/totp/addNewTOTP"; -import { makeElement } from "../../htmlUtils"; +import { makeElement } from "z-makeelement"; import { setErrorText } from "../../pageUtils"; import i18next from "i18next"; diff --git a/src/pages/TOTP/TOTPView.ts b/src/pages/TOTP/TOTPView.ts index c451829..b442b19 100644 --- a/src/pages/TOTP/TOTPView.ts +++ b/src/pages/TOTP/TOTPView.ts @@ -4,7 +4,7 @@ import { Page } from "../../types/Page"; import { SecretTitleElement } from "../../elements/SecretTitleElement"; import { getTOTPCode } from "../../api/totp/getTOTPCode"; import { getTOTPKeys } from "../../api/totp/getTOTPKeys"; -import { makeElement } from "../../htmlUtils"; +import { makeElement } from "z-makeelement"; import { objectToMap } from "../../utils"; import { setErrorText } from "../../pageUtils"; import i18next from "i18next"; diff --git a/src/pages/Transit/NewTransitKey.ts b/src/pages/Transit/NewTransitKey.ts index 362a4fc..006b137 100644 --- a/src/pages/Transit/NewTransitKey.ts +++ b/src/pages/Transit/NewTransitKey.ts @@ -2,7 +2,7 @@ import { Margin } from "../../elements/Margin"; import { Option } from "../../elements/Option"; import { Page } from "../../types/Page"; import { SecretTitleElement } from "../../elements/SecretTitleElement"; -import { makeElement } from "../../htmlUtils"; +import { makeElement } from "z-makeelement"; import { newTransitKey } from "../../api/transit/newTransitKey"; import { setErrorText } from "../../pageUtils"; import i18next from "i18next"; diff --git a/src/pages/Transit/TransitDecrypt.ts b/src/pages/Transit/TransitDecrypt.ts index f0be5a8..e9da182 100644 --- a/src/pages/Transit/TransitDecrypt.ts +++ b/src/pages/Transit/TransitDecrypt.ts @@ -3,7 +3,8 @@ import { FileUploadInput } from "../../elements/FileUploadInput"; import { Margin } from "../../elements/Margin"; import { Page } from "../../types/Page"; import { SecretTitleElement } from "../../elements/SecretTitleElement"; -import { fileToBase64, makeElement } from "../../htmlUtils"; +import { fileToBase64 } from "../../htmlUtils"; +import { makeElement } from "z-makeelement"; import { setErrorText } from "../../pageUtils"; import { transitDecrypt } from "../../api/transit/transitDecrypt"; import i18next from "i18next"; diff --git a/src/pages/Transit/TransitEncrypt.ts b/src/pages/Transit/TransitEncrypt.ts index abd9d9c..1cf1169 100644 --- a/src/pages/Transit/TransitEncrypt.ts +++ b/src/pages/Transit/TransitEncrypt.ts @@ -3,7 +3,8 @@ import { FileUploadInput } from "../../elements/FileUploadInput"; import { Margin } from "../../elements/Margin"; import { Page } from "../../types/Page"; import { SecretTitleElement } from "../../elements/SecretTitleElement"; -import { fileToBase64, makeElement } from "../../htmlUtils"; +import { fileToBase64 } from "../../htmlUtils"; +import { makeElement } from "z-makeelement"; import { setErrorText } from "../../pageUtils"; import { transitEncrypt } from "../../api/transit/transitEncrypt"; import i18next from "i18next"; diff --git a/src/pages/Transit/TransitRewrap.ts b/src/pages/Transit/TransitRewrap.ts index 13af704..1c3cf68 100644 --- a/src/pages/Transit/TransitRewrap.ts +++ b/src/pages/Transit/TransitRewrap.ts @@ -4,7 +4,7 @@ import { Option } from "../../elements/Option"; import { Page } from "../../types/Page"; import { SecretTitleElement } from "../../elements/SecretTitleElement"; import { getTransitKey } from "../../api/transit/getTransitKey"; -import { makeElement } from "../../htmlUtils"; +import { makeElement } from "z-makeelement"; import { objectToMap } from "../../utils"; import { setErrorText } from "../../pageUtils"; import { transitRewrap } from "../../api/transit/transitRewrap"; diff --git a/src/pages/Transit/TransitView.ts b/src/pages/Transit/TransitView.ts index 7450d46..68440dc 100644 --- a/src/pages/Transit/TransitView.ts +++ b/src/pages/Transit/TransitView.ts @@ -2,7 +2,7 @@ import { DoesNotExistError } from "../../types/internalErrors"; import { Page } from "../../types/Page"; import { SecretTitleElement } from "../../elements/SecretTitleElement"; import { getTransitKeys } from "../../api/transit/getTransitKeys"; -import { makeElement } from "../../htmlUtils"; +import { makeElement } from "z-makeelement"; import { setErrorText } from "../../pageUtils"; import i18next from "i18next"; diff --git a/src/pages/Transit/TransitViewSecret.ts b/src/pages/Transit/TransitViewSecret.ts index 24dce71..556f591 100644 --- a/src/pages/Transit/TransitViewSecret.ts +++ b/src/pages/Transit/TransitViewSecret.ts @@ -2,7 +2,7 @@ import { Page } from "../../types/Page"; import { SecretTitleElement } from "../../elements/SecretTitleElement"; import { Tile } from "../../elements/Tile"; import { getTransitKey } from "../../api/transit/getTransitKey"; -import { makeElement } from "../../htmlUtils"; +import { makeElement } from "z-makeelement"; import i18next from "i18next"; export class TransitViewSecretPage extends Page { diff --git a/src/pages/Unseal.ts b/src/pages/Unseal.ts index 7aba5df..2944044 100644 --- a/src/pages/Unseal.ts +++ b/src/pages/Unseal.ts @@ -2,7 +2,7 @@ import { MarginInline } from "../elements/MarginInline"; import { Page } from "../types/Page"; import { QRScanner, QRScannerType } from "../elements/QRScanner"; import { SealStatusType, getSealStatus } from "../api/sys/getSealStatus"; -import { makeElement } from "../htmlUtils"; +import { makeElement } from "z-makeelement"; import { setErrorText } from "../pageUtils"; import { submitUnsealKey } from "../api/sys/submitUnsealKey"; import i18next from "i18next";