@jinntec/jinntap 1.13.1 → 1.13.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/jinn-tap.es.js +23 -24
- package/package.json +1 -1
package/dist/jinn-tap.es.js
CHANGED
|
@@ -21896,37 +21896,36 @@ class Ix {
|
|
|
21896
21896
|
}
|
|
21897
21897
|
updatePanelForCurrentPosition(e) {
|
|
21898
21898
|
this.panel.innerHTML = "";
|
|
21899
|
-
const { from: t, to: i } = e.state.selection, r = e.state.doc.
|
|
21900
|
-
let
|
|
21901
|
-
if (
|
|
21902
|
-
|
|
21903
|
-
let
|
|
21904
|
-
const u = e.state.doc.resolve(l);
|
|
21899
|
+
const { from: t, to: i } = e.state.selection, r = e.state.doc.resolve(t), s = r.node(), o = [];
|
|
21900
|
+
let a;
|
|
21901
|
+
if (s) {
|
|
21902
|
+
s.isText && (a = Ph(e, t, i));
|
|
21903
|
+
let c = r.depth;
|
|
21905
21904
|
for (; c > 0; ) {
|
|
21906
|
-
const
|
|
21907
|
-
if (
|
|
21908
|
-
const
|
|
21909
|
-
type:
|
|
21910
|
-
node:
|
|
21911
|
-
pos: { from:
|
|
21905
|
+
const u = r.node(c);
|
|
21906
|
+
if (u) {
|
|
21907
|
+
const d = {
|
|
21908
|
+
type: u.type.name,
|
|
21909
|
+
node: u,
|
|
21910
|
+
pos: { from: r.start(c), to: r.end(c) }
|
|
21912
21911
|
};
|
|
21913
|
-
|
|
21912
|
+
o.push(d);
|
|
21914
21913
|
}
|
|
21915
21914
|
c--;
|
|
21916
21915
|
}
|
|
21917
21916
|
}
|
|
21918
|
-
let
|
|
21919
|
-
|
|
21917
|
+
let l = document.createElement("ul");
|
|
21918
|
+
o.reverse().forEach((c, u) => {
|
|
21919
|
+
const d = document.createElement("li"), h = document.createElement("a");
|
|
21920
|
+
h.setAttribute("href", "#"), h.textContent = c.type, h.addEventListener("click", (p) => {
|
|
21921
|
+
p.preventDefault(), this.editor.chain().focus().setNodeSelection(c.pos.from - 1).run(), this.attributePanel.showNodeAttributes(c.node);
|
|
21922
|
+
}), d.appendChild(h), l.appendChild(d);
|
|
21923
|
+
}), a && a.forEach((c) => {
|
|
21920
21924
|
const u = document.createElement("li"), d = document.createElement("a");
|
|
21921
|
-
d.setAttribute("href", "#"), d.textContent =
|
|
21922
|
-
h.preventDefault(), this.editor.chain().focus().
|
|
21923
|
-
}), u.appendChild(d),
|
|
21924
|
-
}),
|
|
21925
|
-
const c = document.createElement("li"), u = document.createElement("a");
|
|
21926
|
-
u.setAttribute("href", "#"), u.textContent = l.mark.type.name, u.addEventListener("click", (d) => {
|
|
21927
|
-
d.preventDefault(), this.editor.chain().focus().extendMarkRange(l.mark.type).run(), this.attributePanel.showMarkAttributes(l.mark, l.text);
|
|
21928
|
-
}), c.appendChild(u), a.appendChild(c);
|
|
21929
|
-
}), this.panel.appendChild(a);
|
|
21925
|
+
d.setAttribute("href", "#"), d.textContent = c.mark.type.name, d.addEventListener("click", (h) => {
|
|
21926
|
+
h.preventDefault(), this.editor.chain().focus().extendMarkRange(c.mark.type).run(), this.attributePanel.showMarkAttributes(c.mark, c.text);
|
|
21927
|
+
}), u.appendChild(d), l.appendChild(u);
|
|
21928
|
+
}), this.panel.appendChild(l);
|
|
21930
21929
|
}
|
|
21931
21930
|
}
|
|
21932
21931
|
class zx {
|