@nerd-bible/wordgard 0.5.3-beta1 → 0.5.3-beta3

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/collab.js CHANGED
@@ -73,7 +73,7 @@ const collabField = /*@__PURE__*/GardState.Field.define({
73
73
  }
74
74
  });
75
75
  function collab(config = {}) {
76
- return [collabField, collabConfig.of({ generatedID: Math.floor(Math.random() * 1e9).toString(36), ...config })];
76
+ return [collabField, collabConfig.of({ generatedID: Math.floor(Math.random() * 1e15).toString(36), ...config })];
77
77
  }
78
78
  ;collab = /*@__PURE__*/(function (collab_1) {
79
79
  function receive(state, updates) {
package/dist/editor.js CHANGED
@@ -1858,7 +1858,9 @@ class CompositeTile extends Tile {
1858
1858
  return CoordPos.create(start + this.length - 2 * this.boundary, -1);
1859
1859
  }
1860
1860
  }
1861
- function rowScan(x, y, scan) {
1861
+ function rowScan(x, y, scan, depth = 0) {
1862
+ if (depth > 1)
1863
+ return null;
1862
1864
  let closest = null, closestDx = 1e8, closestRect = null;
1863
1865
  let above = null, below = null;
1864
1866
  scan((rect, value) => {
@@ -1884,16 +1886,16 @@ function rowScan(x, y, scan) {
1884
1886
  if (closestRect) {
1885
1887
  if (closestDx) {
1886
1888
  if (above && above.bottom > closestRect.top)
1887
- return rowScan(x, above.bottom - 1, scan);
1889
+ return rowScan(x, above.bottom - 1, scan, depth + 1);
1888
1890
  if (below && below.top < closestRect.bottom)
1889
- return rowScan(x, below.top + 1, scan);
1891
+ return rowScan(x, below.top + 1, scan, depth + 1);
1890
1892
  }
1891
1893
  return { closest: closest, rect: closestRect };
1892
1894
  }
1893
1895
  let side = above && (!below || (y - above.bottom < below.top - y)) ? above : below;
1894
1896
  if (!side)
1895
1897
  return null;
1896
- return rowScan(x, (side.top + side.bottom) / 2, scan);
1898
+ return rowScan(x, (side.top + side.bottom) / 2, scan, depth + 1);
1897
1899
  }
1898
1900
  function ltrAt(state, pos, assoc, textblock) {
1899
1901
  if (textblock === undefined) {
@@ -3425,7 +3427,7 @@ function rangeForClick(wg, pos, type) {
3425
3427
  return GardSelection.near(wg.state, pos.pos, pos.side || -1);
3426
3428
  }
3427
3429
  }
3428
- const Y_STEP = 5;
3430
+ const Y_STEP = 2;
3429
3431
  function moveVertically(wg, start, forward, distance = 0, selectNode = false) {
3430
3432
  let editorRect = wg.contentDOM.getBoundingClientRect();
3431
3433
  let coords = wg.coordsAtPos(start.head, start.headSide);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nerd-bible/wordgard",
3
- "version": "0.5.3-beta1",
3
+ "version": "0.5.3-beta3",
4
4
  "description": "Semantic rich text editor system",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",