@jinntec/jinntap 1.14.0 → 1.14.1
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 +18 -15
- package/package.json +1 -1
package/dist/jinn-tap.es.js
CHANGED
|
@@ -21661,16 +21661,17 @@ function Px(n, e, t, i = 3) {
|
|
|
21661
21661
|
}
|
|
21662
21662
|
class zx {
|
|
21663
21663
|
constructor(e, t) {
|
|
21664
|
-
this.editor = e.tiptap, this.schemaDef = t, this.panel = e.querySelector(".attribute-panel"), this.currentElement = null, this.currentMark = null, this.setupEventListeners(), this.overlay = document.createElement("div"), this.overlay.className = "jinn-tap overlay", this.overlay.style.display = "block", this.overlay.style.position = "fixed", this.overlay.style.pointerEvents = "none", this.overlay.style.zIndex = "1000", this.overlay.style.display = "none";
|
|
21665
|
-
}
|
|
21666
|
-
setupEventListeners() {
|
|
21667
|
-
this.editor.on("selectionUpdate", (
|
|
21668
|
-
this.updatePanelForCurrentPosition(
|
|
21669
|
-
}), this.editor.on("
|
|
21670
|
-
|
|
21671
|
-
|
|
21672
|
-
|
|
21673
|
-
|
|
21664
|
+
this.editor = e.tiptap, this.schemaDef = t, this.panel = e.querySelector(".attribute-panel"), this.currentElement = null, this.currentMark = null, this.setupEventListeners(e), this.overlay = document.createElement("div"), this.overlay.className = "jinn-tap overlay", this.overlay.style.display = "block", this.overlay.style.position = "fixed", this.overlay.style.pointerEvents = "none", this.overlay.style.zIndex = "1000", this.overlay.style.display = "none";
|
|
21665
|
+
}
|
|
21666
|
+
setupEventListeners(e) {
|
|
21667
|
+
this.editor.on("selectionUpdate", (t) => {
|
|
21668
|
+
this.updatePanelForCurrentPosition(t.editor);
|
|
21669
|
+
}), this.editor.on("transaction", ({ editor: t, transaction: i }) => {
|
|
21670
|
+
const r = i.meta["y-sync$"] !== void 0;
|
|
21671
|
+
i.docChanged && !r && this.updatePanelForCurrentPosition(t);
|
|
21672
|
+
}), this.editor.options.element.addEventListener("empty-element-clicked", ({ detail: t }) => {
|
|
21673
|
+
const { node: i, pos: r } = t;
|
|
21674
|
+
this.editor.chain().focus().setNodeSelection(r).run(), this.showNodeAttributes(i);
|
|
21674
21675
|
});
|
|
21675
21676
|
}
|
|
21676
21677
|
updatePanelForCurrentPosition(e) {
|
|
@@ -21866,8 +21867,9 @@ class Rx {
|
|
|
21866
21867
|
this.editor = e.tiptap, this.attributePanel = t, this.panel = e.querySelector(".navigation-panel"), this.setupEventListeners();
|
|
21867
21868
|
}
|
|
21868
21869
|
setupEventListeners() {
|
|
21869
|
-
this.editor.on("
|
|
21870
|
-
|
|
21870
|
+
this.editor.on("transaction", ({ editor: e, transaction: t }) => {
|
|
21871
|
+
const i = t.meta["y-sync$"] !== void 0;
|
|
21872
|
+
t.docChanged && !i && this.updatePanelForCurrentPosition(e);
|
|
21871
21873
|
}), this.editor.on("selectionUpdate", ({ editor: e }) => {
|
|
21872
21874
|
this.updatePanelForCurrentPosition(e);
|
|
21873
21875
|
});
|
|
@@ -39211,9 +39213,11 @@ class Qx extends HTMLElement {
|
|
|
39211
39213
|
],
|
|
39212
39214
|
autofocus: !1,
|
|
39213
39215
|
onCreate: () => {
|
|
39214
|
-
this.
|
|
39216
|
+
this.dispatchEvent(new CustomEvent("ready"));
|
|
39215
39217
|
},
|
|
39216
|
-
|
|
39218
|
+
onTransaction: ({ editor: o, transaction: a }) => {
|
|
39219
|
+
a.docChanged && this.dispatchContentChange();
|
|
39220
|
+
}
|
|
39217
39221
|
};
|
|
39218
39222
|
this.collabEnabled ? (s.extensions.push(Cv.configure({
|
|
39219
39223
|
provider: this.provider,
|
|
@@ -39229,7 +39233,6 @@ class Qx extends HTMLElement {
|
|
|
39229
39233
|
dispatchContentChange() {
|
|
39230
39234
|
this.dispatchEvent(new CustomEvent("content-change", {
|
|
39231
39235
|
detail: {
|
|
39232
|
-
content: this.editor.getText(),
|
|
39233
39236
|
xml: xc(this.editor)
|
|
39234
39237
|
}
|
|
39235
39238
|
}));
|