diff --git a/src/core/islands/Modal.mjs b/src/core/islands/Modal.mjs index dad3161..4f403a0 100644 --- a/src/core/islands/Modal.mjs +++ b/src/core/islands/Modal.mjs @@ -7,8 +7,8 @@ function Modal(props, ...children) { const { html, extendProps, addKeyListener } = globalThis.__enhancerApi; extendProps(props, { - class: `notion-enhancer--menu-modal group - z-[999] fixed inset-0 w-screen h-screen + class: `notion-enhancer--menu-modal z-[999] + fixed inset-0 w-screen h-screen group/modal transition pointer-events-none opacity-0 open:(pointer-events-auto opacity-100)`, }); @@ -30,6 +30,9 @@ function Modal(props, ...children) { _openQueued = true; while (!document.contains($modal)) { if (!_openQueued) return; + // dont trigger open until menu is in dom, + // to ensure transition is shown when menu + // does initially open await new Promise(requestAnimationFrame); } $modal.setAttribute("open", ""); @@ -55,11 +58,10 @@ function Modal(props, ...children) { function Frame(props) { const { html, extendProps } = globalThis.__enhancerApi; extendProps(props, { - class: `rounded-[5px] w-[1150px] h-[calc(100vh-100px)] - max-w-[calc(100vw-100px)] max-h-[715px] overflow-hidden - bg-[color:var(--theme--bg-primary)] drop-shadow-xl - group-open:(pointer-events-auto opacity-100 scale-100) - transition opacity-0 scale-95`, + class: `rounded-[5px] w-[1150px] h-[calc(100vh-100px)] opacity-0 + max-w-[calc(100vw-100px)] max-h-[715px] overflow-hidden scale-95 + bg-[color:var(--theme--bg-primary)] drop-shadow-xl transition + group-open/modal:(pointer-events-auto opacity-100 scale-100)`, }); return html``; } diff --git a/src/core/islands/Panel.mjs b/src/core/islands/Panel.mjs index 7fb8aed..9cf4e33 100644 --- a/src/core/islands/Panel.mjs +++ b/src/core/islands/Panel.mjs @@ -6,6 +6,7 @@ */ import { Tooltip } from "./Tooltip.mjs"; +import { Select } from "../menu/islands/Select.mjs"; function PanelView(props) { const { html } = globalThis.__enhancerApi; @@ -27,21 +28,21 @@ function Panel({ transitionDuration = 300, ...props }) { - const { html, extendProps, setState } = globalThis.__enhancerApi, + const { html, extendProps, setState, useState } = globalThis.__enhancerApi, { addMutationListener, removeMutationListener } = globalThis.__enhancerApi; extendProps(props, { class: `notion-enhancer--side-panel order-2 shrink-0 transition-[width] open:w-[var(--side\\_panel--width)] - w-0 border-l-1 border-[color:var(--theme--fg-border)] - relative bg-[color:var(--theme--bg-primary)] group - duration-[${transitionDuration}ms]`, + border-l-1 border-[color:var(--theme--fg-border)] + relative bg-[color:var(--theme--bg-primary)] w-0 + duration-[${transitionDuration}ms] group/panel`, }); const $resizeHandle = html`
`, $chevronClose = html`