@aicut/core 0.4.0 → 0.4.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.
- package/README.md +9 -0
- 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 +53 -1
package/README.md
CHANGED
|
@@ -162,6 +162,15 @@ const ed = LightingEditor.create({
|
|
|
162
162
|
ed.setView("front");
|
|
163
163
|
ed.setConfig({ brightness: 0.8, color: "#ffaa3a" });
|
|
164
164
|
ed.setSubjectImage("/frames/another-subject.jpg");
|
|
165
|
+
ed.reset(); // restore safe defaults
|
|
166
|
+
|
|
167
|
+
// Footer slot — the only DOM region the library leaves for host action
|
|
168
|
+
// buttons (Reset, Generate, save-preset, etc.). Library renders nothing
|
|
169
|
+
// into it; host appends whatever it wants:
|
|
170
|
+
const resetBtn = document.createElement("button");
|
|
171
|
+
resetBtn.textContent = "Reset";
|
|
172
|
+
resetBtn.onclick = () => ed.reset();
|
|
173
|
+
ed.controlsFooter.appendChild(resetBtn);
|
|
165
174
|
|
|
166
175
|
// Host snapshot for "Generate" — call from your own button
|
|
167
176
|
function onGenerate() {
|
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();
|