Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@uppy/screen-capture: refactor to ESM #3698

Merged
merged 2 commits into from
May 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ module.exports = {
'packages/@uppy/locales/src/**/*.js',
'packages/@uppy/locales/template.js',
'packages/@uppy/progress-bar/src/**/*.js',
'packages/@uppy/screen-capture/src/**/*.js',
'packages/@uppy/svelte/src/**/*.js',
'packages/@uppy/svelte/rollup.config.js',
'packages/@uppy/vue/src/**/*.js',
Expand Down
1 change: 1 addition & 0 deletions packages/@uppy/screen-capture/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"main": "lib/index.js",
"style": "dist/style.min.css",
"types": "types/index.d.ts",
"type": "module",
"keywords": [
"file uploader",
"uppy",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
const { h, Component } = require('preact')
const RecordButton = require('./RecordButton')
const SubmitButton = require('./SubmitButton')
const StopWatch = require('./StopWatch')
const StreamStatus = require('./StreamStatus')
// TODO: rename this file to RecorderScreen.jsx in the next major.
/* eslint-disable react/jsx-props-no-spreading */
import { h, Component } from 'preact'
import RecordButton from './RecordButton.jsx'
import SubmitButton from './SubmitButton.jsx'
import StopWatch from './StopWatch.jsx'
import StreamStatus from './StreamStatus.jsx'

class RecorderScreen extends Component {
componentWillUnmount () {
this.props.onStop()
const { onStop } = this.props
onStop()
}

render () {
Expand Down Expand Up @@ -53,4 +56,4 @@ class RecorderScreen extends Component {
}
}

module.exports = RecorderScreen
export default RecorderScreen
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const { h } = require('preact')
import { h } from 'preact'

/**
* Control screen capture recording. Will show record or stop button.
*/
module.exports = function RecordButton ({ recording, onStartRecording, onStopRecording, i18n }) {
export default function RecordButton ({ recording, onStartRecording, onStopRecording, i18n }) {
if (recording) {
return (
<button
Expand Down
Loading