2022-07-12 02:55:03 +02:00
|
|
|
import * as mobx from "mobx";
|
2022-06-08 02:25:35 +02:00
|
|
|
import * as React from "react";
|
2023-08-22 06:37:04 +02:00
|
|
|
import { createRoot } from "react-dom/client";
|
|
|
|
import { sprintf } from "sprintf-js";
|
2023-09-24 06:05:06 +02:00
|
|
|
import { Main } from "./main/Main";
|
2023-09-28 00:03:08 +02:00
|
|
|
import { loadFonts } from "./util/util";
|
2023-09-18 06:00:54 +02:00
|
|
|
import * as DOMPurify from "dompurify";
|
2022-06-08 02:25:35 +02:00
|
|
|
|
2022-07-05 07:37:45 +02:00
|
|
|
// @ts-ignore
|
2023-01-17 18:59:31 +01:00
|
|
|
let VERSION = __PROMPT_VERSION__;
|
|
|
|
// @ts-ignore
|
|
|
|
let BUILD = __PROMPT_BUILD__;
|
2022-06-08 02:25:35 +02:00
|
|
|
|
2023-10-04 19:49:17 +02:00
|
|
|
//loadFonts();
|
2023-03-17 05:48:30 +01:00
|
|
|
|
2022-06-08 02:25:35 +02:00
|
|
|
document.addEventListener("DOMContentLoaded", () => {
|
2022-06-17 00:51:17 +02:00
|
|
|
let reactElem = React.createElement(Main, null, null);
|
2022-06-20 22:03:20 +02:00
|
|
|
let elem = document.getElementById("app");
|
2022-06-08 02:25:35 +02:00
|
|
|
let root = createRoot(elem);
|
2023-09-28 00:03:08 +02:00
|
|
|
// @check:font
|
|
|
|
// let isFontLoaded = document.fonts.check("12px 'JetBrains Mono'");
|
|
|
|
document.fonts.ready.then(() => {
|
2022-10-08 03:25:47 +02:00
|
|
|
root.render(reactElem);
|
2023-09-28 00:03:08 +02:00
|
|
|
});
|
2022-06-08 02:25:35 +02:00
|
|
|
});
|
|
|
|
|
2022-07-12 02:55:03 +02:00
|
|
|
(window as any).mobx = mobx;
|
2022-08-17 00:59:28 +02:00
|
|
|
(window as any).sprintf = sprintf;
|
2023-09-18 06:00:54 +02:00
|
|
|
(window as any).DOMPurify = DOMPurify;
|
2022-07-12 02:55:03 +02:00
|
|
|
|
2023-08-22 06:37:04 +02:00
|
|
|
console.log("PROMPT", VERSION, BUILD);
|