Skip to content

Commit

Permalink
refactor: run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaodong2008 committed Nov 29, 2024
1 parent fa46f98 commit 7722b9e
Show file tree
Hide file tree
Showing 136 changed files with 2,076 additions and 1,768 deletions.
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ issuehunt: # Replace with a single IssueHunt username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
polar: # Replace with a single Polar username
buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
custom: ['https://afdian.com/a/newcar']
custom: ["https://afdian.com/a/newcar"]
24 changes: 13 additions & 11 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

title: ""
labels: ""
assignees: ""
---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
Expand All @@ -24,15 +24,17 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
7 changes: 3 additions & 4 deletions .github/ISSUE_TEMPLATE/custom.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
---
name: Custom issue template
about: Describe this issue template's purpose here.
title: ''
labels: ''
assignees: ''

title: ""
labels: ""
assignees: ""
---
7 changes: 3 additions & 4 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

title: ""
labels: ""
assignees: ""
---

**Is your feature request related to a problem? Please describe.**
Expand Down
11 changes: 6 additions & 5 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@ about: Have a contribution to VueMotion! Thank you!
**Related Issues:** [List the issue numbers related to this PR]

**TODO**

- [ ] task1
- [ ] ...

**Checklist:**

- [ ] Code has been reviewed
- [ ] Code complies with the project's code standards and best practices
- [ ] Code has passed all tests
- [ ] Code does not affect the normal use of existing features
- [ ] Documentation has been updated
- [ ] Code has been reviewed
- [ ] Code complies with the project's code standards and best practices
- [ ] Code has passed all tests
- [ ] Code does not affect the normal use of existing features
- [ ] Documentation has been updated

**Screenshots:** [Provide relevant screenshots or GIF animations]
22 changes: 11 additions & 11 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@ diverse, inclusive, and healthy community.
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,
- 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
- 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
- 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
- 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
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities
Expand Down Expand Up @@ -106,7 +106,7 @@ 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
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
Expand Down
9 changes: 3 additions & 6 deletions bump.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import { defineConfig } from 'bumpp'
import { defineConfig } from "bumpp";

export default defineConfig({
files: [
'packages/**/package.json',
'extensions/**/package.json',
],
files: ["packages/**/package.json", "extensions/**/package.json"],
recursive: true,
})
});
86 changes: 49 additions & 37 deletions extensions/animations/src/focus.ts
Original file line number Diff line number Diff line change
@@ -1,41 +1,53 @@
import { defineAnimation } from '@vue-motion/core'
import type { Widget } from '@vue-motion/core'
import type { Positional } from '@vue-motion/lib'
import { defineAnimation } from "@vue-motion/core";
import type { Widget } from "@vue-motion/core";
import type { Positional } from "@vue-motion/lib";

export const focusOn = defineAnimation<Positional & Widget, {
scale?: number
offsetFrom?: [number, number]
}>((target, context) => {
const circle = document.createElementNS('http://www.w3.org/2000/svg', 'circle')
const { width, height } = target.range!
circle.setAttribute('cx', (width).toString())
circle.setAttribute('cy', (height).toString())
circle.setAttribute('fill', 'rgba(135,206,250,0.3)')
circle.setAttribute('stroke', 'rgba(135,206,250,0.3)')
const originRadius = Math.sqrt((width / 2) ** 2 + (height / 2) ** 2)
const scaledRadius = originRadius * (context.scale ?? 2)
circle.setAttribute('r', scaledRadius.toString())
target.element?.appendChild(circle)
return (progress) => {
circle.setAttribute('r', (scaledRadius * (1 - progress)).toString())
export const focusOn = defineAnimation<
Positional & Widget,
{
scale?: number;
offsetFrom?: [number, number];
}
})

export const focusOut = defineAnimation<Positional & Widget, {
scale?: number
offsetFrom?: [number, number]
}>((target, context) => {
const circle = document.createElementNS('http://www.w3.org/2000/svg', 'circle')
const { width, height } = target.range!
circle.setAttribute('cx', (width).toString())
circle.setAttribute('cy', (height).toString())
circle.setAttribute('fill', 'rgba(135,206,250,0.3)')
circle.setAttribute('stroke', 'rgba(135,206,250,0.3)')
const originRadius = Math.sqrt((width / 2) ** 2 + (height / 2) ** 2)
const scaledRadius = originRadius * (context.scale ?? 2)
circle.setAttribute('r', scaledRadius.toString())
target.element?.appendChild(circle)
>((target, context) => {
const circle = document.createElementNS(
"http://www.w3.org/2000/svg",
"circle",
);
const { width, height } = target.range!;
circle.setAttribute("cx", width.toString());
circle.setAttribute("cy", height.toString());
circle.setAttribute("fill", "rgba(135,206,250,0.3)");
circle.setAttribute("stroke", "rgba(135,206,250,0.3)");
const originRadius = Math.sqrt((width / 2) ** 2 + (height / 2) ** 2);
const scaledRadius = originRadius * (context.scale ?? 2);
circle.setAttribute("r", scaledRadius.toString());
target.element?.appendChild(circle);
return (progress) => {
circle.setAttribute('r', (scaledRadius * progress).toString())
circle.setAttribute("r", (scaledRadius * (1 - progress)).toString());
};
});

export const focusOut = defineAnimation<
Positional & Widget,
{
scale?: number;
offsetFrom?: [number, number];
}
})
>((target, context) => {
const circle = document.createElementNS(
"http://www.w3.org/2000/svg",
"circle",
);
const { width, height } = target.range!;
circle.setAttribute("cx", width.toString());
circle.setAttribute("cy", height.toString());
circle.setAttribute("fill", "rgba(135,206,250,0.3)");
circle.setAttribute("stroke", "rgba(135,206,250,0.3)");
const originRadius = Math.sqrt((width / 2) ** 2 + (height / 2) ** 2);
const scaledRadius = originRadius * (context.scale ?? 2);
circle.setAttribute("r", scaledRadius.toString());
target.element?.appendChild(circle);
return (progress) => {
circle.setAttribute("r", (scaledRadius * progress).toString());
};
});
28 changes: 16 additions & 12 deletions extensions/animations/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
import type { AnimationParams } from '@vue-motion/core'
import { registerAnimation } from '@vue-motion/core'
import type { Positional } from '@vue-motion/lib'
import { focusOn } from './focus'
import type { AnimationParams } from "@vue-motion/core";
import { registerAnimation } from "@vue-motion/core";
import type { Positional } from "@vue-motion/lib";
import { focusOn } from "./focus";

export const setups = [
() => {
registerAnimation<Positional>('focusOn', (params: AnimationParams) => (manager) => manager.animate(focusOn, {
duration: params?.duration ?? 1,
by: params?.by,
}))
registerAnimation<Positional>(
"focusOn",
(params: AnimationParams) => (manager) =>
manager.animate(focusOn, {
duration: params?.duration ?? 1,
by: params?.by,
}),
);
},
]
];

declare module '@vue-motion/lib' {
declare module "@vue-motion/lib" {
export interface PositionalMixin {
focusOn: (params?: any) => void
focusOn: (params?: any) => void;
}
}

export { focusOn }
export { focusOn };
22 changes: 11 additions & 11 deletions extensions/animations/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import dts from 'vite-plugin-dts'
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import dts from "vite-plugin-dts";

export default defineConfig({
root: '.',
root: ".",
build: {
lib: {
entry: 'src/index.ts',
name: 'vuemotion',
formats: ['es', 'cjs', 'iife'],
fileName: 'index',
entry: "src/index.ts",
name: "vuemotion",
formats: ["es", "cjs", "iife"],
fileName: "index",
},
rollupOptions: {
external: ['vue'],
external: ["vue"],
},
},
plugins: [
vue(),
dts({
include: ['src/**/*.ts'],
include: ["src/**/*.ts"],
rollupTypes: true,
}),
],
})
});
4 changes: 2 additions & 2 deletions extensions/chart/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from './utils'
export * from './widgets'
export * from "./utils";
export * from "./widgets";
Loading

0 comments on commit 7722b9e

Please sign in to comment.