@ablogcms/notify 3.2.28-beta.0 → 3.2.30

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.mjs CHANGED
@@ -279,16 +279,16 @@ function ToastPresenter({
279
279
  activeStacked.forEach((item, index) => {
280
280
  const el = itemRefs.current.get(item.id);
281
281
  if (!el) return;
282
- el.style.setProperty("--acms-toast-index", String(index));
283
- el.style.setProperty("--acms-toast-offset", `${offset}px`);
282
+ el.style.setProperty("--acms-admin-toast-index", String(index));
283
+ el.style.setProperty("--acms-admin-toast-offset", `${offset}px`);
284
284
  el.dataset.front = index === 0 ? "true" : "false";
285
285
  const height = el.offsetHeight;
286
286
  if (index === 0) frontHeight = height;
287
287
  offset += height + GAP;
288
288
  });
289
- region.style.setProperty("--acms-toast-front-height", `${frontHeight}px`);
289
+ region.style.setProperty("--acms-admin-toast-front-height", `${frontHeight}px`);
290
290
  const totalHeight = expanded ? Math.max(offset - GAP, 0) : frontHeight + PEEK * Math.max(activeStacked.length - 1, 0);
291
- region.style.setProperty("--acms-toast-region-height", `${totalHeight}px`);
291
+ region.style.setProperty("--acms-admin-toast-region-height", `${totalHeight}px`);
292
292
  }, [activeStacked, expanded, overlap]);
293
293
  const expand = useCallback(() => {
294
294
  pause();
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/store/store.ts","../src/notify.ts","../src/notify-container.tsx","../src/presenters/toast-presenter.tsx","../src/presenters/use-toast-stack.ts","../src/store/hook.ts"],"sourcesContent":["import { NotificationItem, NotificationOptions } from '../types';\n\ninterface InternalNotification extends NotificationItem {\n duration: number;\n remaining: number;\n startedAt: number;\n timer: ReturnType<typeof setTimeout> | null;\n onClose?: () => void;\n}\n\ninterface StoreConfig {\n limit: number;\n duration: number;\n}\n\nconst DEFAULT_CONFIG: StoreConfig = { limit: 3, duration: 5000 };\n\nlet config: StoreConfig = { ...DEFAULT_CONFIG };\nlet visible: InternalNotification[] = [];\nlet queue: InternalNotification[] = [];\nlet paused = false;\nlet seq = 0;\n\ntype Listener = () => void;\nconst listeners = new Set<Listener>();\n\nfunction emitChange() {\n for (const listener of listeners) {\n listener();\n }\n}\n\nfunction genId(): string {\n seq += 1;\n return `notification-${seq}`;\n}\n\nfunction resolveDuration(type: NotificationOptions['type'], duration: number | undefined): number {\n if (duration !== undefined) return duration;\n return type === 'danger' ? 0 : config.duration;\n}\n\nfunction clearTimer(notification: InternalNotification): void {\n if (notification.timer) {\n clearTimeout(notification.timer);\n notification.timer = null;\n }\n}\n\nfunction startTimer(notification: InternalNotification): void {\n if (notification.duration === 0) return;\n notification.startedAt = Date.now();\n // startTimer -> dismiss -> drainQueue -> startTimer の相互再帰のため、定義順で解決できない\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n notification.timer = setTimeout(() => dismiss(notification.id), Math.max(notification.remaining, 0));\n}\n\nfunction buildInternal(id: string, options: NotificationOptions): InternalNotification {\n const type = options.type ?? 'info';\n const duration = resolveDuration(type, options.duration);\n return {\n id,\n type,\n title: options.title,\n description: options.description,\n closable: options.closable ?? true,\n action: options.action,\n onClose: options.onClose,\n duration,\n remaining: duration,\n startedAt: 0,\n timer: null,\n };\n}\n\nfunction applyOptions(target: InternalNotification, options: NotificationOptions): void {\n target.type = options.type ?? target.type;\n target.title = options.title ?? target.title;\n if ('description' in options) target.description = options.description;\n if ('closable' in options) target.closable = options.closable ?? true;\n if ('action' in options) target.action = options.action;\n if ('onClose' in options) target.onClose = options.onClose;\n target.duration = resolveDuration(target.type, options.duration);\n target.remaining = target.duration;\n}\n\n/** 既存の通知に options をマージした新しいオブジェクトを返す(未指定フィールドは既存値を維持) */\nfunction mergeNotification(existing: InternalNotification, options: NotificationOptions): InternalNotification {\n const next = { ...existing };\n applyOptions(next, options);\n return next;\n}\n\n/** テスト・HMR 用にストア状態を初期化する */\nexport function reset(): void {\n [...visible, ...queue].forEach(clearTimer);\n visible = [];\n queue = [];\n paused = false;\n seq = 0;\n config = { ...DEFAULT_CONFIG };\n}\n\nexport function configure(next: Partial<StoreConfig>): void {\n config = { ...config, ...next };\n}\n\nexport function subscribe(listener: Listener): () => void {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n}\n\nexport function getSnapshot(): NotificationItem[] {\n return visible;\n}\n\nfunction drainQueue(): void {\n while (queue.length > 0 && visible.length < config.limit) {\n const [next, ...rest] = queue;\n queue = rest;\n visible = [...visible, next];\n if (!paused) startTimer(next);\n }\n}\n\nexport function enqueue(options: NotificationOptions): string {\n const id = options.id ?? genId();\n\n const existing = visible.find((n) => n.id === id);\n if (existing) {\n clearTimer(existing);\n applyOptions(existing, options);\n visible = [...visible];\n if (!paused) startTimer(existing);\n emitChange();\n return id;\n }\n\n const queuedIndex = queue.findIndex((n) => n.id === id);\n if (queuedIndex !== -1) {\n queue = queue.map((n, i) => (i === queuedIndex ? mergeNotification(n, options) : n));\n return id;\n }\n\n const notification = buildInternal(id, options);\n if (visible.length >= config.limit) {\n queue = [...queue, notification];\n return id;\n }\n\n visible = [...visible, notification];\n if (!paused) startTimer(notification);\n emitChange();\n return id;\n}\n\nexport function update(id: string, options: NotificationOptions): void {\n const existing = visible.find((n) => n.id === id);\n if (existing) {\n clearTimer(existing);\n applyOptions(existing, options);\n visible = [...visible];\n if (!paused) startTimer(existing);\n emitChange();\n return;\n }\n\n const queuedIndex = queue.findIndex((n) => n.id === id);\n if (queuedIndex !== -1) {\n queue = queue.map((n, i) => (i === queuedIndex ? mergeNotification(n, options) : n));\n }\n}\n\nexport function dismiss(id?: string): void {\n if (id === undefined) {\n const closing = [...visible, ...queue];\n closing.forEach(clearTimer);\n visible = [];\n queue = [];\n emitChange();\n closing.forEach((n) => n.onClose?.());\n return;\n }\n\n const target = visible.find((n) => n.id === id);\n if (target) {\n clearTimer(target);\n visible = visible.filter((n) => n.id !== id);\n drainQueue();\n emitChange();\n target.onClose?.();\n return;\n }\n\n const queuedTarget = queue.find((n) => n.id === id);\n if (queuedTarget) {\n queue = queue.filter((n) => n.id !== id);\n queuedTarget.onClose?.();\n }\n}\n\nexport function pauseAll(): void {\n if (paused) return;\n paused = true;\n visible.forEach((notification) => {\n if (!notification.timer) return;\n clearTimeout(notification.timer);\n notification.timer = null;\n notification.remaining = Math.max(notification.remaining - (Date.now() - notification.startedAt), 0);\n });\n}\n\nexport function resumeAll(): void {\n if (!paused) return;\n paused = false;\n visible.forEach((notification) => {\n if (notification.duration === 0 || notification.timer) return;\n startTimer(notification);\n });\n}\n","import { dismiss as dismissStore, enqueue, update as updateStore } from './store/store';\nimport { NotificationContent, NotificationOptions, NotificationType, NotifyApi, NotifyPromiseMessages } from './types';\n\n// 旧オプション名(autoHide/onHide)を新名称(duration/onClose)へ正規化する。\n// 明示された新名称があればそちらを優先する。\nfunction normalize(options: NotificationOptions): NotificationOptions {\n const { autoHide, onHide, duration, onClose, ...rest } = options;\n return {\n ...rest,\n duration: duration ?? autoHide,\n onClose: onClose ?? onHide,\n };\n}\n\nfunction show(content: NotificationContent, options: NotificationOptions = {}, type?: NotificationType): string {\n const normalized = normalize(options);\n return enqueue({ ...normalized, type: type ?? normalized.type ?? 'info', title: content });\n}\n\nfunction notify(content: NotificationContent, options?: NotificationOptions): string {\n return show(content, options);\n}\n\nnotify.success = (content: NotificationContent, options?: NotificationOptions) => show(content, options, 'success');\nnotify.info = (content: NotificationContent, options?: NotificationOptions) => show(content, options, 'info');\nnotify.warning = (content: NotificationContent, options?: NotificationOptions) => show(content, options, 'warning');\nnotify.danger = (content: NotificationContent, options?: NotificationOptions) => show(content, options, 'danger');\n\nnotify.promise = function promise<T>(promise: Promise<T>, messages: NotifyPromiseMessages<T>): Promise<T> {\n const id = show(messages.loading, { duration: 0, closable: false }, 'info');\n promise.then(\n (data) => {\n const title = typeof messages.success === 'function' ? messages.success(data) : messages.success;\n updateStore(id, { type: 'success', title });\n },\n (error) => {\n const title = typeof messages.error === 'function' ? messages.error(error) : messages.error;\n updateStore(id, { type: 'danger', title });\n }\n );\n return promise;\n};\n\nnotify.update = (id: string, options: NotificationOptions) => updateStore(id, normalize(options));\nnotify.dismiss = (id?: string) => dismissStore(id);\n\nexport default notify as NotifyApi;\n","import { useEffect } from 'react';\nimport ToastPresenter from './presenters/toast-presenter';\nimport { configure } from './store/store';\nimport { useNotificationStore } from './store';\nimport type { NotificationContainerProps } from './types';\n\nfunction NotificationContainer({\n presenter: Presenter = ToastPresenter,\n placement = 'bottom-right',\n limit = 3,\n duration = 5000,\n overlap = true,\n label,\n}: NotificationContainerProps) {\n useEffect(() => {\n configure({ limit, duration });\n }, [limit, duration]);\n\n const { snapshot, dismiss, pause, resume } = useNotificationStore();\n\n // 既定プレゼンター(ToastPresenter)にのみ placement/overlap/label を渡す。\n // NotificationPresenterProps 自体はプレゼンター間で共通の最小契約に留める。\n if (Presenter === ToastPresenter) {\n return (\n <ToastPresenter\n notifications={snapshot}\n dismiss={dismiss}\n pause={pause}\n resume={resume}\n placement={placement}\n overlap={overlap}\n label={label}\n />\n );\n }\n\n return <Presenter notifications={snapshot} dismiss={dismiss} pause={pause} resume={resume} />;\n}\n\nexport default NotificationContainer;\n","import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';\nimport Toast from '@ablogcms/components/toast';\nimport useToastStack from './use-toast-stack';\nimport type { NotificationPresenterProps, ToastPlacement } from '../types';\n\nexport interface ToastPresenterProps extends NotificationPresenterProps {\n /** 既定 bottom-right */\n placement?: ToastPlacement;\n /** 既定 true(Base UI 方式の重なり表示。false で常時リスト展開) */\n overlap?: boolean;\n /** リージョンの aria-label。既定 i18n('notify.region') */\n label?: string;\n}\n\nconst GAP = 8; // 展開時の toast 間隔($acms-spacers 2)\nconst PEEK = 12; // 折りたたみ時に背面がのぞく量\n\nfunction ToastPresenter({\n notifications,\n dismiss,\n pause,\n resume,\n placement = 'bottom-right',\n overlap = true,\n label,\n}: ToastPresenterProps) {\n const regionRef = useRef<HTMLElement>(null);\n const itemRefs = useRef(new Map<string, HTMLDivElement>());\n const [expanded, setExpanded] = useState(false);\n\n const stack = useToastStack(notifications);\n // 最新(配列末尾)が最前面になるよう反転する\n const activeStacked = useMemo(() => stack.filter((n) => !n.isLeaving).reverse(), [stack]);\n const leavingStacked = useMemo(() => stack.filter((n) => n.isLeaving), [stack]);\n\n useLayoutEffect(() => {\n const region = regionRef.current;\n if (!region || !overlap) return;\n\n let offset = 0;\n let frontHeight = 0;\n activeStacked.forEach((item, index) => {\n const el = itemRefs.current.get(item.id);\n if (!el) return;\n el.style.setProperty('--acms-toast-index', String(index));\n el.style.setProperty('--acms-toast-offset', `${offset}px`);\n el.dataset.front = index === 0 ? 'true' : 'false';\n const height = el.offsetHeight;\n if (index === 0) frontHeight = height;\n offset += height + GAP;\n });\n region.style.setProperty('--acms-toast-front-height', `${frontHeight}px`);\n const totalHeight = expanded\n ? Math.max(offset - GAP, 0)\n : frontHeight + PEEK * Math.max(activeStacked.length - 1, 0);\n region.style.setProperty('--acms-toast-region-height', `${totalHeight}px`);\n }, [activeStacked, expanded, overlap]);\n\n const expand = useCallback(() => {\n pause();\n if (overlap) setExpanded(true);\n }, [pause, overlap]);\n\n const collapse = useCallback(() => {\n resume();\n if (overlap) setExpanded(false);\n }, [resume, overlap]);\n\n const handleBlur = useCallback(\n (event: React.FocusEvent<HTMLElement>) => {\n if (!event.currentTarget.contains(event.relatedTarget as Node | null)) {\n collapse();\n }\n },\n [collapse]\n );\n\n const handleKeyDown = useCallback(\n (event: React.KeyboardEvent<HTMLElement>) => {\n if (event.key === 'Escape' && activeStacked.length > 0) {\n dismiss(activeStacked[0].id);\n }\n },\n [dismiss, activeStacked]\n );\n\n // F6 でリージョンへフォーカス移動(表示中の通知がある場合のみ)\n useEffect(() => {\n function handleGlobalKeyDown(event: KeyboardEvent) {\n if (event.key === 'F6' && notifications.length > 0) {\n event.preventDefault();\n regionRef.current?.focus();\n }\n }\n document.addEventListener('keydown', handleGlobalKeyDown);\n return () => document.removeEventListener('keydown', handleGlobalKeyDown);\n }, [notifications.length]);\n\n return (\n // section は aria-label 付きで暗黙的に role=region を持つ(明示すると redundant-roles で警告される)。\n // ホバー/フォーカスでの pause+展開、Esc での最前面クローズは Sonner / Base UI と同じ「常設ライブ\n // リージョン」パターンの要件で、button/link 化できないため意図的に非対話要素へ付与している。\n // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions\n <section\n ref={regionRef}\n aria-label={label ?? ACMS.i18n('notify.region')}\n tabIndex={-1}\n className=\"acms-admin-toast-region\"\n data-placement={placement}\n data-expanded={overlap ? expanded : true}\n onMouseEnter={expand}\n onMouseLeave={collapse}\n onFocus={expand}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n >\n {activeStacked.map((item, index) => (\n <Toast\n key={item.id}\n ref={(el) => {\n if (el) itemRefs.current.set(item.id, el);\n else itemRefs.current.delete(item.id);\n }}\n type={item.type}\n title={item.title}\n description={item.description}\n closable={item.closable}\n data-front={index === 0}\n // 折りたたみ時、最前面以外は視覚的に隠れる(opacity:0)だけでなく、\n // inert でフォーカス・スクリーンリーダーからも除外する(展開時は解除)\n inert={overlap && !expanded && index !== 0}\n onClose={() => dismiss(item.id)}\n action={\n item.action\n ? {\n label: item.action.label,\n altText: item.action.altText,\n onClick: () => item.action?.onClick({ dismiss: () => dismiss(item.id) }),\n }\n : undefined\n }\n />\n ))}\n {leavingStacked.map((item) => (\n <Toast\n key={item.id}\n className=\"is-leaving\"\n type={item.type}\n title={item.title}\n description={item.description}\n closable={false}\n inert\n />\n ))}\n </section>\n );\n}\n\nexport default ToastPresenter;\n","import { useEffect, useMemo, useRef, useState } from 'react';\nimport type { NotificationItem } from '../types';\n\n// CSS 側の transitionend が来ない環境(prefers-reduced-motion 等)向けの保険。\n// --acms-toast-transition-duration(既定 0.3s)より長く取る。\nconst LEAVE_FALLBACK_MS = 500;\n\nexport interface StackedNotification extends NotificationItem {\n /** 退場アニメーション中(notifications からは既に外れているが DOM 上はまだ残す) */\n isLeaving: boolean;\n}\n\n/**\n * store から外れた通知を即座にアンマウントせず、退場アニメーションの間だけ\n * DOM 上に残す(is-leaving クラスでフェードアウトさせるため)。\n */\nexport default function useToastStack(notifications: NotificationItem[]): StackedNotification[] {\n const [leaving, setLeaving] = useState<NotificationItem[]>([]);\n const prevRef = useRef<NotificationItem[]>([]);\n const timersRef = useRef(new Map<string, ReturnType<typeof setTimeout>>());\n\n useEffect(() => {\n const currentIds = new Set(notifications.map((n) => n.id));\n const newlyRemoved = prevRef.current.filter((n) => !currentIds.has(n.id));\n prevRef.current = notifications;\n\n if (newlyRemoved.length === 0) {\n setLeaving((current) => current.filter((n) => !currentIds.has(n.id)));\n return;\n }\n\n setLeaving((current) => [...current.filter((n) => !currentIds.has(n.id)), ...newlyRemoved]);\n newlyRemoved.forEach((notification) => {\n const timer = setTimeout(() => {\n setLeaving((current) => current.filter((n) => n.id !== notification.id));\n timersRef.current.delete(notification.id);\n }, LEAVE_FALLBACK_MS);\n timersRef.current.set(notification.id, timer);\n });\n }, [notifications]);\n\n useEffect(() => {\n const timers = timersRef.current;\n return () => {\n timers.forEach((timer) => clearTimeout(timer));\n timers.clear();\n };\n }, []);\n\n return useMemo(() => {\n const activeIds = new Set(notifications.map((n) => n.id));\n return [\n ...notifications.map((n) => ({ ...n, isLeaving: false })),\n ...leaving.filter((n) => !activeIds.has(n.id)).map((n) => ({ ...n, isLeaving: true })),\n ];\n }, [notifications, leaving]);\n}\n","import { useSyncExternalStore } from 'react';\nimport { dismiss, getSnapshot, pauseAll, resumeAll, subscribe } from './store';\n\nexport default function useNotificationStore() {\n const snapshot = useSyncExternalStore(subscribe, getSnapshot, getSnapshot);\n\n return { snapshot, dismiss, pause: pauseAll, resume: resumeAll };\n}\n"],"mappings":";AAeA,IAAM,iBAA8B,EAAE,OAAO,GAAG,UAAU,IAAK;AAE/D,IAAI,SAAsB,EAAE,GAAG,eAAe;AAC9C,IAAI,UAAkC,CAAC;AACvC,IAAI,QAAgC,CAAC;AACrC,IAAI,SAAS;AACb,IAAI,MAAM;AAGV,IAAM,YAAY,oB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,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACF;AAAA,EAEJ;AAEA,SAAO,gBAAAF,KAAC,aAAU,eAAe,UAAU,SAASE,UAAS,OAAc,QAAgB;AAC7F;AAEA,IAAO,2BAAQ;","names":["useEffect","useEffect","useMemo","useRef","useState","dismiss","useRef","useState","useMemo","useEffect","jsx","useEffect","dismiss"]}
1
+ {"version":3,"sources":["../src/store/store.ts","../src/notify.ts","../src/notify-container.tsx","../src/presenters/toast-presenter.tsx","../src/presenters/use-toast-stack.ts","../src/store/hook.ts"],"sourcesContent":["import { NotificationItem, NotificationOptions } from '../types';\n\ninterface InternalNotification extends NotificationItem {\n duration: number;\n remaining: number;\n startedAt: number;\n timer: ReturnType<typeof setTimeout> | null;\n onClose?: () => void;\n}\n\ninterface StoreConfig {\n limit: number;\n duration: number;\n}\n\nconst DEFAULT_CONFIG: StoreConfig = { limit: 3, duration: 5000 };\n\nlet config: StoreConfig = { ...DEFAULT_CONFIG };\nlet visible: InternalNotification[] = [];\nlet queue: InternalNotification[] = [];\nlet paused = false;\nlet seq = 0;\n\ntype Listener = () => void;\nconst listeners = new Set<Listener>();\n\nfunction emitChange() {\n for (const listener of listeners) {\n listener();\n }\n}\n\nfunction genId(): string {\n seq += 1;\n return `notification-${seq}`;\n}\n\nfunction resolveDuration(type: NotificationOptions['type'], duration: number | undefined): number {\n if (duration !== undefined) return duration;\n return type === 'danger' ? 0 : config.duration;\n}\n\nfunction clearTimer(notification: InternalNotification): void {\n if (notification.timer) {\n clearTimeout(notification.timer);\n notification.timer = null;\n }\n}\n\nfunction startTimer(notification: InternalNotification): void {\n if (notification.duration === 0) return;\n notification.startedAt = Date.now();\n // startTimer -> dismiss -> drainQueue -> startTimer の相互再帰のため、定義順で解決できない\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n notification.timer = setTimeout(() => dismiss(notification.id), Math.max(notification.remaining, 0));\n}\n\nfunction buildInternal(id: string, options: NotificationOptions): InternalNotification {\n const type = options.type ?? 'info';\n const duration = resolveDuration(type, options.duration);\n return {\n id,\n type,\n title: options.title,\n description: options.description,\n closable: options.closable ?? true,\n action: options.action,\n onClose: options.onClose,\n duration,\n remaining: duration,\n startedAt: 0,\n timer: null,\n };\n}\n\nfunction applyOptions(target: InternalNotification, options: NotificationOptions): void {\n target.type = options.type ?? target.type;\n target.title = options.title ?? target.title;\n if ('description' in options) target.description = options.description;\n if ('closable' in options) target.closable = options.closable ?? true;\n if ('action' in options) target.action = options.action;\n if ('onClose' in options) target.onClose = options.onClose;\n target.duration = resolveDuration(target.type, options.duration);\n target.remaining = target.duration;\n}\n\n/** 既存の通知に options をマージした新しいオブジェクトを返す(未指定フィールドは既存値を維持) */\nfunction mergeNotification(existing: InternalNotification, options: NotificationOptions): InternalNotification {\n const next = { ...existing };\n applyOptions(next, options);\n return next;\n}\n\n/** テスト・HMR 用にストア状態を初期化する */\nexport function reset(): void {\n [...visible, ...queue].forEach(clearTimer);\n visible = [];\n queue = [];\n paused = false;\n seq = 0;\n config = { ...DEFAULT_CONFIG };\n}\n\nexport function configure(next: Partial<StoreConfig>): void {\n config = { ...config, ...next };\n}\n\nexport function subscribe(listener: Listener): () => void {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n}\n\nexport function getSnapshot(): NotificationItem[] {\n return visible;\n}\n\nfunction drainQueue(): void {\n while (queue.length > 0 && visible.length < config.limit) {\n const [next, ...rest] = queue;\n queue = rest;\n visible = [...visible, next];\n if (!paused) startTimer(next);\n }\n}\n\nexport function enqueue(options: NotificationOptions): string {\n const id = options.id ?? genId();\n\n const existing = visible.find((n) => n.id === id);\n if (existing) {\n clearTimer(existing);\n applyOptions(existing, options);\n visible = [...visible];\n if (!paused) startTimer(existing);\n emitChange();\n return id;\n }\n\n const queuedIndex = queue.findIndex((n) => n.id === id);\n if (queuedIndex !== -1) {\n queue = queue.map((n, i) => (i === queuedIndex ? mergeNotification(n, options) : n));\n return id;\n }\n\n const notification = buildInternal(id, options);\n if (visible.length >= config.limit) {\n queue = [...queue, notification];\n return id;\n }\n\n visible = [...visible, notification];\n if (!paused) startTimer(notification);\n emitChange();\n return id;\n}\n\nexport function update(id: string, options: NotificationOptions): void {\n const existing = visible.find((n) => n.id === id);\n if (existing) {\n clearTimer(existing);\n applyOptions(existing, options);\n visible = [...visible];\n if (!paused) startTimer(existing);\n emitChange();\n return;\n }\n\n const queuedIndex = queue.findIndex((n) => n.id === id);\n if (queuedIndex !== -1) {\n queue = queue.map((n, i) => (i === queuedIndex ? mergeNotification(n, options) : n));\n }\n}\n\nexport function dismiss(id?: string): void {\n if (id === undefined) {\n const closing = [...visible, ...queue];\n closing.forEach(clearTimer);\n visible = [];\n queue = [];\n emitChange();\n closing.forEach((n) => n.onClose?.());\n return;\n }\n\n const target = visible.find((n) => n.id === id);\n if (target) {\n clearTimer(target);\n visible = visible.filter((n) => n.id !== id);\n drainQueue();\n emitChange();\n target.onClose?.();\n return;\n }\n\n const queuedTarget = queue.find((n) => n.id === id);\n if (queuedTarget) {\n queue = queue.filter((n) => n.id !== id);\n queuedTarget.onClose?.();\n }\n}\n\nexport function pauseAll(): void {\n if (paused) return;\n paused = true;\n visible.forEach((notification) => {\n if (!notification.timer) return;\n clearTimeout(notification.timer);\n notification.timer = null;\n notification.remaining = Math.max(notification.remaining - (Date.now() - notification.startedAt), 0);\n });\n}\n\nexport function resumeAll(): void {\n if (!paused) return;\n paused = false;\n visible.forEach((notification) => {\n if (notification.duration === 0 || notification.timer) return;\n startTimer(notification);\n });\n}\n","import { dismiss as dismissStore, enqueue, update as updateStore } from './store/store';\nimport { NotificationContent, NotificationOptions, NotificationType, NotifyApi, NotifyPromiseMessages } from './types';\n\n// 旧オプション名(autoHide/onHide)を新名称(duration/onClose)へ正規化する。\n// 明示された新名称があればそちらを優先する。\nfunction normalize(options: NotificationOptions): NotificationOptions {\n const { autoHide, onHide, duration, onClose, ...rest } = options;\n return {\n ...rest,\n duration: duration ?? autoHide,\n onClose: onClose ?? onHide,\n };\n}\n\nfunction show(content: NotificationContent, options: NotificationOptions = {}, type?: NotificationType): string {\n const normalized = normalize(options);\n return enqueue({ ...normalized, type: type ?? normalized.type ?? 'info', title: content });\n}\n\nfunction notify(content: NotificationContent, options?: NotificationOptions): string {\n return show(content, options);\n}\n\nnotify.success = (content: NotificationContent, options?: NotificationOptions) => show(content, options, 'success');\nnotify.info = (content: NotificationContent, options?: NotificationOptions) => show(content, options, 'info');\nnotify.warning = (content: NotificationContent, options?: NotificationOptions) => show(content, options, 'warning');\nnotify.danger = (content: NotificationContent, options?: NotificationOptions) => show(content, options, 'danger');\n\nnotify.promise = function promise<T>(promise: Promise<T>, messages: NotifyPromiseMessages<T>): Promise<T> {\n const id = show(messages.loading, { duration: 0, closable: false }, 'info');\n promise.then(\n (data) => {\n const title = typeof messages.success === 'function' ? messages.success(data) : messages.success;\n updateStore(id, { type: 'success', title });\n },\n (error) => {\n const title = typeof messages.error === 'function' ? messages.error(error) : messages.error;\n updateStore(id, { type: 'danger', title });\n }\n );\n return promise;\n};\n\nnotify.update = (id: string, options: NotificationOptions) => updateStore(id, normalize(options));\nnotify.dismiss = (id?: string) => dismissStore(id);\n\nexport default notify as NotifyApi;\n","import { useEffect } from 'react';\nimport ToastPresenter from './presenters/toast-presenter';\nimport { configure } from './store/store';\nimport { useNotificationStore } from './store';\nimport type { NotificationContainerProps } from './types';\n\nfunction NotificationContainer({\n presenter: Presenter = ToastPresenter,\n placement = 'bottom-right',\n limit = 3,\n duration = 5000,\n overlap = true,\n label,\n}: NotificationContainerProps) {\n useEffect(() => {\n configure({ limit, duration });\n }, [limit, duration]);\n\n const { snapshot, dismiss, pause, resume } = useNotificationStore();\n\n // 既定プレゼンター(ToastPresenter)にのみ placement/overlap/label を渡す。\n // NotificationPresenterProps 自体はプレゼンター間で共通の最小契約に留める。\n if (Presenter === ToastPresenter) {\n return (\n <ToastPresenter\n notifications={snapshot}\n dismiss={dismiss}\n pause={pause}\n resume={resume}\n placement={placement}\n overlap={overlap}\n label={label}\n />\n );\n }\n\n return <Presenter notifications={snapshot} dismiss={dismiss} pause={pause} resume={resume} />;\n}\n\nexport default NotificationContainer;\n","import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';\nimport Toast from '@ablogcms/components/toast';\nimport useToastStack from './use-toast-stack';\nimport type { NotificationPresenterProps, ToastPlacement } from '../types';\n\nexport interface ToastPresenterProps extends NotificationPresenterProps {\n /** 既定 bottom-right */\n placement?: ToastPlacement;\n /** 既定 true(Base UI 方式の重なり表示。false で常時リスト展開) */\n overlap?: boolean;\n /** リージョンの aria-label。既定 i18n('notify.region') */\n label?: string;\n}\n\nconst GAP = 8; // 展開時の toast 間隔($acms-spacers 2)\nconst PEEK = 12; // 折りたたみ時に背面がのぞく量\n\nfunction ToastPresenter({\n notifications,\n dismiss,\n pause,\n resume,\n placement = 'bottom-right',\n overlap = true,\n label,\n}: ToastPresenterProps) {\n const regionRef = useRef<HTMLElement>(null);\n const itemRefs = useRef(new Map<string, HTMLDivElement>());\n const [expanded, setExpanded] = useState(false);\n\n const stack = useToastStack(notifications);\n // 最新(配列末尾)が最前面になるよう反転する\n const activeStacked = useMemo(() => stack.filter((n) => !n.isLeaving).reverse(), [stack]);\n const leavingStacked = useMemo(() => stack.filter((n) => n.isLeaving), [stack]);\n\n useLayoutEffect(() => {\n const region = regionRef.current;\n if (!region || !overlap) return;\n\n let offset = 0;\n let frontHeight = 0;\n activeStacked.forEach((item, index) => {\n const el = itemRefs.current.get(item.id);\n if (!el) return;\n // _toast.scss の --acms-toast-* は css-replace-loader により admin バンドルでは\n // --acms-admin-toast-* に変換される。className と同様、ここでも変換後の名前を直接指定する。\n el.style.setProperty('--acms-admin-toast-index', String(index));\n el.style.setProperty('--acms-admin-toast-offset', `${offset}px`);\n el.dataset.front = index === 0 ? 'true' : 'false';\n const height = el.offsetHeight;\n if (index === 0) frontHeight = height;\n offset += height + GAP;\n });\n region.style.setProperty('--acms-admin-toast-front-height', `${frontHeight}px`);\n const totalHeight = expanded\n ? Math.max(offset - GAP, 0)\n : frontHeight + PEEK * Math.max(activeStacked.length - 1, 0);\n region.style.setProperty('--acms-admin-toast-region-height', `${totalHeight}px`);\n }, [activeStacked, expanded, overlap]);\n\n const expand = useCallback(() => {\n pause();\n if (overlap) setExpanded(true);\n }, [pause, overlap]);\n\n const collapse = useCallback(() => {\n resume();\n if (overlap) setExpanded(false);\n }, [resume, overlap]);\n\n const handleBlur = useCallback(\n (event: React.FocusEvent<HTMLElement>) => {\n if (!event.currentTarget.contains(event.relatedTarget as Node | null)) {\n collapse();\n }\n },\n [collapse]\n );\n\n const handleKeyDown = useCallback(\n (event: React.KeyboardEvent<HTMLElement>) => {\n if (event.key === 'Escape' && activeStacked.length > 0) {\n dismiss(activeStacked[0].id);\n }\n },\n [dismiss, activeStacked]\n );\n\n // F6 でリージョンへフォーカス移動(表示中の通知がある場合のみ)\n useEffect(() => {\n function handleGlobalKeyDown(event: KeyboardEvent) {\n if (event.key === 'F6' && notifications.length > 0) {\n event.preventDefault();\n regionRef.current?.focus();\n }\n }\n document.addEventListener('keydown', handleGlobalKeyDown);\n return () => document.removeEventListener('keydown', handleGlobalKeyDown);\n }, [notifications.length]);\n\n return (\n // section は aria-label 付きで暗黙的に role=region を持つ(明示すると redundant-roles で警告される)。\n // ホバー/フォーカスでの pause+展開、Esc での最前面クローズは Sonner / Base UI と同じ「常設ライブ\n // リージョン」パターンの要件で、button/link 化できないため意図的に非対話要素へ付与している。\n // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions\n <section\n ref={regionRef}\n aria-label={label ?? ACMS.i18n('notify.region')}\n tabIndex={-1}\n className=\"acms-admin-toast-region\"\n data-placement={placement}\n data-expanded={overlap ? expanded : true}\n onMouseEnter={expand}\n onMouseLeave={collapse}\n onFocus={expand}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n >\n {activeStacked.map((item, index) => (\n <Toast\n key={item.id}\n ref={(el) => {\n if (el) itemRefs.current.set(item.id, el);\n else itemRefs.current.delete(item.id);\n }}\n type={item.type}\n title={item.title}\n description={item.description}\n closable={item.closable}\n data-front={index === 0}\n // 折りたたみ時、最前面以外は視覚的に隠れる(opacity:0)だけでなく、\n // inert でフォーカス・スクリーンリーダーからも除外する(展開時は解除)\n inert={overlap && !expanded && index !== 0}\n onClose={() => dismiss(item.id)}\n action={\n item.action\n ? {\n label: item.action.label,\n altText: item.action.altText,\n onClick: () => item.action?.onClick({ dismiss: () => dismiss(item.id) }),\n }\n : undefined\n }\n />\n ))}\n {leavingStacked.map((item) => (\n <Toast\n key={item.id}\n className=\"is-leaving\"\n type={item.type}\n title={item.title}\n description={item.description}\n closable={false}\n inert\n />\n ))}\n </section>\n );\n}\n\nexport default ToastPresenter;\n","import { useEffect, useMemo, useRef, useState } from 'react';\nimport type { NotificationItem } from '../types';\n\n// CSS 側の transitionend が来ない環境(prefers-reduced-motion 等)向けの保険。\n// --acms-toast-transition-duration(既定 0.3s)より長く取る。\nconst LEAVE_FALLBACK_MS = 500;\n\nexport interface StackedNotification extends NotificationItem {\n /** 退場アニメーション中(notifications からは既に外れているが DOM 上はまだ残す) */\n isLeaving: boolean;\n}\n\n/**\n * store から外れた通知を即座にアンマウントせず、退場アニメーションの間だけ\n * DOM 上に残す(is-leaving クラスでフェードアウトさせるため)。\n */\nexport default function useToastStack(notifications: NotificationItem[]): StackedNotification[] {\n const [leaving, setLeaving] = useState<NotificationItem[]>([]);\n const prevRef = useRef<NotificationItem[]>([]);\n const timersRef = useRef(new Map<string, ReturnType<typeof setTimeout>>());\n\n useEffect(() => {\n const currentIds = new Set(notifications.map((n) => n.id));\n const newlyRemoved = prevRef.current.filter((n) => !currentIds.has(n.id));\n prevRef.current = notifications;\n\n if (newlyRemoved.length === 0) {\n setLeaving((current) => current.filter((n) => !currentIds.has(n.id)));\n return;\n }\n\n setLeaving((current) => [...current.filter((n) => !currentIds.has(n.id)), ...newlyRemoved]);\n newlyRemoved.forEach((notification) => {\n const timer = setTimeout(() => {\n setLeaving((current) => current.filter((n) => n.id !== notification.id));\n timersRef.current.delete(notification.id);\n }, LEAVE_FALLBACK_MS);\n timersRef.current.set(notification.id, timer);\n });\n }, [notifications]);\n\n useEffect(() => {\n const timers = timersRef.current;\n return () => {\n timers.forEach((timer) => clearTimeout(timer));\n timers.clear();\n };\n }, []);\n\n return useMemo(() => {\n const activeIds = new Set(notifications.map((n) => n.id));\n return [\n ...notifications.map((n) => ({ ...n, isLeaving: false })),\n ...leaving.filter((n) => !activeIds.has(n.id)).map((n) => ({ ...n, isLeaving: true })),\n ];\n }, [notifications, leaving]);\n}\n","import { useSyncExternalStore } from 'react';\nimport { dismiss, getSnapshot, pauseAll, resumeAll, subscribe } from './store';\n\nexport default function useNotificationStore() {\n const snapshot = useSyncExternalStore(subscribe, getSnapshot, getSnapshot);\n\n return { snapshot, dismiss, pause: pauseAll, resume: resumeAll };\n}\n"],"mappings":";AAeA,IAAM,iBAA8B,EAAE,OAAO,GAAG,UAAU,IAAK;AAE/D,IAAI,SAAsB,EAAE,GAAG,eAAe;AAC9C,IAAI,UAAkC,CAAC;AACvC,IAAI,QAAgC,CAAC;AACrC,IAAI,SAAS;AACb,IAAI,MAAM;AAGV,IAAM,YAAY,oBAAI,IAAc;AAEpC,SAAS,aAAa;AACpB,aAAW,YAAY,WAAW;AAChC,aAAS;AAAA,EACX;AACF;AAEA,SAAS,QAAgB;AACvB,SAAO;AACP,SAAO,gBAAgB,GAAG;AAC5B;AAEA,SAAS,gBAAgB,MAAmC,UAAsC;AAChG,MAAI,aAAa,OAAW,QAAO;AACnC,SAAO,SAAS,WAAW,IAAI,OAAO;AACxC;AAEA,SAAS,WAAW,cAA0C;AAC5D,MAAI,aAAa,OAAO;AACtB,iBAAa,aAAa,KAAK;AAC/B,iBAAa,QAAQ;AAAA,EACvB;AACF;AAEA,SAAS,WAAW,cAA0C;AAC5D,MAAI,aAAa,aAAa,EAAG;AACjC,eAAa,YAAY,KAAK,IAAI;AAGlC,eAAa,QAAQ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K;AAAA,cACZ,aAAa,KAAK;AAAA,cAClB,UAAU;AAAA,cACV,OAAK;AAAA;AAAA,YANA,KAAK;AAAA,UAOZ,CACD;AAAA;AAAA;AAAA,IACH;AAAA;AAEJ;AAEA,IAAO,0BAAQ;;;AEhKf,SAAS,4BAA4B;AAGtB,SAAR,uBAAwC;AAC7C,QAAM,WAAW,qBAAqB,WAAW,aAAa,WAAW;AAEzE,SAAO,EAAE,UAAU,SAAS,OAAO,UAAU,QAAQ,UAAU;AACjE;;;AHiBM,gBAAAK,YAAA;AAlBN,SAAS,sBAAsB;AAAA,EAC7B,WAAW,YAAY;AAAA,EACvB,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,UAAU;AAAA,EACV;AACF,GAA+B;AAC7B,EAAAC,WAAU,MAAM;AACd,cAAU,EAAE,OAAO,SAAS,CAAC;AAAA,EAC/B,GAAG,CAAC,OAAO,QAAQ,CAAC;AAEpB,QAAM,EAAE,UAAU,SAAAC,UAAS,OAAO,OAAO,IAAI,qBAAqB;AAIlE,MAAI,cAAc,yBAAgB;AAChC,WACE,gBAAAF;AAAA,MAAC;AAAA;AAAA,QACC,eAAe;AAAA,QACf,SAASE;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACF;AAAA,EAEJ;AAEA,SAAO,gBAAAF,KAAC,aAAU,eAAe,UAAU,SAASE,UAAS,OAAc,QAAgB;AAC7F;AAEA,IAAO,2BAAQ;","names":["useEffect","useEffect","useMemo","useRef","useState","dismiss","useRef","useState","useMemo","useEffect","jsx","useEffect","dismiss"]}
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@ablogcms/notify",
3
- "version": "3.2.28-beta.0",
3
+ "version": "3.2.30",
4
4
  "type": "module",
5
- "description": "管理画面のトースト通知状態管理",
5
+ "description": "Toast notification state management for a-blog cms admin UI",
6
6
  "license": "MIT",
7
7
  "homepage": "https://www.a-blogcms.jp",
8
8
  "repository": {
@@ -12,16 +12,16 @@
12
12
  },
13
13
  "sideEffects": false,
14
14
  "dependencies": {
15
- "@ablogcms/components": "3.2.28-beta.0",
16
- "@ablogcms/types": "3.2.28-beta.0"
15
+ "@ablogcms/components": "3.2.30",
16
+ "@ablogcms/types": "3.2.30"
17
17
  },
18
18
  "devDependencies": {
19
19
  "@testing-library/react": "^16.3.2",
20
- "vitest": "^4.1.9"
20
+ "vitest": "^4.1.10"
21
21
  },
22
22
  "peerDependencies": {
23
23
  "react": "^19",
24
- "@types/react": "^19.2.17"
24
+ "@types/react": "^19.2.18"
25
25
  },
26
26
  "peerDependenciesMeta": {
27
27
  "@types/react": {