@ni/nimble-components 20.1.20 → 20.1.22

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.
@@ -16288,7 +16288,7 @@
16288
16288
 
16289
16289
  /**
16290
16290
  * Do not edit directly
16291
- * Generated on Thu, 31 Aug 2023 18:57:21 GMT
16291
+ * Generated on Fri, 01 Sep 2023 07:07:38 GMT
16292
16292
  */
16293
16293
 
16294
16294
  const Information100DarkUi = "#a46eff";
@@ -56170,6 +56170,15 @@ img.ProseMirror-separator {
56170
56170
  }
56171
56171
  `;
56172
56172
 
56173
+ /**
56174
+ * TipTap node types.
56175
+ * @public
56176
+ */
56177
+ const TipTapNodeName = {
56178
+ bulletList: 'bulletList',
56179
+ numberedList: 'orderedList'
56180
+ };
56181
+
56173
56182
  /**
56174
56183
  * A nimble styled rich text editor
56175
56184
  */
@@ -56498,10 +56507,14 @@ img.ProseMirror-separator {
56498
56507
  this.tiptapEditor.off('transaction');
56499
56508
  }
56500
56509
  updateEditorButtonsState() {
56510
+ const { extensionManager, state } = this.tiptapEditor;
56511
+ const { extensions } = extensionManager;
56512
+ const { selection } = state;
56513
+ const parentList = findParentNode((node) => isList(node.type.name, extensions))(selection);
56501
56514
  this.boldButton.checked = this.tiptapEditor.isActive('bold');
56502
56515
  this.italicsButton.checked = this.tiptapEditor.isActive('italic');
56503
- this.bulletListButton.checked = this.tiptapEditor.isActive('bulletList');
56504
- this.numberedListButton.checked = this.tiptapEditor.isActive('orderedList');
56516
+ this.bulletListButton.checked = parentList?.node.type.name === TipTapNodeName.bulletList;
56517
+ this.numberedListButton.checked = parentList?.node.type.name === TipTapNodeName.numberedList;
56505
56518
  }
56506
56519
  keyActivatesButton(event) {
56507
56520
  switch (event.key) {
@@ -56561,7 +56574,7 @@ img.ProseMirror-separator {
56561
56574
  - this.tiptapEditor.view.dom.clientWidth;
56562
56575
  }
56563
56576
  getTipTapExtension(extensionName) {
56564
- return this.tiptapEditor.extensionManager.extensions.find(extension => extension.name === extensionName);
56577
+ return this.tiptapEditor.extensionManager.extensions.find((extension) => extension.name === extensionName);
56565
56578
  }
56566
56579
  setEditorTabIndex() {
56567
56580
  this.tiptapEditor.setOptions({
@@ -71637,7 +71650,7 @@ img.ProseMirror-separator {
71637
71650
  return initRange.apply(scale, arguments);
71638
71651
  }
71639
71652
 
71640
- const WaferMapQuadrant = {
71653
+ const WaferMapOriginLocation = {
71641
71654
  bottomLeft: 'bottom-left',
71642
71655
  bottomRight: 'bottom-right',
71643
71656
  topLeft: 'top-left',
@@ -71719,12 +71732,12 @@ img.ProseMirror-separator {
71719
71732
  const containerDiameter = Math.min(this._containerDimensions.width, this._containerDimensions.height);
71720
71733
  const gridDimensions = this.calculateGridDimensions(this.wafermap.dies);
71721
71734
  // this scale is used for positioning the dies on the canvas
71722
- const quadrant = this.wafermap.quadrant;
71723
- this._horizontalScale = this.createHorizontalScale(quadrant, gridDimensions, containerDiameter);
71724
- this._invertedHorizontalScale = this.createInvertedHorizontalScale(quadrant, gridDimensions, containerDiameter);
71735
+ const originLocation = this.wafermap.originLocation;
71736
+ this._horizontalScale = this.createHorizontalScale(originLocation, gridDimensions, containerDiameter);
71737
+ this._invertedHorizontalScale = this.createInvertedHorizontalScale(originLocation, gridDimensions, containerDiameter);
71725
71738
  // this scale is used for positioning the dies on the canvas
71726
- this._verticalScale = this.createVerticalScale(quadrant, gridDimensions, containerDiameter);
71727
- this._invertedVerticalScale = this.createInvertedVerticalScale(quadrant, gridDimensions, containerDiameter);
71739
+ this._verticalScale = this.createVerticalScale(originLocation, gridDimensions, containerDiameter);
71740
+ this._invertedVerticalScale = this.createInvertedVerticalScale(originLocation, gridDimensions, containerDiameter);
71728
71741
  this._dieDimensions = {
71729
71742
  width: this.horizontalScale.bandwidth(),
71730
71743
  height: this.verticalScale.bandwidth()
@@ -71762,47 +71775,47 @@ img.ProseMirror-separator {
71762
71775
  height: canvasDimensions.height - margin.top - margin.bottom
71763
71776
  };
71764
71777
  }
71765
- createHorizontalScale(axisLocation, grid, containerWidth) {
71778
+ createHorizontalScale(originLocation, grid, containerWidth) {
71766
71779
  const scale = band()
71767
71780
  .domain(range(grid.origin.x, grid.origin.x + grid.cols))
71768
71781
  .paddingInner(0)
71769
71782
  .paddingOuter(0)
71770
71783
  .align(0)
71771
71784
  .round(false);
71772
- if (axisLocation === WaferMapQuadrant.bottomLeft
71773
- || axisLocation === WaferMapQuadrant.topLeft) {
71785
+ if (originLocation === WaferMapOriginLocation.bottomLeft
71786
+ || originLocation === WaferMapOriginLocation.topLeft) {
71774
71787
  return scale.range([0, containerWidth]);
71775
71788
  }
71776
71789
  return scale.range([containerWidth, 0]);
71777
71790
  }
71778
- createInvertedHorizontalScale(axisLocation, grid, containerWidth) {
71791
+ createInvertedHorizontalScale(originLocation, grid, containerWidth) {
71779
71792
  const scale = quantile().domain([0, containerWidth]);
71780
- if (axisLocation === WaferMapQuadrant.bottomLeft
71781
- || axisLocation === WaferMapQuadrant.topLeft) {
71793
+ if (originLocation === WaferMapOriginLocation.bottomLeft
71794
+ || originLocation === WaferMapOriginLocation.topLeft) {
71782
71795
  return scale.range(range(grid.origin.x, grid.origin.x + grid.cols));
71783
71796
  }
71784
71797
  return scale.range(range(grid.origin.x, grid.origin.x + grid.cols).reverse());
71785
71798
  }
71786
- createVerticalScale(axisLocation, grid, containerHeight) {
71799
+ createVerticalScale(originLocation, grid, containerHeight) {
71787
71800
  const scale = band()
71788
71801
  .domain(range(grid.origin.y, grid.origin.y + grid.rows))
71789
71802
  .paddingInner(this.defaultPadding)
71790
71803
  .paddingOuter(0)
71791
71804
  .align(0)
71792
71805
  .round(false);
71793
- if (axisLocation === WaferMapQuadrant.bottomLeft
71794
- || axisLocation === WaferMapQuadrant.bottomRight) {
71795
- return scale.range([containerHeight, 0]);
71806
+ if (originLocation === WaferMapOriginLocation.bottomLeft
71807
+ || originLocation === WaferMapOriginLocation.bottomRight) {
71808
+ return scale.range([0, containerHeight]);
71796
71809
  }
71797
- return scale.range([0, containerHeight]);
71810
+ return scale.range([containerHeight, 0]);
71798
71811
  }
71799
- createInvertedVerticalScale(axisLocation, grid, containerHeight) {
71812
+ createInvertedVerticalScale(originLocation, grid, containerHeight) {
71800
71813
  const scale = quantile().domain([0, containerHeight]);
71801
- if (axisLocation === WaferMapQuadrant.bottomLeft
71802
- || axisLocation === WaferMapQuadrant.bottomRight) {
71803
- return scale.range(range(grid.origin.y, grid.origin.y + grid.rows).reverse());
71814
+ if (originLocation === WaferMapOriginLocation.bottomLeft
71815
+ || originLocation === WaferMapOriginLocation.bottomRight) {
71816
+ return scale.range(range(grid.origin.y, grid.origin.y + grid.rows));
71804
71817
  }
71805
- return scale.range(range(grid.origin.y, grid.origin.y + grid.rows));
71818
+ return scale.range(range(grid.origin.y, grid.origin.y + grid.rows).reverse());
71806
71819
  }
71807
71820
  calculateMarginAddition(baseMargin, addedMargin) {
71808
71821
  return {
@@ -72189,13 +72202,13 @@ img.ProseMirror-separator {
72189
72202
  this.wafermap.hoverDie = undefined;
72190
72203
  }
72191
72204
  calculateDieCoordinates(wafermap, mousePosition) {
72192
- const axisLocation = wafermap.quadrant;
72193
- const xRoundFunction = axisLocation === WaferMapQuadrant.bottomLeft
72194
- || axisLocation === WaferMapQuadrant.topLeft
72205
+ const originLocation = wafermap.originLocation;
72206
+ const xRoundFunction = originLocation === WaferMapOriginLocation.bottomLeft
72207
+ || originLocation === WaferMapOriginLocation.topLeft
72195
72208
  ? Math.floor
72196
72209
  : Math.ceil;
72197
- const yRoundFunction = axisLocation === WaferMapQuadrant.topLeft
72198
- || axisLocation === WaferMapQuadrant.topRight
72210
+ const yRoundFunction = originLocation === WaferMapOriginLocation.bottomLeft
72211
+ || originLocation === WaferMapOriginLocation.bottomRight
72199
72212
  ? Math.floor
72200
72213
  : Math.ceil;
72201
72214
  // go to x and y scale to get the x,y values of the die.
@@ -72249,7 +72262,7 @@ img.ProseMirror-separator {
72249
72262
  const trackedItems = [
72250
72263
  'canvasWidth',
72251
72264
  'canvasHeight',
72252
- 'quadrant',
72265
+ 'originLocation',
72253
72266
  'dies',
72254
72267
  'maxCharacters',
72255
72268
  'colorScale',
@@ -72273,7 +72286,7 @@ img.ProseMirror-separator {
72273
72286
  get requiresEventsUpdate() {
72274
72287
  return (this.isTracked('canvasWidth')
72275
72288
  || this.isTracked('canvasHeight')
72276
- || this.isTracked('quadrant')
72289
+ || this.isTracked('originLocation')
72277
72290
  || this.isTracked('dies')
72278
72291
  || this.isTracked('maxCharacters')
72279
72292
  || this.isTracked('colorScale')
@@ -72287,7 +72300,7 @@ img.ProseMirror-separator {
72287
72300
  return this.isTracked('canvasWidth') || this.isTracked('canvasHeight');
72288
72301
  }
72289
72302
  get requiresScalesUpdate() {
72290
- return this.isTracked('quadrant') || this.isTracked('dies');
72303
+ return this.isTracked('originLocation') || this.isTracked('dies');
72291
72304
  }
72292
72305
  get requiresLabelsFontSizeUpdate() {
72293
72306
  return this.isTracked('maxCharacters');
@@ -72335,7 +72348,7 @@ img.ProseMirror-separator {
72335
72348
  * needs to be initialized before the properties trigger changes
72336
72349
  */
72337
72350
  this.waferMapUpdateTracker = new WaferMapUpdateTracker(this);
72338
- this.quadrant = WaferMapQuadrant.topLeft;
72351
+ this.originLocation = WaferMapOriginLocation.bottomLeft;
72339
72352
  this.orientation = WaferMapOrientation.top;
72340
72353
  this.maxCharacters = 4;
72341
72354
  this.dieLabelsHidden = false;
@@ -72446,8 +72459,8 @@ img.ProseMirror-separator {
72446
72459
  });
72447
72460
  return resizeObserver;
72448
72461
  }
72449
- quadrantChanged() {
72450
- this.waferMapUpdateTracker.track('quadrant');
72462
+ originLocationChanged() {
72463
+ this.waferMapUpdateTracker.track('originLocation');
72451
72464
  this.waferMapUpdateTracker.queueUpdate();
72452
72465
  }
72453
72466
  maxCharactersChanged() {
@@ -72497,32 +72510,22 @@ img.ProseMirror-separator {
72497
72510
  }
72498
72511
  }
72499
72512
  __decorate$1([
72500
- attr
72501
- ], WaferMap.prototype, "quadrant", void 0);
72513
+ attr({ attribute: 'origin-location' })
72514
+ ], WaferMap.prototype, "originLocation", void 0);
72502
72515
  __decorate$1([
72503
72516
  attr
72504
72517
  ], WaferMap.prototype, "orientation", void 0);
72505
72518
  __decorate$1([
72506
- attr({
72507
- attribute: 'max-characters',
72508
- converter: nullableNumberConverter
72509
- })
72519
+ attr({ attribute: 'max-characters', converter: nullableNumberConverter })
72510
72520
  ], WaferMap.prototype, "maxCharacters", void 0);
72511
72521
  __decorate$1([
72512
- attr({
72513
- attribute: 'die-labels-hidden',
72514
- mode: 'boolean'
72515
- })
72522
+ attr({ attribute: 'die-labels-hidden', mode: 'boolean' })
72516
72523
  ], WaferMap.prototype, "dieLabelsHidden", void 0);
72517
72524
  __decorate$1([
72518
- attr({
72519
- attribute: 'die-labels-suffix'
72520
- })
72525
+ attr({ attribute: 'die-labels-suffix' })
72521
72526
  ], WaferMap.prototype, "dieLabelsSuffix", void 0);
72522
72527
  __decorate$1([
72523
- attr({
72524
- attribute: 'color-scale-mode'
72525
- })
72528
+ attr({ attribute: 'color-scale-mode' })
72526
72529
  ], WaferMap.prototype, "colorScaleMode", void 0);
72527
72530
  __decorate$1([
72528
72531
  observable