@ni/nimble-components 35.9.3 → 35.10.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.
@@ -18678,30 +18678,6 @@
18678
18678
  }
18679
18679
  ]
18680
18680
  },
18681
- {
18682
- "kind": "javascript-module",
18683
- "path": "src/table/components/cell/index.ts",
18684
- "declarations": [
18685
- {
18686
- "kind": "variable",
18687
- "name": "tableCellTag",
18688
- "type": {
18689
- "text": "string"
18690
- },
18691
- "default": "'nimble-table-cell'"
18692
- }
18693
- ],
18694
- "exports": [
18695
- {
18696
- "kind": "js",
18697
- "name": "tableCellTag",
18698
- "declaration": {
18699
- "name": "tableCellTag",
18700
- "module": "src/table/components/cell/index.ts"
18701
- }
18702
- }
18703
- ]
18704
- },
18705
18681
  {
18706
18682
  "kind": "javascript-module",
18707
18683
  "path": "src/rich-text-mention/users/view/index.ts",
@@ -18797,6 +18773,30 @@
18797
18773
  }
18798
18774
  ]
18799
18775
  },
18776
+ {
18777
+ "kind": "javascript-module",
18778
+ "path": "src/table/components/cell/index.ts",
18779
+ "declarations": [
18780
+ {
18781
+ "kind": "variable",
18782
+ "name": "tableCellTag",
18783
+ "type": {
18784
+ "text": "string"
18785
+ },
18786
+ "default": "'nimble-table-cell'"
18787
+ }
18788
+ ],
18789
+ "exports": [
18790
+ {
18791
+ "kind": "js",
18792
+ "name": "tableCellTag",
18793
+ "declaration": {
18794
+ "name": "tableCellTag",
18795
+ "module": "src/table/components/cell/index.ts"
18796
+ }
18797
+ }
18798
+ ]
18799
+ },
18800
18800
  {
18801
18801
  "kind": "javascript-module",
18802
18802
  "path": "src/table/components/group-row/index.ts",
@@ -20330,109 +20330,25 @@
20330
20330
  },
20331
20331
  {
20332
20332
  "kind": "javascript-module",
20333
- "path": "src/table-column/number-text/cell-view/index.ts",
20333
+ "path": "src/table-column/menu-button/cell-view/index.ts",
20334
20334
  "declarations": [
20335
20335
  {
20336
20336
  "kind": "class",
20337
- "description": "A cell view for displaying number fields as text",
20338
- "name": "TableColumnNumberTextCellView",
20337
+ "description": "The cell view base class for displaying a string field as a menu button.",
20338
+ "name": "TableColumnMenuButtonCellView",
20339
20339
  "members": [
20340
- {
20341
- "kind": "method",
20342
- "name": "columnConfigChanged",
20343
- "privacy": "protected",
20344
- "return": {
20345
- "type": {
20346
- "text": "void"
20347
- }
20348
- },
20349
- "inheritedFrom": {
20350
- "name": "TableColumnTextCellViewBase",
20351
- "module": "src/table-column/text-base/cell-view/index.ts"
20352
- }
20353
- },
20354
- {
20355
- "kind": "method",
20356
- "name": "updateText",
20357
- "privacy": "protected",
20358
- "return": {
20359
- "type": {
20360
- "text": "void"
20361
- }
20362
- },
20363
- "inheritedFrom": {
20364
- "name": "TableColumnTextCellViewBase",
20365
- "module": "src/table-column/text-base/cell-view/index.ts"
20366
- }
20367
- },
20368
- {
20369
- "kind": "field",
20370
- "name": "text",
20371
- "type": {
20372
- "text": "string"
20373
- },
20374
- "privacy": "public",
20375
- "default": "''",
20376
- "description": "Text to render in the cell.",
20377
- "inheritedFrom": {
20378
- "name": "TableColumnTextCellViewBase",
20379
- "module": "src/table-column/text-base/cell-view/index.ts"
20380
- }
20381
- },
20382
- {
20383
- "kind": "field",
20384
- "name": "alignment",
20385
- "type": {
20386
- "text": "TableColumnAlignment"
20387
- },
20388
- "privacy": "public",
20389
- "description": "The alignment of the text within the cell.",
20390
- "inheritedFrom": {
20391
- "name": "TableColumnTextCellViewBase",
20392
- "module": "src/table-column/text-base/cell-view/index.ts"
20393
- }
20394
- },
20395
20340
  {
20396
20341
  "kind": "field",
20397
- "name": "isPlaceholder",
20342
+ "name": "tabbableChildren",
20398
20343
  "type": {
20399
- "text": "boolean"
20344
+ "text": "HTMLElement[]"
20400
20345
  },
20401
20346
  "privacy": "public",
20402
- "default": "false",
20403
- "description": "Whether or not the text being displayed in the cell view is a placeholder.",
20404
- "inheritedFrom": {
20405
- "name": "TableColumnTextCellViewBase",
20406
- "module": "src/table-column/text-base/cell-view/index.ts"
20407
- }
20408
- },
20409
- {
20410
- "kind": "method",
20411
- "name": "cellRecordChanged",
20412
- "privacy": "private",
20413
- "return": {
20414
- "type": {
20415
- "text": "void"
20416
- }
20417
- },
20418
- "inheritedFrom": {
20419
- "name": "TableColumnTextCellViewBase",
20420
- "module": "src/table-column/text-base/cell-view/index.ts"
20421
- }
20422
- },
20423
- {
20424
- "kind": "method",
20425
- "name": "applyPlaceholderTextIfNeeded",
20426
- "privacy": "private",
20427
- "return": {
20428
- "type": {
20429
- "text": ""
20430
- }
20431
- },
20432
- "description": "Sets `this.text` to the appropriate placeholder if `cellValue` warrants it.",
20347
+ "description": "Gets the child elements in this cell view that should be able to be reached via Tab/ Shift-Tab,\nif any.",
20348
+ "readonly": true,
20433
20349
  "inheritedFrom": {
20434
- "name": "TableColumnTextCellViewBase",
20435
- "module": "src/table-column/text-base/cell-view/index.ts"
20350
+ "name": "TableCellView",
20351
+ "module": "src/table-column/base/cell-view/index.ts"
20436
20352
  }
20437
20353
  },
20438
20354
  {
@@ -20483,20 +20399,6 @@
20483
20399
  "module": "src/table-column/base/cell-view/index.ts"
20484
20400
  }
20485
20401
  },
20486
- {
20487
- "kind": "field",
20488
- "name": "tabbableChildren",
20489
- "type": {
20490
- "text": "HTMLElement[]"
20491
- },
20492
- "privacy": "public",
20493
- "description": "Gets the child elements in this cell view that should be able to be reached via Tab/ Shift-Tab,\nif any.",
20494
- "readonly": true,
20495
- "inheritedFrom": {
20496
- "name": "TableCellView",
20497
- "module": "src/table-column/base/cell-view/index.ts"
20498
- }
20499
- },
20500
20402
  {
20501
20403
  "kind": "field",
20502
20404
  "name": "delegatedEvents",
@@ -20538,59 +20440,143 @@
20538
20440
  }
20539
20441
  ],
20540
20442
  "superclass": {
20541
- "name": "TableColumnTextCellViewBase",
20542
- "module": "/src/table-column/text-base/cell-view"
20443
+ "name": "TableCellView",
20444
+ "module": "/src/table-column/base/cell-view"
20543
20445
  }
20544
20446
  },
20545
20447
  {
20546
20448
  "kind": "variable",
20547
- "name": "tableColumnNumberTextCellViewTag",
20449
+ "name": "tableColumnMenuButtonCellViewTag",
20548
20450
  "type": {
20549
20451
  "text": "string"
20550
20452
  },
20551
- "default": "'nimble-table-column-number-text-cell-view'"
20453
+ "default": "'nimble-table-column-menu-button-cell-view'"
20552
20454
  }
20553
20455
  ],
20554
20456
  "exports": [
20555
20457
  {
20556
20458
  "kind": "js",
20557
- "name": "TableColumnNumberTextCellView",
20459
+ "name": "TableColumnMenuButtonCellView",
20558
20460
  "declaration": {
20559
- "name": "TableColumnNumberTextCellView",
20560
- "module": "src/table-column/number-text/cell-view/index.ts"
20461
+ "name": "TableColumnMenuButtonCellView",
20462
+ "module": "src/table-column/menu-button/cell-view/index.ts"
20561
20463
  }
20562
20464
  },
20563
20465
  {
20564
20466
  "kind": "js",
20565
- "name": "tableColumnNumberTextCellViewTag",
20467
+ "name": "tableColumnMenuButtonCellViewTag",
20566
20468
  "declaration": {
20567
- "name": "tableColumnNumberTextCellViewTag",
20568
- "module": "src/table-column/number-text/cell-view/index.ts"
20469
+ "name": "tableColumnMenuButtonCellViewTag",
20470
+ "module": "src/table-column/menu-button/cell-view/index.ts"
20569
20471
  }
20570
20472
  }
20571
20473
  ]
20572
20474
  },
20573
20475
  {
20574
20476
  "kind": "javascript-module",
20575
- "path": "src/table-column/menu-button/cell-view/index.ts",
20477
+ "path": "src/table-column/number-text/cell-view/index.ts",
20576
20478
  "declarations": [
20577
20479
  {
20578
20480
  "kind": "class",
20579
- "description": "The cell view base class for displaying a string field as a menu button.",
20580
- "name": "TableColumnMenuButtonCellView",
20481
+ "description": "A cell view for displaying number fields as text",
20482
+ "name": "TableColumnNumberTextCellView",
20581
20483
  "members": [
20484
+ {
20485
+ "kind": "method",
20486
+ "name": "columnConfigChanged",
20487
+ "privacy": "protected",
20488
+ "return": {
20489
+ "type": {
20490
+ "text": "void"
20491
+ }
20492
+ },
20493
+ "inheritedFrom": {
20494
+ "name": "TableColumnTextCellViewBase",
20495
+ "module": "src/table-column/text-base/cell-view/index.ts"
20496
+ }
20497
+ },
20498
+ {
20499
+ "kind": "method",
20500
+ "name": "updateText",
20501
+ "privacy": "protected",
20502
+ "return": {
20503
+ "type": {
20504
+ "text": "void"
20505
+ }
20506
+ },
20507
+ "inheritedFrom": {
20508
+ "name": "TableColumnTextCellViewBase",
20509
+ "module": "src/table-column/text-base/cell-view/index.ts"
20510
+ }
20511
+ },
20582
20512
  {
20583
20513
  "kind": "field",
20584
- "name": "tabbableChildren",
20514
+ "name": "text",
20585
20515
  "type": {
20586
- "text": "HTMLElement[]"
20516
+ "text": "string"
20587
20517
  },
20588
20518
  "privacy": "public",
20589
- "description": "Gets the child elements in this cell view that should be able to be reached via Tab/ Shift-Tab,\nif any.",
20590
- "readonly": true,
20519
+ "default": "''",
20520
+ "description": "Text to render in the cell.",
20591
20521
  "inheritedFrom": {
20592
- "name": "TableCellView",
20593
- "module": "src/table-column/base/cell-view/index.ts"
20522
+ "name": "TableColumnTextCellViewBase",
20523
+ "module": "src/table-column/text-base/cell-view/index.ts"
20524
+ }
20525
+ },
20526
+ {
20527
+ "kind": "field",
20528
+ "name": "alignment",
20529
+ "type": {
20530
+ "text": "TableColumnAlignment"
20531
+ },
20532
+ "privacy": "public",
20533
+ "description": "The alignment of the text within the cell.",
20534
+ "inheritedFrom": {
20535
+ "name": "TableColumnTextCellViewBase",
20536
+ "module": "src/table-column/text-base/cell-view/index.ts"
20537
+ }
20538
+ },
20539
+ {
20540
+ "kind": "field",
20541
+ "name": "isPlaceholder",
20542
+ "type": {
20543
+ "text": "boolean"
20544
+ },
20545
+ "privacy": "public",
20546
+ "default": "false",
20547
+ "description": "Whether or not the text being displayed in the cell view is a placeholder.",
20548
+ "inheritedFrom": {
20549
+ "name": "TableColumnTextCellViewBase",
20550
+ "module": "src/table-column/text-base/cell-view/index.ts"
20551
+ }
20552
+ },
20553
+ {
20554
+ "kind": "method",
20555
+ "name": "cellRecordChanged",
20556
+ "privacy": "private",
20557
+ "return": {
20558
+ "type": {
20559
+ "text": "void"
20560
+ }
20561
+ },
20562
+ "inheritedFrom": {
20563
+ "name": "TableColumnTextCellViewBase",
20564
+ "module": "src/table-column/text-base/cell-view/index.ts"
20565
+ }
20566
+ },
20567
+ {
20568
+ "kind": "method",
20569
+ "name": "applyPlaceholderTextIfNeeded",
20570
+ "privacy": "private",
20571
+ "return": {
20572
+ "type": {
20573
+ "text": ""
20574
+ }
20575
+ },
20576
+ "description": "Sets `this.text` to the appropriate placeholder if `cellValue` warrants it.",
20577
+ "inheritedFrom": {
20578
+ "name": "TableColumnTextCellViewBase",
20579
+ "module": "src/table-column/text-base/cell-view/index.ts"
20594
20580
  }
20595
20581
  },
20596
20582
  {
@@ -20641,6 +20627,20 @@
20641
20627
  "module": "src/table-column/base/cell-view/index.ts"
20642
20628
  }
20643
20629
  },
20630
+ {
20631
+ "kind": "field",
20632
+ "name": "tabbableChildren",
20633
+ "type": {
20634
+ "text": "HTMLElement[]"
20635
+ },
20636
+ "privacy": "public",
20637
+ "description": "Gets the child elements in this cell view that should be able to be reached via Tab/ Shift-Tab,\nif any.",
20638
+ "readonly": true,
20639
+ "inheritedFrom": {
20640
+ "name": "TableCellView",
20641
+ "module": "src/table-column/base/cell-view/index.ts"
20642
+ }
20643
+ },
20644
20644
  {
20645
20645
  "kind": "field",
20646
20646
  "name": "delegatedEvents",
@@ -20682,34 +20682,34 @@
20682
20682
  }
20683
20683
  ],
20684
20684
  "superclass": {
20685
- "name": "TableCellView",
20686
- "module": "/src/table-column/base/cell-view"
20685
+ "name": "TableColumnTextCellViewBase",
20686
+ "module": "/src/table-column/text-base/cell-view"
20687
20687
  }
20688
20688
  },
20689
20689
  {
20690
20690
  "kind": "variable",
20691
- "name": "tableColumnMenuButtonCellViewTag",
20691
+ "name": "tableColumnNumberTextCellViewTag",
20692
20692
  "type": {
20693
20693
  "text": "string"
20694
20694
  },
20695
- "default": "'nimble-table-column-menu-button-cell-view'"
20695
+ "default": "'nimble-table-column-number-text-cell-view'"
20696
20696
  }
20697
20697
  ],
20698
20698
  "exports": [
20699
20699
  {
20700
20700
  "kind": "js",
20701
- "name": "TableColumnMenuButtonCellView",
20701
+ "name": "TableColumnNumberTextCellView",
20702
20702
  "declaration": {
20703
- "name": "TableColumnMenuButtonCellView",
20704
- "module": "src/table-column/menu-button/cell-view/index.ts"
20703
+ "name": "TableColumnNumberTextCellView",
20704
+ "module": "src/table-column/number-text/cell-view/index.ts"
20705
20705
  }
20706
20706
  },
20707
20707
  {
20708
20708
  "kind": "js",
20709
- "name": "tableColumnMenuButtonCellViewTag",
20709
+ "name": "tableColumnNumberTextCellViewTag",
20710
20710
  "declaration": {
20711
- "name": "tableColumnMenuButtonCellViewTag",
20712
- "module": "src/table-column/menu-button/cell-view/index.ts"
20711
+ "name": "tableColumnNumberTextCellViewTag",
20712
+ "module": "src/table-column/number-text/cell-view/index.ts"
20713
20713
  }
20714
20714
  }
20715
20715
  ]
@@ -2774,6 +2774,32 @@
2774
2774
 
2775
2775
  <hr/>
2776
2776
 
2777
+ ## class: `TableColumnMenuButtonCellView`
2778
+
2779
+ ### Superclass
2780
+
2781
+ | Name | Module | Package |
2782
+ | --------------- | -------------------------------- | ------- |
2783
+ | `TableCellView` | /src/table-column/base/cell-view | |
2784
+
2785
+ ### Fields
2786
+
2787
+ | Name | Privacy | Type | Default | Description | Inherited From |
2788
+ | ------------------ | ------- | ----------------------------------------- | ------- | ----------------------------------------------------------------------------------------------------------- | -------------- |
2789
+ | `tabbableChildren` | public | `HTMLElement[]` | | Gets the child elements in this cell view that should be able to be reached via Tab/ Shift-Tab,&#xA;if any. | TableCellView |
2790
+ | `cellRecord` | public | `TCellRecord \| undefined` | | | TableCellView |
2791
+ | `columnConfig` | public | `TColumnConfig \| undefined` | | | TableCellView |
2792
+ | `column` | public | `TableColumn<TColumnConfig> \| undefined` | | | TableCellView |
2793
+ | `recordId` | public | `string \| undefined` | | | TableCellView |
2794
+
2795
+ ### Methods
2796
+
2797
+ | Name | Privacy | Description | Parameters | Return | Inherited From |
2798
+ | --------------- | ------- | ----------- | ---------- | ------ | -------------- |
2799
+ | `columnChanged` | public | | | `void` | TableCellView |
2800
+
2801
+ <hr/>
2802
+
2777
2803
  ## class: `TableColumnNumberTextCellView`
2778
2804
 
2779
2805
  ### Superclass
@@ -2805,32 +2831,6 @@
2805
2831
 
2806
2832
  <hr/>
2807
2833
 
2808
- ## class: `TableColumnMenuButtonCellView`
2809
-
2810
- ### Superclass
2811
-
2812
- | Name | Module | Package |
2813
- | --------------- | -------------------------------- | ------- |
2814
- | `TableCellView` | /src/table-column/base/cell-view | |
2815
-
2816
- ### Fields
2817
-
2818
- | Name | Privacy | Type | Default | Description | Inherited From |
2819
- | ------------------ | ------- | ----------------------------------------- | ------- | ----------------------------------------------------------------------------------------------------------- | -------------- |
2820
- | `tabbableChildren` | public | `HTMLElement[]` | | Gets the child elements in this cell view that should be able to be reached via Tab/ Shift-Tab,&#xA;if any. | TableCellView |
2821
- | `cellRecord` | public | `TCellRecord \| undefined` | | | TableCellView |
2822
- | `columnConfig` | public | `TColumnConfig \| undefined` | | | TableCellView |
2823
- | `column` | public | `TableColumn<TColumnConfig> \| undefined` | | | TableCellView |
2824
- | `recordId` | public | `string \| undefined` | | | TableCellView |
2825
-
2826
- ### Methods
2827
-
2828
- | Name | Privacy | Description | Parameters | Return | Inherited From |
2829
- | --------------- | ------- | ----------- | ---------- | ------ | -------------- |
2830
- | `columnChanged` | public | | | `void` | TableCellView |
2831
-
2832
- <hr/>
2833
-
2834
2834
  ## class: `TableColumnNumberTextGroupHeaderView`
2835
2835
 
2836
2836
  ### Superclass
@@ -114,7 +114,7 @@ function createCustomLinkExtension() {
114
114
  rel: 'noopener noreferrer',
115
115
  target: null,
116
116
  // Adding `class` here is a workaround to render two mentions without a whitespace as display names
117
- // This attribute can be removed when the below issue is resolved
117
+ // For more details on this behavior, refer to the issue below:
118
118
  // https://github.com/ni/nimble/issues/1707
119
119
  class: ''
120
120
  },
@@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AAC,IAAI,CAAC,KAAK,CAAC,KAAe,CAAC,CACvD,CAAC;QACN,CAAC;aAAM,CAAC;YACJ,MAAM,cAAc,GAAG,yBAAyB,CAC5C,YAAY,EACZ,IAAI,CAAC,OAAO,CACf,CAAC;YACF,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC;QACjD,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;AAC5C,CAAC","sourcesContent":["import { Editor, Mark, Node, mergeAttributes } from '@tiptap/core';\nimport Bold from '@tiptap/extension-bold';\nimport Document from '@tiptap/extension-document';\nimport HardBreak from '@tiptap/extension-hard-break';\nimport Italic from '@tiptap/extension-italic';\nimport Link from '@tiptap/extension-link';\nimport { BulletList, ListItem, OrderedList } from '@tiptap/extension-list';\nimport Mention from '@tiptap/extension-mention';\nimport Paragraph from '@tiptap/extension-paragraph';\nimport Text from '@tiptap/extension-text';\nimport { Placeholder, UndoRedo } from '@tiptap/extensions';\nimport { Slice, Fragment, Node as FragmentNode } from 'prosemirror-model';\nimport { PluginKey } from 'prosemirror-state';\n\nimport { keyEscape } from '@ni/fast-web-utilities';\nimport {\n type ActiveMentionCommandEmitter,\n type ActiveMentionCharacterEmitter,\n mentionPluginPrefix\n} from '../types';\n\nimport { anchorTag } from '../../../anchor';\nimport type { MentionExtensionConfiguration } from '../../models/mention-extension-configuration';\nimport type { RichTextMentionListbox } from '../../mention-listbox';\n\nconst validAbsoluteLinkRegex = /^https?:\\/\\//i;\n\nexport function createTiptapEditor(\n activeMentionCharacterEmitter: ActiveMentionCharacterEmitter,\n activeMentionCommandEmitter: ActiveMentionCommandEmitter,\n editor: HTMLDivElement,\n mentionExtensionConfig: MentionExtensionConfiguration[],\n mentionListbox?: RichTextMentionListbox,\n placeholder?: string\n): Editor {\n const customLink = createCustomLinkExtension();\n const mentionExtensions = mentionExtensionConfig.map(config => createCustomMentionExtension(\n config,\n activeMentionCharacterEmitter,\n activeMentionCommandEmitter,\n mentionListbox\n ));\n\n /**\n * For more information on the extensions for the supported formatting options, refer to the links below.\n * Tiptap marks: https://tiptap.dev/api/marks\n * Tiptap nodes: https://tiptap.dev/api/nodes\n */\n const tipTapEditor = new Editor({\n element: editor,\n // The editor will detect markdown syntax for an input only for these items\n // https://tiptap.dev/api/editor#enable-input-rules\n enableInputRules: [BulletList, OrderedList],\n // The editor will not detect markdown syntax when pasting content in any supported items\n // Lists do not have any default paste rules, they have only input rules, so disabled paste rules\n // https://tiptap.dev/api/editor#enable-paste-rules\n enablePasteRules: false,\n editorProps: {\n // Validating whether the links in the pasted content belongs to the supported scheme (HTTPS/HTTP),\n // and rendering it as a link in the editor. If not, rendering it as a plain text.\n // Also, updating the link text content with its href as we support only the absolute link.\n\n // `transformPasted` can be updated/removed when hyperlink support added\n // See: https://github.com/ni/nimble/issues/1527\n transformPasted\n },\n extensions: [\n Document,\n Paragraph,\n Text,\n BulletList,\n OrderedList,\n ListItem,\n Bold,\n Italic,\n UndoRedo,\n Placeholder.configure({\n placeholder,\n showOnlyWhenEditable: false\n }),\n HardBreak,\n customLink,\n ...mentionExtensions\n ]\n });\n\n /**\n * @param slice contains the Fragment of the copied content. If the content is a link, the slice contains Text node with Link mark.\n * ProseMirror reference for `transformPasted`: https://prosemirror.net/docs/ref/#view.EditorProps.transformPasted\n */\n function transformPasted(slice: Slice): Slice {\n const modifiedFragment = updateLinkAndMentionNodes(\n tipTapEditor,\n slice.content\n );\n return new Slice(modifiedFragment, slice.openStart, slice.openEnd);\n }\n\n return tipTapEditor;\n}\n\n/**\n * Extending the default link mark schema defined in the TipTap.\n *\n * \"excludes\": https://prosemirror.net/docs/ref/#model.MarkSpec.excludes\n * \"inclusive\": https://prosemirror.net/docs/ref/#model.MarkSpec.inclusive\n * \"parseHTML\": https://tiptap.dev/guide/custom-extensions#parse-html\n * \"renderHTML\": https://tiptap.dev/guide/custom-extensions/#render-html\n */\nfunction createCustomLinkExtension(): Mark {\n return Link.extend({\n // Excludes can be removed/enabled when hyperlink support added\n // See: https://github.com/ni/nimble/issues/1527\n excludes: '_',\n // Inclusive can be updated when hyperlink support added\n // See: https://github.com/ni/nimble/issues/1527\n inclusive: false,\n parseHTML() {\n return [\n // To load the `nimble-anchor` from the HTML parsed content by markdown-parser as links in the Tiptap editor, the `parseHTML`\n // of Link extension should return nimble `anchorTag`.\n // This is because the link mark schema in `markdown-parser.ts` file uses `<nimble-anchor>` as anchor tag and not `<a>`.\n {\n tag: anchorTag\n },\n // `<a>` tag is added here to support when pasting a link from external source.\n {\n tag: 'a'\n }\n ];\n },\n // HTMLAttribute cannot be in camelCase as we want to match it with the name in Tiptap\n renderHTML({\n // eslint-disable-next-line @typescript-eslint/naming-convention\n HTMLAttributes\n }: {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n HTMLAttributes: { [key: string]: string }\n }) {\n // The below 'a' tag should be replaced with 'nimble-anchor' once the below issue is fixed.\n // https://github.com/ni/nimble/issues/1516\n return ['a', HTMLAttributes];\n }\n }).configure({\n // HTMLAttribute cannot be in camelCase as we want to match it with the name in Tiptap\n // eslint-disable-next-line @typescript-eslint/naming-convention\n HTMLAttributes: {\n rel: 'noopener noreferrer',\n target: null,\n // Adding `class` here is a workaround to render two mentions without a whitespace as display names\n // This attribute can be removed when the below issue is resolved\n // https://github.com/ni/nimble/issues/1707\n class: ''\n },\n autolink: true,\n openOnClick: false,\n // linkOnPaste can be enabled when hyperlink support added\n // See: https://github.com/ni/nimble/issues/1527\n linkOnPaste: false,\n shouldAutoLink: href => validAbsoluteLinkRegex.test(href)\n });\n}\n\nfunction createCustomMentionExtension(\n config: MentionExtensionConfiguration,\n activeMentionCharacterEmitter: ActiveMentionCharacterEmitter,\n activeMentionCommandEmitter: ActiveMentionCommandEmitter,\n mentionListbox?: RichTextMentionListbox\n): Node {\n return Mention.extend({\n name: config.name,\n parseHTML() {\n return [\n {\n tag: config.viewElement\n }\n ];\n },\n addAttributes() {\n return {\n href: {\n default: null,\n parseHTML: (element: HTMLElement) => element.getAttribute('mention-href'),\n renderHTML: (attributes: { [key: string]: string }) => {\n return {\n 'mention-href': attributes.href\n };\n }\n },\n label: {\n default: null,\n parseHTML: (element: HTMLElement) => element.getAttribute('mention-label'),\n renderHTML: (attributes: { [key: string]: string }) => {\n return {\n 'mention-label': attributes.label\n };\n }\n },\n disabled: {\n default: null,\n parseHTML: (element: HTMLElement) => element.getAttribute('disabled'),\n renderHTML: (attributes: { [key: string]: string }) => {\n return {\n disabled: attributes.disabled\n };\n }\n }\n };\n },\n renderHTML({\n node,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n HTMLAttributes\n }: {\n node: FragmentNode,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n HTMLAttributes: { [key: string]: string }\n }) {\n return [\n config.viewElement,\n mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),\n this.options.renderText({\n options: this.options,\n node,\n suggestion: null\n })\n ];\n }\n }).configure({\n suggestion: {\n char: config.character,\n decorationClass: 'nimble-mention-view-edit',\n pluginKey: new PluginKey(config.key),\n allowSpaces: true,\n render: () => {\n let inSuggestionMode = false;\n return {\n onStart: (props): void => {\n /**\n * If the cursor position moves to outside of the mention and configuration element changes,\n * the setMarkdown() will trigger this `onStart` without a decoration node because the cursor\n * position is temporarily moved out of the suggestion decoration. Ignore `onStart` in that case\n * and don't show the mention list box since it doesn't have anything to anchor to.\n */\n if (props.decorationNode === null) {\n return;\n }\n inSuggestionMode = true;\n config.mentionUpdateEmitter(props.query);\n activeMentionCharacterEmitter(props.text.slice(0, 1));\n activeMentionCommandEmitter(props.command);\n mentionListbox?.show({\n filter: props.query,\n anchorNode: props.decorationNode as HTMLElement\n });\n },\n onUpdate: (props): void => {\n if (!inSuggestionMode) {\n return;\n }\n config.mentionUpdateEmitter(props.query);\n activeMentionCommandEmitter(props.command);\n mentionListbox?.show({\n filter: props.query,\n anchorNode: props.decorationNode as HTMLElement\n });\n },\n onKeyDown: (props): boolean => {\n if (!inSuggestionMode) {\n return false;\n }\n if (props.event.key === keyEscape) {\n inSuggestionMode = false;\n }\n return (\n mentionListbox?.keydownHandler(props.event) ?? false\n );\n },\n onExit: (): void => {\n activeMentionCharacterEmitter('');\n activeMentionCommandEmitter(undefined);\n mentionListbox?.close();\n }\n };\n }\n }\n });\n}\n\n/**\n * This method finds the Link mark in the pasted content and update its Text node.\n * If there is no text node, pass the node's fragment recursively and updates only node containing Link mark.\n * If the Text node does not contains Link mark, push the same node to `updatedNodes`.\n *\n * @param fragment Fragment containing the pasted content. [Fragment](https://prosemirror.net/docs/ref/#model.Fragment)\n * @returns modified fragment from the `updatedNode` after updating the valid link text with its href value.\n */\nfunction updateLinkAndMentionNodes(\n tiptapEditor: Editor,\n fragment: Fragment\n): Fragment {\n const updatedNodes: FragmentNode[] = [];\n\n fragment.forEach(node => {\n if (node.isText && node.marks.length > 0) {\n const linkMark = node.marks.find(\n mark => mark.type.name === 'link'\n );\n if (linkMark) {\n // Checks if the link is valid link or not\n // Needing to separately validate the link on paste is a workaround for a tiptap issue\n // See: https://github.com/ni/nimble/issues/1527\n if (\n validAbsoluteLinkRegex.test(linkMark.attrs.href as string)\n ) {\n // The below lines of code is responsible for updating the text content with its href value and creates a new updated text node.\n // This code needs an update when the hyperlink support is added.\n // See: https://github.com/ni/nimble/issues/1527\n updatedNodes.push(\n tiptapEditor.schema.text(\n linkMark.attrs.href as string,\n node.marks\n )\n );\n } else {\n // If it is a invalid link, creates a new Text node with the same text content and without a Link mark.\n updatedNodes.push(\n tiptapEditor.schema.text(\n node.textContent,\n linkMark.removeFromSet(node.marks)\n )\n );\n }\n } else {\n updatedNodes.push(node);\n }\n } else if (node.type.name.startsWith(mentionPluginPrefix)) {\n updatedNodes.push(\n tiptapEditor.schema.text(node.attrs.label as string)\n );\n } else {\n const updatedContent = updateLinkAndMentionNodes(\n tiptapEditor,\n node.content\n );\n updatedNodes.push(node.copy(updatedContent));\n }\n });\n\n return Fragment.fromArray(updatedNodes);\n}\n"]}
1
+ {"version":3,"file":"create-tiptap-editor.js","sourceRoot":"","sources":["../../../../../src/rich-text/editor/models/create-tiptap-editor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,IAAI,MAAM,wBAAwB,CAAC;AAC1C,OAAO,QAAQ,MAAM,4BAA4B,CAAC;AAClD,OAAO,SAAS,MAAM,8BAA8B,CAAC;AACrD,OAAO,MAAM,MAAM,0BAA0B,CAAC;AAC9C,OAAO,IAAI,MAAM,wBAAwB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,OAAO,MAAM,2BAA2B,CAAC;AAChD,OAAO,SAAS,MAAM,6BAA6B,CAAC;AACpD,OAAO,IAAI,MAAM,wBAAwB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,IAAI,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAGH,mBAAmB,EACtB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,MAAM,sBAAsB,GAAG,eAAe,CAAC;AAE/C,MAAM,UAAU,kBAAkB,CAC9B,6BAA4D,EAC5D,2BAAwD,EACxD,MAAsB,EACtB,sBAAuD,EACvD,cAAuC,EACvC,WAAoB;IAEpB,MAAM,UAAU,GAAG,yBAAyB,EAAE,CAAC;IAC/C,MAAM,iBAAiB,GAAG,sBAAsB,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CA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,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,KAAe,CAAC,CACvD,CAAC;QACN,CAAC;aAAM,CAAC;YACJ,MAAM,cAAc,GAAG,yBAAyB,CAC5C,YAAY,EACZ,IAAI,CAAC,OAAO,CACf,CAAC;YACF,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC;QACjD,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;AAC5C,CAAC","sourcesContent":["import { Editor, Mark, Node, mergeAttributes } from '@tiptap/core';\nimport Bold from '@tiptap/extension-bold';\nimport Document from '@tiptap/extension-document';\nimport HardBreak from '@tiptap/extension-hard-break';\nimport Italic from '@tiptap/extension-italic';\nimport Link from '@tiptap/extension-link';\nimport { BulletList, ListItem, OrderedList } from '@tiptap/extension-list';\nimport Mention from '@tiptap/extension-mention';\nimport Paragraph from '@tiptap/extension-paragraph';\nimport Text from '@tiptap/extension-text';\nimport { Placeholder, UndoRedo } from '@tiptap/extensions';\nimport { Slice, Fragment, Node as FragmentNode } from 'prosemirror-model';\nimport { PluginKey } from 'prosemirror-state';\n\nimport { keyEscape } from '@ni/fast-web-utilities';\nimport {\n type ActiveMentionCommandEmitter,\n type ActiveMentionCharacterEmitter,\n mentionPluginPrefix\n} from '../types';\n\nimport { anchorTag } from '../../../anchor';\nimport type { MentionExtensionConfiguration } from '../../models/mention-extension-configuration';\nimport type { RichTextMentionListbox } from '../../mention-listbox';\n\nconst validAbsoluteLinkRegex = /^https?:\\/\\//i;\n\nexport function createTiptapEditor(\n activeMentionCharacterEmitter: ActiveMentionCharacterEmitter,\n activeMentionCommandEmitter: ActiveMentionCommandEmitter,\n editor: HTMLDivElement,\n mentionExtensionConfig: MentionExtensionConfiguration[],\n mentionListbox?: RichTextMentionListbox,\n placeholder?: string\n): Editor {\n const customLink = createCustomLinkExtension();\n const mentionExtensions = mentionExtensionConfig.map(config => createCustomMentionExtension(\n config,\n activeMentionCharacterEmitter,\n activeMentionCommandEmitter,\n mentionListbox\n ));\n\n /**\n * For more information on the extensions for the supported formatting options, refer to the links below.\n * Tiptap marks: https://tiptap.dev/api/marks\n * Tiptap nodes: https://tiptap.dev/api/nodes\n */\n const tipTapEditor = new Editor({\n element: editor,\n // The editor will detect markdown syntax for an input only for these items\n // https://tiptap.dev/api/editor#enable-input-rules\n enableInputRules: [BulletList, OrderedList],\n // The editor will not detect markdown syntax when pasting content in any supported items\n // Lists do not have any default paste rules, they have only input rules, so disabled paste rules\n // https://tiptap.dev/api/editor#enable-paste-rules\n enablePasteRules: false,\n editorProps: {\n // Validating whether the links in the pasted content belongs to the supported scheme (HTTPS/HTTP),\n // and rendering it as a link in the editor. If not, rendering it as a plain text.\n // Also, updating the link text content with its href as we support only the absolute link.\n\n // `transformPasted` can be updated/removed when hyperlink support added\n // See: https://github.com/ni/nimble/issues/1527\n transformPasted\n },\n extensions: [\n Document,\n Paragraph,\n Text,\n BulletList,\n OrderedList,\n ListItem,\n Bold,\n Italic,\n UndoRedo,\n Placeholder.configure({\n placeholder,\n showOnlyWhenEditable: false\n }),\n HardBreak,\n customLink,\n ...mentionExtensions\n ]\n });\n\n /**\n * @param slice contains the Fragment of the copied content. If the content is a link, the slice contains Text node with Link mark.\n * ProseMirror reference for `transformPasted`: https://prosemirror.net/docs/ref/#view.EditorProps.transformPasted\n */\n function transformPasted(slice: Slice): Slice {\n const modifiedFragment = updateLinkAndMentionNodes(\n tipTapEditor,\n slice.content\n );\n return new Slice(modifiedFragment, slice.openStart, slice.openEnd);\n }\n\n return tipTapEditor;\n}\n\n/**\n * Extending the default link mark schema defined in the TipTap.\n *\n * \"excludes\": https://prosemirror.net/docs/ref/#model.MarkSpec.excludes\n * \"inclusive\": https://prosemirror.net/docs/ref/#model.MarkSpec.inclusive\n * \"parseHTML\": https://tiptap.dev/guide/custom-extensions#parse-html\n * \"renderHTML\": https://tiptap.dev/guide/custom-extensions/#render-html\n */\nfunction createCustomLinkExtension(): Mark {\n return Link.extend({\n // Excludes can be removed/enabled when hyperlink support added\n // See: https://github.com/ni/nimble/issues/1527\n excludes: '_',\n // Inclusive can be updated when hyperlink support added\n // See: https://github.com/ni/nimble/issues/1527\n inclusive: false,\n parseHTML() {\n return [\n // To load the `nimble-anchor` from the HTML parsed content by markdown-parser as links in the Tiptap editor, the `parseHTML`\n // of Link extension should return nimble `anchorTag`.\n // This is because the link mark schema in `markdown-parser.ts` file uses `<nimble-anchor>` as anchor tag and not `<a>`.\n {\n tag: anchorTag\n },\n // `<a>` tag is added here to support when pasting a link from external source.\n {\n tag: 'a'\n }\n ];\n },\n // HTMLAttribute cannot be in camelCase as we want to match it with the name in Tiptap\n renderHTML({\n // eslint-disable-next-line @typescript-eslint/naming-convention\n HTMLAttributes\n }: {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n HTMLAttributes: { [key: string]: string }\n }) {\n // The below 'a' tag should be replaced with 'nimble-anchor' once the below issue is fixed.\n // https://github.com/ni/nimble/issues/1516\n return ['a', HTMLAttributes];\n }\n }).configure({\n // HTMLAttribute cannot be in camelCase as we want to match it with the name in Tiptap\n // eslint-disable-next-line @typescript-eslint/naming-convention\n HTMLAttributes: {\n rel: 'noopener noreferrer',\n target: null,\n // Adding `class` here is a workaround to render two mentions without a whitespace as display names\n // For more details on this behavior, refer to the issue below:\n // https://github.com/ni/nimble/issues/1707\n class: ''\n },\n autolink: true,\n openOnClick: false,\n // linkOnPaste can be enabled when hyperlink support added\n // See: https://github.com/ni/nimble/issues/1527\n linkOnPaste: false,\n shouldAutoLink: href => validAbsoluteLinkRegex.test(href)\n });\n}\n\nfunction createCustomMentionExtension(\n config: MentionExtensionConfiguration,\n activeMentionCharacterEmitter: ActiveMentionCharacterEmitter,\n activeMentionCommandEmitter: ActiveMentionCommandEmitter,\n mentionListbox?: RichTextMentionListbox\n): Node {\n return Mention.extend({\n name: config.name,\n parseHTML() {\n return [\n {\n tag: config.viewElement\n }\n ];\n },\n addAttributes() {\n return {\n href: {\n default: null,\n parseHTML: (element: HTMLElement) => element.getAttribute('mention-href'),\n renderHTML: (attributes: { [key: string]: string }) => {\n return {\n 'mention-href': attributes.href\n };\n }\n },\n label: {\n default: null,\n parseHTML: (element: HTMLElement) => element.getAttribute('mention-label'),\n renderHTML: (attributes: { [key: string]: string }) => {\n return {\n 'mention-label': attributes.label\n };\n }\n },\n disabled: {\n default: null,\n parseHTML: (element: HTMLElement) => element.getAttribute('disabled'),\n renderHTML: (attributes: { [key: string]: string }) => {\n return {\n disabled: attributes.disabled\n };\n }\n }\n };\n },\n renderHTML({\n node,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n HTMLAttributes\n }: {\n node: FragmentNode,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n HTMLAttributes: { [key: string]: string }\n }) {\n return [\n config.viewElement,\n mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),\n this.options.renderText({\n options: this.options,\n node,\n suggestion: null\n })\n ];\n }\n }).configure({\n suggestion: {\n char: config.character,\n decorationClass: 'nimble-mention-view-edit',\n pluginKey: new PluginKey(config.key),\n allowSpaces: true,\n render: () => {\n let inSuggestionMode = false;\n return {\n onStart: (props): void => {\n /**\n * If the cursor position moves to outside of the mention and configuration element changes,\n * the setMarkdown() will trigger this `onStart` without a decoration node because the cursor\n * position is temporarily moved out of the suggestion decoration. Ignore `onStart` in that case\n * and don't show the mention list box since it doesn't have anything to anchor to.\n */\n if (props.decorationNode === null) {\n return;\n }\n inSuggestionMode = true;\n config.mentionUpdateEmitter(props.query);\n activeMentionCharacterEmitter(props.text.slice(0, 1));\n activeMentionCommandEmitter(props.command);\n mentionListbox?.show({\n filter: props.query,\n anchorNode: props.decorationNode as HTMLElement\n });\n },\n onUpdate: (props): void => {\n if (!inSuggestionMode) {\n return;\n }\n config.mentionUpdateEmitter(props.query);\n activeMentionCommandEmitter(props.command);\n mentionListbox?.show({\n filter: props.query,\n anchorNode: props.decorationNode as HTMLElement\n });\n },\n onKeyDown: (props): boolean => {\n if (!inSuggestionMode) {\n return false;\n }\n if (props.event.key === keyEscape) {\n inSuggestionMode = false;\n }\n return (\n mentionListbox?.keydownHandler(props.event) ?? false\n );\n },\n onExit: (): void => {\n activeMentionCharacterEmitter('');\n activeMentionCommandEmitter(undefined);\n mentionListbox?.close();\n }\n };\n }\n }\n });\n}\n\n/**\n * This method finds the Link mark in the pasted content and update its Text node.\n * If there is no text node, pass the node's fragment recursively and updates only node containing Link mark.\n * If the Text node does not contains Link mark, push the same node to `updatedNodes`.\n *\n * @param fragment Fragment containing the pasted content. [Fragment](https://prosemirror.net/docs/ref/#model.Fragment)\n * @returns modified fragment from the `updatedNode` after updating the valid link text with its href value.\n */\nfunction updateLinkAndMentionNodes(\n tiptapEditor: Editor,\n fragment: Fragment\n): Fragment {\n const updatedNodes: FragmentNode[] = [];\n\n fragment.forEach(node => {\n if (node.isText && node.marks.length > 0) {\n const linkMark = node.marks.find(\n mark => mark.type.name === 'link'\n );\n if (linkMark) {\n // Checks if the link is valid link or not\n // Needing to separately validate the link on paste is a workaround for a tiptap issue\n // See: https://github.com/ni/nimble/issues/1527\n if (\n validAbsoluteLinkRegex.test(linkMark.attrs.href as string)\n ) {\n // The below lines of code is responsible for updating the text content with its href value and creates a new updated text node.\n // This code needs an update when the hyperlink support is added.\n // See: https://github.com/ni/nimble/issues/1527\n updatedNodes.push(\n tiptapEditor.schema.text(\n linkMark.attrs.href as string,\n node.marks\n )\n );\n } else {\n // If it is a invalid link, creates a new Text node with the same text content and without a Link mark.\n updatedNodes.push(\n tiptapEditor.schema.text(\n node.textContent,\n linkMark.removeFromSet(node.marks)\n )\n );\n }\n } else {\n updatedNodes.push(node);\n }\n } else if (node.type.name.startsWith(mentionPluginPrefix)) {\n updatedNodes.push(\n tiptapEditor.schema.text(node.attrs.label as string)\n );\n } else {\n const updatedContent = updateLinkAndMentionNodes(\n tiptapEditor,\n node.content\n );\n updatedNodes.push(node.copy(updatedContent));\n }\n });\n\n return Fragment.fromArray(updatedNodes);\n}\n"]}
@@ -144,7 +144,7 @@ export class RichTextEditorPageObject {
144
144
  }
145
145
  getMentionButtonLabel(buttonIndex) {
146
146
  const buttons = this.getMentionButtons();
147
- return buttons[buttonIndex]?.innerText ?? '';
147
+ return (buttons[buttonIndex]?.innerText ?? '').trim();
148
148
  }
149
149
  getButtonCheckedState(button) {
150
150
  const toggleButton = this.getFormattingButton(button);