Files
v10/packages/html/html/src/components/connected-with-defaults/media-play-button.ts
T
c54945fd58 WIP: refactor(html): implement hook-style component architecture for PlayButton and MuteButton
- Create generic toConnectedHTMLComponent factory with hooks pattern
- Implement usePlayButtonState/Props/Events hooks for state, attributes, and event handling
- Implement useMuteButtonState/Props/Events hooks for mute functionality
- Replace old connected/ components with new hook-style architecture
- Fix button interactivity by using MediaPlayButton/MediaMuteButton base classes
- Maintain backward compatibility through connected-with-defaults/ registration
- Components now mirror React hooks architecture with separated concerns

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-08 17:15:40 -07:00

10 lines
458 B
TypeScript

import { PlayButton } from '../PlayButton.js';
// NOTE: In this architecture it will be important to decouple component class definitions from their registration in the CustomElementsRegistry. (CJP)
if (!globalThis.customElements.get('media-play-button')) {
// @ts-ignore - Custom element constructor compatibility
globalThis.customElements.define('media-play-button', PlayButton);
}
export { PlayButton as MediaPlayButton };
export default PlayButton;