@aicut/core 0.4.1 → 0.4.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 +16 -3
- package/dist/index.cjs +20 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/styles/theme.css +60 -1
package/README.md
CHANGED
|
@@ -131,17 +131,30 @@ Editor.create({ container, project, locale: localeZh });
|
|
|
131
131
|
editor.setLocale({ undo: "Annuler" }); // partial override
|
|
132
132
|
```
|
|
133
133
|
|
|
134
|
-
##
|
|
134
|
+
## Host slots
|
|
135
135
|
|
|
136
|
-
|
|
136
|
+
The editor reserves four slot DOM elements for host-supplied controls. Library paints nothing into any of them; populated slots show, empty ones collapse.
|
|
137
137
|
|
|
138
138
|
```ts
|
|
139
|
+
// Header above the preview — collapses entirely when both empty.
|
|
140
|
+
editor.headerLeft.textContent = "Untitled project";
|
|
139
141
|
const exportBtn = document.createElement("button");
|
|
140
142
|
exportBtn.textContent = "Export";
|
|
141
143
|
exportBtn.onclick = () => editor.requestExport();
|
|
142
|
-
editor.
|
|
144
|
+
editor.headerRight.appendChild(exportBtn);
|
|
145
|
+
|
|
146
|
+
// Toolbar bookends (next to the built-in icons)
|
|
147
|
+
editor.toolbarLeft.appendChild(aspectDropdown);
|
|
148
|
+
editor.toolbarRight.appendChild(customIconBtn);
|
|
143
149
|
```
|
|
144
150
|
|
|
151
|
+
| Slot | Where |
|
|
152
|
+
| --- | --- |
|
|
153
|
+
| `editor.headerLeft` / `editor.headerRight` | Optional header row above the preview |
|
|
154
|
+
| `editor.toolbarLeft` / `editor.toolbarRight` | Bookends on the toolbar row |
|
|
155
|
+
|
|
156
|
+
The standalone `Timeline` also exposes `toolbarLeft` / `toolbarRight` when constructed with `toolbar: true`.
|
|
157
|
+
|
|
145
158
|
## Lighting picker (opt-in sub-entry)
|
|
146
159
|
|
|
147
160
|
A separate component for AI-relighting workflows — drag a light dot around a 3D sphere wrapping a subject frame, control brightness / color / direction. Three.js is bundled only on this sub-entry, so consumers of the video editor pay zero bytes for it.
|
package/dist/index.cjs
CHANGED
|
@@ -2519,6 +2519,11 @@ function scaleToSlider(scale) {
|
|
|
2519
2519
|
var EditorUI = class {
|
|
2520
2520
|
root;
|
|
2521
2521
|
editor;
|
|
2522
|
+
header;
|
|
2523
|
+
/** Host-extensible slot at the very left of the editor header. */
|
|
2524
|
+
headerLeft;
|
|
2525
|
+
/** Host-extensible slot at the very right of the editor header. */
|
|
2526
|
+
headerRight;
|
|
2522
2527
|
preview;
|
|
2523
2528
|
fullscreenExitBtn;
|
|
2524
2529
|
toolbar;
|
|
@@ -2532,6 +2537,15 @@ var EditorUI = class {
|
|
|
2532
2537
|
const locale = editor.getLocale();
|
|
2533
2538
|
root.classList.add("aicut-root");
|
|
2534
2539
|
root.innerHTML = "";
|
|
2540
|
+
this.header = document.createElement("div");
|
|
2541
|
+
this.header.className = "aicut-header";
|
|
2542
|
+
this.header.setAttribute("data-testid", "aicut-header");
|
|
2543
|
+
this.headerLeft = document.createElement("div");
|
|
2544
|
+
this.headerLeft.className = "aicut-header-slot aicut-header-left";
|
|
2545
|
+
this.headerRight = document.createElement("div");
|
|
2546
|
+
this.headerRight.className = "aicut-header-slot aicut-header-right";
|
|
2547
|
+
this.header.append(this.headerLeft, this.headerRight);
|
|
2548
|
+
root.appendChild(this.header);
|
|
2535
2549
|
this.preview = document.createElement("div");
|
|
2536
2550
|
this.preview.className = "aicut-preview-host";
|
|
2537
2551
|
this.preview.setAttribute("data-testid", "aicut-preview");
|
|
@@ -2810,6 +2824,12 @@ var Editor = class _Editor {
|
|
|
2810
2824
|
get toolbarRight() {
|
|
2811
2825
|
return this.ui.toolbarRight;
|
|
2812
2826
|
}
|
|
2827
|
+
get headerLeft() {
|
|
2828
|
+
return this.ui.headerLeft;
|
|
2829
|
+
}
|
|
2830
|
+
get headerRight() {
|
|
2831
|
+
return this.ui.headerRight;
|
|
2832
|
+
}
|
|
2813
2833
|
// ---- playback -------------------------------------------------------
|
|
2814
2834
|
play() {
|
|
2815
2835
|
this.engine.play();
|