diff --git a/INSTALLATION.md b/INSTALLATION.md index 9b894d44..b2c0820d 100644 --- a/INSTALLATION.md +++ b/INSTALLATION.md @@ -8,7 +8,7 @@ We welcome users to install and try our Hypertrons Chrome Extension. If you have ### Chrome / Edge -1. Install our extension from [Chrome Web Store](https://chrome.google.com/webstore/detail/hypercrx/ijchfbpdgeljmhnhokmekkecpbdkgabc) or [Edge Extensions Home](https://microsoftedge.microsoft.com/addons/detail/hypercrx/lbbajaehiibofpconjgdjonmkidpcome?hl=zh-CN) +1. Install our extension from [Chrome Web Store](https://chrome.google.com/webstore/detail/hypercrx/ijchfbpdgeljmhnhokmekkecpbdkgabc) or [Edge Extensions Home](https://microsoftedge.microsoft.com/addons/detail/hypercrx/lbbajaehiibofpconjgdjonmkidpcome?hl=zh-CN) [Chrome] Visit [Chrome Web Store](https://chrome.google.com/webstore/detail/hypercrx/ijchfbpdgeljmhnhokmekkecpbdkgabc),and click **[Add to Chrome]**. @@ -46,7 +46,6 @@ We welcome users to install and try our Hypertrons Chrome Extension. If you have - 3. You can change configuration of hypertrons-crx by visiting the setting page:
= 16.14
2. yarn
+
### 快速开始
1. git clone https://github.com/hypertrons/hypertrons-crx
diff --git a/scripts/bump-version.cjs b/scripts/bump-version.cjs
index c28ced5d..89200f31 100644
--- a/scripts/bump-version.cjs
+++ b/scripts/bump-version.cjs
@@ -1,14 +1,15 @@
// according to https://github.com/TriPSs/conventional-changelog-action#pre-commit-hook
// this script should be a CommonJS module
-const semver = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/i
+const semver =
+ /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/i;
-function validate({version}) {
+function validate({ version }) {
// validate if the given version conforms semver
return String(version).match(semver) === null;
}
-function compare({oldVersion, newVersion}) {
+function compare({ oldVersion, newVersion }) {
// compare oldVersion and newVersion number
// return -1 if oldVersion is greater;
// 0 if two versions are equal;
@@ -32,8 +33,10 @@ async function bump({ version, deploy }) {
// update package.json
const pkgPath = 'package.json';
const pkg = await readJson(pkgPath);
- if (compare({oldVersion: pkg.version, newVersion: version}) <= 0) {
- throw new Error('Input version number is not greater than the current version number!');
+ if (compare({ oldVersion: pkg.version, newVersion: version }) <= 0) {
+ throw new Error(
+ 'Input version number is not greater than the current version number!'
+ );
}
pkg.version = version;
writeJson(pkgPath, pkg);
@@ -46,8 +49,15 @@ async function bump({ version, deploy }) {
update_info.chrome.latest_version = version;
update_info.edge.latest_version = version;
}
- if (compare({oldVersion: update_info.develop.latest_version, newVersion: version}) <= 0) {
- throw new Error('Input version number is not greater than the current version number!');
+ if (
+ compare({
+ oldVersion: update_info.develop.latest_version,
+ newVersion: version,
+ }) <= 0
+ ) {
+ throw new Error(
+ 'Input version number is not greater than the current version number!'
+ );
}
update_info.develop.latest_version = version;
writeJson(infoPath, update_info);
@@ -58,7 +68,7 @@ module.exports = { bump };
try {
const [nodePath, scriptPath, versionNumber, ...otherArgs] = process.argv;
if (versionNumber !== undefined) {
- if (validate({version: versionNumber})) {
+ if (validate({ version: versionNumber })) {
// version number is not valid
throw new Error('Input version number is valid');
}
@@ -69,4 +79,3 @@ try {
return -1;
}
return 0;
-
diff --git a/src/pages/ContentScripts/features/repo-activity-racing-bar/RacingBar.tsx b/src/pages/ContentScripts/features/repo-activity-racing-bar/RacingBar.tsx
index 6f48672b..993674d8 100644
--- a/src/pages/ContentScripts/features/repo-activity-racing-bar/RacingBar.tsx
+++ b/src/pages/ContentScripts/features/repo-activity-racing-bar/RacingBar.tsx
@@ -1,10 +1,23 @@
import { RepoActivityDetails } from '.';
import { avatarColorStore } from './AvatarColorStore';
-import React, { useEffect, useState, useRef } from 'react';
+import React, {
+ useEffect,
+ useState,
+ useRef,
+ forwardRef,
+ useImperativeHandle,
+ ForwardedRef,
+} from 'react';
import * as echarts from 'echarts';
-import type { EChartsOption, EChartsType, BarSeriesOption } from 'echarts';
import { Spin } from 'antd';
+import type { BarSeriesOption, EChartsOption, EChartsType } from 'echarts';
+
+export interface MediaControlers {
+ play: () => void;
+ startRecording: () => void;
+ stopRecording: () => void;
+}
interface RacingBarProps {
repoName: string;
@@ -140,7 +153,7 @@ const updateMonth = async (
let timer: NodeJS.Timeout;
-const play = (instance: EChartsType, data: RepoActivityDetails) => {
+const playFromStart = (instance: EChartsType, data: RepoActivityDetails) => {
const months = Object.keys(data);
let i = 0;
@@ -182,58 +195,121 @@ const countLongTermContributors = (
return [count, [...contributors.keys()]];
};
-const RacingBar = ({ data }: RacingBarProps): JSX.Element => {
- const [loadedAvatars, setLoadedAvatars] = useState(0);
- const divEL = useRef