@camstack/addon-osd-manager 0.1.184 → 0.1.186
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/dist/{MaskShapeCanvas-BT714ljC.mjs → MaskShapeCanvas-mrxtKs_l.mjs} +85 -85
- package/dist/MotionZonesSettings-Dp0R0q3Z.mjs +310 -0
- package/dist/{PrivacyMaskSettings-CVXHA1TY.mjs → PrivacyMaskSettings-IPP5tsg4.mjs} +14 -14
- package/dist/{SceneMonitorEditor-DfXktuc-.mjs → SceneMonitorEditor-wh-xCA6m.mjs} +314 -314
- package/dist/_stub.js +3641 -3107
- package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_osd_manager_page-WQk_9a7Q.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_osd_manager_page-Cr3qSOlj.mjs} +3 -3
- package/dist/_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-fuPdAfsY.mjs +26 -0
- package/dist/{_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare__react__loadShare__.js-C5jUMd7X.mjs → _virtual_mf___mfe_internal__addon_osd_manager_page__loadShare__react__loadShare__.js-D7xZfSHZ.mjs} +1 -1
- package/dist/addon-osd-manager.css +1 -1
- package/dist/{hostInit-B13AG8B3.mjs → hostInit-Byg5VNXi.mjs} +2 -2
- package/dist/index.js +10 -124
- package/dist/index.mjs +10 -124
- package/dist/{player-overlays-2U369Hn_.mjs → player-overlays-C2udddNf.mjs} +11 -11
- package/dist/remoteEntry.js +1 -1
- package/dist/{responsive-CX9nMQmP.mjs → responsive-Bef0FhzN.mjs} +36 -36
- package/dist/{scene-monitor-copy-mbiaJvpA.mjs → scene-monitor-copy-OXVinJYb.mjs} +12 -12
- package/dist/{square-c2Ehe_cj.mjs → square-ClhvKotL.mjs} +1 -1
- package/dist/{trash-2-C8s1nBjB.mjs → trash-2-DtyxSKWI.mjs} +1 -1
- package/dist/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_osd_manager_page__remoteEntry_js-Bi3cgGjf.mjs → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_osd_manager_page__remoteEntry_js-2lDHA88N.mjs} +1 -1
- package/package.json +1 -1
- package/dist/MotionZonesSettings-D6SgWxHM.mjs +0 -310
- package/dist/_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-CTH5s3ZX.mjs +0 -26
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { a as e, i as t, r as n, t as r } from "./rolldown-runtime-HEgqtunE.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { _ as i, a, b as o, c as s, f as c, g as l, h as u, l as d, n as f, o as p, s as m, t as h, u as g, x as _, y as v } from "./_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare__react__loadShare__.js-D7xZfSHZ.mjs";
|
|
3
3
|
import { n as y, r as b } from "./_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-DalfdIDw.mjs";
|
|
4
4
|
//#region ../../node_modules/konva/lib/Global.js
|
|
5
|
-
|
|
5
|
+
_();
|
|
6
6
|
var x = Math.PI / 180;
|
|
7
7
|
function S() {
|
|
8
8
|
return typeof window < "u" && ({}.toString.call(window) === "[object Window]" || {}.toString.call(window) === "[object global]");
|
|
@@ -7956,7 +7956,7 @@ var qi = Un, Ji = /* @__PURE__ */ r(((e) => {
|
|
|
7956
7956
|
}
|
|
7957
7957
|
return "Minified React error #" + e + "; visit " + t + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";
|
|
7958
7958
|
}
|
|
7959
|
-
function
|
|
7959
|
+
function a(e) {
|
|
7960
7960
|
var t = e, n = e;
|
|
7961
7961
|
if (e.alternate) for (; t.return;) t = t.return;
|
|
7962
7962
|
else {
|
|
@@ -7968,42 +7968,42 @@ var qi = Un, Ji = /* @__PURE__ */ r(((e) => {
|
|
|
7968
7968
|
return t.tag === 3 ? n : null;
|
|
7969
7969
|
}
|
|
7970
7970
|
function s(e) {
|
|
7971
|
-
if (
|
|
7971
|
+
if (a(e) !== e) throw Error(i(188));
|
|
7972
7972
|
}
|
|
7973
7973
|
function c(e) {
|
|
7974
7974
|
var t = e.alternate;
|
|
7975
7975
|
if (!t) {
|
|
7976
|
-
if (t =
|
|
7976
|
+
if (t = a(e), t === null) throw Error(i(188));
|
|
7977
7977
|
return t === e ? e : null;
|
|
7978
7978
|
}
|
|
7979
7979
|
for (var n = e, r = t;;) {
|
|
7980
|
-
var
|
|
7981
|
-
if (
|
|
7982
|
-
var c =
|
|
7980
|
+
var o = n.return;
|
|
7981
|
+
if (o === null) break;
|
|
7982
|
+
var c = o.alternate;
|
|
7983
7983
|
if (c === null) {
|
|
7984
|
-
if (r =
|
|
7984
|
+
if (r = o.return, r !== null) {
|
|
7985
7985
|
n = r;
|
|
7986
7986
|
continue;
|
|
7987
7987
|
}
|
|
7988
7988
|
break;
|
|
7989
7989
|
}
|
|
7990
|
-
if (
|
|
7991
|
-
for (c =
|
|
7992
|
-
if (c === n) return s(
|
|
7993
|
-
if (c === r) return s(
|
|
7990
|
+
if (o.child === c.child) {
|
|
7991
|
+
for (c = o.child; c;) {
|
|
7992
|
+
if (c === n) return s(o), e;
|
|
7993
|
+
if (c === r) return s(o), t;
|
|
7994
7994
|
c = c.sibling;
|
|
7995
7995
|
}
|
|
7996
7996
|
throw Error(i(188));
|
|
7997
7997
|
}
|
|
7998
|
-
if (n.return !== r.return) n =
|
|
7998
|
+
if (n.return !== r.return) n = o, r = c;
|
|
7999
7999
|
else {
|
|
8000
|
-
for (var l = !1, u =
|
|
8000
|
+
for (var l = !1, u = o.child; u;) {
|
|
8001
8001
|
if (u === n) {
|
|
8002
|
-
l = !0, n =
|
|
8002
|
+
l = !0, n = o, r = c;
|
|
8003
8003
|
break;
|
|
8004
8004
|
}
|
|
8005
8005
|
if (u === r) {
|
|
8006
|
-
l = !0, r =
|
|
8006
|
+
l = !0, r = o, n = c;
|
|
8007
8007
|
break;
|
|
8008
8008
|
}
|
|
8009
8009
|
u = u.sibling;
|
|
@@ -8011,11 +8011,11 @@ var qi = Un, Ji = /* @__PURE__ */ r(((e) => {
|
|
|
8011
8011
|
if (!l) {
|
|
8012
8012
|
for (u = c.child; u;) {
|
|
8013
8013
|
if (u === n) {
|
|
8014
|
-
l = !0, n = c, r =
|
|
8014
|
+
l = !0, n = c, r = o;
|
|
8015
8015
|
break;
|
|
8016
8016
|
}
|
|
8017
8017
|
if (u === r) {
|
|
8018
|
-
l = !0, r = c, n =
|
|
8018
|
+
l = !0, r = c, n = o;
|
|
8019
8019
|
break;
|
|
8020
8020
|
}
|
|
8021
8021
|
u = u.sibling;
|
|
@@ -8089,7 +8089,7 @@ var qi = Un, Ji = /* @__PURE__ */ r(((e) => {
|
|
|
8089
8089
|
function g(e) {
|
|
8090
8090
|
return e >>>= 0, e === 0 ? 32 : 31 - (bc(e) / xc | 0) | 0;
|
|
8091
8091
|
}
|
|
8092
|
-
function
|
|
8092
|
+
function v(e) {
|
|
8093
8093
|
var t = e & 42;
|
|
8094
8094
|
if (t !== 0) return t;
|
|
8095
8095
|
switch (e & -e) {
|
|
@@ -8133,7 +8133,7 @@ var qi = Un, Ji = /* @__PURE__ */ r(((e) => {
|
|
|
8133
8133
|
var i = 0, a = e.suspendedLanes, o = e.pingedLanes;
|
|
8134
8134
|
e = e.warmLanes;
|
|
8135
8135
|
var s = r & 134217727;
|
|
8136
|
-
return s === 0 ? (s = r & ~a, s === 0 ? o === 0 ? n || (n = r & ~e, n !== 0 && (i =
|
|
8136
|
+
return s === 0 ? (s = r & ~a, s === 0 ? o === 0 ? n || (n = r & ~e, n !== 0 && (i = v(n))) : i = v(o) : i = v(s)) : (r = s & ~a, r === 0 ? (o &= s, o === 0 ? n || (n = s & ~e, n !== 0 && (i = v(n))) : i = v(o)) : i = v(r)), i === 0 ? 0 : t !== 0 && t !== i && (t & a) === 0 && (a = i & -i, n = t & -t, a >= n || a === 32 && n & 4194048) ? t : i;
|
|
8137
8137
|
}
|
|
8138
8138
|
function b(e, t) {
|
|
8139
8139
|
return (e.pendingLanes & ~(e.suspendedLanes & ~e.pingedLanes) & t) === 0;
|
|
@@ -12218,7 +12218,7 @@ var qi = Un, Ji = /* @__PURE__ */ r(((e) => {
|
|
|
12218
12218
|
function Aa(e, t) {
|
|
12219
12219
|
ka(e, t), (e = e.alternate) && ka(e, t);
|
|
12220
12220
|
}
|
|
12221
|
-
var U = {}, ja = (
|
|
12221
|
+
var U = {}, ja = (_(), t(o)), Ma = Yi(), Na = Object.assign, Pa = Symbol.for("react.element"), Fa = Symbol.for("react.transitional.element"), Ia = Symbol.for("react.portal"), La = Symbol.for("react.fragment"), Ra = Symbol.for("react.strict_mode"), za = Symbol.for("react.profiler"), Ba = Symbol.for("react.consumer"), Va = Symbol.for("react.context"), Ha = Symbol.for("react.forward_ref"), Ua = Symbol.for("react.suspense"), Wa = Symbol.for("react.suspense_list"), Ga = Symbol.for("react.memo"), Ka = Symbol.for("react.lazy"), qa = Symbol.for("react.activity"), Ja = Symbol.for("react.memo_cache_sentinel"), Ya = Symbol.iterator, Xa = Symbol.for("react.client.reference"), Za = Array.isArray, W = ja.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Qa = e.rendererVersion, $a = e.rendererPackageName, eo = e.extraDevToolsConfig, to = e.getPublicInstance, no = e.getRootHostContext, ro = e.getChildHostContext, io = e.prepareForCommit, ao = e.resetAfterCommit, oo = e.createInstance;
|
|
12222
12222
|
e.cloneMutableInstance;
|
|
12223
12223
|
var so = e.appendInitialChild, co = e.finalizeInitialChildren, lo = e.shouldSetTextContent, uo = e.createTextInstance;
|
|
12224
12224
|
e.cloneMutableTextInstance;
|
|
@@ -12553,7 +12553,7 @@ var qi = Un, Ji = /* @__PURE__ */ r(((e) => {
|
|
|
12553
12553
|
switch (e.tag) {
|
|
12554
12554
|
case 3:
|
|
12555
12555
|
if (e = e.stateNode, e.current.memoizedState.isDehydrated) {
|
|
12556
|
-
var t =
|
|
12556
|
+
var t = v(e.pendingLanes);
|
|
12557
12557
|
if (t !== 0) {
|
|
12558
12558
|
for (e.pendingLanes |= 2, e.entangledLanes |= 2; t;) {
|
|
12559
12559
|
var n = 1 << 31 - yc(t);
|
|
@@ -12997,11 +12997,11 @@ function mo() {}
|
|
|
12997
12997
|
function ho() {
|
|
12998
12998
|
return null;
|
|
12999
12999
|
}
|
|
13000
|
-
var go = /* @__PURE__ */
|
|
13000
|
+
var go = /* @__PURE__ */ v.createContext(null);
|
|
13001
13001
|
function _o() {}
|
|
13002
13002
|
//#endregion
|
|
13003
13003
|
//#region ../../node_modules/its-fine/dist/index.js
|
|
13004
|
-
|
|
13004
|
+
_();
|
|
13005
13005
|
function vo(e, t, n) {
|
|
13006
13006
|
if (!e) return;
|
|
13007
13007
|
if (n(e) === !0) return e;
|
|
@@ -13038,10 +13038,10 @@ var bo = /* @__PURE__ */ yo(/* @__PURE__ */ h(null)), xo = class extends p {
|
|
|
13038
13038
|
}
|
|
13039
13039
|
};
|
|
13040
13040
|
function So() {
|
|
13041
|
-
let e =
|
|
13041
|
+
let e = d(bo);
|
|
13042
13042
|
if (e === null) throw Error("its-fine: useFiber must be called within a <FiberProvider />!");
|
|
13043
|
-
let t =
|
|
13044
|
-
return
|
|
13043
|
+
let t = c();
|
|
13044
|
+
return u(() => {
|
|
13045
13045
|
for (let n of [e, e?.alternate]) {
|
|
13046
13046
|
if (!n) continue;
|
|
13047
13047
|
let e = vo(n, !1, (e) => {
|
|
@@ -13057,7 +13057,7 @@ function So() {
|
|
|
13057
13057
|
}
|
|
13058
13058
|
var Co = Symbol.for("react.context"), wo = (e) => typeof e == "object" && !!e && "$$typeof" in e && e.$$typeof === Co;
|
|
13059
13059
|
function To() {
|
|
13060
|
-
let e = So(), [t] =
|
|
13060
|
+
let e = So(), [t] = i(() => /* @__PURE__ */ new Map());
|
|
13061
13061
|
t.clear();
|
|
13062
13062
|
let n = e;
|
|
13063
13063
|
for (; n;) {
|
|
@@ -13068,27 +13068,27 @@ function To() {
|
|
|
13068
13068
|
}
|
|
13069
13069
|
function Eo() {
|
|
13070
13070
|
let e = To();
|
|
13071
|
-
return
|
|
13071
|
+
return u(() => Array.from(e.keys()).reduce((t, n) => (r) => /* @__PURE__ */ f(t, null, /* @__PURE__ */ f(n.Provider, {
|
|
13072
13072
|
...r,
|
|
13073
13073
|
value: e.get(n)
|
|
13074
13074
|
})), (e) => /* @__PURE__ */ f(xo, { ...e })), [e]);
|
|
13075
13075
|
}
|
|
13076
|
-
if (
|
|
13076
|
+
if (_(), v.version.indexOf("19") === -1) throw Error("react-konva version 19 is only compatible with React 19. Make sure to have the last version of react-konva and react or downgrade react-konva to version 18.");
|
|
13077
13077
|
function Do(e) {
|
|
13078
|
-
let t =
|
|
13079
|
-
return
|
|
13078
|
+
let t = v.useRef({});
|
|
13079
|
+
return v.useLayoutEffect(() => {
|
|
13080
13080
|
t.current = e;
|
|
13081
|
-
}),
|
|
13081
|
+
}), v.useLayoutEffect(() => () => {
|
|
13082
13082
|
t.current = {};
|
|
13083
13083
|
}, []), t.current;
|
|
13084
13084
|
}
|
|
13085
13085
|
var Oo = () => {
|
|
13086
|
-
let e =
|
|
13087
|
-
return
|
|
13086
|
+
let e = v.useRef(0);
|
|
13087
|
+
return v.useMemo(() => {
|
|
13088
13088
|
e.current++;
|
|
13089
13089
|
}, []), e.current > 1;
|
|
13090
13090
|
}, ko = (e) => {
|
|
13091
|
-
let t =
|
|
13091
|
+
let t = v.useRef(null), n = v.useRef(null), r = v.useRef(null), i = Do(e), a = Eo(), o = v.useRef(null), s = (t) => {
|
|
13092
13092
|
let { forwardedRef: n } = e;
|
|
13093
13093
|
n && (typeof n == "function" ? n(t) : n.current = t);
|
|
13094
13094
|
}, c = Oo(), l = () => {
|
|
@@ -13096,15 +13096,15 @@ var Oo = () => {
|
|
|
13096
13096
|
Lo.updateContainer(null, r.current, null);
|
|
13097
13097
|
}), n.current?.destroy(), n.current = null;
|
|
13098
13098
|
};
|
|
13099
|
-
return
|
|
13099
|
+
return v.useLayoutEffect(() => (o.current &&= (clearTimeout(o.current), null), n.current ? s(n.current) : (n.current = new qi.Stage({
|
|
13100
13100
|
width: e.width,
|
|
13101
13101
|
height: e.height,
|
|
13102
13102
|
container: t.current
|
|
13103
|
-
}), s(n.current), r.current = Lo.createContainer(n.current, ta.ConcurrentRoot, null, !1, null, "", console.error, console.error, console.error, null), Lo.updateContainer(
|
|
13103
|
+
}), s(n.current), r.current = Lo.createContainer(n.current, ta.ConcurrentRoot, null, !1, null, "", console.error, console.error, console.error, null), Lo.updateContainer(v.createElement(a, {}, e.children), r.current, null, () => {})), () => {
|
|
13104
13104
|
c ? o.current = setTimeout(l, 0) : l();
|
|
13105
|
-
}), []),
|
|
13106
|
-
s(n.current), pa(n.current, e, i), Lo.updateContainer(
|
|
13107
|
-
}),
|
|
13105
|
+
}), []), v.useLayoutEffect(() => {
|
|
13106
|
+
s(n.current), pa(n.current, e, i), Lo.updateContainer(v.createElement(a, {}, e.children), r.current, null), Lo.flushSyncWork();
|
|
13107
|
+
}), v.createElement("div", {
|
|
13108
13108
|
ref: t,
|
|
13109
13109
|
id: e.id,
|
|
13110
13110
|
accessKey: e.accessKey,
|
|
@@ -13116,13 +13116,13 @@ var Oo = () => {
|
|
|
13116
13116
|
});
|
|
13117
13117
|
}, Ao = "Layer", jo = "Group", Mo = "Rect", No = "Circle", Po = "Line", Fo = "Text", Io = "Arrow", Lo = (0, ea.default)(ha);
|
|
13118
13118
|
ua(() => Lo.flushSyncWork());
|
|
13119
|
-
var Ro =
|
|
13119
|
+
var Ro = v.forwardRef((e, t) => v.createElement(xo, {}, v.createElement(ko, {
|
|
13120
13120
|
...e,
|
|
13121
13121
|
forwardedRef: t
|
|
13122
13122
|
})));
|
|
13123
13123
|
//#endregion
|
|
13124
13124
|
//#region ../ui-library/src/composites/cap-settings/MaskShapeCanvas.tsx
|
|
13125
|
-
|
|
13125
|
+
_();
|
|
13126
13126
|
var zo = {
|
|
13127
13127
|
rect: "#ef4444",
|
|
13128
13128
|
polygon: "#3b82f6",
|
|
@@ -13172,11 +13172,11 @@ function es(e, t) {
|
|
|
13172
13172
|
function ts(e) {
|
|
13173
13173
|
return e.kind === "polygon" || e.kind === "line";
|
|
13174
13174
|
}
|
|
13175
|
-
function ns({ items: e, selectedId: t, onSelect: n, onShapeChange: r, onDrawComplete:
|
|
13176
|
-
let m = l(null), [h, _] =
|
|
13175
|
+
function ns({ items: e, selectedId: t, onSelect: n, onShapeChange: r, onDrawComplete: a, drawingKind: o, supportedShapes: c, transparent: u = !1, backdrop: d, polygonVertices: f, grid: p }) {
|
|
13176
|
+
let m = l(null), [h, _] = i({
|
|
13177
13177
|
w: 800,
|
|
13178
13178
|
h: 450
|
|
13179
|
-
}), [v, x] =
|
|
13179
|
+
}), [v, x] = i([]), [S, C] = i(null), [w, T] = i(null), [ee, te] = i(null), E = o !== null && c.includes(o);
|
|
13180
13180
|
g(() => {
|
|
13181
13181
|
if (!ee) return;
|
|
13182
13182
|
let t = e.find((e) => e.id === ee.itemId);
|
|
@@ -13204,10 +13204,10 @@ function ns({ items: e, selectedId: t, onSelect: n, onShapeChange: r, onDrawComp
|
|
|
13204
13204
|
}, [u]), g(() => {
|
|
13205
13205
|
!E && S !== null && C(null);
|
|
13206
13206
|
}, [E, S]);
|
|
13207
|
-
let ne =
|
|
13208
|
-
|
|
13209
|
-
}, [
|
|
13210
|
-
if (!E ||
|
|
13207
|
+
let ne = s((e) => {
|
|
13208
|
+
a(e), x([]);
|
|
13209
|
+
}, [a]), re = s((e) => {
|
|
13210
|
+
if (!E || o === null) {
|
|
13211
13211
|
n(null);
|
|
13212
13212
|
return;
|
|
13213
13213
|
}
|
|
@@ -13216,7 +13216,7 @@ function ns({ items: e, selectedId: t, onSelect: n, onShapeChange: r, onDrawComp
|
|
|
13216
13216
|
let r = t.getPointerPosition();
|
|
13217
13217
|
if (!r) return;
|
|
13218
13218
|
let i = Yo(r, h.w, h.h);
|
|
13219
|
-
if (
|
|
13219
|
+
if (o === "rect") {
|
|
13220
13220
|
let e = Zo(i.x), t = Zo(i.y);
|
|
13221
13221
|
ne({
|
|
13222
13222
|
kind: "rect",
|
|
@@ -13227,7 +13227,7 @@ function ns({ items: e, selectedId: t, onSelect: n, onShapeChange: r, onDrawComp
|
|
|
13227
13227
|
});
|
|
13228
13228
|
return;
|
|
13229
13229
|
}
|
|
13230
|
-
if (
|
|
13230
|
+
if (o === "grid") {
|
|
13231
13231
|
let e = p?.width ?? Ko, t = p?.height ?? qo;
|
|
13232
13232
|
ne({
|
|
13233
13233
|
kind: "grid",
|
|
@@ -13237,7 +13237,7 @@ function ns({ items: e, selectedId: t, onSelect: n, onShapeChange: r, onDrawComp
|
|
|
13237
13237
|
});
|
|
13238
13238
|
return;
|
|
13239
13239
|
}
|
|
13240
|
-
if (
|
|
13240
|
+
if (o === "line") {
|
|
13241
13241
|
if (v.length === 0) {
|
|
13242
13242
|
x([i]);
|
|
13243
13243
|
return;
|
|
@@ -13248,7 +13248,7 @@ function ns({ items: e, selectedId: t, onSelect: n, onShapeChange: r, onDrawComp
|
|
|
13248
13248
|
});
|
|
13249
13249
|
return;
|
|
13250
13250
|
}
|
|
13251
|
-
if (
|
|
13251
|
+
if (o === "polygon") {
|
|
13252
13252
|
if (v.length === 0) {
|
|
13253
13253
|
x([i]);
|
|
13254
13254
|
return;
|
|
@@ -13267,33 +13267,33 @@ function ns({ items: e, selectedId: t, onSelect: n, onShapeChange: r, onDrawComp
|
|
|
13267
13267
|
}
|
|
13268
13268
|
}, [
|
|
13269
13269
|
E,
|
|
13270
|
-
|
|
13270
|
+
o,
|
|
13271
13271
|
v,
|
|
13272
13272
|
h,
|
|
13273
13273
|
p,
|
|
13274
13274
|
ne,
|
|
13275
13275
|
n
|
|
13276
|
-
]), ie =
|
|
13277
|
-
!E ||
|
|
13276
|
+
]), ie = s((e) => {
|
|
13277
|
+
!E || o !== "polygon" || v.length < Uo || (e.cancelBubble = !0, ne({
|
|
13278
13278
|
kind: "polygon",
|
|
13279
13279
|
points: v
|
|
13280
13280
|
}));
|
|
13281
13281
|
}, [
|
|
13282
13282
|
E,
|
|
13283
|
-
|
|
13283
|
+
o,
|
|
13284
13284
|
v,
|
|
13285
13285
|
ne
|
|
13286
13286
|
]), ae = l(null), oe = l(null);
|
|
13287
13287
|
g(() => () => {
|
|
13288
13288
|
ae.current !== null && cancelAnimationFrame(ae.current);
|
|
13289
13289
|
}, []);
|
|
13290
|
-
let D =
|
|
13290
|
+
let D = s((e) => {
|
|
13291
13291
|
if (!E) return;
|
|
13292
13292
|
let t = e.target.getStage();
|
|
13293
13293
|
t && (oe.current = t.getPointerPosition() ?? null, ae.current === null && (ae.current = requestAnimationFrame(() => {
|
|
13294
13294
|
ae.current = null, C(oe.current);
|
|
13295
13295
|
})));
|
|
13296
|
-
}, [E]), O = l(!1), se = l(!0), ce = l(/* @__PURE__ */ new Set()), le =
|
|
13296
|
+
}, [E]), O = l(!1), se = l(!0), ce = l(/* @__PURE__ */ new Set()), le = s((e, t, n, i) => {
|
|
13297
13297
|
let a = t.gridWidth * t.gridHeight;
|
|
13298
13298
|
if (n < 0 || n >= a || t.cells[n] === i) return;
|
|
13299
13299
|
let o = [...t.cells];
|
|
@@ -13423,14 +13423,14 @@ function ns({ items: e, selectedId: t, onSelect: n, onShapeChange: r, onDrawComp
|
|
|
13423
13423
|
/* @__PURE__ */ y(Ao, {
|
|
13424
13424
|
listening: !1,
|
|
13425
13425
|
children: E && v.length > 0 && /* @__PURE__ */ b("Group", { children: [
|
|
13426
|
-
|
|
13426
|
+
o === "polygon" && v.length >= 2 && /* @__PURE__ */ y("Line", {
|
|
13427
13427
|
points: Xo(v, h.w, h.h),
|
|
13428
13428
|
stroke: Ho,
|
|
13429
13429
|
strokeWidth: 1.5,
|
|
13430
13430
|
dash: [6, 3],
|
|
13431
13431
|
opacity: .8
|
|
13432
13432
|
}),
|
|
13433
|
-
|
|
13433
|
+
o === "line" && v.length === 1 && S && /* @__PURE__ */ y("Line", {
|
|
13434
13434
|
points: [
|
|
13435
13435
|
v[0].x * h.w,
|
|
13436
13436
|
v[0].y * h.h,
|
|
@@ -13442,7 +13442,7 @@ function ns({ items: e, selectedId: t, onSelect: n, onShapeChange: r, onDrawComp
|
|
|
13442
13442
|
dash: [6, 3],
|
|
13443
13443
|
opacity: .7
|
|
13444
13444
|
}),
|
|
13445
|
-
|
|
13445
|
+
o === "polygon" && S && v.length >= 1 && /* @__PURE__ */ y("Line", {
|
|
13446
13446
|
points: [
|
|
13447
13447
|
v[v.length - 1].x * h.w,
|
|
13448
13448
|
v[v.length - 1].y * h.h,
|
|
@@ -13455,7 +13455,7 @@ function ns({ items: e, selectedId: t, onSelect: n, onShapeChange: r, onDrawComp
|
|
|
13455
13455
|
opacity: .5
|
|
13456
13456
|
}),
|
|
13457
13457
|
v.map((e, t) => {
|
|
13458
|
-
let n = Jo(e, h.w, h.h), r = t === 0 &&
|
|
13458
|
+
let n = Jo(e, h.w, h.h), r = t === 0 && o === "polygon" && v.length >= Uo;
|
|
13459
13459
|
return /* @__PURE__ */ y("Circle", {
|
|
13460
13460
|
x: n.x,
|
|
13461
13461
|
y: n.y,
|
|
@@ -13472,7 +13472,7 @@ function ns({ items: e, selectedId: t, onSelect: n, onShapeChange: r, onDrawComp
|
|
|
13472
13472
|
}),
|
|
13473
13473
|
E ? /* @__PURE__ */ y("div", {
|
|
13474
13474
|
className: "px-3 py-1.5 bg-zinc-800/80 text-[11px] text-zinc-400 border-t border-zinc-700",
|
|
13475
|
-
children:
|
|
13475
|
+
children: o === "line" ? "Click to set the start point, click again to complete the line" : o === "rect" ? "Click to drop a rectangle, then drag the corner to resize" : o === "grid" ? "Click to add the grid, then paint cells" : v.length < Uo ? "Click to add points (min 3). Double-click or click the first point to close." : "Continue adding points. Double-click or click the first point to close."
|
|
13476
13476
|
}) : null
|
|
13477
13477
|
]
|
|
13478
13478
|
});
|
|
@@ -13481,8 +13481,8 @@ var rs = .02;
|
|
|
13481
13481
|
function is(e, t) {
|
|
13482
13482
|
return Math.abs(e.x - t.x) < 1e-6 && Math.abs(e.y - t.y) < 1e-6 && Math.abs(e.width - t.width) < 1e-6 && Math.abs(e.height - t.height) < 1e-6;
|
|
13483
13483
|
}
|
|
13484
|
-
function as({ item: e, shape: t, color: n, selected: r, dimmed:
|
|
13485
|
-
let [d, f] =
|
|
13484
|
+
function as({ item: e, shape: t, color: n, selected: r, dimmed: a, editable: o, isDrawing: s, size: c, onSelect: l, onShapeChange: u }) {
|
|
13485
|
+
let [d, f] = i(null), p = {
|
|
13486
13486
|
x: t.x,
|
|
13487
13487
|
y: t.y,
|
|
13488
13488
|
width: t.width,
|
|
@@ -13497,7 +13497,7 @@ function as({ item: e, shape: t, color: n, selected: r, dimmed: i, editable: a,
|
|
|
13497
13497
|
t.height,
|
|
13498
13498
|
d
|
|
13499
13499
|
]);
|
|
13500
|
-
let m = d ?? p, h = m.x *
|
|
13500
|
+
let m = d ?? p, h = m.x * c.w, _ = m.y * c.h, v = m.width * c.w, x = m.height * c.h, S = a ? .35 : r ? 1 : .85, C = (t) => {
|
|
13501
13501
|
f(t), u(e.id, {
|
|
13502
13502
|
kind: "rect",
|
|
13503
13503
|
x: t.x,
|
|
@@ -13508,16 +13508,16 @@ function as({ item: e, shape: t, color: n, selected: r, dimmed: i, editable: a,
|
|
|
13508
13508
|
};
|
|
13509
13509
|
return /* @__PURE__ */ y(jo, {
|
|
13510
13510
|
onClick: (t) => {
|
|
13511
|
-
t.cancelBubble = !0,
|
|
13511
|
+
t.cancelBubble = !0, s || l(e.id);
|
|
13512
13512
|
},
|
|
13513
13513
|
children: /* @__PURE__ */ b(jo, {
|
|
13514
|
-
draggable:
|
|
13515
|
-
dragBoundFunc:
|
|
13516
|
-
x: Math.max(-h, Math.min(
|
|
13517
|
-
y: Math.max(-_, Math.min(
|
|
13514
|
+
draggable: o,
|
|
13515
|
+
dragBoundFunc: o ? (e) => ({
|
|
13516
|
+
x: Math.max(-h, Math.min(c.w - (h + v), e.x)),
|
|
13517
|
+
y: Math.max(-_, Math.min(c.h - (_ + x), e.y))
|
|
13518
13518
|
}) : void 0,
|
|
13519
|
-
onDragEnd:
|
|
13520
|
-
let t = e.target, n = t.x() /
|
|
13519
|
+
onDragEnd: o ? (e) => {
|
|
13520
|
+
let t = e.target, n = t.x() / c.w, r = t.y() / c.h;
|
|
13521
13521
|
if (t.position({
|
|
13522
13522
|
x: 0,
|
|
13523
13523
|
y: 0
|
|
@@ -13530,14 +13530,14 @@ function as({ item: e, shape: t, color: n, selected: r, dimmed: i, editable: a,
|
|
|
13530
13530
|
});
|
|
13531
13531
|
} : void 0,
|
|
13532
13532
|
onMouseEnter: (e) => {
|
|
13533
|
-
if (!
|
|
13533
|
+
if (!o) return;
|
|
13534
13534
|
let t = e.target.getStage();
|
|
13535
13535
|
t && (t.container().style.cursor = "move");
|
|
13536
13536
|
},
|
|
13537
13537
|
onMouseLeave: (e) => {
|
|
13538
|
-
if (!
|
|
13538
|
+
if (!o) return;
|
|
13539
13539
|
let t = e.target.getStage();
|
|
13540
|
-
t && (t.container().style.cursor =
|
|
13540
|
+
t && (t.container().style.cursor = s ? "crosshair" : "default");
|
|
13541
13541
|
},
|
|
13542
13542
|
children: [
|
|
13543
13543
|
/* @__PURE__ */ y(Mo, {
|
|
@@ -13562,7 +13562,7 @@ function as({ item: e, shape: t, color: n, selected: r, dimmed: i, editable: a,
|
|
|
13562
13562
|
fontStyle: "bold",
|
|
13563
13563
|
listening: !1
|
|
13564
13564
|
}) : null,
|
|
13565
|
-
|
|
13565
|
+
o ? /* @__PURE__ */ y(No, {
|
|
13566
13566
|
x: h + v,
|
|
13567
13567
|
y: _ + x,
|
|
13568
13568
|
radius: 6,
|
|
@@ -13571,14 +13571,14 @@ function as({ item: e, shape: t, color: n, selected: r, dimmed: i, editable: a,
|
|
|
13571
13571
|
strokeWidth: 1.5,
|
|
13572
13572
|
draggable: !0,
|
|
13573
13573
|
dragBoundFunc: (e) => ({
|
|
13574
|
-
x: Math.min(
|
|
13575
|
-
y: Math.min(
|
|
13574
|
+
x: Math.min(c.w, Math.max(h, e.x)),
|
|
13575
|
+
y: Math.min(c.h, Math.max(_, e.y))
|
|
13576
13576
|
}),
|
|
13577
13577
|
onDragStart: (e) => {
|
|
13578
13578
|
e.cancelBubble = !0;
|
|
13579
13579
|
},
|
|
13580
13580
|
onDragMove: (e) => {
|
|
13581
|
-
let t = e.target, n = Zo(t.x() /
|
|
13581
|
+
let t = e.target, n = Zo(t.x() / c.w - m.x), r = Zo(t.y() / c.h - m.y);
|
|
13582
13582
|
f({
|
|
13583
13583
|
...m,
|
|
13584
13584
|
width: Math.max(rs, Math.min(n, 1 - m.x)),
|
|
@@ -13586,7 +13586,7 @@ function as({ item: e, shape: t, color: n, selected: r, dimmed: i, editable: a,
|
|
|
13586
13586
|
});
|
|
13587
13587
|
},
|
|
13588
13588
|
onDragEnd: (e) => {
|
|
13589
|
-
let t = e.target, n = Zo(t.x() /
|
|
13589
|
+
let t = e.target, n = Zo(t.x() / c.w - m.x), r = Zo(t.y() / c.h - m.y);
|
|
13590
13590
|
C({
|
|
13591
13591
|
...m,
|
|
13592
13592
|
width: Math.max(rs, Math.min(n, 1 - m.x)),
|
|
@@ -13801,6 +13801,6 @@ function ss({ item: e, shape: t, color: n, selected: r, dimmed: i, editable: a,
|
|
|
13801
13801
|
]
|
|
13802
13802
|
});
|
|
13803
13803
|
}
|
|
13804
|
-
var cs =
|
|
13804
|
+
var cs = a(ns);
|
|
13805
13805
|
//#endregion
|
|
13806
13806
|
export { cs as MaskShapeCanvas };
|