@ihabdevteam/core 0.8.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/README.md +591 -0
- package/dist/components.cjs.css +19 -0
- package/dist/components.cjs.js +975 -0
- package/dist/components.esm.css +19 -0
- package/dist/components.esm.js +975 -0
- package/dist/hooks.cjs.css +1 -0
- package/dist/hooks.cjs.js +799 -0
- package/dist/hooks.esm.css +1 -0
- package/dist/hooks.esm.js +799 -0
- package/dist/ihabdevteam-core-tokens.css +1 -0
- package/dist/ihabdevteam-core.cjs.js +993 -0
- package/dist/ihabdevteam-core.css +1 -0
- package/dist/ihabdevteam-core.d.ts +8272 -0
- package/dist/ihabdevteam-core.esm.js +993 -0
- package/dist/logo/Logo_APEB.svg +53 -0
- package/dist/logo/Logo_APEB_black.svg +42 -0
- package/dist/logo/Logo_APEB_white.svg +42 -0
- package/dist/logo/Logo_HTP_kr.svg +21 -0
- package/dist/logo/Logo_HTP_kr_black.svg +17 -0
- package/dist/logo/Logo_HTP_kr_white.svg +17 -0
- package/dist/logo/Logo_IHAB_en.svg +18 -0
- package/dist/logo/Logo_IHAB_en_black.svg +14 -0
- package/dist/logo/Logo_IHAB_en_white.svg +14 -0
- package/dist/logo/Logo_IHAB_kr.svg +18 -0
- package/dist/logo/Logo_IHAB_kr_black.svg +14 -0
- package/dist/logo/Logo_IHAB_kr_white.svg +14 -0
- package/dist/logo/Logo_SDS_kr.svg +22 -0
- package/dist/logo/Logo_SDS_kr_black.svg +18 -0
- package/dist/logo/Logo_SDS_kr_white.svg +18 -0
- package/dist/logo/Logo_speechearManager_kr.svg +20 -0
- package/dist/logo/Logo_speechearManager_kr_black.svg +21 -0
- package/dist/logo/Logo_speechearManager_kr_textWhite.svg +45 -0
- package/dist/logo/Logo_speechearManager_kr_white.svg +21 -0
- package/dist/logo/Logo_speechear_kr.svg +17 -0
- package/dist/logo/Logo_speechear_kr_black.svg +16 -0
- package/dist/logo/Logo_speechear_kr_textWhite.svg +42 -0
- package/dist/logo/Logo_speechear_kr_white.svg +16 -0
- package/dist/logo/Symbol_APEB.svg +34 -0
- package/dist/logo/Symbol_APEB_black.svg +15 -0
- package/dist/logo/Symbol_APEB_white.svg +15 -0
- package/dist/logo/Symbol_HTP.svg +14 -0
- package/dist/logo/Symbol_HTP_black.svg +10 -0
- package/dist/logo/Symbol_HTP_white.svg +10 -0
- package/dist/logo/Symbol_IHAB.svg +14 -0
- package/dist/logo/Symbol_IHAB_black.svg +10 -0
- package/dist/logo/Symbol_IHAB_white.svg +10 -0
- package/dist/logo/Symbol_SDS.svg +14 -0
- package/dist/logo/Symbol_SDS_black.svg +10 -0
- package/dist/logo/Symbol_SDS_white.svg +10 -0
- package/dist/logo/Symbol_speechear.svg +15 -0
- package/dist/logo/Symbol_speechear_black.svg +16 -0
- package/dist/logo/Symbol_speechear_white.svg +16 -0
- package/dist/logo/qr_speechear.svg +1 -0
- package/dist/packages/core/src/CoreScope.d.ts +40 -0
- package/dist/packages/core/src/CoreScope.js +19 -0
- package/dist/packages/core/src/components/Accordion.css +125 -0
- package/dist/packages/core/src/components/Accordion.d.ts +19 -0
- package/dist/packages/core/src/components/Accordion.js +33 -0
- package/dist/packages/core/src/components/ActionCard.css +109 -0
- package/dist/packages/core/src/components/ActionCard.d.ts +33 -0
- package/dist/packages/core/src/components/ActionCard.js +28 -0
- package/dist/packages/core/src/components/Alert.css +76 -0
- package/dist/packages/core/src/components/Alert.d.ts +18 -0
- package/dist/packages/core/src/components/Alert.js +28 -0
- package/dist/packages/core/src/components/AudioMeter.css +80 -0
- package/dist/packages/core/src/components/AudioMeter.d.ts +49 -0
- package/dist/packages/core/src/components/AudioMeter.js +91 -0
- package/dist/packages/core/src/components/Avatar.css +42 -0
- package/dist/packages/core/src/components/Avatar.d.ts +21 -0
- package/dist/packages/core/src/components/Avatar.js +31 -0
- package/dist/packages/core/src/components/Badge.css +166 -0
- package/dist/packages/core/src/components/Badge.d.ts +82 -0
- package/dist/packages/core/src/components/Badge.js +62 -0
- package/dist/packages/core/src/components/BarChart.css +142 -0
- package/dist/packages/core/src/components/BarChart.d.ts +16 -0
- package/dist/packages/core/src/components/BarChart.js +187 -0
- package/dist/packages/core/src/components/Board.css +85 -0
- package/dist/packages/core/src/components/Board.d.ts +39 -0
- package/dist/packages/core/src/components/Board.js +12 -0
- package/dist/packages/core/src/components/BottomNav.css +105 -0
- package/dist/packages/core/src/components/BottomNav.d.ts +32 -0
- package/dist/packages/core/src/components/BottomNav.js +92 -0
- package/dist/packages/core/src/components/Breadcrumb.css +62 -0
- package/dist/packages/core/src/components/Breadcrumb.d.ts +13 -0
- package/dist/packages/core/src/components/Breadcrumb.js +10 -0
- package/dist/packages/core/src/components/BulkBar.css +75 -0
- package/dist/packages/core/src/components/BulkBar.d.ts +22 -0
- package/dist/packages/core/src/components/BulkBar.js +40 -0
- package/dist/packages/core/src/components/Button.css +655 -0
- package/dist/packages/core/src/components/Button.d.ts +5 -0
- package/dist/packages/core/src/components/Button.js +202 -0
- package/dist/packages/core/src/components/Calendar.css +249 -0
- package/dist/packages/core/src/components/Calendar.d.ts +23 -0
- package/dist/packages/core/src/components/Calendar.js +92 -0
- package/dist/packages/core/src/components/ChartSection.css +191 -0
- package/dist/packages/core/src/components/ChartSection.d.ts +42 -0
- package/dist/packages/core/src/components/ChartSection.js +22 -0
- package/dist/packages/core/src/components/Checkbox.css +94 -0
- package/dist/packages/core/src/components/Checkbox.d.ts +16 -0
- package/dist/packages/core/src/components/Checkbox.js +15 -0
- package/dist/packages/core/src/components/ChoiceChips.css +65 -0
- package/dist/packages/core/src/components/ChoiceChips.d.ts +15 -0
- package/dist/packages/core/src/components/ChoiceChips.js +8 -0
- package/dist/packages/core/src/components/CircleBadge.d.ts +31 -0
- package/dist/packages/core/src/components/CircleBadge.js +20 -0
- package/dist/packages/core/src/components/CodeBox.css +62 -0
- package/dist/packages/core/src/components/CodeBox.d.ts +18 -0
- package/dist/packages/core/src/components/CodeBox.js +132 -0
- package/dist/packages/core/src/components/ColorPicker.css +40 -0
- package/dist/packages/core/src/components/ColorPicker.d.ts +17 -0
- package/dist/packages/core/src/components/ColorPicker.js +23 -0
- package/dist/packages/core/src/components/CompanyMeta.css +33 -0
- package/dist/packages/core/src/components/CompanyMeta.d.ts +14 -0
- package/dist/packages/core/src/components/CompanyMeta.js +12 -0
- package/dist/packages/core/src/components/CountTile.css +47 -0
- package/dist/packages/core/src/components/CountTile.d.ts +22 -0
- package/dist/packages/core/src/components/CountTile.js +24 -0
- package/dist/packages/core/src/components/DatePicker.css +151 -0
- package/dist/packages/core/src/components/DatePicker.d.ts +13 -0
- package/dist/packages/core/src/components/DatePicker.js +107 -0
- package/dist/packages/core/src/components/Dialog.css +98 -0
- package/dist/packages/core/src/components/Dialog.d.ts +31 -0
- package/dist/packages/core/src/components/Dialog.js +51 -0
- package/dist/packages/core/src/components/Divider.css +33 -0
- package/dist/packages/core/src/components/Divider.d.ts +13 -0
- package/dist/packages/core/src/components/Divider.js +14 -0
- package/dist/packages/core/src/components/Dropdown.css +175 -0
- package/dist/packages/core/src/components/Dropdown.d.ts +23 -0
- package/dist/packages/core/src/components/Dropdown.js +117 -0
- package/dist/packages/core/src/components/Effect/EffectPartyPopper.css +25 -0
- package/dist/packages/core/src/components/Effect/EffectPartyPopper.d.ts +11 -0
- package/dist/packages/core/src/components/Effect/EffectPartyPopper.js +298 -0
- package/dist/packages/core/src/components/Effect/EffectPartyPopperHost.d.ts +5 -0
- package/dist/packages/core/src/components/Effect/EffectPartyPopperHost.js +13 -0
- package/dist/packages/core/src/components/EmptyState.css +23 -0
- package/dist/packages/core/src/components/EmptyState.d.ts +19 -0
- package/dist/packages/core/src/components/EmptyState.js +7 -0
- package/dist/packages/core/src/components/ErrorState.css +2 -0
- package/dist/packages/core/src/components/ErrorState.d.ts +18 -0
- package/dist/packages/core/src/components/ErrorState.js +11 -0
- package/dist/packages/core/src/components/FileUpload.css +114 -0
- package/dist/packages/core/src/components/FileUpload.d.ts +25 -0
- package/dist/packages/core/src/components/FileUpload.js +111 -0
- package/dist/packages/core/src/components/FilterPanel.css +188 -0
- package/dist/packages/core/src/components/FilterPanel.d.ts +34 -0
- package/dist/packages/core/src/components/FilterPanel.js +82 -0
- package/dist/packages/core/src/components/FilterSectionInfo.d.ts +12 -0
- package/dist/packages/core/src/components/FilterSectionInfo.js +15 -0
- package/dist/packages/core/src/components/Footer.css +186 -0
- package/dist/packages/core/src/components/Footer.d.ts +18 -0
- package/dist/packages/core/src/components/Footer.js +19 -0
- package/dist/packages/core/src/components/Header.css +274 -0
- package/dist/packages/core/src/components/Header.d.ts +44 -0
- package/dist/packages/core/src/components/Header.js +98 -0
- package/dist/packages/core/src/components/HearingDeviceInfo.css +48 -0
- package/dist/packages/core/src/components/HearingDeviceInfo.d.ts +22 -0
- package/dist/packages/core/src/components/HearingDeviceInfo.js +13 -0
- package/dist/packages/core/src/components/Icon.d.ts +14 -0
- package/dist/packages/core/src/components/Icon.js +73 -0
- package/dist/packages/core/src/components/IconGridMenu.css +141 -0
- package/dist/packages/core/src/components/IconGridMenu.d.ts +20 -0
- package/dist/packages/core/src/components/IconGridMenu.js +45 -0
- package/dist/packages/core/src/components/LandingBottomSticky.css +114 -0
- package/dist/packages/core/src/components/LandingBottomSticky.d.ts +26 -0
- package/dist/packages/core/src/components/LandingBottomSticky.js +20 -0
- package/dist/packages/core/src/components/LandingHeader.css +192 -0
- package/dist/packages/core/src/components/LandingHeader.d.ts +67 -0
- package/dist/packages/core/src/components/LandingHeader.js +40 -0
- package/dist/packages/core/src/components/Loader.css +88 -0
- package/dist/packages/core/src/components/Loader.d.ts +14 -0
- package/dist/packages/core/src/components/Loader.js +12 -0
- package/dist/packages/core/src/components/NoticeBox.css +79 -0
- package/dist/packages/core/src/components/NoticeBox.d.ts +21 -0
- package/dist/packages/core/src/components/NoticeBox.js +19 -0
- package/dist/packages/core/src/components/PageTitle.css +27 -0
- package/dist/packages/core/src/components/PageTitle.d.ts +23 -0
- package/dist/packages/core/src/components/PageTitle.js +10 -0
- package/dist/packages/core/src/components/Pagination.css +11 -0
- package/dist/packages/core/src/components/Pagination.d.ts +22 -0
- package/dist/packages/core/src/components/Pagination.js +20 -0
- package/dist/packages/core/src/components/Panel.css +361 -0
- package/dist/packages/core/src/components/Panel.d.ts +166 -0
- package/dist/packages/core/src/components/Panel.js +162 -0
- package/dist/packages/core/src/components/PassCard/PassCard.css +289 -0
- package/dist/packages/core/src/components/PassCard/PassCard.d.ts +56 -0
- package/dist/packages/core/src/components/PassCard/PassCard.js +313 -0
- package/dist/packages/core/src/components/PassCard/PassCardBg.css +39 -0
- package/dist/packages/core/src/components/PassCard/PassCardBg.d.ts +8 -0
- package/dist/packages/core/src/components/PassCard/PassCardBg.js +6 -0
- package/dist/packages/core/src/components/PassCard/PassCardBgIHAB.css +25 -0
- package/dist/packages/core/src/components/PassCard/PassCardBgIHAB.d.ts +7 -0
- package/dist/packages/core/src/components/PassCard/PassCardBgIHAB.js +18 -0
- package/dist/packages/core/src/components/PassCard/PassCardBgLeftColorGrid.css +45 -0
- package/dist/packages/core/src/components/PassCard/PassCardBgLeftColorGrid.d.ts +9 -0
- package/dist/packages/core/src/components/PassCard/PassCardBgLeftColorGrid.js +19 -0
- package/dist/packages/core/src/components/PassCard/PassCardBgSoundLine.css +19 -0
- package/dist/packages/core/src/components/PassCard/PassCardBgSoundLine.d.ts +9 -0
- package/dist/packages/core/src/components/PassCard/PassCardBgSoundLine.js +23 -0
- package/dist/packages/core/src/components/PassCard/PassCardBgSoundLineV1.css +15 -0
- package/dist/packages/core/src/components/PassCard/PassCardBgSoundLineV1.d.ts +9 -0
- package/dist/packages/core/src/components/PassCard/PassCardBgSoundLineV1.js +24 -0
- package/dist/packages/core/src/components/PassCard/PassCardBgSoundMove.css +16 -0
- package/dist/packages/core/src/components/PassCard/PassCardBgSoundMove.d.ts +9 -0
- package/dist/packages/core/src/components/PassCard/PassCardBgSoundMove.js +31 -0
- package/dist/packages/core/src/components/PassCard/PassCardBgSoundMoveV1.css +16 -0
- package/dist/packages/core/src/components/PassCard/PassCardBgSoundMoveV1.d.ts +9 -0
- package/dist/packages/core/src/components/PassCard/PassCardBgSoundMoveV1.js +32 -0
- package/dist/packages/core/src/components/PassCard/PassCardBgTalk.css +33 -0
- package/dist/packages/core/src/components/PassCard/PassCardBgTalk.d.ts +9 -0
- package/dist/packages/core/src/components/PassCard/PassCardBgTalk.js +18 -0
- package/dist/packages/core/src/components/PassCard/PassCardBgTalkV1.css +36 -0
- package/dist/packages/core/src/components/PassCard/PassCardBgTalkV1.d.ts +13 -0
- package/dist/packages/core/src/components/PassCard/PassCardBgTalkV1.js +22 -0
- package/dist/packages/core/src/components/PassCard/PassCardBgTheme.d.ts +38 -0
- package/dist/packages/core/src/components/PassCard/PassCardBgTheme.js +34 -0
- package/dist/packages/core/src/components/PassCard/PassCardBgTwoCircle.css +36 -0
- package/dist/packages/core/src/components/PassCard/PassCardBgTwoCircle.d.ts +9 -0
- package/dist/packages/core/src/components/PassCard/PassCardBgTwoCircle.js +18 -0
- package/dist/packages/core/src/components/PassCard/PassCard_Back.css +76 -0
- package/dist/packages/core/src/components/PassCard/PassCard_Back.d.ts +13 -0
- package/dist/packages/core/src/components/PassCard/PassCard_Back.js +20 -0
- package/dist/packages/core/src/components/PassCard/ihabOutlinePath.d.ts +12 -0
- package/dist/packages/core/src/components/PassCard/ihabOutlinePath.js +19 -0
- package/dist/packages/core/src/components/PassCard/passCardProduct.d.ts +48 -0
- package/dist/packages/core/src/components/PassCard/passCardProduct.js +56 -0
- package/dist/packages/core/src/components/PaymentPlan.css +318 -0
- package/dist/packages/core/src/components/PaymentPlan.d.ts +57 -0
- package/dist/packages/core/src/components/PaymentPlan.js +126 -0
- package/dist/packages/core/src/components/PersonCard.css +72 -0
- package/dist/packages/core/src/components/PersonCard.d.ts +27 -0
- package/dist/packages/core/src/components/PersonCard.js +11 -0
- package/dist/packages/core/src/components/Popup/ConfirmPopup.d.ts +58 -0
- package/dist/packages/core/src/components/Popup/ConfirmPopup.js +59 -0
- package/dist/packages/core/src/components/Popup/CouponInputPopup.css +28 -0
- package/dist/packages/core/src/components/Popup/CouponInputPopup.d.ts +8 -0
- package/dist/packages/core/src/components/Popup/CouponInputPopup.js +45 -0
- package/dist/packages/core/src/components/Popup/DeviceListPopup.css +78 -0
- package/dist/packages/core/src/components/Popup/DeviceListPopup.d.ts +28 -0
- package/dist/packages/core/src/components/Popup/DeviceListPopup.js +31 -0
- package/dist/packages/core/src/components/Popup/DeviceSideTable.d.ts +41 -0
- package/dist/packages/core/src/components/Popup/DeviceSideTable.js +92 -0
- package/dist/packages/core/src/components/Popup/ListPopup.css +44 -0
- package/dist/packages/core/src/components/Popup/ListPopup.d.ts +75 -0
- package/dist/packages/core/src/components/Popup/ListPopup.js +85 -0
- package/dist/packages/core/src/components/Popup/LoadTablePopup.css +248 -0
- package/dist/packages/core/src/components/Popup/LoadTablePopup.d.ts +12 -0
- package/dist/packages/core/src/components/Popup/LoadTablePopup.js +86 -0
- package/dist/packages/core/src/components/Popup/Popup.css +136 -0
- package/dist/packages/core/src/components/Popup/Popup.d.ts +77 -0
- package/dist/packages/core/src/components/Popup/Popup.js +135 -0
- package/dist/packages/core/src/components/Popup/SaveTablePopup.css +32 -0
- package/dist/packages/core/src/components/Popup/SaveTablePopup.d.ts +25 -0
- package/dist/packages/core/src/components/Popup/SaveTablePopup.js +55 -0
- package/dist/packages/core/src/components/Popup/TrainingResultPopup.css +277 -0
- package/dist/packages/core/src/components/Popup/TrainingResultPopup.d.ts +14 -0
- package/dist/packages/core/src/components/Popup/TrainingResultPopup.js +104 -0
- package/dist/packages/core/src/components/Popup/WordDataUpdatePopup.css +119 -0
- package/dist/packages/core/src/components/Popup/WordDataUpdatePopup.d.ts +12 -0
- package/dist/packages/core/src/components/Popup/WordDataUpdatePopup.js +73 -0
- package/dist/packages/core/src/components/Popup/customerDetailUtils.d.ts +19 -0
- package/dist/packages/core/src/components/Popup/customerDetailUtils.js +45 -0
- package/dist/packages/core/src/components/ProgressBar.css +114 -0
- package/dist/packages/core/src/components/ProgressBar.d.ts +65 -0
- package/dist/packages/core/src/components/ProgressBar.js +51 -0
- package/dist/packages/core/src/components/ProgressIndicator.css +41 -0
- package/dist/packages/core/src/components/ProgressIndicator.d.ts +18 -0
- package/dist/packages/core/src/components/ProgressIndicator.js +45 -0
- package/dist/packages/core/src/components/PromoBanner.css +54 -0
- package/dist/packages/core/src/components/PromoBanner.d.ts +30 -0
- package/dist/packages/core/src/components/PromoBanner.js +54 -0
- package/dist/packages/core/src/components/PromoBannerBg/PromoBannerBg.css +8 -0
- package/dist/packages/core/src/components/PromoBannerBg/PromoBannerBgDark.css +3 -0
- package/dist/packages/core/src/components/PromoBannerBg/PromoBannerBgDark.d.ts +11 -0
- package/dist/packages/core/src/components/PromoBannerBg/PromoBannerBgDark.js +20 -0
- package/dist/packages/core/src/components/PromoBannerBg/PromoBannerBgDeep.css +3 -0
- package/dist/packages/core/src/components/PromoBannerBg/PromoBannerBgDeep.d.ts +10 -0
- package/dist/packages/core/src/components/PromoBannerBg/PromoBannerBgDeep.js +19 -0
- package/dist/packages/core/src/components/PromoBannerBg/PromoBannerBgDiagonal.css +10 -0
- package/dist/packages/core/src/components/PromoBannerBg/PromoBannerBgDiagonal.d.ts +10 -0
- package/dist/packages/core/src/components/PromoBannerBg/PromoBannerBgDiagonal.js +19 -0
- package/dist/packages/core/src/components/PromoBannerBg/PromoBannerBgDots.css +5 -0
- package/dist/packages/core/src/components/PromoBannerBg/PromoBannerBgDots.d.ts +10 -0
- package/dist/packages/core/src/components/PromoBannerBg/PromoBannerBgDots.js +19 -0
- package/dist/packages/core/src/components/PromoBannerBg/PromoBannerBgInstagram.css +3 -0
- package/dist/packages/core/src/components/PromoBannerBg/PromoBannerBgInstagram.d.ts +11 -0
- package/dist/packages/core/src/components/PromoBannerBg/PromoBannerBgInstagram.js +20 -0
- package/dist/packages/core/src/components/PromoBannerBg/PromoBannerBgMain.css +3 -0
- package/dist/packages/core/src/components/PromoBannerBg/PromoBannerBgMain.d.ts +12 -0
- package/dist/packages/core/src/components/PromoBannerBg/PromoBannerBgMain.js +21 -0
- package/dist/packages/core/src/components/PromoBannerBg/PromoBannerBgNaver.css +3 -0
- package/dist/packages/core/src/components/PromoBannerBg/PromoBannerBgNaver.d.ts +11 -0
- package/dist/packages/core/src/components/PromoBannerBg/PromoBannerBgNaver.js +20 -0
- package/dist/packages/core/src/components/PromoBannerBg/PromoBannerBgOutline.css +16 -0
- package/dist/packages/core/src/components/PromoBannerBg/PromoBannerBgOutline.d.ts +11 -0
- package/dist/packages/core/src/components/PromoBannerBg/PromoBannerBgOutline.js +20 -0
- package/dist/packages/core/src/components/PromoBannerBg/PromoBannerBgRadial.css +3 -0
- package/dist/packages/core/src/components/PromoBannerBg/PromoBannerBgRadial.d.ts +10 -0
- package/dist/packages/core/src/components/PromoBannerBg/PromoBannerBgRadial.js +19 -0
- package/dist/packages/core/src/components/PromoBannerBg/PromoBannerBgSoft.css +3 -0
- package/dist/packages/core/src/components/PromoBannerBg/PromoBannerBgSoft.d.ts +12 -0
- package/dist/packages/core/src/components/PromoBannerBg/PromoBannerBgSoft.js +21 -0
- package/dist/packages/core/src/components/PromoBannerBg/PromoBannerBgSoftSub.css +3 -0
- package/dist/packages/core/src/components/PromoBannerBg/PromoBannerBgSoftSub.d.ts +10 -0
- package/dist/packages/core/src/components/PromoBannerBg/PromoBannerBgSoftSub.js +19 -0
- package/dist/packages/core/src/components/PromoBannerBg/PromoBannerBgSub.css +3 -0
- package/dist/packages/core/src/components/PromoBannerBg/PromoBannerBgSub.d.ts +10 -0
- package/dist/packages/core/src/components/PromoBannerBg/PromoBannerBgSub.js +19 -0
- package/dist/packages/core/src/components/PromoBannerBg/PromoBannerBgSuccess.css +3 -0
- package/dist/packages/core/src/components/PromoBannerBg/PromoBannerBgSuccess.d.ts +11 -0
- package/dist/packages/core/src/components/PromoBannerBg/PromoBannerBgSuccess.js +20 -0
- package/dist/packages/core/src/components/PromoBannerBg/PromoBannerBgTheme.d.ts +32 -0
- package/dist/packages/core/src/components/PromoBannerBg/PromoBannerBgTheme.js +29 -0
- package/dist/packages/core/src/components/PromoBannerBg/PromoBannerBgWarm.css +3 -0
- package/dist/packages/core/src/components/PromoBannerBg/PromoBannerBgWarm.d.ts +11 -0
- package/dist/packages/core/src/components/PromoBannerBg/PromoBannerBgWarm.js +20 -0
- package/dist/packages/core/src/components/PromoBannerBg/promoBannerBg.d.ts +21 -0
- package/dist/packages/core/src/components/PromoBannerBg/promoBannerBg.js +49 -0
- package/dist/packages/core/src/components/PublicationCard.css +70 -0
- package/dist/packages/core/src/components/PublicationCard.d.ts +31 -0
- package/dist/packages/core/src/components/PublicationCard.js +11 -0
- package/dist/packages/core/src/components/Radio.css +64 -0
- package/dist/packages/core/src/components/Radio.d.ts +13 -0
- package/dist/packages/core/src/components/Radio.js +9 -0
- package/dist/packages/core/src/components/RadioGroup.css +14 -0
- package/dist/packages/core/src/components/RadioGroup.d.ts +21 -0
- package/dist/packages/core/src/components/RadioGroup.js +14 -0
- package/dist/packages/core/src/components/Rating.css +69 -0
- package/dist/packages/core/src/components/Rating.d.ts +21 -0
- package/dist/packages/core/src/components/Rating.js +51 -0
- package/dist/packages/core/src/components/RingChart.css +50 -0
- package/dist/packages/core/src/components/RingChart.d.ts +68 -0
- package/dist/packages/core/src/components/RingChart.js +57 -0
- package/dist/packages/core/src/components/SearchSummary.css +62 -0
- package/dist/packages/core/src/components/SearchSummary.d.ts +32 -0
- package/dist/packages/core/src/components/SearchSummary.js +48 -0
- package/dist/packages/core/src/components/Section.css +73 -0
- package/dist/packages/core/src/components/Section.d.ts +16 -0
- package/dist/packages/core/src/components/Section.js +15 -0
- package/dist/packages/core/src/components/SectionHeader.css +87 -0
- package/dist/packages/core/src/components/SectionHeader.d.ts +31 -0
- package/dist/packages/core/src/components/SectionHeader.js +16 -0
- package/dist/packages/core/src/components/SegmentedControl.css +67 -0
- package/dist/packages/core/src/components/SegmentedControl.d.ts +26 -0
- package/dist/packages/core/src/components/SegmentedControl.js +13 -0
- package/dist/packages/core/src/components/ShortcutBadge.css +68 -0
- package/dist/packages/core/src/components/ShortcutBadge.d.ts +31 -0
- package/dist/packages/core/src/components/ShortcutBadge.js +23 -0
- package/dist/packages/core/src/components/SideNav.css +281 -0
- package/dist/packages/core/src/components/SideNav.d.ts +32 -0
- package/dist/packages/core/src/components/SideNav.js +92 -0
- package/dist/packages/core/src/components/Slider.css +184 -0
- package/dist/packages/core/src/components/Slider.d.ts +67 -0
- package/dist/packages/core/src/components/Slider.js +97 -0
- package/dist/packages/core/src/components/SoundCompass.css +138 -0
- package/dist/packages/core/src/components/SoundCompass.d.ts +42 -0
- package/dist/packages/core/src/components/SoundCompass.js +136 -0
- package/dist/packages/core/src/components/SplashLogo.css +32 -0
- package/dist/packages/core/src/components/SplashLogo.d.ts +35 -0
- package/dist/packages/core/src/components/SplashLogo.js +32 -0
- package/dist/packages/core/src/components/StatChart.css +83 -0
- package/dist/packages/core/src/components/StatChart.d.ts +26 -0
- package/dist/packages/core/src/components/StatChart.js +41 -0
- package/dist/packages/core/src/components/Table.css +158 -0
- package/dist/packages/core/src/components/Table.d.ts +94 -0
- package/dist/packages/core/src/components/Table.js +200 -0
- package/dist/packages/core/src/components/TableCell.css +12 -0
- package/dist/packages/core/src/components/TableField.css +60 -0
- package/dist/packages/core/src/components/Tabs.css +55 -0
- package/dist/packages/core/src/components/Tabs.d.ts +30 -0
- package/dist/packages/core/src/components/Tabs.js +55 -0
- package/dist/packages/core/src/components/TextField.css +266 -0
- package/dist/packages/core/src/components/TextField.d.ts +86 -0
- package/dist/packages/core/src/components/TextField.js +149 -0
- package/dist/packages/core/src/components/Timeline.css +62 -0
- package/dist/packages/core/src/components/Timeline.d.ts +26 -0
- package/dist/packages/core/src/components/Timeline.js +11 -0
- package/dist/packages/core/src/components/Toast.css +76 -0
- package/dist/packages/core/src/components/Toast.d.ts +10 -0
- package/dist/packages/core/src/components/Toast.js +19 -0
- package/dist/packages/core/src/components/Toggle.css +61 -0
- package/dist/packages/core/src/components/Toggle.d.ts +18 -0
- package/dist/packages/core/src/components/Toggle.js +7 -0
- package/dist/packages/core/src/components/Toolbar.css +86 -0
- package/dist/packages/core/src/components/Toolbar.d.ts +52 -0
- package/dist/packages/core/src/components/Toolbar.js +20 -0
- package/dist/packages/core/src/components/Tooltip/DebugTooltip.css +27 -0
- package/dist/packages/core/src/components/Tooltip/DebugTooltip.d.ts +12 -0
- package/dist/packages/core/src/components/Tooltip/DebugTooltip.js +79 -0
- package/dist/packages/core/src/components/Tooltip/DescriptionTooltip.css +50 -0
- package/dist/packages/core/src/components/Tooltip/DescriptionTooltip.d.ts +16 -0
- package/dist/packages/core/src/components/Tooltip/DescriptionTooltip.js +11 -0
- package/dist/packages/core/src/components/Tooltip/InfoTooltip.css +39 -0
- package/dist/packages/core/src/components/Tooltip/InfoTooltip.d.ts +13 -0
- package/dist/packages/core/src/components/Tooltip/InfoTooltip.js +10 -0
- package/dist/packages/core/src/components/Tooltip/MenuTooltip.css +93 -0
- package/dist/packages/core/src/components/Tooltip/MenuTooltip.d.ts +30 -0
- package/dist/packages/core/src/components/Tooltip/MenuTooltip.js +92 -0
- package/dist/packages/core/src/components/Tooltip/TextBoxTooltip.css +95 -0
- package/dist/packages/core/src/components/Tooltip/TextBoxTooltip.d.ts +13 -0
- package/dist/packages/core/src/components/Tooltip/TextBoxTooltip.js +55 -0
- package/dist/packages/core/src/components/Tooltip/Tooltip.css +120 -0
- package/dist/packages/core/src/components/Tooltip/Tooltip.d.ts +25 -0
- package/dist/packages/core/src/components/Tooltip/Tooltip.js +296 -0
- package/dist/packages/core/src/components/Tooltip/TrainingTooltip.css +67 -0
- package/dist/packages/core/src/components/Tooltip/TrainingTooltip.d.ts +16 -0
- package/dist/packages/core/src/components/Tooltip/TrainingTooltip.js +40 -0
- package/dist/packages/core/src/components/Tooltip/WordImageTooltip.css +61 -0
- package/dist/packages/core/src/components/Tooltip/WordImageTooltip.d.ts +12 -0
- package/dist/packages/core/src/components/Tooltip/WordImageTooltip.js +39 -0
- package/dist/packages/core/src/components/Tooltip/tooltipConstants.d.ts +44 -0
- package/dist/packages/core/src/components/Tooltip/tooltipConstants.js +38 -0
- package/dist/packages/core/src/components/TopBanner.css +100 -0
- package/dist/packages/core/src/components/TopBanner.d.ts +25 -0
- package/dist/packages/core/src/components/TopBanner.js +36 -0
- package/dist/packages/core/src/components/Training/AudioPlayerWaveForm.d.ts +17 -0
- package/dist/packages/core/src/components/Training/AudioPlayerWaveForm.js +237 -0
- package/dist/packages/core/src/components/Training/CategoryIcon.css +85 -0
- package/dist/packages/core/src/components/Training/CategoryIcon.d.ts +16 -0
- package/dist/packages/core/src/components/Training/CategoryIcon.js +79 -0
- package/dist/packages/core/src/components/Training/NoisePlayerContext.d.ts +43 -0
- package/dist/packages/core/src/components/Training/NoisePlayerContext.js +26 -0
- package/dist/packages/core/src/components/Training/NoiseSettingsTooltip.css +52 -0
- package/dist/packages/core/src/components/Training/NoiseSettingsTooltip.d.ts +13 -0
- package/dist/packages/core/src/components/Training/NoiseSettingsTooltip.js +81 -0
- package/dist/packages/core/src/components/Training/TrainingBlock.css +33 -0
- package/dist/packages/core/src/components/Training/TrainingBlock.d.ts +45 -0
- package/dist/packages/core/src/components/Training/TrainingBlock.js +44 -0
- package/dist/packages/core/src/components/Training/TrainingBlockButton.css +337 -0
- package/dist/packages/core/src/components/Training/TrainingBlockButton.d.ts +5 -0
- package/dist/packages/core/src/components/Training/TrainingBlockButton.js +193 -0
- package/dist/packages/core/src/components/Training/TrainingCard.css +178 -0
- package/dist/packages/core/src/components/Training/TrainingCard.d.ts +24 -0
- package/dist/packages/core/src/components/Training/TrainingCard.js +29 -0
- package/dist/packages/core/src/components/Training/TrainingCardGroup.css +73 -0
- package/dist/packages/core/src/components/Training/TrainingCardGroup.d.ts +41 -0
- package/dist/packages/core/src/components/Training/TrainingCardGroup.js +16 -0
- package/dist/packages/core/src/components/Training/TrainingPagePopup.css +210 -0
- package/dist/packages/core/src/components/Training/TrainingPagePopup.d.ts +91 -0
- package/dist/packages/core/src/components/Training/TrainingPagePopup.js +799 -0
- package/dist/packages/core/src/components/Training/TrainingPagePopupBottom.css +45 -0
- package/dist/packages/core/src/components/Training/TrainingPagePopupBottom.d.ts +14 -0
- package/dist/packages/core/src/components/Training/TrainingPagePopupBottom.js +60 -0
- package/dist/packages/core/src/components/Training/TrainingPagePopupContext.d.ts +13 -0
- package/dist/packages/core/src/components/Training/TrainingPagePopupContext.js +12 -0
- package/dist/packages/core/src/components/Training/TrainingPagePopupTitle.css +77 -0
- package/dist/packages/core/src/components/Training/TrainingPagePopupTitle.d.ts +21 -0
- package/dist/packages/core/src/components/Training/TrainingPagePopupTitle.js +41 -0
- package/dist/packages/core/src/components/Training/TrainingStep.css +236 -0
- package/dist/packages/core/src/components/Training/TrainingStep.d.ts +15 -0
- package/dist/packages/core/src/components/Training/TrainingStep.js +89 -0
- package/dist/packages/core/src/components/Training/TrainingStepAudioPlayer.css +320 -0
- package/dist/packages/core/src/components/Training/TrainingStepAudioPlayer.d.ts +5 -0
- package/dist/packages/core/src/components/Training/TrainingStepAudioPlayer.js +971 -0
- package/dist/packages/core/src/components/Training/TrainingStepBullet.css +148 -0
- package/dist/packages/core/src/components/Training/TrainingStepBullet.d.ts +6 -0
- package/dist/packages/core/src/components/Training/TrainingStepBullet.js +11 -0
- package/dist/packages/core/src/components/Training/TrainingStepCard.css +0 -0
- package/dist/packages/core/src/components/Training/TrainingStepCard.d.ts +36 -0
- package/dist/packages/core/src/components/Training/TrainingStepCard.js +110 -0
- package/dist/packages/core/src/components/Training/TrainingStepCardOrder.d.ts +15 -0
- package/dist/packages/core/src/components/Training/TrainingStepCardOrder.js +58 -0
- package/dist/packages/core/src/components/Training/TrainingStepComponents.d.ts +35 -0
- package/dist/packages/core/src/components/Training/TrainingStepComponents.js +60 -0
- package/dist/packages/core/src/components/Training/TrainingStepConfirm.d.ts +24 -0
- package/dist/packages/core/src/components/Training/TrainingStepConfirm.js +117 -0
- package/dist/packages/core/src/components/Training/TrainingStepConfirmWithText.d.ts +16 -0
- package/dist/packages/core/src/components/Training/TrainingStepConfirmWithText.js +60 -0
- package/dist/packages/core/src/components/Training/TrainingStepListen.d.ts +27 -0
- package/dist/packages/core/src/components/Training/TrainingStepListen.js +13 -0
- package/dist/packages/core/src/components/Training/TrainingStepOrderList.css +221 -0
- package/dist/packages/core/src/components/Training/TrainingStepOrderList.d.ts +7 -0
- package/dist/packages/core/src/components/Training/TrainingStepOrderList.js +445 -0
- package/dist/packages/core/src/components/Training/TrainingStepTextBox.css +111 -0
- package/dist/packages/core/src/components/Training/TrainingStepTextBox.d.ts +8 -0
- package/dist/packages/core/src/components/Training/TrainingStepTextBox.js +74 -0
- package/dist/packages/core/src/components/Training/TrainingStepTitle.css +89 -0
- package/dist/packages/core/src/components/Training/TrainingStepTitle.d.ts +21 -0
- package/dist/packages/core/src/components/Training/TrainingStepTitle.js +91 -0
- package/dist/packages/core/src/components/Training/TrainingWordCard.css +266 -0
- package/dist/packages/core/src/components/Training/TrainingWordCard.d.ts +43 -0
- package/dist/packages/core/src/components/Training/TrainingWordCard.js +229 -0
- package/dist/packages/core/src/components/Training/WordTablePopup.css +56 -0
- package/dist/packages/core/src/components/Training/WordTablePopup.d.ts +61 -0
- package/dist/packages/core/src/components/Training/WordTablePopup.js +105 -0
- package/dist/packages/core/src/components/Training/audioPlaybackRules.d.ts +95 -0
- package/dist/packages/core/src/components/Training/audioPlaybackRules.js +125 -0
- package/dist/packages/core/src/components/Training/audioWaits.d.ts +27 -0
- package/dist/packages/core/src/components/Training/audioWaits.js +64 -0
- package/dist/packages/core/src/components/Training/currentSound.d.ts +26 -0
- package/dist/packages/core/src/components/Training/currentSound.js +46 -0
- package/dist/packages/core/src/components/Training/pagePopupTiming.d.ts +17 -0
- package/dist/packages/core/src/components/Training/pagePopupTiming.js +17 -0
- package/dist/packages/core/src/components/Training/trainingBlockButtonTypes.d.ts +79 -0
- package/dist/packages/core/src/components/Training/trainingBlockButtonTypes.js +27 -0
- package/dist/packages/core/src/components/Training/trainingMissStats.d.ts +148 -0
- package/dist/packages/core/src/components/Training/trainingMissStats.js +163 -0
- package/dist/packages/core/src/components/Training/trainingPopupUtils.d.ts +108 -0
- package/dist/packages/core/src/components/Training/trainingPopupUtils.js +226 -0
- package/dist/packages/core/src/components/Training/trainingScenario.d.ts +42 -0
- package/dist/packages/core/src/components/Training/trainingScenario.js +25 -0
- package/dist/packages/core/src/components/Training/trainingStepAudioPlayerTypes.d.ts +37 -0
- package/dist/packages/core/src/components/Training/trainingStepAudioPlayerTypes.js +20 -0
- package/dist/packages/core/src/components/Training/trainingStepOrderListTypes.d.ts +34 -0
- package/dist/packages/core/src/components/Training/trainingStepOrderListTypes.js +5 -0
- package/dist/packages/core/src/components/Training/useAnchorRect.d.ts +26 -0
- package/dist/packages/core/src/components/Training/useAnchorRect.js +52 -0
- package/dist/packages/core/src/components/Training/useAudioPreview.d.ts +11 -0
- package/dist/packages/core/src/components/Training/useAudioPreview.js +178 -0
- package/dist/packages/core/src/components/Training/useNoiseFade.d.ts +24 -0
- package/dist/packages/core/src/components/Training/useNoiseFade.js +303 -0
- package/dist/packages/core/src/components/Training/useObjectUrls.d.ts +25 -0
- package/dist/packages/core/src/components/Training/useObjectUrls.js +56 -0
- package/dist/packages/core/src/components/Training/useProgressTicker.d.ts +33 -0
- package/dist/packages/core/src/components/Training/useProgressTicker.js +74 -0
- package/dist/packages/core/src/components/Training/useTTSPlayback.d.ts +30 -0
- package/dist/packages/core/src/components/Training/useTTSPlayback.js +172 -0
- package/dist/packages/core/src/components/Training/useWaveReady.d.ts +36 -0
- package/dist/packages/core/src/components/Training/useWaveReady.js +65 -0
- package/dist/packages/core/src/components/UpdateAlert.css +116 -0
- package/dist/packages/core/src/components/UpdateAlert.d.ts +23 -0
- package/dist/packages/core/src/components/UpdateAlert.js +25 -0
- package/dist/packages/core/src/components/Word/ContrastFilterPanel.d.ts +25 -0
- package/dist/packages/core/src/components/Word/ContrastFilterPanel.js +69 -0
- package/dist/packages/core/src/components/Word/PhonemeFilterPanel.d.ts +24 -0
- package/dist/packages/core/src/components/Word/PhonemeFilterPanel.js +15 -0
- package/dist/packages/core/src/components/Word/PhonemeSelectBlock.css +272 -0
- package/dist/packages/core/src/components/Word/PhonemeSelectBlock.d.ts +45 -0
- package/dist/packages/core/src/components/Word/PhonemeSelectBlock.js +71 -0
- package/dist/packages/core/src/components/Word/TableFilterPanel.d.ts +56 -0
- package/dist/packages/core/src/components/Word/TableFilterPanel.js +42 -0
- package/dist/packages/core/src/components/Word/WordSearchFilterPanel.d.ts +23 -0
- package/dist/packages/core/src/components/Word/WordSearchFilterPanel.js +14 -0
- package/dist/packages/core/src/components/Word/WordSearchResultBlock.css +130 -0
- package/dist/packages/core/src/components/Word/WordSearchResultBlock.d.ts +47 -0
- package/dist/packages/core/src/components/Word/WordSearchResultBlock.js +141 -0
- package/dist/packages/core/src/components/Word/WordTableBlock.css +85 -0
- package/dist/packages/core/src/components/Word/WordTableBlock.d.ts +5 -0
- package/dist/packages/core/src/components/Word/WordTableBlock.js +297 -0
- package/dist/packages/core/src/components/Word/WordTableButton.css +185 -0
- package/dist/packages/core/src/components/Word/WordTableButton.d.ts +48 -0
- package/dist/packages/core/src/components/Word/WordTableButton.js +28 -0
- package/dist/packages/core/src/components/Word/WordTableThumbnail.css +56 -0
- package/dist/packages/core/src/components/Word/WordTableThumbnail.d.ts +10 -0
- package/dist/packages/core/src/components/Word/WordTableThumbnail.js +21 -0
- package/dist/packages/core/src/components/Word/generatedDraft.d.ts +39 -0
- package/dist/packages/core/src/components/Word/generatedDraft.js +69 -0
- package/dist/packages/core/src/components/Word/phonemeSelectBlockUtils.d.ts +14 -0
- package/dist/packages/core/src/components/Word/phonemeSelectBlockUtils.js +10 -0
- package/dist/packages/core/src/components/Word/useWordTableDisplaySettings.d.ts +35 -0
- package/dist/packages/core/src/components/Word/useWordTableDisplaySettings.js +82 -0
- package/dist/packages/core/src/components/Word/useWordTablePrint.d.ts +31 -0
- package/dist/packages/core/src/components/Word/useWordTablePrint.js +43 -0
- package/dist/packages/core/src/components/Word/wordScoreStats.d.ts +77 -0
- package/dist/packages/core/src/components/Word/wordScoreStats.js +100 -0
- package/dist/packages/core/src/components/Word/wordTableBlockTypes.d.ts +85 -0
- package/dist/packages/core/src/components/Word/wordTableBlockTypes.js +3 -0
- package/dist/packages/core/src/components/Word/wordTablePrint.d.ts +14 -0
- package/dist/packages/core/src/components/Word/wordTablePrint.js +210 -0
- package/dist/packages/core/src/components/Word/wordTableRecommend.d.ts +67 -0
- package/dist/packages/core/src/components/Word/wordTableRecommend.js +91 -0
- package/dist/packages/core/src/components/Word/wordTableReview.d.ts +49 -0
- package/dist/packages/core/src/components/Word/wordTableReview.js +112 -0
- package/dist/packages/core/src/components/Word/wordTableScoring.d.ts +100 -0
- package/dist/packages/core/src/components/Word/wordTableScoring.js +126 -0
- package/dist/packages/core/src/components/Word/wordTableSettings.d.ts +56 -0
- package/dist/packages/core/src/components/Word/wordTableSettings.js +140 -0
- package/dist/packages/core/src/components/WordTable.css +424 -0
- package/dist/packages/core/src/components/WordTable.d.ts +75 -0
- package/dist/packages/core/src/components/WordTable.js +184 -0
- package/dist/packages/core/src/components/barChartData.d.ts +48 -0
- package/dist/packages/core/src/components/barChartData.js +111 -0
- package/dist/packages/core/src/components/barChartTypes.d.ts +82 -0
- package/dist/packages/core/src/components/barChartTypes.js +22 -0
- package/dist/packages/core/src/components/buttonTypes.d.ts +102 -0
- package/dist/packages/core/src/components/buttonTypes.js +1 -0
- package/dist/packages/core/src/components/tableTrackList.d.ts +9 -0
- package/dist/packages/core/src/components/tableTrackList.js +32 -0
- package/dist/packages/core/src/components/useAnchoredMenu.d.ts +28 -0
- package/dist/packages/core/src/components/useAnchoredMenu.js +72 -0
- package/dist/packages/core/src/components/useBarChartControl.d.ts +8 -0
- package/dist/packages/core/src/components/useBarChartControl.js +76 -0
- package/dist/packages/core/src/components/useCalendarMonth.d.ts +12 -0
- package/dist/packages/core/src/components/useCalendarMonth.js +50 -0
- package/dist/packages/core/src/components/useComboboxSuggestions.d.ts +22 -0
- package/dist/packages/core/src/components/useComboboxSuggestions.js +60 -0
- package/dist/packages/core/src/components/useFitScale.d.ts +16 -0
- package/dist/packages/core/src/components/useFitScale.js +43 -0
- package/dist/packages/core/src/components/useSoundCompassExam.d.ts +54 -0
- package/dist/packages/core/src/components/useSoundCompassExam.js +128 -0
- package/dist/packages/core/src/components/useToastLifecycle.d.ts +16 -0
- package/dist/packages/core/src/components/useToastLifecycle.js +140 -0
- package/dist/packages/core/src/components/wordTableLayout.d.ts +76 -0
- package/dist/packages/core/src/components/wordTableLayout.js +162 -0
- package/dist/packages/core/src/components.d.ts +314 -0
- package/dist/packages/core/src/components.js +232 -0
- package/dist/packages/core/src/context/I18nContext.d.ts +11 -0
- package/dist/packages/core/src/context/I18nContext.js +20 -0
- package/dist/packages/core/src/context/I18nProvider.d.ts +9 -0
- package/dist/packages/core/src/context/I18nProvider.js +15 -0
- package/dist/packages/core/src/context/WordDataContext.d.ts +25 -0
- package/dist/packages/core/src/context/WordDataContext.js +6 -0
- package/dist/packages/core/src/context/WordDataProvider.d.ts +5 -0
- package/dist/packages/core/src/context/WordDataProvider.js +5 -0
- package/dist/packages/core/src/hooks/bodyScrollLock.d.ts +5 -0
- package/dist/packages/core/src/hooks/bodyScrollLock.js +62 -0
- package/dist/packages/core/src/hooks/escStack.d.ts +2 -0
- package/dist/packages/core/src/hooks/escStack.js +38 -0
- package/dist/packages/core/src/hooks/useBackgroundUrl.d.ts +2 -0
- package/dist/packages/core/src/hooks/useBackgroundUrl.js +13 -0
- package/dist/packages/core/src/hooks/useCacheManagement.d.ts +34 -0
- package/dist/packages/core/src/hooks/useCacheManagement.js +107 -0
- package/dist/packages/core/src/hooks/useDailyTrainingSelection.d.ts +17 -0
- package/dist/packages/core/src/hooks/useDailyTrainingSelection.js +87 -0
- package/dist/packages/core/src/hooks/useDeviceManagement.d.ts +37 -0
- package/dist/packages/core/src/hooks/useDeviceManagement.js +40 -0
- package/dist/packages/core/src/hooks/useDocumentTitle.d.ts +22 -0
- package/dist/packages/core/src/hooks/useDocumentTitle.js +49 -0
- package/dist/packages/core/src/hooks/useEditableList.d.ts +20 -0
- package/dist/packages/core/src/hooks/useEditableList.js +73 -0
- package/dist/packages/core/src/hooks/useEscToClose.d.ts +19 -0
- package/dist/packages/core/src/hooks/useEscToClose.js +30 -0
- package/dist/packages/core/src/hooks/useFocusTrap.d.ts +19 -0
- package/dist/packages/core/src/hooks/useFocusTrap.js +50 -0
- package/dist/packages/core/src/hooks/useFontScale.d.ts +20 -0
- package/dist/packages/core/src/hooks/useFontScale.js +51 -0
- package/dist/packages/core/src/hooks/useHoverAnchor.d.ts +33 -0
- package/dist/packages/core/src/hooks/useHoverAnchor.js +49 -0
- package/dist/packages/core/src/hooks/useIcon.d.ts +7 -0
- package/dist/packages/core/src/hooks/useIcon.js +124 -0
- package/dist/packages/core/src/hooks/useLatestRef.d.ts +12 -0
- package/dist/packages/core/src/hooks/useLatestRef.js +17 -0
- package/dist/packages/core/src/hooks/useLucideIcon.d.ts +15 -0
- package/dist/packages/core/src/hooks/useLucideIcon.js +71 -0
- package/dist/packages/core/src/hooks/useMediaQuery.d.ts +17 -0
- package/dist/packages/core/src/hooks/useMediaQuery.js +45 -0
- package/dist/packages/core/src/hooks/usePagedList.d.ts +23 -0
- package/dist/packages/core/src/hooks/usePagedList.js +26 -0
- package/dist/packages/core/src/hooks/useParentBgTheme.d.ts +8 -0
- package/dist/packages/core/src/hooks/useParentBgTheme.js +18 -0
- package/dist/packages/core/src/hooks/usePasswordChange.d.ts +28 -0
- package/dist/packages/core/src/hooks/usePasswordChange.js +54 -0
- package/dist/packages/core/src/hooks/useRelativeDay.d.ts +12 -0
- package/dist/packages/core/src/hooks/useRelativeDay.js +30 -0
- package/dist/packages/core/src/hooks/useTablePaging.d.ts +46 -0
- package/dist/packages/core/src/hooks/useTablePaging.js +63 -0
- package/dist/packages/core/src/hooks/useToastState.d.ts +15 -0
- package/dist/packages/core/src/hooks/useToastState.js +29 -0
- package/dist/packages/core/src/hooks/useTrainingSessionLog.d.ts +7 -0
- package/dist/packages/core/src/hooks/useTrainingSessionLog.js +26 -0
- package/dist/packages/core/src/hooks/useTrainingTypeLabels.d.ts +16 -0
- package/dist/packages/core/src/hooks/useTrainingTypeLabels.js +25 -0
- package/dist/packages/core/src/hooks/useVisitAllPanel.d.ts +30 -0
- package/dist/packages/core/src/hooks/useVisitAllPanel.js +43 -0
- package/dist/packages/core/src/hooks/useVisitHistory.d.ts +38 -0
- package/dist/packages/core/src/hooks/useVisitHistory.js +59 -0
- package/dist/packages/core/src/hooks/useVisitSchedule.d.ts +31 -0
- package/dist/packages/core/src/hooks/useVisitSchedule.js +101 -0
- package/dist/packages/core/src/hooks/useWindowEvent.d.ts +11 -0
- package/dist/packages/core/src/hooks/useWindowEvent.js +27 -0
- package/dist/packages/core/src/hooks/useWordAttributeFilter.d.ts +70 -0
- package/dist/packages/core/src/hooks/useWordAttributeFilter.js +115 -0
- package/dist/packages/core/src/hooks/useWordDataStats.d.ts +22 -0
- package/dist/packages/core/src/hooks/useWordDataStats.js +40 -0
- package/dist/packages/core/src/hooks/useWordImage.d.ts +19 -0
- package/dist/packages/core/src/hooks/useWordImage.js +28 -0
- package/dist/packages/core/src/hooks/useWordMeanings.d.ts +39 -0
- package/dist/packages/core/src/hooks/useWordMeanings.js +62 -0
- package/dist/packages/core/src/hooks/useWordTrainingDataGeneration.d.ts +34 -0
- package/dist/packages/core/src/hooks/useWordTrainingDataGeneration.js +98 -0
- package/dist/packages/core/src/hooks/useWordTrainingFilter.d.ts +91 -0
- package/dist/packages/core/src/hooks/useWordTrainingFilter.js +549 -0
- package/dist/packages/core/src/hooks/wordTrainingFilterModel.d.ts +61 -0
- package/dist/packages/core/src/hooks/wordTrainingFilterModel.js +102 -0
- package/dist/packages/core/src/hooks.d.ts +27 -0
- package/dist/packages/core/src/hooks.js +28 -0
- package/dist/packages/core/src/i18n/index.d.ts +21 -0
- package/dist/packages/core/src/i18n/index.js +68 -0
- package/dist/packages/core/src/i18n/locales/en.json +4055 -0
- package/dist/packages/core/src/i18n/locales/ko.json +4052 -0
- package/dist/packages/core/src/icon/none.svg +4 -0
- package/dist/packages/core/src/icon/null.svg +3 -0
- package/dist/packages/core/src/index.d.ts +16 -0
- package/dist/packages/core/src/index.js +25 -0
- package/dist/packages/core/src/logo/Logo_APEB.svg +53 -0
- package/dist/packages/core/src/logo/Logo_APEB_black.svg +42 -0
- package/dist/packages/core/src/logo/Logo_APEB_white.svg +42 -0
- package/dist/packages/core/src/logo/Logo_HTP_kr.svg +21 -0
- package/dist/packages/core/src/logo/Logo_HTP_kr_black.svg +17 -0
- package/dist/packages/core/src/logo/Logo_HTP_kr_white.svg +17 -0
- package/dist/packages/core/src/logo/Logo_IHAB_en.svg +18 -0
- package/dist/packages/core/src/logo/Logo_IHAB_en_black.svg +14 -0
- package/dist/packages/core/src/logo/Logo_IHAB_en_white.svg +14 -0
- package/dist/packages/core/src/logo/Logo_IHAB_kr.svg +18 -0
- package/dist/packages/core/src/logo/Logo_IHAB_kr_black.svg +14 -0
- package/dist/packages/core/src/logo/Logo_IHAB_kr_white.svg +14 -0
- package/dist/packages/core/src/logo/Logo_SDS_kr.svg +22 -0
- package/dist/packages/core/src/logo/Logo_SDS_kr_black.svg +18 -0
- package/dist/packages/core/src/logo/Logo_SDS_kr_white.svg +18 -0
- package/dist/packages/core/src/logo/Logo_speechearManager_kr.svg +20 -0
- package/dist/packages/core/src/logo/Logo_speechearManager_kr_black.svg +21 -0
- package/dist/packages/core/src/logo/Logo_speechearManager_kr_textWhite.svg +45 -0
- package/dist/packages/core/src/logo/Logo_speechearManager_kr_white.svg +21 -0
- package/dist/packages/core/src/logo/Logo_speechear_kr.svg +17 -0
- package/dist/packages/core/src/logo/Logo_speechear_kr_black.svg +16 -0
- package/dist/packages/core/src/logo/Logo_speechear_kr_textWhite.svg +42 -0
- package/dist/packages/core/src/logo/Logo_speechear_kr_white.svg +16 -0
- package/dist/packages/core/src/logo/Symbol_APEB.svg +34 -0
- package/dist/packages/core/src/logo/Symbol_APEB_black.svg +15 -0
- package/dist/packages/core/src/logo/Symbol_APEB_white.svg +15 -0
- package/dist/packages/core/src/logo/Symbol_HTP.svg +14 -0
- package/dist/packages/core/src/logo/Symbol_HTP_black.svg +10 -0
- package/dist/packages/core/src/logo/Symbol_HTP_white.svg +10 -0
- package/dist/packages/core/src/logo/Symbol_IHAB.svg +14 -0
- package/dist/packages/core/src/logo/Symbol_IHAB_black.svg +10 -0
- package/dist/packages/core/src/logo/Symbol_IHAB_white.svg +10 -0
- package/dist/packages/core/src/logo/Symbol_SDS.svg +14 -0
- package/dist/packages/core/src/logo/Symbol_SDS_black.svg +10 -0
- package/dist/packages/core/src/logo/Symbol_SDS_white.svg +10 -0
- package/dist/packages/core/src/logo/Symbol_speechear.svg +15 -0
- package/dist/packages/core/src/logo/Symbol_speechear_black.svg +16 -0
- package/dist/packages/core/src/logo/Symbol_speechear_white.svg +16 -0
- package/dist/packages/core/src/logo/qr_speechear.svg +1 -0
- package/dist/packages/core/src/sounds/noiseAssets.d.ts +6 -0
- package/dist/packages/core/src/sounds/noiseAssets.js +24 -0
- package/dist/packages/core/src/styles.css +144 -0
- package/dist/packages/core/src/tokens.css +407 -0
- package/dist/packages/core/src/types/audio.d.ts +11 -0
- package/dist/packages/core/src/types/audio.js +1 -0
- package/dist/packages/core/src/types/device.d.ts +10 -0
- package/dist/packages/core/src/types/device.js +1 -0
- package/dist/packages/core/src/types/filterPanel.d.ts +63 -0
- package/dist/packages/core/src/types/filterPanel.js +8 -0
- package/dist/packages/core/src/types/geometry.d.ts +14 -0
- package/dist/packages/core/src/types/geometry.js +1 -0
- package/dist/packages/core/src/types/training.d.ts +131 -0
- package/dist/packages/core/src/types/training.js +1 -0
- package/dist/packages/core/src/types/wordSearch.d.ts +49 -0
- package/dist/packages/core/src/types/wordSearch.js +1 -0
- package/dist/packages/core/src/types.d.ts +3 -0
- package/dist/packages/core/src/types.js +1 -0
- package/dist/packages/core/src/utils/CategoryData.d.ts +91 -0
- package/dist/packages/core/src/utils/CategoryData.js +57 -0
- package/dist/packages/core/src/utils/array.d.ts +20 -0
- package/dist/packages/core/src/utils/array.js +36 -0
- package/dist/packages/core/src/utils/assets.d.ts +41 -0
- package/dist/packages/core/src/utils/assets.js +62 -0
- package/dist/packages/core/src/utils/audioMeter.d.ts +19 -0
- package/dist/packages/core/src/utils/audioMeter.js +70 -0
- package/dist/packages/core/src/utils/categories.d.ts +67 -0
- package/dist/packages/core/src/utils/categories.js +70 -0
- package/dist/packages/core/src/utils/clipboard.d.ts +10 -0
- package/dist/packages/core/src/utils/clipboard.js +46 -0
- package/dist/packages/core/src/utils/companyTypes.d.ts +2 -0
- package/dist/packages/core/src/utils/companyTypes.js +6 -0
- package/dist/packages/core/src/utils/csv.d.ts +22 -0
- package/dist/packages/core/src/utils/csv.js +35 -0
- package/dist/packages/core/src/utils/cx.d.ts +7 -0
- package/dist/packages/core/src/utils/cx.js +9 -0
- package/dist/packages/core/src/utils/dailySelectionUtils.d.ts +15 -0
- package/dist/packages/core/src/utils/dailySelectionUtils.js +68 -0
- package/dist/packages/core/src/utils/date.d.ts +86 -0
- package/dist/packages/core/src/utils/date.js +171 -0
- package/dist/packages/core/src/utils/deviceKind.d.ts +13 -0
- package/dist/packages/core/src/utils/deviceKind.js +19 -0
- package/dist/packages/core/src/utils/encoding.d.ts +26 -0
- package/dist/packages/core/src/utils/encoding.js +33 -0
- package/dist/packages/core/src/utils/errorMessage.d.ts +44 -0
- package/dist/packages/core/src/utils/errorMessage.js +63 -0
- package/dist/packages/core/src/utils/fontScale.d.ts +10 -0
- package/dist/packages/core/src/utils/fontScale.js +28 -0
- package/dist/packages/core/src/utils/format.d.ts +48 -0
- package/dist/packages/core/src/utils/format.js +122 -0
- package/dist/packages/core/src/utils/gameScoreLogger.d.ts +48 -0
- package/dist/packages/core/src/utils/gameScoreLogger.js +42 -0
- package/dist/packages/core/src/utils/getTrainingData.d.ts +61 -0
- package/dist/packages/core/src/utils/getTrainingData.js +156 -0
- package/dist/packages/core/src/utils/imageConfig.d.ts +48 -0
- package/dist/packages/core/src/utils/imageConfig.js +159 -0
- package/dist/packages/core/src/utils/josa.d.ts +29 -0
- package/dist/packages/core/src/utils/josa.js +103 -0
- package/dist/packages/core/src/utils/koreanPronunciation.d.ts +16 -0
- package/dist/packages/core/src/utils/koreanPronunciation.js +223 -0
- package/dist/packages/core/src/utils/koreanSyllable.d.ts +174 -0
- package/dist/packages/core/src/utils/koreanSyllable.js +654 -0
- package/dist/packages/core/src/utils/lucideIconSet.d.ts +16 -0
- package/dist/packages/core/src/utils/lucideIconSet.js +350 -0
- package/dist/packages/core/src/utils/lucideLoader.d.ts +44 -0
- package/dist/packages/core/src/utils/lucideLoader.js +76 -0
- package/dist/packages/core/src/utils/noiseSettingsStore.d.ts +22 -0
- package/dist/packages/core/src/utils/noiseSettingsStore.js +36 -0
- package/dist/packages/core/src/utils/phonemeConvert.d.ts +9 -0
- package/dist/packages/core/src/utils/phonemeConvert.js +53 -0
- package/dist/packages/core/src/utils/phonemeGroups.d.ts +22 -0
- package/dist/packages/core/src/utils/phonemeGroups.js +29 -0
- package/dist/packages/core/src/utils/phonemePairSearch.d.ts +22 -0
- package/dist/packages/core/src/utils/phonemePairSearch.js +583 -0
- package/dist/packages/core/src/utils/phonemePairSearchTypes.d.ts +46 -0
- package/dist/packages/core/src/utils/phonemePairSearchTypes.js +1 -0
- package/dist/packages/core/src/utils/planFeatures.d.ts +61 -0
- package/dist/packages/core/src/utils/planFeatures.js +168 -0
- package/dist/packages/core/src/utils/pronunciationConfig.d.ts +7 -0
- package/dist/packages/core/src/utils/pronunciationConfig.js +21 -0
- package/dist/packages/core/src/utils/savedWordTables.d.ts +18 -0
- package/dist/packages/core/src/utils/savedWordTables.js +70 -0
- package/dist/packages/core/src/utils/sortValue.d.ts +24 -0
- package/dist/packages/core/src/utils/sortValue.js +26 -0
- package/dist/packages/core/src/utils/speak.d.ts +7 -0
- package/dist/packages/core/src/utils/speak.js +35 -0
- package/dist/packages/core/src/utils/storage.d.ts +102 -0
- package/dist/packages/core/src/utils/storage.js +118 -0
- package/dist/packages/core/src/utils/theme.d.ts +11 -0
- package/dist/packages/core/src/utils/theme.js +28 -0
- package/dist/packages/core/src/utils/trainingItemResults.d.ts +60 -0
- package/dist/packages/core/src/utils/trainingItemResults.js +72 -0
- package/dist/packages/core/src/utils/trainingLogger.d.ts +58 -0
- package/dist/packages/core/src/utils/trainingLogger.js +50 -0
- package/dist/packages/core/src/utils/trainingPalette.d.ts +12 -0
- package/dist/packages/core/src/utils/trainingPalette.js +12 -0
- package/dist/packages/core/src/utils/ttsConfig.d.ts +78 -0
- package/dist/packages/core/src/utils/ttsConfig.js +89 -0
- package/dist/packages/core/src/utils/ttsResolver.d.ts +17 -0
- package/dist/packages/core/src/utils/ttsResolver.js +56 -0
- package/dist/packages/core/src/utils/wordContrast.d.ts +54 -0
- package/dist/packages/core/src/utils/wordContrast.js +198 -0
- package/dist/packages/core/src/utils/wordPairIndex.d.ts +26 -0
- package/dist/packages/core/src/utils/wordPairIndex.js +194 -0
- package/dist/packages/core/src/utils/wordPool.d.ts +34 -0
- package/dist/packages/core/src/utils/wordPool.js +20 -0
- package/dist/packages/core/src/utils/wordSuggestionPolicy.d.ts +55 -0
- package/dist/packages/core/src/utils/wordSuggestionPolicy.js +97 -0
- package/dist/packages/core/src/utils/wordTrainingGenerators.d.ts +122 -0
- package/dist/packages/core/src/utils/wordTrainingGenerators.js +560 -0
- package/dist/packages/core/src/utils/wordTrainingGroups.d.ts +10 -0
- package/dist/packages/core/src/utils/wordTrainingGroups.js +69 -0
- package/dist/packages/core/src/utils/wordTrainingPool.d.ts +51 -0
- package/dist/packages/core/src/utils/wordTrainingPool.js +436 -0
- package/dist/packages/core/src/utils/wordTrainingRuntime.d.ts +38 -0
- package/dist/packages/core/src/utils/wordTrainingRuntime.js +641 -0
- package/dist/packages/core/src/utils/wordTrainingRuntimeTypes.d.ts +89 -0
- package/dist/packages/core/src/utils/wordTrainingRuntimeTypes.js +77 -0
- package/dist/packages/core/src/utils.d.ts +57 -0
- package/dist/packages/core/src/utils.js +46 -0
- package/dist/tsdoc-metadata.json +11 -0
- package/dist/types.cjs.js +1 -0
- package/dist/types.esm.js +1 -0
- package/dist/utils.cjs.js +20 -0
- package/dist/utils.esm.js +20 -0
- package/package.json +171 -0
|
@@ -0,0 +1,971 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cx } from '../../utils/cx';
|
|
4
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
5
|
+
import { useTranslation } from "react-i18next";
|
|
6
|
+
// TrainingItem, TrainingGroup import 제거됨 (resolveMapping 제거로 불필요)
|
|
7
|
+
import { downloadSound, getSignedOrPublicUrl, resolveSoundPath } from '../../utils/storage';
|
|
8
|
+
import { getTTSUrlResolver } from '../../utils/ttsConfig';
|
|
9
|
+
import { getElementAnalyser, resumeAudioMeter } from '../../utils/audioMeter';
|
|
10
|
+
import { useNoisePlayer } from './NoisePlayerContext';
|
|
11
|
+
import { useNoiseFade } from './useNoiseFade';
|
|
12
|
+
import { useTTSPlayback } from './useTTSPlayback';
|
|
13
|
+
import './TrainingStepAudioPlayer.css';
|
|
14
|
+
import WaveForm from './AudioPlayerWaveForm';
|
|
15
|
+
import Toast from '../Toast';
|
|
16
|
+
import Button from '../Button';
|
|
17
|
+
import Icon from '../Icon';
|
|
18
|
+
import InfoTooltip from '../Tooltip/InfoTooltip';
|
|
19
|
+
import { STATUS_MESSAGES } from './trainingStepAudioPlayerTypes';
|
|
20
|
+
import { measureAudioDuration, waitForCanPlay } from './audioWaits';
|
|
21
|
+
import { useWaveReady } from './useWaveReady';
|
|
22
|
+
import { useObjectUrls } from './useObjectUrls';
|
|
23
|
+
import { useAnchorRect } from './useAnchorRect';
|
|
24
|
+
import { useProgressTicker } from './useProgressTicker';
|
|
25
|
+
import { nextTrackIndex, shouldIgnorePause, buildSegments, totalDurationOf, normalizeSources } from './audioPlaybackRules';
|
|
26
|
+
/** @public */
|
|
27
|
+
export default function TrainingStepAudioPlayer({ btnLabel, soundSrc, bucketPath, onDone, disabled = false, ttsText = null, className, showSoundWaveForm = true, showNoiseWaveForm = true }) {
|
|
28
|
+
const { t } = useTranslation();
|
|
29
|
+
const label = btnLabel;
|
|
30
|
+
// 소음 재생
|
|
31
|
+
const noisePlayer = useNoisePlayer();
|
|
32
|
+
// 미터용 analyser 등록 — 콜백 stale 방지용 ref
|
|
33
|
+
const registerAnalyserRef = useRef(noisePlayer?.registerAnalyser);
|
|
34
|
+
/* 렌더 중에 ref 를 쓰면 **버려질 렌더의 값**이 남을 수 있다(동시성 렌더링에서 React 는
|
|
35
|
+
커밋하지 않을 렌더를 그리다 버린다). 이 값을 읽는 곳은 재생 이벤트 핸들러와 언마운트
|
|
36
|
+
정리뿐이라 둘 다 커밋 이후에 도는 자리다 — 그러니 효과에서 갱신해도 늦지 않고,
|
|
37
|
+
그래야 커밋된 값만 들어간다. 이 효과는 맨 앞에 두어 뒤따르는 효과들이 이미 채워진
|
|
38
|
+
값을 보게 한다. */
|
|
39
|
+
useEffect(() => { registerAnalyserRef.current = noisePlayer?.registerAnalyser; });
|
|
40
|
+
const audioRef = useRef(null);
|
|
41
|
+
const fillRef = useRef(null);
|
|
42
|
+
const btnsRef = useRef(null);
|
|
43
|
+
// mappingRef removed — resolveMapping 제거됨
|
|
44
|
+
/* 내려받기 폴백으로 만든 blob 주소의 회수는 useObjectUrls 가 들고 있다.
|
|
45
|
+
(한때 '현재 재생 중 하나'를 따로 든 ref 가 있었는데 null 만 대입돼서 그 옆의
|
|
46
|
+
revokeObjectURL 이 한 번도 실행된 적이 없었다 — 실제 회수는 전부 이쪽이 했다.) */
|
|
47
|
+
const objectUrls = useObjectUrls();
|
|
48
|
+
const sourceButtonsRef = useRef(null);
|
|
49
|
+
const fetchingRef = useRef(false);
|
|
50
|
+
// handlePrev/handleNext/handleJumpTo 세대 토큰 — 빠른 연타로 여러 호출이 겹치면
|
|
51
|
+
// src 교체/load()가 서로 인터리빙되며 "선택된" UI가 실제 재생 중인 트랙과 어긋날 수 있다.
|
|
52
|
+
// 각 호출 시작 시 증가시키고, await 이후 최신 호출인지 확인해 아니면 중단한다.
|
|
53
|
+
const jumpTokenRef = useRef(0);
|
|
54
|
+
const triPathRef = useRef(null);
|
|
55
|
+
/* 듣기 단추 설명 툴팁이 붙을 자리 — 가리키기와 초점 둘 다 받고, 다른 곳을 누르면 닫는다. */
|
|
56
|
+
/* 구조 분해해서 받는다 — `listenBtnRect` 처럼 점을 찍어 쓰면 lint 규칙이 그 객체를
|
|
57
|
+
ref 로 보고 "렌더 중 ref 접근"으로 잘못 짚는다(rect 는 상태다). */
|
|
58
|
+
const { ref: listenBtnRef, rect: listenBtnRect, show: showListenTip, hide: hideListenTip, } = useAnchorRect();
|
|
59
|
+
// 이 컴포넌트는 스텝/페이지 전환마다 key가 바뀌어 완전히 언마운트-재마운트된다.
|
|
60
|
+
// registerAnalyser는 재생 시작 시점에만 호출되고 해제는 없어서, 언마운트 후에도
|
|
61
|
+
// NoisePlayerContext가 이전 스텝의(이미 detach된) analyser를 그대로 들고 있다가
|
|
62
|
+
// 다음 스텝이 재생을 시작하기 전까지 미터에 잔상(ghost reading)이 남는다.
|
|
63
|
+
useEffect(() => {
|
|
64
|
+
return () => {
|
|
65
|
+
registerAnalyserRef.current?.('main', null);
|
|
66
|
+
registerAnalyserRef.current?.('noise', null);
|
|
67
|
+
};
|
|
68
|
+
}, []);
|
|
69
|
+
const [isFetchingUrl, setIsFetchingUrl] = useState(false);
|
|
70
|
+
const [fetchDebugStatus, setFetchDebugStatus] = useState('idle');
|
|
71
|
+
const [playbackState, setPlaybackState] = useState('stopped');
|
|
72
|
+
// 소음 감시(watchdog)에서 참조 — speechSynthesis TTS 재생 중에는 main <audio>가 놀고
|
|
73
|
+
// 있어도 소음이 나오는 게 정상이므로, <audio> 상태 대신 이 값으로 재생 여부를 판단한다.
|
|
74
|
+
const playbackStateRef = useRef('stopped');
|
|
75
|
+
useEffect(() => { playbackStateRef.current = playbackState; }, [playbackState]);
|
|
76
|
+
const [progress, setProgress] = useState(0);
|
|
77
|
+
/* `stateLocal` 은 이 컴포넌트의 상태 기계다 — default · active · load · playMode.
|
|
78
|
+
**'disabled' 는 여기 담지 않는다.** 그건 밖에서 온 prop 이라, 담는 순간 "prop 을
|
|
79
|
+
상태에 베껴 두고 바뀔 때마다 맞추는" 효과가 필요해진다. 그 효과는 낡은 상태로 한 번
|
|
80
|
+
그린 뒤에야 고쳐 주고, 무엇보다 **비활성이 풀릴 때 원래 무엇을 하고 있었는지 잃는다**
|
|
81
|
+
(예전 코드는 무조건 'active' 로 되돌렸다).
|
|
82
|
+
|
|
83
|
+
대신 아래에서 `uiState` 로 겹쳐 읽는다 — 상태 기계는 그대로 두고 화면만 가린다. */
|
|
84
|
+
const [stateLocal, setStateLocal] = useState('active');
|
|
85
|
+
const [sources, setSources] = useState(null);
|
|
86
|
+
const [segments, setSegments] = useState(null);
|
|
87
|
+
const [currentIndex, setCurrentIndex] = useState(0);
|
|
88
|
+
/* 어느 구간 단추를 밝힐 것인가.
|
|
89
|
+
*
|
|
90
|
+
* 한때 번호를 통째로 들고 있었는데, 값이 null 이 아닐 때는 **언제나 `currentIndex` 와
|
|
91
|
+
* 같았다** — 여덟 자리 전부 `setCurrentIndex` 와 나란히 같은 값을 넣고 있었다.
|
|
92
|
+
* 그래서 번호는 `currentIndex` 에서 읽고, 여기서는 **밝힐지 말지만** 든다.
|
|
93
|
+
* 둘을 따로 들면 언젠가 한쪽만 갱신되는 자리가 생긴다(실제로 `goToTrack` 이
|
|
94
|
+
* 번호만 바꾸고 이 값은 효과에 기대고 있었다). */
|
|
95
|
+
const [구간표시, set구간표시] = useState(false);
|
|
96
|
+
const [totalDuration, setTotalDuration] = useState(0);
|
|
97
|
+
// 문장(메인) 재생 속도·볼륨 — 하단 소음설정 툴팁과 공유(NoisePlayerContext)
|
|
98
|
+
const playbackRate = noisePlayer?.playbackRate ?? 1.0;
|
|
99
|
+
const mainVolume = noisePlayer?.mainVolume ?? 1.0;
|
|
100
|
+
const [fillCompletionPhase, setFillCompletionPhase] = useState('idle');
|
|
101
|
+
const [noticeMessage, setNoticeMessage] = useState("");
|
|
102
|
+
const [noticePosition] = useState("top");
|
|
103
|
+
const sourcesRef = useRef(null);
|
|
104
|
+
const currentIndexRef = useRef(0);
|
|
105
|
+
const waveProgressRef = useRef(null);
|
|
106
|
+
/* 진행 표시는 React 를 거치지 않고 DOM 을 직접 만진다 — 초당 예순 번 상태를 바꾸면
|
|
107
|
+
파형 바 300개가 매 프레임 다시 만들어진다. 프레임 사슬을 걸고 끄는 일이 원래
|
|
108
|
+
아홉 군데에 흩어져 있었다. */
|
|
109
|
+
/* 함수만 꺼내 쓴다 — 훅이 돌려주는 객체는 매 렌더 새것이라 그대로 의존성에 넣으면
|
|
110
|
+
이벤트 배선이 매 렌더 다시 붙는다. 안쪽 셋은 useCallback 이라 안정적이다. */
|
|
111
|
+
const { start: startTicker, stop: stopTicker, settleTo: settleTicker, } = useProgressTicker({ audioRef, fillRef, waveProgressRef, sourcesRef, currentIndexRef });
|
|
112
|
+
/* 파형이 자리를 잡을 때까지 기다리는 규칙은 useWaveReady 가 들고 있다 —
|
|
113
|
+
ref 둘·함수 둘에 "준비 안 됨으로 되돌리기"가 일곱 군데 흩어져 있던 것을 모았다. */
|
|
114
|
+
const { onReadyChange: handleWaveReadyChange, waitForReady: waitForWaveReady, markNotReady: markWaveNotReady, } = useWaveReady({ showSoundWaveForm, showNoiseWaveForm });
|
|
115
|
+
const noticeResetRef = useRef(null);
|
|
116
|
+
const disabledRef = useRef(disabled);
|
|
117
|
+
const onDoneRef = useRef(onDone);
|
|
118
|
+
const fillOutResetRef = useRef(null);
|
|
119
|
+
/* 재생이 '끝까지 가서' 끝났는가.
|
|
120
|
+
*
|
|
121
|
+
* 두 벌인 이유가 있다. **ref 는 즉시성**이 필요해서다 — onEnded 와 ✓ 단추가 동시에
|
|
122
|
+
* 들어올 때 중복 호출을 막는 문지기라, 다음 렌더를 기다릴 수 없다. **상태는 화면**이
|
|
123
|
+
* 필요해서다 — 진행 마커의 표시 여부가 이 값에 걸려 있는데, ref 를 렌더 중에 읽으면
|
|
124
|
+
* React 가 다시 그려 주지 않아 화면과 값이 어긋날 수 있다.
|
|
125
|
+
*
|
|
126
|
+
* 그래서 둘을 **반드시 함께** 바꾼다. 직접 대입하지 말고 markCompletedByEnd 를 쓸 것. */
|
|
127
|
+
const completedByEndRef = useRef(false);
|
|
128
|
+
const [completedByEnd, setCompletedByEnd] = useState(false);
|
|
129
|
+
const markCompletedByEnd = useCallback((v) => {
|
|
130
|
+
completedByEndRef.current = v;
|
|
131
|
+
setCompletedByEnd(v);
|
|
132
|
+
}, []);
|
|
133
|
+
const handleEndRef = useRef(null);
|
|
134
|
+
const { activeNoiseUrl, noiseSettingsRef, fadeInNoise, fadeOutNoise } = useNoiseFade({
|
|
135
|
+
noisePlayer,
|
|
136
|
+
audioRef,
|
|
137
|
+
playbackStateRef,
|
|
138
|
+
});
|
|
139
|
+
const { startTTS, stopTTS } = useTTSPlayback({
|
|
140
|
+
ttsText,
|
|
141
|
+
playbackRate,
|
|
142
|
+
mainVolume,
|
|
143
|
+
fillRef,
|
|
144
|
+
waveProgressRef,
|
|
145
|
+
setProgress,
|
|
146
|
+
setPlaybackState,
|
|
147
|
+
setStateLocal,
|
|
148
|
+
fadeInNoise,
|
|
149
|
+
fadeOutNoise,
|
|
150
|
+
noiseSettingsRef,
|
|
151
|
+
onDoneRef,
|
|
152
|
+
handleEndRef,
|
|
153
|
+
});
|
|
154
|
+
const requestedSources = Array.isArray(soundSrc)
|
|
155
|
+
? soundSrc.filter(Boolean)
|
|
156
|
+
: (soundSrc ? [soundSrc] : []);
|
|
157
|
+
const ttsMode = (!requestedSources || requestedSources.length === 0) && !!ttsText;
|
|
158
|
+
const multiSources = Array.isArray(sources) && sources.length > 0 ? sources : (Array.isArray(segments) && segments.length > 0 ? segments : null);
|
|
159
|
+
const sourceButtonCount = Math.max(Array.isArray(multiSources) ? multiSources.length : 0, requestedSources.length);
|
|
160
|
+
// resolveMapping 제거됨 — JSON 파일 의존성 없이 resolveSoundPath(code, bucketPath) 로 직접 경로 결정
|
|
161
|
+
const tryPlayWithRetry = useCallback(async (a, attempts = 3, delayMs = 50) => {
|
|
162
|
+
for (let i = 0; i < attempts; i++) {
|
|
163
|
+
try {
|
|
164
|
+
await a.play();
|
|
165
|
+
return true;
|
|
166
|
+
}
|
|
167
|
+
catch (err) {
|
|
168
|
+
const errName = err instanceof Error ? err.name : (typeof err === 'object' && err && 'name' in err ? err.name : undefined);
|
|
169
|
+
if (errName === 'AbortError') {
|
|
170
|
+
await new Promise((res) => setTimeout(res, delayMs));
|
|
171
|
+
continue;
|
|
172
|
+
}
|
|
173
|
+
if (import.meta.env?.DEV)
|
|
174
|
+
console.warn('TrainingStepAudioPlayer: play failed (non-abort)', err);
|
|
175
|
+
// 브라우저 자동재생 정책 등으로 play()가 최종 거부되면 호출부 대부분이 반환값을
|
|
176
|
+
// 그냥 버려 사용자는 아무 반응 없이 조용히 실패한 것처럼 보인다 — fetch 실패와
|
|
177
|
+
// 동일한 Toast 채널로 재생 실패도 알린다.
|
|
178
|
+
try {
|
|
179
|
+
setNoticeMessage(t('training.audioFetchError', '사운드 소스를 가져오지 못했습니다.'));
|
|
180
|
+
}
|
|
181
|
+
catch (_) { }
|
|
182
|
+
return false;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
if (import.meta.env?.DEV)
|
|
186
|
+
console.warn("TrainingStepAudioPlayer: play failed after retries", { src: a.src });
|
|
187
|
+
try {
|
|
188
|
+
setNoticeMessage(t('training.audioFetchError', '사운드 소스를 가져오지 못했습니다.'));
|
|
189
|
+
}
|
|
190
|
+
catch (_) { }
|
|
191
|
+
return false;
|
|
192
|
+
}, [t]);
|
|
193
|
+
const attachAudioListeners = useCallback(() => {
|
|
194
|
+
const a = audioRef.current;
|
|
195
|
+
if (!a)
|
|
196
|
+
return;
|
|
197
|
+
const onPlay = () => {
|
|
198
|
+
setPlaybackState("playing");
|
|
199
|
+
setStateLocal("playMode");
|
|
200
|
+
set구간표시(true);
|
|
201
|
+
startTicker();
|
|
202
|
+
// 미터: 재생 제스처 시점에 context resume 후 메인 analyser 등록(무음 방지)
|
|
203
|
+
try {
|
|
204
|
+
resumeAudioMeter();
|
|
205
|
+
registerAnalyserRef.current?.('main', getElementAnalyser(a));
|
|
206
|
+
}
|
|
207
|
+
catch (e) { }
|
|
208
|
+
// 소음 동기 시작
|
|
209
|
+
const ns = noiseSettingsRef.current;
|
|
210
|
+
if (ns?.enabled && (ns?.level ?? 0) > 0) {
|
|
211
|
+
fadeInNoise(ns.level / 9);
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
const onPause = () => {
|
|
215
|
+
// 두 가지 경우 무시:
|
|
216
|
+
// 1. 오디오 자연 종료: 브라우저는 ended 이전에 pause 를 발생시킵니다. a.ended 로 감지합니다.
|
|
217
|
+
// 2. handleEnd 가 a.pause() 를 호출한 이후: completedByEndRef 가 true 입니다.
|
|
218
|
+
if (shouldIgnorePause({ ended: !!a?.ended, completedByEnd: completedByEndRef.current }))
|
|
219
|
+
return;
|
|
220
|
+
setPlaybackState("paused");
|
|
221
|
+
stopTicker();
|
|
222
|
+
// 소음 동기 일시정지
|
|
223
|
+
fadeOutNoise();
|
|
224
|
+
};
|
|
225
|
+
const onEnded = () => {
|
|
226
|
+
try {
|
|
227
|
+
const sref = sourcesRef.current;
|
|
228
|
+
const next = nextTrackIndex(sref, currentIndexRef.current);
|
|
229
|
+
if (next !== null) {
|
|
230
|
+
currentIndexRef.current = next;
|
|
231
|
+
setCurrentIndex(next);
|
|
232
|
+
set구간표시(true);
|
|
233
|
+
const nextSrc = sref?.[next] && sref[next].src;
|
|
234
|
+
if (nextSrc && a) {
|
|
235
|
+
a.src = nextSrc;
|
|
236
|
+
a.load();
|
|
237
|
+
tryPlayWithRetry(a).catch(() => { });
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
catch (e) { }
|
|
243
|
+
setPlaybackState("stopped");
|
|
244
|
+
setProgress(1);
|
|
245
|
+
try {
|
|
246
|
+
if (a)
|
|
247
|
+
try {
|
|
248
|
+
a.currentTime = 0;
|
|
249
|
+
}
|
|
250
|
+
catch (e) { }
|
|
251
|
+
}
|
|
252
|
+
catch (e) { }
|
|
253
|
+
stopTicker();
|
|
254
|
+
set구간표시(false);
|
|
255
|
+
// 마지막 트랙 종료 시 소음 정지
|
|
256
|
+
fadeOutNoise();
|
|
257
|
+
// Route through handleEnd (via ref) so stateLocal transitions to 'active' before onDone fires.
|
|
258
|
+
// Direct onDoneRef.current(true) would fire while stateLocal === 'playMode'.
|
|
259
|
+
try {
|
|
260
|
+
if (!disabledRef.current && handleEndRef.current)
|
|
261
|
+
handleEndRef.current();
|
|
262
|
+
}
|
|
263
|
+
catch (e) { }
|
|
264
|
+
};
|
|
265
|
+
a.addEventListener("play", onPlay);
|
|
266
|
+
a.addEventListener("pause", onPause);
|
|
267
|
+
a.addEventListener("ended", onEnded);
|
|
268
|
+
return () => {
|
|
269
|
+
try {
|
|
270
|
+
a.removeEventListener("play", onPlay);
|
|
271
|
+
a.removeEventListener("pause", onPause);
|
|
272
|
+
a.removeEventListener("ended", onEnded);
|
|
273
|
+
stopTicker();
|
|
274
|
+
}
|
|
275
|
+
catch (e) { }
|
|
276
|
+
};
|
|
277
|
+
}, [fadeInNoise, fadeOutNoise, tryPlayWithRetry, noiseSettingsRef, startTicker, stopTicker]);
|
|
278
|
+
useEffect(() => {
|
|
279
|
+
const cleanup = attachAudioListeners();
|
|
280
|
+
return cleanup;
|
|
281
|
+
}, [attachAudioListeners]);
|
|
282
|
+
useEffect(() => {
|
|
283
|
+
disabledRef.current = disabled;
|
|
284
|
+
}, [disabled]);
|
|
285
|
+
useEffect(() => {
|
|
286
|
+
onDoneRef.current = onDone;
|
|
287
|
+
}, [onDone]);
|
|
288
|
+
useEffect(() => {
|
|
289
|
+
/* 비활성이면 그리지 않는다 — 예전에는 `stateLocal` 이 'disabled' 를 담고 있어
|
|
290
|
+
이 한 줄로 걸러졌다. 이제 prop 을 직접 본다. */
|
|
291
|
+
if (disabled || stateLocal !== 'active')
|
|
292
|
+
return;
|
|
293
|
+
const p = triPathRef.current;
|
|
294
|
+
if (!p)
|
|
295
|
+
return;
|
|
296
|
+
let styleEl = null;
|
|
297
|
+
const raf = requestAnimationFrame(() => {
|
|
298
|
+
try {
|
|
299
|
+
const L = p.getTotalLength();
|
|
300
|
+
if (!L)
|
|
301
|
+
return;
|
|
302
|
+
const gap = L * 0.20;
|
|
303
|
+
p.style.strokeDasharray = `${L - gap} ${gap}`;
|
|
304
|
+
const id = 'triFlow_' + Math.random().toString(36).slice(2);
|
|
305
|
+
styleEl = document.createElement('style');
|
|
306
|
+
styleEl.textContent = `@keyframes ${id}{from{stroke-dashoffset:0}to{stroke-dashoffset:-${L}}}`;
|
|
307
|
+
document.head.appendChild(styleEl);
|
|
308
|
+
p.style.animation = `${id} 2.4s linear infinite`;
|
|
309
|
+
}
|
|
310
|
+
catch (e) { }
|
|
311
|
+
});
|
|
312
|
+
return () => { cancelAnimationFrame(raf); styleEl?.remove(); };
|
|
313
|
+
}, [stateLocal, disabled]);
|
|
314
|
+
useEffect(() => { sourcesRef.current = sources; }, [sources]);
|
|
315
|
+
useEffect(() => { currentIndexRef.current = currentIndex; }, [currentIndex]);
|
|
316
|
+
useEffect(() => {
|
|
317
|
+
const btnsEl = btnsRef.current;
|
|
318
|
+
const srcWrap = sourceButtonsRef.current;
|
|
319
|
+
if (!btnsEl || !srcWrap)
|
|
320
|
+
return;
|
|
321
|
+
let ro = null;
|
|
322
|
+
const MIN_BUTTON = 32;
|
|
323
|
+
const MAX_BUTTON = 60;
|
|
324
|
+
const calc = () => {
|
|
325
|
+
try {
|
|
326
|
+
const children = Array.from(btnsEl.querySelectorAll(':scope > .button'));
|
|
327
|
+
let occupied = 0;
|
|
328
|
+
children.forEach((el) => {
|
|
329
|
+
if (el === srcWrap)
|
|
330
|
+
return;
|
|
331
|
+
const r = el.getBoundingClientRect();
|
|
332
|
+
occupied += r.width;
|
|
333
|
+
});
|
|
334
|
+
const total = btnsEl.getBoundingClientRect().width;
|
|
335
|
+
const available = Math.max(0, Math.floor(total - occupied - 8));
|
|
336
|
+
const count = sourceButtonCount;
|
|
337
|
+
if (!count || available <= 0) {
|
|
338
|
+
Array.from(srcWrap.children).forEach((c) => { try {
|
|
339
|
+
c.style.width = '';
|
|
340
|
+
}
|
|
341
|
+
catch { } });
|
|
342
|
+
return;
|
|
343
|
+
}
|
|
344
|
+
let per = Math.floor(available / count);
|
|
345
|
+
if (per > MAX_BUTTON)
|
|
346
|
+
per = MAX_BUTTON;
|
|
347
|
+
if (per < MIN_BUTTON)
|
|
348
|
+
per = Math.max(MIN_BUTTON, Math.floor(available / count));
|
|
349
|
+
const btnEls = Array.from(srcWrap.querySelectorAll('.button'));
|
|
350
|
+
btnEls.forEach((b) => { try {
|
|
351
|
+
b.style.width = `${per}px`;
|
|
352
|
+
}
|
|
353
|
+
catch (e) { } });
|
|
354
|
+
}
|
|
355
|
+
catch (e) { }
|
|
356
|
+
};
|
|
357
|
+
const rafId = requestAnimationFrame(calc);
|
|
358
|
+
try {
|
|
359
|
+
ro = new ResizeObserver(() => { requestAnimationFrame(calc); });
|
|
360
|
+
ro.observe(btnsEl);
|
|
361
|
+
ro.observe(srcWrap);
|
|
362
|
+
window.addEventListener('resize', calc);
|
|
363
|
+
}
|
|
364
|
+
catch (e) { }
|
|
365
|
+
return () => {
|
|
366
|
+
try {
|
|
367
|
+
cancelAnimationFrame(rafId);
|
|
368
|
+
}
|
|
369
|
+
catch (e) { }
|
|
370
|
+
try {
|
|
371
|
+
if (ro) {
|
|
372
|
+
ro.disconnect();
|
|
373
|
+
ro = null;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
catch (e) { }
|
|
377
|
+
try {
|
|
378
|
+
window.removeEventListener('resize', calc);
|
|
379
|
+
}
|
|
380
|
+
catch (e) { }
|
|
381
|
+
};
|
|
382
|
+
}, [sources, segments, sourceButtonCount]);
|
|
383
|
+
/* 남은 타이머 정리. 프레임 사슬은 여기서 안 건드린다 — useProgressTicker 가 스스로
|
|
384
|
+
떠날 때 멈춘다. 두 곳에서 멈추면 "어디서 멈추는가"가 다시 흩어진다. */
|
|
385
|
+
useEffect(() => {
|
|
386
|
+
return () => {
|
|
387
|
+
try {
|
|
388
|
+
if (noticeResetRef.current) {
|
|
389
|
+
clearTimeout(noticeResetRef.current);
|
|
390
|
+
noticeResetRef.current = null;
|
|
391
|
+
}
|
|
392
|
+
if (fillOutResetRef.current) {
|
|
393
|
+
clearTimeout(fillOutResetRef.current);
|
|
394
|
+
fillOutResetRef.current = null;
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
catch (e) { }
|
|
398
|
+
};
|
|
399
|
+
}, []);
|
|
400
|
+
/**
|
|
401
|
+
* TTS URL 리졸버가 반환한 직접 URL을 오디오 소스로 준비합니다.
|
|
402
|
+
* soundSrc 없이 ttsText → URL 변환 후 일반 오디오 플로우로 진입할 때 사용합니다.
|
|
403
|
+
*/
|
|
404
|
+
/**
|
|
405
|
+
* 걸어 놓은 소리를 실제로 재생하기까지 — 한 벌뿐이다.
|
|
406
|
+
*
|
|
407
|
+
* 한 소리짜리 경로와 여러 소리짜리 경로가 같은 스무 줄을 각자 들고 있었다. 차례가
|
|
408
|
+
* 중요하다: **스피너는 파형까지 준비된 뒤에 끈다.** 먼저 끄면 스피너가 사라진 자리에
|
|
409
|
+
* 파형이 뒤늦게 나타나는 빈 화면 구간이 생긴다.
|
|
410
|
+
*/
|
|
411
|
+
/**
|
|
412
|
+
* 새로 만든 소스 목록을 화면과 ref 에 한꺼번에 앉힌다.
|
|
413
|
+
*
|
|
414
|
+
* 세 갈래(단일 TTS·복수 TTS·저장소 소스)가 이 네 줄을 각자 들고 있었고 **둘씩 어긋나
|
|
415
|
+
* 있었다.** 하나는 구간 길이를 `|| 0` 없이 넘겼고(길이를 모르면 undefined 가 흘렀다),
|
|
416
|
+
* 다른 하나는 `sourcesRef` 를 즉시 안 채워 다음 렌더까지 옛 목록을 들고 있었다
|
|
417
|
+
* (재생 중 트랙 번호를 그 ref 로 읽는다). 한 벌로 모아 그 두 어긋남을 없앤다.
|
|
418
|
+
*/
|
|
419
|
+
const applySources = (finalSources, total) => {
|
|
420
|
+
setSources(finalSources);
|
|
421
|
+
setTotalDuration(total);
|
|
422
|
+
markWaveNotReady();
|
|
423
|
+
setSegments(buildSegments(finalSources));
|
|
424
|
+
/* 즉시 채운다 — 아래에서 이어지는 재생이 다음 렌더를 기다리지 않고 이 값을 읽는다. */
|
|
425
|
+
sourcesRef.current = finalSources;
|
|
426
|
+
};
|
|
427
|
+
const loadAndPlay = async (a, src) => {
|
|
428
|
+
markCompletedByEnd(false);
|
|
429
|
+
fetchingRef.current = false;
|
|
430
|
+
a.src = src;
|
|
431
|
+
a.load();
|
|
432
|
+
await waitForCanPlay(a);
|
|
433
|
+
await waitForWaveReady();
|
|
434
|
+
setIsFetchingUrl(false);
|
|
435
|
+
await tryPlayWithRetry(a);
|
|
436
|
+
setStateLocal('playMode');
|
|
437
|
+
setCurrentIndex(0);
|
|
438
|
+
set구간표시(true);
|
|
439
|
+
};
|
|
440
|
+
const fetchAndPrepareFromTTSUrl = async (ttsUrl, playAfterLoad = false) => {
|
|
441
|
+
const a = audioRef.current;
|
|
442
|
+
setIsFetchingUrl(true);
|
|
443
|
+
setFetchDebugStatus('measuring_duration');
|
|
444
|
+
try {
|
|
445
|
+
// 오디오 길이 측정 — 에러 시 reject 하여 outer catch 로 전달합니다. (10초 — 서버 응답 대기)
|
|
446
|
+
const dur = await measureAudioDuration(ttsUrl, { timeoutMs: 10000, rejectOnError: true });
|
|
447
|
+
const finalSources = [{ src: ttsUrl, objectUrl: null, duration: dur }];
|
|
448
|
+
applySources(finalSources, dur);
|
|
449
|
+
setFetchDebugStatus('ready');
|
|
450
|
+
if (playAfterLoad && a)
|
|
451
|
+
await loadAndPlay(a, ttsUrl);
|
|
452
|
+
}
|
|
453
|
+
finally {
|
|
454
|
+
fetchingRef.current = false;
|
|
455
|
+
setIsFetchingUrl(false);
|
|
456
|
+
}
|
|
457
|
+
};
|
|
458
|
+
/**
|
|
459
|
+
* 여러 TTS URL을 한 번에 로드하여 multi-source 재생 (1, 2, ...)
|
|
460
|
+
*/
|
|
461
|
+
const fetchAndPrepareFromMultipleTTSUrls = async (ttsUrls, playAfterLoad = false) => {
|
|
462
|
+
const a = audioRef.current;
|
|
463
|
+
setIsFetchingUrl(true);
|
|
464
|
+
setFetchDebugStatus('measuring_duration');
|
|
465
|
+
try {
|
|
466
|
+
// 각 URL의 duration을 병렬로 측정 (실패한 URL은 0초로 계속)
|
|
467
|
+
const durations = await Promise.all(ttsUrls.map(url => measureAudioDuration(url, { timeoutMs: 10000 })));
|
|
468
|
+
const finalSources = ttsUrls.map((src, i) => ({ src, objectUrl: null, duration: durations[i] || 0 }));
|
|
469
|
+
applySources(finalSources, totalDurationOf(finalSources));
|
|
470
|
+
setFetchDebugStatus('ready');
|
|
471
|
+
if (playAfterLoad && a && finalSources.length > 0)
|
|
472
|
+
await loadAndPlay(a, finalSources[0].src);
|
|
473
|
+
}
|
|
474
|
+
finally {
|
|
475
|
+
fetchingRef.current = false;
|
|
476
|
+
setIsFetchingUrl(false);
|
|
477
|
+
}
|
|
478
|
+
};
|
|
479
|
+
const fetchAndPrepare = async (playAfterLoad = false, showSpinner = true) => {
|
|
480
|
+
const a = audioRef.current;
|
|
481
|
+
const candidates = soundSrc ? (Array.isArray(soundSrc) ? soundSrc : [soundSrc]) : [];
|
|
482
|
+
if (!candidates || candidates.length === 0 || !candidates.some(Boolean))
|
|
483
|
+
return;
|
|
484
|
+
if (fetchingRef.current)
|
|
485
|
+
return;
|
|
486
|
+
fetchingRef.current = true;
|
|
487
|
+
if (showSpinner)
|
|
488
|
+
setIsFetchingUrl(true);
|
|
489
|
+
setFetchDebugStatus('resolving');
|
|
490
|
+
try {
|
|
491
|
+
// ── 1단계: 소리 지정을 한 모양으로 편다 (순수 계산 — audioPlaybackRules) ──
|
|
492
|
+
const built = normalizeSources(soundSrc, bucketPath, resolveSoundPath);
|
|
493
|
+
// ── 2단계: 경로 → URL 취득 (resolveUrl → 실패 시 download fallback) ──────
|
|
494
|
+
const finalSources = [];
|
|
495
|
+
let total = 0;
|
|
496
|
+
for (const b of built) {
|
|
497
|
+
let srcUrl = b.src ?? null;
|
|
498
|
+
let objUrl = null;
|
|
499
|
+
if (!srcUrl && b.resolvedPath) {
|
|
500
|
+
// resolveUrl 로 스트리밍 URL 취득 시도 (signed URL 또는 public URL)
|
|
501
|
+
try {
|
|
502
|
+
setFetchDebugStatus('getting_signed_url');
|
|
503
|
+
srcUrl = await getSignedOrPublicUrl(b.resolvedPath);
|
|
504
|
+
}
|
|
505
|
+
catch (e) {
|
|
506
|
+
srcUrl = null;
|
|
507
|
+
}
|
|
508
|
+
// resolveUrl 실패 시 blob 다운로드로 폴백
|
|
509
|
+
if (!srcUrl) {
|
|
510
|
+
try {
|
|
511
|
+
setFetchDebugStatus('downloading');
|
|
512
|
+
const blob = await downloadSound(b.resolvedPath);
|
|
513
|
+
if (blob) {
|
|
514
|
+
const blobObj = blob instanceof Blob ? blob : new Blob([blob]);
|
|
515
|
+
objUrl = objectUrls.track(URL.createObjectURL(blobObj));
|
|
516
|
+
srcUrl = objUrl;
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
catch (e) {
|
|
520
|
+
setFetchDebugStatus('error');
|
|
521
|
+
try {
|
|
522
|
+
setNoticeMessage(t('training.audioFetchError', '사운드 소스를 가져오지 못했습니다.'));
|
|
523
|
+
setStateLocal('active');
|
|
524
|
+
}
|
|
525
|
+
catch (_) { }
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
if (!srcUrl)
|
|
530
|
+
continue;
|
|
531
|
+
// 오디오 길이 측정 (네트워크 무응답 대비 3초 타임아웃, 실패 시 0초로 계속)
|
|
532
|
+
let dur = 0;
|
|
533
|
+
try {
|
|
534
|
+
setFetchDebugStatus('measuring_duration');
|
|
535
|
+
dur = await measureAudioDuration(srcUrl, { timeoutMs: 3000 });
|
|
536
|
+
}
|
|
537
|
+
catch (_) {
|
|
538
|
+
dur = 0;
|
|
539
|
+
}
|
|
540
|
+
total += dur || 0;
|
|
541
|
+
finalSources.push({ ...b, src: srcUrl, objectUrl: objUrl, duration: dur });
|
|
542
|
+
}
|
|
543
|
+
applySources(finalSources, total);
|
|
544
|
+
if (finalSources.length > 0 && playAfterLoad && a) {
|
|
545
|
+
const first = finalSources[0];
|
|
546
|
+
markCompletedByEnd(false);
|
|
547
|
+
try {
|
|
548
|
+
// 교체된 이전 소스들의 blob 주소 회수 — 새 소스 목록에 남은 것만 유지
|
|
549
|
+
objectUrls.keepOnly(finalSources.map(f => f.objectUrl));
|
|
550
|
+
}
|
|
551
|
+
catch (_) { }
|
|
552
|
+
setFetchDebugStatus('ready');
|
|
553
|
+
fetchingRef.current = false;
|
|
554
|
+
if (first.src && a) {
|
|
555
|
+
try {
|
|
556
|
+
a.src = first.src;
|
|
557
|
+
a.load();
|
|
558
|
+
// canplay 이벤트 대기 — load() 직후 play() 호출 시 발생하는 AbortError 방지.
|
|
559
|
+
// 짧은 파일도 canplay가 빠르게 발생하므로 재생 지연 없음.
|
|
560
|
+
// (같은 기다림이 이 파일 위쪽에 waitForCanPlay 로 이미 있었다. 여기에 한 벌
|
|
561
|
+
// 더 적혀 있어, 기본 대기 시간을 고치면 한쪽만 바뀌는 자리였다.)
|
|
562
|
+
await waitForCanPlay(a);
|
|
563
|
+
await waitForWaveReady();
|
|
564
|
+
// 스피너는 waveform까지 준비된 뒤(재생 직전)에 해제 — 짧은 단어 파일의 경우
|
|
565
|
+
// 재생 중/후까지 스피너가 보이는 현상도, 스피너가 사라진 뒤 waveform이
|
|
566
|
+
// 뒤늦게 나타나는 빈 화면 구간도 생기지 않도록 한다.
|
|
567
|
+
if (showSpinner)
|
|
568
|
+
setIsFetchingUrl(false);
|
|
569
|
+
if (a)
|
|
570
|
+
await tryPlayWithRetry(a);
|
|
571
|
+
}
|
|
572
|
+
catch (e) {
|
|
573
|
+
if (showSpinner)
|
|
574
|
+
setIsFetchingUrl(false);
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
else {
|
|
578
|
+
if (showSpinner)
|
|
579
|
+
setIsFetchingUrl(false);
|
|
580
|
+
}
|
|
581
|
+
setStateLocal('playMode');
|
|
582
|
+
setCurrentIndex(0);
|
|
583
|
+
set구간표시(true);
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
finally {
|
|
587
|
+
fetchingRef.current = false;
|
|
588
|
+
if (showSpinner)
|
|
589
|
+
setIsFetchingUrl(false);
|
|
590
|
+
setFetchDebugStatus((prev) => (prev === 'ready' ? 'ready' : 'idle'));
|
|
591
|
+
}
|
|
592
|
+
};
|
|
593
|
+
const handleToggle = async () => {
|
|
594
|
+
const a = audioRef.current;
|
|
595
|
+
if (!a && !ttsMode)
|
|
596
|
+
return;
|
|
597
|
+
// TTS mode: TTS URL 리졸버가 있으면 오디오 파일로 변환(waveform 지원),
|
|
598
|
+
// 없으면 기존 speechSynthesis fallback
|
|
599
|
+
if (ttsMode) {
|
|
600
|
+
const synth = window.speechSynthesis;
|
|
601
|
+
if (stateLocal === 'active') {
|
|
602
|
+
const resolver = getTTSUrlResolver();
|
|
603
|
+
// ttsText가 배열인 경우: 모든 텍스트의 URL을 미리 resolve해서 multi-source 재생
|
|
604
|
+
const ttsArr = Array.isArray(ttsText) ? ttsText.filter(Boolean) : (ttsText ? [ttsText] : []);
|
|
605
|
+
if (resolver && ttsArr.length > 0) {
|
|
606
|
+
/* 리졸버(문장 TTS는 서버 합성까지 기다린다)가 느릴 수 있어 스피너를 먼저 켠다 —
|
|
607
|
+
fetchAndPrepare 가 켜기 전 합성 대기 구간에 아무 표시가 없던 문제.
|
|
608
|
+
|
|
609
|
+
한 문장이냐 여러 문장이냐로 아래 두 줄만 갈리는데, 한때 이 스무 줄 전체가
|
|
610
|
+
두 벌로 있었다. 감싸개는 한 벌이면 된다. */
|
|
611
|
+
setStateLocal('load');
|
|
612
|
+
setIsFetchingUrl(true);
|
|
613
|
+
setFetchDebugStatus('resolving');
|
|
614
|
+
fetchingRef.current = true;
|
|
615
|
+
try {
|
|
616
|
+
const urls = await Promise.all(ttsArr.map(t => Promise.resolve(resolver(t))));
|
|
617
|
+
if (urls.length > 1)
|
|
618
|
+
await fetchAndPrepareFromMultipleTTSUrls(urls, true);
|
|
619
|
+
else
|
|
620
|
+
await fetchAndPrepareFromTTSUrl(urls[0], true);
|
|
621
|
+
}
|
|
622
|
+
catch (e) {
|
|
623
|
+
// 리졸버·길이 측정이 실패하면 브라우저 음성 합성으로 물러선다 — 소리는 나야 한다
|
|
624
|
+
fetchingRef.current = false;
|
|
625
|
+
setIsFetchingUrl(false);
|
|
626
|
+
setStateLocal('active');
|
|
627
|
+
startTTS(ttsArr[0] || undefined);
|
|
628
|
+
}
|
|
629
|
+
return;
|
|
630
|
+
}
|
|
631
|
+
// 리졸버 미설정 → 기존 speechSynthesis
|
|
632
|
+
startTTS(ttsArr[0] || undefined);
|
|
633
|
+
return;
|
|
634
|
+
}
|
|
635
|
+
// playMode 중 일시정지/재개
|
|
636
|
+
if (stateLocal === 'playMode') {
|
|
637
|
+
// 오디오 파일로 변환된 경우 audioRef로 제어
|
|
638
|
+
if (a) {
|
|
639
|
+
if (a.paused) {
|
|
640
|
+
// 전부 들은 뒤 다시 재생 — 마지막 트랙 이어듣기가 아니라 처음(1번)부터
|
|
641
|
+
// 다시 시작한다(일반 오디오 분기와 동일한 처리).
|
|
642
|
+
if (completedByEndRef.current) {
|
|
643
|
+
await handleReplay();
|
|
644
|
+
return;
|
|
645
|
+
}
|
|
646
|
+
await tryPlayWithRetry(a);
|
|
647
|
+
setPlaybackState('playing');
|
|
648
|
+
}
|
|
649
|
+
else {
|
|
650
|
+
a.pause();
|
|
651
|
+
setPlaybackState('paused');
|
|
652
|
+
}
|
|
653
|
+
return;
|
|
654
|
+
}
|
|
655
|
+
// speechSynthesis fallback
|
|
656
|
+
try {
|
|
657
|
+
if (synth && synth.paused) {
|
|
658
|
+
try {
|
|
659
|
+
synth.resume();
|
|
660
|
+
setPlaybackState('playing');
|
|
661
|
+
}
|
|
662
|
+
catch (e) { }
|
|
663
|
+
}
|
|
664
|
+
else {
|
|
665
|
+
try {
|
|
666
|
+
synth.pause();
|
|
667
|
+
setPlaybackState('paused');
|
|
668
|
+
}
|
|
669
|
+
catch (e) { }
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
catch (e) { }
|
|
673
|
+
}
|
|
674
|
+
return;
|
|
675
|
+
}
|
|
676
|
+
if (stateLocal === "active") {
|
|
677
|
+
/* 비활성인 채로 소스가 이미 준비돼 있으면 다시 받지 않고 그것부터 튼다.
|
|
678
|
+
(예전에는 `stateLocal === 'disabled'` 로 판정했다 — 같은 뜻이다.) */
|
|
679
|
+
if (disabled && Array.isArray(sourcesRef.current) && sourcesRef.current.length > 0) {
|
|
680
|
+
const first = sourcesRef.current[0];
|
|
681
|
+
try {
|
|
682
|
+
if (first.src && a) {
|
|
683
|
+
try {
|
|
684
|
+
a.src = first.src;
|
|
685
|
+
a.load();
|
|
686
|
+
if (a)
|
|
687
|
+
await tryPlayWithRetry(a);
|
|
688
|
+
}
|
|
689
|
+
catch (e) { }
|
|
690
|
+
}
|
|
691
|
+
setStateLocal('playMode');
|
|
692
|
+
setCurrentIndex(0);
|
|
693
|
+
set구간표시(true);
|
|
694
|
+
return;
|
|
695
|
+
}
|
|
696
|
+
catch (e) { }
|
|
697
|
+
}
|
|
698
|
+
setStateLocal("load");
|
|
699
|
+
await fetchAndPrepare(true);
|
|
700
|
+
return;
|
|
701
|
+
}
|
|
702
|
+
if (stateLocal === "load")
|
|
703
|
+
return;
|
|
704
|
+
if (stateLocal === "playMode" || stateLocal === "active") {
|
|
705
|
+
try {
|
|
706
|
+
if (a && a.paused) {
|
|
707
|
+
if (completedByEndRef.current) {
|
|
708
|
+
await handleReplay();
|
|
709
|
+
return;
|
|
710
|
+
}
|
|
711
|
+
if (a)
|
|
712
|
+
await tryPlayWithRetry(a);
|
|
713
|
+
setPlaybackState("playing");
|
|
714
|
+
}
|
|
715
|
+
else {
|
|
716
|
+
if (a) {
|
|
717
|
+
a.pause();
|
|
718
|
+
setPlaybackState("paused");
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
catch (e) {
|
|
723
|
+
const errName = e instanceof Error ? e.name : (typeof e === 'object' && e && 'name' in e ? e.name : undefined);
|
|
724
|
+
if (errName !== 'AbortError' && import.meta.env?.DEV) {
|
|
725
|
+
console.warn('TrainingStepAudioPlayer: toggle failed', e);
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
};
|
|
730
|
+
const handleReplay = async () => {
|
|
731
|
+
const a = audioRef.current;
|
|
732
|
+
if (!a)
|
|
733
|
+
return;
|
|
734
|
+
try {
|
|
735
|
+
// 멀티소스: 전부 들은 뒤(또는 재생 도중) 다시 재생하면 마지막 트랙이 아니라
|
|
736
|
+
// 맨 처음(1번) 소스부터 다시 시작한다 — src 교체·waveform 대기·재생을 모두
|
|
737
|
+
// 처리하는 handleJumpTo에 위임.
|
|
738
|
+
const sref = sourcesRef.current;
|
|
739
|
+
if (Array.isArray(sref) && sref.length > 1) {
|
|
740
|
+
await handleJumpTo(0);
|
|
741
|
+
return;
|
|
742
|
+
}
|
|
743
|
+
markCompletedByEnd(false);
|
|
744
|
+
try {
|
|
745
|
+
a.currentTime = 0;
|
|
746
|
+
}
|
|
747
|
+
catch (e) { }
|
|
748
|
+
if (a)
|
|
749
|
+
await tryPlayWithRetry(a);
|
|
750
|
+
setPlaybackState('playing');
|
|
751
|
+
setStateLocal('playMode');
|
|
752
|
+
}
|
|
753
|
+
catch (e) { }
|
|
754
|
+
};
|
|
755
|
+
const handleStop = () => {
|
|
756
|
+
if (ttsMode) {
|
|
757
|
+
stopTTS();
|
|
758
|
+
return;
|
|
759
|
+
}
|
|
760
|
+
const a = audioRef.current;
|
|
761
|
+
try {
|
|
762
|
+
if (a) {
|
|
763
|
+
try {
|
|
764
|
+
a.pause();
|
|
765
|
+
}
|
|
766
|
+
catch (e) { }
|
|
767
|
+
try {
|
|
768
|
+
a.currentTime = 0;
|
|
769
|
+
}
|
|
770
|
+
catch (e) { }
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
catch (e) { }
|
|
774
|
+
fadeOutNoise();
|
|
775
|
+
setPlaybackState('stopped');
|
|
776
|
+
setStateLocal('active');
|
|
777
|
+
setProgress(0);
|
|
778
|
+
set구간표시(false);
|
|
779
|
+
};
|
|
780
|
+
/**
|
|
781
|
+
* 트랙을 갈아 끼우고 재생한다 — 이전·다음·번호 단추가 모두 이 한 벌을 쓴다.
|
|
782
|
+
*
|
|
783
|
+
* 세 벌이 따로 있었고 **`handleJumpTo` 만 `completedByEnd` 를 되돌렸다.** 나머지 둘로
|
|
784
|
+
* 트랙을 옮기면, 앞 문항을 끝까지 들은 뒤에는 그 값이 참인 채로 남아
|
|
785
|
+
*
|
|
786
|
+
* · 진행 마커가 드러나지 않고(`fillVisibleFlag` 가 이 값을 본다)
|
|
787
|
+
* · `pause` 이벤트가 통째로 무시된다(`shouldIgnorePause`)
|
|
788
|
+
*
|
|
789
|
+
* 새 트랙이 재생되는데 화면은 아무 표시도 안 하는 상태가 된다. 소스가 여럿인 훈련에서만
|
|
790
|
+
* 나므로 화면에서 재현하지는 못했고(2026-08-28), 구조로 없앤다.
|
|
791
|
+
*
|
|
792
|
+
* 이동 토큰은 연타 방지다 — 파형을 기다리는 사이 더 최신 이동이 오면 이 호출은 물러선다.
|
|
793
|
+
*/
|
|
794
|
+
const goToTrack = async (index, { sameSegment = false } = {}) => {
|
|
795
|
+
const myToken = ++jumpTokenRef.current;
|
|
796
|
+
const a = audioRef.current;
|
|
797
|
+
const sref = sourcesRef.current;
|
|
798
|
+
const src = sref?.[index]?.src;
|
|
799
|
+
try {
|
|
800
|
+
markCompletedByEnd(false);
|
|
801
|
+
setCurrentIndex(index);
|
|
802
|
+
set구간표시(true); // 재생이 시작되기 전에도 밝힌다 — 예전엔 효과가 해 주던 일
|
|
803
|
+
currentIndexRef.current = index;
|
|
804
|
+
if (!src || !a)
|
|
805
|
+
return;
|
|
806
|
+
// 같은 구간을 다시 트는 것이면 파형은 그대로다 — 괜히 기다리지 않는다.
|
|
807
|
+
if (!sameSegment)
|
|
808
|
+
markWaveNotReady();
|
|
809
|
+
a.src = src;
|
|
810
|
+
a.load();
|
|
811
|
+
if (!sameSegment)
|
|
812
|
+
await waitForWaveReady();
|
|
813
|
+
if (myToken !== jumpTokenRef.current)
|
|
814
|
+
return;
|
|
815
|
+
await tryPlayWithRetry(a);
|
|
816
|
+
if (myToken !== jumpTokenRef.current)
|
|
817
|
+
return;
|
|
818
|
+
setPlaybackState('playing');
|
|
819
|
+
setStateLocal('playMode');
|
|
820
|
+
}
|
|
821
|
+
catch (e) {
|
|
822
|
+
if (import.meta.env?.DEV)
|
|
823
|
+
console.warn('TrainingStepAudioPlayer: 트랙 이동 실패', e);
|
|
824
|
+
}
|
|
825
|
+
};
|
|
826
|
+
const handlePrev = async () => {
|
|
827
|
+
const sref = sourcesRef.current;
|
|
828
|
+
const idx = currentIndexRef.current || 0;
|
|
829
|
+
/* 첫 트랙에서 '이전'은 처음으로 되감기다 — 그건 '다시듣기'와 같은 일이라 그쪽에 맡긴다.
|
|
830
|
+
*
|
|
831
|
+
* 한때 여기에 되감기를 따로 적어 뒀는데 `markCompletedByEnd(false)` 가 빠져 있었다.
|
|
832
|
+
* 그래서 **끝까지 들은 뒤 '이전'을 누르면 소리는 다시 나는데 진행 마커가 안 나왔다**
|
|
833
|
+
* (마커의 표시 여부가 그 값을 본다). 화면에서 재현해 확인했다(2026-08-28). */
|
|
834
|
+
if (!sref || idx <= 0) {
|
|
835
|
+
await handleReplay();
|
|
836
|
+
return;
|
|
837
|
+
}
|
|
838
|
+
await goToTrack(idx - 1);
|
|
839
|
+
};
|
|
840
|
+
const handleNext = async () => {
|
|
841
|
+
const sref = sourcesRef.current;
|
|
842
|
+
const idx = currentIndexRef.current || 0;
|
|
843
|
+
// 마지막 트랙에서 '다음'은 정지다
|
|
844
|
+
if (!sref || idx >= sref.length - 1) {
|
|
845
|
+
handleStop();
|
|
846
|
+
return;
|
|
847
|
+
}
|
|
848
|
+
await goToTrack(idx + 1);
|
|
849
|
+
};
|
|
850
|
+
const handleEnd = () => {
|
|
851
|
+
// Guard: prevent double invocation (e.g. ✓ button + natural onEnded firing at same time)
|
|
852
|
+
if (completedByEndRef.current)
|
|
853
|
+
return;
|
|
854
|
+
const holdDelay = 200;
|
|
855
|
+
const outDelay = 340;
|
|
856
|
+
markCompletedByEnd(true);
|
|
857
|
+
try {
|
|
858
|
+
setProgress(1);
|
|
859
|
+
}
|
|
860
|
+
catch (e) { }
|
|
861
|
+
settleTicker(1);
|
|
862
|
+
try {
|
|
863
|
+
setFillCompletionPhase('hold');
|
|
864
|
+
}
|
|
865
|
+
catch (e) { }
|
|
866
|
+
try {
|
|
867
|
+
const a = audioRef.current;
|
|
868
|
+
// ttsMode가 true여도 fetchAndPrepareFromTTSUrl로 실제 오디오 파일을 재생한 경우
|
|
869
|
+
// (a.src가 설정된 경우)에는 일반 오디오처럼 처리해야 합니다.
|
|
870
|
+
// stopTTS()를 호출하면 즉시 stateLocal='active'로 전환되어 fill 애니메이션이 건너뜁니다.
|
|
871
|
+
const hasTTSAudioSrc = ttsMode && !!(a?.src);
|
|
872
|
+
if (!ttsMode || hasTTSAudioSrc) {
|
|
873
|
+
if (a) {
|
|
874
|
+
a.pause();
|
|
875
|
+
try {
|
|
876
|
+
a.currentTime = 0;
|
|
877
|
+
}
|
|
878
|
+
catch (e) { }
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
else {
|
|
882
|
+
stopTTS(); // pure speechSynthesis path
|
|
883
|
+
}
|
|
884
|
+
fadeOutNoise();
|
|
885
|
+
}
|
|
886
|
+
catch (e) { }
|
|
887
|
+
try {
|
|
888
|
+
setPlaybackState('stopped');
|
|
889
|
+
}
|
|
890
|
+
catch (e) { }
|
|
891
|
+
set구간표시(false);
|
|
892
|
+
if (disabledRef.current)
|
|
893
|
+
return;
|
|
894
|
+
try {
|
|
895
|
+
if (fillOutResetRef.current) {
|
|
896
|
+
clearTimeout(fillOutResetRef.current);
|
|
897
|
+
fillOutResetRef.current = null;
|
|
898
|
+
}
|
|
899
|
+
fillOutResetRef.current = setTimeout(() => {
|
|
900
|
+
try {
|
|
901
|
+
setFillCompletionPhase('out');
|
|
902
|
+
}
|
|
903
|
+
catch (e) { }
|
|
904
|
+
fillOutResetRef.current = setTimeout(() => {
|
|
905
|
+
try {
|
|
906
|
+
if (typeof onDoneRef.current === 'function')
|
|
907
|
+
onDoneRef.current(true);
|
|
908
|
+
}
|
|
909
|
+
catch (e) { }
|
|
910
|
+
try {
|
|
911
|
+
setFillCompletionPhase('idle');
|
|
912
|
+
}
|
|
913
|
+
catch (e) { }
|
|
914
|
+
fillOutResetRef.current = null;
|
|
915
|
+
}, outDelay);
|
|
916
|
+
}, holdDelay);
|
|
917
|
+
}
|
|
918
|
+
catch (e) { }
|
|
919
|
+
};
|
|
920
|
+
// Keep handleEndRef current so the stale onEnded closure (registered once on mount) can
|
|
921
|
+
// always reach the latest handleEnd — avoids calling onDone while stateLocal === 'playMode'.
|
|
922
|
+
/* 위 registerAnalyserRef 와 같은 이유로 렌더가 아니라 효과에서 갱신한다. 이 값을 읽는
|
|
923
|
+
곳은 <audio> 의 'ended' 핸들러 하나뿐이고, 그 이벤트는 커밋 중에 발화하지 않는다. */
|
|
924
|
+
useEffect(() => { handleEndRef.current = handleEnd; });
|
|
925
|
+
const handleClearNotice = useCallback(() => setNoticeMessage(''), []);
|
|
926
|
+
const handleJumpTo = async (index) => {
|
|
927
|
+
const sref = sourcesRef.current || [];
|
|
928
|
+
if (!sref[index])
|
|
929
|
+
return;
|
|
930
|
+
await goToTrack(index, { sameSegment: index === currentIndexRef.current });
|
|
931
|
+
};
|
|
932
|
+
const displayedPlaying = playbackState === "playing";
|
|
933
|
+
const currentSegments = useMemo(() => {
|
|
934
|
+
if (!segments || segments.length <= 1)
|
|
935
|
+
return segments;
|
|
936
|
+
const seg = segments[currentIndex];
|
|
937
|
+
return seg ? [seg] : segments;
|
|
938
|
+
}, [segments, currentIndex]);
|
|
939
|
+
const isDisabled = disabled === true;
|
|
940
|
+
useEffect(() => {
|
|
941
|
+
try {
|
|
942
|
+
const a = audioRef.current;
|
|
943
|
+
if (a && typeof a.playbackRate === 'number')
|
|
944
|
+
a.playbackRate = playbackRate || 1.0;
|
|
945
|
+
}
|
|
946
|
+
catch (e) { }
|
|
947
|
+
}, [playbackRate]);
|
|
948
|
+
// 문장(메인) 볼륨 반영
|
|
949
|
+
useEffect(() => {
|
|
950
|
+
try {
|
|
951
|
+
const a = audioRef.current;
|
|
952
|
+
if (a)
|
|
953
|
+
a.volume = Math.max(0, Math.min(1, mainVolume));
|
|
954
|
+
}
|
|
955
|
+
catch (e) { }
|
|
956
|
+
}, [mainVolume]);
|
|
957
|
+
// fill (진행 마커) 클래스 및 초기 위치 계산 — RAF 루프에서 .style.left를 직접 갱신합니다.
|
|
958
|
+
const isFillHolding = fillCompletionPhase === 'hold';
|
|
959
|
+
const isFillOutAnimating = fillCompletionPhase === 'out';
|
|
960
|
+
const fillVisibleFlag = ((stateLocal === "playMode" && !isFetchingUrl) && !completedByEnd) || isFillHolding || isFillOutAnimating;
|
|
961
|
+
const fillExpandedFlag = playbackState !== "stopped" || isFillHolding || isFillOutAnimating;
|
|
962
|
+
const fillPausedFlag = playbackState === "paused";
|
|
963
|
+
const fillLeftPercent = Math.max(0, Math.min(100, (progress || 0) * 100));
|
|
964
|
+
const fillClass = cx('audio-player__fill', fillVisibleFlag ? 'is-visible' : '', fillExpandedFlag ? 'is-expanded' : '', fillPausedFlag ? 'is-paused' : '', isFillOutAnimating ? 'is-out' : '');
|
|
965
|
+
return (_jsxs("div", { className: `audio-player ${isDisabled ? 'is-disabled' : ''}${className ? ` ${className}` : ''}`, role: "group", "aria-label": typeof label === 'string' ? label : undefined, children: [_jsxs("div", { className: `audio-player__panel ${displayedPlaying ? "is-playing" : ""} ${isFetchingUrl ? "is-loading" : ""} ${stateLocal !== "default" ? "is-revealed" : ""}`, children: [isFetchingUrl ? (_jsxs("div", { className: "audio-player__loading", role: "status", "aria-live": "polite", children: [_jsx("span", { className: "audio-player__loading-spinner", "aria-hidden": "true" }), _jsx("span", { className: "audio-player__loading-text", children: STATUS_MESSAGES[fetchDebugStatus] })] })) : null, stateLocal === "active" ? (_jsx("button", { className: "audio-player__button", type: "button", onClick: () => { hideListenTip(); handleToggle(); }, "aria-label": typeof label === 'string' ? label : t('training.listen', '듣기'), onMouseEnter: showListenTip, onMouseLeave: hideListenTip,
|
|
966
|
+
// 키보드로 이 버튼에 오면 마우스와 동일하게 안내를 띄운다
|
|
967
|
+
onFocus: showListenTip, onBlur: hideListenTip, children: _jsx("span", { ref: listenBtnRef, className: "audio-player__button-triangle-wrap", children: _jsx("svg", { className: "audio-player__button-triangle", viewBox: "0 0 24 24", "aria-hidden": "true", children: _jsx("path", { ref: triPathRef, d: "M13.2 7.7 L16.5 9.85 Q20.2 12 16.5 14.15 L10 18.3 Q7 19.7 7 16.3 L7 7.7 Q7 4.3 10 5.7 L13.2 7.7" }) }) }) })) : null, listenBtnRect && (_jsx(InfoTooltip, { anchorRect: listenBtnRect, text: typeof label === 'string' && label ? label : t('training.listenLabel', '문장 듣기'), offset: 8 })), _jsxs("div", { className: `audio-player__play ${stateLocal === "playMode" || displayedPlaying ? "is-visible" : ""}`, children: [_jsxs("div", { ref: btnsRef, className: "audio-player__buttons", children: [_jsx(Button, { size: 32, showTooltipInfo: true, type: "dot", shape: "pill", useBorder: false, icon: "skip-back", onClick: handlePrev, ariaLabel: t('training.prev', '이전'), width: "60px", variant: "transparent-white", "aria-hidden": "true", tabIndex: -1, disabled: stateLocal !== 'playMode' }), _jsx(Button, { size: 32, showTooltipInfo: true, type: "dot", shape: "pill", useBorder: false, icon: displayedPlaying ? "pause" : "play", onClick: handleToggle, ariaLabel: t('common.playPause', '재생 / 멈춤'), width: "60px", variant: "transparent-white", disabled: stateLocal !== 'playMode' }), _jsx(Button, { size: 32, showTooltipInfo: true, type: "dot", shape: "pill", useBorder: false, icon: "square", onClick: handleStop, ariaLabel: t('training.stop', '정지'), width: "60px", variant: "transparent-white", "aria-hidden": "true", tabIndex: -1, disabled: stateLocal !== 'playMode' }), sourceButtonCount > 1 ? (_jsx("div", { ref: sourceButtonsRef, className: "audio-player__source-buttons", children: Array.from({ length: sourceButtonCount }).map((_, idx) => (_jsx(Button, { size: 32, type: "dot", shape: "pill", useBorder: false, label: String(idx + 1), onClick: () => { try {
|
|
968
|
+
handleJumpTo(idx);
|
|
969
|
+
}
|
|
970
|
+
catch (e) { } }, ariaLabel: t('training.sourcePlay', { n: idx + 1 }), variant: "transparent-white", selected: 구간표시 && currentIndex === idx, disabled: stateLocal !== 'playMode' || !(Array.isArray(sources) && sources[idx]), showTooltipInfo: true }, idx))) })) : null, (!Array.isArray(sources) || sources.length <= 1) ? (_jsx(Button, { size: 32, showTooltipInfo: true, type: "dot", shape: "pill", useBorder: false, icon: "repeat", onClick: handleReplay, ariaLabel: t('common.replay', '다시듣기'), width: "60px", variant: "transparent-white", disabled: stateLocal !== 'playMode' })) : null, _jsx(Button, { size: 32, showTooltipInfo: true, type: "dot", shape: "pill", useBorder: false, icon: "skip-forward", onClick: handleNext, ariaLabel: t('training.next', '다음'), width: "60px", variant: "transparent-white", "aria-hidden": true, tabIndex: -1, disabled: stateLocal !== 'playMode' }), _jsx(Button, { size: 32, showTooltipInfo: true, type: "dot", shape: "pill", useBorder: false, icon: "check", onClick: handleEnd, ariaLabel: t('common.done', '완료'), width: "60px", variant: "transparent-white", disabled: stateLocal !== 'playMode' })] }), _jsxs("div", { className: "audio-player__slider", children: [_jsx("div", { className: fillClass, ref: fillRef, style: { left: `${fillLeftPercent}%` }, "aria-hidden": "true" }), (showSoundWaveForm || showNoiseWaveForm) && (_jsx(WaveForm, { segments: currentSegments, progress: progress, totalDuration: totalDuration, onSegmentClick: handleJumpTo, waveProgressRef: waveProgressRef, showSoundWaveForm: showSoundWaveForm, noiseSrc: (showNoiseWaveForm && noisePlayer?.settings.enabled && (noisePlayer?.settings.level ?? 0) > 0) ? activeNoiseUrl : null, noiseLevel: noisePlayer?.settings.level ?? 0, noiseSpeed: noisePlayer?.settings.speed ?? 1, mainVolume: mainVolume, onReadyChange: handleWaveReadyChange }))] })] }), _jsx("audio", { ref: audioRef, crossOrigin: "anonymous", preload: "auto" })] }), !showSoundWaveForm && (_jsxs("p", { className: "audio-player__no-waveform caption-1", children: [_jsx(Icon, { icon: "triangle-alert", size: 14 }), t('training.noSoundWaveform', '소리 비교 문제는 웨이브폼을 표현하지 않습니다.')] })), _jsx(Toast, { message: noticeMessage, position: noticePosition, onClose: handleClearNotice })] }));
|
|
971
|
+
}
|