@fileverse-dev/ddoc 3.0.56-patch-1 → 3.0.56-patch-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/dist/index.es.js +94 -68
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -167906,96 +167906,118 @@ const l5 = ek.getInstance(), xIe = (e) => ({
|
|
|
167906
167906
|
};
|
|
167907
167907
|
},
|
|
167908
167908
|
addCommands() {
|
|
167909
|
-
const e = (
|
|
167910
|
-
var
|
|
167911
|
-
|
|
167912
|
-
|
|
167913
|
-
|
|
167914
|
-
|
|
167915
|
-
|
|
167916
|
-
|
|
167917
|
-
|
|
167918
|
-
|
|
167919
|
-
|
|
167920
|
-
|
|
167921
|
-
|
|
167922
|
-
|
|
167909
|
+
const e = () => {
|
|
167910
|
+
var i;
|
|
167911
|
+
try {
|
|
167912
|
+
return (i = this.editor.view) == null ? void 0 : i.dom;
|
|
167913
|
+
} catch {
|
|
167914
|
+
return;
|
|
167915
|
+
}
|
|
167916
|
+
}, t = (i) => typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(i) : i.replace(/\\/g, "\\\\").replace(/"/g, '\\"'), n = (i, s) => {
|
|
167917
|
+
const a = t(s);
|
|
167918
|
+
return i.querySelectorAll(
|
|
167919
|
+
`[data-comment-id="${a}"]`
|
|
167920
|
+
);
|
|
167921
|
+
}, r = (i, s) => {
|
|
167922
|
+
const a = i.getAttribute("data-resolved") === "true";
|
|
167923
|
+
i.setAttribute("data-active", s ? "true" : "false"), i.classList.toggle("inline-comment--active", s), i.classList.toggle(
|
|
167924
|
+
"inline-comment--resolved",
|
|
167925
|
+
!s && a
|
|
167926
|
+
), i.classList.toggle(
|
|
167927
|
+
"inline-comment--unresolved",
|
|
167928
|
+
!s && !a
|
|
167929
|
+
);
|
|
167930
|
+
}, o = (i, s) => {
|
|
167931
|
+
if (i === s) return;
|
|
167932
|
+
const a = e();
|
|
167933
|
+
a && (i && n(a, i).forEach((l) => {
|
|
167934
|
+
r(l, !1);
|
|
167935
|
+
}), s && n(a, s).forEach((l) => {
|
|
167936
|
+
r(l, !0);
|
|
167937
|
+
}));
|
|
167923
167938
|
};
|
|
167924
167939
|
return {
|
|
167925
|
-
setComment: (
|
|
167926
|
-
unsetComment: (
|
|
167927
|
-
var
|
|
167928
|
-
if (!
|
|
167929
|
-
const
|
|
167930
|
-
return
|
|
167931
|
-
const
|
|
167932
|
-
(
|
|
167940
|
+
setComment: (i) => ({ commands: s }) => i ? (s.setMark("comment", { commentId: i }), !0) : !1,
|
|
167941
|
+
unsetComment: (i) => ({ tr: s, dispatch: a }) => {
|
|
167942
|
+
var u, c;
|
|
167943
|
+
if (!i) return !1;
|
|
167944
|
+
const l = [];
|
|
167945
|
+
return s.doc.descendants((d, p) => {
|
|
167946
|
+
const h = d.marks.find(
|
|
167947
|
+
(f) => f.type.name === "comment" && f.attrs.commentId === i
|
|
167933
167948
|
);
|
|
167934
|
-
|
|
167935
|
-
mark:
|
|
167949
|
+
h && l.push({
|
|
167950
|
+
mark: h,
|
|
167936
167951
|
range: {
|
|
167937
|
-
from:
|
|
167938
|
-
to:
|
|
167952
|
+
from: p,
|
|
167953
|
+
to: p + d.nodeSize
|
|
167939
167954
|
}
|
|
167940
167955
|
});
|
|
167941
|
-
}),
|
|
167942
|
-
|
|
167943
|
-
}), (
|
|
167944
|
-
},
|
|
167945
|
-
resolveComment: (
|
|
167946
|
-
var
|
|
167947
|
-
if (!
|
|
167948
|
-
const
|
|
167949
|
-
return
|
|
167950
|
-
const
|
|
167951
|
-
(
|
|
167956
|
+
}), l.forEach(({ mark: d, range: p }) => {
|
|
167957
|
+
s.removeMark(p.from, p.to, d);
|
|
167958
|
+
}), (c = (u = this.options).onCommentDeleted) == null || c.call(u, i), a == null ? void 0 : a(s);
|
|
167959
|
+
},
|
|
167960
|
+
resolveComment: (i) => ({ tr: s, dispatch: a }) => {
|
|
167961
|
+
var u, c;
|
|
167962
|
+
if (!i) return !1;
|
|
167963
|
+
const l = [];
|
|
167964
|
+
return s.doc.descendants((d, p) => {
|
|
167965
|
+
const h = d.marks.find(
|
|
167966
|
+
(f) => f.type.name === "comment" && f.attrs.commentId === i
|
|
167952
167967
|
);
|
|
167953
|
-
|
|
167954
|
-
mark:
|
|
167968
|
+
h && l.push({
|
|
167969
|
+
mark: h,
|
|
167955
167970
|
range: {
|
|
167956
|
-
from:
|
|
167957
|
-
to:
|
|
167971
|
+
from: p,
|
|
167972
|
+
to: p + d.nodeSize
|
|
167958
167973
|
}
|
|
167959
167974
|
});
|
|
167960
|
-
}),
|
|
167961
|
-
|
|
167962
|
-
|
|
167963
|
-
|
|
167975
|
+
}), l.forEach(({ range: d }) => {
|
|
167976
|
+
s.addMark(
|
|
167977
|
+
d.from,
|
|
167978
|
+
d.to,
|
|
167964
167979
|
this.editor.schema.marks.comment.create({
|
|
167965
|
-
commentId:
|
|
167980
|
+
commentId: i,
|
|
167966
167981
|
resolved: !0
|
|
167967
167982
|
})
|
|
167968
167983
|
);
|
|
167969
|
-
}), (
|
|
167970
|
-
},
|
|
167971
|
-
unresolveComment: (
|
|
167972
|
-
var
|
|
167973
|
-
if (!
|
|
167974
|
-
const
|
|
167975
|
-
return
|
|
167976
|
-
const
|
|
167977
|
-
(
|
|
167984
|
+
}), (c = (u = this.options).onCommentResolved) == null || c.call(u, i), a == null ? void 0 : a(s);
|
|
167985
|
+
},
|
|
167986
|
+
unresolveComment: (i) => ({ tr: s, dispatch: a }) => {
|
|
167987
|
+
var u, c;
|
|
167988
|
+
if (!i) return !1;
|
|
167989
|
+
const l = [];
|
|
167990
|
+
return s.doc.descendants((d, p) => {
|
|
167991
|
+
const h = d.marks.find(
|
|
167992
|
+
(f) => f.type.name === "comment" && f.attrs.commentId === i
|
|
167978
167993
|
);
|
|
167979
|
-
|
|
167980
|
-
mark:
|
|
167994
|
+
h && l.push({
|
|
167995
|
+
mark: h,
|
|
167981
167996
|
range: {
|
|
167982
|
-
from:
|
|
167983
|
-
to:
|
|
167997
|
+
from: p,
|
|
167998
|
+
to: p + d.nodeSize
|
|
167984
167999
|
}
|
|
167985
168000
|
});
|
|
167986
|
-
}),
|
|
167987
|
-
|
|
167988
|
-
|
|
167989
|
-
|
|
168001
|
+
}), l.forEach(({ range: d }) => {
|
|
168002
|
+
s.addMark(
|
|
168003
|
+
d.from,
|
|
168004
|
+
d.to,
|
|
167990
168005
|
this.editor.schema.marks.comment.create({
|
|
167991
|
-
commentId:
|
|
168006
|
+
commentId: i,
|
|
167992
168007
|
resolved: !1
|
|
167993
168008
|
})
|
|
167994
168009
|
);
|
|
167995
|
-
}), (
|
|
168010
|
+
}), (c = (u = this.options).onCommentUnresolved) == null || c.call(u, i), a == null ? void 0 : a(s);
|
|
167996
168011
|
},
|
|
167997
|
-
setCommentActive: (
|
|
167998
|
-
|
|
168012
|
+
setCommentActive: (i) => () => {
|
|
168013
|
+
if (!i) return !1;
|
|
168014
|
+
const s = this.storage.activeCommentId;
|
|
168015
|
+
return s === i || (this.storage.activeCommentId = i, o(s, i)), !0;
|
|
168016
|
+
},
|
|
168017
|
+
unsetCommentActive: () => () => {
|
|
168018
|
+
const i = this.storage.activeCommentId;
|
|
168019
|
+
return i && (this.storage.activeCommentId = null, o(i, null)), !0;
|
|
168020
|
+
}
|
|
167999
168021
|
};
|
|
168000
168022
|
}
|
|
168001
168023
|
});
|
|
@@ -169546,7 +169568,11 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
169546
169568
|
}
|
|
169547
169569
|
},
|
|
169548
169570
|
blur: () => {
|
|
169549
|
-
|
|
169571
|
+
try {
|
|
169572
|
+
J == null || J.commands.unsetCommentActive();
|
|
169573
|
+
} catch {
|
|
169574
|
+
return;
|
|
169575
|
+
}
|
|
169550
169576
|
}
|
|
169551
169577
|
},
|
|
169552
169578
|
handleClick: (_e, Te, Be) => {
|