@ylzcc/editor 0.2.18 → 0.2.20

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/editor.es.js CHANGED
@@ -62465,13 +62465,23 @@ const Heading = Node$1.create({
62465
62465
  }));
62466
62466
  },
62467
62467
  onTransaction() {
62468
- var $P, zP, eme, tme, nme, rme, ime, ome;
62469
- if (document.querySelectorAll(".h-link").length > 0 || !(($P = this == null ? void 0 : this.editor) != null && $P.isFocused) || !((zP = this == null ? void 0 : this.editor) != null && zP.isEditable) || !((eme = this == null ? void 0 : this.options) != null && eme.component))
62468
+ var zP, eme, tme, nme, rme, ime, ome, ame, cme, ume;
62469
+ if (document.querySelectorAll(".h-link").length > 0 || !((zP = this == null ? void 0 : this.editor) != null && zP.isFocused) || !((eme = this == null ? void 0 : this.editor) != null && eme.isEditable) || !((tme = this == null ? void 0 : this.options) != null && tme.component))
62470
62470
  return;
62471
- const kh = (rme = (nme = (tme = this == null ? void 0 : this.editor) == null ? void 0 : tme.view) == null ? void 0 : nme.state) == null ? void 0 : rme.selection, { empty: x_, from: B_, to: $_ } = kh;
62471
+ const kh = (ime = (rme = (nme = this == null ? void 0 : this.editor) == null ? void 0 : nme.view) == null ? void 0 : rme.state) == null ? void 0 : ime.selection, { empty: x_, from: B_, to: $_, anchor: $P } = kh;
62472
62472
  if (x_ || B_ === $_) {
62473
- (ome = (ime = this == null ? void 0 : this.options) == null ? void 0 : ime.tippy) == null || ome.hide();
62473
+ (ame = (ome = this == null ? void 0 : this.options) == null ? void 0 : ome.tippy) == null || ame.hide();
62474
62474
  return;
62475
+ } else {
62476
+ let sme = !1;
62477
+ const { doc: lme } = this.editor.state;
62478
+ if (lme.descendants((dme, fme) => {
62479
+ const pme = $P >= fme && $P < fme + dme.nodeSize;
62480
+ return dme.type.name === "active" && pme && (sme = !0), !1;
62481
+ }), sme) {
62482
+ (ume = (cme = this == null ? void 0 : this.options) == null ? void 0 : cme.tippy) == null || ume.hide();
62483
+ return;
62484
+ }
62475
62485
  }
62476
62486
  build$1(this, B_, $_);
62477
62487
  },
@@ -94545,13 +94555,13 @@ const LinkComponent = (Ff) => {
94545
94555
  const rme = zP >= nme && zP < nme + tme.nodeSize;
94546
94556
  if (tme.type.name === "active" && rme) {
94547
94557
  const ime = Decoration.node(nme, nme + tme.nodeSize, {
94548
- // class: 'tiptap-active-focus',
94549
- style: "outline: 2px solid #1677ff;"
94558
+ class: "tiptap-active-focus"
94559
+ // style: 'outline: 2px solid #1677ff;'
94550
94560
  });
94551
94561
  eme.push(ime);
94552
94562
  }
94553
94563
  return !1;
94554
- }), console.log(eme), DecorationSet.create($_, eme);
94564
+ }), DecorationSet.create($_, eme);
94555
94565
  }
94556
94566
  }
94557
94567
  })