@aicut/vue 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +46 -27
  2. package/package.json +36 -2
package/README.md CHANGED
@@ -1,6 +1,14 @@
1
1
  # @aicut/vue
2
2
 
3
- Vue 3 wrapper around **[@aicut/core](https://www.npmjs.com/package/@aicut/core)** — a canvas-rendered video editor component. Import the core stylesheet once and use it like any other Vue SFC.
3
+ > Vue 3 wrapper for the **AiCut** video editor canvas timeline, custom toolbar slots, theming, i18n, drop-in `<VideoEditor>`.
4
+
5
+ [![npm](https://img.shields.io/npm/v/@aicut/vue.svg)](https://www.npmjs.com/package/@aicut/vue)
6
+ [![License](https://img.shields.io/npm/l/@aicut/vue.svg)](./LICENSE)
7
+ [![GitHub](https://img.shields.io/badge/repo-ziqiangai/AiCut-181717?logo=github)](https://github.com/ziqiangai/AiCut)
8
+
9
+ ![AiCut editor](https://raw.githubusercontent.com/ziqiangai/AiCut/main/docs/screenshots/editor-dark.png)
10
+
11
+ ## Install
4
12
 
5
13
  ```bash
6
14
  pnpm add @aicut/vue @aicut/core
@@ -20,12 +28,14 @@ import "@aicut/core/styles.css";
20
28
 
21
29
  const project: Project = {
22
30
  version: 1,
23
- sources: [{ id: "s1", url: "/media/a.mp4", kind: "video", name: "a.mp4" }],
24
- tracks: [
25
- { id: "t1", kind: "video", clips: [
26
- { id: "c1", sourceId: "s1", in: 0, out: 5000, start: 0 },
27
- ]},
31
+ sources: [
32
+ { id: "s1", url: "/media/a.mp4", kind: "video", name: "a.mp4" },
28
33
  ],
34
+ tracks: [{
35
+ id: "t1",
36
+ kind: "video",
37
+ clips: [{ id: "c1", sourceId: "s1", in: 0, out: 5000, start: 0 }],
38
+ }],
29
39
  };
30
40
 
31
41
  const editor = ref<{ api(): EditorApi | null } | null>(null);
@@ -53,29 +63,36 @@ async function doExport(p: Project) {
53
63
  </template>
54
64
  ```
55
65
 
56
- The component is **uncontrolled for project state**. Restore later with `editor.value?.api()?.setProject(saved)`.
66
+ The component is **uncontrolled for project state**. Restore later with:
67
+
68
+ ```ts
69
+ editor.value?.api()?.setProject(saved);
70
+ ```
57
71
 
58
72
  ## Props
59
73
 
60
- | Prop | Type | Notes |
61
- | --- | --- | --- |
62
- | `defaultProject` | `Project` | Initial project. Read once on mount. |
63
- | `theme` | `Theme` | CSS variable overrides. Reactive. |
64
- | `locale` | `Partial<Locale>` | UI strings. English by default; pass `localeZh` for Chinese. Reactive. |
74
+ ```ts
75
+ interface VideoEditorProps {
76
+ defaultProject?: Project;
77
+ theme?: Theme; // CSS-var overrides; reactive
78
+ locale?: Partial<Locale>; // EN default; pass localeZh for ZH; reactive
79
+ }
80
+ ```
65
81
 
66
82
  ## Events
67
83
 
68
- | Event | Payload |
69
- | --- | --- |
70
- | `ready` | `(api: EditorApi)` |
71
- | `change` | `(project: Project)` |
72
- | `export` | `(project: Project)` — fired by `api.requestExport()` |
73
- | `time-update` | `(timeMs: number)` |
74
- | `play` / `pause` | `()` |
75
- | `selection-change` | `(clipId: string \| null)` |
76
- | `error` | `(error: Error)` |
84
+ ```ts
85
+ ready (api: EditorApi)
86
+ change (project: Project)
87
+ export (project: Project) // fired by api.requestExport()
88
+ time-update (timeMs: number)
89
+ play ()
90
+ pause ()
91
+ selection-change (clipId: string | null)
92
+ error (error: Error)
93
+ ```
77
94
 
78
- The exposed `api()` returns the same `EditorApi` instance described in [`@aicut/core`](https://www.npmjs.com/package/@aicut/core) — `play`, `pause`, `seek`, `split`, `setProject`, `requestExport`, `setTheme`, `setLocale`, the lot.
95
+ The exposed `api()` returns the full **`EditorApi`** described in [@aicut/core](https://www.npmjs.com/package/@aicut/core) — `play`, `pause`, `seek`, `split`, `setProject`, `requestExport`, `setTheme`, `setLocale`, and more.
79
96
 
80
97
  ## Theming
81
98
 
@@ -93,8 +110,6 @@ The exposed `api()` returns the same `EditorApi` instance described in [`@aicut/
93
110
  />
94
111
  ```
95
112
 
96
- The `theme` prop is reactive — swap the binding and the editor calls `setTheme` internally.
97
-
98
113
  ## i18n
99
114
 
100
115
  ```vue
@@ -103,7 +118,9 @@ import { ref, computed } from "vue";
103
118
  import { VideoEditor, localeEn, localeZh, type Locale } from "@aicut/vue";
104
119
 
105
120
  const lang = ref<"en" | "zh">("en");
106
- const locale = computed<Locale>(() => (lang.value === "zh" ? localeZh : localeEn));
121
+ const locale = computed<Locale>(() =>
122
+ lang.value === "zh" ? localeZh : localeEn,
123
+ );
107
124
  </script>
108
125
 
109
126
  <template>
@@ -111,6 +128,8 @@ const locale = computed<Locale>(() => (lang.value === "zh" ? localeZh : localeEn
111
128
  </template>
112
129
  ```
113
130
 
131
+ `locale` swap re-titles the toolbar and re-paints canvas labels in place.
132
+
114
133
  ## Standalone `<Timeline>`
115
134
 
116
135
  ```vue
@@ -131,6 +150,6 @@ const picked = ref(0);
131
150
  </template>
132
151
  ```
133
152
 
134
- ## License
153
+ ---
135
154
 
136
- MIT
155
+ [Full docs & demo](https://github.com/ziqiangai/AiCut) · [@aicut/core](https://www.npmjs.com/package/@aicut/core) · [@aicut/react](https://www.npmjs.com/package/@aicut/react)
package/package.json CHANGED
@@ -1,8 +1,42 @@
1
1
  {
2
2
  "name": "@aicut/vue",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Vue 3 wrapper for the AiCut video editor — thin declarative shell over @aicut/core.",
5
5
  "license": "MIT",
6
+ "author": "ziqiang <ziqiangytu@gmail.com>",
7
+ "homepage": "https://github.com/ziqiangai/AiCut#readme",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/ziqiangai/AiCut.git",
11
+ "directory": "packages/vue"
12
+ },
13
+ "bugs": {
14
+ "url": "https://github.com/ziqiangai/AiCut/issues"
15
+ },
16
+ "keywords": [
17
+ "video-editor",
18
+ "video-editing",
19
+ "vue",
20
+ "vue3",
21
+ "vue-component",
22
+ "timeline",
23
+ "timeline-editor",
24
+ "nle",
25
+ "video-cutter",
26
+ "video-clip",
27
+ "canvas",
28
+ "video",
29
+ "editor",
30
+ "mp4",
31
+ "component",
32
+ "capcut",
33
+ "premiere",
34
+ "final-cut",
35
+ "davinci",
36
+ "imovie",
37
+ "veed",
38
+ "filmora"
39
+ ],
6
40
  "type": "module",
7
41
  "main": "./dist/index.cjs",
8
42
  "module": "./dist/index.js",
@@ -19,7 +53,7 @@
19
53
  "README.md"
20
54
  ],
21
55
  "dependencies": {
22
- "@aicut/core": "0.1.0"
56
+ "@aicut/core": "0.1.1"
23
57
  },
24
58
  "peerDependencies": {
25
59
  "vue": "^3.4.0"