@interlacejs/editor 1.0.0 → 1.0.3
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.
- package/README.md +49 -0
- package/package.json +11 -7
package/README.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# @interlacejs/editor
|
|
2
|
+
|
|
3
|
+
The React authoring UI for [Interlace](https://github.com/farayolaj/interlace) interactive videos: build one in your host app with the top-level `InterlaceEditor` component (or drive its pieces directly).
|
|
4
|
+
|
|
5
|
+
## What's inside
|
|
6
|
+
|
|
7
|
+
- **`InterlaceEditor`** — the full authoring experience as one component: video-source step, keyframe timeline (fits the video duration, wheel-zoom), hook inspector, placement editor with resize handles, gated preview, and a save flow.
|
|
8
|
+
- **`useAuthoringStore`** — the store hook underneath: create/add/update/remove content items, serialize the finished document.
|
|
9
|
+
- **Timeline components** — `KeyframeTimeline`, `Timeline`/`TimelineEntry` semantics for blocking and non-blocking hooks.
|
|
10
|
+
- **Content-type plumbing** — `ContentTypePicker`, `ContentTypeEditorSlot`, `ContentTypeEditor` mount layer, whatever type your registry holds.
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
pnpm add @interlacejs/editor @interlacejs/core @interlacejs/player @interlacejs/quiz
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Minimal example
|
|
19
|
+
|
|
20
|
+
```tsx
|
|
21
|
+
import { InterlaceEditor } from "@interlace/editor";
|
|
22
|
+
import { QuizContentType } from "@interlace/quiz";
|
|
23
|
+
import { ContentTypeRegistry } from "@interlace/core";
|
|
24
|
+
|
|
25
|
+
const registry = new ContentTypeRegistry();
|
|
26
|
+
registry.register(QuizContentType);
|
|
27
|
+
|
|
28
|
+
<div style={{ width: 960, height: 640 }}>
|
|
29
|
+
<InterlaceEditor
|
|
30
|
+
contentTypeRegistry={registry}
|
|
31
|
+
document={existingDoc} // optional: omit for a fresh document
|
|
32
|
+
onUpload={async (file) => URL.createObjectURL(file)} // your upload story
|
|
33
|
+
onSave={(doc) => save(doc)} // the host owns persistence
|
|
34
|
+
onError={(e) => showError(e.message)}
|
|
35
|
+
/>
|
|
36
|
+
</div>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
`onSave` receives the serialized document (JSON) ready for the player (`@interlacejs/player`). The editor never persists on its own — bring your own storage.
|
|
40
|
+
|
|
41
|
+
## Strings and theming
|
|
42
|
+
|
|
43
|
+
Both `InterlaceEditor` and sub-components accept `strings`/`theme` overrides; the built-in default strings derive from `@interlacejs/core`'s `DEFAULT_STRINGS` so hosts can localize once.
|
|
44
|
+
|
|
45
|
+
See the [root README](https://github.com/farayolaj/interlace) for the document format and the `apps/demo` for a working wiring.
|
|
46
|
+
|
|
47
|
+
## License
|
|
48
|
+
|
|
49
|
+
ISC
|
package/package.json
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@interlacejs/editor",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Interlace content authoring and editing tools.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
|
-
"module": "./dist/index.
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
8
|
"types": "./dist/index.d.ts",
|
|
9
9
|
"exports": {
|
|
10
|
-
".":
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"require": "./dist/index.cjs"
|
|
14
|
+
}
|
|
11
15
|
},
|
|
12
16
|
"sideEffects": false,
|
|
13
17
|
"files": [
|
|
@@ -48,10 +52,10 @@
|
|
|
48
52
|
"vitest": "^2.1.9"
|
|
49
53
|
},
|
|
50
54
|
"dependencies": {
|
|
51
|
-
"@interlacejs/core": "0.1.
|
|
52
|
-
"@interlacejs/native-adapter": "0.0.
|
|
53
|
-
"@interlacejs/player": "0.1.
|
|
54
|
-
"@interlacejs/quiz": "0.1.
|
|
55
|
+
"@interlacejs/core": "0.1.3",
|
|
56
|
+
"@interlacejs/native-adapter": "0.0.4",
|
|
57
|
+
"@interlacejs/player": "0.1.3",
|
|
58
|
+
"@interlacejs/quiz": "0.1.3"
|
|
55
59
|
},
|
|
56
60
|
"scripts": {
|
|
57
61
|
"build": "tsup",
|