@lerx/promise-modal 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/ModalManager.d.ts +0 -1
- package/dist/app/constant.d.ts +0 -1
- package/dist/bootstrap/BootstrapProvider/BootstrapProvider.d.ts +0 -1
- package/dist/bootstrap/BootstrapProvider/helpers/bootstrap.d.ts +0 -1
- package/dist/bootstrap/BootstrapProvider/hooks/useInitialize.d.ts +0 -1
- package/dist/bootstrap/BootstrapProvider/index.d.ts +0 -1
- package/dist/bootstrap/BootstrapProvider/type.d.ts +0 -1
- package/dist/bootstrap/BootstrapProvider/useBootstrap.d.ts +0 -1
- package/dist/bootstrap/index.d.ts +0 -1
- package/dist/components/Anchor/Anchor.d.ts +0 -1
- package/dist/components/Anchor/classNames.emotion.d.ts +0 -1
- package/dist/components/Anchor/index.d.ts +0 -1
- package/dist/components/Background/Background.d.ts +0 -1
- package/dist/components/Background/classNames.emotion.d.ts +0 -1
- package/dist/components/Background/index.d.ts +0 -1
- package/dist/components/FallbackComponents/FallbackContent.d.ts +0 -1
- package/dist/components/FallbackComponents/FallbackFooter.d.ts +0 -1
- package/dist/components/FallbackComponents/FallbackForegroundFrame.d.ts +0 -1
- package/dist/components/FallbackComponents/FallbackSubtitle.d.ts +0 -1
- package/dist/components/FallbackComponents/FallbackTitle.d.ts +0 -1
- package/dist/components/FallbackComponents/classNames.emotion.d.ts +0 -1
- package/dist/components/FallbackComponents/index.d.ts +0 -1
- package/dist/components/Foreground/Foreground.d.ts +0 -1
- package/dist/components/Foreground/classNames.emotion.d.ts +0 -1
- package/dist/components/Foreground/components/AlertInner.d.ts +0 -1
- package/dist/components/Foreground/components/ConfirmInner.d.ts +0 -1
- package/dist/components/Foreground/components/PromptInner.d.ts +0 -1
- package/dist/components/Foreground/components/index.d.ts +0 -1
- package/dist/components/Foreground/index.d.ts +0 -1
- package/dist/components/Presenter/Presenter.d.ts +0 -1
- package/dist/components/Presenter/classNames.emotion.d.ts +0 -1
- package/dist/components/Presenter/index.d.ts +0 -1
- package/dist/core/handle/alert.d.ts +0 -1
- package/dist/core/handle/confirm.d.ts +0 -1
- package/dist/core/handle/index.d.ts +0 -1
- package/dist/core/handle/prompt.d.ts +0 -1
- package/dist/core/index.d.ts +0 -1
- package/dist/core/node/ModalNode/AbstractNode.d.ts +0 -1
- package/dist/core/node/ModalNode/AlertNode.d.ts +0 -1
- package/dist/core/node/ModalNode/ConfirmNode.d.ts +0 -1
- package/dist/core/node/ModalNode/PromptNode.d.ts +0 -1
- package/dist/core/node/ModalNode/index.d.ts +0 -1
- package/dist/core/node/index.d.ts +0 -1
- package/dist/core/node/nodeFactory.d.ts +0 -1
- package/dist/core/node/type.d.ts +0 -1
- package/dist/hooks/useActiveModalCount.d.ts +0 -1
- package/dist/hooks/useDefaultPathname.d.ts +0 -1
- package/dist/hooks/useDestroyAfter.d.ts +0 -1
- package/dist/hooks/useModalAnimation.d.ts +0 -1
- package/dist/hooks/useSubscribeModal.d.ts +0 -1
- package/dist/index.cjs +966 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.mjs +953 -0
- package/dist/providers/ConfigurationContext/ConfigurationContext.d.ts +0 -1
- package/dist/providers/ConfigurationContext/ConfigurationContextProvider.d.ts +4 -1
- package/dist/providers/ConfigurationContext/index.d.ts +0 -1
- package/dist/providers/ConfigurationContext/useConfigurationContext.d.ts +0 -1
- package/dist/providers/ModalManagerContext/ModalManagerContext.d.ts +0 -1
- package/dist/providers/ModalManagerContext/ModalManagerContextProvider.d.ts +0 -1
- package/dist/providers/ModalManagerContext/index.d.ts +0 -1
- package/dist/providers/ModalManagerContext/useModalManagerContext.d.ts +0 -1
- package/dist/providers/UserDefinedContext/UserDefinedContext.d.ts +0 -1
- package/dist/providers/UserDefinedContext/UserDefinedContextProvider.d.ts +2 -2
- package/dist/providers/UserDefinedContext/index.d.ts +0 -1
- package/dist/providers/UserDefinedContext/useUserDefinedContext.d.ts +0 -1
- package/dist/providers/index.d.ts +0 -1
- package/dist/types/alert.d.ts +0 -1
- package/dist/types/background.d.ts +0 -1
- package/dist/types/base.d.ts +0 -1
- package/dist/types/confirm.d.ts +0 -1
- package/dist/types/index.d.ts +0 -1
- package/dist/types/modal.d.ts +0 -1
- package/dist/types/prompt.d.ts +0 -1
- package/package.json +19 -31
- package/dist/app/ModalManager.d.ts.map +0 -1
- package/dist/app/constant.d.ts.map +0 -1
- package/dist/bootstrap/BootstrapProvider/BootstrapProvider.d.ts.map +0 -1
- package/dist/bootstrap/BootstrapProvider/helpers/bootstrap.d.ts.map +0 -1
- package/dist/bootstrap/BootstrapProvider/hooks/useInitialize.d.ts.map +0 -1
- package/dist/bootstrap/BootstrapProvider/index.d.ts.map +0 -1
- package/dist/bootstrap/BootstrapProvider/type.d.ts.map +0 -1
- package/dist/bootstrap/BootstrapProvider/useBootstrap.d.ts.map +0 -1
- package/dist/bootstrap/index.d.ts.map +0 -1
- package/dist/components/Anchor/Anchor.d.ts.map +0 -1
- package/dist/components/Anchor/classNames.emotion.d.ts.map +0 -1
- package/dist/components/Anchor/index.d.ts.map +0 -1
- package/dist/components/Background/Background.d.ts.map +0 -1
- package/dist/components/Background/classNames.emotion.d.ts.map +0 -1
- package/dist/components/Background/index.d.ts.map +0 -1
- package/dist/components/FallbackComponents/FallbackContent.d.ts.map +0 -1
- package/dist/components/FallbackComponents/FallbackFooter.d.ts.map +0 -1
- package/dist/components/FallbackComponents/FallbackForegroundFrame.d.ts.map +0 -1
- package/dist/components/FallbackComponents/FallbackSubtitle.d.ts.map +0 -1
- package/dist/components/FallbackComponents/FallbackTitle.d.ts.map +0 -1
- package/dist/components/FallbackComponents/classNames.emotion.d.ts.map +0 -1
- package/dist/components/FallbackComponents/index.d.ts.map +0 -1
- package/dist/components/Foreground/Foreground.d.ts.map +0 -1
- package/dist/components/Foreground/classNames.emotion.d.ts.map +0 -1
- package/dist/components/Foreground/components/AlertInner.d.ts.map +0 -1
- package/dist/components/Foreground/components/ConfirmInner.d.ts.map +0 -1
- package/dist/components/Foreground/components/PromptInner.d.ts.map +0 -1
- package/dist/components/Foreground/components/index.d.ts.map +0 -1
- package/dist/components/Foreground/index.d.ts.map +0 -1
- package/dist/components/Presenter/Presenter.d.ts.map +0 -1
- package/dist/components/Presenter/classNames.emotion.d.ts.map +0 -1
- package/dist/components/Presenter/index.d.ts.map +0 -1
- package/dist/core/handle/alert.d.ts.map +0 -1
- package/dist/core/handle/confirm.d.ts.map +0 -1
- package/dist/core/handle/index.d.ts.map +0 -1
- package/dist/core/handle/prompt.d.ts.map +0 -1
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/node/ModalNode/AbstractNode.d.ts.map +0 -1
- package/dist/core/node/ModalNode/AlertNode.d.ts.map +0 -1
- package/dist/core/node/ModalNode/ConfirmNode.d.ts.map +0 -1
- package/dist/core/node/ModalNode/PromptNode.d.ts.map +0 -1
- package/dist/core/node/ModalNode/index.d.ts.map +0 -1
- package/dist/core/node/index.d.ts.map +0 -1
- package/dist/core/node/nodeFactory.d.ts.map +0 -1
- package/dist/core/node/type.d.ts.map +0 -1
- package/dist/hooks/useActiveModalCount.d.ts.map +0 -1
- package/dist/hooks/useDefaultPathname.d.ts.map +0 -1
- package/dist/hooks/useDestroyAfter.d.ts.map +0 -1
- package/dist/hooks/useModalAnimation.d.ts.map +0 -1
- package/dist/hooks/useSubscribeModal.d.ts.map +0 -1
- package/dist/index.cjs.js +0 -2
- package/dist/index.cjs.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.esm.js +0 -2
- package/dist/index.esm.js.map +0 -1
- package/dist/providers/ConfigurationContext/ConfigurationContext.d.ts.map +0 -1
- package/dist/providers/ConfigurationContext/ConfigurationContextProvider.d.ts.map +0 -1
- package/dist/providers/ConfigurationContext/index.d.ts.map +0 -1
- package/dist/providers/ConfigurationContext/useConfigurationContext.d.ts.map +0 -1
- package/dist/providers/ModalManagerContext/ModalManagerContext.d.ts.map +0 -1
- package/dist/providers/ModalManagerContext/ModalManagerContextProvider.d.ts.map +0 -1
- package/dist/providers/ModalManagerContext/index.d.ts.map +0 -1
- package/dist/providers/ModalManagerContext/useModalManagerContext.d.ts.map +0 -1
- package/dist/providers/UserDefinedContext/UserDefinedContext.d.ts.map +0 -1
- package/dist/providers/UserDefinedContext/UserDefinedContextProvider.d.ts.map +0 -1
- package/dist/providers/UserDefinedContext/index.d.ts.map +0 -1
- package/dist/providers/UserDefinedContext/useUserDefinedContext.d.ts.map +0 -1
- package/dist/providers/index.d.ts.map +0 -1
- package/dist/types/alert.d.ts.map +0 -1
- package/dist/types/background.d.ts.map +0 -1
- package/dist/types/base.d.ts.map +0 -1
- package/dist/types/confirm.d.ts.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/modal.d.ts.map +0 -1
- package/dist/types/prompt.d.ts.map +0 -1
package/dist/index.cjs.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../src/app/ModalManager.ts","../src/core/node/ModalNode/AbstractNode.ts","../src/core/node/ModalNode/AlertNode.ts","../src/core/node/ModalNode/ConfirmNode.ts","../src/core/node/ModalNode/PromptNode.ts","../src/core/node/nodeFactory.ts","../src/providers/ModalManagerContext/ModalManagerContext.ts","../src/providers/ModalManagerContext/ModalManagerContextProvider.tsx","../src/providers/ModalManagerContext/useModalManagerContext.ts","../src/components/FallbackComponents/classNames.emotion.ts","../src/components/FallbackComponents/FallbackTitle.tsx","../src/components/FallbackComponents/FallbackSubtitle.tsx","../src/components/FallbackComponents/FallbackContent.tsx","../src/components/FallbackComponents/FallbackFooter.tsx","../src/hooks/useActiveModalCount.ts","../src/components/FallbackComponents/FallbackForegroundFrame.tsx","../src/providers/ConfigurationContext/ConfigurationContext.ts","../src/providers/ConfigurationContext/ConfigurationContextProvider.tsx","../src/app/constant.ts","../src/providers/ConfigurationContext/useConfigurationContext.ts","../src/providers/UserDefinedContext/UserDefinedContext.ts","../src/providers/UserDefinedContext/UserDefinedContextProvider.tsx","../src/providers/UserDefinedContext/useUserDefinedContext.ts","../src/hooks/useDefaultPathname.ts","../src/components/Background/classNames.emotion.ts","../src/components/Background/Background.tsx","../src/components/Foreground/classNames.emotion.ts","../src/components/Foreground/components/AlertInner.tsx","../src/components/Foreground/components/ConfirmInner.tsx","../src/components/Foreground/components/PromptInner.tsx","../src/components/Foreground/Foreground.tsx","../src/hooks/useSubscribeModal.ts","../src/components/Presenter/classNames.emotion.ts","../src/components/Presenter/Presenter.tsx","../src/components/Anchor/classNames.emotion.ts","../src/components/Anchor/Anchor.tsx","../src/bootstrap/BootstrapProvider/helpers/bootstrap.tsx","../src/bootstrap/BootstrapProvider/hooks/useInitialize.ts","../src/bootstrap/BootstrapProvider/BootstrapProvider.tsx","../src/core/handle/alert.ts","../src/core/handle/confirm.ts","../src/core/handle/prompt.ts","../src/hooks/useDestroyAfter.ts","../src/bootstrap/BootstrapProvider/useBootstrap.tsx","../src/hooks/useModalAnimation.ts"],"sourcesContent":["import { getRandomString } from '@winglet/common-utils';\n\nimport type { Fn } from '@aileron/declare';\n\nimport type { Modal } from '@/promise-modal/types';\n\nexport class ModalManager {\n static #active = false;\n static activate() {\n if (ModalManager.#active) return false;\n return (ModalManager.#active = true);\n }\n\n static #anchor: HTMLElement | null = null;\n static anchor(options?: {\n tag?: string;\n prefix?: string;\n root?: HTMLElement;\n }): HTMLElement {\n if (ModalManager.#anchor) {\n const anchor = document.getElementById(ModalManager.#anchor.id);\n if (anchor) return anchor;\n }\n const {\n tag = 'div',\n prefix = 'promise-modal',\n root = document.body,\n } = options || {};\n const node = document.createElement(tag);\n node.setAttribute('id', `${prefix}-${getRandomString(36)}`);\n root.appendChild(node);\n ModalManager.#anchor = node;\n return node;\n }\n\n static #prerenderList: Modal[] = [];\n static get prerender() {\n return ModalManager.#prerenderList;\n }\n\n static #openHandler: Fn<[Modal], void> = (modal: Modal) =>\n ModalManager.#prerenderList.push(modal);\n static set openHandler(handler: Fn<[Modal], void>) {\n ModalManager.#openHandler = handler;\n ModalManager.#prerenderList = [];\n }\n\n static get unanchored() {\n return !ModalManager.#anchor;\n }\n\n static reset() {\n ModalManager.#active = false;\n ModalManager.#anchor = null;\n ModalManager.#prerenderList = [];\n ModalManager.#openHandler = (modal: Modal) =>\n ModalManager.#prerenderList.push(modal);\n }\n\n static open(modal: Modal) {\n ModalManager.#openHandler(modal);\n }\n}\n","import type { ReactNode } from 'react';\n\nimport type { Fn } from '@aileron/declare';\n\nimport type {\n BackgroundComponent,\n BaseModal,\n ForegroundComponent,\n ManagedEntity,\n ModalBackground,\n} from '@/promise-modal/types';\n\ntype AbstractNodeProps<T, B> = BaseModal<T, B> & ManagedEntity;\n\nexport abstract class AbstractNode<T, B> {\n readonly id: number;\n readonly initiator: string;\n\n readonly title?: ReactNode;\n readonly subtitle?: ReactNode;\n readonly background?: ModalBackground<B>;\n\n readonly manualDestroy: boolean;\n readonly closeOnBackdropClick: boolean;\n readonly dimmed: boolean;\n\n readonly ForegroundComponent?: ForegroundComponent;\n readonly BackgroundComponent?: BackgroundComponent;\n\n #alive: boolean;\n get alive() {\n return this.#alive;\n }\n #visible: boolean;\n get visible() {\n return this.#visible;\n }\n\n #resolve: (result: T | null) => void;\n #listeners: Set<Fn> = new Set();\n\n constructor({\n id,\n initiator,\n title,\n subtitle,\n background,\n dimmed = true,\n manualDestroy = false,\n closeOnBackdropClick = true,\n resolve,\n ForegroundComponent,\n BackgroundComponent,\n }: AbstractNodeProps<T, B>) {\n this.id = id;\n this.initiator = initiator;\n this.title = title;\n this.subtitle = subtitle;\n this.background = background;\n\n this.dimmed = dimmed;\n this.manualDestroy = manualDestroy;\n this.closeOnBackdropClick = closeOnBackdropClick;\n\n this.ForegroundComponent = ForegroundComponent;\n this.BackgroundComponent = BackgroundComponent;\n\n this.#alive = true;\n this.#visible = true;\n this.#resolve = resolve;\n }\n\n subscribe(listener: Fn) {\n this.#listeners.add(listener);\n return () => {\n this.#listeners.delete(listener);\n };\n }\n publish() {\n for (const listener of this.#listeners) listener();\n }\n protected resolve(result: T | null) {\n this.#resolve(result);\n }\n onDestroy() {\n const needPublish = this.#alive === true;\n this.#alive = false;\n if (this.manualDestroy && needPublish) this.publish();\n }\n onShow() {\n const needPublish = this.#visible === false;\n this.#visible = true;\n if (needPublish) this.publish();\n }\n onHide() {\n const needPublish = this.#visible === true;\n this.#visible = false;\n if (needPublish) this.publish();\n }\n abstract onClose(): void;\n abstract onConfirm(): void;\n}\n","import type { ComponentType, ReactNode } from 'react';\n\nimport type {\n AlertContentProps,\n AlertFooterRender,\n AlertModal,\n FooterOptions,\n ManagedEntity,\n} from '@/promise-modal/types';\n\nimport { AbstractNode } from './AbstractNode';\n\ntype AlertNodeProps<B> = AlertModal<B> & ManagedEntity;\n\nexport class AlertNode<B> extends AbstractNode<null, B> {\n readonly type: 'alert';\n readonly subtype?: 'info' | 'success' | 'warning' | 'error';\n readonly content?: ReactNode | ComponentType<AlertContentProps>;\n readonly footer?:\n | AlertFooterRender\n | Pick<FooterOptions, 'confirm' | 'hideConfirm'>\n | false;\n\n constructor({\n id,\n initiator,\n type,\n subtype,\n title,\n subtitle,\n content,\n footer,\n background,\n dimmed,\n manualDestroy,\n closeOnBackdropClick,\n resolve,\n ForegroundComponent,\n BackgroundComponent,\n }: AlertNodeProps<B>) {\n super({\n id,\n initiator,\n title,\n subtitle,\n background,\n dimmed,\n manualDestroy,\n closeOnBackdropClick,\n resolve,\n ForegroundComponent,\n BackgroundComponent,\n });\n this.type = type;\n this.subtype = subtype;\n this.content = content;\n this.footer = footer;\n }\n onClose() {\n this.resolve(null);\n }\n onConfirm() {\n this.resolve(null);\n }\n}\n","import type { ComponentType, ReactNode } from 'react';\n\nimport type {\n ConfirmContentProps,\n ConfirmFooterRender,\n ConfirmModal,\n FooterOptions,\n ManagedEntity,\n} from '@/promise-modal/types';\n\nimport { AbstractNode } from './AbstractNode';\n\ntype ConfirmNodeProps<B> = ConfirmModal<B> & ManagedEntity;\n\nexport class ConfirmNode<B> extends AbstractNode<boolean, B> {\n readonly type: 'confirm';\n readonly subtype?: 'info' | 'success' | 'warning' | 'error';\n readonly content?: ReactNode | ComponentType<ConfirmContentProps>;\n readonly footer?: ConfirmFooterRender | FooterOptions | false;\n\n constructor({\n id,\n initiator,\n type,\n subtype,\n title,\n subtitle,\n content,\n footer,\n background,\n dimmed,\n manualDestroy,\n closeOnBackdropClick,\n resolve,\n ForegroundComponent,\n BackgroundComponent,\n }: ConfirmNodeProps<B>) {\n super({\n id,\n initiator,\n title,\n subtitle,\n background,\n dimmed,\n manualDestroy,\n closeOnBackdropClick,\n resolve,\n ForegroundComponent,\n BackgroundComponent,\n });\n this.type = type;\n this.subtype = subtype;\n this.content = content;\n this.footer = footer;\n }\n onClose() {\n this.resolve(false);\n }\n onConfirm() {\n this.resolve(true);\n }\n}\n","import type { ComponentType, ReactNode } from 'react';\n\nimport type {\n FooterOptions,\n ManagedEntity,\n PromptContentProps,\n PromptFooterRender,\n PromptInputProps,\n PromptModal,\n} from '@/promise-modal/types';\n\nimport { AbstractNode } from './AbstractNode';\n\ntype PromptNodeProps<T, B> = PromptModal<T, B> & ManagedEntity;\n\nexport class PromptNode<T, B> extends AbstractNode<T, B> {\n readonly type: 'prompt';\n readonly content?: ReactNode | ComponentType<PromptContentProps>;\n readonly defaultValue: T | undefined;\n readonly Input: (props: PromptInputProps<T>) => ReactNode;\n readonly disabled?: (value: T) => boolean;\n readonly returnOnCancel?: boolean;\n readonly footer?: PromptFooterRender<T> | FooterOptions | false;\n\n #value: T | undefined;\n\n constructor({\n id,\n initiator,\n type,\n title,\n subtitle,\n content,\n defaultValue,\n Input,\n disabled,\n returnOnCancel,\n footer,\n background,\n dimmed,\n manualDestroy,\n closeOnBackdropClick,\n resolve,\n ForegroundComponent,\n BackgroundComponent,\n }: PromptNodeProps<T, B>) {\n super({\n id,\n initiator,\n title,\n subtitle,\n background,\n dimmed,\n manualDestroy,\n closeOnBackdropClick,\n resolve,\n ForegroundComponent,\n BackgroundComponent,\n });\n this.type = type;\n this.content = content;\n this.Input = Input;\n this.defaultValue = defaultValue;\n this.#value = defaultValue;\n this.disabled = disabled;\n this.returnOnCancel = returnOnCancel;\n this.footer = footer;\n }\n\n onChange(value: T) {\n this.#value = value;\n }\n onConfirm() {\n this.resolve(this.#value ?? null);\n }\n onClose() {\n if (this.returnOnCancel) this.resolve(this.#value ?? null);\n else this.resolve(null);\n }\n}\n","import type { ManagedModal } from '@/promise-modal/types';\n\nimport { AlertNode, ConfirmNode, PromptNode } from './ModalNode';\n\nexport const nodeFactory = <T, B>(modal: ManagedModal<T, B>) => {\n switch (modal.type) {\n case 'alert':\n return new AlertNode<B>(modal);\n case 'confirm':\n return new ConfirmNode<B>(modal);\n case 'prompt':\n return new PromptNode<T, B>(modal);\n }\n // @ts-expect-error: This state is unreachable by design and should NEVER occur.\n throw new Error(`Unknown modal: ${modal.type}`, { modal });\n};\n","import { createContext } from 'react';\n\nimport type { Fn } from '@aileron/declare';\n\nimport type { ModalNode } from '@/promise-modal/core';\nimport type { ModalActions, ModalHandlersWithId } from '@/promise-modal/types';\n\nexport interface ModalManagerContextProps extends ModalHandlersWithId {\n modalIds: ModalNode['id'][];\n getModal: Fn<[id: ModalNode['id']], ModalActions>;\n getModalNode: Fn<[id: ModalNode['id']], ModalNode | undefined>;\n setUpdater: Fn<[updater: Fn]>;\n}\n\nexport const ModalManagerContext = createContext<ModalManagerContextProps>(\n {} as ModalManagerContextProps,\n);\n","import {\n type PropsWithChildren,\n memo,\n useCallback,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { convertMsFromDuration } from '@winglet/common-utils';\nimport { useOnMountLayout, useReference } from '@winglet/react-utils';\n\nimport type { Fn } from '@aileron/declare';\n\nimport { ModalManager } from '@/promise-modal/app/ModalManager';\nimport { type ModalNode, nodeFactory } from '@/promise-modal/core';\nimport { useConfigurationOptions } from '@/promise-modal/providers';\nimport type { Modal } from '@/promise-modal/types';\n\nimport { ModalManagerContext } from './ModalManagerContext';\n\ninterface ModalManagerContextProviderProps {\n usePathname: Fn<[], { pathname: string }>;\n}\n\nexport const ModalManagerContextProvider = memo(\n ({\n usePathname,\n children,\n }: PropsWithChildren<ModalManagerContextProviderProps>) => {\n const modalDictionary = useRef<Map<ModalNode['id'], ModalNode>>(new Map());\n\n const [modalIds, setModalIds] = useState<ModalNode['id'][]>([]);\n const modalIdsRef = useReference(modalIds);\n const { pathname } = usePathname();\n\n const initiator = useRef(pathname);\n const modalIdSequence = useRef(0);\n\n const options = useConfigurationOptions();\n\n const duration = useMemo(\n () => convertMsFromDuration(options.duration),\n [options],\n );\n\n useOnMountLayout(() => {\n const { manualDestroy, closeOnBackdropClick } = options;\n\n for (const data of ModalManager.prerender) {\n const modal = nodeFactory({\n ...data,\n id: modalIdSequence.current++,\n initiator: initiator.current,\n manualDestroy:\n data.manualDestroy !== undefined\n ? data.manualDestroy\n : manualDestroy,\n closeOnBackdropClick:\n data.closeOnBackdropClick !== undefined\n ? data.closeOnBackdropClick\n : closeOnBackdropClick,\n });\n modalDictionary.current.set(modal.id, modal);\n setModalIds((ids) => [...ids, modal.id]);\n }\n\n ModalManager.openHandler = (data: Modal) => {\n const modal = nodeFactory({\n ...data,\n id: modalIdSequence.current++,\n initiator: initiator.current,\n manualDestroy:\n data.manualDestroy !== undefined\n ? data.manualDestroy\n : manualDestroy,\n closeOnBackdropClick:\n data.closeOnBackdropClick !== undefined\n ? data.closeOnBackdropClick\n : closeOnBackdropClick,\n });\n modalDictionary.current.set(modal.id, modal);\n setModalIds((ids) => {\n const aliveIds: number[] = [];\n for (let index = 0; index < ids.length; index++) {\n const id = ids[index];\n const destroyed = !modalDictionary.current.get(id)?.alive;\n if (destroyed) modalDictionary.current.delete(id);\n else aliveIds.push(id);\n }\n return [...aliveIds, modal.id];\n });\n };\n return () => {\n ModalManager.reset();\n };\n });\n\n useLayoutEffect(() => {\n for (const id of modalIdsRef.current) {\n const modal = modalDictionary.current.get(id);\n if (!modal?.alive) continue;\n if (modal.initiator === pathname) modal.onShow();\n else modal.onHide();\n }\n initiator.current = pathname;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [pathname]);\n\n const getModalNode = useCallback((modalId: ModalNode['id']) => {\n return modalDictionary.current.get(modalId);\n }, []);\n\n const onDestroy = useCallback((modalId: ModalNode['id']) => {\n const modal = modalDictionary.current.get(modalId);\n if (!modal) return;\n modal.onDestroy();\n updaterRef.current?.();\n }, []);\n\n const updaterRef = useRef<Fn>(undefined);\n const hideModal = useCallback(\n (modalId: ModalNode['id']) => {\n const modal = modalDictionary.current.get(modalId);\n if (!modal) return;\n modal.onHide();\n updaterRef.current?.();\n if (!modal.manualDestroy)\n setTimeout(() => {\n modal.onDestroy();\n }, duration);\n },\n [duration],\n );\n\n const onChange = useCallback((modalId: ModalNode['id'], value: any) => {\n const modal = modalDictionary.current.get(modalId);\n if (!modal) return;\n if (modal.type === 'prompt') modal.onChange(value);\n }, []);\n\n const onConfirm = useCallback(\n (modalId: ModalNode['id']) => {\n const modal = modalDictionary.current.get(modalId);\n if (!modal) return;\n modal.onConfirm();\n hideModal(modalId);\n },\n [hideModal],\n );\n\n const onClose = useCallback(\n (modalId: ModalNode['id']) => {\n const modal = modalDictionary.current.get(modalId);\n if (!modal) return;\n modal.onClose();\n hideModal(modalId);\n },\n [hideModal],\n );\n\n const getModal = useCallback(\n (modalId: ModalNode['id']) => ({\n modal: getModalNode(modalId),\n onConfirm: () => onConfirm(modalId),\n onClose: () => onClose(modalId),\n onChange: (value: any) => onChange(modalId, value),\n onDestroy: () => onDestroy(modalId),\n }),\n [getModalNode, onConfirm, onClose, onChange, onDestroy],\n );\n\n const value = useMemo(() => {\n return {\n modalIds,\n getModalNode,\n onChange,\n onConfirm,\n onClose,\n onDestroy,\n getModal,\n setUpdater: (updater: Fn) => {\n updaterRef.current = updater;\n },\n };\n }, [\n modalIds,\n getModal,\n getModalNode,\n onChange,\n onConfirm,\n onClose,\n onDestroy,\n ]);\n\n return (\n <ModalManagerContext.Provider value={value}>\n {children}\n </ModalManagerContext.Provider>\n );\n },\n);\n","import { useContext, useMemo } from 'react';\n\nimport type { ManagedModal } from '@/promise-modal/types';\n\nimport { ModalManagerContext } from './ModalManagerContext';\n\nexport const useModalManagerContext = () => useContext(ModalManagerContext);\n\nexport const useModal = (id: ManagedModal['id']) => {\n const { getModal } = useModalManagerContext();\n return useMemo(() => getModal(id), [id, getModal]);\n};\n","import { css } from '@emotion/css';\n\nexport const fallback = css`\n margin: unset;\n`;\n\nexport const frame = css`\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n background-color: white;\n padding: 20px 80px;\n gap: 10px;\n border: 1px solid black;\n`;\n","import type { PropsWithChildren } from 'react';\n\nimport { fallback } from './classNames.emotion';\n\nexport const FallbackTitle = ({ children }: PropsWithChildren) => {\n return <h2 className={fallback}>{children}</h2>;\n};\n","import type { PropsWithChildren } from 'react';\n\nimport { fallback } from './classNames.emotion';\n\nexport const FallbackSubtitle = ({ children }: PropsWithChildren) => {\n return <h3 className={fallback}>{children}</h3>;\n};\n","import type { PropsWithChildren } from 'react';\n\nimport { fallback } from './classNames.emotion';\n\nexport const FallbackContent = ({ children }: PropsWithChildren) => {\n return <div className={fallback}>{children}</div>;\n};\n","import type { FooterComponentProps } from '@/promise-modal/types';\n\nexport const FallbackFooter = ({\n confirmLabel,\n hideConfirm = false,\n cancelLabel,\n hideCancel = false,\n disabled,\n onConfirm,\n onCancel,\n}: FooterComponentProps) => {\n return (\n <div>\n {!hideConfirm && (\n <button onClick={onConfirm} disabled={disabled}>\n {confirmLabel || 'Confirm'}\n </button>\n )}\n\n {!hideCancel && typeof onCancel === 'function' && (\n <button onClick={onCancel}>{cancelLabel || 'Cancel'}</button>\n )}\n </div>\n );\n};\n","import { useMemo } from 'react';\n\nimport type { Fn } from '@aileron/declare';\n\nimport type { ModalNode } from '@/promise-modal/core';\nimport { useModalManagerContext } from '@/promise-modal/providers';\n\nconst defaultValidate = (modal?: ModalNode) => modal?.visible;\n\nexport const useActiveModalCount = (\n validate: Fn<[ModalNode?], boolean | undefined> = defaultValidate,\n refreshKey: string | number = 0,\n) => {\n const { modalIds, getModalNode } = useModalManagerContext();\n return useMemo(() => {\n let count = 0;\n for (const id of modalIds) {\n if (validate(getModalNode(id))) count++;\n }\n return count;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [getModalNode, modalIds, refreshKey]);\n};\n","import {\n type ForwardedRef,\n type PropsWithChildren,\n forwardRef,\n useMemo,\n} from 'react';\n\nimport { useActiveModalCount } from '@/promise-modal/hooks/useActiveModalCount';\nimport type { ModalFrameProps } from '@/promise-modal/types';\n\nimport { frame } from './classNames.emotion';\n\nconst MAX_MODAL_COUNT = 5;\nconst MAX_MODAL_LEVEL = 3;\n\nexport const FallbackForegroundFrame = forwardRef(\n (\n { id, onChangeOrder, children }: PropsWithChildren<ModalFrameProps>,\n ref: ForwardedRef<HTMLDivElement>,\n ) => {\n const activeCount = useActiveModalCount();\n const [level, offset] = useMemo(() => {\n const stacked = activeCount > 1;\n const level = stacked\n ? (Math.floor(id / MAX_MODAL_COUNT) % MAX_MODAL_LEVEL) * 100\n : 0;\n const offset = stacked ? (id % MAX_MODAL_COUNT) * 35 : 0;\n return [level, offset];\n }, [activeCount, id]);\n\n return (\n <div\n ref={ref}\n className={frame}\n onClick={onChangeOrder}\n style={{\n marginBottom: `calc(25vh + ${level}px)`,\n marginLeft: `${level}px`,\n transform: `translate(${offset}px, ${offset}px)`,\n }}\n >\n {children}\n </div>\n );\n },\n);\n","import { type ComponentType, createContext } from 'react';\n\nimport type { Color, Duration } from '@aileron/declare';\n\nimport type {\n BackgroundComponent,\n FooterComponentProps,\n ForegroundComponent,\n WrapperComponentProps,\n} from '@/promise-modal/types';\n\nexport interface ConfigurationContextProps {\n ForegroundComponent: ForegroundComponent;\n BackgroundComponent?: BackgroundComponent;\n TitleComponent: ComponentType<WrapperComponentProps>;\n SubtitleComponent: ComponentType<WrapperComponentProps>;\n ContentComponent: ComponentType<WrapperComponentProps>;\n FooterComponent: ComponentType<FooterComponentProps>;\n options: {\n duration: Duration;\n backdrop: Color;\n manualDestroy: boolean;\n closeOnBackdropClick: boolean;\n };\n}\n\nexport const ConfigurationContext = createContext<ConfigurationContextProps>(\n {} as ConfigurationContextProps,\n);\n","import {\n type ComponentType,\n type PropsWithChildren,\n memo,\n useMemo,\n} from 'react';\n\nimport type { Color, Duration } from '@aileron/declare';\n\nimport {\n DEFAULT_ANIMATION_DURATION,\n DEFAULT_BACKDROP_COLOR,\n} from '@/promise-modal/app/constant';\nimport {\n FallbackContent,\n FallbackFooter,\n FallbackForegroundFrame,\n FallbackSubtitle,\n FallbackTitle,\n} from '@/promise-modal/components/FallbackComponents';\nimport type {\n FooterComponentProps,\n ModalFrameProps,\n WrapperComponentProps,\n} from '@/promise-modal/types';\n\nimport { ConfigurationContext } from './ConfigurationContext';\n\nexport interface ConfigurationContextProviderProps {\n BackgroundComponent?: ComponentType<ModalFrameProps>;\n ForegroundComponent?: ComponentType<ModalFrameProps>;\n TitleComponent?: ComponentType<WrapperComponentProps>;\n SubtitleComponent?: ComponentType<WrapperComponentProps>;\n ContentComponent?: ComponentType<WrapperComponentProps>;\n FooterComponent?: ComponentType<FooterComponentProps>;\n options?: {\n /** Modal transition time(ms, s) */\n duration?: Duration;\n /** Modal backdrop color */\n backdrop?: Color;\n /** Whether to destroy the modal manually */\n manualDestroy?: boolean;\n /** Whether to close the modal when the backdrop is clicked */\n closeOnBackdropClick?: boolean;\n };\n}\n\nexport const ConfigurationContextProvider = memo(\n ({\n ForegroundComponent,\n BackgroundComponent,\n TitleComponent,\n SubtitleComponent,\n ContentComponent,\n FooterComponent,\n options,\n children,\n }: PropsWithChildren<ConfigurationContextProviderProps>) => {\n const value = useMemo(\n () => ({\n BackgroundComponent,\n ForegroundComponent: ForegroundComponent || FallbackForegroundFrame,\n TitleComponent: TitleComponent || FallbackTitle,\n SubtitleComponent: SubtitleComponent || FallbackSubtitle,\n ContentComponent: memo(ContentComponent || FallbackContent),\n FooterComponent: memo(FooterComponent || FallbackFooter),\n options: {\n duration: DEFAULT_ANIMATION_DURATION,\n backdrop: DEFAULT_BACKDROP_COLOR,\n closeOnBackdropClick: true,\n manualDestroy: false,\n ...options,\n } satisfies ConfigurationContextProviderProps['options'],\n }),\n [\n ForegroundComponent,\n BackgroundComponent,\n ContentComponent,\n FooterComponent,\n SubtitleComponent,\n TitleComponent,\n options,\n ],\n );\n return (\n <ConfigurationContext.Provider value={value}>\n {children}\n </ConfigurationContext.Provider>\n );\n },\n);\n","import type { Color, Duration } from '@aileron/declare';\n\nexport const DEFAULT_ANIMATION_DURATION: Duration = '300ms';\n\nexport const DEFAULT_BACKDROP_COLOR: Color = 'rgba(0, 0, 0, 0.5)';\n","import { useContext } from 'react';\n\nimport { convertMsFromDuration } from '@winglet/common-utils';\n\nimport { ConfigurationContext } from './ConfigurationContext';\n\nexport const useConfigurationContext = () => useContext(ConfigurationContext);\n\nexport const useConfigurationOptions = () => {\n const context = useContext(ConfigurationContext);\n return context.options;\n};\n\nexport const useConfigurationDuration = () => {\n const context = useConfigurationOptions();\n return {\n duration: context.duration,\n milliseconds: convertMsFromDuration(context.duration),\n };\n};\n\nexport const useConfigurationBackdrop = () => {\n const context = useConfigurationOptions();\n return context.backdrop;\n};\n","import { createContext } from 'react';\n\nimport type { Dictionary } from '@aileron/declare';\n\nexport interface UserDefinedContext {\n context: Dictionary;\n}\n\nexport const UserDefinedContext = createContext<UserDefinedContext>(\n {} as UserDefinedContext,\n);\n","import { PropsWithChildren, useMemo } from 'react';\n\nimport type { Dictionary } from '@aileron/declare';\n\nimport { UserDefinedContext } from './UserDefinedContext';\n\ninterface UserDefinedContextProviderProps {\n /** User defined context */\n context?: Dictionary;\n}\n\nexport const UserDefinedContextProvider = ({\n context,\n children,\n}: PropsWithChildren<UserDefinedContextProviderProps>) => {\n const contextValue = useMemo(() => ({ context: context || {} }), [context]);\n return (\n <UserDefinedContext.Provider value={contextValue}>\n {children}\n </UserDefinedContext.Provider>\n );\n};\n","import { useContext } from 'react';\n\nimport { UserDefinedContext } from './UserDefinedContext';\n\nexport const useUserDefinedContext = () => {\n return useContext(UserDefinedContext);\n};\n","import { useLayoutEffect, useState } from 'react';\n\nexport const usePathname = () => {\n const [pathname, setPathname] = useState(window.location.pathname);\n useLayoutEffect(() => {\n let requestId: number;\n const checkPathname = () => {\n if (requestId) cancelAnimationFrame(requestId);\n if (pathname !== window.location.pathname) {\n setPathname(window.location.pathname);\n } else {\n requestId = requestAnimationFrame(checkPathname);\n }\n };\n requestId = requestAnimationFrame(checkPathname);\n return () => {\n if (requestId) cancelAnimationFrame(requestId);\n };\n }, [pathname]);\n return { pathname };\n};\n","import { css } from '@emotion/css';\n\nexport const background = css`\n display: none;\n position: fixed;\n inset: 0;\n z-index: -999;\n pointer-events: none;\n > * {\n pointer-events: none;\n }\n`;\n\nexport const active = css`\n pointer-events: all;\n`;\n\nexport const visible = css`\n display: flex;\n align-items: center;\n justify-content: center;\n`;\n","import { type MouseEvent, useCallback, useMemo } from 'react';\n\nimport { cx } from '@emotion/css';\n\nimport {\n useConfigurationContext,\n useModal,\n useUserDefinedContext,\n} from '@/promise-modal/providers';\nimport type { ModalLayerProps } from '@/promise-modal/types';\n\nimport { active, background, visible } from './classNames.emotion';\n\nexport const BackgroundFrame = ({\n modalId,\n onChangeOrder,\n}: ModalLayerProps) => {\n const { BackgroundComponent } = useConfigurationContext();\n const { context: userDefinedContext } = useUserDefinedContext();\n const { modal, onClose, onChange, onConfirm, onDestroy } = useModal(modalId);\n\n const handleClose = useCallback(\n (event: MouseEvent) => {\n if (modal && modal.closeOnBackdropClick && modal.visible) onClose();\n event.stopPropagation();\n },\n [modal, onClose],\n );\n\n const Background = useMemo(\n () => modal?.BackgroundComponent || BackgroundComponent,\n [BackgroundComponent, modal],\n );\n\n if (!modal) return null;\n\n return (\n <div\n className={cx(background, {\n [visible]: modal.manualDestroy ? modal.alive : modal.visible,\n [active]: modal.closeOnBackdropClick && modal.visible,\n })}\n onClick={handleClose}\n >\n {Background && (\n <Background\n id={modal.id}\n type={modal.type}\n alive={modal.alive}\n visible={modal.visible}\n initiator={modal.initiator}\n manualDestroy={modal.manualDestroy}\n closeOnBackdropClick={modal.closeOnBackdropClick}\n background={modal.background}\n onChange={onChange}\n onConfirm={onConfirm}\n onClose={onClose}\n onDestroy={onDestroy}\n onChangeOrder={onChangeOrder}\n context={userDefinedContext}\n />\n )}\n </div>\n );\n};\n","import { css } from '@emotion/css';\n\nexport const foreground = css`\n pointer-events: none;\n display: none;\n position: fixed;\n inset: 0;\n z-index: 1;\n`;\n\nexport const active = css`\n > * {\n pointer-events: all;\n }\n`;\n\nexport const visible = css`\n display: flex !important;\n justify-content: center;\n align-items: center;\n`;\n","import { Fragment, memo, useMemo } from 'react';\n\nimport { isString } from '@winglet/common-utils';\nimport { renderComponent, useHandle } from '@winglet/react-utils';\n\nimport type { AlertNode } from '@/promise-modal/core';\nimport {\n useConfigurationContext,\n useUserDefinedContext,\n} from '@/promise-modal/providers';\nimport type { ModalActions } from '@/promise-modal/types';\n\ninterface AlertInnerProps<B> {\n modal: AlertNode<B>;\n handlers: Pick<ModalActions, 'onConfirm'>;\n}\n\nexport const AlertInner = memo(\n <B,>({ modal, handlers }: AlertInnerProps<B>) => {\n const { title, subtitle, content, footer } = useMemo(() => modal, [modal]);\n const { context: userDefinedContext } = useUserDefinedContext();\n const { onConfirm } = useMemo(() => handlers, [handlers]);\n\n const handleConfirm = useHandle(onConfirm);\n\n const {\n TitleComponent,\n SubtitleComponent,\n ContentComponent,\n FooterComponent,\n } = useConfigurationContext();\n\n return (\n <Fragment>\n {title &&\n (isString(title) ? (\n <TitleComponent context={userDefinedContext}>\n {title}\n </TitleComponent>\n ) : (\n title\n ))}\n {subtitle &&\n (isString(subtitle) ? (\n <SubtitleComponent context={userDefinedContext}>\n {subtitle}\n </SubtitleComponent>\n ) : (\n subtitle\n ))}\n {content &&\n (isString(content) ? (\n <ContentComponent context={userDefinedContext}>\n {content}\n </ContentComponent>\n ) : (\n renderComponent(content, {\n onConfirm: handleConfirm,\n })\n ))}\n {footer !== false &&\n (typeof footer === 'function' ? (\n footer({\n onConfirm: handleConfirm,\n context: userDefinedContext,\n })\n ) : (\n <FooterComponent\n onConfirm={handleConfirm}\n confirmLabel={footer?.confirm}\n hideConfirm={footer?.hideConfirm}\n context={userDefinedContext}\n />\n ))}\n </Fragment>\n );\n },\n);\n","import { Fragment, memo, useMemo } from 'react';\n\nimport { isString } from '@winglet/common-utils';\nimport { renderComponent, useHandle } from '@winglet/react-utils';\n\nimport type { ConfirmNode } from '@/promise-modal/core';\nimport {\n useConfigurationContext,\n useUserDefinedContext,\n} from '@/promise-modal/providers';\nimport type { ModalActions } from '@/promise-modal/types';\n\ninterface ConfirmInnerProps<B> {\n modal: ConfirmNode<B>;\n handlers: Pick<ModalActions, 'onConfirm' | 'onClose'>;\n}\n\nexport const ConfirmInner = memo(\n <B,>({ modal, handlers }: ConfirmInnerProps<B>) => {\n const { title, subtitle, content, footer } = useMemo(() => modal, [modal]);\n const { context: userDefinedContext } = useUserDefinedContext();\n const { onConfirm, onClose } = useMemo(() => handlers, [handlers]);\n\n const handleConfirm = useHandle(onConfirm);\n const handleClose = useHandle(onClose);\n\n const {\n TitleComponent,\n SubtitleComponent,\n ContentComponent,\n FooterComponent,\n } = useConfigurationContext();\n\n return (\n <Fragment>\n {title &&\n (isString(title) ? (\n <TitleComponent context={userDefinedContext}>\n {title}\n </TitleComponent>\n ) : (\n title\n ))}\n {subtitle &&\n (isString(subtitle) ? (\n <SubtitleComponent context={userDefinedContext}>\n {subtitle}\n </SubtitleComponent>\n ) : (\n subtitle\n ))}\n {content &&\n (isString(content) ? (\n <ContentComponent context={userDefinedContext}>\n {content}\n </ContentComponent>\n ) : (\n renderComponent(content, {\n onConfirm: handleConfirm,\n onCancel: handleClose,\n context: userDefinedContext,\n })\n ))}\n {footer !== false &&\n (typeof footer === 'function' ? (\n footer({\n onConfirm: handleConfirm,\n onCancel: handleClose,\n context: userDefinedContext,\n })\n ) : (\n <FooterComponent\n onConfirm={handleConfirm}\n onCancel={handleClose}\n confirmLabel={footer?.confirm}\n cancelLabel={footer?.cancel}\n hideConfirm={footer?.hideConfirm}\n hideCancel={footer?.hideCancel}\n context={userDefinedContext}\n />\n ))}\n </Fragment>\n );\n },\n);\n","import { Fragment, memo, useCallback, useMemo, useState } from 'react';\n\nimport { isFunction, isString } from '@winglet/common-utils';\nimport {\n renderComponent,\n useHandle,\n withErrorBoundary,\n} from '@winglet/react-utils';\n\nimport type { PromptNode } from '@/promise-modal/core';\nimport {\n useConfigurationContext,\n useUserDefinedContext,\n} from '@/promise-modal/providers';\nimport type { ModalActions } from '@/promise-modal/types';\n\ninterface PromptInnerProps<T, B> {\n modal: PromptNode<T, B>;\n handlers: Pick<ModalActions, 'onChange' | 'onClose' | 'onConfirm'>;\n}\n\nexport const PromptInner = memo(\n <T, B>({ modal, handlers }: PromptInnerProps<T, B>) => {\n const {\n Input,\n defaultValue,\n disabled: checkDisabled,\n title,\n subtitle,\n content,\n footer,\n } = useMemo(\n () => ({\n ...modal,\n Input: memo(withErrorBoundary(modal.Input)),\n }),\n [modal],\n );\n\n const { context: userDefinedContext } = useUserDefinedContext();\n\n const [value, setValue] = useState<T | undefined>(defaultValue);\n\n const { onChange, onClose, onConfirm } = useMemo(\n () => handlers,\n [handlers],\n );\n\n const handleClose = useHandle(onClose);\n const handleChange = useHandle(\n (inputValue?: T | ((prevState: T | undefined) => T | undefined)) => {\n const input = isFunction(inputValue) ? inputValue(value) : inputValue;\n setValue(input);\n onChange(input);\n },\n );\n\n const handleConfirm = useCallback(() => {\n // NOTE: wait for the next tick to ensure the value is updated\n requestAnimationFrame(onConfirm);\n }, [onConfirm]);\n\n const disabled = useMemo(\n () => (value ? !!checkDisabled?.(value) : false),\n [checkDisabled, value],\n );\n\n const {\n TitleComponent,\n SubtitleComponent,\n ContentComponent,\n FooterComponent,\n } = useConfigurationContext();\n\n return (\n <Fragment>\n {title &&\n (isString(title) ? (\n <TitleComponent context={userDefinedContext}>\n {title}\n </TitleComponent>\n ) : (\n title\n ))}\n {subtitle &&\n (isString(subtitle) ? (\n <SubtitleComponent context={userDefinedContext}>\n {subtitle}\n </SubtitleComponent>\n ) : (\n subtitle\n ))}\n {content &&\n (isString(content) ? (\n <ContentComponent context={userDefinedContext}>\n {content}\n </ContentComponent>\n ) : (\n renderComponent(content, {\n onConfirm: handleConfirm,\n onCancel: handleClose,\n context: userDefinedContext,\n })\n ))}\n\n {Input && (\n <Input\n defaultValue={defaultValue}\n value={value}\n onChange={handleChange}\n onConfirm={handleConfirm}\n onCancel={handleClose}\n context={userDefinedContext}\n />\n )}\n\n {footer !== false &&\n (typeof footer === 'function' ? (\n footer({\n value,\n disabled,\n onChange: handleChange,\n onConfirm: handleConfirm,\n onCancel: handleClose,\n context: userDefinedContext,\n })\n ) : (\n <FooterComponent\n disabled={disabled}\n onConfirm={handleConfirm}\n onCancel={handleClose}\n confirmLabel={footer?.confirm}\n cancelLabel={footer?.cancel}\n hideConfirm={footer?.hideConfirm}\n hideCancel={footer?.hideCancel}\n context={userDefinedContext}\n />\n ))}\n </Fragment>\n );\n },\n);\n","import { useMemo } from 'react';\n\nimport { cx } from '@emotion/css';\n\nimport {\n useConfigurationContext,\n useModal,\n useUserDefinedContext,\n} from '@/promise-modal/providers';\nimport type { ModalLayerProps } from '@/promise-modal/types';\n\nimport { active, foreground, visible } from './classNames.emotion';\nimport { AlertInner, ConfirmInner, PromptInner } from './components';\n\nexport const ForegroundFrame = ({\n modalId,\n onChangeOrder,\n}: ModalLayerProps) => {\n const { ForegroundComponent } = useConfigurationContext();\n const { context: userDefinedContext } = useUserDefinedContext();\n\n const { modal, onChange, onConfirm, onClose, onDestroy } = useModal(modalId);\n\n const Foreground = useMemo(\n () => modal?.ForegroundComponent || ForegroundComponent,\n [ForegroundComponent, modal],\n );\n\n if (!modal) return null;\n\n return (\n <div\n className={cx(foreground, {\n [visible]: modal.manualDestroy ? modal.alive : modal.visible,\n [active]: modal.visible,\n })}\n >\n <Foreground\n id={modal.id}\n type={modal.type}\n alive={modal.alive}\n visible={modal.visible}\n initiator={modal.initiator}\n manualDestroy={modal.manualDestroy}\n closeOnBackdropClick={modal.closeOnBackdropClick}\n background={modal.background}\n onChange={onChange}\n onConfirm={onConfirm}\n onClose={onClose}\n onDestroy={onDestroy}\n onChangeOrder={onChangeOrder}\n context={userDefinedContext}\n >\n {modal.type === 'alert' && (\n <AlertInner modal={modal} handlers={{ onConfirm }} />\n )}\n {modal.type === 'confirm' && (\n <ConfirmInner modal={modal} handlers={{ onConfirm, onClose }} />\n )}\n {modal.type === 'prompt' && (\n <PromptInner\n modal={modal}\n handlers={{ onChange, onConfirm, onClose }}\n />\n )}\n </Foreground>\n </div>\n );\n};\n","import { useEffect } from 'react';\n\nimport { useVersion } from '@winglet/react-utils';\n\nimport type { ModalNode } from '@/promise-modal/core';\n\nexport const useSubscribeModal = (modal?: ModalNode) => {\n const [version, update] = useVersion();\n useEffect(() => {\n if (!modal) return;\n const unsubscribe = modal.subscribe(update);\n return unsubscribe;\n }, [modal, update]);\n return version;\n};\n","import { css } from '@emotion/css';\n\nexport const presenter = css`\n position: fixed;\n inset: 0;\n pointer-events: none;\n overflow: hidden;\n`;\n","import { memo, useRef } from 'react';\n\nimport { counterFactory } from '@winglet/common-utils';\nimport { useHandle } from '@winglet/react-utils';\n\nimport { Background } from '@/promise-modal/components/Background';\nimport { Foreground } from '@/promise-modal/components/Foreground';\nimport { useSubscribeModal } from '@/promise-modal/hooks/useSubscribeModal';\nimport { useModal } from '@/promise-modal/providers';\nimport type { ModalIdProps } from '@/promise-modal/types';\n\nimport { presenter } from './classNames.emotion';\n\nconst { increment } = counterFactory(1);\n\nexport const Presenter = memo(({ modalId }: ModalIdProps) => {\n const ref = useRef<HTMLDivElement>(null);\n const { modal } = useModal(modalId);\n useSubscribeModal(modal);\n const handleChangeOrder = useHandle(() => {\n if (ref.current) {\n ref.current.style.zIndex = `${increment()}`;\n }\n });\n return (\n <div ref={ref} className={presenter}>\n <Background modalId={modalId} onChangeOrder={handleChangeOrder} />\n <Foreground modalId={modalId} onChangeOrder={handleChangeOrder} />\n </div>\n );\n});\n","import { css } from '@emotion/css';\n\nexport const anchor = css`\n display: flex;\n align-items: center;\n justify-content: center;\n position: fixed;\n inset: 0;\n pointer-events: none;\n z-index: 1000;\n transition: background-color ease-in-out;\n`;\n","import { memo, useEffect } from 'react';\n\nimport { map } from '@winglet/common-utils';\nimport { useVersion, withErrorBoundary } from '@winglet/react-utils';\n\nimport { Presenter } from '@/promise-modal/components/Presenter';\nimport type { ModalNode } from '@/promise-modal/core';\nimport { useActiveModalCount } from '@/promise-modal/hooks/useActiveModalCount';\nimport {\n useConfigurationOptions,\n useModalManagerContext,\n} from '@/promise-modal/providers';\n\nimport { anchor } from './classNames.emotion';\n\nconst AnchorInner = () => {\n const [version, update] = useVersion();\n\n const { modalIds, setUpdater } = useModalManagerContext();\n\n useEffect(() => {\n setUpdater(update);\n }, [setUpdater, update]);\n\n const options = useConfigurationOptions();\n\n const dimmed = useActiveModalCount(validateDimmable, version);\n\n return (\n <div\n className={anchor}\n style={{\n transitionDuration: options.duration,\n backgroundColor: dimmed ? options.backdrop : 'transparent',\n }}\n >\n {map(modalIds, (id) => (\n <Presenter key={id} modalId={id} />\n ))}\n </div>\n );\n};\n\nconst validateDimmable = (modal?: ModalNode) => modal?.visible && modal.dimmed;\n\nexport const Anchor = memo(withErrorBoundary(AnchorInner));\n","import { createPortal } from 'react-dom';\n\nimport type { Dictionary, Fn } from '@aileron/declare';\n\nimport { Anchor } from '@/promise-modal/components/Anchor';\nimport {\n ConfigurationContextProvider,\n type ConfigurationContextProviderProps,\n} from '@/promise-modal/providers/ConfigurationContext';\nimport { ModalManagerContextProvider } from '@/promise-modal/providers/ModalManagerContext';\nimport { UserDefinedContextProvider } from '@/promise-modal/providers/UserDefinedContext';\n\ninterface BootstrapProps extends ConfigurationContextProviderProps {\n usePathname: Fn<[], { pathname: string }>;\n context?: Dictionary;\n anchor: HTMLElement;\n}\n\nexport const bootstrap = ({\n ForegroundComponent,\n BackgroundComponent,\n TitleComponent,\n SubtitleComponent,\n ContentComponent,\n FooterComponent,\n usePathname,\n options,\n context,\n anchor,\n}: BootstrapProps) =>\n createPortal(\n <UserDefinedContextProvider context={context}>\n <ConfigurationContextProvider\n ForegroundComponent={ForegroundComponent}\n BackgroundComponent={BackgroundComponent}\n TitleComponent={TitleComponent}\n SubtitleComponent={SubtitleComponent}\n ContentComponent={ContentComponent}\n FooterComponent={FooterComponent}\n options={options}\n >\n <ModalManagerContextProvider usePathname={usePathname}>\n <Anchor />\n </ModalManagerContextProvider>\n </ConfigurationContextProvider>\n </UserDefinedContextProvider>,\n anchor,\n );\n","import { useCallback, useRef } from 'react';\n\nimport { printError } from '@winglet/common-utils';\nimport { useVersion } from '@winglet/react-utils';\n\nimport { ModalManager } from '@/promise-modal/app/ModalManager';\n\nexport const useInitialize = () => {\n const permitted = useRef(ModalManager.activate());\n const anchorRef = useRef<HTMLElement | null>(null);\n const [, update] = useVersion();\n\n const handleInitialize = useCallback(\n (root?: HTMLElement) => {\n if (permitted.current) {\n anchorRef.current = ModalManager.anchor({ root });\n update();\n } else\n printError(\n 'ModalProvider is already initialized',\n [\n 'ModalProvider can only be initialized once.',\n 'Nesting ModalProvider will be ignored...',\n ],\n {\n info: 'Something is wrong with the ModalProvider initialization...',\n },\n );\n },\n [update],\n );\n\n return {\n anchorRef,\n handleInitialize,\n } as const;\n};\n","import {\n Fragment,\n type PropsWithChildren,\n forwardRef,\n useImperativeHandle,\n useMemo,\n} from 'react';\n\nimport { useOnMount } from '@winglet/react-utils';\n\nimport { usePathname as useDefaultPathname } from '@/promise-modal/hooks/useDefaultPathname';\n\nimport { bootstrap } from './helpers/bootstrap';\nimport { useInitialize } from './hooks/useInitialize';\nimport type { BootstrapProviderHandle, BootstrapProviderProps } from './type';\n\nexport const BootstrapProvider = forwardRef<\n BootstrapProviderHandle,\n PropsWithChildren<BootstrapProviderProps>\n>(\n (\n {\n usePathname: useExternalPathname,\n ForegroundComponent,\n BackgroundComponent,\n TitleComponent,\n SubtitleComponent,\n ContentComponent,\n FooterComponent,\n options,\n context,\n children,\n },\n handleRef,\n ) => {\n const usePathname = useMemo(\n () => useExternalPathname || useDefaultPathname,\n [useExternalPathname],\n );\n\n const { anchorRef, handleInitialize } = useInitialize();\n\n useImperativeHandle(\n handleRef,\n () => ({\n initialize: handleInitialize,\n }),\n [handleInitialize],\n );\n\n useOnMount(() => {\n /**\n * NOTE: `handleRef` being null indicates that no `ref` was provided.\n * In this case, the `ModalProvider`(=`BootstrapProvider`) is not receiving the `ref`,\n * so it should be initialized automatically.\n */\n if (handleRef === null) handleInitialize();\n return () => {\n if (anchorRef.current) anchorRef.current.remove();\n };\n });\n\n return (\n <Fragment>\n {children}\n {anchorRef.current &&\n bootstrap({\n ForegroundComponent,\n BackgroundComponent,\n TitleComponent,\n SubtitleComponent,\n ContentComponent,\n FooterComponent,\n usePathname,\n options,\n context,\n anchor: anchorRef.current,\n })}\n </Fragment>\n );\n },\n);\n","import type { ComponentType, ReactNode } from 'react';\n\nimport { ModalManager } from '@/promise-modal/app/ModalManager';\nimport type {\n AlertContentProps,\n AlertFooterRender,\n BackgroundComponent,\n FooterOptions,\n ForegroundComponent,\n ModalBackground,\n} from '@/promise-modal/types';\n\ninterface AlertProps<B> {\n subtype?: 'info' | 'success' | 'warning' | 'error';\n title?: ReactNode;\n subtitle?: ReactNode;\n content?: ReactNode | ComponentType<AlertContentProps>;\n background?: ModalBackground<B>;\n footer?:\n | AlertFooterRender\n | Pick<FooterOptions, 'confirm' | 'hideConfirm'>\n | false;\n dimmed?: boolean;\n manualDestroy?: boolean;\n closeOnBackdropClick?: boolean;\n ForegroundComponent?: ForegroundComponent;\n BackgroundComponent?: BackgroundComponent;\n}\n\nexport const alert = <B = any>({\n subtype,\n title,\n subtitle,\n content,\n background,\n footer,\n dimmed,\n manualDestroy,\n closeOnBackdropClick,\n ForegroundComponent,\n BackgroundComponent,\n}: AlertProps<B>) => {\n return new Promise<void>((resolve, reject) => {\n try {\n ModalManager.open({\n type: 'alert',\n subtype,\n resolve: () => resolve(),\n title,\n subtitle,\n content,\n background,\n footer,\n dimmed,\n manualDestroy,\n closeOnBackdropClick,\n ForegroundComponent,\n BackgroundComponent,\n });\n } catch (error) {\n reject(error);\n }\n });\n};\n","import type { ComponentType, ReactNode } from 'react';\n\nimport { ModalManager } from '@/promise-modal/app/ModalManager';\nimport type {\n BackgroundComponent,\n ConfirmContentProps,\n ConfirmFooterRender,\n FooterOptions,\n ForegroundComponent,\n ModalBackground,\n} from '@/promise-modal/types';\n\ninterface ConfirmProps<B> {\n subtype?: 'info' | 'success' | 'warning' | 'error';\n title?: ReactNode;\n subtitle?: ReactNode;\n content?: ReactNode | ComponentType<ConfirmContentProps>;\n background?: ModalBackground<B>;\n footer?: ConfirmFooterRender | FooterOptions | false;\n dimmed?: boolean;\n manualDestroy?: boolean;\n closeOnBackdropClick?: boolean;\n ForegroundComponent?: ForegroundComponent;\n BackgroundComponent?: BackgroundComponent;\n}\n\nexport const confirm = <B = any>({\n subtype,\n title,\n subtitle,\n content,\n background,\n footer,\n dimmed,\n manualDestroy,\n closeOnBackdropClick,\n ForegroundComponent,\n BackgroundComponent,\n}: ConfirmProps<B>) => {\n return new Promise<boolean>((resolve, reject) => {\n try {\n ModalManager.open({\n type: 'confirm',\n subtype,\n resolve: (result) => resolve(result ?? false),\n title,\n subtitle,\n content,\n background,\n footer,\n dimmed,\n manualDestroy,\n closeOnBackdropClick,\n ForegroundComponent,\n BackgroundComponent,\n });\n } catch (error) {\n reject(error);\n }\n });\n};\n","import type { ComponentType, ReactNode } from 'react';\n\nimport { ModalManager } from '@/promise-modal/app/ModalManager';\nimport type {\n BackgroundComponent,\n FooterOptions,\n ForegroundComponent,\n ModalBackground,\n PromptContentProps,\n PromptFooterRender,\n PromptInputProps,\n} from '@/promise-modal/types';\n\ninterface PromptProps<T, B = any> {\n title?: ReactNode;\n subtitle?: ReactNode;\n content?: ReactNode | ComponentType<PromptContentProps>;\n Input: (props: PromptInputProps<T>) => ReactNode;\n defaultValue?: T;\n disabled?: (value: T) => boolean;\n returnOnCancel?: boolean;\n background?: ModalBackground<B>;\n footer?: PromptFooterRender<T> | FooterOptions | false;\n dimmed?: boolean;\n manualDestroy?: boolean;\n closeOnBackdropClick?: boolean;\n ForegroundComponent?: ForegroundComponent;\n BackgroundComponent?: BackgroundComponent;\n}\n\nexport const prompt = <T, B = any>({\n defaultValue,\n title,\n subtitle,\n content,\n Input,\n disabled,\n returnOnCancel,\n background,\n footer,\n dimmed,\n manualDestroy,\n closeOnBackdropClick,\n ForegroundComponent,\n BackgroundComponent,\n}: PromptProps<T, B>) => {\n return new Promise<T>((resolve, reject) => {\n try {\n ModalManager.open({\n type: 'prompt',\n resolve: (result) => resolve(result as T),\n title,\n subtitle,\n content,\n Input,\n defaultValue,\n disabled,\n returnOnCancel,\n background,\n footer,\n dimmed,\n manualDestroy,\n closeOnBackdropClick,\n ForegroundComponent,\n BackgroundComponent,\n });\n } catch (error) {\n reject(error);\n }\n });\n};\n","import { useEffect, useRef } from 'react';\n\nimport { convertMsFromDuration, isString } from '@winglet/common-utils';\n\nimport type { Duration } from '@aileron/declare';\n\nimport type { ModalNode } from '@/promise-modal/core';\nimport { useModal } from '@/promise-modal/providers';\n\nimport { useSubscribeModal } from './useSubscribeModal';\n\nexport const useDestroyAfter = (\n modalId: ModalNode['id'],\n duration: Duration | number,\n) => {\n const { modal, onDestroy } = useModal(modalId);\n const tick = useSubscribeModal(modal);\n\n const reference = useRef({\n modal,\n onDestroy,\n milliseconds: isString(duration)\n ? convertMsFromDuration(duration)\n : duration,\n });\n\n useEffect(() => {\n const { modal, onDestroy, milliseconds } = reference.current;\n if (!modal || modal.visible || !modal.alive) return;\n const timer = setTimeout(() => {\n onDestroy();\n }, milliseconds);\n return () => {\n if (timer) clearTimeout(timer);\n };\n }, [tick]);\n};\n","import { useCallback, useMemo } from 'react';\n\nimport { useOnMount } from '@winglet/react-utils';\n\nimport { usePathname as useDefaultPathname } from '@/promise-modal/hooks/useDefaultPathname';\n\nimport { bootstrap } from './helpers/bootstrap';\nimport { useInitialize } from './hooks/useInitialize';\nimport type { BootstrapProviderProps } from './type';\n\nexport const useBootstrap = ({\n usePathname: useExternalPathname,\n ForegroundComponent,\n BackgroundComponent,\n TitleComponent,\n SubtitleComponent,\n ContentComponent,\n FooterComponent,\n options,\n context,\n mode = 'auto',\n}: BootstrapProviderProps & { mode?: 'manual' | 'auto' } = {}) => {\n const usePathname = useMemo(\n () => useExternalPathname || useDefaultPathname,\n [useExternalPathname],\n );\n\n const { anchorRef, handleInitialize } = useInitialize();\n\n useOnMount(() => {\n if (mode === 'auto') handleInitialize();\n return () => {\n if (anchorRef.current) anchorRef.current.remove();\n };\n });\n\n const initialize = useCallback(\n (element: HTMLElement) => {\n if (mode === 'manual') handleInitialize(element);\n },\n [mode, handleInitialize],\n );\n\n const portal =\n anchorRef.current &&\n bootstrap({\n usePathname,\n ForegroundComponent,\n BackgroundComponent,\n TitleComponent,\n SubtitleComponent,\n ContentComponent,\n FooterComponent,\n options,\n context,\n anchor: anchorRef.current,\n });\n\n return { portal, initialize };\n};\n","import { useLayoutEffect, useRef } from 'react';\n\nimport type { Fn } from '@aileron/declare';\n\ninterface ModalAnimationHandler {\n onVisible?: Fn;\n onHidden?: Fn;\n}\n\nexport const useModalAnimation = (\n visible: boolean,\n handler: ModalAnimationHandler,\n) => {\n const handlerRef = useRef(handler);\n handlerRef.current = handler;\n useLayoutEffect(() => {\n if (!handlerRef.current) return;\n let frame: ReturnType<typeof requestAnimationFrame>;\n if (visible)\n frame = requestAnimationFrame(() => handlerRef.current.onVisible?.());\n else frame = requestAnimationFrame(() => handlerRef.current.onHidden?.());\n return () => {\n if (frame) cancelAnimationFrame(frame);\n };\n }, [visible]);\n};\n"],"names":["ModalManager","static","activate","active","anchor","options","document","getElementById","id","tag","prefix","root","body","node","createElement","setAttribute","getRandomString","appendChild","prerender","prerenderList","modal","push","openHandler","handler","unanchored","reset","open","AbstractNode","initiator","title","subtitle","background","manualDestroy","closeOnBackdropClick","dimmed","ForegroundComponent","BackgroundComponent","alive","this","visible","resolve","listeners","Set","constructor","subscribe","listener","add","delete","publish","result","onDestroy","needPublish","onShow","onHide","AlertNode","type","subtype","content","footer","super","onClose","onConfirm","ConfirmNode","PromptNode","defaultValue","Input","disabled","returnOnCancel","value","onChange","nodeFactory","Error","ModalManagerContext","createContext","ModalManagerContextProvider","memo","usePathname","children","modalDictionary","useRef","Map","modalIds","setModalIds","useState","modalIdsRef","useReference","pathname","modalIdSequence","useConfigurationOptions","duration","useMemo","convertMsFromDuration","useOnMountLayout","data","current","undefined","set","ids","aliveIds","index","length","get","useLayoutEffect","getModalNode","useCallback","modalId","updaterRef","hideModal","setTimeout","getModal","setUpdater","updater","_jsx","jsx","Provider","useModalManagerContext","useContext","useModal","fallback","css","process","env","NODE_ENV","name","styles","toString","_EMOTION_STRINGIFIED_CSS_ERROR__","frame","FallbackTitle","className","FallbackSubtitle","FallbackContent","FallbackFooter","confirmLabel","hideConfirm","cancelLabel","hideCancel","onCancel","_jsxs","onClick","defaultValidate","useActiveModalCount","validate","refreshKey","count","FallbackForegroundFrame","forwardRef","onChangeOrder","ref","activeCount","level","offset","stacked","Math","floor","style","marginBottom","marginLeft","transform","ConfigurationContext","ConfigurationContextProvider","TitleComponent","SubtitleComponent","ContentComponent","FooterComponent","backdrop","useConfigurationContext","UserDefinedContext","UserDefinedContextProvider","context","contextValue","useUserDefinedContext","setPathname","window","location","requestId","checkPathname","cancelAnimationFrame","requestAnimationFrame","BackgroundFrame","userDefinedContext","handleClose","event","stopPropagation","Background","cx","visible$1","active$1","foreground","AlertInner","handlers","handleConfirm","useHandle","Fragment","isString","renderComponent","confirm","ConfirmInner","cancel","PromptInner","checkDisabled","withErrorBoundary","setValue","handleChange","inputValue","input","isFunction","ForegroundFrame","Foreground","useSubscribeModal","version","update","useVersion","useEffect","presenter","increment","counterFactory","Presenter","handleChangeOrder","zIndex","validateDimmable","Anchor","transitionDuration","backgroundColor","map","bootstrap","createPortal","useInitialize","permitted","anchorRef","handleInitialize","printError","info","BootstrapProvider","useExternalPathname","handleRef","useDefaultPathname","useImperativeHandle","initialize","useOnMount","remove","Promise","reject","error","tick","reference","milliseconds","timer","clearTimeout","mode","element","portal","handlerRef","onVisible","onHidden"],"mappings":"+LAMaA,EACXC,UAAiB,EACjB,eAAOC,GACL,OAAIF,GAAaG,IACTH,GAAaG,GAAU,GAGjCF,SAAqC,KACrC,aAAOG,CAAOC,GAKZ,GAAIL,GAAaI,EAAS,CACxB,MAAMA,EAASE,SAASC,eAAeP,GAAaI,EAAQI,IAC5D,GAAIJ,EAAQ,OAAOA,EAErB,MAAMK,IACJA,EAAM,MAAKC,OACXA,EAAS,gBAAeC,KACxBA,EAAOL,SAASM,MACdP,GAAW,CAAE,EACXQ,EAAOP,SAASQ,cAAcL,GAIpC,OAHAI,EAAKE,aAAa,KAAM,GAAGL,KAAUM,EAAeA,gBAAC,OACrDL,EAAKM,YAAYJ,GACjBb,GAAaI,EAAUS,EAChBA,EAGTZ,SAAiC,GACjC,oBAAWiB,GACT,OAAOlB,GAAamB,EAGtBlB,SAA0CmB,GACxCpB,GAAamB,EAAeE,KAAKD,GACnC,sBAAWE,CAAYC,GACrBvB,GAAasB,EAAeC,EAC5BvB,GAAamB,EAAiB,GAGhC,qBAAWK,GACT,OAAQxB,GAAaI,EAGvB,YAAOqB,GACLzB,GAAaG,GAAU,EACvBH,GAAaI,EAAU,KACvBJ,GAAamB,EAAiB,GAC9BnB,GAAasB,EAAgBF,GAC3BpB,GAAamB,EAAeE,KAAKD,GAGrC,WAAOM,CAAKN,GACVpB,GAAasB,EAAaF,UC9CRO,EACXnB,GACAoB,UAEAC,MACAC,SACAC,WAEAC,cACAC,qBACAC,OAEAC,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dPtB,EAAUvI,SACVmI,GAAU,aACRrJ,EACAzC,sBACAC,sBACA6H,iBACAC,oBACAC,mBACAC,kBACA/J,UACAoK,UACArK,OAAQiO,EAAUvI,UAGLgJ,aAAY,4BCjDE,CAC/BvM,EACAhB,KAEA,MAAMqO,EAAa7K,EAAMA,OAACxD,GAC1BqO,EAAW9J,QAAUvE,EACrB+E,EAAAA,iBAAgB,KACd,IAAKsJ,EAAW9J,QAAS,OACzB,IAAIiC,EAIJ,OAFEA,EADExF,EACM2I,uBAAsB,IAAM0E,EAAW9J,QAAQ+J,gBAC5C3E,uBAAsB,IAAM0E,EAAW9J,QAAQgK,eACrD,KACD/H,GAAOkD,qBAAqBlD,EAAM,CACvC,GACA,CAACxF,GAAS,2BzBHyB,IACtBiD,IACD6E,kCAVuB,KACtC,MAAMI,EAAUjF,IAChB,MAAO,CACLC,SAAUgF,EAAQhF,SAClB6J,aAAc3J,EAAAA,sBAAsB8E,EAAQhF,UAC7C"}
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,IAAI,eAAe,EAC1C,wBAAwB,IAAI,gBAAgB,EAC5C,wBAAwB,IAAI,gBAAgB,GAC7C,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,YAAY,IAAI,kBAAkB,EAClC,iBAAiB,IAAI,aAAa,EAClC,KAAK,uBAAuB,IAAI,mBAAmB,EACnD,KAAK,sBAAsB,IAAI,kBAAkB,GAClD,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE9D,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhD,YAAY,EACV,eAAe,EACf,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,SAAS,CAAC"}
|
package/dist/index.esm.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as e,jsxs as n}from"react/jsx-runtime";import{createContext as o,memo as t,useRef as r,useState as i,useMemo as s,useLayoutEffect as a,useCallback as l,useContext as c,forwardRef as d,Fragment as u,useEffect as m,useImperativeHandle as p}from"react";import{getRandomString as C,convertMsFromDuration as h,isString as f,isFunction as g,counterFactory as b,map as v,printError as y}from"@winglet/common-utils";import{useReference as k,useOnMountLayout as x,useHandle as B,renderComponent as D,withErrorBoundary as O,useVersion as F,useOnMount as N}from"@winglet/react-utils";import{css as w,cx as I}from"@emotion/css";import{createPortal as S}from"react-dom";class E{static#e=!1;static activate(){return!E.#e&&(E.#e=!0)}static#n=null;static anchor(e){if(E.#n){const e=document.getElementById(E.#n.id);if(e)return e}const{tag:n="div",prefix:o="promise-modal",root:t=document.body}=e||{},r=document.createElement(n);return r.setAttribute("id",`${o}-${C(36)}`),t.appendChild(r),E.#n=r,r}static#o=[];static get prerender(){return E.#o}static#t=e=>E.#o.push(e);static set openHandler(e){E.#t=e,E.#o=[]}static get unanchored(){return!E.#n}static reset(){E.#e=!1,E.#n=null,E.#o=[],E.#t=e=>E.#o.push(e)}static open(e){E.#t(e)}}const j=({subtype:e,title:n,subtitle:o,content:t,background:r,footer:i,dimmed:s,manualDestroy:a,closeOnBackdropClick:l,ForegroundComponent:c,BackgroundComponent:d})=>new Promise(((u,m)=>{try{E.open({type:"alert",subtype:e,resolve:()=>u(),title:n,subtitle:o,content:t,background:r,footer:i,dimmed:s,manualDestroy:a,closeOnBackdropClick:l,ForegroundComponent:c,BackgroundComponent:d})}catch(e){m(e)}})),P=({subtype:e,title:n,subtitle:o,content:t,background:r,footer:i,dimmed:s,manualDestroy:a,closeOnBackdropClick:l,ForegroundComponent:c,BackgroundComponent:d})=>new Promise(((u,m)=>{try{E.open({type:"confirm",subtype:e,resolve:e=>u(e??!1),title:n,subtitle:o,content:t,background:r,footer:i,dimmed:s,manualDestroy:a,closeOnBackdropClick:l,ForegroundComponent:c,BackgroundComponent:d})}catch(e){m(e)}})),V=({defaultValue:e,title:n,subtitle:o,content:t,Input:r,disabled:i,returnOnCancel:s,background:a,footer:l,dimmed:c,manualDestroy:d,closeOnBackdropClick:u,ForegroundComponent:m,BackgroundComponent:p})=>new Promise(((C,h)=>{try{E.open({type:"prompt",resolve:e=>C(e),title:n,subtitle:o,content:t,Input:r,defaultValue:e,disabled:i,returnOnCancel:s,background:a,footer:l,dimmed:c,manualDestroy:d,closeOnBackdropClick:u,ForegroundComponent:m,BackgroundComponent:p})}catch(e){h(e)}}));class z{id;initiator;title;subtitle;background;manualDestroy;closeOnBackdropClick;dimmed;ForegroundComponent;BackgroundComponent;#r;get alive(){return this.#r}#i;get visible(){return this.#i}#s;#a=new Set;constructor({id:e,initiator:n,title:o,subtitle:t,background:r,dimmed:i=!0,manualDestroy:s=!1,closeOnBackdropClick:a=!0,resolve:l,ForegroundComponent:c,BackgroundComponent:d}){this.id=e,this.initiator=n,this.title=o,this.subtitle=t,this.background=r,this.dimmed=i,this.manualDestroy=s,this.closeOnBackdropClick=a,this.ForegroundComponent=c,this.BackgroundComponent=d,this.#r=!0,this.#i=!0,this.#s=l}subscribe(e){return this.#a.add(e),()=>{this.#a.delete(e)}}publish(){for(const e of this.#a)e()}resolve(e){this.#s(e)}onDestroy(){const e=!0===this.#r;this.#r=!1,this.manualDestroy&&e&&this.publish()}onShow(){const e=!1===this.#i;this.#i=!0,e&&this.publish()}onHide(){const e=!0===this.#i;this.#i=!1,e&&this.publish()}}class M extends z{type;subtype;content;footer;constructor({id:e,initiator:n,type:o,subtype:t,title:r,subtitle:i,content:s,footer:a,background:l,dimmed:c,manualDestroy:d,closeOnBackdropClick:u,resolve:m,ForegroundComponent:p,BackgroundComponent:C}){super({id:e,initiator:n,title:r,subtitle:i,background:l,dimmed:c,manualDestroy:d,closeOnBackdropClick:u,resolve:m,ForegroundComponent:p,BackgroundComponent:C}),this.type=o,this.subtype=t,this.content=s,this.footer=a}onClose(){this.resolve(null)}onConfirm(){this.resolve(null)}}class L extends z{type;subtype;content;footer;constructor({id:e,initiator:n,type:o,subtype:t,title:r,subtitle:i,content:s,footer:a,background:l,dimmed:c,manualDestroy:d,closeOnBackdropClick:u,resolve:m,ForegroundComponent:p,BackgroundComponent:C}){super({id:e,initiator:n,title:r,subtitle:i,background:l,dimmed:c,manualDestroy:d,closeOnBackdropClick:u,resolve:m,ForegroundComponent:p,BackgroundComponent:C}),this.type=o,this.subtype=t,this.content=s,this.footer=a}onClose(){this.resolve(!1)}onConfirm(){this.resolve(!0)}}class T extends z{type;content;defaultValue;Input;disabled;returnOnCancel;footer;#l;constructor({id:e,initiator:n,type:o,title:t,subtitle:r,content:i,defaultValue:s,Input:a,disabled:l,returnOnCancel:c,footer:d,background:u,dimmed:m,manualDestroy:p,closeOnBackdropClick:C,resolve:h,ForegroundComponent:f,BackgroundComponent:g}){super({id:e,initiator:n,title:t,subtitle:r,background:u,dimmed:m,manualDestroy:p,closeOnBackdropClick:C,resolve:h,ForegroundComponent:f,BackgroundComponent:g}),this.type=o,this.content=i,this.Input=a,this.defaultValue=s,this.#l=s,this.disabled=l,this.returnOnCancel=c,this.footer=d}onChange(e){this.#l=e}onConfirm(){this.resolve(this.#l??null)}onClose(){this.returnOnCancel?this.resolve(this.#l??null):this.resolve(null)}}const H=e=>{switch(e.type){case"alert":return new M(e);case"confirm":return new L(e);case"prompt":return new T(e)}throw new Error(`Unknown modal: ${e.type}`,{modal:e})},_=o({}),A=t((({usePathname:n,children:o})=>{const t=r(new Map),[c,d]=i([]),u=k(c),{pathname:m}=n(),p=r(m),C=r(0),f=te(),g=s((()=>h(f.duration)),[f]);x((()=>{const{manualDestroy:e,closeOnBackdropClick:n}=f;for(const o of E.prerender){const r=H({...o,id:C.current++,initiator:p.current,manualDestroy:void 0!==o.manualDestroy?o.manualDestroy:e,closeOnBackdropClick:void 0!==o.closeOnBackdropClick?o.closeOnBackdropClick:n});t.current.set(r.id,r),d((e=>[...e,r.id]))}return E.openHandler=o=>{const r=H({...o,id:C.current++,initiator:p.current,manualDestroy:void 0!==o.manualDestroy?o.manualDestroy:e,closeOnBackdropClick:void 0!==o.closeOnBackdropClick?o.closeOnBackdropClick:n});t.current.set(r.id,r),d((e=>{const n=[];for(let o=0;o<e.length;o++){const r=e[o];t.current.get(r)?.alive?n.push(r):t.current.delete(r)}return[...n,r.id]}))},()=>{E.reset()}})),a((()=>{for(const e of u.current){const n=t.current.get(e);n?.alive&&(n.initiator===m?n.onShow():n.onHide())}p.current=m}),[m]);const b=l((e=>t.current.get(e)),[]),v=l((e=>{const n=t.current.get(e);n&&(n.onDestroy(),y.current?.())}),[]),y=r(void 0),B=l((e=>{const n=t.current.get(e);n&&(n.onHide(),y.current?.(),n.manualDestroy||setTimeout((()=>{n.onDestroy()}),g))}),[g]),D=l(((e,n)=>{const o=t.current.get(e);o&&"prompt"===o.type&&o.onChange(n)}),[]),O=l((e=>{const n=t.current.get(e);n&&(n.onConfirm(),B(e))}),[B]),F=l((e=>{const n=t.current.get(e);n&&(n.onClose(),B(e))}),[B]),N=l((e=>({modal:b(e),onConfirm:()=>O(e),onClose:()=>F(e),onChange:n=>D(e,n),onDestroy:()=>v(e)})),[b,O,F,D,v]),w=s((()=>({modalIds:c,getModalNode:b,onChange:D,onConfirm:O,onClose:F,onDestroy:v,getModal:N,setUpdater:e=>{y.current=e}})),[c,N,b,D,O,F,v]);return e(_.Provider,{value:w,children:o})})),$=()=>c(_),q=e=>{const{getModal:n}=$();return s((()=>n(e)),[e,n])};function Y(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}const R=w("production"===process.env.NODE_ENV?{name:"131j9g2",styles:"margin:unset"}:{name:"1w3kbco-fallback",styles:"margin:unset;label:fallback;",toString:Y}),U=w("production"===process.env.NODE_ENV?{name:"1kuk3a3",styles:"display:flex;flex-direction:column;justify-content:center;align-items:center;background-color:white;padding:20px 80px;gap:10px;border:1px solid black"}:{name:"16dbbea-frame",styles:"display:flex;flex-direction:column;justify-content:center;align-items:center;background-color:white;padding:20px 80px;gap:10px;border:1px solid black;label:frame;",toString:Y}),G=({children:n})=>e("h2",{className:R,children:n}),J=({children:n})=>e("h3",{className:R,children:n}),K=({children:n})=>e("div",{className:R,children:n}),Q=({confirmLabel:o,hideConfirm:t=!1,cancelLabel:r,hideCancel:i=!1,disabled:s,onConfirm:a,onCancel:l})=>n("div",{children:[!t&&e("button",{onClick:a,disabled:s,children:o||"Confirm"}),!i&&"function"==typeof l&&e("button",{onClick:l,children:r||"Cancel"})]}),W=e=>e?.visible,X=(e=W,n=0)=>{const{modalIds:o,getModalNode:t}=$();return s((()=>{let n=0;for(const r of o)e(t(r))&&n++;return n}),[t,o,n])},Z=d((({id:n,onChangeOrder:o,children:t},r)=>{const i=X(),[a,l]=s((()=>{const e=i>1;return[e?Math.floor(n/5)%3*100:0,e?n%5*35:0]}),[i,n]);return e("div",{ref:r,className:U,onClick:o,style:{marginBottom:`calc(25vh + ${a}px)`,marginLeft:`${a}px`,transform:`translate(${l}px, ${l}px)`},children:t})})),ee=o({}),ne=t((({ForegroundComponent:n,BackgroundComponent:o,TitleComponent:r,SubtitleComponent:i,ContentComponent:a,FooterComponent:l,options:c,children:d})=>{const u=s((()=>({BackgroundComponent:o,ForegroundComponent:n||Z,TitleComponent:r||G,SubtitleComponent:i||J,ContentComponent:t(a||K),FooterComponent:t(l||Q),options:{duration:"300ms",backdrop:"rgba(0, 0, 0, 0.5)",closeOnBackdropClick:!0,manualDestroy:!1,...c}})),[n,o,a,l,i,r,c]);return e(ee.Provider,{value:u,children:d})})),oe=()=>c(ee),te=()=>c(ee).options,re=()=>{const e=te();return{duration:e.duration,milliseconds:h(e.duration)}},ie=()=>te().backdrop,se=o({}),ae=({context:n,children:o})=>{const t=s((()=>({context:n||{}})),[n]);return e(se.Provider,{value:t,children:o})},le=()=>c(se),ce=()=>{const[e,n]=i(window.location.pathname);return a((()=>{let o;const t=()=>{o&&cancelAnimationFrame(o),e!==window.location.pathname?n(window.location.pathname):o=requestAnimationFrame(t)};return o=requestAnimationFrame(t),()=>{o&&cancelAnimationFrame(o)}}),[e]),{pathname:e}};function de(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}const ue=w("production"===process.env.NODE_ENV?{name:"u7uu4v",styles:"display:none;position:fixed;inset:0;z-index:-999;pointer-events:none;>*{pointer-events:none;}"}:{name:"coymdj-background",styles:"display:none;position:fixed;inset:0;z-index:-999;pointer-events:none;>*{pointer-events:none;};label:background;",toString:de}),me=w("production"===process.env.NODE_ENV?{name:"n07k1x",styles:"pointer-events:all"}:{name:"1hektcs-active",styles:"pointer-events:all;label:active;",toString:de}),pe=w("production"===process.env.NODE_ENV?{name:"1wnowod",styles:"display:flex;align-items:center;justify-content:center"}:{name:"xppew7-visible",styles:"display:flex;align-items:center;justify-content:center;label:visible;",toString:de}),Ce=({modalId:n,onChangeOrder:o})=>{const{BackgroundComponent:t}=oe(),{context:r}=le(),{modal:i,onClose:a,onChange:c,onConfirm:d,onDestroy:u}=q(n),m=l((e=>{i&&i.closeOnBackdropClick&&i.visible&&a(),e.stopPropagation()}),[i,a]),p=s((()=>i?.BackgroundComponent||t),[t,i]);return i?e("div",{className:I(ue,{[pe]:i.manualDestroy?i.alive:i.visible,[me]:i.closeOnBackdropClick&&i.visible}),onClick:m,children:p&&e(p,{id:i.id,type:i.type,alive:i.alive,visible:i.visible,initiator:i.initiator,manualDestroy:i.manualDestroy,closeOnBackdropClick:i.closeOnBackdropClick,background:i.background,onChange:c,onConfirm:d,onClose:a,onDestroy:u,onChangeOrder:o,context:r})}):null};function he(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}const fe=w("production"===process.env.NODE_ENV?{name:"12g0hx0",styles:"pointer-events:none;display:none;position:fixed;inset:0;z-index:1"}:{name:"1hcczik-foreground",styles:"pointer-events:none;display:none;position:fixed;inset:0;z-index:1;label:foreground;",toString:he}),ge=w("production"===process.env.NODE_ENV?{name:"1g95xyq",styles:">*{pointer-events:all;}"}:{name:"123csva-active",styles:">*{pointer-events:all;};label:active;",toString:he}),be=w("production"===process.env.NODE_ENV?{name:"1fmljv2",styles:"display:flex!important;justify-content:center;align-items:center"}:{name:"1p4unab-visible",styles:"display:flex!important;justify-content:center;align-items:center;label:visible;",toString:he}),ve=t((({modal:o,handlers:t})=>{const{title:r,subtitle:i,content:a,footer:l}=s((()=>o),[o]),{context:c}=le(),{onConfirm:d}=s((()=>t),[t]),m=B(d),{TitleComponent:p,SubtitleComponent:C,ContentComponent:h,FooterComponent:g}=oe();return n(u,{children:[r&&(f(r)?e(p,{context:c,children:r}):r),i&&(f(i)?e(C,{context:c,children:i}):i),a&&(f(a)?e(h,{context:c,children:a}):D(a,{onConfirm:m})),!1!==l&&("function"==typeof l?l({onConfirm:m,context:c}):e(g,{onConfirm:m,confirmLabel:l?.confirm,hideConfirm:l?.hideConfirm,context:c}))]})})),ye=t((({modal:o,handlers:t})=>{const{title:r,subtitle:i,content:a,footer:l}=s((()=>o),[o]),{context:c}=le(),{onConfirm:d,onClose:m}=s((()=>t),[t]),p=B(d),C=B(m),{TitleComponent:h,SubtitleComponent:g,ContentComponent:b,FooterComponent:v}=oe();return n(u,{children:[r&&(f(r)?e(h,{context:c,children:r}):r),i&&(f(i)?e(g,{context:c,children:i}):i),a&&(f(a)?e(b,{context:c,children:a}):D(a,{onConfirm:p,onCancel:C,context:c})),!1!==l&&("function"==typeof l?l({onConfirm:p,onCancel:C,context:c}):e(v,{onConfirm:p,onCancel:C,confirmLabel:l?.confirm,cancelLabel:l?.cancel,hideConfirm:l?.hideConfirm,hideCancel:l?.hideCancel,context:c}))]})})),ke=t((({modal:o,handlers:r})=>{const{Input:a,defaultValue:c,disabled:d,title:m,subtitle:p,content:C,footer:h}=s((()=>({...o,Input:t(O(o.Input))})),[o]),{context:b}=le(),[v,y]=i(c),{onChange:k,onClose:x,onConfirm:F}=s((()=>r),[r]),N=B(x),w=B((e=>{const n=g(e)?e(v):e;y(n),k(n)})),I=l((()=>{requestAnimationFrame(F)}),[F]),S=s((()=>!!v&&!!d?.(v)),[d,v]),{TitleComponent:E,SubtitleComponent:j,ContentComponent:P,FooterComponent:V}=oe();return n(u,{children:[m&&(f(m)?e(E,{context:b,children:m}):m),p&&(f(p)?e(j,{context:b,children:p}):p),C&&(f(C)?e(P,{context:b,children:C}):D(C,{onConfirm:I,onCancel:N,context:b})),a&&e(a,{defaultValue:c,value:v,onChange:w,onConfirm:I,onCancel:N,context:b}),!1!==h&&("function"==typeof h?h({value:v,disabled:S,onChange:w,onConfirm:I,onCancel:N,context:b}):e(V,{disabled:S,onConfirm:I,onCancel:N,confirmLabel:h?.confirm,cancelLabel:h?.cancel,hideConfirm:h?.hideConfirm,hideCancel:h?.hideCancel,context:b}))]})})),xe=({modalId:o,onChangeOrder:t})=>{const{ForegroundComponent:r}=oe(),{context:i}=le(),{modal:a,onChange:l,onConfirm:c,onClose:d,onDestroy:u}=q(o),m=s((()=>a?.ForegroundComponent||r),[r,a]);return a?e("div",{className:I(fe,{[be]:a.manualDestroy?a.alive:a.visible,[ge]:a.visible}),children:n(m,{id:a.id,type:a.type,alive:a.alive,visible:a.visible,initiator:a.initiator,manualDestroy:a.manualDestroy,closeOnBackdropClick:a.closeOnBackdropClick,background:a.background,onChange:l,onConfirm:c,onClose:d,onDestroy:u,onChangeOrder:t,context:i,children:["alert"===a.type&&e(ve,{modal:a,handlers:{onConfirm:c}}),"confirm"===a.type&&e(ye,{modal:a,handlers:{onConfirm:c,onClose:d}}),"prompt"===a.type&&e(ke,{modal:a,handlers:{onChange:l,onConfirm:c,onClose:d}})]})}):null},Be=e=>{const[n,o]=F();return m((()=>{if(e)return e.subscribe(o)}),[e,o]),n},De=w("production"===process.env.NODE_ENV?{name:"13dmkf4",styles:"position:fixed;inset:0;pointer-events:none;overflow:hidden"}:{name:"yjeu12-presenter",styles:"position:fixed;inset:0;pointer-events:none;overflow:hidden;label:presenter;",toString:function(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}}),{increment:Oe}=b(1),Fe=t((({modalId:o})=>{const t=r(null),{modal:i}=q(o);Be(i);const s=B((()=>{t.current&&(t.current.style.zIndex=`${Oe()}`)}));return n("div",{ref:t,className:De,children:[e(Ce,{modalId:o,onChangeOrder:s}),e(xe,{modalId:o,onChangeOrder:s})]})})),Ne=w("production"===process.env.NODE_ENV?{name:"2hpasy",styles:"display:flex;align-items:center;justify-content:center;position:fixed;inset:0;pointer-events:none;z-index:1000;transition:background-color ease-in-out"}:{name:"lhj8co-anchor",styles:"display:flex;align-items:center;justify-content:center;position:fixed;inset:0;pointer-events:none;z-index:1000;transition:background-color ease-in-out;label:anchor;",toString:function(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}}),we=e=>e?.visible&&e.dimmed,Ie=t(O((()=>{const[n,o]=F(),{modalIds:t,setUpdater:r}=$();m((()=>{r(o)}),[r,o]);const i=te(),s=X(we,n);return e("div",{className:Ne,style:{transitionDuration:i.duration,backgroundColor:s?i.backdrop:"transparent"},children:v(t,(n=>e(Fe,{modalId:n},n)))})}))),Se=({ForegroundComponent:n,BackgroundComponent:o,TitleComponent:t,SubtitleComponent:r,ContentComponent:i,FooterComponent:s,usePathname:a,options:l,context:c,anchor:d})=>S(e(ae,{context:c,children:e(ne,{ForegroundComponent:n,BackgroundComponent:o,TitleComponent:t,SubtitleComponent:r,ContentComponent:i,FooterComponent:s,options:l,children:e(A,{usePathname:a,children:e(Ie,{})})})}),d),Ee=()=>{const e=r(E.activate()),n=r(null),[,o]=F(),t=l((t=>{e.current?(n.current=E.anchor({root:t}),o()):y("ModalProvider is already initialized",["ModalProvider can only be initialized once.","Nesting ModalProvider will be ignored..."],{info:"Something is wrong with the ModalProvider initialization..."})}),[o]);return{anchorRef:n,handleInitialize:t}},je=d((({usePathname:e,ForegroundComponent:o,BackgroundComponent:t,TitleComponent:r,SubtitleComponent:i,ContentComponent:a,FooterComponent:l,options:c,context:d,children:m},C)=>{const h=s((()=>e||ce),[e]),{anchorRef:f,handleInitialize:g}=Ee();return p(C,(()=>({initialize:g})),[g]),N((()=>(null===C&&g(),()=>{f.current&&f.current.remove()}))),n(u,{children:[m,f.current&&Se({ForegroundComponent:o,BackgroundComponent:t,TitleComponent:r,SubtitleComponent:i,ContentComponent:a,FooterComponent:l,usePathname:h,options:c,context:d,anchor:f.current})]})})),Pe=({usePathname:e,ForegroundComponent:n,BackgroundComponent:o,TitleComponent:t,SubtitleComponent:r,ContentComponent:i,FooterComponent:a,options:c,context:d,mode:u="auto"}={})=>{const m=s((()=>e||ce),[e]),{anchorRef:p,handleInitialize:C}=Ee();N((()=>("auto"===u&&C(),()=>{p.current&&p.current.remove()})));const h=l((e=>{"manual"===u&&C(e)}),[u,C]);return{portal:p.current&&Se({usePathname:m,ForegroundComponent:n,BackgroundComponent:o,TitleComponent:t,SubtitleComponent:r,ContentComponent:i,FooterComponent:a,options:c,context:d,anchor:p.current}),initialize:h}},Ve=(e,n)=>{const{modal:o,onDestroy:t}=q(e),i=Be(o),s=r({modal:o,onDestroy:t,milliseconds:f(n)?h(n):n});m((()=>{const{modal:e,onDestroy:n,milliseconds:o}=s.current;if(!e||e.visible||!e.alive)return;const t=setTimeout((()=>{n()}),o);return()=>{t&&clearTimeout(t)}}),[i])},ze=(e,n)=>{const o=r(n);o.current=n,a((()=>{if(!o.current)return;let n;return n=e?requestAnimationFrame((()=>o.current.onVisible?.())):requestAnimationFrame((()=>o.current.onHidden?.())),()=>{n&&cancelAnimationFrame(n)}}),[e])};export{je as ModalProvider,j as alert,P as confirm,V as prompt,X as useActiveModalCount,Ve as useDestroyAfter,Pe as useInitializeModal,ze as useModalAnimation,ie as useModalBackdrop,re as useModalDuration,te as useModalOptions,Be as useSubscribeModal};
|
|
2
|
-
//# sourceMappingURL=index.esm.js.map
|
package/dist/index.esm.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../src/app/ModalManager.ts","../src/core/handle/alert.ts","../src/core/handle/confirm.ts","../src/core/handle/prompt.ts","../src/core/node/ModalNode/AbstractNode.ts","../src/core/node/ModalNode/AlertNode.ts","../src/core/node/ModalNode/ConfirmNode.ts","../src/core/node/ModalNode/PromptNode.ts","../src/core/node/nodeFactory.ts","../src/providers/ModalManagerContext/ModalManagerContext.ts","../src/providers/ModalManagerContext/ModalManagerContextProvider.tsx","../src/providers/ModalManagerContext/useModalManagerContext.ts","../src/components/FallbackComponents/classNames.emotion.ts","../src/components/FallbackComponents/FallbackTitle.tsx","../src/components/FallbackComponents/FallbackSubtitle.tsx","../src/components/FallbackComponents/FallbackContent.tsx","../src/components/FallbackComponents/FallbackFooter.tsx","../src/hooks/useActiveModalCount.ts","../src/components/FallbackComponents/FallbackForegroundFrame.tsx","../src/providers/ConfigurationContext/ConfigurationContext.ts","../src/providers/ConfigurationContext/ConfigurationContextProvider.tsx","../src/app/constant.ts","../src/providers/ConfigurationContext/useConfigurationContext.ts","../src/providers/UserDefinedContext/UserDefinedContext.ts","../src/providers/UserDefinedContext/UserDefinedContextProvider.tsx","../src/providers/UserDefinedContext/useUserDefinedContext.ts","../src/hooks/useDefaultPathname.ts","../src/components/Background/classNames.emotion.ts","../src/components/Background/Background.tsx","../src/components/Foreground/classNames.emotion.ts","../src/components/Foreground/components/AlertInner.tsx","../src/components/Foreground/components/ConfirmInner.tsx","../src/components/Foreground/components/PromptInner.tsx","../src/components/Foreground/Foreground.tsx","../src/hooks/useSubscribeModal.ts","../src/components/Presenter/classNames.emotion.ts","../src/components/Presenter/Presenter.tsx","../src/components/Anchor/classNames.emotion.ts","../src/components/Anchor/Anchor.tsx","../src/bootstrap/BootstrapProvider/helpers/bootstrap.tsx","../src/bootstrap/BootstrapProvider/hooks/useInitialize.ts","../src/bootstrap/BootstrapProvider/BootstrapProvider.tsx","../src/bootstrap/BootstrapProvider/useBootstrap.tsx","../src/hooks/useDestroyAfter.ts","../src/hooks/useModalAnimation.ts"],"sourcesContent":["import { getRandomString } from '@winglet/common-utils';\n\nimport type { Fn } from '@aileron/declare';\n\nimport type { Modal } from '@/promise-modal/types';\n\nexport class ModalManager {\n static #active = false;\n static activate() {\n if (ModalManager.#active) return false;\n return (ModalManager.#active = true);\n }\n\n static #anchor: HTMLElement | null = null;\n static anchor(options?: {\n tag?: string;\n prefix?: string;\n root?: HTMLElement;\n }): HTMLElement {\n if (ModalManager.#anchor) {\n const anchor = document.getElementById(ModalManager.#anchor.id);\n if (anchor) return anchor;\n }\n const {\n tag = 'div',\n prefix = 'promise-modal',\n root = document.body,\n } = options || {};\n const node = document.createElement(tag);\n node.setAttribute('id', `${prefix}-${getRandomString(36)}`);\n root.appendChild(node);\n ModalManager.#anchor = node;\n return node;\n }\n\n static #prerenderList: Modal[] = [];\n static get prerender() {\n return ModalManager.#prerenderList;\n }\n\n static #openHandler: Fn<[Modal], void> = (modal: Modal) =>\n ModalManager.#prerenderList.push(modal);\n static set openHandler(handler: Fn<[Modal], void>) {\n ModalManager.#openHandler = handler;\n ModalManager.#prerenderList = [];\n }\n\n static get unanchored() {\n return !ModalManager.#anchor;\n }\n\n static reset() {\n ModalManager.#active = false;\n ModalManager.#anchor = null;\n ModalManager.#prerenderList = [];\n ModalManager.#openHandler = (modal: Modal) =>\n ModalManager.#prerenderList.push(modal);\n }\n\n static open(modal: Modal) {\n ModalManager.#openHandler(modal);\n }\n}\n","import type { ComponentType, ReactNode } from 'react';\n\nimport { ModalManager } from '@/promise-modal/app/ModalManager';\nimport type {\n AlertContentProps,\n AlertFooterRender,\n BackgroundComponent,\n FooterOptions,\n ForegroundComponent,\n ModalBackground,\n} from '@/promise-modal/types';\n\ninterface AlertProps<B> {\n subtype?: 'info' | 'success' | 'warning' | 'error';\n title?: ReactNode;\n subtitle?: ReactNode;\n content?: ReactNode | ComponentType<AlertContentProps>;\n background?: ModalBackground<B>;\n footer?:\n | AlertFooterRender\n | Pick<FooterOptions, 'confirm' | 'hideConfirm'>\n | false;\n dimmed?: boolean;\n manualDestroy?: boolean;\n closeOnBackdropClick?: boolean;\n ForegroundComponent?: ForegroundComponent;\n BackgroundComponent?: BackgroundComponent;\n}\n\nexport const alert = <B = any>({\n subtype,\n title,\n subtitle,\n content,\n background,\n footer,\n dimmed,\n manualDestroy,\n closeOnBackdropClick,\n ForegroundComponent,\n BackgroundComponent,\n}: AlertProps<B>) => {\n return new Promise<void>((resolve, reject) => {\n try {\n ModalManager.open({\n type: 'alert',\n subtype,\n resolve: () => resolve(),\n title,\n subtitle,\n content,\n background,\n footer,\n dimmed,\n manualDestroy,\n closeOnBackdropClick,\n ForegroundComponent,\n BackgroundComponent,\n });\n } catch (error) {\n reject(error);\n }\n });\n};\n","import type { ComponentType, ReactNode } from 'react';\n\nimport { ModalManager } from '@/promise-modal/app/ModalManager';\nimport type {\n BackgroundComponent,\n ConfirmContentProps,\n ConfirmFooterRender,\n FooterOptions,\n ForegroundComponent,\n ModalBackground,\n} from '@/promise-modal/types';\n\ninterface ConfirmProps<B> {\n subtype?: 'info' | 'success' | 'warning' | 'error';\n title?: ReactNode;\n subtitle?: ReactNode;\n content?: ReactNode | ComponentType<ConfirmContentProps>;\n background?: ModalBackground<B>;\n footer?: ConfirmFooterRender | FooterOptions | false;\n dimmed?: boolean;\n manualDestroy?: boolean;\n closeOnBackdropClick?: boolean;\n ForegroundComponent?: ForegroundComponent;\n BackgroundComponent?: BackgroundComponent;\n}\n\nexport const confirm = <B = any>({\n subtype,\n title,\n subtitle,\n content,\n background,\n footer,\n dimmed,\n manualDestroy,\n closeOnBackdropClick,\n ForegroundComponent,\n BackgroundComponent,\n}: ConfirmProps<B>) => {\n return new Promise<boolean>((resolve, reject) => {\n try {\n ModalManager.open({\n type: 'confirm',\n subtype,\n resolve: (result) => resolve(result ?? false),\n title,\n subtitle,\n content,\n background,\n footer,\n dimmed,\n manualDestroy,\n closeOnBackdropClick,\n ForegroundComponent,\n BackgroundComponent,\n });\n } catch (error) {\n reject(error);\n }\n });\n};\n","import type { ComponentType, ReactNode } from 'react';\n\nimport { ModalManager } from '@/promise-modal/app/ModalManager';\nimport type {\n BackgroundComponent,\n FooterOptions,\n ForegroundComponent,\n ModalBackground,\n PromptContentProps,\n PromptFooterRender,\n PromptInputProps,\n} from '@/promise-modal/types';\n\ninterface PromptProps<T, B = any> {\n title?: ReactNode;\n subtitle?: ReactNode;\n content?: ReactNode | ComponentType<PromptContentProps>;\n Input: (props: PromptInputProps<T>) => ReactNode;\n defaultValue?: T;\n disabled?: (value: T) => boolean;\n returnOnCancel?: boolean;\n background?: ModalBackground<B>;\n footer?: PromptFooterRender<T> | FooterOptions | false;\n dimmed?: boolean;\n manualDestroy?: boolean;\n closeOnBackdropClick?: boolean;\n ForegroundComponent?: ForegroundComponent;\n BackgroundComponent?: BackgroundComponent;\n}\n\nexport const prompt = <T, B = any>({\n defaultValue,\n title,\n subtitle,\n content,\n Input,\n disabled,\n returnOnCancel,\n background,\n footer,\n dimmed,\n manualDestroy,\n closeOnBackdropClick,\n ForegroundComponent,\n BackgroundComponent,\n}: PromptProps<T, B>) => {\n return new Promise<T>((resolve, reject) => {\n try {\n ModalManager.open({\n type: 'prompt',\n resolve: (result) => resolve(result as T),\n title,\n subtitle,\n content,\n Input,\n defaultValue,\n disabled,\n returnOnCancel,\n background,\n footer,\n dimmed,\n manualDestroy,\n closeOnBackdropClick,\n ForegroundComponent,\n BackgroundComponent,\n });\n } catch (error) {\n reject(error);\n }\n });\n};\n","import type { ReactNode } from 'react';\n\nimport type { Fn } from '@aileron/declare';\n\nimport type {\n BackgroundComponent,\n BaseModal,\n ForegroundComponent,\n ManagedEntity,\n ModalBackground,\n} from '@/promise-modal/types';\n\ntype AbstractNodeProps<T, B> = BaseModal<T, B> & ManagedEntity;\n\nexport abstract class AbstractNode<T, B> {\n readonly id: number;\n readonly initiator: string;\n\n readonly title?: ReactNode;\n readonly subtitle?: ReactNode;\n readonly background?: ModalBackground<B>;\n\n readonly manualDestroy: boolean;\n readonly closeOnBackdropClick: boolean;\n readonly dimmed: boolean;\n\n readonly ForegroundComponent?: ForegroundComponent;\n readonly BackgroundComponent?: BackgroundComponent;\n\n #alive: boolean;\n get alive() {\n return this.#alive;\n }\n #visible: boolean;\n get visible() {\n return this.#visible;\n }\n\n #resolve: (result: T | null) => void;\n #listeners: Set<Fn> = new Set();\n\n constructor({\n id,\n initiator,\n title,\n subtitle,\n background,\n dimmed = true,\n manualDestroy = false,\n closeOnBackdropClick = true,\n resolve,\n ForegroundComponent,\n BackgroundComponent,\n }: AbstractNodeProps<T, B>) {\n this.id = id;\n this.initiator = initiator;\n this.title = title;\n this.subtitle = subtitle;\n this.background = background;\n\n this.dimmed = dimmed;\n this.manualDestroy = manualDestroy;\n this.closeOnBackdropClick = closeOnBackdropClick;\n\n this.ForegroundComponent = ForegroundComponent;\n this.BackgroundComponent = BackgroundComponent;\n\n this.#alive = true;\n this.#visible = true;\n this.#resolve = resolve;\n }\n\n subscribe(listener: Fn) {\n this.#listeners.add(listener);\n return () => {\n this.#listeners.delete(listener);\n };\n }\n publish() {\n for (const listener of this.#listeners) listener();\n }\n protected resolve(result: T | null) {\n this.#resolve(result);\n }\n onDestroy() {\n const needPublish = this.#alive === true;\n this.#alive = false;\n if (this.manualDestroy && needPublish) this.publish();\n }\n onShow() {\n const needPublish = this.#visible === false;\n this.#visible = true;\n if (needPublish) this.publish();\n }\n onHide() {\n const needPublish = this.#visible === true;\n this.#visible = false;\n if (needPublish) this.publish();\n }\n abstract onClose(): void;\n abstract onConfirm(): void;\n}\n","import type { ComponentType, ReactNode } from 'react';\n\nimport type {\n AlertContentProps,\n AlertFooterRender,\n AlertModal,\n FooterOptions,\n ManagedEntity,\n} from '@/promise-modal/types';\n\nimport { AbstractNode } from './AbstractNode';\n\ntype AlertNodeProps<B> = AlertModal<B> & ManagedEntity;\n\nexport class AlertNode<B> extends AbstractNode<null, B> {\n readonly type: 'alert';\n readonly subtype?: 'info' | 'success' | 'warning' | 'error';\n readonly content?: ReactNode | ComponentType<AlertContentProps>;\n readonly footer?:\n | AlertFooterRender\n | Pick<FooterOptions, 'confirm' | 'hideConfirm'>\n | false;\n\n constructor({\n id,\n initiator,\n type,\n subtype,\n title,\n subtitle,\n content,\n footer,\n background,\n dimmed,\n manualDestroy,\n closeOnBackdropClick,\n resolve,\n ForegroundComponent,\n BackgroundComponent,\n }: AlertNodeProps<B>) {\n super({\n id,\n initiator,\n title,\n subtitle,\n background,\n dimmed,\n manualDestroy,\n closeOnBackdropClick,\n resolve,\n ForegroundComponent,\n BackgroundComponent,\n });\n this.type = type;\n this.subtype = subtype;\n this.content = content;\n this.footer = footer;\n }\n onClose() {\n this.resolve(null);\n }\n onConfirm() {\n this.resolve(null);\n }\n}\n","import type { ComponentType, ReactNode } from 'react';\n\nimport type {\n ConfirmContentProps,\n ConfirmFooterRender,\n ConfirmModal,\n FooterOptions,\n ManagedEntity,\n} from '@/promise-modal/types';\n\nimport { AbstractNode } from './AbstractNode';\n\ntype ConfirmNodeProps<B> = ConfirmModal<B> & ManagedEntity;\n\nexport class ConfirmNode<B> extends AbstractNode<boolean, B> {\n readonly type: 'confirm';\n readonly subtype?: 'info' | 'success' | 'warning' | 'error';\n readonly content?: ReactNode | ComponentType<ConfirmContentProps>;\n readonly footer?: ConfirmFooterRender | FooterOptions | false;\n\n constructor({\n id,\n initiator,\n type,\n subtype,\n title,\n subtitle,\n content,\n footer,\n background,\n dimmed,\n manualDestroy,\n closeOnBackdropClick,\n resolve,\n ForegroundComponent,\n BackgroundComponent,\n }: ConfirmNodeProps<B>) {\n super({\n id,\n initiator,\n title,\n subtitle,\n background,\n dimmed,\n manualDestroy,\n closeOnBackdropClick,\n resolve,\n ForegroundComponent,\n BackgroundComponent,\n });\n this.type = type;\n this.subtype = subtype;\n this.content = content;\n this.footer = footer;\n }\n onClose() {\n this.resolve(false);\n }\n onConfirm() {\n this.resolve(true);\n }\n}\n","import type { ComponentType, ReactNode } from 'react';\n\nimport type {\n FooterOptions,\n ManagedEntity,\n PromptContentProps,\n PromptFooterRender,\n PromptInputProps,\n PromptModal,\n} from '@/promise-modal/types';\n\nimport { AbstractNode } from './AbstractNode';\n\ntype PromptNodeProps<T, B> = PromptModal<T, B> & ManagedEntity;\n\nexport class PromptNode<T, B> extends AbstractNode<T, B> {\n readonly type: 'prompt';\n readonly content?: ReactNode | ComponentType<PromptContentProps>;\n readonly defaultValue: T | undefined;\n readonly Input: (props: PromptInputProps<T>) => ReactNode;\n readonly disabled?: (value: T) => boolean;\n readonly returnOnCancel?: boolean;\n readonly footer?: PromptFooterRender<T> | FooterOptions | false;\n\n #value: T | undefined;\n\n constructor({\n id,\n initiator,\n type,\n title,\n subtitle,\n content,\n defaultValue,\n Input,\n disabled,\n returnOnCancel,\n footer,\n background,\n dimmed,\n manualDestroy,\n closeOnBackdropClick,\n resolve,\n ForegroundComponent,\n BackgroundComponent,\n }: PromptNodeProps<T, B>) {\n super({\n id,\n initiator,\n title,\n subtitle,\n background,\n dimmed,\n manualDestroy,\n closeOnBackdropClick,\n resolve,\n ForegroundComponent,\n BackgroundComponent,\n });\n this.type = type;\n this.content = content;\n this.Input = Input;\n this.defaultValue = defaultValue;\n this.#value = defaultValue;\n this.disabled = disabled;\n this.returnOnCancel = returnOnCancel;\n this.footer = footer;\n }\n\n onChange(value: T) {\n this.#value = value;\n }\n onConfirm() {\n this.resolve(this.#value ?? null);\n }\n onClose() {\n if (this.returnOnCancel) this.resolve(this.#value ?? null);\n else this.resolve(null);\n }\n}\n","import type { ManagedModal } from '@/promise-modal/types';\n\nimport { AlertNode, ConfirmNode, PromptNode } from './ModalNode';\n\nexport const nodeFactory = <T, B>(modal: ManagedModal<T, B>) => {\n switch (modal.type) {\n case 'alert':\n return new AlertNode<B>(modal);\n case 'confirm':\n return new ConfirmNode<B>(modal);\n case 'prompt':\n return new PromptNode<T, B>(modal);\n }\n // @ts-expect-error: This state is unreachable by design and should NEVER occur.\n throw new Error(`Unknown modal: ${modal.type}`, { modal });\n};\n","import { createContext } from 'react';\n\nimport type { Fn } from '@aileron/declare';\n\nimport type { ModalNode } from '@/promise-modal/core';\nimport type { ModalActions, ModalHandlersWithId } from '@/promise-modal/types';\n\nexport interface ModalManagerContextProps extends ModalHandlersWithId {\n modalIds: ModalNode['id'][];\n getModal: Fn<[id: ModalNode['id']], ModalActions>;\n getModalNode: Fn<[id: ModalNode['id']], ModalNode | undefined>;\n setUpdater: Fn<[updater: Fn]>;\n}\n\nexport const ModalManagerContext = createContext<ModalManagerContextProps>(\n {} as ModalManagerContextProps,\n);\n","import {\n type PropsWithChildren,\n memo,\n useCallback,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { convertMsFromDuration } from '@winglet/common-utils';\nimport { useOnMountLayout, useReference } from '@winglet/react-utils';\n\nimport type { Fn } from '@aileron/declare';\n\nimport { ModalManager } from '@/promise-modal/app/ModalManager';\nimport { type ModalNode, nodeFactory } from '@/promise-modal/core';\nimport { useConfigurationOptions } from '@/promise-modal/providers';\nimport type { Modal } from '@/promise-modal/types';\n\nimport { ModalManagerContext } from './ModalManagerContext';\n\ninterface ModalManagerContextProviderProps {\n usePathname: Fn<[], { pathname: string }>;\n}\n\nexport const ModalManagerContextProvider = memo(\n ({\n usePathname,\n children,\n }: PropsWithChildren<ModalManagerContextProviderProps>) => {\n const modalDictionary = useRef<Map<ModalNode['id'], ModalNode>>(new Map());\n\n const [modalIds, setModalIds] = useState<ModalNode['id'][]>([]);\n const modalIdsRef = useReference(modalIds);\n const { pathname } = usePathname();\n\n const initiator = useRef(pathname);\n const modalIdSequence = useRef(0);\n\n const options = useConfigurationOptions();\n\n const duration = useMemo(\n () => convertMsFromDuration(options.duration),\n [options],\n );\n\n useOnMountLayout(() => {\n const { manualDestroy, closeOnBackdropClick } = options;\n\n for (const data of ModalManager.prerender) {\n const modal = nodeFactory({\n ...data,\n id: modalIdSequence.current++,\n initiator: initiator.current,\n manualDestroy:\n data.manualDestroy !== undefined\n ? data.manualDestroy\n : manualDestroy,\n closeOnBackdropClick:\n data.closeOnBackdropClick !== undefined\n ? data.closeOnBackdropClick\n : closeOnBackdropClick,\n });\n modalDictionary.current.set(modal.id, modal);\n setModalIds((ids) => [...ids, modal.id]);\n }\n\n ModalManager.openHandler = (data: Modal) => {\n const modal = nodeFactory({\n ...data,\n id: modalIdSequence.current++,\n initiator: initiator.current,\n manualDestroy:\n data.manualDestroy !== undefined\n ? data.manualDestroy\n : manualDestroy,\n closeOnBackdropClick:\n data.closeOnBackdropClick !== undefined\n ? data.closeOnBackdropClick\n : closeOnBackdropClick,\n });\n modalDictionary.current.set(modal.id, modal);\n setModalIds((ids) => {\n const aliveIds: number[] = [];\n for (let index = 0; index < ids.length; index++) {\n const id = ids[index];\n const destroyed = !modalDictionary.current.get(id)?.alive;\n if (destroyed) modalDictionary.current.delete(id);\n else aliveIds.push(id);\n }\n return [...aliveIds, modal.id];\n });\n };\n return () => {\n ModalManager.reset();\n };\n });\n\n useLayoutEffect(() => {\n for (const id of modalIdsRef.current) {\n const modal = modalDictionary.current.get(id);\n if (!modal?.alive) continue;\n if (modal.initiator === pathname) modal.onShow();\n else modal.onHide();\n }\n initiator.current = pathname;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [pathname]);\n\n const getModalNode = useCallback((modalId: ModalNode['id']) => {\n return modalDictionary.current.get(modalId);\n }, []);\n\n const onDestroy = useCallback((modalId: ModalNode['id']) => {\n const modal = modalDictionary.current.get(modalId);\n if (!modal) return;\n modal.onDestroy();\n updaterRef.current?.();\n }, []);\n\n const updaterRef = useRef<Fn>(undefined);\n const hideModal = useCallback(\n (modalId: ModalNode['id']) => {\n const modal = modalDictionary.current.get(modalId);\n if (!modal) return;\n modal.onHide();\n updaterRef.current?.();\n if (!modal.manualDestroy)\n setTimeout(() => {\n modal.onDestroy();\n }, duration);\n },\n [duration],\n );\n\n const onChange = useCallback((modalId: ModalNode['id'], value: any) => {\n const modal = modalDictionary.current.get(modalId);\n if (!modal) return;\n if (modal.type === 'prompt') modal.onChange(value);\n }, []);\n\n const onConfirm = useCallback(\n (modalId: ModalNode['id']) => {\n const modal = modalDictionary.current.get(modalId);\n if (!modal) return;\n modal.onConfirm();\n hideModal(modalId);\n },\n [hideModal],\n );\n\n const onClose = useCallback(\n (modalId: ModalNode['id']) => {\n const modal = modalDictionary.current.get(modalId);\n if (!modal) return;\n modal.onClose();\n hideModal(modalId);\n },\n [hideModal],\n );\n\n const getModal = useCallback(\n (modalId: ModalNode['id']) => ({\n modal: getModalNode(modalId),\n onConfirm: () => onConfirm(modalId),\n onClose: () => onClose(modalId),\n onChange: (value: any) => onChange(modalId, value),\n onDestroy: () => onDestroy(modalId),\n }),\n [getModalNode, onConfirm, onClose, onChange, onDestroy],\n );\n\n const value = useMemo(() => {\n return {\n modalIds,\n getModalNode,\n onChange,\n onConfirm,\n onClose,\n onDestroy,\n getModal,\n setUpdater: (updater: Fn) => {\n updaterRef.current = updater;\n },\n };\n }, [\n modalIds,\n getModal,\n getModalNode,\n onChange,\n onConfirm,\n onClose,\n onDestroy,\n ]);\n\n return (\n <ModalManagerContext.Provider value={value}>\n {children}\n </ModalManagerContext.Provider>\n );\n },\n);\n","import { useContext, useMemo } from 'react';\n\nimport type { ManagedModal } from '@/promise-modal/types';\n\nimport { ModalManagerContext } from './ModalManagerContext';\n\nexport const useModalManagerContext = () => useContext(ModalManagerContext);\n\nexport const useModal = (id: ManagedModal['id']) => {\n const { getModal } = useModalManagerContext();\n return useMemo(() => getModal(id), [id, getModal]);\n};\n","import { css } from '@emotion/css';\n\nexport const fallback = css`\n margin: unset;\n`;\n\nexport const frame = css`\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n background-color: white;\n padding: 20px 80px;\n gap: 10px;\n border: 1px solid black;\n`;\n","import type { PropsWithChildren } from 'react';\n\nimport { fallback } from './classNames.emotion';\n\nexport const FallbackTitle = ({ children }: PropsWithChildren) => {\n return <h2 className={fallback}>{children}</h2>;\n};\n","import type { PropsWithChildren } from 'react';\n\nimport { fallback } from './classNames.emotion';\n\nexport const FallbackSubtitle = ({ children }: PropsWithChildren) => {\n return <h3 className={fallback}>{children}</h3>;\n};\n","import type { PropsWithChildren } from 'react';\n\nimport { fallback } from './classNames.emotion';\n\nexport const FallbackContent = ({ children }: PropsWithChildren) => {\n return <div className={fallback}>{children}</div>;\n};\n","import type { FooterComponentProps } from '@/promise-modal/types';\n\nexport const FallbackFooter = ({\n confirmLabel,\n hideConfirm = false,\n cancelLabel,\n hideCancel = false,\n disabled,\n onConfirm,\n onCancel,\n}: FooterComponentProps) => {\n return (\n <div>\n {!hideConfirm && (\n <button onClick={onConfirm} disabled={disabled}>\n {confirmLabel || 'Confirm'}\n </button>\n )}\n\n {!hideCancel && typeof onCancel === 'function' && (\n <button onClick={onCancel}>{cancelLabel || 'Cancel'}</button>\n )}\n </div>\n );\n};\n","import { useMemo } from 'react';\n\nimport type { Fn } from '@aileron/declare';\n\nimport type { ModalNode } from '@/promise-modal/core';\nimport { useModalManagerContext } from '@/promise-modal/providers';\n\nconst defaultValidate = (modal?: ModalNode) => modal?.visible;\n\nexport const useActiveModalCount = (\n validate: Fn<[ModalNode?], boolean | undefined> = defaultValidate,\n refreshKey: string | number = 0,\n) => {\n const { modalIds, getModalNode } = useModalManagerContext();\n return useMemo(() => {\n let count = 0;\n for (const id of modalIds) {\n if (validate(getModalNode(id))) count++;\n }\n return count;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [getModalNode, modalIds, refreshKey]);\n};\n","import {\n type ForwardedRef,\n type PropsWithChildren,\n forwardRef,\n useMemo,\n} from 'react';\n\nimport { useActiveModalCount } from '@/promise-modal/hooks/useActiveModalCount';\nimport type { ModalFrameProps } from '@/promise-modal/types';\n\nimport { frame } from './classNames.emotion';\n\nconst MAX_MODAL_COUNT = 5;\nconst MAX_MODAL_LEVEL = 3;\n\nexport const FallbackForegroundFrame = forwardRef(\n (\n { id, onChangeOrder, children }: PropsWithChildren<ModalFrameProps>,\n ref: ForwardedRef<HTMLDivElement>,\n ) => {\n const activeCount = useActiveModalCount();\n const [level, offset] = useMemo(() => {\n const stacked = activeCount > 1;\n const level = stacked\n ? (Math.floor(id / MAX_MODAL_COUNT) % MAX_MODAL_LEVEL) * 100\n : 0;\n const offset = stacked ? (id % MAX_MODAL_COUNT) * 35 : 0;\n return [level, offset];\n }, [activeCount, id]);\n\n return (\n <div\n ref={ref}\n className={frame}\n onClick={onChangeOrder}\n style={{\n marginBottom: `calc(25vh + ${level}px)`,\n marginLeft: `${level}px`,\n transform: `translate(${offset}px, ${offset}px)`,\n }}\n >\n {children}\n </div>\n );\n },\n);\n","import { type ComponentType, createContext } from 'react';\n\nimport type { Color, Duration } from '@aileron/declare';\n\nimport type {\n BackgroundComponent,\n FooterComponentProps,\n ForegroundComponent,\n WrapperComponentProps,\n} from '@/promise-modal/types';\n\nexport interface ConfigurationContextProps {\n ForegroundComponent: ForegroundComponent;\n BackgroundComponent?: BackgroundComponent;\n TitleComponent: ComponentType<WrapperComponentProps>;\n SubtitleComponent: ComponentType<WrapperComponentProps>;\n ContentComponent: ComponentType<WrapperComponentProps>;\n FooterComponent: ComponentType<FooterComponentProps>;\n options: {\n duration: Duration;\n backdrop: Color;\n manualDestroy: boolean;\n closeOnBackdropClick: boolean;\n };\n}\n\nexport const ConfigurationContext = createContext<ConfigurationContextProps>(\n {} as ConfigurationContextProps,\n);\n","import {\n type ComponentType,\n type PropsWithChildren,\n memo,\n useMemo,\n} from 'react';\n\nimport type { Color, Duration } from '@aileron/declare';\n\nimport {\n DEFAULT_ANIMATION_DURATION,\n DEFAULT_BACKDROP_COLOR,\n} from '@/promise-modal/app/constant';\nimport {\n FallbackContent,\n FallbackFooter,\n FallbackForegroundFrame,\n FallbackSubtitle,\n FallbackTitle,\n} from '@/promise-modal/components/FallbackComponents';\nimport type {\n FooterComponentProps,\n ModalFrameProps,\n WrapperComponentProps,\n} from '@/promise-modal/types';\n\nimport { ConfigurationContext } from './ConfigurationContext';\n\nexport interface ConfigurationContextProviderProps {\n BackgroundComponent?: ComponentType<ModalFrameProps>;\n ForegroundComponent?: ComponentType<ModalFrameProps>;\n TitleComponent?: ComponentType<WrapperComponentProps>;\n SubtitleComponent?: ComponentType<WrapperComponentProps>;\n ContentComponent?: ComponentType<WrapperComponentProps>;\n FooterComponent?: ComponentType<FooterComponentProps>;\n options?: {\n /** Modal transition time(ms, s) */\n duration?: Duration;\n /** Modal backdrop color */\n backdrop?: Color;\n /** Whether to destroy the modal manually */\n manualDestroy?: boolean;\n /** Whether to close the modal when the backdrop is clicked */\n closeOnBackdropClick?: boolean;\n };\n}\n\nexport const ConfigurationContextProvider = memo(\n ({\n ForegroundComponent,\n BackgroundComponent,\n TitleComponent,\n SubtitleComponent,\n ContentComponent,\n FooterComponent,\n options,\n children,\n }: PropsWithChildren<ConfigurationContextProviderProps>) => {\n const value = useMemo(\n () => ({\n BackgroundComponent,\n ForegroundComponent: ForegroundComponent || FallbackForegroundFrame,\n TitleComponent: TitleComponent || FallbackTitle,\n SubtitleComponent: SubtitleComponent || FallbackSubtitle,\n ContentComponent: memo(ContentComponent || FallbackContent),\n FooterComponent: memo(FooterComponent || FallbackFooter),\n options: {\n duration: DEFAULT_ANIMATION_DURATION,\n backdrop: DEFAULT_BACKDROP_COLOR,\n closeOnBackdropClick: true,\n manualDestroy: false,\n ...options,\n } satisfies ConfigurationContextProviderProps['options'],\n }),\n [\n ForegroundComponent,\n BackgroundComponent,\n ContentComponent,\n FooterComponent,\n SubtitleComponent,\n TitleComponent,\n options,\n ],\n );\n return (\n <ConfigurationContext.Provider value={value}>\n {children}\n </ConfigurationContext.Provider>\n );\n },\n);\n","import type { Color, Duration } from '@aileron/declare';\n\nexport const DEFAULT_ANIMATION_DURATION: Duration = '300ms';\n\nexport const DEFAULT_BACKDROP_COLOR: Color = 'rgba(0, 0, 0, 0.5)';\n","import { useContext } from 'react';\n\nimport { convertMsFromDuration } from '@winglet/common-utils';\n\nimport { ConfigurationContext } from './ConfigurationContext';\n\nexport const useConfigurationContext = () => useContext(ConfigurationContext);\n\nexport const useConfigurationOptions = () => {\n const context = useContext(ConfigurationContext);\n return context.options;\n};\n\nexport const useConfigurationDuration = () => {\n const context = useConfigurationOptions();\n return {\n duration: context.duration,\n milliseconds: convertMsFromDuration(context.duration),\n };\n};\n\nexport const useConfigurationBackdrop = () => {\n const context = useConfigurationOptions();\n return context.backdrop;\n};\n","import { createContext } from 'react';\n\nimport type { Dictionary } from '@aileron/declare';\n\nexport interface UserDefinedContext {\n context: Dictionary;\n}\n\nexport const UserDefinedContext = createContext<UserDefinedContext>(\n {} as UserDefinedContext,\n);\n","import { PropsWithChildren, useMemo } from 'react';\n\nimport type { Dictionary } from '@aileron/declare';\n\nimport { UserDefinedContext } from './UserDefinedContext';\n\ninterface UserDefinedContextProviderProps {\n /** User defined context */\n context?: Dictionary;\n}\n\nexport const UserDefinedContextProvider = ({\n context,\n children,\n}: PropsWithChildren<UserDefinedContextProviderProps>) => {\n const contextValue = useMemo(() => ({ context: context || {} }), [context]);\n return (\n <UserDefinedContext.Provider value={contextValue}>\n {children}\n </UserDefinedContext.Provider>\n );\n};\n","import { useContext } from 'react';\n\nimport { UserDefinedContext } from './UserDefinedContext';\n\nexport const useUserDefinedContext = () => {\n return useContext(UserDefinedContext);\n};\n","import { useLayoutEffect, useState } from 'react';\n\nexport const usePathname = () => {\n const [pathname, setPathname] = useState(window.location.pathname);\n useLayoutEffect(() => {\n let requestId: number;\n const checkPathname = () => {\n if (requestId) cancelAnimationFrame(requestId);\n if (pathname !== window.location.pathname) {\n setPathname(window.location.pathname);\n } else {\n requestId = requestAnimationFrame(checkPathname);\n }\n };\n requestId = requestAnimationFrame(checkPathname);\n return () => {\n if (requestId) cancelAnimationFrame(requestId);\n };\n }, [pathname]);\n return { pathname };\n};\n","import { css } from '@emotion/css';\n\nexport const background = css`\n display: none;\n position: fixed;\n inset: 0;\n z-index: -999;\n pointer-events: none;\n > * {\n pointer-events: none;\n }\n`;\n\nexport const active = css`\n pointer-events: all;\n`;\n\nexport const visible = css`\n display: flex;\n align-items: center;\n justify-content: center;\n`;\n","import { type MouseEvent, useCallback, useMemo } from 'react';\n\nimport { cx } from '@emotion/css';\n\nimport {\n useConfigurationContext,\n useModal,\n useUserDefinedContext,\n} from '@/promise-modal/providers';\nimport type { ModalLayerProps } from '@/promise-modal/types';\n\nimport { active, background, visible } from './classNames.emotion';\n\nexport const BackgroundFrame = ({\n modalId,\n onChangeOrder,\n}: ModalLayerProps) => {\n const { BackgroundComponent } = useConfigurationContext();\n const { context: userDefinedContext } = useUserDefinedContext();\n const { modal, onClose, onChange, onConfirm, onDestroy } = useModal(modalId);\n\n const handleClose = useCallback(\n (event: MouseEvent) => {\n if (modal && modal.closeOnBackdropClick && modal.visible) onClose();\n event.stopPropagation();\n },\n [modal, onClose],\n );\n\n const Background = useMemo(\n () => modal?.BackgroundComponent || BackgroundComponent,\n [BackgroundComponent, modal],\n );\n\n if (!modal) return null;\n\n return (\n <div\n className={cx(background, {\n [visible]: modal.manualDestroy ? modal.alive : modal.visible,\n [active]: modal.closeOnBackdropClick && modal.visible,\n })}\n onClick={handleClose}\n >\n {Background && (\n <Background\n id={modal.id}\n type={modal.type}\n alive={modal.alive}\n visible={modal.visible}\n initiator={modal.initiator}\n manualDestroy={modal.manualDestroy}\n closeOnBackdropClick={modal.closeOnBackdropClick}\n background={modal.background}\n onChange={onChange}\n onConfirm={onConfirm}\n onClose={onClose}\n onDestroy={onDestroy}\n onChangeOrder={onChangeOrder}\n context={userDefinedContext}\n />\n )}\n </div>\n );\n};\n","import { css } from '@emotion/css';\n\nexport const foreground = css`\n pointer-events: none;\n display: none;\n position: fixed;\n inset: 0;\n z-index: 1;\n`;\n\nexport const active = css`\n > * {\n pointer-events: all;\n }\n`;\n\nexport const visible = css`\n display: flex !important;\n justify-content: center;\n align-items: center;\n`;\n","import { Fragment, memo, useMemo } from 'react';\n\nimport { isString } from '@winglet/common-utils';\nimport { renderComponent, useHandle } from '@winglet/react-utils';\n\nimport type { AlertNode } from '@/promise-modal/core';\nimport {\n useConfigurationContext,\n useUserDefinedContext,\n} from '@/promise-modal/providers';\nimport type { ModalActions } from '@/promise-modal/types';\n\ninterface AlertInnerProps<B> {\n modal: AlertNode<B>;\n handlers: Pick<ModalActions, 'onConfirm'>;\n}\n\nexport const AlertInner = memo(\n <B,>({ modal, handlers }: AlertInnerProps<B>) => {\n const { title, subtitle, content, footer } = useMemo(() => modal, [modal]);\n const { context: userDefinedContext } = useUserDefinedContext();\n const { onConfirm } = useMemo(() => handlers, [handlers]);\n\n const handleConfirm = useHandle(onConfirm);\n\n const {\n TitleComponent,\n SubtitleComponent,\n ContentComponent,\n FooterComponent,\n } = useConfigurationContext();\n\n return (\n <Fragment>\n {title &&\n (isString(title) ? (\n <TitleComponent context={userDefinedContext}>\n {title}\n </TitleComponent>\n ) : (\n title\n ))}\n {subtitle &&\n (isString(subtitle) ? (\n <SubtitleComponent context={userDefinedContext}>\n {subtitle}\n </SubtitleComponent>\n ) : (\n subtitle\n ))}\n {content &&\n (isString(content) ? (\n <ContentComponent context={userDefinedContext}>\n {content}\n </ContentComponent>\n ) : (\n renderComponent(content, {\n onConfirm: handleConfirm,\n })\n ))}\n {footer !== false &&\n (typeof footer === 'function' ? (\n footer({\n onConfirm: handleConfirm,\n context: userDefinedContext,\n })\n ) : (\n <FooterComponent\n onConfirm={handleConfirm}\n confirmLabel={footer?.confirm}\n hideConfirm={footer?.hideConfirm}\n context={userDefinedContext}\n />\n ))}\n </Fragment>\n );\n },\n);\n","import { Fragment, memo, useMemo } from 'react';\n\nimport { isString } from '@winglet/common-utils';\nimport { renderComponent, useHandle } from '@winglet/react-utils';\n\nimport type { ConfirmNode } from '@/promise-modal/core';\nimport {\n useConfigurationContext,\n useUserDefinedContext,\n} from '@/promise-modal/providers';\nimport type { ModalActions } from '@/promise-modal/types';\n\ninterface ConfirmInnerProps<B> {\n modal: ConfirmNode<B>;\n handlers: Pick<ModalActions, 'onConfirm' | 'onClose'>;\n}\n\nexport const ConfirmInner = memo(\n <B,>({ modal, handlers }: ConfirmInnerProps<B>) => {\n const { title, subtitle, content, footer } = useMemo(() => modal, [modal]);\n const { context: userDefinedContext } = useUserDefinedContext();\n const { onConfirm, onClose } = useMemo(() => handlers, [handlers]);\n\n const handleConfirm = useHandle(onConfirm);\n const handleClose = useHandle(onClose);\n\n const {\n TitleComponent,\n SubtitleComponent,\n ContentComponent,\n FooterComponent,\n } = useConfigurationContext();\n\n return (\n <Fragment>\n {title &&\n (isString(title) ? (\n <TitleComponent context={userDefinedContext}>\n {title}\n </TitleComponent>\n ) : (\n title\n ))}\n {subtitle &&\n (isString(subtitle) ? (\n <SubtitleComponent context={userDefinedContext}>\n {subtitle}\n </SubtitleComponent>\n ) : (\n subtitle\n ))}\n {content &&\n (isString(content) ? (\n <ContentComponent context={userDefinedContext}>\n {content}\n </ContentComponent>\n ) : (\n renderComponent(content, {\n onConfirm: handleConfirm,\n onCancel: handleClose,\n context: userDefinedContext,\n })\n ))}\n {footer !== false &&\n (typeof footer === 'function' ? (\n footer({\n onConfirm: handleConfirm,\n onCancel: handleClose,\n context: userDefinedContext,\n })\n ) : (\n <FooterComponent\n onConfirm={handleConfirm}\n onCancel={handleClose}\n confirmLabel={footer?.confirm}\n cancelLabel={footer?.cancel}\n hideConfirm={footer?.hideConfirm}\n hideCancel={footer?.hideCancel}\n context={userDefinedContext}\n />\n ))}\n </Fragment>\n );\n },\n);\n","import { Fragment, memo, useCallback, useMemo, useState } from 'react';\n\nimport { isFunction, isString } from '@winglet/common-utils';\nimport {\n renderComponent,\n useHandle,\n withErrorBoundary,\n} from '@winglet/react-utils';\n\nimport type { PromptNode } from '@/promise-modal/core';\nimport {\n useConfigurationContext,\n useUserDefinedContext,\n} from '@/promise-modal/providers';\nimport type { ModalActions } from '@/promise-modal/types';\n\ninterface PromptInnerProps<T, B> {\n modal: PromptNode<T, B>;\n handlers: Pick<ModalActions, 'onChange' | 'onClose' | 'onConfirm'>;\n}\n\nexport const PromptInner = memo(\n <T, B>({ modal, handlers }: PromptInnerProps<T, B>) => {\n const {\n Input,\n defaultValue,\n disabled: checkDisabled,\n title,\n subtitle,\n content,\n footer,\n } = useMemo(\n () => ({\n ...modal,\n Input: memo(withErrorBoundary(modal.Input)),\n }),\n [modal],\n );\n\n const { context: userDefinedContext } = useUserDefinedContext();\n\n const [value, setValue] = useState<T | undefined>(defaultValue);\n\n const { onChange, onClose, onConfirm } = useMemo(\n () => handlers,\n [handlers],\n );\n\n const handleClose = useHandle(onClose);\n const handleChange = useHandle(\n (inputValue?: T | ((prevState: T | undefined) => T | undefined)) => {\n const input = isFunction(inputValue) ? inputValue(value) : inputValue;\n setValue(input);\n onChange(input);\n },\n );\n\n const handleConfirm = useCallback(() => {\n // NOTE: wait for the next tick to ensure the value is updated\n requestAnimationFrame(onConfirm);\n }, [onConfirm]);\n\n const disabled = useMemo(\n () => (value ? !!checkDisabled?.(value) : false),\n [checkDisabled, value],\n );\n\n const {\n TitleComponent,\n SubtitleComponent,\n ContentComponent,\n FooterComponent,\n } = useConfigurationContext();\n\n return (\n <Fragment>\n {title &&\n (isString(title) ? (\n <TitleComponent context={userDefinedContext}>\n {title}\n </TitleComponent>\n ) : (\n title\n ))}\n {subtitle &&\n (isString(subtitle) ? (\n <SubtitleComponent context={userDefinedContext}>\n {subtitle}\n </SubtitleComponent>\n ) : (\n subtitle\n ))}\n {content &&\n (isString(content) ? (\n <ContentComponent context={userDefinedContext}>\n {content}\n </ContentComponent>\n ) : (\n renderComponent(content, {\n onConfirm: handleConfirm,\n onCancel: handleClose,\n context: userDefinedContext,\n })\n ))}\n\n {Input && (\n <Input\n defaultValue={defaultValue}\n value={value}\n onChange={handleChange}\n onConfirm={handleConfirm}\n onCancel={handleClose}\n context={userDefinedContext}\n />\n )}\n\n {footer !== false &&\n (typeof footer === 'function' ? (\n footer({\n value,\n disabled,\n onChange: handleChange,\n onConfirm: handleConfirm,\n onCancel: handleClose,\n context: userDefinedContext,\n })\n ) : (\n <FooterComponent\n disabled={disabled}\n onConfirm={handleConfirm}\n onCancel={handleClose}\n confirmLabel={footer?.confirm}\n cancelLabel={footer?.cancel}\n hideConfirm={footer?.hideConfirm}\n hideCancel={footer?.hideCancel}\n context={userDefinedContext}\n />\n ))}\n </Fragment>\n );\n },\n);\n","import { useMemo } from 'react';\n\nimport { cx } from '@emotion/css';\n\nimport {\n useConfigurationContext,\n useModal,\n useUserDefinedContext,\n} from '@/promise-modal/providers';\nimport type { ModalLayerProps } from '@/promise-modal/types';\n\nimport { active, foreground, visible } from './classNames.emotion';\nimport { AlertInner, ConfirmInner, PromptInner } from './components';\n\nexport const ForegroundFrame = ({\n modalId,\n onChangeOrder,\n}: ModalLayerProps) => {\n const { ForegroundComponent } = useConfigurationContext();\n const { context: userDefinedContext } = useUserDefinedContext();\n\n const { modal, onChange, onConfirm, onClose, onDestroy } = useModal(modalId);\n\n const Foreground = useMemo(\n () => modal?.ForegroundComponent || ForegroundComponent,\n [ForegroundComponent, modal],\n );\n\n if (!modal) return null;\n\n return (\n <div\n className={cx(foreground, {\n [visible]: modal.manualDestroy ? modal.alive : modal.visible,\n [active]: modal.visible,\n })}\n >\n <Foreground\n id={modal.id}\n type={modal.type}\n alive={modal.alive}\n visible={modal.visible}\n initiator={modal.initiator}\n manualDestroy={modal.manualDestroy}\n closeOnBackdropClick={modal.closeOnBackdropClick}\n background={modal.background}\n onChange={onChange}\n onConfirm={onConfirm}\n onClose={onClose}\n onDestroy={onDestroy}\n onChangeOrder={onChangeOrder}\n context={userDefinedContext}\n >\n {modal.type === 'alert' && (\n <AlertInner modal={modal} handlers={{ onConfirm }} />\n )}\n {modal.type === 'confirm' && (\n <ConfirmInner modal={modal} handlers={{ onConfirm, onClose }} />\n )}\n {modal.type === 'prompt' && (\n <PromptInner\n modal={modal}\n handlers={{ onChange, onConfirm, onClose }}\n />\n )}\n </Foreground>\n </div>\n );\n};\n","import { useEffect } from 'react';\n\nimport { useVersion } from '@winglet/react-utils';\n\nimport type { ModalNode } from '@/promise-modal/core';\n\nexport const useSubscribeModal = (modal?: ModalNode) => {\n const [version, update] = useVersion();\n useEffect(() => {\n if (!modal) return;\n const unsubscribe = modal.subscribe(update);\n return unsubscribe;\n }, [modal, update]);\n return version;\n};\n","import { css } from '@emotion/css';\n\nexport const presenter = css`\n position: fixed;\n inset: 0;\n pointer-events: none;\n overflow: hidden;\n`;\n","import { memo, useRef } from 'react';\n\nimport { counterFactory } from '@winglet/common-utils';\nimport { useHandle } from '@winglet/react-utils';\n\nimport { Background } from '@/promise-modal/components/Background';\nimport { Foreground } from '@/promise-modal/components/Foreground';\nimport { useSubscribeModal } from '@/promise-modal/hooks/useSubscribeModal';\nimport { useModal } from '@/promise-modal/providers';\nimport type { ModalIdProps } from '@/promise-modal/types';\n\nimport { presenter } from './classNames.emotion';\n\nconst { increment } = counterFactory(1);\n\nexport const Presenter = memo(({ modalId }: ModalIdProps) => {\n const ref = useRef<HTMLDivElement>(null);\n const { modal } = useModal(modalId);\n useSubscribeModal(modal);\n const handleChangeOrder = useHandle(() => {\n if (ref.current) {\n ref.current.style.zIndex = `${increment()}`;\n }\n });\n return (\n <div ref={ref} className={presenter}>\n <Background modalId={modalId} onChangeOrder={handleChangeOrder} />\n <Foreground modalId={modalId} onChangeOrder={handleChangeOrder} />\n </div>\n );\n});\n","import { css } from '@emotion/css';\n\nexport const anchor = css`\n display: flex;\n align-items: center;\n justify-content: center;\n position: fixed;\n inset: 0;\n pointer-events: none;\n z-index: 1000;\n transition: background-color ease-in-out;\n`;\n","import { memo, useEffect } from 'react';\n\nimport { map } from '@winglet/common-utils';\nimport { useVersion, withErrorBoundary } from '@winglet/react-utils';\n\nimport { Presenter } from '@/promise-modal/components/Presenter';\nimport type { ModalNode } from '@/promise-modal/core';\nimport { useActiveModalCount } from '@/promise-modal/hooks/useActiveModalCount';\nimport {\n useConfigurationOptions,\n useModalManagerContext,\n} from '@/promise-modal/providers';\n\nimport { anchor } from './classNames.emotion';\n\nconst AnchorInner = () => {\n const [version, update] = useVersion();\n\n const { modalIds, setUpdater } = useModalManagerContext();\n\n useEffect(() => {\n setUpdater(update);\n }, [setUpdater, update]);\n\n const options = useConfigurationOptions();\n\n const dimmed = useActiveModalCount(validateDimmable, version);\n\n return (\n <div\n className={anchor}\n style={{\n transitionDuration: options.duration,\n backgroundColor: dimmed ? options.backdrop : 'transparent',\n }}\n >\n {map(modalIds, (id) => (\n <Presenter key={id} modalId={id} />\n ))}\n </div>\n );\n};\n\nconst validateDimmable = (modal?: ModalNode) => modal?.visible && modal.dimmed;\n\nexport const Anchor = memo(withErrorBoundary(AnchorInner));\n","import { createPortal } from 'react-dom';\n\nimport type { Dictionary, Fn } from '@aileron/declare';\n\nimport { Anchor } from '@/promise-modal/components/Anchor';\nimport {\n ConfigurationContextProvider,\n type ConfigurationContextProviderProps,\n} from '@/promise-modal/providers/ConfigurationContext';\nimport { ModalManagerContextProvider } from '@/promise-modal/providers/ModalManagerContext';\nimport { UserDefinedContextProvider } from '@/promise-modal/providers/UserDefinedContext';\n\ninterface BootstrapProps extends ConfigurationContextProviderProps {\n usePathname: Fn<[], { pathname: string }>;\n context?: Dictionary;\n anchor: HTMLElement;\n}\n\nexport const bootstrap = ({\n ForegroundComponent,\n BackgroundComponent,\n TitleComponent,\n SubtitleComponent,\n ContentComponent,\n FooterComponent,\n usePathname,\n options,\n context,\n anchor,\n}: BootstrapProps) =>\n createPortal(\n <UserDefinedContextProvider context={context}>\n <ConfigurationContextProvider\n ForegroundComponent={ForegroundComponent}\n BackgroundComponent={BackgroundComponent}\n TitleComponent={TitleComponent}\n SubtitleComponent={SubtitleComponent}\n ContentComponent={ContentComponent}\n FooterComponent={FooterComponent}\n options={options}\n >\n <ModalManagerContextProvider usePathname={usePathname}>\n <Anchor />\n </ModalManagerContextProvider>\n </ConfigurationContextProvider>\n </UserDefinedContextProvider>,\n anchor,\n );\n","import { useCallback, useRef } from 'react';\n\nimport { printError } from '@winglet/common-utils';\nimport { useVersion } from '@winglet/react-utils';\n\nimport { ModalManager } from '@/promise-modal/app/ModalManager';\n\nexport const useInitialize = () => {\n const permitted = useRef(ModalManager.activate());\n const anchorRef = useRef<HTMLElement | null>(null);\n const [, update] = useVersion();\n\n const handleInitialize = useCallback(\n (root?: HTMLElement) => {\n if (permitted.current) {\n anchorRef.current = ModalManager.anchor({ root });\n update();\n } else\n printError(\n 'ModalProvider is already initialized',\n [\n 'ModalProvider can only be initialized once.',\n 'Nesting ModalProvider will be ignored...',\n ],\n {\n info: 'Something is wrong with the ModalProvider initialization...',\n },\n );\n },\n [update],\n );\n\n return {\n anchorRef,\n handleInitialize,\n } as const;\n};\n","import {\n Fragment,\n type PropsWithChildren,\n forwardRef,\n useImperativeHandle,\n useMemo,\n} from 'react';\n\nimport { useOnMount } from '@winglet/react-utils';\n\nimport { usePathname as useDefaultPathname } from '@/promise-modal/hooks/useDefaultPathname';\n\nimport { bootstrap } from './helpers/bootstrap';\nimport { useInitialize } from './hooks/useInitialize';\nimport type { BootstrapProviderHandle, BootstrapProviderProps } from './type';\n\nexport const BootstrapProvider = forwardRef<\n BootstrapProviderHandle,\n PropsWithChildren<BootstrapProviderProps>\n>(\n (\n {\n usePathname: useExternalPathname,\n ForegroundComponent,\n BackgroundComponent,\n TitleComponent,\n SubtitleComponent,\n ContentComponent,\n FooterComponent,\n options,\n context,\n children,\n },\n handleRef,\n ) => {\n const usePathname = useMemo(\n () => useExternalPathname || useDefaultPathname,\n [useExternalPathname],\n );\n\n const { anchorRef, handleInitialize } = useInitialize();\n\n useImperativeHandle(\n handleRef,\n () => ({\n initialize: handleInitialize,\n }),\n [handleInitialize],\n );\n\n useOnMount(() => {\n /**\n * NOTE: `handleRef` being null indicates that no `ref` was provided.\n * In this case, the `ModalProvider`(=`BootstrapProvider`) is not receiving the `ref`,\n * so it should be initialized automatically.\n */\n if (handleRef === null) handleInitialize();\n return () => {\n if (anchorRef.current) anchorRef.current.remove();\n };\n });\n\n return (\n <Fragment>\n {children}\n {anchorRef.current &&\n bootstrap({\n ForegroundComponent,\n BackgroundComponent,\n TitleComponent,\n SubtitleComponent,\n ContentComponent,\n FooterComponent,\n usePathname,\n options,\n context,\n anchor: anchorRef.current,\n })}\n </Fragment>\n );\n },\n);\n","import { useCallback, useMemo } from 'react';\n\nimport { useOnMount } from '@winglet/react-utils';\n\nimport { usePathname as useDefaultPathname } from '@/promise-modal/hooks/useDefaultPathname';\n\nimport { bootstrap } from './helpers/bootstrap';\nimport { useInitialize } from './hooks/useInitialize';\nimport type { BootstrapProviderProps } from './type';\n\nexport const useBootstrap = ({\n usePathname: useExternalPathname,\n ForegroundComponent,\n BackgroundComponent,\n TitleComponent,\n SubtitleComponent,\n ContentComponent,\n FooterComponent,\n options,\n context,\n mode = 'auto',\n}: BootstrapProviderProps & { mode?: 'manual' | 'auto' } = {}) => {\n const usePathname = useMemo(\n () => useExternalPathname || useDefaultPathname,\n [useExternalPathname],\n );\n\n const { anchorRef, handleInitialize } = useInitialize();\n\n useOnMount(() => {\n if (mode === 'auto') handleInitialize();\n return () => {\n if (anchorRef.current) anchorRef.current.remove();\n };\n });\n\n const initialize = useCallback(\n (element: HTMLElement) => {\n if (mode === 'manual') handleInitialize(element);\n },\n [mode, handleInitialize],\n );\n\n const portal =\n anchorRef.current &&\n bootstrap({\n usePathname,\n ForegroundComponent,\n BackgroundComponent,\n TitleComponent,\n SubtitleComponent,\n ContentComponent,\n FooterComponent,\n options,\n context,\n anchor: anchorRef.current,\n });\n\n return { portal, initialize };\n};\n","import { useEffect, useRef } from 'react';\n\nimport { convertMsFromDuration, isString } from '@winglet/common-utils';\n\nimport type { Duration } from '@aileron/declare';\n\nimport type { ModalNode } from '@/promise-modal/core';\nimport { useModal } from '@/promise-modal/providers';\n\nimport { useSubscribeModal } from './useSubscribeModal';\n\nexport const useDestroyAfter = (\n modalId: ModalNode['id'],\n duration: Duration | number,\n) => {\n const { modal, onDestroy } = useModal(modalId);\n const tick = useSubscribeModal(modal);\n\n const reference = useRef({\n modal,\n onDestroy,\n milliseconds: isString(duration)\n ? convertMsFromDuration(duration)\n : duration,\n });\n\n useEffect(() => {\n const { modal, onDestroy, milliseconds } = reference.current;\n if (!modal || modal.visible || !modal.alive) return;\n const timer = setTimeout(() => {\n onDestroy();\n }, milliseconds);\n return () => {\n if (timer) clearTimeout(timer);\n };\n }, [tick]);\n};\n","import { useLayoutEffect, useRef } from 'react';\n\nimport type { Fn } from '@aileron/declare';\n\ninterface ModalAnimationHandler {\n onVisible?: Fn;\n onHidden?: Fn;\n}\n\nexport const useModalAnimation = (\n visible: boolean,\n handler: ModalAnimationHandler,\n) => {\n const handlerRef = useRef(handler);\n handlerRef.current = handler;\n useLayoutEffect(() => {\n if (!handlerRef.current) return;\n let frame: ReturnType<typeof requestAnimationFrame>;\n if (visible)\n frame = requestAnimationFrame(() => handlerRef.current.onVisible?.());\n else frame = requestAnimationFrame(() => handlerRef.current.onHidden?.());\n return () => {\n if (frame) cancelAnimationFrame(frame);\n };\n }, [visible]);\n};\n"],"names":["ModalManager","static","activate","active","anchor","options","document","getElementById","id","tag","prefix","root","body","node","createElement","setAttribute","getRandomString","appendChild","prerender","prerenderList","modal","push","openHandler","handler","unanchored","reset","open","alert","subtype","title","subtitle","content","background","footer","dimmed","manualDestroy","closeOnBackdropClick","ForegroundComponent","BackgroundComponent","Promise","resolve","reject","type","error","confirm","result","prompt","defaultValue","Input","disabled","returnOnCancel","AbstractNode","initiator","alive","this","visible","listeners","Set","constructor","subscribe","listener","add","delete","publish","onDestroy","needPublish","onShow","onHide","AlertNode","super","onClose","onConfirm","ConfirmNode","PromptNode","value","onChange","nodeFactory","Error","ModalManagerContext","createContext","ModalManagerContextProvider","memo","usePathname","children","modalDictionary","useRef","Map","modalIds","setModalIds","useState","modalIdsRef","useReference","pathname","modalIdSequence","useConfigurationOptions","duration","useMemo","convertMsFromDuration","useOnMountLayout","data","current","undefined","set","ids","aliveIds","index","length","get","useLayoutEffect","getModalNode","useCallback","modalId","updaterRef","hideModal","setTimeout","getModal","setUpdater","updater","_jsx","Provider","useModalManagerContext","useContext","useModal","fallback","css","process","env","NODE_ENV","name","styles","toString","_EMOTION_STRINGIFIED_CSS_ERROR__","frame","FallbackTitle","className","FallbackSubtitle","FallbackContent","FallbackFooter","confirmLabel","hideConfirm","cancelLabel","hideCancel","onCancel","_jsxs","onClick","defaultValidate","useActiveModalCount","validate","refreshKey","count","FallbackForegroundFrame","forwardRef","onChangeOrder","ref","activeCount","level","offset","stacked","Math","floor","style","marginBottom","marginLeft","transform","ConfigurationContext","ConfigurationContextProvider","TitleComponent","SubtitleComponent","ContentComponent","FooterComponent","backdrop","useConfigurationContext","useConfigurationDuration","context","milliseconds","useConfigurationBackdrop","UserDefinedContext","UserDefinedContextProvider","contextValue","useUserDefinedContext","setPathname","window","location","requestId","checkPathname","cancelAnimationFrame","requestAnimationFrame","BackgroundFrame","userDefinedContext","handleClose","event","stopPropagation","Background","cx","visible$1","active$1","foreground","AlertInner","handlers","handleConfirm","useHandle","Fragment","isString","renderComponent","ConfirmInner","cancel","PromptInner","checkDisabled","withErrorBoundary","setValue","handleChange","inputValue","input","isFunction","ForegroundFrame","Foreground","useSubscribeModal","version","update","useVersion","useEffect","presenter","increment","counterFactory","Presenter","handleChangeOrder","zIndex","validateDimmable","Anchor","transitionDuration","backgroundColor","map","bootstrap","createPortal","useInitialize","permitted","anchorRef","handleInitialize","printError","info","BootstrapProvider","useExternalPathname","handleRef","useDefaultPathname","useImperativeHandle","initialize","useOnMount","remove","useBootstrap","mode","element","portal","useDestroyAfter","tick","reference","timer","clearTimeout","useModalAnimation","handlerRef","onVisible","onHidden"],"mappings":"kqBAMaA,EACXC,UAAiB,EACjB,eAAOC,GACL,OAAIF,GAAaG,IACTH,GAAaG,GAAU,GAGjCF,SAAqC,KACrC,aAAOG,CAAOC,GAKZ,GAAIL,GAAaI,EAAS,CACxB,MAAMA,EAASE,SAASC,eAAeP,GAAaI,EAAQI,IAC5D,GAAIJ,EAAQ,OAAOA,EAErB,MAAMK,IACJA,EAAM,MAAKC,OACXA,EAAS,gBAAeC,KACxBA,EAAOL,SAASM,MACdP,GAAW,CAAE,EACXQ,EAAOP,SAASQ,cAAcL,GAIpC,OAHAI,EAAKE,aAAa,KAAM,GAAGL,KAAUM,EAAgB,OACrDL,EAAKM,YAAYJ,GACjBb,GAAaI,EAAUS,EAChBA,EAGTZ,SAAiC,GACjC,oBAAWiB,GACT,OAAOlB,GAAamB,EAGtBlB,SAA0CmB,GACxCpB,GAAamB,EAAeE,KAAKD,GACnC,sBAAWE,CAAYC,GACrBvB,GAAasB,EAAeC,EAC5BvB,GAAamB,EAAiB,GAGhC,qBAAWK,GACT,OAAQxB,GAAaI,EAGvB,YAAOqB,GACLzB,GAAaG,GAAU,EACvBH,GAAaI,EAAU,KACvBJ,GAAamB,EAAiB,GAC9BnB,GAAasB,EAAgBF,GAC3BpB,GAAamB,EAAeE,KAAKD,GAGrC,WAAOM,CAAKN,GACVpB,GAAasB,EAAaF,IC/BvB,MAAMO,EAAQ,EACnBC,UACAC,QACAC,WACAC,UACAC,aACAC,SACAC,SACAC,gBACAC,uBACAC,sBACAC,yBAEO,IAAIC,SAAc,CAACC,EAASC,KACjC,IACEzC,EAAa0B,KAAK,CAChBgB,KAAM,QACNd,UACAY,QAAS,IAAMA,IACfX,QACAC,WACAC,UACAC,aACAC,SACAC,SACAC,gBACAC,uBACAC,sBACAC,wBAEF,MAAOK,GACPF,EAAOE,OClCAC,EAAU,EACrBhB,UACAC,QACAC,WACAC,UACAC,aACAC,SACAC,SACAC,gBACAC,uBACAC,sBACAC,yBAEO,IAAIC,SAAiB,CAACC,EAASC,KACpC,IACEzC,EAAa0B,KAAK,CAChBgB,KAAM,UACNd,UACAY,QAAUK,GAAWL,EAAQK,IAAU,GACvChB,QACAC,WACAC,UACAC,aACAC,SACAC,SACAC,gBACAC,uBACAC,sBACAC,wBAEF,MAAOK,GACPF,EAAOE,OC3BAG,EAAS,EACpBC,eACAlB,QACAC,WACAC,UACAiB,QACAC,WACAC,iBACAlB,aACAC,SACAC,SACAC,gBACAC,uBACAC,sBACAC,yBAEO,IAAIC,SAAW,CAACC,EAASC,KAC9B,IACEzC,EAAa0B,KAAK,CAChBgB,KAAM,SACNF,QAAUK,GAAWL,EAAQK,GAC7BhB,QACAC,WACAC,UACAiB,QACAD,eACAE,WACAC,iBACAlB,aACAC,SACAC,SACAC,gBACAC,uBACAC,sBACAC,wBAEF,MAAOK,GACPF,EAAOE,aCrDSQ,EACX3C,GACA4C,UAEAvB,MACAC,SACAE,WAEAG,cACAC,qBACAF,OAEAG,oBACAC,oBAETe,GACA,SAAIA,GACF,OAAOC,MAAKD,EAEdE,GACA,WAAIA,GACF,OAAOD,MAAKC,EAGdf,GACAgB,GAAsB,IAAIC,IAE1B,WAAAC,EAAYlD,GACVA,EAAE4C,UACFA,EAASvB,MACTA,EAAKC,SACLA,EAAQE,WACRA,EAAUE,OACVA,GAAS,EAAIC,cACbA,GAAgB,EAAKC,qBACrBA,GAAuB,EAAII,QAC3BA,EAAOH,oBACPA,EAAmBC,oBACnBA,IAEAgB,KAAK9C,GAAKA,EACV8C,KAAKF,UAAYA,EACjBE,KAAKzB,MAAQA,EACbyB,KAAKxB,SAAWA,EAChBwB,KAAKtB,WAAaA,EAElBsB,KAAKpB,OAASA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O,EAAUxI,UAGLiJ,aAAY,EC/ClBO,GAAkB,CAC7B7I,EACAhB,KAEA,MAAM3E,MAAEA,EAAK4C,UAAEA,GAAc0D,EAASX,GAChC8I,EAAOrC,GAAkBpM,GAEzB0O,EAAYzK,EAAO,CACvBjE,QACA4C,YACA8G,aAAc4B,EAAS3G,GACnBE,EAAsBF,GACtBA,IAGN6H,GAAU,KACR,MAAMxM,MAAEA,EAAK4C,UAAEA,EAAS8G,aAAEA,GAAiBgF,EAAU1J,QACrD,IAAKhF,GAASA,EAAMmC,UAAYnC,EAAMiC,MAAO,OAC7C,MAAM0M,EAAQ7I,YAAW,KACvBlD,GAAW,GACV8G,GACH,MAAO,KACDiF,GAAOC,aAAaD,EAAM,CAC/B,GACA,CAACF,GAAM,EC1BCI,GAAoB,CAC/B1M,EACAhC,KAEA,MAAM2O,EAAa7K,EAAO9D,GAC1B2O,EAAW9J,QAAU7E,EACrBqF,GAAgB,KACd,IAAKsJ,EAAW9J,QAAS,OACzB,IAAIgC,EAIJ,OAFEA,EADE7E,EACMmI,uBAAsB,IAAMwE,EAAW9J,QAAQ+J,gBAC5CzE,uBAAsB,IAAMwE,EAAW9J,QAAQgK,eACrD,KACDhI,GAAOqD,qBAAqBrD,EAAM,CACvC,GACA,CAAC7E,GAAS"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigurationContext.d.ts","sourceRoot":"","sources":["../../../src/providers/ConfigurationContext/ConfigurationContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAiB,MAAM,OAAO,CAAC;AAE1D,OAAO,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAExD,OAAO,KAAK,EACV,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,uBAAuB,CAAC;AAE/B,MAAM,WAAW,yBAAyB;IACxC,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,cAAc,EAAE,aAAa,CAAC,qBAAqB,CAAC,CAAC;IACrD,iBAAiB,EAAE,aAAa,CAAC,qBAAqB,CAAC,CAAC;IACxD,gBAAgB,EAAE,aAAa,CAAC,qBAAqB,CAAC,CAAC;IACvD,eAAe,EAAE,aAAa,CAAC,oBAAoB,CAAC,CAAC;IACrD,OAAO,EAAE;QACP,QAAQ,EAAE,QAAQ,CAAC;QACnB,QAAQ,EAAE,KAAK,CAAC;QAChB,aAAa,EAAE,OAAO,CAAC;QACvB,oBAAoB,EAAE,OAAO,CAAC;KAC/B,CAAC;CACH;AAED,eAAO,MAAM,oBAAoB,oDAEhC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigurationContextProvider.d.ts","sourceRoot":"","sources":["../../../src/providers/ConfigurationContext/ConfigurationContextProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,iBAAiB,EAGvB,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAaxD,OAAO,KAAK,EACV,oBAAoB,EACpB,eAAe,EACf,qBAAqB,EACtB,MAAM,uBAAuB,CAAC;AAI/B,MAAM,WAAW,iCAAiC;IAChD,mBAAmB,CAAC,EAAE,aAAa,CAAC,eAAe,CAAC,CAAC;IACrD,mBAAmB,CAAC,EAAE,aAAa,CAAC,eAAe,CAAC,CAAC;IACrD,cAAc,CAAC,EAAE,aAAa,CAAC,qBAAqB,CAAC,CAAC;IACtD,iBAAiB,CAAC,EAAE,aAAa,CAAC,qBAAqB,CAAC,CAAC;IACzD,gBAAgB,CAAC,EAAE,aAAa,CAAC,qBAAqB,CAAC,CAAC;IACxD,eAAe,CAAC,EAAE,aAAa,CAAC,oBAAoB,CAAC,CAAC;IACtD,OAAO,CAAC,EAAE;QAER,QAAQ,CAAC,EAAE,QAAQ,CAAC;QAEpB,QAAQ,CAAC,EAAE,KAAK,CAAC;QAEjB,aAAa,CAAC,EAAE,OAAO,CAAC;QAExB,oBAAoB,CAAC,EAAE,OAAO,CAAC;KAChC,CAAC;CACH;AAED,eAAO,MAAM,4BAA4B,+KAUpC,iBAAiB,CAAC,iCAAiC,CAAC,6CAiCxD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/ConfigurationContext/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,4BAA4B,EAC5B,KAAK,iCAAiC,GACvC,MAAM,gCAAgC,CAAC;AAExC,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,2BAA2B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useConfigurationContext.d.ts","sourceRoot":"","sources":["../../../src/providers/ConfigurationContext/useConfigurationContext.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,uBAAuB,kEAAyC,CAAC;AAE9E,eAAO,MAAM,uBAAuB;;;;;CAGnC,CAAC;AAEF,eAAO,MAAM,wBAAwB;;;CAMpC,CAAC;AAEF,eAAO,MAAM,wBAAwB,wCAGpC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ModalManagerContext.d.ts","sourceRoot":"","sources":["../../../src/providers/ModalManagerContext/ModalManagerContext.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAE3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE/E,MAAM,WAAW,wBAAyB,SAAQ,mBAAmB;IACnE,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;IAC5B,QAAQ,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC;IAClD,YAAY,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC,CAAC;IAC/D,UAAU,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;CAC/B;AAED,eAAO,MAAM,mBAAmB,mDAE/B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ModalManagerContextProvider.d.ts","sourceRoot":"","sources":["../../../src/providers/ModalManagerContext/ModalManagerContextProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,iBAAiB,EAOvB,MAAM,OAAO,CAAC;AAKf,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAS3C,UAAU,gCAAgC;IACxC,WAAW,EAAE,EAAE,CAAC,EAAE,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC3C;AAED,eAAO,MAAM,2BAA2B,mEAInC,iBAAiB,CAAC,gCAAgC,CAAC,6CA4KvD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/ModalManagerContext/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,sBAAsB,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useModalManagerContext.d.ts","sourceRoot":"","sources":["../../../src/providers/ModalManagerContext/useModalManagerContext.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAI1D,eAAO,MAAM,sBAAsB,gEAAwC,CAAC;AAE5E,eAAO,MAAM,QAAQ,GAAI,IAAI,YAAY,CAAC,IAAI,CAAC,iDAG9C,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UserDefinedContext.d.ts","sourceRoot":"","sources":["../../../src/providers/UserDefinedContext/UserDefinedContext.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,UAAU,CAAC;CACrB;AAED,eAAO,MAAM,kBAAkB,6CAE9B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UserDefinedContextProvider.d.ts","sourceRoot":"","sources":["../../../src/providers/UserDefinedContext/UserDefinedContextProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAW,MAAM,OAAO,CAAC;AAEnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAInD,UAAU,+BAA+B;IAEvC,OAAO,CAAC,EAAE,UAAU,CAAC;CACtB;AAED,eAAO,MAAM,0BAA0B,GAAI,wBAGxC,iBAAiB,CAAC,+BAA+B,CAAC,4CAOpD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/UserDefinedContext/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useUserDefinedContext.d.ts","sourceRoot":"","sources":["../../../src/providers/UserDefinedContext/useUserDefinedContext.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,eAAO,MAAM,qBAAqB,0BAEjC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEzE,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../src/types/alert.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,KAAK,EAAE,SAAS,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE9E,MAAM,MAAM,iBAAiB,CAAC,OAAO,SAAS,UAAU,GAAG,MAAM,IAAI,CAAC,KAAK,EAAE;IAC3E,SAAS,EAAE,YAAY,CAAC;IACxB,OAAO,EAAE,OAAO,CAAC;CAClB,KAAK,SAAS,CAAC;AAEhB,MAAM,MAAM,iBAAiB,CAAC,OAAO,SAAS,UAAU,GAAG,MAAM,IAAI,IAAI,CACvE,qBAAqB,CAAC,OAAO,CAAC,EAC9B,WAAW,CACZ,CAAC;AAEF,MAAM,WAAW,UAAU,CAAC,CAAC,GAAG,GAAG,EAAE,OAAO,SAAS,UAAU,GAAG,MAAM,CACtE,SAAQ,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC;IAC1B,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;IACnD,OAAO,CAAC,EAAE,SAAS,GAAG,aAAa,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC;IAChE,MAAM,CAAC,EACH,iBAAiB,CAAC,OAAO,CAAC,GAC1B,IAAI,CAAC,aAAa,EAAE,SAAS,GAAG,aAAa,CAAC,GAC9C,KAAK,CAAC;CACX"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"background.d.ts","sourceRoot":"","sources":["../../src/types/background.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe,CAAC,CAAC;IAChC,IAAI,CAAC,EAAE,CAAC,CAAC;CACV"}
|
package/dist/types/base.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/types/base.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,MAAM,WAAW,SAAS,CAAC,CAAC,EAAE,CAAC;IAC7B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,UAAU,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC;IAChC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,OAAO,EAAE,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,KAAK,IAAI,CAAC;IACpC,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;CAC3C;AAED,MAAM,MAAM,mBAAmB,GAAG,aAAa,CAC7C,iBAAiB,CAAC,eAAe,CAA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M,mBAAmB,CAAC,OAAO,SAAS,UAAU,GAAG,MAAM,IAAI,CAAC,KAAK,EAAE;IAC7E,SAAS,EAAE,YAAY,CAAC;IACxB,QAAQ,EAAE,YAAY,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;CAClB,KAAK,SAAS,CAAC;AAEhB,MAAM,MAAM,mBAAmB,CAAC,OAAO,SAAS,UAAU,GAAG,MAAM,IACjE,qBAAqB,CAAC,OAAO,CAAC,CAAC;AAEjC,MAAM,WAAW,YAAY,CAAC,CAAC,GAAG,GAAG,EAAE,OAAO,SAAS,UAAU,GAAG,MAAM,CACxE,SAAQ,SAAS,CAAC,OAAO,EAAE,CAAC,CAAC;IAC7B,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;IACnD,OAAO,CAAC,EAAE,SAAS,GAAG,aAAa,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC,CAAC;IAClE,MAAM,CAAC,EAAE,mBAAmB,CAAC,OAAO,CAAC,GAAG,aAAa,GAAG,KAAK,CAAC;CAC/D"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../src/types/modal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,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