@damiro/stylo 0.20.0 → 0.20.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.
@@ -732,7 +732,7 @@ function zt(e, t, n, r) {
732
732
  }
733
733
  function Bt(e, t) {
734
734
  let n = document.createElement("span");
735
- n.className = e.class;
735
+ n.className = e.class, n.dataset.styloCellMark = "";
736
736
  for (let [t, r] of Object.entries(e.attributes ?? {})) try {
737
737
  n.setAttribute(t, r);
738
738
  } catch {}
@@ -1815,6 +1815,7 @@ var cr = Se.define(), lr = /* @__PURE__ */ new WeakMap(), ur = class extends k {
1815
1815
  editing = null;
1816
1816
  syncing = !1;
1817
1817
  pendingOffset = null;
1818
+ pressOnMark = !1;
1818
1819
  gizmos = null;
1819
1820
  longPress = null;
1820
1821
  longPressAt = 0;
@@ -1895,9 +1896,18 @@ var cr = Se.define(), lr = /* @__PURE__ */ new WeakMap(), ur = class extends k {
1895
1896
  }
1896
1897
  onFocusIn(e) {
1897
1898
  let t = e.target.closest("td, th");
1898
- if (!t || t === this.editing) return;
1899
- let n = this.pendingOffset ?? b(t);
1900
- this.pendingOffset = null, this.editing && this.finish(this.editing, !1), this.editing = t, this.paint(t, !0), d(t, n);
1899
+ if (!(!t || t === this.editing)) {
1900
+ if (this.pressOnMark) {
1901
+ this.pressOnMark = !1, document.addEventListener("mouseup", () => setTimeout(() => this.enterCell(t)), { once: !0 });
1902
+ return;
1903
+ }
1904
+ this.enterCell(t);
1905
+ }
1906
+ }
1907
+ enterCell(e) {
1908
+ if (!this.table?.contains(e) || e === this.editing) return;
1909
+ let t = this.pendingOffset ?? b(e);
1910
+ this.pendingOffset = null, this.editing && this.finish(this.editing, !1), this.editing = e, this.paint(e, !0), d(e, t);
1901
1911
  }
1902
1912
  onFocusOut(e) {
1903
1913
  if (this.syncing || !this.editing) return;
@@ -1975,7 +1985,7 @@ var cr = Se.define(), lr = /* @__PURE__ */ new WeakMap(), ur = class extends k {
1975
1985
  }), n.addEventListener("mousedown", (e) => {
1976
1986
  e.stopPropagation();
1977
1987
  let t = e.target.closest("td, th");
1978
- this.pendingOffset = t && t !== this.editing ? x(t, e.clientX, e.clientY) : null;
1988
+ this.pendingOffset = t && t !== this.editing ? x(t, e.clientX, e.clientY) : null, this.pressOnMark = !!e.target.closest("[data-stylo-cell-mark]");
1979
1989
  }), n.addEventListener("focusin", (e) => this.onFocusIn(e)), n.addEventListener("focusout", (e) => this.onFocusOut(e));
1980
1990
  let r = (t) => {
1981
1991
  t && (this.editing = t, this.finish(t, !0), this.sync(e));
@@ -3028,4 +3038,4 @@ function ri({ value: e, onChange: t, readOnly: r, placeholder: i, onWikiLinkClic
3028
3038
  //#endregion
3029
3039
  export { ri as InPlaceView };
3030
3040
 
3031
- //# sourceMappingURL=InPlaceView-AZ_ufoP3.js.map
3041
+ //# sourceMappingURL=InPlaceView-gei6uiAm.js.map