diff --git a/ui/core/components/importers.ts b/ui/core/components/importers.tsx similarity index 82% rename from ui/core/components/importers.ts rename to ui/core/components/importers.tsx index 303eefe341..a204096ce3 100644 --- a/ui/core/components/importers.ts +++ b/ui/core/components/importers.tsx @@ -1,5 +1,6 @@ import { JsonObject } from '@protobuf-ts/runtime'; import { default as pako } from 'pako'; +import { ref } from 'tsx-vanilla'; import { IndividualSimUI } from '../individual_sim_ui'; import { Class, EquipmentSpec, Glyphs, ItemSlot, ItemSpec, Profession, Race, Spec } from '../proto/common'; @@ -26,40 +27,46 @@ export abstract class Importer extends BaseModal { this.includeFile = includeFile; const uploadInputId = 'upload-input-' + title.toLowerCase().replaceAll(' ', '-'); - this.body.innerHTML = ` -
- - `; - this.footer!.innerHTML = ` - ${ - this.includeFile - ? ` - - - ` - : '' - } - - `; - - this.textElem = this.rootElem.getElementsByClassName('importer-textarea')[0] as HTMLTextAreaElement; - this.descriptionElem = this.rootElem.getElementsByClassName('import-description')[0] as HTMLElement; - - if (this.includeFile) { - const uploadInput = this.rootElem.getElementsByClassName('importer-upload-input')[0] as HTMLButtonElement; - uploadInput.addEventListener('change', async event => { - const data: string = await (event as any).target.files[0].text(); - this.textElem.textContent = data; + const descriptionElemRef = refImport settings from a JSON file, which can be created using the JSON Export feature.
-To import, upload the file or paste the text below, then click, 'Import'.
- `; + this.descriptionElem.appendChild( + <> +Import settings from a JSON file, which can be created using the JSON Export feature.
+To import, upload the file or paste the text below, then click, 'Import'.
+ >, + ); } async onImport(data: string) { @@ -220,23 +229,25 @@ export class IndividualJsonImporter- Import settings from 60 Upgrades. -
-- This feature imports gear, race, and (optionally) talents. It does NOT import buffs, debuffs, consumes, rotation, or custom stats. -
-- To import, paste the output from the site's export option below and click, 'Import'. -
- `; + this.descriptionElem.appendChild( + <> ++ Import settings from{' '} + + 60 Upgrades + + . +
+This feature imports gear, race, and (optionally) talents. It does NOT import buffs, debuffs, consumes, rotation, or custom stats.
+To import, paste the output from the site's export option below and click, 'Import'.
+ >, + ); } async onImport(data: string) { @@ -244,7 +255,7 @@ export class Individual80UImporter- Import settings from Wowhead Gear Planner. -
-- This feature imports gear, race, and (optionally) talents. It does NOT import buffs, debuffs, consumes, rotation, or custom stats. -
-- To import, paste the gear planner link below and click, 'Import'. -
- `; + this.descriptionElem.appendChild( + <> ++ Import settings from{' '} + + Wowhead Gear Planner + + . +
+This feature imports gear, race, and (optionally) talents. It does NOT import buffs, debuffs, consumes, rotation, or custom stats.
+To import, paste the gear planner link below and click, 'Import'.
+ >, + ); } async onImport(url: string) { @@ -475,17 +492,41 @@ export class IndividualAddonImporter- Import settings from the WoWSims Importer In-Game Addon. -
-- This feature imports gear, race, talents, glyphs, and professions. It does NOT import buffs, debuffs, consumes, rotation, or custom stats. -
-- To import, paste the output from the addon below and click, 'Import'. -
- `; + const warningRef = ref+ Import settings from the{' '} + + WoWSims Importer In-Game Addon + + . +
++ This feature imports gear, race, talents, glyphs, and professions. It does NOT import buffs, debuffs, consumes, rotation, or custom stats. +
+To import, paste the output from the addon below and click, 'Import'.
+ + >, + ); + + if (warningRef.value) + new Toast({ + title: 'Reforging issues', + body: ( + <> + There are known issues with Reforging when using the WSE addon. +