@photoroom/ui 0.1.374 → 0.1.375
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/components/editor/SelectionObjectBox/MoveableSelectionObjectBox.d.ts +1 -1
- package/components/editor/SelectionObjectBox/MoveableSelectionObjectBox.d.ts.map +1 -1
- package/components/editor/SelectionObjectBox/SelectionObjectBox.d.ts +1 -1
- package/index.css +1 -1
- package/index.mjs +30 -30
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -45215,61 +45215,61 @@ var The = /* @__PURE__ */ function(e) {
|
|
|
45215
45215
|
} }), Mhe = (e) => {
|
|
45216
45216
|
let [t, n] = e;
|
|
45217
45217
|
return t && n ? t === n ? "nwse-resize" : "nesw-resize" : t ? "ew-resize" : "ns-resize";
|
|
45218
|
-
}, Nhe = (e) => ((e.inputEvent?.target)?.closest?.(".layer-box-rotation-zone"))?.style.cursor || "grabbing", Phe = `.moveable-edge-hover-band .moveable-line.moveable-direction::before{height:24px;bottom:${-24 / 2}px}`, _4 = ({ target: r, shouldShowLateralHandles: i, shouldShowVerticalHandles: a, selectionBoxHeight: o, editionPill: s, forcedPillPosition: c, variant: l = "default", onRotateStart: u, onRotateEnd: d, onScaleStart: f, onScale: p, onScaleEnd: m, onRotate: h, onEditionPillPointerMove: g, onRotateButtonPointerMove: _,
|
|
45219
|
-
let
|
|
45218
|
+
}, Nhe = (e) => ((e.inputEvent?.target)?.closest?.(".layer-box-rotation-zone"))?.style.cursor || "grabbing", Phe = `.moveable-edge-hover-band .moveable-line.moveable-direction::before{height:24px;bottom:${-24 / 2}px}`, _4 = ({ target: r, shouldShowLateralHandles: i, shouldShowVerticalHandles: a, selectionBoxHeight: o, editionPill: s, forcedPillPosition: c, variant: l = "default", onRotateStart: u, onRotateEnd: d, onScaleStart: f, onScale: p, onScaleEnd: m, onRotate: h, onEditionPillPointerMove: g, onRotateButtonPointerMove: _, scalable: v, rotatable: y, ref: b, ...x }) => {
|
|
45219
|
+
let S = l === "layerBox", C = l === "cropBox", w = v ?? !C, T = S && !w, E = [
|
|
45220
45220
|
"nw",
|
|
45221
45221
|
"ne",
|
|
45222
45222
|
"sw",
|
|
45223
45223
|
"se"
|
|
45224
45224
|
];
|
|
45225
|
-
!
|
|
45226
|
-
let
|
|
45225
|
+
!C && i && E.push("w", "e"), !C && a && E.push("n", "s");
|
|
45226
|
+
let D = (e) => {
|
|
45227
45227
|
p4(Mhe(e.direction)), f?.(e);
|
|
45228
|
-
},
|
|
45228
|
+
}, O = (e) => {
|
|
45229
45229
|
p4(null), m?.(e);
|
|
45230
|
-
},
|
|
45230
|
+
}, k = (e) => {
|
|
45231
45231
|
p4(Nhe(e)), u?.(e);
|
|
45232
|
-
},
|
|
45232
|
+
}, A = (e) => {
|
|
45233
45233
|
p4(null), d?.(e);
|
|
45234
45234
|
};
|
|
45235
45235
|
Ce(() => () => p4(null), []);
|
|
45236
|
-
let
|
|
45236
|
+
let j = U("[&>.moveable-ne]:bg-white! [&>.moveable-nw]:bg-white! [&>.moveable-se]:bg-white! [&>.moveable-sw]:bg-white!", "[&>.moveable-nw]:border-content-accent! [&>.moveable-ne]:border-content-accent! [&>.moveable-sw]:border-content-accent! [&>.moveable-se]:border-content-accent!", "[&>.moveable-ne]:border! [&>.moveable-nw]:border! [&>.moveable-se]:border! [&>.moveable-sw]:border!", "[&>.moveable-ne]:size-2.5! [&>.moveable-nw]:size-2.5! [&>.moveable-se]:size-2.5! [&>.moveable-sw]:size-2.5!", "[&>.moveable-ne]:rounded-[2px]! [&>.moveable-nw]:rounded-[2px]! [&>.moveable-se]:rounded-[2px]! [&>.moveable-sw]:rounded-[2px]!", "[&>.moveable-control]:z-10!"), M = U("[&>.moveable-control]:rounded-none! [&>.moveable-control]:border-0! [&>.moveable-control]:bg-transparent!", "[&>.moveable-ne]:size-6! [&>.moveable-nw]:size-6! [&>.moveable-se]:size-6! [&>.moveable-sw]:size-6!"), N = {
|
|
45237
45237
|
default: U("[&>.moveable-control]:border-content-accent! [&>.moveable-control]:border-2! [&>.moveable-control]:bg-white!", "[&>.moveable-control:hover]:bg-content-accent! [&>.moveable-control:hover]:text-content-white-primary!", "[&>.moveable-control:focus-visible]:bg-content-accent! [&>.moveable-control:focus-visible]:text-content-white-primary!", "[&>.moveable-control:active]:bg-content-accent! [&>.moveable-control:active]:text-content-white-primary!", "[&>.moveable-e]:rounded-300! [&>.moveable-e]:h-5! [&>.moveable-e]:w-2!", "[&>.moveable-w]:rounded-300! [&>.moveable-w]:h-5! [&>.moveable-w]:w-2!", "[&>.moveable-n]:rounded-300! [&>.moveable-n]:h-2! [&>.moveable-n]:w-5!", "[&>.moveable-s]:rounded-300! [&>.moveable-s]:h-2! [&>.moveable-s]:w-5!", "[&>.moveable-e]:top-[-3px]! [&>.moveable-e]:left-0.5!", "[&>.moveable-w]:top-[-3px]! [&>.moveable-w]:left-1!", "[&>.moveable-n]:top-1! [&>.moveable-n]:left-[-3px]!", "[&>.moveable-s]:top-0.5! [&>.moveable-s]:left-[-3px]!"),
|
|
45238
|
-
layerBox:
|
|
45239
|
-
cropBox:
|
|
45240
|
-
}[l],
|
|
45238
|
+
layerBox: j,
|
|
45239
|
+
cropBox: M
|
|
45240
|
+
}[l], P = U("[&>.moveable-nw]:mt-[-4px]! [&>.moveable-nw]:ml-[-4px]!", "[&>.moveable-ne]:mt-[-4px]! [&>.moveable-ne]:ml-[-6px]!", "[&>.moveable-sw]:mt-[-6px]! [&>.moveable-sw]:ml-[-4px]!", "[&>.moveable-se]:mt-[-6px]! [&>.moveable-se]:ml-[-6px]!"), F = {
|
|
45241
45241
|
default: U("[&>.moveable-ne]:top-px! [&>.moveable-ne]:-left-px!", "[&>.moveable-nw]:top-px! [&>.moveable-nw]:left-px!", "[&>.moveable-se]:-top-px! [&>.moveable-se]:-left-px!", "[&>.moveable-sw]:-top-px! [&>.moveable-sw]:left-px!"),
|
|
45242
|
-
layerBox:
|
|
45242
|
+
layerBox: P,
|
|
45243
45243
|
cropBox: void 0
|
|
45244
|
-
}[l],
|
|
45244
|
+
}[l], I = {
|
|
45245
45245
|
default: "[&>.moveable-line:not(.moveable-edge)]:bg-content-accent!",
|
|
45246
45246
|
layerBox: "[&>.moveable-line:not(.moveable-edge)]:bg-content-accent!",
|
|
45247
45247
|
cropBox: "[&>.moveable-line]:bg-transparent!"
|
|
45248
45248
|
}[l];
|
|
45249
|
-
return /* @__PURE__ */ n(e, { children: [(
|
|
45250
|
-
ref:
|
|
45249
|
+
return /* @__PURE__ */ n(e, { children: [(S || C) && /* @__PURE__ */ t("style", { children: Phe }), /* @__PURE__ */ t(The, {
|
|
45250
|
+
ref: b,
|
|
45251
45251
|
dragArea: !1,
|
|
45252
45252
|
draggable: !1,
|
|
45253
45253
|
origin: !1,
|
|
45254
45254
|
transformOrigin: "center",
|
|
45255
45255
|
target: r,
|
|
45256
|
-
className: U("z-10!",
|
|
45257
|
-
scalable:
|
|
45258
|
-
resizable:
|
|
45259
|
-
checkResizableError:
|
|
45256
|
+
className: U("z-10!", I, S || C ? "[&>.moveable-line:not(.moveable-edge)]:h-px!" : "[&>.moveable-line]:h-0.5!", T && "[&>.moveable-line:not(.moveable-edge)]:hidden!", (S || C) && "moveable-edge-hover-band", "[&>.moveable-line[data-line-key=render-line-0]]:top-px!", "[&>.moveable-line[data-line-key=render-line-1]]:-left-px!", "[&>.moveable-line[data-line-key=render-line-2]]:-top-px!", "[&>.moveable-line[data-line-key=render-line-3]]:left-px!", N, F),
|
|
45257
|
+
scalable: w,
|
|
45258
|
+
resizable: C,
|
|
45259
|
+
checkResizableError: C ? !1 : void 0,
|
|
45260
45260
|
keepRatio: !1,
|
|
45261
|
-
edge:
|
|
45261
|
+
edge: S || C ? [
|
|
45262
45262
|
"n",
|
|
45263
45263
|
"e",
|
|
45264
45264
|
"s",
|
|
45265
45265
|
"w"
|
|
45266
45266
|
] : void 0,
|
|
45267
|
-
renderDirections:
|
|
45268
|
-
rotatable: !
|
|
45269
|
-
ables: [...
|
|
45267
|
+
renderDirections: E,
|
|
45268
|
+
rotatable: S ? { renderDirections: !1 } : y ?? !C,
|
|
45269
|
+
ables: [...C ? [] : [S ? jhe : Dhe], Ehe],
|
|
45270
45270
|
props: {
|
|
45271
|
-
customRotation: !
|
|
45272
|
-
layerBoxRotation:
|
|
45271
|
+
customRotation: !S && !C,
|
|
45272
|
+
layerBoxRotation: S,
|
|
45273
45273
|
customEditable: !0,
|
|
45274
45274
|
selectionBoxHeight: o,
|
|
45275
45275
|
forcedPillPosition: c,
|
|
@@ -45283,13 +45283,13 @@ var The = /* @__PURE__ */ function(e) {
|
|
|
45283
45283
|
layerBox: ".layer-box-rotation-zone",
|
|
45284
45284
|
cropBox: void 0
|
|
45285
45285
|
}[l],
|
|
45286
|
-
onScaleStart:
|
|
45286
|
+
onScaleStart: S ? D : f,
|
|
45287
45287
|
onScale: p,
|
|
45288
|
-
onScaleEnd:
|
|
45289
|
-
onRotateStart:
|
|
45288
|
+
onScaleEnd: S ? O : m,
|
|
45289
|
+
onRotateStart: S ? k : u,
|
|
45290
45290
|
onRotate: h,
|
|
45291
|
-
onRotateEnd:
|
|
45292
|
-
...
|
|
45291
|
+
onRotateEnd: S ? A : d,
|
|
45292
|
+
...x
|
|
45293
45293
|
})] });
|
|
45294
45294
|
};
|
|
45295
45295
|
_4.displayName = "MoveableSelectionObjectBox";
|