@ni/nimble-components 33.0.3 → 33.1.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.
@@ -17879,6 +17879,10 @@
17879
17879
  name: 'circle_check_16_x_16',
17880
17880
  data: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M8 2a6 6 0 1 0 6 6 6 6 0 0 0-6-6m-1.212 9.2L4 8.388 5.225 7.2l1.553 1.61 4.06-4.01L12 6.013Z" class="cls-1"/></svg>`,
17881
17881
  };
17882
+ const circleMinus16X16 = {
17883
+ name: 'circle_minus_16_x_16',
17884
+ data: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M8 4c2.21 0 4 1.79 4 4s-1.79 4-4 4-4-1.79-4-4 1.79-4 4-4m0-2C4.69 2 2 4.69 2 8s2.69 6 6 6 6-2.69 6-6-2.69-6-6-6m3 7H5V7h6z" class="cls-1"/></svg>`,
17885
+ };
17882
17886
  const circlePartialBroken16X16 = {
17883
17887
  name: 'circle_partial_broken_16_x_16',
17884
17888
  data: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M9 2v2.686a3.475 3.475 0 0 1 0 6.628V14A6.1 6.1 0 0 0 9 2" class="cls-1"/><path d="M7 11.314a3.475 3.475 0 0 1 0-6.628V2a6.1 6.1 0 0 0 0 12Z" class="cls-2"/></svg>`,
@@ -22882,6 +22886,18 @@ so this becomes the fallback color for the slot */ ''}
22882
22886
  }
22883
22887
  registerIcon('icon-circle-filled', IconCircleFilled);
22884
22888
 
22889
+ // AUTO-GENERATED FILE - DO NOT EDIT DIRECTLY
22890
+ // See generation source in nimble-components/build/generate-icons
22891
+ /**
22892
+ * The icon component for the 'circleMinus' icon
22893
+ */
22894
+ class IconCircleMinus extends Icon {
22895
+ constructor() {
22896
+ super(circleMinus16X16);
22897
+ }
22898
+ }
22899
+ registerIcon('icon-circle-minus', IconCircleMinus);
22900
+
22885
22901
  // AUTO-GENERATED FILE - DO NOT EDIT DIRECTLY
22886
22902
  // See generation source in nimble-components/build/generate-icons
22887
22903
  /**
@@ -28179,7 +28195,7 @@ so this becomes the fallback color for the slot */ ''}
28179
28195
  tree shape like this (without back pointers) makes easy.
28180
28196
 
28181
28197
  **Do not** directly mutate the properties of a `Node` object. See
28182
- [the guide](/docs/guide/#doc) for more information.
28198
+ [the guide](https://prosemirror.net/docs/guide/#doc) for more information.
28183
28199
  */
28184
28200
  let Node$2 = class Node {
28185
28201
  /**
@@ -28214,7 +28230,7 @@ so this becomes the fallback color for the slot */ ''}
28214
28230
  get children() { return this.content.content; }
28215
28231
  /**
28216
28232
  The size of this node, as defined by the integer-based [indexing
28217
- scheme](/docs/guide/#doc.indexing). For text nodes, this is the
28233
+ scheme](https://prosemirror.net/docs/guide/#doc.indexing). For text nodes, this is the
28218
28234
  amount of characters. For other leaf nodes, it is one. For
28219
28235
  non-leaf nodes, it is the size of the content plus two (the
28220
28236
  start and end token).
@@ -30671,18 +30687,14 @@ so this becomes the fallback color for the slot */ ''}
30671
30687
  maps](https://prosemirror.net/docs/ref/#transform.StepMap). It has special provisions for losslessly
30672
30688
  handling mapping positions through a series of steps in which some
30673
30689
  steps are inverted versions of earlier steps. (This comes up when
30674
- ‘[rebasing](/docs/guide/#transform.rebasing)’ steps for
30690
+ ‘[rebasing](https://prosemirror.net/docs/guide/#transform.rebasing)’ steps for
30675
30691
  collaboration or history management.)
30676
30692
  */
30677
30693
  class Mapping {
30678
30694
  /**
30679
30695
  Create a new mapping with the given position maps.
30680
30696
  */
30681
- constructor(
30682
- /**
30683
- The step maps in this mapping.
30684
- */
30685
- maps = [],
30697
+ constructor(maps,
30686
30698
  /**
30687
30699
  @internal
30688
30700
  */
@@ -30695,23 +30707,22 @@ so this becomes the fallback color for the slot */ ''}
30695
30707
  /**
30696
30708
  The end position in the `maps` array.
30697
30709
  */
30698
- to = maps.length) {
30699
- this.maps = maps;
30710
+ to = maps ? maps.length : 0) {
30700
30711
  this.mirror = mirror;
30701
30712
  this.from = from;
30702
30713
  this.to = to;
30714
+ this._maps = maps || [];
30715
+ this.ownData = !(maps || mirror);
30703
30716
  }
30704
30717
  /**
30705
- Create a mapping that maps only through a part of this one.
30718
+ The step maps in this mapping.
30706
30719
  */
30707
- slice(from = 0, to = this.maps.length) {
30708
- return new Mapping(this.maps, this.mirror, from, to);
30709
- }
30720
+ get maps() { return this._maps; }
30710
30721
  /**
30711
- @internal
30722
+ Create a mapping that maps only through a part of this one.
30712
30723
  */
30713
- copy() {
30714
- return new Mapping(this.maps.slice(), this.mirror && this.mirror.slice(), this.from, this.to);
30724
+ slice(from = 0, to = this.maps.length) {
30725
+ return new Mapping(this._maps, this.mirror, from, to);
30715
30726
  }
30716
30727
  /**
30717
30728
  Add a step map to the end of this mapping. If `mirrors` is
@@ -30719,18 +30730,23 @@ so this becomes the fallback color for the slot */ ''}
30719
30730
  image of this one.
30720
30731
  */
30721
30732
  appendMap(map, mirrors) {
30722
- this.to = this.maps.push(map);
30733
+ if (!this.ownData) {
30734
+ this._maps = this._maps.slice();
30735
+ this.mirror = this.mirror && this.mirror.slice();
30736
+ this.ownData = true;
30737
+ }
30738
+ this.to = this._maps.push(map);
30723
30739
  if (mirrors != null)
30724
- this.setMirror(this.maps.length - 1, mirrors);
30740
+ this.setMirror(this._maps.length - 1, mirrors);
30725
30741
  }
30726
30742
  /**
30727
30743
  Add all the step maps in a given mapping to this one (preserving
30728
30744
  mirroring information).
30729
30745
  */
30730
30746
  appendMapping(mapping) {
30731
- for (let i = 0, startSize = this.maps.length; i < mapping.maps.length; i++) {
30747
+ for (let i = 0, startSize = this._maps.length; i < mapping._maps.length; i++) {
30732
30748
  let mirr = mapping.getMirror(i);
30733
- this.appendMap(mapping.maps[i], mirr != null && mirr < i ? startSize + mirr : undefined);
30749
+ this.appendMap(mapping._maps[i], mirr != null && mirr < i ? startSize + mirr : undefined);
30734
30750
  }
30735
30751
  }
30736
30752
  /**
@@ -30756,9 +30772,9 @@ so this becomes the fallback color for the slot */ ''}
30756
30772
  Append the inverse of the given mapping to this one.
30757
30773
  */
30758
30774
  appendMappingInverted(mapping) {
30759
- for (let i = mapping.maps.length - 1, totalSize = this.maps.length + mapping.maps.length; i >= 0; i--) {
30775
+ for (let i = mapping.maps.length - 1, totalSize = this._maps.length + mapping._maps.length; i >= 0; i--) {
30760
30776
  let mirr = mapping.getMirror(i);
30761
- this.appendMap(mapping.maps[i].invert(), mirr != null && mirr > i ? totalSize - mirr - 1 : undefined);
30777
+ this.appendMap(mapping._maps[i].invert(), mirr != null && mirr > i ? totalSize - mirr - 1 : undefined);
30762
30778
  }
30763
30779
  }
30764
30780
  /**
@@ -30776,7 +30792,7 @@ so this becomes the fallback color for the slot */ ''}
30776
30792
  if (this.mirror)
30777
30793
  return this._map(pos, assoc, true);
30778
30794
  for (let i = this.from; i < this.to; i++)
30779
- pos = this.maps[i].map(pos, assoc);
30795
+ pos = this._maps[i].map(pos, assoc);
30780
30796
  return pos;
30781
30797
  }
30782
30798
  /**
@@ -30790,12 +30806,12 @@ so this becomes the fallback color for the slot */ ''}
30790
30806
  _map(pos, assoc, simple) {
30791
30807
  let delInfo = 0;
30792
30808
  for (let i = this.from; i < this.to; i++) {
30793
- let map = this.maps[i], result = map.mapResult(pos, assoc);
30809
+ let map = this._maps[i], result = map.mapResult(pos, assoc);
30794
30810
  if (result.recover != null) {
30795
30811
  let corr = this.getMirror(i);
30796
30812
  if (corr != null && corr > i && corr < this.to) {
30797
30813
  i = corr;
30798
- pos = this.maps[corr].recover(result.recover);
30814
+ pos = this._maps[corr].recover(result.recover);
30799
30815
  continue;
30800
30816
  }
30801
30817
  }
@@ -32597,7 +32613,7 @@ so this becomes the fallback color for the slot */ ''}
32597
32613
  greater than one, any number of nodes above that. By default, the
32598
32614
  parts split off will inherit the node type of the original node.
32599
32615
  This can be changed by passing an array of types and attributes to
32600
- use after the split.
32616
+ use after the split (with the outermost nodes coming first).
32601
32617
  */
32602
32618
  split(pos, depth = 1, typesAfter) {
32603
32619
  split(this, pos, depth, typesAfter);
@@ -33830,11 +33846,13 @@ so this becomes the fallback color for the slot */ ''}
33830
33846
  function scrollRectIntoView(view, rect, startDOM) {
33831
33847
  let scrollThreshold = view.someProp("scrollThreshold") || 0, scrollMargin = view.someProp("scrollMargin") || 5;
33832
33848
  let doc = view.dom.ownerDocument;
33833
- for (let parent = startDOM || view.dom;; parent = parentNode(parent)) {
33849
+ for (let parent = startDOM || view.dom;;) {
33834
33850
  if (!parent)
33835
33851
  break;
33836
- if (parent.nodeType != 1)
33852
+ if (parent.nodeType != 1) {
33853
+ parent = parentNode(parent);
33837
33854
  continue;
33855
+ }
33838
33856
  let elt = parent;
33839
33857
  let atTop = elt == doc.body;
33840
33858
  let bounding = atTop ? windowRect(doc) : clientRect(elt);
@@ -33863,8 +33881,10 @@ so this becomes the fallback color for the slot */ ''}
33863
33881
  rect = { left: rect.left - dX, top: rect.top - dY, right: rect.right - dX, bottom: rect.bottom - dY };
33864
33882
  }
33865
33883
  }
33866
- if (atTop || /^(fixed|sticky)$/.test(getComputedStyle(parent).position))
33884
+ let pos = atTop ? "fixed" : getComputedStyle(parent).position;
33885
+ if (/^(fixed|sticky)$/.test(pos))
33867
33886
  break;
33887
+ parent = pos == "absolute" ? parent.offsetParent : parentNode(parent);
33868
33888
  }
33869
33889
  }
33870
33890
  // Store the scroll position of the editor's parent nodes, along with
@@ -39275,6 +39295,17 @@ so this becomes the fallback color for the slot */ ''}
39275
39295
  return doPaste(this, text, null, true, event || new ClipboardEvent("paste"));
39276
39296
  }
39277
39297
  /**
39298
+ Serialize the given slice as it would be if it was copied from
39299
+ this editor. Returns a DOM element that contains a
39300
+ representation of the slice as its children, a textual
39301
+ representation, and the transformed slice (which can be
39302
+ different from the given input due to hooks like
39303
+ [`transformCopied`](https://prosemirror.net/docs/ref/#view.EditorProps.transformCopied)).
39304
+ */
39305
+ serializeForClipboard(slice) {
39306
+ return serializeForClipboard(this, slice);
39307
+ }
39308
+ /**
39278
39309
  Removes the editor from the DOM and destroys all [node
39279
39310
  views](https://prosemirror.net/docs/ref/#view.NodeView).
39280
39311
  */
@@ -39722,7 +39753,7 @@ so this becomes the fallback color for the slot */ ''}
39722
39753
  return false;
39723
39754
  };
39724
39755
  /**
39725
- A more limited form of [`joinBackward`]($commands.joinBackward)
39756
+ A more limited form of [`joinBackward`](https://prosemirror.net/docs/ref/#commands.joinBackward)
39726
39757
  that only tries to join the current textblock to the one before
39727
39758
  it, if the cursor is at the start of a textblock.
39728
39759
  */
@@ -39734,7 +39765,7 @@ so this becomes the fallback color for the slot */ ''}
39734
39765
  return $cut ? joinTextblocksAround(state, $cut, dispatch) : false;
39735
39766
  };
39736
39767
  /**
39737
- A more limited form of [`joinForward`]($commands.joinForward)
39768
+ A more limited form of [`joinForward`](https://prosemirror.net/docs/ref/#commands.joinForward)
39738
39769
  that only tries to join the current textblock to the one after
39739
39770
  it, if the cursor is at the end of a textblock.
39740
39771
  */
@@ -40389,9 +40420,9 @@ so this becomes the fallback color for the slot */ ''}
40389
40420
  if (target == null)
40390
40421
  return false;
40391
40422
  tr.lift(range, target);
40392
- let after = tr.mapping.map(end, -1) - 1;
40393
- if (canJoin(tr.doc, after))
40394
- tr.join(after);
40423
+ let $after = tr.doc.resolve(tr.mapping.map(end, -1) - 1);
40424
+ if (canJoin(tr.doc, $after.pos) && $after.nodeBefore.type == $after.nodeAfter.type)
40425
+ tr.join($after.pos);
40395
40426
  dispatch(tr.scrollIntoView());
40396
40427
  return true;
40397
40428
  }
@@ -44070,13 +44101,14 @@ so this becomes the fallback color for the slot */ ''}
44070
44101
  },
44071
44102
  });
44072
44103
 
44104
+ const focusEventsPluginKey = new PluginKey('focusEvents');
44073
44105
  const FocusEvents = Extension.create({
44074
44106
  name: 'focusEvents',
44075
44107
  addProseMirrorPlugins() {
44076
44108
  const { editor } = this;
44077
44109
  return [
44078
44110
  new Plugin({
44079
- key: new PluginKey('focusEvents'),
44111
+ key: focusEventsPluginKey,
44080
44112
  props: {
44081
44113
  handleDOMEvents: {
44082
44114
  focus: (view, event) => {
@@ -53310,6 +53342,16 @@ img.ProseMirror-separator {
53310
53342
  return output;
53311
53343
  }
53312
53344
 
53345
+ /**
53346
+ * Creates a string based on an array of numeric code points.
53347
+ * @see `punycode.ucs2.decode`
53348
+ * @memberOf punycode.ucs2
53349
+ * @name encode
53350
+ * @param {Array} codePoints The array of numeric code points.
53351
+ * @returns {String} The new Unicode string (UCS-2).
53352
+ */
53353
+ const ucs2encode = codePoints => String.fromCodePoint(...codePoints);
53354
+
53313
53355
  /**
53314
53356
  * Converts a basic code point into a digit/integer.
53315
53357
  * @see `digitToBasic()`
@@ -53595,6 +53637,25 @@ img.ProseMirror-separator {
53595
53637
 
53596
53638
  /** Define the public API */
53597
53639
  const punycode = {
53640
+ /**
53641
+ * A string representing the current Punycode.js version number.
53642
+ * @memberOf punycode
53643
+ * @type String
53644
+ */
53645
+ 'version': '2.3.1',
53646
+ /**
53647
+ * An object of methods to convert from JavaScript's internal character
53648
+ * representation (UCS-2) to Unicode code points, and back.
53649
+ * @see <https://mathiasbynens.be/notes/javascript-encoding>
53650
+ * @memberOf punycode
53651
+ * @type Object
53652
+ */
53653
+ 'ucs2': {
53654
+ 'decode': ucs2decode,
53655
+ 'encode': ucs2encode
53656
+ },
53657
+ 'decode': decode,
53658
+ 'encode': encode,
53598
53659
  'toASCII': toASCII,
53599
53660
  'toUnicode': toUnicode
53600
53661
  };
@@ -54491,6 +54552,7 @@ img.ProseMirror-separator {
54491
54552
  toDOM(node) { return ["a", node.attrs]; }
54492
54553
  },
54493
54554
  code: {
54555
+ code: true,
54494
54556
  parseDOM: [{ tag: "code" }],
54495
54557
  toDOM() { return ["code"]; }
54496
54558
  }
@@ -59428,7 +59490,7 @@ img.ProseMirror-separator {
59428
59490
  },
59429
59491
  },
59430
59492
  type: {
59431
- default: undefined,
59493
+ default: null,
59432
59494
  parseHTML: element => element.getAttribute('type'),
59433
59495
  },
59434
59496
  };
@@ -67775,7 +67837,7 @@ focus outline in that case.
67775
67837
  function memo(getDeps, fn, opts) {
67776
67838
  let deps = opts.initialDeps ?? [];
67777
67839
  let result;
67778
- return () => {
67840
+ function memoizedFunction() {
67779
67841
  var _a, _b, _c, _d;
67780
67842
  let depTime;
67781
67843
  if (opts.key && ((_a = opts.debug) == null ? void 0 : _a.call(opts))) depTime = Date.now();
@@ -67813,7 +67875,11 @@ focus outline in that case.
67813
67875
  }
67814
67876
  (_d = opts == null ? void 0 : opts.onChange) == null ? void 0 : _d.call(opts, result);
67815
67877
  return result;
67878
+ }
67879
+ memoizedFunction.updateDeps = (newDeps) => {
67880
+ deps = newDeps;
67816
67881
  };
67882
+ return memoizedFunction;
67817
67883
  }
67818
67884
  function notUndefined(value, msg) {
67819
67885
  if (value === void 0) {
@@ -68022,7 +68088,7 @@ focus outline in that case.
68022
68088
  isScrollingResetDelay: 150,
68023
68089
  enabled: true,
68024
68090
  isRtl: false,
68025
- useScrollendEvent: true,
68091
+ useScrollendEvent: false,
68026
68092
  useAnimationFrameWithResizeObserver: false,
68027
68093
  ...opts2
68028
68094
  };
@@ -68240,6 +68306,7 @@ focus outline in that case.
68240
68306
  startIndex = range.startIndex;
68241
68307
  endIndex = range.endIndex;
68242
68308
  }
68309
+ this.maybeNotify.updateDeps([this.isScrolling, startIndex, endIndex]);
68243
68310
  return [
68244
68311
  this.options.rangeExtractor,
68245
68312
  this.options.overscan,
@@ -68462,10 +68529,19 @@ focus outline in that case.
68462
68529
  let end;
68463
68530
  if (measurements.length === 0) {
68464
68531
  end = this.options.paddingStart;
68532
+ } else if (this.options.lanes === 1) {
68533
+ end = ((_a = measurements[measurements.length - 1]) == null ? void 0 : _a.end) ?? 0;
68465
68534
  } else {
68466
- end = this.options.lanes === 1 ? ((_a = measurements[measurements.length - 1]) == null ? void 0 : _a.end) ?? 0 : Math.max(
68467
- ...measurements.slice(-this.options.lanes).map((m) => m.end)
68468
- );
68535
+ const endByLane = Array(this.options.lanes).fill(null);
68536
+ let endIndex = measurements.length - 1;
68537
+ while (endIndex >= 0 && endByLane.some((val) => val === null)) {
68538
+ const item = measurements[endIndex];
68539
+ if (endByLane[item.lane] === null) {
68540
+ endByLane[item.lane] = item.end;
68541
+ }
68542
+ endIndex--;
68543
+ }
68544
+ end = Math.max(...endByLane.filter((val) => val !== null));
68469
68545
  }
68470
68546
  return Math.max(
68471
68547
  end - this.options.scrollMargin + this.options.paddingEnd,
@@ -68511,6 +68587,12 @@ focus outline in that case.
68511
68587
  }) {
68512
68588
  const lastIndex = measurements.length - 1;
68513
68589
  const getOffset = (index) => measurements[index].start;
68590
+ if (measurements.length <= lanes) {
68591
+ return {
68592
+ startIndex: 0,
68593
+ endIndex: lastIndex
68594
+ };
68595
+ }
68514
68596
  let startIndex = findNearestBinarySearch(
68515
68597
  0,
68516
68598
  lastIndex,
@@ -68518,10 +68600,23 @@ focus outline in that case.
68518
68600
  scrollOffset
68519
68601
  );
68520
68602
  let endIndex = startIndex;
68521
- while (endIndex < lastIndex && measurements[endIndex].end < scrollOffset + outerSize) {
68522
- endIndex++;
68523
- }
68524
- if (lanes > 1) {
68603
+ if (lanes === 1) {
68604
+ while (endIndex < lastIndex && measurements[endIndex].end < scrollOffset + outerSize) {
68605
+ endIndex++;
68606
+ }
68607
+ } else if (lanes > 1) {
68608
+ const endPerLane = Array(lanes).fill(0);
68609
+ while (endIndex < lastIndex && endPerLane.some((pos) => pos < scrollOffset + outerSize)) {
68610
+ const item = measurements[endIndex];
68611
+ endPerLane[item.lane] = item.end;
68612
+ endIndex++;
68613
+ }
68614
+ const startPerLane = Array(lanes).fill(scrollOffset + outerSize);
68615
+ while (startIndex >= 0 && startPerLane.some((pos) => pos >= scrollOffset)) {
68616
+ const item = measurements[startIndex];
68617
+ startPerLane[item.lane] = item.start;
68618
+ startIndex--;
68619
+ }
68525
68620
  startIndex = Math.max(0, startIndex - startIndex % lanes);
68526
68621
  endIndex = Math.min(lastIndex, endIndex + (lanes - 1 - endIndex % lanes));
68527
68622
  }
@@ -68545,7 +68640,6 @@ focus outline in that case.
68545
68640
  this.headerContainerMarginRight = 0;
68546
68641
  this.rowContainerYOffset = 0;
68547
68642
  this._pageSize = 0;
68548
- this.isScrollingTimer = 0;
68549
68643
  this.table = table;
68550
68644
  this.tanStackTable = tanStackTable;
68551
68645
  this.viewportResizeObserver = new ResizeObserver(entries => {
@@ -68608,6 +68702,7 @@ focus outline in that case.
68608
68702
  enableSmoothScroll: true,
68609
68703
  overscan: 3,
68610
68704
  isScrollingResetDelay: 250,
68705
+ useScrollendEvent: false,
68611
68706
  scrollToFn: elementScroll,
68612
68707
  observeElementOffset,
68613
68708
  observeElementRect,
@@ -68619,15 +68714,6 @@ focus outline in that case.
68619
68714
  this.visibleItems = virtualizer.getVirtualItems();
68620
68715
  this.scrollHeight = virtualizer.getTotalSize();
68621
68716
  this.isScrolling = virtualizer.isScrolling;
68622
- // There are multiple browser bugs that can result in us getting stuck thinking that we're scrolling.
68623
- // As a workaround, we assume scrolling stopped if we haven't received an update in 300ms.
68624
- // Tech debt item to remove this workaround: https://github.com/ni/nimble/issues/2382
68625
- window.clearTimeout(this.isScrollingTimer);
68626
- if (this.isScrolling) {
68627
- this.isScrollingTimer = window.setTimeout(() => {
68628
- this.isScrolling = false;
68629
- }, 300);
68630
- }
68631
68717
  // We're using a separate div ('table-scroll') to represent the full height of all rows, and
68632
68718
  // the row container's height is only big enough to hold the virtualized rows. So we don't
68633
68719
  // use the TanStackVirtual-provided 'start' offset (which is in terms of the full height)