@photoroom/ui 0.1.137 → 0.1.138
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/index.mjs +77 -53
- package/package.json +2 -2
package/index.mjs
CHANGED
|
@@ -35068,7 +35068,7 @@ var Nq = {
|
|
|
35068
35068
|
return e instanceof iJ ? e : new iJ(e);
|
|
35069
35069
|
};
|
|
35070
35070
|
//#endregion
|
|
35071
|
-
//#region ../../node_modules/.pnpm/react-colorful@5.
|
|
35071
|
+
//#region ../../node_modules/.pnpm/react-colorful@5.7.0_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-colorful/dist/index.mjs
|
|
35072
35072
|
function oJ() {
|
|
35073
35073
|
return (oJ = Object.assign || function(e) {
|
|
35074
35074
|
for (var t = 1; t < arguments.length; t++) {
|
|
@@ -35108,48 +35108,61 @@ var lJ = function(e, t, n) {
|
|
|
35108
35108
|
}, pJ = function(e) {
|
|
35109
35109
|
!uJ(e) && e.preventDefault();
|
|
35110
35110
|
}, mJ = t.memo(function(e) {
|
|
35111
|
-
var n = e.onMove, r = e.onKey, i =
|
|
35111
|
+
var n = e.onMove, r = e.onKey, i = e.onEnd, a = sJ(e, [
|
|
35112
|
+
"onMove",
|
|
35113
|
+
"onKey",
|
|
35114
|
+
"onEnd"
|
|
35115
|
+
]), o = S(null), s = cJ(n), c = cJ(r), l = cJ(i), u = S(null), d = S(!1), f = b(function() {
|
|
35112
35116
|
var e = function(e) {
|
|
35113
|
-
pJ(e), (uJ(e) ? e.touches.length > 0 : e.buttons > 0) &&
|
|
35117
|
+
pJ(e), (uJ(e) ? e.touches.length > 0 : e.buttons > 0) && o.current ? s(fJ(o.current, e, u.current)) : (n(!1), l());
|
|
35114
35118
|
}, t = function() {
|
|
35115
|
-
|
|
35119
|
+
n(!1), l();
|
|
35116
35120
|
};
|
|
35117
35121
|
function n(n) {
|
|
35118
|
-
var r =
|
|
35119
|
-
|
|
35122
|
+
var r = d.current, i = dJ(o.current), a = n ? i.addEventListener : i.removeEventListener;
|
|
35123
|
+
a(r ? "touchmove" : "mousemove", e), a(r ? "touchend" : "mouseup", t);
|
|
35120
35124
|
}
|
|
35121
35125
|
return [
|
|
35122
35126
|
function(e) {
|
|
35123
|
-
var t = e.nativeEvent, r =
|
|
35127
|
+
var t = e.nativeEvent, r = o.current;
|
|
35124
35128
|
if (r && (pJ(t), !function(e, t) {
|
|
35125
35129
|
return t && !uJ(e);
|
|
35126
|
-
}(t,
|
|
35130
|
+
}(t, d.current) && r)) {
|
|
35127
35131
|
if (uJ(t)) {
|
|
35128
|
-
|
|
35132
|
+
d.current = !0;
|
|
35129
35133
|
var i = t.changedTouches || [];
|
|
35130
|
-
i.length && (
|
|
35134
|
+
i.length && (u.current = i[0].identifier);
|
|
35131
35135
|
}
|
|
35132
|
-
r.focus(),
|
|
35136
|
+
r.focus(), s(fJ(r, t, u.current)), n(!0);
|
|
35133
35137
|
}
|
|
35134
35138
|
},
|
|
35135
35139
|
function(e) {
|
|
35136
35140
|
var t = e.which || e.keyCode;
|
|
35137
|
-
t < 37 || t > 40 || (e.preventDefault(),
|
|
35141
|
+
t < 37 || t > 40 || (e.preventDefault(), c({
|
|
35138
35142
|
left: t === 39 ? .05 : t === 37 ? -.05 : 0,
|
|
35139
35143
|
top: t === 40 ? .05 : t === 38 ? -.05 : 0
|
|
35140
35144
|
}));
|
|
35141
35145
|
},
|
|
35146
|
+
function(e) {
|
|
35147
|
+
var t = e.which || e.keyCode;
|
|
35148
|
+
t >= 37 && t <= 40 && l();
|
|
35149
|
+
},
|
|
35142
35150
|
n
|
|
35143
35151
|
];
|
|
35144
|
-
}, [
|
|
35152
|
+
}, [
|
|
35153
|
+
c,
|
|
35154
|
+
s,
|
|
35155
|
+
l
|
|
35156
|
+
]), p = f[0], m = f[1], g = f[2], _ = f[3];
|
|
35145
35157
|
return h(function() {
|
|
35146
|
-
return
|
|
35147
|
-
}, [
|
|
35148
|
-
onTouchStart:
|
|
35149
|
-
onMouseDown:
|
|
35158
|
+
return _;
|
|
35159
|
+
}, [_]), t.createElement("div", oJ({}, a, {
|
|
35160
|
+
onTouchStart: p,
|
|
35161
|
+
onMouseDown: p,
|
|
35150
35162
|
className: "react-colorful__interactive",
|
|
35151
|
-
ref:
|
|
35152
|
-
onKeyDown:
|
|
35163
|
+
ref: o,
|
|
35164
|
+
onKeyDown: m,
|
|
35165
|
+
onKeyUp: g,
|
|
35153
35166
|
tabIndex: 0,
|
|
35154
35167
|
role: "slider"
|
|
35155
35168
|
}));
|
|
@@ -35244,14 +35257,15 @@ var vJ = function(e) {
|
|
|
35244
35257
|
a: i
|
|
35245
35258
|
};
|
|
35246
35259
|
}, DJ = t.memo(function(e) {
|
|
35247
|
-
var n = e.hue, r = e.onChange, i = hJ(["react-colorful__hue", e.className]);
|
|
35248
|
-
return t.createElement("div", { className:
|
|
35260
|
+
var n = e.hue, r = e.onChange, i = e.onChangeEnd, a = hJ(["react-colorful__hue", e.className]);
|
|
35261
|
+
return t.createElement("div", { className: a }, t.createElement(mJ, {
|
|
35249
35262
|
onMove: function(e) {
|
|
35250
35263
|
r({ h: 360 * e.left });
|
|
35251
35264
|
},
|
|
35252
35265
|
onKey: function(e) {
|
|
35253
35266
|
r({ h: lJ(n + 360 * e.left, 0, 360) });
|
|
35254
35267
|
},
|
|
35268
|
+
onEnd: i,
|
|
35255
35269
|
"aria-label": "Hue",
|
|
35256
35270
|
"aria-valuenow": _J(n),
|
|
35257
35271
|
"aria-valuemax": "360",
|
|
@@ -35267,7 +35281,7 @@ var vJ = function(e) {
|
|
|
35267
35281
|
})
|
|
35268
35282
|
})));
|
|
35269
35283
|
}), OJ = t.memo(function(e) {
|
|
35270
|
-
var n = e.hsva, r = e.onChange, i = { backgroundColor: SJ({
|
|
35284
|
+
var n = e.hsva, r = e.onChange, i = e.onChangeEnd, a = { backgroundColor: SJ({
|
|
35271
35285
|
h: n.h,
|
|
35272
35286
|
s: 100,
|
|
35273
35287
|
v: 100,
|
|
@@ -35275,7 +35289,7 @@ var vJ = function(e) {
|
|
|
35275
35289
|
}) };
|
|
35276
35290
|
return t.createElement("div", {
|
|
35277
35291
|
className: "react-colorful__saturation",
|
|
35278
|
-
style:
|
|
35292
|
+
style: a
|
|
35279
35293
|
}, t.createElement(mJ, {
|
|
35280
35294
|
onMove: function(e) {
|
|
35281
35295
|
r({
|
|
@@ -35289,6 +35303,7 @@ var vJ = function(e) {
|
|
|
35289
35303
|
v: lJ(n.v - 100 * e.top, 0, 100)
|
|
35290
35304
|
});
|
|
35291
35305
|
},
|
|
35306
|
+
onEnd: i,
|
|
35292
35307
|
"aria-label": "Color",
|
|
35293
35308
|
"aria-valuetext": "Saturation " + _J(n.s) + "%, Brightness " + _J(n.v) + "%"
|
|
35294
35309
|
}, t.createElement(gJ, {
|
|
@@ -35304,36 +35319,42 @@ var vJ = function(e) {
|
|
|
35304
35319
|
}, AJ = function(e, t) {
|
|
35305
35320
|
return e.toLowerCase() === t.toLowerCase() || kJ(yJ(e), yJ(t));
|
|
35306
35321
|
};
|
|
35307
|
-
function jJ(e, t, n) {
|
|
35308
|
-
var
|
|
35322
|
+
function jJ(e, t, n, r) {
|
|
35323
|
+
var i = cJ(n), a = cJ(r), o = C(function() {
|
|
35309
35324
|
return e.toHsva(t);
|
|
35310
|
-
}),
|
|
35325
|
+
}), s = o[0], c = o[1], l = S({
|
|
35311
35326
|
color: t,
|
|
35312
|
-
hsva:
|
|
35313
|
-
});
|
|
35327
|
+
hsva: s
|
|
35328
|
+
}), u = S(!1);
|
|
35314
35329
|
return h(function() {
|
|
35315
|
-
if (!e.equal(t,
|
|
35330
|
+
if (!e.equal(t, l.current.color)) {
|
|
35316
35331
|
var n = e.toHsva(t);
|
|
35317
|
-
|
|
35332
|
+
l.current = {
|
|
35318
35333
|
hsva: n,
|
|
35319
35334
|
color: t
|
|
35320
|
-
},
|
|
35335
|
+
}, c(n), u.current = !1;
|
|
35321
35336
|
}
|
|
35322
35337
|
}, [t, e]), h(function() {
|
|
35323
35338
|
var t;
|
|
35324
|
-
kJ(
|
|
35325
|
-
hsva:
|
|
35339
|
+
kJ(s, l.current.hsva) || e.equal(t = e.fromHsva(s), l.current.color) || (l.current = {
|
|
35340
|
+
hsva: s,
|
|
35326
35341
|
color: t
|
|
35327
|
-
},
|
|
35342
|
+
}, i(t), u.current = !0);
|
|
35328
35343
|
}, [
|
|
35329
|
-
|
|
35344
|
+
s,
|
|
35330
35345
|
e,
|
|
35331
|
-
|
|
35332
|
-
]), [
|
|
35333
|
-
|
|
35334
|
-
|
|
35335
|
-
|
|
35336
|
-
|
|
35346
|
+
i
|
|
35347
|
+
]), [
|
|
35348
|
+
s,
|
|
35349
|
+
p(function(e) {
|
|
35350
|
+
c(function(t) {
|
|
35351
|
+
return Object.assign({}, t, e);
|
|
35352
|
+
});
|
|
35353
|
+
}, []),
|
|
35354
|
+
p(function() {
|
|
35355
|
+
u.current && (u.current = !1, a(l.current.color));
|
|
35356
|
+
}, [a])
|
|
35357
|
+
];
|
|
35337
35358
|
}
|
|
35338
35359
|
var MJ, NJ = typeof window < "u" ? y : h, PJ = function() {
|
|
35339
35360
|
return MJ || (typeof __webpack_nonce__ < "u" ? __webpack_nonce__ : void 0);
|
|
@@ -35348,23 +35369,26 @@ var MJ, NJ = typeof window < "u" ? y : h, PJ = function() {
|
|
|
35348
35369
|
}
|
|
35349
35370
|
}, []);
|
|
35350
35371
|
}, LJ = function(e) {
|
|
35351
|
-
var n = e.className, r = e.colorModel, i = e.color, a = i === void 0 ? r.defaultColor : i, o = e.onChange, s = sJ(e, [
|
|
35372
|
+
var n = e.className, r = e.colorModel, i = e.color, a = i === void 0 ? r.defaultColor : i, o = e.onChange, s = e.onChangeEnd, c = sJ(e, [
|
|
35352
35373
|
"className",
|
|
35353
35374
|
"colorModel",
|
|
35354
35375
|
"color",
|
|
35355
|
-
"onChange"
|
|
35356
|
-
|
|
35357
|
-
|
|
35358
|
-
|
|
35359
|
-
|
|
35360
|
-
|
|
35361
|
-
|
|
35376
|
+
"onChange",
|
|
35377
|
+
"onChangeEnd"
|
|
35378
|
+
]), l = S(null);
|
|
35379
|
+
IJ(l);
|
|
35380
|
+
var u = jJ(r, a, o, s), d = u[0], f = u[1], p = u[2], m = hJ(["react-colorful", n]);
|
|
35381
|
+
return t.createElement("div", oJ({}, c, {
|
|
35382
|
+
ref: l,
|
|
35383
|
+
className: m
|
|
35362
35384
|
}), t.createElement(OJ, {
|
|
35363
|
-
hsva:
|
|
35364
|
-
onChange:
|
|
35385
|
+
hsva: d,
|
|
35386
|
+
onChange: f,
|
|
35387
|
+
onChangeEnd: p
|
|
35365
35388
|
}), t.createElement(DJ, {
|
|
35366
|
-
hue:
|
|
35367
|
-
onChange:
|
|
35389
|
+
hue: d.h,
|
|
35390
|
+
onChange: f,
|
|
35391
|
+
onChangeEnd: p,
|
|
35368
35392
|
className: "react-colorful__last-control"
|
|
35369
35393
|
}));
|
|
35370
35394
|
}, RJ = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@photoroom/ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.138",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Photoroom design system components",
|
|
6
6
|
"sideEffects": [
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"fuse.js": "7.3.0",
|
|
61
61
|
"lodash-es": "4.18.1",
|
|
62
62
|
"motion": "12.38.0",
|
|
63
|
-
"react-colorful": "5.
|
|
63
|
+
"react-colorful": "5.7.0",
|
|
64
64
|
"react-device-detect": "2.2.3",
|
|
65
65
|
"react-intersection-observer": "10.0.3",
|
|
66
66
|
"react-moveable": "0.56.0",
|