@interlacejs/editor 1.0.0 → 1.0.2

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 +49 -0
  2. package/package.json +5 -5
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,6 +1,6 @@
1
1
  {
2
2
  "name": "@interlacejs/editor",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Interlace content authoring and editing tools.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -48,10 +48,10 @@
48
48
  "vitest": "^2.1.9"
49
49
  },
50
50
  "dependencies": {
51
- "@interlacejs/core": "0.1.0",
52
- "@interlacejs/native-adapter": "0.0.1",
53
- "@interlacejs/player": "0.1.0",
54
- "@interlacejs/quiz": "0.1.0"
51
+ "@interlacejs/core": "0.1.2",
52
+ "@interlacejs/native-adapter": "0.0.3",
53
+ "@interlacejs/player": "0.1.2",
54
+ "@interlacejs/quiz": "0.1.2"
55
55
  },
56
56
  "scripts": {
57
57
  "build": "tsup",