/** * notion-enhancer * (c) 2023 dragonwocky (https://dragonwocky.me/) * (https://notion-enhancer.github.io/) under the MIT license */ "use strict"; import { Heading } from "./Heading.mjs"; import { Description } from "./Description.mjs"; import { Checkbox } from "./Checkbox.mjs"; import { Button } from "./Button.mjs"; import { Tile } from "./Tile.mjs"; const privacyPolicy = "https://notion-enhancer.github.io/about/privacy-policy/", tsAndCs = "https://notion-enhancer.github.io/about/terms-and-conditions/"; function Onboarding() { const { html, setState, useState } = globalThis.__enhancerApi, { version, initDatabase } = globalThis.__enhancerApi, $submitAgreement = html`<${Button} icon="arrow-right" class="ml-auto" disabled >Continue `, $agreeToTerms = html`
<${Heading} class="mb-[8px]"> Thanks for installing the notion-enhancer! <${Description}> In order for the notion-enhancer to function, it may access, collect, process and/or store data on your device (including workspace content, device metadata, and notion-enhancer configuration) as described in its privacy policy. Unless otherwise stated, the notion-enhancer will never transmit your information from your device. Collection of anonymous telemetry data is enabled by default and can be disabled at any time through the menu.

The notion-enhancer is free and open-source software distributed under the MIT License without warranty of any kind. In no event shall the authors be liable for any consequences of the software's use. Before continuing, you must read and agree to the notion-enhancer's privacy policy and terms & conditions.
<${Checkbox} _set=${(checked) => ($submitAgreement.disabled = !checked)} _requireReload=${false} />

I have read and agree to the Privacy Policy and Terms & Conditions.

${$submitAgreement}
`; $submitAgreement.onclick = async () => { if ($submitAgreement.disabled) return; await initDatabase().set("agreedToTerms", version); setState({ rerender: true }); }; const $regularGreeting = html`
<${Tile} href="https://notion-enhancer.github.io/getting-started/basic-usage/" icon="graduation-cap" title="Stuck?" >Check out the usage guide. <${Tile} href="https://notion-enhancer.github.io/documentation/mods/" icon="package-plus" title="Something missing?" >Build your own extension. <${Tile} href="https://github.com/notion-enhancer/notion-enhancer/issues" icon="bug" title="Something broken?" >Report a bug.
`, $featuredSponsors = html`
<${Heading} class="mb-[8px]">Featured Sponsors <${Description}> A few awesome companies out there have teamed up with me to provide you with the notion-enhancer, free forever. Check them out!
<${Description} class="mt-[12px]"> Join this list.
`; useState(["rerender"], async () => { const agreedToTerms = await initDatabase().get("agreedToTerms"); $agreeToTerms.style.display = agreedToTerms === version ? "none" : ""; $regularGreeting.style.display = agreedToTerms === version ? "" : "none"; $featuredSponsors.style.display = agreedToTerms === version ? "" : "none"; }); return html`${$agreeToTerms}${$regularGreeting}`; } export { Onboarding };