Skip to content

Commit

Permalink
Merge branch 'master' into feat/img-to-image
Browse files Browse the repository at this point in the history
  • Loading branch information
luckymore authored Jul 28, 2023
2 parents 5dfc853 + 4cf67a3 commit 7112188
Show file tree
Hide file tree
Showing 337 changed files with 17,472 additions and 8,641 deletions.
2 changes: 1 addition & 1 deletion .dumi/theme/builtins/preview-default/Previewer.less
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@
}

&-tab {
border-top: 1px solid @c-border-inner;
border-top: 1px solid var(--doc-border-color);
--title-font-size: 14px;
.adm-tabs-header {
border-bottom: none;
Expand Down
15 changes: 1 addition & 14 deletions .dumi/theme/builtins/preview-default/Previewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { history } from 'dumi'
import type { IPreviewerComponentProps } from 'dumi/theme'
import {
context,
// useRiddle,
useMotions,
useCopy,
useLocaleProps,
Expand Down Expand Up @@ -66,9 +65,7 @@ const Previewer: React.FC<IPreviewerProps> = oProps => {
const openCSB = useCodeSandbox(
props.hideActions?.includes('CSB') ? null : props
)
// const openRiddle = useRiddle(
// props.hideActions?.includes('RIDDLE') ? null : props
// )

const [execMotions, isMotionRunning] = useMotions(
props.motions || [],
demoRef.current
Expand Down Expand Up @@ -119,14 +116,6 @@ const Previewer: React.FC<IPreviewerProps> = oProps => {
onClick={openCSB}
/>
)}
{/*{openRiddle && (*/}
{/* <button*/}
{/* title='Open demo on Riddle'*/}
{/* className='__dumi-default-icon'*/}
{/* role='riddle'*/}
{/* onClick={openRiddle}*/}
{/* />*/}
{/*)}*/}
{props.motions && (
<button
title='Execute motions'
Expand Down Expand Up @@ -159,8 +148,6 @@ const Previewer: React.FC<IPreviewerProps> = oProps => {
{!isSingleFile && (
<Tabs
className='__dumi-default-previewer-source-tab'
// prefixCls='__dumi-default-tabs'
// moreIcon='···'
stretch={false}
defaultActiveKey={currentFile}
onChange={handleFileChange}
Expand Down
2 changes: 0 additions & 2 deletions .dumi/theme/builtins/preview-default/use-code-sandbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,6 @@ export const sleep = (time: number) => new Promise(resolve => setTimeout(resolve
),
}

// console.log('Files:', existDemoBlock, files)

return serialize({ files })
}

Expand Down
7 changes: 0 additions & 7 deletions .dumi/theme/components/SideMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import type { FC } from 'react'
import React, { useContext } from 'react'
import { context, NavLink } from 'dumi/theme'
import './SideMenu.less'
// import { DocSearch } from '@docsearch/react'
// import '@docsearch/css'

interface INavbarProps {
location: any
Expand All @@ -28,11 +26,6 @@ const SideMenu: FC<INavbarProps> = ({ location }) => {
<div className='__dumi-default-menu-inner'>
{/* menu list */}
<ul className='__dumi-default-menu-list'>
{/*<DocSearch*/}
{/* appId='BH4D9OD16A'*/}
{/* indexName='ant_design_mobile'*/}
{/* apiKey='3f05ea4cbd28d07129a5e32e87a856b5'*/}
{/*/>*/}
{menu.map(item => {
// always use meta from routes to reduce menu data size
const hasChildren = item.children && Boolean(item.children.length)
Expand Down
16 changes: 14 additions & 2 deletions .dumi/theme/components/device.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import type { FC } from 'react'
import React, { useState, useContext, useEffect } from 'react'
import { QRCodeSVG } from 'qrcode.react'
import { context } from 'dumi/theme'
import { usePrefersColor } from 'dumi/theme'
import { context, usePrefersColor } from 'dumi/theme'
import './device.less'
import { Popover } from 'antd-mobile'

Expand All @@ -11,6 +10,8 @@ interface IDeviceProps {
url: string
}

type PrefersColorValue = 'dark' | 'light' | 'auto'

export const Device: FC<IDeviceProps> = ({ url }) => {
const [renderKey, setRenderKey] = useState(Math.random())
const [color] = usePrefersColor()
Expand All @@ -23,6 +24,17 @@ export const Device: FC<IDeviceProps> = ({ url }) => {
setRenderKey(Math.random())
}, [color])

useEffect(() => {
const mediaQueryList = (['light', 'dark'] as PrefersColorValue[]).map(
color => window.matchMedia(`(prefers-color-scheme: ${color})`)
)
const handler = () => {
setRenderKey(Math.random())
}

mediaQueryList.forEach(mq => mq.addEventListener('change', handler))
}, [])

return (
<div className={'adm-doc-device'} data-device-type='iOS' data-mode={mode}>
<iframe title='dumi-previewer' src={url} key={renderKey} />
Expand Down
2 changes: 1 addition & 1 deletion .dumi/theme/components/slug-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const SlugList: FC<Props> = props => {
<div className='adm-doc-toc'>
<ul role='slug-list'>
{slugs
.filter(({ depth }, index) => depth > 1 && depth < 4)
.filter(({ depth }) => depth > 1 && depth < 4)
.map(slug => (
<li key={slug.heading} title={slug.value} data-depth={slug.depth}>
<AnchorLink to={`#${slug.heading}`}>
Expand Down
2 changes: 1 addition & 1 deletion .dumi/theme/layouts/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const Features = (features: any) => (

const Layout: React.FC<IRouteComponentProps> = ({ children, location }) => {
const {
config: { mode, repository },
config: { repository },
meta,
locale,
} = useContext(context)
Expand Down
99 changes: 25 additions & 74 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,127 +2,78 @@

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our
community include:
Examples of behavior that contributes to a positive environment for our community include:

- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
- Focusing on what is best not just for us as individuals, but for the
overall community
- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
- Focusing on what is best not just for us as individuals, but for the overall community

Examples of unacceptable behavior include:

- The use of sexualized language or imagery, and sexual attention or
advances of any kind
- The use of sexualized language or imagery, and sexual attention or advances of any kind
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email
address, without their explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting
- Publishing others' private information, such as a physical or email address, without their explicit permission
- Other conduct which could reasonably be considered inappropriate in a professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.

Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
[email protected].
All complaints will be reviewed and investigated promptly and fairly.
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [email protected]. All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
All community leaders are obligated to respect the privacy and security of the reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series
of actions.
**Community Impact**: A violation through a single incident or series of actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
the community.
**Consequence**: A permanent ban from any sort of public interaction within the community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.

Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.
For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
4 changes: 1 addition & 3 deletions .github/HOW_TO_ASK_QUESTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@

一个好标题范例是"目标-差异式"的描述,许多技术支持组织就是这样做的。在目标部分指出是哪一个或哪一组东西有问题,在差异部分则描述与期望的行为不一致的地方。

> 蠢问题:求救!Swiper 组件 onIndexChange 事件挂掉了
> 稍好一点的问题:Swiper 组件 onIndexChange 事件一直疯狂触发,我把 autoplay 关掉就正常了
> 聪明问题:Swiper 组件设置 autoplay 后,onIndexChange 事件间隔 autoplayInterval 持续触发,不会停止
> 蠢问题:求救!Swiper 组件 onIndexChange 事件挂掉了稍好一点的问题:Swiper 组件 onIndexChange 事件一直疯狂触发,我把 autoplay 关掉就正常了聪明问题:Swiper 组件设置 autoplay 后,onIndexChange 事件间隔 autoplayInterval 持续触发,不会停止
### 使用清晰、正确、精准且合乎语法的语句

Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/pr-check-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Used to merge master/feature branches with each other
name: PR Check CI

on:
schedule:
- cron: '*/5 * * * *'

permissions:
contents: read

jobs:
pr-check-ci:
permissions:
checks: read # for actions-cool/check-pr-ci to get check reference
contents: write # for actions-cool/check-pr-ci to merge PRs
issues: write # for actions-cool/check-pr-ci to update issues
pull-requests: write # for actions-cool/check-pr-ci to update PRs
runs-on: ubuntu-latest
steps:
- uses: actions-cool/[email protected]
with:
filter-label: 'BranchAutoMerge'
filter-creator-authority: 'write'
filter-head-ref: 'master, feature, next, master-merge-feature, feature-merge-master, next-merge-master, next-merge-feature'
filter-support-fork: false
skip-run-names: 'deploy preview, pr-check-ci, build preview failed, suggest-related-links'
conflict-review-body: '😅 This branch has conflicts that must be resolved!'
success-review: true
success-merge: true
merge-method: 'merge'
merge-title: 'chore: auto merge branches (#${number})'
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lts/Gallium
2 changes: 1 addition & 1 deletion .prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = {
jsxSingleQuote: true,
quoteProps: 'preserve',
arrowParens: 'avoid',
proseWrap: 'preserve',
proseWrap: 'never',
overrides: [
{
'files': ['*.md'],
Expand Down
Loading

0 comments on commit 7112188

Please sign in to comment.