@8btc/whiteboard 0.0.20-alpha.6 → 0.0.20-alpha.7
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/index.js +43 -43
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { jsxs as ce, jsx as E, Fragment as Mr } from "react/jsx-runtime";
|
|
|
9
9
|
import * as T from "react";
|
|
10
10
|
import nt, { useState as ye, useEffect as be, useRef as et, useContext as Ar, createContext as Or, useLayoutEffect as As, useDebugValue as ty, forwardRef as xe, useMemo as nn, isValidElement as iu, version as ny, cloneElement as ry, Fragment as iy, useCallback as Qe, memo as $t } from "react";
|
|
11
11
|
import me from "konva";
|
|
12
|
-
import { N as
|
|
12
|
+
import { N as oe, I as ut, R as te } from "./const-CNw7pZuI.js";
|
|
13
13
|
import oy from "mitt";
|
|
14
14
|
import { v4 as Vr } from "uuid";
|
|
15
15
|
import { Slot as sy } from "@radix-ui/react-slot";
|
|
@@ -133,7 +133,7 @@ class my {
|
|
|
133
133
|
return;
|
|
134
134
|
const t = b(this, X).getPointerPosition(), r = e.target;
|
|
135
135
|
let i = null;
|
|
136
|
-
r.getParent()?.className === "Transformer" ? i = r.getParent().nodes() : r === b(this, X) ? i = r : (i = r.findAncestor((o) => o.hasName(
|
|
136
|
+
r.getParent()?.className === "Transformer" ? i = r.getParent().nodes() : r === b(this, X) ? i = r : (i = r.findAncestor((o) => o.hasName(oe.selectable), !0), i && b(this, Q)._selectNodes([i.id()])), b(this, Q)._showContextMenu({
|
|
137
137
|
x: t ? t.x : 0,
|
|
138
138
|
y: t ? t.y : 0,
|
|
139
139
|
clientX: e.evt.clientX,
|
|
@@ -519,7 +519,7 @@ function ou(n, e) {
|
|
|
519
519
|
...i,
|
|
520
520
|
width: t,
|
|
521
521
|
height: r,
|
|
522
|
-
name: `${
|
|
522
|
+
name: `${oe.nodeRoot} ${oe.selectable} ${oe.rect}`,
|
|
523
523
|
draggable: !0
|
|
524
524
|
};
|
|
525
525
|
}
|
|
@@ -532,7 +532,7 @@ function su(n, e) {
|
|
|
532
532
|
return {
|
|
533
533
|
...n,
|
|
534
534
|
...i,
|
|
535
|
-
name: `${
|
|
535
|
+
name: `${oe.nodeRoot} ${oe.selectable} ${oe.image}`,
|
|
536
536
|
draggable: !0
|
|
537
537
|
};
|
|
538
538
|
}
|
|
@@ -545,7 +545,7 @@ function lu(n, e) {
|
|
|
545
545
|
return {
|
|
546
546
|
...n,
|
|
547
547
|
...i,
|
|
548
|
-
name: `${
|
|
548
|
+
name: `${oe.nodeRoot} ${oe.selectable} ${oe.video}`,
|
|
549
549
|
draggable: !0
|
|
550
550
|
};
|
|
551
551
|
}
|
|
@@ -556,7 +556,7 @@ function au(n, e) {
|
|
|
556
556
|
...i,
|
|
557
557
|
width: t,
|
|
558
558
|
height: r,
|
|
559
|
-
name: `${
|
|
559
|
+
name: `${oe.nodeRoot} ${oe.imageMarker} ${n.$_parentId}`
|
|
560
560
|
};
|
|
561
561
|
}
|
|
562
562
|
function cu(n, e) {
|
|
@@ -566,7 +566,7 @@ function cu(n, e) {
|
|
|
566
566
|
...i,
|
|
567
567
|
width: t,
|
|
568
568
|
height: r,
|
|
569
|
-
name: `${
|
|
569
|
+
name: `${oe.nodeRoot} ${oe.selectable} ${oe.html}`,
|
|
570
570
|
draggable: !0
|
|
571
571
|
};
|
|
572
572
|
}
|
|
@@ -580,7 +580,7 @@ function uu(n, e) {
|
|
|
580
580
|
align: "left",
|
|
581
581
|
...n,
|
|
582
582
|
...t,
|
|
583
|
-
name: `${
|
|
583
|
+
name: `${oe.nodeRoot} ${oe.selectable} ${oe.text}`,
|
|
584
584
|
draggable: !0
|
|
585
585
|
};
|
|
586
586
|
}
|
|
@@ -590,7 +590,7 @@ function du(n, e) {
|
|
|
590
590
|
cornerRadius: 0,
|
|
591
591
|
...n,
|
|
592
592
|
...t,
|
|
593
|
-
name: `${
|
|
593
|
+
name: `${oe.nodeRoot} ${oe.richText}`,
|
|
594
594
|
draggable: !0
|
|
595
595
|
};
|
|
596
596
|
}
|
|
@@ -835,7 +835,7 @@ class Sy extends Qn {
|
|
|
835
835
|
createElement() {
|
|
836
836
|
const t = Math.max(this.config.width ?? te.MIN_SIZE, te.MIN_SIZE), r = Math.max(this.config.height ?? te.MIN_SIZE, te.MIN_SIZE), i = new me.Group({
|
|
837
837
|
id: this.config.id,
|
|
838
|
-
name: `${
|
|
838
|
+
name: `${oe.nodeRoot} ${oe.imageMarker} ${this.config.$_parentId}`,
|
|
839
839
|
x: this.config.x,
|
|
840
840
|
y: this.config.y,
|
|
841
841
|
width: t,
|
|
@@ -17901,7 +17901,7 @@ class CC extends Qn {
|
|
|
17901
17901
|
W(this, "resizeObserver");
|
|
17902
17902
|
W(this, "editor");
|
|
17903
17903
|
W(this, "attachEditor", () => {
|
|
17904
|
-
this.element.listening(!1), this.core._selectNodes(), this.core.isEditingText = !0, this.htmlElement.style.pointerEvents = "auto";
|
|
17904
|
+
this.htmlElement.id = "rich-text-html-element", this.element.listening(!1), this.core._selectNodes(), this.core.isEditingText = !0, this.htmlElement.style.pointerEvents = "auto";
|
|
17905
17905
|
const t = this.htmlEditorElement.innerHTML;
|
|
17906
17906
|
this.htmlEditorElement.innerHTML = "";
|
|
17907
17907
|
const r = new ww({
|
|
@@ -17921,11 +17921,11 @@ class CC extends Qn {
|
|
|
17921
17921
|
}), window.addEventListener("keydown", b(this, xi));
|
|
17922
17922
|
});
|
|
17923
17923
|
W(this, "detachEditor", () => {
|
|
17924
|
-
this.editor && (this.htmlEditorElement.innerHTML = this.editor.getHTML(), this.config.$_htmlContent = this.editor.getHTML(), this.editor.commands.blur(), this.editor.destroy(), this.editor = void 0, this.htmlElement.style.pointerEvents = "none", this.element.listening(!0), this.core.isEditingText = !1, this.core._unregisterTextEditor(), window.removeEventListener("keydown", b(this, xi)), window.removeEventListener("click", b(this, Ci)));
|
|
17924
|
+
this.editor && (this.htmlElement.id = "", this.htmlEditorElement.innerHTML = this.editor.getHTML(), this.config.$_htmlContent = this.editor.getHTML(), this.editor.commands.blur(), this.editor.destroy(), this.editor = void 0, this.htmlElement.style.pointerEvents = "none", this.element.listening(!0), this.core.isEditingText = !1, this.core._unregisterTextEditor(), window.removeEventListener("keydown", b(this, xi)), window.removeEventListener("click", b(this, Ci)));
|
|
17925
17925
|
});
|
|
17926
17926
|
P(this, Jt, () => {
|
|
17927
17927
|
const t = this.element.getClientRect();
|
|
17928
|
-
this.htmlElement.style.left = `${t.x}px`, this.htmlElement.style.top = `${t.y}px`, this.config.lockX ? this.htmlEditorElement.style.width = `${t.width}px` : this.htmlEditorElement.style.width = "auto", this.htmlEditorElement.style.transform = `scale(${this.config.htmlScale})`, this.htmlElement.style.transform = `scale(${this.core.getState().viewport.scale
|
|
17928
|
+
this.htmlElement.style.left = `${t.x}px`, this.htmlElement.style.top = `${t.y}px`, this.config.lockX ? this.htmlEditorElement.style.width = `${t.width}px` : this.htmlEditorElement.style.width = "auto", this.htmlEditorElement.style.transform = `scale(${this.config.htmlScale})`, this.htmlElement.style.transform = `scale(${this.core.getState().viewport.scale / this.config.scaleWhenCreate})`;
|
|
17929
17929
|
});
|
|
17930
17930
|
P(this, Es, () => {
|
|
17931
17931
|
this.resizeObserver = new ResizeObserver((t) => {
|
|
@@ -17952,7 +17952,7 @@ class CC extends Qn {
|
|
|
17952
17952
|
const r = t.target;
|
|
17953
17953
|
this.htmlElement.contains(r) || this.detachEditor();
|
|
17954
17954
|
});
|
|
17955
|
-
this.core = t, this.config = du(r, this.core.getTheme()), this.config.scaleWhenCreate = this.config.scaleWhenCreate || this.core.getState().viewport.scale || 1, this.config.htmlScale = this.config.htmlScale || 1, this.element = this.createElement(), tr(this.element, this), this.isDraft = i, this.htmlElement = document.createElement("div"), this.htmlElement.
|
|
17955
|
+
this.core = t, this.config = du(r, this.core.getTheme()), this.config.scaleWhenCreate = this.config.scaleWhenCreate || this.core.getState().viewport.scale || 1, this.config.htmlScale = this.config.htmlScale || 1, this.element = this.createElement(), tr(this.element, this), this.isDraft = i, this.htmlElement = document.createElement("div"), this.htmlElement.style.position = "absolute", this.htmlElement.style.pointerEvents = "none", this.htmlElement.style.overflowWrap = "break-word", this.htmlElement.style.transformOrigin = "top left", this.htmlEditorElement = document.createElement("div"), this.htmlEditorElement.style.transformOrigin = "top left", this.htmlEditorElement.innerHTML = this.config.$_htmlContent || "", this.htmlElement.appendChild(this.htmlEditorElement), this.core.getStage().content.appendChild(this.htmlElement), b(this, Es).call(this), ae(this, Ts, Cm).call(this), setTimeout(() => {
|
|
17956
17956
|
b(this, Jt).call(this);
|
|
17957
17957
|
});
|
|
17958
17958
|
}
|
|
@@ -18564,7 +18564,7 @@ class MC extends yy {
|
|
|
18564
18564
|
width: r.x - t.x,
|
|
18565
18565
|
height: r.y - t.y
|
|
18566
18566
|
});
|
|
18567
|
-
const i = b(this, Ye).getClientRect(), s = b(this, lt).find(`.${
|
|
18567
|
+
const i = b(this, Ye).getClientRect(), s = b(this, lt).find(`.${oe.selectable}`).filter((l) => {
|
|
18568
18568
|
const a = l.getClientRect();
|
|
18569
18569
|
return me.Util.haveIntersection(i, a);
|
|
18570
18570
|
});
|
|
@@ -18590,7 +18590,7 @@ class MC extends yy {
|
|
|
18590
18590
|
if (s.length === 0)
|
|
18591
18591
|
b(this, bt).clearNodes();
|
|
18592
18592
|
else {
|
|
18593
|
-
const l = this.getStage().find(`.${
|
|
18593
|
+
const l = this.getStage().find(`.${oe.selectable}`).filter((a) => s.includes(a.id()));
|
|
18594
18594
|
b(this, bt).setNodes(l);
|
|
18595
18595
|
}
|
|
18596
18596
|
this._updateState({ selectedNodeIds: s }, !1), this._emit("nodes:selected", s);
|
|
@@ -18664,7 +18664,7 @@ class MC extends yy {
|
|
|
18664
18664
|
}
|
|
18665
18665
|
// 在调整节点上下层级后调用,同步到 store 中
|
|
18666
18666
|
_syncNodesZIndexToStore() {
|
|
18667
|
-
const t = this.getStage().find(`.${
|
|
18667
|
+
const t = this.getStage().find(`.${oe.nodeRoot}`).map((s) => s.id()).filter((s) => s), r = this.getState().nodes || [], i = /* @__PURE__ */ new Map();
|
|
18668
18668
|
t.forEach((s, l) => {
|
|
18669
18669
|
i.set(s, l);
|
|
18670
18670
|
});
|
|
@@ -18943,7 +18943,7 @@ class AC extends MC {
|
|
|
18943
18943
|
let s = 1 / 0, l = 1 / 0, a = -1 / 0, c = -1 / 0;
|
|
18944
18944
|
const u = this.getMainLayer(), d = this.getState().selectedNodeIds || [], f = o && o.length > 0, h = !f && d.length > 0, p = f ? o : h ? d : null;
|
|
18945
18945
|
if (u.children.forEach((k) => {
|
|
18946
|
-
if (k.visible() && k.getClassName() !== "Transformer" && k.hasName(
|
|
18946
|
+
if (k.visible() && k.getClassName() !== "Transformer" && k.hasName(oe.selectable)) {
|
|
18947
18947
|
if (p) {
|
|
18948
18948
|
const R = k.id();
|
|
18949
18949
|
if (!p.includes(R)) return;
|
|
@@ -20055,7 +20055,7 @@ function zt(n) {
|
|
|
20055
20055
|
function Mc(n) {
|
|
20056
20056
|
return Ws() ? n instanceof Node || n instanceof Ke(n).Node : !1;
|
|
20057
20057
|
}
|
|
20058
|
-
function
|
|
20058
|
+
function ie(n) {
|
|
20059
20059
|
return Ws() ? n instanceof Element || n instanceof Ke(n).Element : !1;
|
|
20060
20060
|
}
|
|
20061
20061
|
function mt(n) {
|
|
@@ -20091,7 +20091,7 @@ function js(n) {
|
|
|
20091
20091
|
const ik = /transform|translate|scale|rotate|perspective|filter/, ok = /paint|layout|strict|content/, _n = (n) => !!n && n !== "none";
|
|
20092
20092
|
let Tl;
|
|
20093
20093
|
function Ac(n) {
|
|
20094
|
-
const e =
|
|
20094
|
+
const e = ie(n) ? pt(n) : n;
|
|
20095
20095
|
return _n(e.transform) || _n(e.translate) || _n(e.scale) || _n(e.rotate) || _n(e.perspective) || !Ks() && (_n(e.backdropFilter) || _n(e.filter)) || ik.test(e.willChange || "") || ok.test(e.contain || "");
|
|
20096
20096
|
}
|
|
20097
20097
|
function sk(n) {
|
|
@@ -20115,7 +20115,7 @@ function pt(n) {
|
|
|
20115
20115
|
return Ke(n).getComputedStyle(n);
|
|
20116
20116
|
}
|
|
20117
20117
|
function qs(n) {
|
|
20118
|
-
return
|
|
20118
|
+
return ie(n) ? {
|
|
20119
20119
|
scrollLeft: n.scrollLeft,
|
|
20120
20120
|
scrollTop: n.scrollTop
|
|
20121
20121
|
} : {
|
|
@@ -20163,7 +20163,7 @@ function Dm(n) {
|
|
|
20163
20163
|
};
|
|
20164
20164
|
}
|
|
20165
20165
|
function Oc(n) {
|
|
20166
|
-
return
|
|
20166
|
+
return ie(n) ? n : n.contextElement;
|
|
20167
20167
|
}
|
|
20168
20168
|
function hr(n) {
|
|
20169
20169
|
const e = Oc(n);
|
|
@@ -20195,11 +20195,11 @@ function Xn(n, e, t, r) {
|
|
|
20195
20195
|
e === void 0 && (e = !1), t === void 0 && (t = !1);
|
|
20196
20196
|
const i = n.getBoundingClientRect(), o = Oc(n);
|
|
20197
20197
|
let s = Dt(1);
|
|
20198
|
-
e && (r ?
|
|
20198
|
+
e && (r ? ie(r) && (s = hr(r)) : s = hr(n));
|
|
20199
20199
|
const l = ak(o, t, r) ? Lm(o) : Dt(0);
|
|
20200
20200
|
let a = (i.left + l.x) / s.x, c = (i.top + l.y) / s.y, u = i.width / s.x, d = i.height / s.y;
|
|
20201
20201
|
if (o) {
|
|
20202
|
-
const f = Ke(o), h = r &&
|
|
20202
|
+
const f = Ke(o), h = r && ie(r) ? Ke(r) : r;
|
|
20203
20203
|
let p = f, m = Ea(p);
|
|
20204
20204
|
for (; m && r && h !== p; ) {
|
|
20205
20205
|
const g = hr(m), y = m.getBoundingClientRect(), v = pt(m), w = y.left + (m.clientLeft + parseFloat(v.paddingLeft)) * g.x, x = y.top + (m.clientTop + parseFloat(v.paddingTop)) * g.y;
|
|
@@ -20301,7 +20301,7 @@ function Jd(n, e, t) {
|
|
|
20301
20301
|
r = fk(n, t);
|
|
20302
20302
|
else if (e === "document")
|
|
20303
20303
|
r = dk(zt(n));
|
|
20304
|
-
else if (
|
|
20304
|
+
else if (ie(e))
|
|
20305
20305
|
r = hk(e, t);
|
|
20306
20306
|
else {
|
|
20307
20307
|
const i = Lm(n);
|
|
@@ -20316,16 +20316,16 @@ function Jd(n, e, t) {
|
|
|
20316
20316
|
}
|
|
20317
20317
|
function _m(n, e) {
|
|
20318
20318
|
const t = rn(n);
|
|
20319
|
-
return t === e || !
|
|
20319
|
+
return t === e || !ie(t) || tn(t) ? !1 : pt(t).position === "fixed" || _m(t, e);
|
|
20320
20320
|
}
|
|
20321
20321
|
function pk(n, e) {
|
|
20322
20322
|
const t = e.get(n);
|
|
20323
20323
|
if (t)
|
|
20324
20324
|
return t;
|
|
20325
|
-
let r = En(n, [], !1).filter((l) =>
|
|
20325
|
+
let r = En(n, [], !1).filter((l) => ie(l) && Rr(l) !== "body"), i = null;
|
|
20326
20326
|
const o = pt(n).position === "fixed";
|
|
20327
20327
|
let s = o ? rn(n) : n;
|
|
20328
|
-
for (;
|
|
20328
|
+
for (; ie(s) && !tn(s); ) {
|
|
20329
20329
|
const l = pt(s), a = Ac(s);
|
|
20330
20330
|
!a && l.position === "fixed" && (i = null), (o ? !a && !i : !a && l.position === "static" && !!i && (i.position === "absolute" || i.position === "fixed") || Oi(s) && !a && _m(n, s)) ? r = r.filter((u) => u !== s) : i = l, s = rn(s);
|
|
20331
20331
|
}
|
|
@@ -20403,7 +20403,7 @@ function Bm(n, e) {
|
|
|
20403
20403
|
if (!mt(n)) {
|
|
20404
20404
|
let i = rn(n);
|
|
20405
20405
|
for (; i && !tn(i); ) {
|
|
20406
|
-
if (
|
|
20406
|
+
if (ie(i) && !Ml(i))
|
|
20407
20407
|
return i;
|
|
20408
20408
|
i = rn(i);
|
|
20409
20409
|
}
|
|
@@ -20438,7 +20438,7 @@ const wk = {
|
|
|
20438
20438
|
getClientRects: uk,
|
|
20439
20439
|
getDimensions: gk,
|
|
20440
20440
|
getScale: hr,
|
|
20441
|
-
isElement:
|
|
20441
|
+
isElement: ie,
|
|
20442
20442
|
isRTL: vk
|
|
20443
20443
|
};
|
|
20444
20444
|
function $m(n, e) {
|
|
@@ -23105,7 +23105,7 @@ function $E(n, e) {
|
|
|
23105
23105
|
function Re(Z) {
|
|
23106
23106
|
B() || J(Z, !1);
|
|
23107
23107
|
}
|
|
23108
|
-
if (
|
|
23108
|
+
if (ie(s.domReference)) {
|
|
23109
23109
|
const Z = s.domReference, Ce = s.floating;
|
|
23110
23110
|
return t && Z.addEventListener("mouseleave", F), f && Z.addEventListener("mousemove", D, {
|
|
23111
23111
|
once: !0
|
|
@@ -23118,7 +23118,7 @@ function $E(n, e) {
|
|
|
23118
23118
|
if (l && t && (D = m.current) != null && (D = D.__options) != null && D.blockPointerEvents && j()) {
|
|
23119
23119
|
N.current = !0;
|
|
23120
23120
|
const F = s.floating;
|
|
23121
|
-
if (
|
|
23121
|
+
if (ie(s.domReference) && F) {
|
|
23122
23122
|
var O;
|
|
23123
23123
|
const Y = It(s.floating).body;
|
|
23124
23124
|
Y.setAttribute(xf, "");
|
|
@@ -23398,14 +23398,14 @@ function GE(n, e) {
|
|
|
23398
23398
|
if (v.current = !1, c === "click" && D || V || typeof y == "function" && !y(R))
|
|
23399
23399
|
return;
|
|
23400
23400
|
const O = cr(R), F = "[" + Ri("inert") + "]", Y = It(i.floating).querySelectorAll(F);
|
|
23401
|
-
let Re =
|
|
23401
|
+
let Re = ie(O) ? O : null;
|
|
23402
23402
|
for (; Re && !tn(Re); ) {
|
|
23403
23403
|
const Ie = rn(Re);
|
|
23404
|
-
if (tn(Ie) || !
|
|
23404
|
+
if (tn(Ie) || !ie(Ie))
|
|
23405
23405
|
break;
|
|
23406
23406
|
Re = Ie;
|
|
23407
23407
|
}
|
|
23408
|
-
if (Y.length &&
|
|
23408
|
+
if (Y.length && ie(O) && !uE(O) && // Clicked on a direct ancestor (e.g. FloatingOverlay).
|
|
23409
23409
|
!Er(O, i.floating) && // If the target root element contains none of the markers, then the
|
|
23410
23410
|
// element was injected after the floating element rendered.
|
|
23411
23411
|
Array.from(Y).every((Ie) => !Er(Re, Ie)))
|
|
@@ -23466,7 +23466,7 @@ function GE(n, e) {
|
|
|
23466
23466
|
const O = It(i.floating);
|
|
23467
23467
|
l && (O.addEventListener("keydown", C ? _ : N, C), O.addEventListener("compositionstart", V), O.addEventListener("compositionend", D)), y && O.addEventListener(c, S ? j : L, S);
|
|
23468
23468
|
let F = [];
|
|
23469
|
-
return f && (
|
|
23469
|
+
return f && (ie(i.domReference) && (F = En(i.domReference)), ie(i.floating) && (F = F.concat(En(i.floating))), !ie(i.reference) && i.reference && i.reference.contextElement && (F = F.concat(En(i.reference.contextElement)))), F = F.filter((Y) => {
|
|
23470
23470
|
var Re;
|
|
23471
23471
|
return Y !== ((Re = O.defaultView) == null ? void 0 : Re.visualViewport);
|
|
23472
23472
|
}), F.forEach((Y) => {
|
|
@@ -23519,7 +23519,7 @@ function JE(n) {
|
|
|
23519
23519
|
} = n, i = Hc(), o = T.useRef({}), [s] = T.useState(() => PE()), l = Vc() != null;
|
|
23520
23520
|
if (process.env.NODE_ENV !== "production") {
|
|
23521
23521
|
const h = r.reference;
|
|
23522
|
-
h && !
|
|
23522
|
+
h && !ie(h) && LE("Cannot pass a virtual element to the `elements.reference` option,", "as it must be a real DOM element. Use `refs.setPositionReference()`", "instead.");
|
|
23523
23523
|
}
|
|
23524
23524
|
const [a, c] = T.useState(r.reference), u = Nt((h, p, m) => {
|
|
23525
23525
|
o.current.openEvent = h ? p : void 0, s.emit("openchange", {
|
|
@@ -23569,17 +23569,17 @@ function YE(n) {
|
|
|
23569
23569
|
}
|
|
23570
23570
|
}
|
|
23571
23571
|
}), p = T.useCallback((w) => {
|
|
23572
|
-
const x =
|
|
23572
|
+
const x = ie(w) ? {
|
|
23573
23573
|
getBoundingClientRect: () => w.getBoundingClientRect(),
|
|
23574
23574
|
getClientRects: () => w.getClientRects(),
|
|
23575
23575
|
contextElement: w
|
|
23576
23576
|
} : w;
|
|
23577
23577
|
a(x), h.refs.setReference(x);
|
|
23578
23578
|
}, [h.refs]), m = T.useCallback((w) => {
|
|
23579
|
-
(
|
|
23579
|
+
(ie(w) || w === null) && (d.current = w, s(w)), (ie(h.refs.reference.current) || h.refs.reference.current === null || // Don't allow setting virtual elements using the old technique back to
|
|
23580
23580
|
// `null` to support `positionReference` + an unstable `reference`
|
|
23581
23581
|
// callback ref.
|
|
23582
|
-
w !== null && !
|
|
23582
|
+
w !== null && !ie(w)) && h.refs.setReference(w);
|
|
23583
23583
|
}, [h.refs]), g = T.useMemo(() => ({
|
|
23584
23584
|
...h.refs,
|
|
23585
23585
|
setReference: m,
|
|
@@ -23657,7 +23657,7 @@ function XE(n, e) {
|
|
|
23657
23657
|
onFocus(h) {
|
|
23658
23658
|
if (c.current) return;
|
|
23659
23659
|
const p = cr(h.nativeEvent);
|
|
23660
|
-
if (a &&
|
|
23660
|
+
if (a && ie(p)) {
|
|
23661
23661
|
if ($l() && !h.relatedTarget) {
|
|
23662
23662
|
if (!d.current && !dE(p))
|
|
23663
23663
|
return;
|
|
@@ -23668,7 +23668,7 @@ function XE(n, e) {
|
|
|
23668
23668
|
},
|
|
23669
23669
|
onBlur(h) {
|
|
23670
23670
|
c.current = !1;
|
|
23671
|
-
const p = h.relatedTarget, m = h.nativeEvent, g =
|
|
23671
|
+
const p = h.relatedTarget, m = h.nativeEvent, g = ie(p) && p.hasAttribute(Ri("focus-guard")) && p.getAttribute("data-type") === "outside";
|
|
23672
23672
|
u.current = window.setTimeout(() => {
|
|
23673
23673
|
var y;
|
|
23674
23674
|
const v = Na(s.domReference ? s.domReference.ownerDocument : document);
|
|
@@ -25639,7 +25639,7 @@ export {
|
|
|
25639
25639
|
AC as CanvasApi,
|
|
25640
25640
|
vy as DARK_THEME,
|
|
25641
25641
|
Df as DEFAULT_THEME,
|
|
25642
|
-
|
|
25642
|
+
oe as NODE_NAMES,
|
|
25643
25643
|
nM as THEME_PRESETS,
|
|
25644
25644
|
sM as TipTapBubbleMenu,
|
|
25645
25645
|
iM as Whiteboard,
|