ChangelogComponents
0.1.25
NiceModal imperative API와 타입을 추가 노출합니다. `register`, `unregister`, `NiceModalContext` 등으로 string-id 기반 모달 관리와 store 조회를 소비자 코드에서 직접 사용할 수 있습니다.
@ebay/nice-modal-react의 런타임 헬퍼와 타입을 디자인 시스템에서 함께 노출합니다. 기존 Modal.create/Modal.show/Modal.hide/Modal.remove/Modal.Provider 외에 string-id 등록, declarative holder, store context를 namespace와 top-level에서 사용할 수 있습니다. 라우팅 이벤트에 맞춰 모달을 일괄 정리하거나 강제 모달을 명시 id로 관리해야 하는 escape hatch에 사용합니다. 기존 컴포넌트 직접 전달 (Modal.show(MyModal, args)) 패턴은 그대로 동작합니다.
추가 노출 API
Modal.register(id, Component, defaultProps?)/Modal.unregister(id)— 명시적 string id 등록 (Modal.show('id', args)호출 가능)Modal.ModalDef/Modal.ModalHolder— declarative 등록 컴포넌트NiceModalContext— 현재 등록된 모달 store에 접근하는 React Context (namespaceModal.NiceModalContext와 top-level 모두 import 가능)
추가 노출 타입
NiceModalHandler, NiceModalState, NiceModalStore, NiceModalAction, NiceModalHocProps를 type export로 노출합니다.
사용 예시
import { Modal, NiceModalContext } from '@featuring-corp/components';
// 강제 모달을 명시 id로 등록 후 호출
Modal.register('Persistent_FooModal', FooModal);
Modal.show('Persistent_FooModal', { username: 'foo' });
// 등록된 모달 store 조회 (예: route change 시 일괄 hide)
const ctx = useContext(NiceModalContext);
Object.keys(ctx).forEach((id) => Modal.hide(id));