@damiro/stylo 0.13.0 → 0.13.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.
@@ -1,5 +1,5 @@
1
- import { a as e, o as t, r as n } from "./highlight-DNGJlCDY.js";
2
- import { S as r, _ as i, a, b as o, c as s, d as c, f as l, g as u, h as d, i as f, l as p, m, n as h, o as g, p as _, r as ee, s as v, t as te, u as ne, v as re, x as y, y as b } from "./useCodeMirror-COmcRrUo.js";
1
+ import { a as e, o as t, r as n } from "./highlight-B4c0sXF_.js";
2
+ import { S as r, _ as i, a, b as o, c as s, d as c, f as l, g as u, h as d, i as f, l as p, m, n as h, o as g, p as _, r as ee, s as v, t as te, u as ne, v as re, x as y, y as b } from "./useCodeMirror-C3DKpax1.js";
3
3
  import { a as ie, i as x } from "./config-DTBxVhtH.js";
4
4
  import { a as S, n as ae, o as oe, r as C, t as w } from "./embed-Dsu6b-MV.js";
5
5
  import { t as se } from "./katex-BfiLlqfN.js";
@@ -2021,14 +2021,14 @@ var Wn = P.define({
2021
2021
  };
2022
2022
  }, this.contentDOM.addEventListener("pointerdown", this.onPointerDown, !0), this.onContextMenu = (t) => {
2023
2023
  let n = t.target;
2024
- e.state.facet(Ce) && (n?.closest(".cm-inplace-table-edit") || (t.preventDefault(), this.longPress.cancel(), !(Date.now() - this.longPressAt < 700) && this.openMenuAt(t.clientX, t.clientY, n)));
2024
+ !e.state.facet(Ce) || e.state.readOnly || n?.closest(".cm-inplace-table-edit") || (t.preventDefault(), this.longPress.cancel(), !(Date.now() - this.longPressAt < 700) && this.openMenuAt(t.clientX, t.clientY, n));
2025
2025
  }, this.contentDOM.addEventListener("contextmenu", this.onContextMenu), this.longPress = an(this.contentDOM, { onLongPress: (e, t, n) => {
2026
2026
  this.longPressAt = Date.now(), this.openMenuAt(e, t, n);
2027
2027
  } });
2028
2028
  }
2029
2029
  openMenuAt(e, t, n) {
2030
2030
  let r = this.view;
2031
- if (!r.state.facet(Ce) || n?.closest(".cm-inplace-table-edit")) return;
2031
+ if (!r.state.facet(Ce) || r.state.readOnly || n?.closest(".cm-inplace-table-edit")) return;
2032
2032
  let i = n?.closest(".cm-inplace-hr");
2033
2033
  if (i) {
2034
2034
  let n = r.posAtDOM(i);
@@ -2089,7 +2089,7 @@ function Yn(e) {
2089
2089
  };
2090
2090
  }
2091
2091
  function Xn(e, t, n) {
2092
- if (e.state.facet(ke) !== "bar" || e.state.field(Kn, !1)) return null;
2092
+ if (e.state.facet(ke) !== "bar" || e.state.readOnly || e.state.field(Kn, !1)) return null;
2093
2093
  let r = Yn(e);
2094
2094
  if (!r) return null;
2095
2095
  let { box: i, inCell: a } = r;
@@ -2140,8 +2140,8 @@ var Zn = class {
2140
2140
  e.dom.appendChild(this.bar), t.addEventListener("scroll", this.onScroll, !0), t.addEventListener("selectionchange", this.onSelectionChange);
2141
2141
  }
2142
2142
  update(e) {
2143
- let t = e.startState.field(Kn, !1) !== e.state.field(Kn, !1);
2144
- (e.selectionSet || e.docChanged || e.focusChanged || t) && this.schedule();
2143
+ let t = e.startState.field(Kn, !1) !== e.state.field(Kn, !1), n = e.startState.readOnly !== e.state.readOnly;
2144
+ (e.selectionSet || e.docChanged || e.focusChanged || t || n) && this.schedule();
2145
2145
  }
2146
2146
  schedule() {
2147
2147
  this.view.requestMeasure({
@@ -2704,4 +2704,4 @@ function _r({ value: e, onChange: n, readOnly: i, placeholder: a, onWikiLinkClic
2704
2704
  //#endregion
2705
2705
  export { _r as InPlaceView };
2706
2706
 
2707
- //# sourceMappingURL=InPlaceView-BGVCST5f.js.map
2707
+ //# sourceMappingURL=InPlaceView-DJzxnK6B.js.map