@ni/nimble-components 20.11.0 → 20.12.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.
@@ -16298,7 +16298,7 @@
16298
16298
 
16299
16299
  /**
16300
16300
  * Do not edit directly
16301
- * Generated on Wed, 01 Nov 2023 16:12:34 GMT
16301
+ * Generated on Thu, 02 Nov 2023 17:05:25 GMT
16302
16302
  */
16303
16303
 
16304
16304
  const Information100DarkUi = "#a46eff";
@@ -16886,7 +16886,7 @@
16886
16886
  createFontTokens(tokenNames.headlinePlus1Font, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), Headline2Family, Headline2Weight, Headline2Size, Headline2LineHeight, Headline2FallbackFontFamily);
16887
16887
  createFontTokens(tokenNames.titlePlus2Font, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), Title3Family, Title3Weight, Title3Size, Title3LineHeight, Title3FallbackFontFamily);
16888
16888
  const [titlePlus1Font, titlePlus1FontColor, titlePlus1DisabledFontColor, titlePlus1FontFamily, titlePlus1FontWeight, titlePlus1FontSize, titlePlus1FontLineHeight, titlePlus1FallbackFontFamily] = createFontTokens(tokenNames.titlePlus1Font, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), Title2Family, Title2Weight, Title2Size, Title2LineHeight, Title2FallbackFontFamily);
16889
- createFontTokens(tokenNames.titleFont, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), Title1Family, Title1Weight, Title1Size, Title1LineHeight, Title1FallbackFontFamily);
16889
+ const [titleFont, titleFontColor, titleDisabledFontColor, titleFontFamily, titleFontWeight, titleFontSize, titleFontLineHeight, titleFallbackFontFamily] = createFontTokens(tokenNames.titleFont, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), Title1Family, Title1Weight, Title1Size, Title1LineHeight, Title1FallbackFontFamily);
16890
16890
  createFontTokens(tokenNames.subtitlePlus1Font, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), Subtitle2Family, Subtitle2Weight, Subtitle2Size, Subtitle2LineHeight, Subtitle2FallbackFontFamily);
16891
16891
  const [subtitleFont, subtitleFontColor, subtitleDisabledFontColor, subtitleFontFamily, subtitleFontWeight, subtitleFontSize, subtitleFontLineHeight, subtitleFallbackFontFamily] = createFontTokens(tokenNames.subtitleFont, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), Subtitle1Family, Subtitle1Weight, Subtitle1Size, Subtitle1LineHeight, Subtitle1FallbackFontFamily);
16892
16892
  const [linkFont, linkFontColor, linkDisabledFontColor, linkFontFamily, linkFontWeight, linkFontSize, linkFontLineHeight, linkFallbackFontFamily] = createFontTokens(tokenNames.linkFont, (element) => getDefaultFontColorForTheme(element), (element) => hexToRgbaCssColor(getDefaultFontColorForTheme(element), 0.3), LinkLightUiFamily, LinkLightUiWeight, LinkLightUiSize, LinkLineHeight, LinkFallbackFontFamily);
@@ -18899,6 +18899,10 @@
18899
18899
  name: 'arrows_repeat_16_x_16',
18900
18900
  data: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path class="cls-1" d="M8.75 11.75 10 14l-6-3 6-3-1.25 2.25ZM8 11h1a4 4 0 0 0 4-4M7.25 5.75 6 8l6-3-6-3 1.25 2.25ZM8 5H7a4 4 0 0 0-4 4"/></svg>`
18901
18901
  };
18902
+ const at16X16 = {
18903
+ name: 'at_16_x_16',
18904
+ data: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" xml:space="preserve"><path d="M12.139 3.621a5.49 5.49 0 0 1 1.206 1.845c.29.716.436 1.519.436 2.407 0 .641-.091 1.292-.275 1.954-.183.662-.412 1.211-.687 1.646H9.343l-.11-.536a4.554 4.554 0 0 1-.756.415c-.242.104-.593.155-1.051.155-.747 0-1.351-.308-1.813-.924-.462-.616-.694-1.446-.694-2.49 0-.558.078-1.047.234-1.467.156-.418.369-.784.639-1.095.252-.293.556-.522.914-.687a2.518 2.518 0 0 1 1.064-.248c.302 0 .57.056.804.169.234.112.414.23.543.353v-.425h1.594v5.605h1.168c.165-.362.288-.755.368-1.178.079-.424.12-.83.12-1.22 0-.774-.108-1.453-.323-2.036-.215-.585-.512-1.069-.892-1.453a3.695 3.695 0 0 0-1.366-.879 4.861 4.861 0 0 0-1.697-.289c-.581 0-1.133.115-1.657.343a4.548 4.548 0 0 0-1.383.928c-.407.398-.738.898-.992 1.497s-.381 1.257-.381 1.972c0 .778.12 1.468.36 2.068.24.6.559 1.099.958 1.497.397.393.86.694 1.386.9a4.533 4.533 0 0 0 1.668.309c.389 0 .831-.035 1.328-.106a9.3 9.3 0 0 0 1.321-.279v1.333c-.426.096-.85.17-1.271.22-.422.049-.882.075-1.381.075a6.124 6.124 0 0 1-2.325-.433 5.415 5.415 0 0 1-1.852-1.23 5.58 5.58 0 0 1-1.212-1.91 6.666 6.666 0 0 1-.436-2.444c0-.852.151-1.641.453-2.366a5.94 5.94 0 0 1 1.25-1.9A5.66 5.66 0 0 1 5.781 2.46 5.808 5.808 0 0 1 8.079 2c.806 0 1.558.142 2.257.426a5.273 5.273 0 0 1 1.803 1.195zM9.082 9.652V6.19a2.79 2.79 0 0 0-.522-.21 2.1 2.1 0 0 0-.543-.065c-.44 0-.778.192-1.017.577s-.357.912-.357 1.58c0 .723.098 1.259.295 1.607.197.348.522.522.975.522.238 0 .446-.047.625-.141.18-.093.36-.229.544-.408z"/></svg>`
18905
+ };
18902
18906
  const bars16X16 = {
18903
18907
  name: 'bars_16_x_16',
18904
18908
  data: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path class="cls-1" d="M2 13v-2h12v2Zm0-4V7h12v2Zm0-4V3h12v2Z"/></svg>`
@@ -19931,9 +19935,23 @@
19931
19935
  color: ${bodyFontColor};
19932
19936
  background-color: ${sectionBackgroundColor};
19933
19937
  }
19938
+
19939
+ section {
19940
+ display: contents;
19941
+ }
19942
+
19943
+ ::slotted([slot='title']) {
19944
+ font: ${titleFont};
19945
+ color: ${titleFontColor};
19946
+ }
19934
19947
  `;
19935
19948
 
19936
- const template$s = html `<slot></slot>`;
19949
+ const template$s = html `
19950
+ <section aria-labelledby="title-slot">
19951
+ <slot name="title" id="title-slot"></slot>
19952
+ <slot></slot>
19953
+ </section>
19954
+ `;
19937
19955
 
19938
19956
  /**
19939
19957
  * A nimble-styled card
@@ -21796,6 +21814,19 @@
21796
21814
  registerIcon('icon-arrows-repeat', IconArrowsRepeat);
21797
21815
  DesignSystem.tagFor(IconArrowsRepeat);
21798
21816
 
21817
+ // AUTO-GENERATED FILE - DO NOT EDIT DIRECTLY
21818
+ // See generation source in nimble-components/build/generate-icons
21819
+ /**
21820
+ * The icon component for the 'at' icon
21821
+ */
21822
+ class IconAt extends Icon {
21823
+ constructor() {
21824
+ super(at16X16);
21825
+ }
21826
+ }
21827
+ registerIcon('icon-at', IconAt);
21828
+ DesignSystem.tagFor(IconAt);
21829
+
21799
21830
  // AUTO-GENERATED FILE - DO NOT EDIT DIRECTLY
21800
21831
  // See generation source in nimble-components/build/generate-icons
21801
21832
  /**
@@ -44614,6 +44645,39 @@ img.ProseMirror-separator {
44614
44645
  });
44615
44646
  }
44616
44647
 
44648
+ function pasteHandler(options) {
44649
+ return new Plugin({
44650
+ key: new PluginKey('handlePasteLink'),
44651
+ props: {
44652
+ handlePaste: (view, event, slice) => {
44653
+ var _a;
44654
+ const { state } = view;
44655
+ const { selection } = state;
44656
+ const { empty } = selection;
44657
+ if (empty) {
44658
+ return false;
44659
+ }
44660
+ let textContent = '';
44661
+ slice.content.forEach(node => {
44662
+ textContent += node.textContent;
44663
+ });
44664
+ const link = find$1(textContent).find(item => item.isLink && item.value === textContent);
44665
+ if (!textContent || !link) {
44666
+ return false;
44667
+ }
44668
+ const html = (_a = event.clipboardData) === null || _a === void 0 ? void 0 : _a.getData('text/html');
44669
+ const hrefRegex = /href="([^"]*)"/;
44670
+ const existingLink = html === null || html === void 0 ? void 0 : html.match(hrefRegex);
44671
+ const url = existingLink ? existingLink[1] : link.href;
44672
+ options.editor.commands.setMark(options.type, {
44673
+ href: url,
44674
+ });
44675
+ return true;
44676
+ },
44677
+ },
44678
+ });
44679
+ }
44680
+
44617
44681
  const Link = Mark.create({
44618
44682
  name: 'link',
44619
44683
  priority: 1000,
@@ -44707,7 +44771,7 @@ img.ProseMirror-separator {
44707
44771
  type: this.type,
44708
44772
  getAttributes: (match, pasteEvent) => {
44709
44773
  var _a, _b;
44710
- const html = (_a = pasteEvent.clipboardData) === null || _a === void 0 ? void 0 : _a.getData('text/html');
44774
+ const html = (_a = pasteEvent === null || pasteEvent === void 0 ? void 0 : pasteEvent.clipboardData) === null || _a === void 0 ? void 0 : _a.getData('text/html');
44711
44775
  const hrefRegex = /href="([^"]*)"/;
44712
44776
  const existingLink = html === null || html === void 0 ? void 0 : html.match(hrefRegex);
44713
44777
  if (existingLink) {
@@ -44735,6 +44799,12 @@ img.ProseMirror-separator {
44735
44799
  type: this.type,
44736
44800
  }));
44737
44801
  }
44802
+ if (this.options.linkOnPaste) {
44803
+ plugins.push(pasteHandler({
44804
+ editor: this.editor,
44805
+ type: this.type,
44806
+ }));
44807
+ }
44738
44808
  return plugins;
44739
44809
  },
44740
44810
  });