Skip to content

Commit 1be9973

Browse files
committed
Added basic docs
1 parent e170710 commit 1be9973

File tree

13 files changed

+227
-20
lines changed

13 files changed

+227
-20
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
# production
1212
/dist
13-
/docs-dist
13+
/docs/dist
1414

1515
# misc
1616
.DS_Store

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
legacy-peer-deps=true

.prettierrc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
{
22
"singleQuote": true,
33
"trailingComma": "all",
4+
"singleAttributePerLine": true,
45
"printWidth": 200,
56
"overrides": [
67
{
78
"files": ".prettierrc",
8-
"options": { "parser": "json" }
9+
"options": {
10+
"parser": "json"
11+
}
912
}
1013
]
11-
}
14+
}

docs/footer.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import React from 'react';
2+
3+
export default function Footer() {
4+
return (
5+
<div>
6+
<div>Released under the MIT License.</div>
7+
</div>
8+
);
9+
}

docs/pages/docs/get-started.mdx

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
title: Get Started
3+
description: Installation and Basic Usage
4+
---
5+
6+
## Installation
7+
8+
To get started, install the package from npm using your package manager of choice.
9+
10+
:::code-group
11+
12+
```bash [npm]
13+
npm install @mfoulks3200/react-timeline-editor
14+
```
15+
16+
```bash [bun]
17+
bun install @mfoulks3200/react-timeline-editor
18+
```
19+
20+
```bash [yarn]
21+
yarn add @mfoulks3200/react-timeline-editor
22+
```
23+
24+
```bash [pnpm]
25+
pnpm install @mfoulks3200/react-timeline-editor
26+
```
27+
28+
:::
29+
30+
## Basic Usage
31+
32+
import { TimelineEditor } from '../../snippets/BasicTimelinePreview.tsx';
33+
34+
:::code-group
35+
36+
<div data-title="Preview">
37+
<div style={{
38+
width: 'calc( 100% + 44px )',
39+
height: '200px',
40+
marginLeft: "-22px",
41+
marginTop: "-20px",
42+
marginBottom: "-20px",
43+
overflow: "hidden"
44+
}}>
45+
<TimelineEditor />
46+
</div>
47+
</div>
48+
49+
```tsx [example.tsx]
50+
// [!include ~/snippets/BasicTimelinePreview.tsx]
51+
```
52+
53+
```ts [mock-data.ts]
54+
// [!include ~/../src/mock-data.ts]
55+
```
56+
57+
:::

docs/pages/index.mdx

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1-
# Hello, World! [This is my first page]
1+
---
2+
title: Introduction
3+
description: What is React Timeline Editor?
4+
---
25

3-
Welcome to my docs.
6+
# React Timeline Editor
7+
8+
`react-timeline-editor` Is a component developed based on react and used to quickly build timeline editing capabilities.
9+
10+
It can be mainly used to build animation editors, video editors, etc.
11+
12+
## Features
13+
14+
- 🛠 Supports drag and drop, zoom mode, and provides convenient control hooks.
15+
- 🔗 Provides interactive capabilities such as grid adsorption and auxiliary line adsorption.
16+
- 🏷 Automatically identify action length and scroll infinitely.
17+
- 🎨 Customizable styles quickly and easily.
18+
- 📡 Provides a strongly decoupled runner capability that can run independently from the editor.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import React, { useState } from 'react';
2+
import { MockRowData, MockEffectData } from '../../src/mock-data';
3+
import { Timeline } from '../../src/components/timeline';
4+
5+
export const TimelineEditor = () => {
6+
const [data, setData] = useState(MockRowData);
7+
8+
return (
9+
<Timeline
10+
style={{ width: '100%', height: '100%' }}
11+
onChange={setData}
12+
editorData={data}
13+
effects={MockEffectData}
14+
hideCursor={false}
15+
autoScroll={true}
16+
/>
17+
);
18+
};

package.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,11 @@
2424
"url": "git+https://github.com/mfoulks3200/react-timeline-editor.git"
2525
},
2626
"scripts": {
27-
"start": "dumi dev",
28-
"legacydocs:build": "dumi build",
2927
"docs:dev": "vocs dev",
3028
"docs:build": "vocs build",
3129
"docs:preview": "vocs preview",
3230
"docs:deploy": "",
33-
"build": "father-build",
34-
"build:rollup": "rm -rf ./dist && rollup --config rollup.config.mjs",
31+
"build": "rm -rf ./dist && rollup --config rollup.config.mjs",
3532
"deploy": "npm run docs:build && npm run docs:deploy",
3633
"prepublishOnly": "npm run build"
3734
},
@@ -71,6 +68,7 @@
7168
"react-dom": "^18.0.2",
7269
"rollup": "^4.35.0",
7370
"rollup-plugin-less": "^1.1.3",
71+
"vite-tsconfig-paths": "^5.1.4",
7472
"yorkie": "^2.0.0"
7573
}
76-
}
74+
}

rollup.build.css

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,13 @@
9595
top: 0;
9696
transform: translate(50%, -100%);
9797
}
98+
.timeline-editor-edit-row {
99+
background-repeat: no-repeat, repeat;
100+
background-image: linear-gradient(#191b1d, #191b1d), linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 0);
101+
display: flex;
102+
flex-direction: row;
103+
box-sizing: border-box;
104+
}
98105
.timeline-editor-drag-line-container {
99106
position: absolute;
100107
height: 100%;
@@ -108,13 +115,6 @@
108115
height: 99%;
109116
border-left: 1px dashed rgba(82, 151, 255, 0.6);
110117
}
111-
.timeline-editor-edit-row {
112-
background-repeat: no-repeat, repeat;
113-
background-image: linear-gradient(#191b1d, #191b1d), linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 0);
114-
display: flex;
115-
flex-direction: row;
116-
box-sizing: border-box;
117-
}
118118
.timeline-editor-action {
119119
position: absolute;
120120
left: 0;

src/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
export * from './components/timeline';
22
export * from './interface/timeline';
3-
export * from './engine/engine'
4-
3+
export * from './engine/engine';
4+
export * from './mock-data';

0 commit comments

Comments
 (0)