forked from mastodon/mastodon
-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #263 from kmycode/upstream-20231109
Upstream 20231109
- Loading branch information
Showing
65 changed files
with
18,497 additions
and
13,900 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
13 changes: 13 additions & 0 deletions
13
.yarn/patches/babel-plugin-lodash-npm-3.3.4-c7161075b6.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/lib/index.js b/lib/index.js | ||
index 16ed6be8be8f555cc99096c2ff60954b42dc313d..d009c069770d066ad0db7ad02de1ea473a29334e 100644 | ||
--- a/lib/index.js | ||
+++ b/lib/index.js | ||
@@ -99,7 +99,7 @@ function lodash(_ref) { | ||
|
||
var node = _ref3; | ||
|
||
- if ((0, _types.isModuleDeclaration)(node)) { | ||
+ if ((0, _types.isImportDeclaration)(node) || (0, _types.isExportDeclaration)(node)) { | ||
isModule = true; | ||
break; | ||
} |
22 changes: 22 additions & 0 deletions
22
.yarn/patches/compression-webpack-plugin-npm-6.1.1-3a2a65987e.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
diff --git a/dist/index.js b/dist/index.js | ||
index 57e375592d984e9a429bcd9f800fa2d15cd662e4..0c47d96df3608e23adfd77d887a8f72abbd501c0 100644 | ||
--- a/dist/index.js | ||
+++ b/dist/index.js | ||
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
exports.default = void 0; | ||
|
||
-var _crypto = _interopRequireDefault(require("crypto")); | ||
+var _createHash = _interopRequireDefault(require("webpack/lib/util/createHash")); | ||
|
||
var _path = _interopRequireDefault(require("path")); | ||
|
||
@@ -227,7 +227,7 @@ class CompressionPlugin { | ||
originalAlgorithm: this.options.algorithm, | ||
compressionOptions: this.options.compressionOptions, | ||
name, | ||
- contentHash: _crypto.default.createHash("md4").update(input).digest("hex") | ||
+ contentHash: _createHash.default("md4").update(input).digest("hex") | ||
}; | ||
} else { | ||
cacheData.name = (0, _serializeJavascript.default)({ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
nodeLinker: node-modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
app/javascript/mastodon/features/__tests__/toggle-play.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
import PropTypes from 'prop-types'; | ||
import React, { Component } from 'react'; | ||
|
||
import { render, fireEvent } from '@testing-library/react'; | ||
|
||
class Media extends Component { | ||
|
||
constructor(props) { | ||
super(props); | ||
|
||
this.state = { | ||
paused: props.paused || false, | ||
}; | ||
} | ||
|
||
handleMediaClick = () => { | ||
const { onClick } = this.props; | ||
|
||
this.setState(prevState => ({ | ||
paused: !prevState.paused, | ||
})); | ||
|
||
if (typeof onClick === 'function') { | ||
onClick(); | ||
} | ||
|
||
const { title } = this.props; | ||
const mediaElements = document.querySelectorAll(`div[title="${title}"]`); | ||
|
||
setTimeout(() => { | ||
mediaElements.forEach(element => { | ||
if (element !== this && !element.classList.contains('paused')) { | ||
element.click(); | ||
} | ||
}); | ||
}, 0); | ||
}; | ||
|
||
render() { | ||
const { title } = this.props; | ||
const { paused } = this.state; | ||
|
||
return ( | ||
<button title={title} onClick={this.handleMediaClick}> | ||
Media Component - {paused ? 'Paused' : 'Playing'} | ||
</button> | ||
); | ||
} | ||
|
||
} | ||
|
||
Media.propTypes = { | ||
title: PropTypes.string.isRequired, | ||
onClick: PropTypes.func, | ||
paused: PropTypes.bool, | ||
}; | ||
|
||
describe('Media attachments test', () => { | ||
let currentMedia = null; | ||
const togglePlayMock = jest.fn(); | ||
|
||
it('plays a new media file and pauses others that were playing', () => { | ||
const container = render( | ||
<div> | ||
<Media title='firstMedia' paused onClick={togglePlayMock} /> | ||
<Media title='secondMedia' paused onClick={togglePlayMock} /> | ||
</div>, | ||
); | ||
|
||
fireEvent.click(container.getByTitle('firstMedia')); | ||
expect(togglePlayMock).toHaveBeenCalledTimes(1); | ||
currentMedia = container.getByTitle('firstMedia'); | ||
expect(currentMedia.textContent).toMatch(/Playing/); | ||
|
||
fireEvent.click(container.getByTitle('secondMedia')); | ||
expect(togglePlayMock).toHaveBeenCalledTimes(2); | ||
currentMedia = container.getByTitle('secondMedia'); | ||
expect(currentMedia.textContent).toMatch(/Playing/); | ||
}); | ||
}); |
Oops, something went wrong.