@lerx/promise-modal 0.10.5 → 0.11.1
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/@aileron/declare/index.d.ts +4 -4
- package/dist/app/ModalManager.d.ts +3 -3
- package/dist/app/constant.d.ts +1 -1
- package/dist/bootstrap/BootstrapProvider/BootstrapProvider.d.ts +1 -1
- package/dist/bootstrap/BootstrapProvider/helpers/bootstrap.d.ts +2 -2
- package/dist/bootstrap/BootstrapProvider/index.d.ts +3 -3
- package/dist/bootstrap/BootstrapProvider/type.d.ts +2 -2
- package/dist/bootstrap/BootstrapProvider/useBootstrap.d.ts +1 -1
- package/dist/bootstrap/index.d.ts +1 -1
- package/dist/components/Anchor/index.d.ts +1 -1
- package/dist/components/Background/Background.d.ts +1 -1
- package/dist/components/Background/index.d.ts +1 -1
- package/dist/components/FallbackComponents/FallbackFooter.d.ts +1 -1
- package/dist/components/FallbackComponents/FallbackForegroundFrame.d.ts +1 -1
- package/dist/components/FallbackComponents/index.d.ts +5 -5
- package/dist/components/Foreground/Foreground.d.ts +1 -1
- package/dist/components/Foreground/components/AlertInner.d.ts +2 -2
- package/dist/components/Foreground/components/ConfirmInner.d.ts +2 -2
- package/dist/components/Foreground/components/PromptInner.d.ts +2 -2
- package/dist/components/Foreground/components/index.d.ts +3 -3
- package/dist/components/Foreground/index.d.ts +1 -1
- package/dist/components/Presenter/Presenter.d.ts +1 -1
- package/dist/components/Presenter/index.d.ts +1 -1
- package/dist/core/handle/alert.d.ts +2 -2
- package/dist/core/handle/confirm.d.ts +2 -2
- package/dist/core/handle/index.d.ts +5 -5
- package/dist/core/handle/prompt.d.ts +2 -2
- package/dist/core/handle/static.d.ts +1 -1
- package/dist/core/handle/type.d.ts +2 -2
- package/dist/core/index.d.ts +2 -2
- package/dist/core/node/ModalNode/AbstractNode.d.ts +2 -2
- package/dist/core/node/ModalNode/AlertNode.d.ts +2 -2
- package/dist/core/node/ModalNode/ConfirmNode.d.ts +2 -2
- package/dist/core/node/ModalNode/PromptNode.d.ts +3 -3
- package/dist/core/node/ModalNode/index.d.ts +3 -3
- package/dist/core/node/index.d.ts +2 -2
- package/dist/core/node/nodeFactory.d.ts +2 -2
- package/dist/core/node/type.d.ts +1 -1
- package/dist/helpers/closeModal.d.ts +1 -1
- package/dist/helpers/subscribeAbortSignal.d.ts +1 -1
- package/dist/hooks/useActiveModalCount.d.ts +2 -2
- package/dist/hooks/useDestroyAfter.d.ts +2 -2
- package/dist/hooks/useModal.d.ts +2 -2
- package/dist/hooks/useModalAnimation.d.ts +1 -1
- package/dist/hooks/useModalDuration.d.ts +1 -1
- package/dist/hooks/useSubscribeModal.d.ts +1 -1
- package/dist/index.d.ts +10 -10
- package/dist/providers/ConfigurationContext/ConfigurationContext.d.ts +1 -1
- package/dist/providers/ConfigurationContext/ConfigurationContextProvider.d.ts +1 -1
- package/dist/providers/ConfigurationContext/index.d.ts +2 -2
- package/dist/providers/ModalManagerContext/ModalManagerContext.d.ts +3 -3
- package/dist/providers/ModalManagerContext/ModalManagerContextProvider.d.ts +1 -1
- package/dist/providers/ModalManagerContext/index.d.ts +2 -2
- package/dist/providers/ModalManagerContext/useModalManagerContext.d.ts +1 -1
- package/dist/providers/UserDefinedContext/UserDefinedContext.d.ts +1 -1
- package/dist/providers/UserDefinedContext/UserDefinedContextProvider.d.ts +1 -1
- package/dist/providers/UserDefinedContext/index.d.ts +2 -2
- package/dist/providers/UserDefinedContext/useUserDefinedContext.d.ts +1 -1
- package/dist/providers/index.d.ts +3 -3
- package/dist/types/alert.d.ts +2 -2
- package/dist/types/base.d.ts +3 -3
- package/dist/types/confirm.d.ts +2 -2
- package/dist/types/index.d.ts +7 -7
- package/dist/types/modal.d.ts +6 -6
- package/dist/types/option.d.ts +1 -1
- package/dist/types/prompt.d.ts +2 -2
- package/package.json +5 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './function';
|
|
2
|
-
export * from './object';
|
|
3
|
-
export * from './utility';
|
|
4
|
-
export * from './unit';
|
|
1
|
+
export * from './function.js';
|
|
2
|
+
export * from './object.js';
|
|
3
|
+
export * from './utility.js';
|
|
4
|
+
export * from './unit.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Fn } from '../@aileron/declare';
|
|
2
|
-
import type { ModalNode } from '../core';
|
|
3
|
-
import type { Modal } from '../types';
|
|
1
|
+
import type { Fn } from '../@aileron/declare/index.js';
|
|
2
|
+
import type { ModalNode } from '../core/index.js';
|
|
3
|
+
import type { Modal } from '../types/index.js';
|
|
4
4
|
export declare class ModalManager {
|
|
5
5
|
private static __anchor__;
|
|
6
6
|
private static __scope__;
|
package/dist/app/constant.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Color, Duration } from '../@aileron/declare';
|
|
1
|
+
import type { Color, Duration } from '../@aileron/declare/index.js';
|
|
2
2
|
export declare const DEFAULT_Z_INDEX: number;
|
|
3
3
|
export declare const DEFAULT_ANIMATION_DURATION: Duration;
|
|
4
4
|
export declare const DEFAULT_BACKDROP_COLOR: Color;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Dictionary, Fn } from '../../../@aileron/declare';
|
|
2
|
-
import { type ConfigurationContextProviderProps } from '../../../providers/ConfigurationContext';
|
|
1
|
+
import type { Dictionary, Fn } from '../../../@aileron/declare/index.js';
|
|
2
|
+
import { type ConfigurationContextProviderProps } from '../../../providers/ConfigurationContext/index.js';
|
|
3
3
|
interface BootstrapProps extends ConfigurationContextProviderProps {
|
|
4
4
|
usePathname: Fn<[], {
|
|
5
5
|
pathname: string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { BootstrapProvider } from './BootstrapProvider';
|
|
2
|
-
export { useBootstrap } from './useBootstrap';
|
|
3
|
-
export type { BootstrapProviderHandle, BootstrapProviderProps } from './type';
|
|
1
|
+
export { BootstrapProvider } from './BootstrapProvider.js';
|
|
2
|
+
export { useBootstrap } from './useBootstrap.js';
|
|
3
|
+
export type { BootstrapProviderHandle, BootstrapProviderProps } from './type.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Dictionary, Fn } from '../../@aileron/declare';
|
|
2
|
-
import type { ConfigurationContextProviderProps } from '../../providers/ConfigurationContext';
|
|
1
|
+
import type { Dictionary, Fn } from '../../@aileron/declare/index.js';
|
|
2
|
+
import type { ConfigurationContextProviderProps } from '../../providers/ConfigurationContext/index.js';
|
|
3
3
|
export type BootstrapProviderProps = {
|
|
4
4
|
usePathname?: Fn<[], {
|
|
5
5
|
pathname: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { useBootstrap, BootstrapProvider, type BootstrapProviderHandle, type BootstrapProviderProps, } from './BootstrapProvider';
|
|
1
|
+
export { useBootstrap, BootstrapProvider, type BootstrapProviderHandle, type BootstrapProviderProps, } from './BootstrapProvider/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Anchor } from './Anchor';
|
|
1
|
+
export { Anchor } from './Anchor.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ModalLayerProps } from '../../types';
|
|
1
|
+
import type { ModalLayerProps } from '../../types/index.js';
|
|
2
2
|
export declare const BackgroundFrame: ({ modalId, onChangeOrder, }: ModalLayerProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { BackgroundFrame as Background } from './Background';
|
|
1
|
+
export { BackgroundFrame as Background } from './Background.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { FooterComponentProps } from '../../types';
|
|
1
|
+
import type { FooterComponentProps } from '../../types/index.js';
|
|
2
2
|
export declare const FallbackFooter: ({ confirmLabel, hideConfirm, cancelLabel, hideCancel, disabled, onConfirm, onCancel, }: FooterComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ModalFrameProps } from '../../types';
|
|
1
|
+
import type { ModalFrameProps } from '../../types/index.js';
|
|
2
2
|
export declare const FallbackForegroundFrame: import("react").ForwardRefExoticComponent<ModalFrameProps & {
|
|
3
3
|
children?: import("react").ReactNode | undefined;
|
|
4
4
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { FallbackTitle } from './FallbackTitle';
|
|
2
|
-
export { FallbackSubtitle } from './FallbackSubtitle';
|
|
3
|
-
export { FallbackContent } from './FallbackContent';
|
|
4
|
-
export { FallbackFooter } from './FallbackFooter';
|
|
5
|
-
export { FallbackForegroundFrame } from './FallbackForegroundFrame';
|
|
1
|
+
export { FallbackTitle } from './FallbackTitle.js';
|
|
2
|
+
export { FallbackSubtitle } from './FallbackSubtitle.js';
|
|
3
|
+
export { FallbackContent } from './FallbackContent.js';
|
|
4
|
+
export { FallbackFooter } from './FallbackFooter.js';
|
|
5
|
+
export { FallbackForegroundFrame } from './FallbackForegroundFrame.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ModalLayerProps } from '../../types';
|
|
1
|
+
import type { ModalLayerProps } from '../../types/index.js';
|
|
2
2
|
export declare const ForegroundFrame: ({ modalId, onChangeOrder, }: ModalLayerProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { AlertNode } from '../../../core';
|
|
2
|
-
import type { ModalActions } from '../../../types';
|
|
1
|
+
import type { AlertNode } from '../../../core/index.js';
|
|
2
|
+
import type { ModalActions } from '../../../types/index.js';
|
|
3
3
|
interface AlertInnerProps<B> {
|
|
4
4
|
modal: AlertNode<B>;
|
|
5
5
|
handlers: Pick<ModalActions, 'onConfirm'>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ConfirmNode } from '../../../core';
|
|
2
|
-
import type { ModalActions } from '../../../types';
|
|
1
|
+
import type { ConfirmNode } from '../../../core/index.js';
|
|
2
|
+
import type { ModalActions } from '../../../types/index.js';
|
|
3
3
|
interface ConfirmInnerProps<B> {
|
|
4
4
|
modal: ConfirmNode<B>;
|
|
5
5
|
handlers: Pick<ModalActions, 'onConfirm' | 'onClose'>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { PromptNode } from '../../../core';
|
|
2
|
-
import type { ModalActions } from '../../../types';
|
|
1
|
+
import type { PromptNode } from '../../../core/index.js';
|
|
2
|
+
import type { ModalActions } from '../../../types/index.js';
|
|
3
3
|
interface PromptInnerProps<T, B> {
|
|
4
4
|
modal: PromptNode<T, B>;
|
|
5
5
|
handlers: Pick<ModalActions, 'onChange' | 'onClose' | 'onConfirm'>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { AlertInner } from './AlertInner';
|
|
2
|
-
export { ConfirmInner } from './ConfirmInner';
|
|
3
|
-
export { PromptInner } from './PromptInner';
|
|
1
|
+
export { AlertInner } from './AlertInner.js';
|
|
2
|
+
export { ConfirmInner } from './ConfirmInner.js';
|
|
3
|
+
export { PromptInner } from './PromptInner.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ForegroundFrame as Foreground } from './Foreground';
|
|
1
|
+
export { ForegroundFrame as Foreground } from './Foreground.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { PresenterProps } from '../../types';
|
|
1
|
+
import type { PresenterProps } from '../../types/index.js';
|
|
2
2
|
export declare const Presenter: import("react").MemoExoticComponent<({ modalId, getValue, increment }: PresenterProps) => import("react/jsx-runtime").JSX.Element>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Presenter } from './Presenter';
|
|
1
|
+
export { Presenter } from './Presenter.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { alertHandler } from './alert';
|
|
2
|
-
export { confirmHandler } from './confirm';
|
|
3
|
-
export { promptHandler } from './prompt';
|
|
4
|
-
export { alert, confirm, prompt } from './static';
|
|
5
|
-
export type { AlertProps, ConfirmProps, PromptProps } from './type';
|
|
1
|
+
export { alertHandler } from './alert.js';
|
|
2
|
+
export { confirmHandler } from './confirm.js';
|
|
3
|
+
export { promptHandler } from './prompt.js';
|
|
4
|
+
export { alert, confirm, prompt } from './static.js';
|
|
5
|
+
export type { AlertProps, ConfirmProps, PromptProps } from './type.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ComponentType, ReactNode } from 'react';
|
|
2
|
-
import type { Fn } from '../../@aileron/declare';
|
|
3
|
-
import type { AlertContentProps, AlertFooterRender, BackgroundComponent, ConfirmContentProps, ConfirmFooterRender, FooterOptions, ForegroundComponent, ModalBackground, PromptContentProps, PromptFooterRender, PromptInputProps } from '../../types';
|
|
2
|
+
import type { Fn } from '../../@aileron/declare/index.js';
|
|
3
|
+
import type { AlertContentProps, AlertFooterRender, BackgroundComponent, ConfirmContentProps, ConfirmFooterRender, FooterOptions, ForegroundComponent, ModalBackground, PromptContentProps, PromptFooterRender, PromptInputProps } from '../../types/index.js';
|
|
4
4
|
export interface OverridableHandleProps {
|
|
5
5
|
/** Modal group identifier for managing related modals */
|
|
6
6
|
group?: string;
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './handle';
|
|
2
|
-
export * from './node';
|
|
1
|
+
export * from './handle/index.js';
|
|
2
|
+
export * from './node/index.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import type { Fn } from '../../../@aileron/declare';
|
|
3
|
-
import type { BackgroundComponent, BaseModal, ForegroundComponent, ManagedEntity, ModalBackground } from '../../../types';
|
|
2
|
+
import type { Fn } from '../../../@aileron/declare/index.js';
|
|
3
|
+
import type { BackgroundComponent, BaseModal, ForegroundComponent, ManagedEntity, ModalBackground } from '../../../types/index.js';
|
|
4
4
|
type AbstractNodeProps<T, B> = BaseModal<T, B> & ManagedEntity;
|
|
5
5
|
export declare abstract class AbstractNode<T, B> {
|
|
6
6
|
readonly id: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ComponentType, ReactNode } from 'react';
|
|
2
|
-
import type { AlertContentProps, AlertFooterRender, AlertModal, FooterOptions, ManagedEntity } from '../../../types';
|
|
3
|
-
import { AbstractNode } from './AbstractNode';
|
|
2
|
+
import type { AlertContentProps, AlertFooterRender, AlertModal, FooterOptions, ManagedEntity } from '../../../types/index.js';
|
|
3
|
+
import { AbstractNode } from './AbstractNode.js';
|
|
4
4
|
type AlertNodeProps<B> = AlertModal<B> & ManagedEntity;
|
|
5
5
|
export declare class AlertNode<B = any> extends AbstractNode<null, B> {
|
|
6
6
|
readonly type: 'alert';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ComponentType, ReactNode } from 'react';
|
|
2
|
-
import type { ConfirmContentProps, ConfirmFooterRender, ConfirmModal, FooterOptions, ManagedEntity } from '../../../types';
|
|
3
|
-
import { AbstractNode } from './AbstractNode';
|
|
2
|
+
import type { ConfirmContentProps, ConfirmFooterRender, ConfirmModal, FooterOptions, ManagedEntity } from '../../../types/index.js';
|
|
3
|
+
import { AbstractNode } from './AbstractNode.js';
|
|
4
4
|
type ConfirmNodeProps<B> = ConfirmModal<B> & ManagedEntity;
|
|
5
5
|
export declare class ConfirmNode<B = any> extends AbstractNode<boolean, B> {
|
|
6
6
|
readonly type: 'confirm';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ComponentType, ReactNode } from 'react';
|
|
2
|
-
import type { Fn } from '../../../@aileron/declare';
|
|
3
|
-
import type { FooterOptions, ManagedEntity, PromptContentProps, PromptFooterRender, PromptInputProps, PromptModal } from '../../../types';
|
|
4
|
-
import { AbstractNode } from './AbstractNode';
|
|
2
|
+
import type { Fn } from '../../../@aileron/declare/index.js';
|
|
3
|
+
import type { FooterOptions, ManagedEntity, PromptContentProps, PromptFooterRender, PromptInputProps, PromptModal } from '../../../types/index.js';
|
|
4
|
+
import { AbstractNode } from './AbstractNode.js';
|
|
5
5
|
type PromptNodeProps<T, B> = PromptModal<T, B> & ManagedEntity;
|
|
6
6
|
export declare class PromptNode<T = any, B = any> extends AbstractNode<T, B> {
|
|
7
7
|
readonly type: 'prompt';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { AlertNode } from './AlertNode';
|
|
2
|
-
export { ConfirmNode } from './ConfirmNode';
|
|
3
|
-
export { PromptNode } from './PromptNode';
|
|
1
|
+
export { AlertNode } from './AlertNode.js';
|
|
2
|
+
export { ConfirmNode } from './ConfirmNode.js';
|
|
3
|
+
export { PromptNode } from './PromptNode.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { nodeFactory } from './nodeFactory';
|
|
2
|
-
export type { ModalNode, AlertNode, ConfirmNode, PromptNode } from './type';
|
|
1
|
+
export { nodeFactory } from './nodeFactory.js';
|
|
2
|
+
export type { ModalNode, AlertNode, ConfirmNode, PromptNode } from './type.js';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { ManagedModal } from '../../types';
|
|
2
|
-
import { AlertNode, ConfirmNode, PromptNode } from './ModalNode';
|
|
1
|
+
import type { ManagedModal } from '../../types/index.js';
|
|
2
|
+
import { AlertNode, ConfirmNode, PromptNode } from './ModalNode/index.js';
|
|
3
3
|
export declare const nodeFactory: <T, B>(modal: ManagedModal<T, B>) => AlertNode<B> | ConfirmNode<B> | PromptNode<T, B>;
|
package/dist/core/node/type.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { AlertNode, ConfirmNode, PromptNode } from './ModalNode';
|
|
1
|
+
import type { AlertNode, ConfirmNode, PromptNode } from './ModalNode/index.js';
|
|
2
2
|
export type ModalNode<T = any, B = any> = AlertNode<B> | ConfirmNode<B> | PromptNode<T, B>;
|
|
3
3
|
export type { AlertNode, ConfirmNode, PromptNode };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ModalNode } from '../core';
|
|
1
|
+
import type { ModalNode } from '../core/index.js';
|
|
2
2
|
export declare const closeModal: (modalNode: ModalNode, refresh?: boolean) => NodeJS.Timeout | undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ModalNode } from '../core';
|
|
1
|
+
import type { ModalNode } from '../core/index.js';
|
|
2
2
|
export declare const subscribeAbortSignal: (modalNode: ModalNode, signal: AbortSignal | undefined) => (() => void) | null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Fn } from '../@aileron/declare';
|
|
2
|
-
import type { ModalNode } from '../core';
|
|
1
|
+
import type { Fn } from '../@aileron/declare/index.js';
|
|
2
|
+
import type { ModalNode } from '../core/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* Hook that counts the number of active modals based on a validation function.
|
|
5
5
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Duration } from '../@aileron/declare';
|
|
2
|
-
import type { ModalNode } from '../core';
|
|
1
|
+
import type { Duration } from '../@aileron/declare/index.js';
|
|
2
|
+
import type { ModalNode } from '../core/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* Hook that automatically destroys a modal after it becomes hidden.
|
|
5
5
|
*
|
package/dist/hooks/useModal.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type AlertProps, type ConfirmProps, type PromptProps } from '../core';
|
|
2
|
-
import type { OverridableHandleProps } from '../core/handle/type';
|
|
1
|
+
import { type AlertProps, type ConfirmProps, type PromptProps } from '../core/index.js';
|
|
2
|
+
import type { OverridableHandleProps } from '../core/handle/type.js';
|
|
3
3
|
export declare const useModal: (configuration?: OverridableHandleProps) => {
|
|
4
4
|
readonly alert: <Background = any>(args: AlertProps<Background>) => Promise<void>;
|
|
5
5
|
readonly confirm: <Background = any>(args: ConfirmProps<Background>) => Promise<boolean>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { useConfigurationOptions as useModalOptions, useConfigurationBackdrop as useModalBackdrop, } from './providers';
|
|
2
|
-
export { useBootstrap as useInitializeModal, BootstrapProvider as ModalProvider, type BootstrapProviderHandle as ModalProviderHandle, type BootstrapProviderProps as ModalProviderProps, } from './bootstrap';
|
|
3
|
-
export { useModal } from './hooks/useModal';
|
|
4
|
-
export { useActiveModalCount } from './hooks/useActiveModalCount';
|
|
5
|
-
export { useDestroyAfter } from './hooks/useDestroyAfter';
|
|
6
|
-
export { useModalAnimation } from './hooks/useModalAnimation';
|
|
7
|
-
export { useModalDuration } from './hooks/useModalDuration';
|
|
8
|
-
export { useSubscribeModal } from './hooks/useSubscribeModal';
|
|
9
|
-
export { alert, confirm, prompt } from './core';
|
|
10
|
-
export type { ModalOptions, ModalFrameProps, FooterComponentProps, ModalBackground, PromptInputProps, AlertContentProps, ConfirmContentProps, PromptContentProps, WrapperComponentProps, } from './types';
|
|
1
|
+
export { useConfigurationOptions as useModalOptions, useConfigurationBackdrop as useModalBackdrop, } from './providers/index.js';
|
|
2
|
+
export { useBootstrap as useInitializeModal, BootstrapProvider as ModalProvider, type BootstrapProviderHandle as ModalProviderHandle, type BootstrapProviderProps as ModalProviderProps, } from './bootstrap/index.js';
|
|
3
|
+
export { useModal } from './hooks/useModal.js';
|
|
4
|
+
export { useActiveModalCount } from './hooks/useActiveModalCount.js';
|
|
5
|
+
export { useDestroyAfter } from './hooks/useDestroyAfter.js';
|
|
6
|
+
export { useModalAnimation } from './hooks/useModalAnimation.js';
|
|
7
|
+
export { useModalDuration } from './hooks/useModalDuration.js';
|
|
8
|
+
export { useSubscribeModal } from './hooks/useSubscribeModal.js';
|
|
9
|
+
export { alert, confirm, prompt } from './core/index.js';
|
|
10
|
+
export type { ModalOptions, ModalFrameProps, FooterComponentProps, ModalBackground, PromptInputProps, AlertContentProps, ConfirmContentProps, PromptContentProps, WrapperComponentProps, } from './types/index.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type CSSProperties, type ComponentType } from 'react';
|
|
2
|
-
import type { BackgroundComponent, FooterComponentProps, ForegroundComponent, ModalOptions, WrapperComponentProps } from '../../types';
|
|
2
|
+
import type { BackgroundComponent, FooterComponentProps, ForegroundComponent, ModalOptions, WrapperComponentProps } from '../../types/index.js';
|
|
3
3
|
export interface ConfigurationContextProps {
|
|
4
4
|
ForegroundComponent: ForegroundComponent;
|
|
5
5
|
BackgroundComponent?: BackgroundComponent;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ComponentType, type PropsWithChildren } from 'react';
|
|
2
|
-
import type { FooterComponentProps, ModalFrameProps, ModalOptions, WrapperComponentProps } from '../../types';
|
|
2
|
+
import type { FooterComponentProps, ModalFrameProps, ModalOptions, WrapperComponentProps } from '../../types/index.js';
|
|
3
3
|
export interface ConfigurationContextProviderProps {
|
|
4
4
|
BackgroundComponent?: ComponentType<ModalFrameProps>;
|
|
5
5
|
ForegroundComponent?: ComponentType<ModalFrameProps>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { ConfigurationContextProvider, type ConfigurationContextProviderProps, } from './ConfigurationContextProvider';
|
|
2
|
-
export { useConfigurationContext, useConfigurationOptions, useConfigurationDuration, useConfigurationBackdrop, } from './useConfigurationContext';
|
|
1
|
+
export { ConfigurationContextProvider, type ConfigurationContextProviderProps, } from './ConfigurationContextProvider.js';
|
|
2
|
+
export { useConfigurationContext, useConfigurationOptions, useConfigurationDuration, useConfigurationBackdrop, } from './useConfigurationContext.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Fn } from '../../@aileron/declare';
|
|
2
|
-
import type { ModalNode } from '../../core';
|
|
3
|
-
import type { ModalActions, ModalHandlersWithId } from '../../types';
|
|
1
|
+
import type { Fn } from '../../@aileron/declare/index.js';
|
|
2
|
+
import type { ModalNode } from '../../core/index.js';
|
|
3
|
+
import type { ModalActions, ModalHandlersWithId } from '../../types/index.js';
|
|
4
4
|
export interface ModalManagerContextProps extends ModalHandlersWithId {
|
|
5
5
|
modalIds: ModalNode['id'][];
|
|
6
6
|
getModal: Fn<[id: ModalNode['id']], ModalActions>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { ModalManagerContextProvider } from './ModalManagerContextProvider';
|
|
2
|
-
export { useModalManagerContext, useModalManager, } from './useModalManagerContext';
|
|
1
|
+
export { ModalManagerContextProvider } from './ModalManagerContextProvider.js';
|
|
2
|
+
export { useModalManagerContext, useModalManager, } from './useModalManagerContext.js';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { ManagedModal } from '../../types';
|
|
1
|
+
import type { ManagedModal } from '../../types/index.js';
|
|
2
2
|
export declare const useModalManagerContext: () => import("./ModalManagerContext").ModalManagerContextProps;
|
|
3
3
|
export declare const useModalManager: (id: ManagedModal["id"]) => import("../../types").ModalActions;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type PropsWithChildren } from 'react';
|
|
2
|
-
import type { Dictionary } from '../../@aileron/declare';
|
|
2
|
+
import type { Dictionary } from '../../@aileron/declare/index.js';
|
|
3
3
|
interface UserDefinedContextProviderProps {
|
|
4
4
|
/** User defined context */
|
|
5
5
|
context?: Dictionary;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { UserDefinedContextProvider } from './UserDefinedContextProvider';
|
|
2
|
-
export { useUserDefinedContext } from './useUserDefinedContext';
|
|
1
|
+
export { UserDefinedContextProvider } from './UserDefinedContextProvider.js';
|
|
2
|
+
export { useUserDefinedContext } from './useUserDefinedContext.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { UserDefinedContext } from './UserDefinedContext';
|
|
1
|
+
import { UserDefinedContext } from './UserDefinedContext.js';
|
|
2
2
|
export declare const useUserDefinedContext: () => UserDefinedContext;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { useModalManagerContext, useModalManager } from './ModalManagerContext';
|
|
2
|
-
export { useConfigurationContext, useConfigurationOptions, useConfigurationDuration, useConfigurationBackdrop, } from './ConfigurationContext';
|
|
3
|
-
export { useUserDefinedContext } from './UserDefinedContext';
|
|
1
|
+
export { useModalManagerContext, useModalManager } from './ModalManagerContext/index.js';
|
|
2
|
+
export { useConfigurationContext, useConfigurationOptions, useConfigurationDuration, useConfigurationBackdrop, } from './ConfigurationContext/index.js';
|
|
3
|
+
export { useUserDefinedContext } from './UserDefinedContext/index.js';
|
package/dist/types/alert.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ComponentType, ReactNode } from 'react';
|
|
2
|
-
import type { Dictionary, Fn } from '../@aileron/declare';
|
|
3
|
-
import type { BaseModal, ContentComponentProps, FooterOptions } from './base';
|
|
2
|
+
import type { Dictionary, Fn } from '../@aileron/declare/index.js';
|
|
3
|
+
import type { BaseModal, ContentComponentProps, FooterOptions } from './base.js';
|
|
4
4
|
export type AlertFooterRender<Context extends Dictionary = object> = Fn<[
|
|
5
5
|
props: {
|
|
6
6
|
onConfirm: Fn;
|
package/dist/types/base.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ComponentType, PropsWithChildren, ReactNode } from 'react';
|
|
2
|
-
import type { Dictionary, Fn } from '../@aileron/declare';
|
|
3
|
-
import type { ModalBackground } from './background';
|
|
4
|
-
import type { ModalFrameProps } from './modal';
|
|
2
|
+
import type { Dictionary, Fn } from '../@aileron/declare/index.js';
|
|
3
|
+
import type { ModalBackground } from './background.js';
|
|
4
|
+
import type { ModalFrameProps } from './modal.js';
|
|
5
5
|
export interface BaseModal<T, B> {
|
|
6
6
|
group?: string;
|
|
7
7
|
title?: ReactNode;
|
package/dist/types/confirm.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ComponentType, ReactNode } from 'react';
|
|
2
|
-
import type { Dictionary, Fn } from '../@aileron/declare';
|
|
3
|
-
import type { BaseModal, ContentComponentProps, FooterOptions } from './base';
|
|
2
|
+
import type { Dictionary, Fn } from '../@aileron/declare/index.js';
|
|
3
|
+
import type { BaseModal, ContentComponentProps, FooterOptions } from './base.js';
|
|
4
4
|
export type ConfirmFooterRender<Context extends Dictionary = object> = Fn<[
|
|
5
5
|
props: {
|
|
6
6
|
onConfirm: Fn;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export * from './alert';
|
|
2
|
-
export * from './base';
|
|
3
|
-
export * from './confirm';
|
|
4
|
-
export * from './modal';
|
|
5
|
-
export * from './prompt';
|
|
6
|
-
export * from './background';
|
|
7
|
-
export * from './option';
|
|
1
|
+
export * from './alert.js';
|
|
2
|
+
export * from './base.js';
|
|
3
|
+
export * from './confirm.js';
|
|
4
|
+
export * from './modal.js';
|
|
5
|
+
export * from './prompt.js';
|
|
6
|
+
export * from './background.js';
|
|
7
|
+
export * from './option.js';
|
package/dist/types/modal.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { Dictionary, Fn } from '../@aileron/declare';
|
|
2
|
-
import type { ModalNode } from '../core';
|
|
3
|
-
import type { AlertModal } from './alert';
|
|
4
|
-
import type { ModalBackground } from './background';
|
|
5
|
-
import type { ConfirmModal } from './confirm';
|
|
6
|
-
import type { PromptModal } from './prompt';
|
|
1
|
+
import type { Dictionary, Fn } from '../@aileron/declare/index.js';
|
|
2
|
+
import type { ModalNode } from '../core/index.js';
|
|
3
|
+
import type { AlertModal } from './alert.js';
|
|
4
|
+
import type { ModalBackground } from './background.js';
|
|
5
|
+
import type { ConfirmModal } from './confirm.js';
|
|
6
|
+
import type { PromptModal } from './prompt.js';
|
|
7
7
|
export type Modal<T = any, B = any, Context extends Dictionary = object> = AlertModal<B, Context> | ConfirmModal<B, Context> | PromptModal<T, B, Context>;
|
|
8
8
|
export type ManagedEntity = {
|
|
9
9
|
id: number;
|
package/dist/types/option.d.ts
CHANGED
package/dist/types/prompt.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ComponentType, ReactNode } from 'react';
|
|
2
|
-
import type { Dictionary, Fn, SetStateFn } from '../@aileron/declare';
|
|
3
|
-
import type { BaseModal, ContentComponentProps, FooterOptions } from './base';
|
|
2
|
+
import type { Dictionary, Fn, SetStateFn } from '../@aileron/declare/index.js';
|
|
3
|
+
import type { BaseModal, ContentComponentProps, FooterOptions } from './base.js';
|
|
4
4
|
export type PromptFooterRender<T, Context extends Dictionary = object> = Fn<[
|
|
5
5
|
props: {
|
|
6
6
|
value: T | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lerx/promise-modal",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.1",
|
|
4
4
|
"description": "Universal React modal utility that can be used outside React components with promise-based results for alert, confirm, and prompt modals",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"scripts": {
|
|
51
51
|
"build": "rollup -c && yarn build:types",
|
|
52
52
|
"build:publish:npm": "yarn build && yarn publish:npm",
|
|
53
|
-
"build:types": "
|
|
53
|
+
"build:types": "node ../../aileron/script/build/buildTypes.mjs",
|
|
54
54
|
"build-storybook": "storybook build",
|
|
55
55
|
"format": "prettier --write \"src/**/*.{ts,tsx}\"",
|
|
56
56
|
"lint": "eslint \"src/**/*.{ts,tsx}\"",
|
|
@@ -65,9 +65,9 @@
|
|
|
65
65
|
"version:patch": "yarn version patch"
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"@winglet/common-utils": "^0.
|
|
69
|
-
"@winglet/react-utils": "^0.
|
|
70
|
-
"@winglet/style-utils": "^0.
|
|
68
|
+
"@winglet/common-utils": "^0.11.1",
|
|
69
|
+
"@winglet/react-utils": "^0.11.2",
|
|
70
|
+
"@winglet/style-utils": "^0.11.1"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"@types/react": "^19.0.0",
|