@lerx/promise-modal 0.9.0 → 0.9.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/index.cjs CHANGED
@@ -455,14 +455,14 @@ const DEFAULT_OPTIONS = {
455
455
  manualDestroy: false,
456
456
  };
457
457
  const ConfigurationContextProvider = react.memo(({ ForegroundComponent, BackgroundComponent, TitleComponent, SubtitleComponent, ContentComponent, FooterComponent, options: inputOptions, children, }) => {
458
- const constant = hook.useConstant({
458
+ const constant = hook.useMemorize(() => ({
459
459
  BackgroundComponent,
460
460
  ForegroundComponent: ForegroundComponent || FallbackForegroundFrame,
461
461
  TitleComponent: TitleComponent || FallbackTitle,
462
462
  SubtitleComponent: SubtitleComponent || FallbackSubtitle,
463
463
  ContentComponent: react.memo(ContentComponent || FallbackContent),
464
464
  FooterComponent: react.memo(FooterComponent || FallbackFooter),
465
- });
465
+ }));
466
466
  const options = hook.useSnapshot(inputOptions);
467
467
  const value = react.useMemo(() => {
468
468
  const { backdrop: defaultBackdrop, ...defaultOptions } = DEFAULT_OPTIONS;
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { jsx, jsxs } from 'react/jsx-runtime';
2
2
  import { createContext, useContext, useMemo, forwardRef, memo, useRef, useState, useLayoutEffect, useCallback, Fragment, useEffect, useImperativeHandle } from 'react';
3
3
  import { convertMsFromDuration } from '@winglet/common-utils/convert';
4
- import { useConstant, useSnapshot, useReference, useOnMountLayout, useHandle, useVersion, useOnMount, useOnUnmount } from '@winglet/react-utils/hook';
4
+ import { useMemorize, useSnapshot, useReference, useOnMountLayout, useHandle, useVersion, useOnMount, useOnUnmount } from '@winglet/react-utils/hook';
5
5
  import { polynomialHash } from '@winglet/common-utils/hash';
6
6
  import { getRandomString, counterFactory } from '@winglet/common-utils/lib';
7
7
  import { styleManagerFactory, destroyScope } from '@winglet/style-utils/style-manager';
@@ -453,14 +453,14 @@ const DEFAULT_OPTIONS = {
453
453
  manualDestroy: false,
454
454
  };
455
455
  const ConfigurationContextProvider = memo(({ ForegroundComponent, BackgroundComponent, TitleComponent, SubtitleComponent, ContentComponent, FooterComponent, options: inputOptions, children, }) => {
456
- const constant = useConstant({
456
+ const constant = useMemorize(() => ({
457
457
  BackgroundComponent,
458
458
  ForegroundComponent: ForegroundComponent || FallbackForegroundFrame,
459
459
  TitleComponent: TitleComponent || FallbackTitle,
460
460
  SubtitleComponent: SubtitleComponent || FallbackSubtitle,
461
461
  ContentComponent: memo(ContentComponent || FallbackContent),
462
462
  FooterComponent: memo(FooterComponent || FallbackFooter),
463
- });
463
+ }));
464
464
  const options = useSnapshot(inputOptions);
465
465
  const value = useMemo(() => {
466
466
  const { backdrop: defaultBackdrop, ...defaultOptions } = DEFAULT_OPTIONS;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lerx/promise-modal",
3
- "version": "0.9.0",
3
+ "version": "0.9.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",