Skip to content

Commit

Permalink
Merge branch 'release/v3.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
kitce committed Apr 2, 2022
2 parents 7fa1db2 + d8102a5 commit afc836d
Show file tree
Hide file tree
Showing 119 changed files with 1,460 additions and 1,011 deletions.
2 changes: 1 addition & 1 deletion .cz.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ commitizen:
changelog_start_rev: v2.0.0
name: cz_conventional_commits
tag_format: v$version
version: 3.1.1
version: 3.2.0
version_files:
- package.json
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 2
insert_final_newline = true
tab_width = 2
trim_trailing_whitespace = true
2 changes: 1 addition & 1 deletion dist/egg.js

Large diffs are not rendered by default.

8 changes: 0 additions & 8 deletions dist/libel.js.LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@ object-assign
* Released under the MIT license
*/

/*!
* Pikaday
*
* Copyright © 2014 David Bushell | BSD & MIT license | https://github.com/Pikaday/Pikaday
*/

/*!
* html2canvas 1.3.2 <https://html2canvas.hertzen.com>
* Copyright (c) 2021 Niklas von Hertzen <https://hertzen.com>
Expand Down Expand Up @@ -88,8 +82,6 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */

/*! @license DOMPurify 2.3.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.3.6/LICENSE */

/** @license React v0.20.2
* scheduler.production.min.js
*
Expand Down
2 changes: 1 addition & 1 deletion dist/libel.meta.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ==UserScript==
// @name Libel
// @version 3.1.1
// @version 3.2.0
// @author kitce <[email protected]>
// @description Label users on LIHKG
// @homepage https://kitce.github.io/libel
Expand Down
4 changes: 2 additions & 2 deletions dist/libel.user.js

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "libel",
"namespace": "libel",
"displayName": "Libel",
"version": "3.1.1",
"version": "3.2.0",
"description": "Label users on LIHKG",
"author": "kitce <[email protected]>",
"repository": {
Expand Down Expand Up @@ -37,7 +37,6 @@
"debug": "^4.3.3",
"events": "^3.3.0",
"focus-trap-react": "^8.8.2",
"handsontable": "^11.1.0",
"html2canvas": "^1.0.0-rc.7",
"immer": "^8.0.1",
"joi": "^17.4.0",
Expand Down Expand Up @@ -71,7 +70,7 @@
"@types/react": "^17.0.3",
"@types/react-dom": "^17.0.3",
"@types/redux-persist": "^4.3.1",
"@types/redux-state-sync": "^3.1.1",
"@types/redux-state-sync": "^3.2.0",
"@types/sass": "^1.16.0",
"@types/semver": "^7.3.6",
"@types/tailwindcss": "^2.0.2",
Expand All @@ -81,7 +80,7 @@
"css-loader": "^5.2.0",
"cssnano": "^5.1.4",
"dotenv": "^10.0.0",
"identity-obj-proxy": "^3.1.1",
"identity-obj-proxy": "^3.0.0",
"jest": "^27.5.1",
"postcss": "^8.2.9",
"postcss-loader": "^5.2.0",
Expand Down
89 changes: 3 additions & 86 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
4 changes: 2 additions & 2 deletions src/components/AddLabelButton/AddLabelButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const AddLabelButton: React.FunctionComponent<IProps> = (props) => {
gtag.event(EventAction.Close, { event_category: EventCategory.Modal, event_label: EventLabel.AddLabel });
}, []);

const handleLabelFormSubmit: TLabelFormProps['onSubmission'] = useCallback(async (event, data) => {
const handleLabelFormSubmit: TLabelFormProps['onSubmit'] = useCallback(async (data) => {
const { text, reason, color, image, meta } = data;
const source = mapPostToSource(targetReply);
const payload: IAddLabelPayload = { user, text, reason, color, image, source };
Expand Down Expand Up @@ -90,7 +90,7 @@ const AddLabelButton: React.FunctionComponent<IProps> = (props) => {
fragile={false}
loading={loading}
onClose={handleLabelFormModalClose}
onSubmission={handleLabelFormSubmit}
onSubmit={handleLabelFormSubmit}
/>
</React.Fragment>
);
Expand Down
4 changes: 3 additions & 1 deletion src/components/Announcement/Announcement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ interface IProps {
forced?: boolean;
}

type TProps = IProps & React.ComponentPropsWithoutRef<'div'>;
type TComponentProps = React.ComponentPropsWithoutRef<'div'>;

type TProps = IProps & TComponentProps;

const announcementElements: HTMLDivElement[] = [];

Expand Down
16 changes: 8 additions & 8 deletions src/components/BaseButton/BaseButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ interface IProps {
loading?: boolean;
}

type TAnchorHTMLAttributes = React.ComponentPropsWithoutRef<'a'>;
type TButtonHTMLAttributes = React.ComponentPropsWithoutRef<'button'>;
type TAnchorComponentProps = React.ComponentPropsWithoutRef<'a'>;
type TButtonComponentProps = React.ComponentPropsWithoutRef<'button'>;

type HTMLAttributesWithAs<K extends keyof JSX.IntrinsicElements> = {
type TComponentPropsWithAs<K extends keyof JSX.IntrinsicElements> = {
as?: K;
} & React.ComponentPropsWithoutRef<K>;

type AnchorHTMLAttributesWithAs = HTMLAttributesWithAs<'a'>;
type ButtonHTMLAttributesWithAs = HTMLAttributesWithAs<'button'>;
type TAnchorComponentPropsWithAs = TComponentPropsWithAs<'a'>;
type TButtonComponentPropsWithAs = TComponentPropsWithAs<'button'>;

export type TProps = IProps & (
AnchorHTMLAttributesWithAs |
ButtonHTMLAttributesWithAs
TAnchorComponentPropsWithAs |
TButtonComponentPropsWithAs
);

const BaseButton: React.FunctionComponent<TProps> = (props) => {
Expand All @@ -44,7 +44,7 @@ const BaseButton: React.FunctionComponent<TProps> = (props) => {
children
)
);
return React.createElement(as, _props as TAnchorHTMLAttributes & TButtonHTMLAttributes, _children);
return React.createElement(as, _props as TAnchorComponentProps & TButtonComponentProps, _children);
};

export default BaseButton;
16 changes: 1 addition & 15 deletions src/components/BaseInput/BaseInput.module.scss
Original file line number Diff line number Diff line change
@@ -1,32 +1,18 @@
@import '../../stylesheets/base';

$height: 2.25rem;

.label {
@apply mr-4;
line-height: $height;
}

.input {
input {
@apply w-full;

&[type='text'] {
height: $height;
}
@apply outline-none;

&:disabled {
@apply cursor-not-allowed;
@apply opacity-20;
}

&:focus {
outline: 1px solid $color-yellow01;

@include dark-mode() {
outline: 1px solid rgba($color-yellow01, 0.6);
}
}
}
}

Expand Down
Loading

0 comments on commit afc836d

Please sign in to comment.