@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 CHANGED
@@ -131,17 +131,30 @@ Editor.create({ container, project, locale: localeZh });
131
131
  editor.setLocale({ undo: "Annuler" }); // partial override
132
132
  ```
133
133
 
134
- ## Toolbar slots
134
+ ## Host slots
135
135
 
136
- Both the editor's toolbar and the standalone `Timeline`'s optional toolbar expose `toolbarLeft` / `toolbarRight` slot DOM elements. The library renders nothing into them append your own buttons.
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.toolbarRight.appendChild(exportBtn);
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();