@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aicut/core",
3
- "version": "0.4.1",
3
+ "version": "0.4.3",
4
4
  "description": "Framework-agnostic core for the AiCut video editor — canvas timeline, data model, HTML5 playback engine, plus an opt-in 3D lighting picker.",
5
5
  "license": "MIT",
6
6
  "author": "ziqiang <ziqiangytu@gmail.com>",
package/styles/theme.css CHANGED
@@ -52,7 +52,15 @@
52
52
  --aicut-playhead-color: var(--color-brand);
53
53
 
54
54
  display: grid;
55
- grid-template-rows: 1fr auto auto;
55
+ /* Four explicit rows: header / preview / toolbar / timeline. When
56
+ the header is hidden (empty slots → display:none below), browsers
57
+ would otherwise auto-reflow the remaining three children into
58
+ rows 1/2/3 — which would put the preview in the `auto` row and
59
+ toolbar in the `1fr` row, causing the preview to collapse and a
60
+ big gap between toolbar and timeline. The explicit grid-row
61
+ assignments on the children pin each surface to its intended
62
+ row regardless of which siblings are present. */
63
+ grid-template-rows: auto 1fr auto auto;
56
64
  width: 100%;
57
65
  height: 100%;
58
66
  min-height: 480px;
@@ -130,6 +138,57 @@
130
138
  display: inline-flex;
131
139
  }
132
140
 
141
+ /* ===== Header (opt-in via slots) ===== */
142
+
143
+ /* Slim bar above the preview. Bookend left/right slots are host-
144
+ filled via the React wrapper's headerLeft/headerRight props or the
145
+ Vue named slots. Collapsed entirely when both slots are empty so
146
+ the default editor layout is byte-for-byte the same as before the
147
+ header existed. */
148
+ .aicut-header {
149
+ display: flex;
150
+ align-items: center;
151
+ justify-content: space-between;
152
+ gap: 12px;
153
+ height: 44px;
154
+ padding: 0 12px;
155
+ background: var(--aicut-controls-bg);
156
+ border-bottom: 1px solid var(--aicut-controls-border);
157
+ color: var(--aicut-controls-text);
158
+ font-size: 13px;
159
+ /* Sit above the preview so dropdowns/popovers from header buttons
160
+ can overflow naturally without z-index plumbing. */
161
+ position: relative;
162
+ z-index: 1;
163
+ }
164
+
165
+ /* Auto-hide when both slots are empty — keep today's default layout
166
+ exactly as it was for callers that don't use the header. With the
167
+ per-child grid-row assignments below, display:none here cleanly
168
+ removes the header without reflowing preview/toolbar/timeline. */
169
+ .aicut-root:has(.aicut-header-left:empty):has(.aicut-header-right:empty)
170
+ .aicut-header {
171
+ display: none;
172
+ }
173
+
174
+ /* Pin each editor surface to its intended row. Required so the four
175
+ children can't auto-reflow when one (e.g. the header) is hidden. */
176
+ .aicut-root > .aicut-header { grid-row: 1; }
177
+ .aicut-root > .aicut-preview-host { grid-row: 2; }
178
+ .aicut-root > .aicut-toolbar { grid-row: 3; }
179
+ .aicut-root > .aicut-timeline { grid-row: 4; }
180
+
181
+ .aicut-header-slot {
182
+ display: flex;
183
+ align-items: center;
184
+ gap: 8px;
185
+ min-width: 0;
186
+ }
187
+
188
+ .aicut-header-right {
189
+ margin-left: auto;
190
+ }
191
+
133
192
  /* ===== Toolbar ===== */
134
193
 
135
194
  .aicut-toolbar {