@ni/nimble-components 32.8.0 → 32.8.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.
@@ -27222,7 +27222,7 @@ so this becomes the fallback color for the slot */ ''}
27222
27222
  */
27223
27223
  constructor(
27224
27224
  /**
27225
- @internal
27225
+ The child nodes in this fragment.
27226
27226
  */
27227
27227
  content, size) {
27228
27228
  this.content = content;
@@ -28334,6 +28334,10 @@ so this becomes the fallback color for the slot */ ''}
28334
28334
  this.content = content || Fragment.empty;
28335
28335
  }
28336
28336
  /**
28337
+ The array of this node's child nodes.
28338
+ */
28339
+ get children() { return this.content.content; }
28340
+ /**
28337
28341
  The size of this node, as defined by the integer-based [indexing
28338
28342
  scheme](/docs/guide/#doc.indexing). For text nodes, this is the
28339
28343
  amount of characters. For other leaf nodes, it is one. For
@@ -29029,16 +29033,14 @@ so this becomes the fallback color for the slot */ ''}
29029
29033
  stream.err("Unexpected token '" + stream.next + "'");
29030
29034
  }
29031
29035
  }
29032
- /**
29033
- Construct an NFA from an expression as returned by the parser. The
29034
- NFA is represented as an array of states, which are themselves
29035
- arrays of edges, which are `{term, to}` objects. The first state is
29036
- the entry state and the last node is the success state.
29037
-
29038
- Note that unlike typical NFAs, the edge ordering in this one is
29039
- significant, in that it is used to contruct filler content when
29040
- necessary.
29041
- */
29036
+ // Construct an NFA from an expression as returned by the parser. The
29037
+ // NFA is represented as an array of states, which are themselves
29038
+ // arrays of edges, which are `{term, to}` objects. The first state is
29039
+ // the entry state and the last node is the success state.
29040
+ //
29041
+ // Note that unlike typical NFAs, the edge ordering in this one is
29042
+ // significant, in that it is used to contruct filler content when
29043
+ // necessary.
29042
29044
  function nfa(expr) {
29043
29045
  let nfa = [[]];
29044
29046
  connect(compile(expr, 0), node());
@@ -34738,18 +34740,19 @@ so this becomes the fallback color for the slot */ ''}
34738
34740
  // custom things with the selection. Note that this falls apart when
34739
34741
  // a selection starts in such a node and ends in another, in which
34740
34742
  // case we just use whatever domFromPos produces as a best effort.
34741
- setSelection(anchor, head, root, force = false) {
34743
+ setSelection(anchor, head, view, force = false) {
34742
34744
  // If the selection falls entirely in a child, give it to that child
34743
34745
  let from = Math.min(anchor, head), to = Math.max(anchor, head);
34744
34746
  for (let i = 0, offset = 0; i < this.children.length; i++) {
34745
34747
  let child = this.children[i], end = offset + child.size;
34746
34748
  if (from > offset && to < end)
34747
- return child.setSelection(anchor - offset - child.border, head - offset - child.border, root, force);
34749
+ return child.setSelection(anchor - offset - child.border, head - offset - child.border, view, force);
34748
34750
  offset = end;
34749
34751
  }
34750
34752
  let anchorDOM = this.domFromPos(anchor, anchor ? -1 : 1);
34751
34753
  let headDOM = head == anchor ? anchorDOM : this.domFromPos(head, head ? -1 : 1);
34752
- let domSel = root.getSelection();
34754
+ let domSel = view.root.getSelection();
34755
+ let selRange = view.domSelectionRange();
34753
34756
  let brKludge = false;
34754
34757
  // On Firefox, using Selection.collapse to put the cursor after a
34755
34758
  // BR node for some reason doesn't always work (#1073). On Safari,
@@ -34780,14 +34783,14 @@ so this becomes the fallback color for the slot */ ''}
34780
34783
  }
34781
34784
  // Firefox can act strangely when the selection is in front of an
34782
34785
  // uneditable node. See #1163 and https://bugzilla.mozilla.org/show_bug.cgi?id=1709536
34783
- if (gecko && domSel.focusNode && domSel.focusNode != headDOM.node && domSel.focusNode.nodeType == 1) {
34784
- let after = domSel.focusNode.childNodes[domSel.focusOffset];
34786
+ if (gecko && selRange.focusNode && selRange.focusNode != headDOM.node && selRange.focusNode.nodeType == 1) {
34787
+ let after = selRange.focusNode.childNodes[selRange.focusOffset];
34785
34788
  if (after && after.contentEditable == "false")
34786
34789
  force = true;
34787
34790
  }
34788
34791
  if (!(force || brKludge && safari) &&
34789
- isEquivalentPosition(anchorDOM.node, anchorDOM.offset, domSel.anchorNode, domSel.anchorOffset) &&
34790
- isEquivalentPosition(headDOM.node, headDOM.offset, domSel.focusNode, domSel.focusOffset))
34792
+ isEquivalentPosition(anchorDOM.node, anchorDOM.offset, selRange.anchorNode, selRange.anchorOffset) &&
34793
+ isEquivalentPosition(headDOM.node, headDOM.offset, selRange.focusNode, selRange.focusOffset))
34791
34794
  return;
34792
34795
  // Selection.extend can be used to create an 'inverted' selection
34793
34796
  // (one where the focus is before the anchor), but not all
@@ -34976,6 +34979,9 @@ so this becomes the fallback color for the slot */ ''}
34976
34979
  copy.children = nodes;
34977
34980
  return copy;
34978
34981
  }
34982
+ ignoreMutation(mutation) {
34983
+ return this.spec.ignoreMutation ? this.spec.ignoreMutation(mutation) : super.ignoreMutation(mutation);
34984
+ }
34979
34985
  destroy() {
34980
34986
  if (this.spec.destroy)
34981
34987
  this.spec.destroy();
@@ -35319,9 +35325,9 @@ so this becomes the fallback color for the slot */ ''}
35319
35325
  deselectNode() {
35320
35326
  this.spec.deselectNode ? this.spec.deselectNode() : super.deselectNode();
35321
35327
  }
35322
- setSelection(anchor, head, root, force) {
35323
- this.spec.setSelection ? this.spec.setSelection(anchor, head, root)
35324
- : super.setSelection(anchor, head, root, force);
35328
+ setSelection(anchor, head, view, force) {
35329
+ this.spec.setSelection ? this.spec.setSelection(anchor, head, view.root)
35330
+ : super.setSelection(anchor, head, view, force);
35325
35331
  }
35326
35332
  destroy() {
35327
35333
  if (this.spec.destroy)
@@ -35981,7 +35987,7 @@ so this becomes the fallback color for the slot */ ''}
35981
35987
  if (!sel.empty && !sel.$from.parent.inlineContent)
35982
35988
  resetEditableTo = temporarilyEditableNear(view, sel.to);
35983
35989
  }
35984
- view.docView.setSelection(anchor, head, view.root, force);
35990
+ view.docView.setSelection(anchor, head, view, force);
35985
35991
  if (brokenSelectBetweenUneditable) {
35986
35992
  if (resetEditableFrom)
35987
35993
  resetEditable(resetEditableFrom);
@@ -40609,6 +40615,13 @@ so this becomes the fallback color for the slot */ ''}
40609
40615
  }
40610
40616
  return this;
40611
40617
  }
40618
+ once(event, fn) {
40619
+ const onceFn = (...args) => {
40620
+ this.off(event, onceFn);
40621
+ fn.apply(this, args);
40622
+ };
40623
+ return this.on(event, onceFn);
40624
+ }
40612
40625
  removeAllListeners() {
40613
40626
  this.callbacks = {};
40614
40627
  }
@@ -40914,6 +40927,7 @@ so this becomes the fallback color for the slot */ ''}
40914
40927
  draggable: callOrReturn(getExtensionField(extension, 'draggable', context)),
40915
40928
  code: callOrReturn(getExtensionField(extension, 'code', context)),
40916
40929
  whitespace: callOrReturn(getExtensionField(extension, 'whitespace', context)),
40930
+ linebreakReplacement: callOrReturn(getExtensionField(extension, 'linebreakReplacement', context)),
40917
40931
  defining: callOrReturn(getExtensionField(extension, 'defining', context)),
40918
40932
  isolating: callOrReturn(getExtensionField(extension, 'isolating', context)),
40919
40933
  attrs: Object.fromEntries(extensionAttributes.map(extensionAttribute => {
@@ -41007,6 +41021,14 @@ so this becomes the fallback color for the slot */ ''}
41007
41021
  return enabled;
41008
41022
  }
41009
41023
 
41024
+ function getHTMLFromFragment(fragment, schema) {
41025
+ const documentFragment = DOMSerializer.fromSchema(schema).serializeFragment(fragment);
41026
+ const temporaryDocument = document.implementation.createHTMLDocument();
41027
+ const container = temporaryDocument.createElement('div');
41028
+ container.appendChild(documentFragment);
41029
+ return container.innerHTML;
41030
+ }
41031
+
41010
41032
  /**
41011
41033
  * Returns the text content of a resolved prosemirror position
41012
41034
  * @param $from The resolved position to get the text content from
@@ -41136,7 +41158,7 @@ so this becomes the fallback color for the slot */ ''}
41136
41158
  init() {
41137
41159
  return null;
41138
41160
  },
41139
- apply(tr, prev) {
41161
+ apply(tr, prev, state) {
41140
41162
  const stored = tr.getMeta(plugin);
41141
41163
  if (stored) {
41142
41164
  return stored;
@@ -41146,7 +41168,14 @@ so this becomes the fallback color for the slot */ ''}
41146
41168
  const isSimulatedInput = !!simulatedInputMeta;
41147
41169
  if (isSimulatedInput) {
41148
41170
  setTimeout(() => {
41149
- const { from, text } = simulatedInputMeta;
41171
+ let { text } = simulatedInputMeta;
41172
+ if (typeof text === 'string') {
41173
+ text = text;
41174
+ }
41175
+ else {
41176
+ text = getHTMLFromFragment(Fragment.from(text), state.schema);
41177
+ }
41178
+ const { from } = simulatedInputMeta;
41150
41179
  const to = from + text.length;
41151
41180
  run$1$1({
41152
41181
  editor,
@@ -41339,7 +41368,7 @@ so this becomes the fallback color for the slot */ ''}
41339
41368
 
41340
41369
  /**
41341
41370
  * Paste rules are used to react to pasted content.
41342
- * @see https://tiptap.dev/guide/custom-extensions/#paste-rules
41371
+ * @see https://tiptap.dev/docs/editor/extensions/custom-extensions/extend-existing#paste-rules
41343
41372
  */
41344
41373
  class PasteRule {
41345
41374
  constructor(config) {
@@ -41429,7 +41458,13 @@ so this becomes the fallback color for the slot */ ''}
41429
41458
  let isPastedFromProseMirror = false;
41430
41459
  let isDroppedFromProseMirror = false;
41431
41460
  let pasteEvent = typeof ClipboardEvent !== 'undefined' ? new ClipboardEvent('paste') : null;
41432
- let dropEvent = typeof DragEvent !== 'undefined' ? new DragEvent('drop') : null;
41461
+ let dropEvent;
41462
+ try {
41463
+ dropEvent = typeof DragEvent !== 'undefined' ? new DragEvent('drop') : null;
41464
+ }
41465
+ catch (e) {
41466
+ dropEvent = null;
41467
+ }
41433
41468
  const processEvent = ({ state, from, to, rule, pasteEvt, }) => {
41434
41469
  const tr = state.tr;
41435
41470
  const chainableState = createChainableState({
@@ -41448,7 +41483,12 @@ so this becomes the fallback color for the slot */ ''}
41448
41483
  if (!handler || !tr.steps.length) {
41449
41484
  return;
41450
41485
  }
41451
- dropEvent = typeof DragEvent !== 'undefined' ? new DragEvent('drop') : null;
41486
+ try {
41487
+ dropEvent = typeof DragEvent !== 'undefined' ? new DragEvent('drop') : null;
41488
+ }
41489
+ catch (e) {
41490
+ dropEvent = null;
41491
+ }
41452
41492
  pasteEvent = typeof ClipboardEvent !== 'undefined' ? new ClipboardEvent('paste') : null;
41453
41493
  return tr;
41454
41494
  };
@@ -41497,7 +41537,14 @@ so this becomes the fallback color for the slot */ ''}
41497
41537
  }
41498
41538
  // Handle simulated paste
41499
41539
  if (isSimulatedPaste) {
41500
- const { from, text } = simulatedPasteMeta;
41540
+ let { text } = simulatedPasteMeta;
41541
+ if (typeof text === 'string') {
41542
+ text = text;
41543
+ }
41544
+ else {
41545
+ text = getHTMLFromFragment(Fragment.from(text), state.schema);
41546
+ }
41547
+ const { from } = simulatedPasteMeta;
41501
41548
  const to = from + text.length;
41502
41549
  const pasteEvt = createClipboardPasteEvent(text);
41503
41550
  return processEvent({
@@ -42094,13 +42141,33 @@ so this becomes the fallback color for the slot */ ''}
42094
42141
 
42095
42142
  function findMarkInSet(marks, type, attributes = {}) {
42096
42143
  return marks.find(item => {
42097
- return item.type === type && objectIncludes(item.attrs, attributes);
42144
+ return (item.type === type
42145
+ && objectIncludes(
42146
+ // Only check equality for the attributes that are provided
42147
+ Object.fromEntries(Object.keys(attributes).map(k => [k, item.attrs[k]])), attributes));
42098
42148
  });
42099
42149
  }
42100
42150
  function isMarkInSet(marks, type, attributes = {}) {
42101
42151
  return !!findMarkInSet(marks, type, attributes);
42102
42152
  }
42103
- function getMarkRange($pos, type, attributes = {}) {
42153
+ /**
42154
+ * Get the range of a mark at a resolved position.
42155
+ */
42156
+ function getMarkRange(
42157
+ /**
42158
+ * The position to get the mark range for.
42159
+ */
42160
+ $pos,
42161
+ /**
42162
+ * The mark type to get the range for.
42163
+ */
42164
+ type,
42165
+ /**
42166
+ * The attributes to match against.
42167
+ * If not provided, only the first mark at the position will be matched.
42168
+ */
42169
+ attributes) {
42170
+ var _a;
42104
42171
  if (!$pos || !type) {
42105
42172
  return;
42106
42173
  }
@@ -42113,6 +42180,8 @@ so this becomes the fallback color for the slot */ ''}
42113
42180
  if (!start.node || !start.node.marks.some(mark => mark.type === type)) {
42114
42181
  return;
42115
42182
  }
42183
+ // Default to only matching against the first mark's attributes
42184
+ attributes = attributes || ((_a = start.node.marks[0]) === null || _a === void 0 ? void 0 : _a.attrs);
42116
42185
  // We now know that the cursor is either at the start, middle or end of a text node with the specified mark
42117
42186
  // so we can look it up on the targeted mark
42118
42187
  const mark = findMarkInSet([...start.node.marks], type, attributes);
@@ -42123,8 +42192,8 @@ so this becomes the fallback color for the slot */ ''}
42123
42192
  let startPos = $pos.start() + start.offset;
42124
42193
  let endIndex = startIndex + 1;
42125
42194
  let endPos = startPos + start.node.nodeSize;
42126
- findMarkInSet([...start.node.marks], type, attributes);
42127
- while (startIndex > 0 && mark.isInSet($pos.parent.child(startIndex - 1).marks)) {
42195
+ while (startIndex > 0
42196
+ && isMarkInSet([...$pos.parent.child(startIndex - 1).marks], type, attributes)) {
42128
42197
  startIndex -= 1;
42129
42198
  startPos -= $pos.parent.child(startIndex).nodeSize;
42130
42199
  }
@@ -42300,6 +42369,9 @@ so this becomes the fallback color for the slot */ ''}
42300
42369
  * @returns The created Prosemirror node or fragment
42301
42370
  */
42302
42371
  function createNodeFromContent(content, schema, options) {
42372
+ if (content instanceof Node$2 || content instanceof Fragment) {
42373
+ return content;
42374
+ }
42303
42375
  options = {
42304
42376
  slice: true,
42305
42377
  parseOptions: {},
@@ -42464,6 +42536,15 @@ so this becomes the fallback color for the slot */ ''}
42464
42536
  if (Array.isArray(value)) {
42465
42537
  newContent = value.map(v => v.text || '').join('');
42466
42538
  }
42539
+ else if (value instanceof Fragment) {
42540
+ let text = '';
42541
+ value.forEach(node => {
42542
+ if (node.text) {
42543
+ text += node.text;
42544
+ }
42545
+ });
42546
+ newContent = text;
42547
+ }
42467
42548
  else if (typeof value === 'object' && !!value && !!value.text) {
42468
42549
  newContent = value.text;
42469
42550
  }
@@ -42941,14 +43022,6 @@ so this becomes the fallback color for the slot */ ''}
42941
43022
  return (selection) => findParentNodeClosestToPos(selection.$from, predicate);
42942
43023
  }
42943
43024
 
42944
- function getHTMLFromFragment(fragment, schema) {
42945
- const documentFragment = DOMSerializer.fromSchema(schema).serializeFragment(fragment);
42946
- const temporaryDocument = document.implementation.createHTMLDocument();
42947
- const container = temporaryDocument.createElement('div');
42948
- container.appendChild(documentFragment);
42949
- return container.innerHTML;
42950
- }
42951
-
42952
43025
  /**
42953
43026
  * Gets the text of a Prosemirror node
42954
43027
  * @param node The Prosemirror node
@@ -43345,6 +43418,11 @@ so this becomes the fallback color for the slot */ ''}
43345
43418
 
43346
43419
  const setNode = (typeOrName, attributes = {}) => ({ state, dispatch, chain }) => {
43347
43420
  const type = getNodeType(typeOrName, state.schema);
43421
+ let attributesToCopy;
43422
+ if (state.selection.$anchor.sameParent(state.selection.$head)) {
43423
+ // only copy attributes if the selection is pointing to a node of the same type
43424
+ attributesToCopy = state.selection.$anchor.parent.attrs;
43425
+ }
43348
43426
  // TODO: use a fallback like insertContent?
43349
43427
  if (!type.isTextblock) {
43350
43428
  console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.');
@@ -43353,14 +43431,14 @@ so this becomes the fallback color for the slot */ ''}
43353
43431
  return (chain()
43354
43432
  // try to convert node to default node if needed
43355
43433
  .command(({ commands }) => {
43356
- const canSetBlock = setBlockType(type, attributes)(state);
43434
+ const canSetBlock = setBlockType(type, { ...attributesToCopy, ...attributes })(state);
43357
43435
  if (canSetBlock) {
43358
43436
  return true;
43359
43437
  }
43360
43438
  return commands.clearNodes();
43361
43439
  })
43362
43440
  .command(({ state: updatedState }) => {
43363
- return setBlockType(type, attributes)(updatedState, dispatch);
43441
+ return setBlockType(type, { ...attributesToCopy, ...attributes })(updatedState, dispatch);
43364
43442
  })
43365
43443
  .run());
43366
43444
  };
@@ -43779,21 +43857,63 @@ so this becomes the fallback color for the slot */ ''}
43779
43857
  markType = getMarkType(typeOrName, state.schema);
43780
43858
  }
43781
43859
  if (dispatch) {
43782
- tr.selection.ranges.forEach(range => {
43860
+ tr.selection.ranges.forEach((range) => {
43783
43861
  const from = range.$from.pos;
43784
43862
  const to = range.$to.pos;
43785
- state.doc.nodesBetween(from, to, (node, pos) => {
43786
- if (nodeType && nodeType === node.type) {
43787
- tr.setNodeMarkup(pos, undefined, {
43788
- ...node.attrs,
43863
+ let lastPos;
43864
+ let lastNode;
43865
+ let trimmedFrom;
43866
+ let trimmedTo;
43867
+ if (tr.selection.empty) {
43868
+ state.doc.nodesBetween(from, to, (node, pos) => {
43869
+ if (nodeType && nodeType === node.type) {
43870
+ trimmedFrom = Math.max(pos, from);
43871
+ trimmedTo = Math.min(pos + node.nodeSize, to);
43872
+ lastPos = pos;
43873
+ lastNode = node;
43874
+ }
43875
+ });
43876
+ }
43877
+ else {
43878
+ state.doc.nodesBetween(from, to, (node, pos) => {
43879
+ if (pos < from && nodeType && nodeType === node.type) {
43880
+ trimmedFrom = Math.max(pos, from);
43881
+ trimmedTo = Math.min(pos + node.nodeSize, to);
43882
+ lastPos = pos;
43883
+ lastNode = node;
43884
+ }
43885
+ if (pos >= from && pos <= to) {
43886
+ if (nodeType && nodeType === node.type) {
43887
+ tr.setNodeMarkup(pos, undefined, {
43888
+ ...node.attrs,
43889
+ ...attributes,
43890
+ });
43891
+ }
43892
+ if (markType && node.marks.length) {
43893
+ node.marks.forEach((mark) => {
43894
+ if (markType === mark.type) {
43895
+ const trimmedFrom2 = Math.max(pos, from);
43896
+ const trimmedTo2 = Math.min(pos + node.nodeSize, to);
43897
+ tr.addMark(trimmedFrom2, trimmedTo2, markType.create({
43898
+ ...mark.attrs,
43899
+ ...attributes,
43900
+ }));
43901
+ }
43902
+ });
43903
+ }
43904
+ }
43905
+ });
43906
+ }
43907
+ if (lastNode) {
43908
+ if (lastPos !== undefined) {
43909
+ tr.setNodeMarkup(lastPos, undefined, {
43910
+ ...lastNode.attrs,
43789
43911
  ...attributes,
43790
43912
  });
43791
43913
  }
43792
- if (markType && node.marks.length) {
43793
- node.marks.forEach(mark => {
43914
+ if (markType && lastNode.marks.length) {
43915
+ lastNode.marks.forEach((mark) => {
43794
43916
  if (markType === mark.type) {
43795
- const trimmedFrom = Math.max(pos, from);
43796
- const trimmedTo = Math.min(pos + node.nodeSize, to);
43797
43917
  tr.addMark(trimmedFrom, trimmedTo, markType.create({
43798
43918
  ...mark.attrs,
43799
43919
  ...attributes,
@@ -43801,7 +43921,7 @@ so this becomes the fallback color for the slot */ ''}
43801
43921
  }
43802
43922
  });
43803
43923
  }
43804
- });
43924
+ }
43805
43925
  });
43806
43926
  }
43807
43927
  return true;
@@ -44605,6 +44725,7 @@ img.ProseMirror-separator {
44605
44725
  * Creates a ProseMirror view.
44606
44726
  */
44607
44727
  createView() {
44728
+ var _a;
44608
44729
  let doc;
44609
44730
  try {
44610
44731
  doc = createDocument(this.options.content, this.schema, this.options.parseOptions, { errorOnInvalidContent: this.options.enableContentCheck });
@@ -44633,18 +44754,17 @@ img.ProseMirror-separator {
44633
44754
  const selection = resolveFocusPosition(doc, this.options.autofocus);
44634
44755
  this.view = new EditorView(this.options.element, {
44635
44756
  ...this.options.editorProps,
44757
+ attributes: {
44758
+ // add `role="textbox"` to the editor element
44759
+ role: 'textbox',
44760
+ ...(_a = this.options.editorProps) === null || _a === void 0 ? void 0 : _a.attributes,
44761
+ },
44636
44762
  dispatchTransaction: this.dispatchTransaction.bind(this),
44637
44763
  state: EditorState.create({
44638
44764
  doc,
44639
44765
  selection: selection || undefined,
44640
44766
  }),
44641
44767
  });
44642
- // add `role="textbox"` to the editor element
44643
- this.view.dom.setAttribute('role', 'textbox');
44644
- // add aria-label to the editor element
44645
- if (!this.view.dom.getAttribute('aria-label')) {
44646
- this.view.dom.setAttribute('aria-label', 'Rich-Text Editor');
44647
- }
44648
44768
  // `editor.view` is not yet available at this time.
44649
44769
  // Therefore we will add all plugins and node views directly afterwards.
44650
44770
  const newState = this.state.reconfigure({
@@ -44840,7 +44960,7 @@ img.ProseMirror-separator {
44840
44960
  /**
44841
44961
  * Build an input rule that adds a mark when the
44842
44962
  * matched text is typed into it.
44843
- * @see https://tiptap.dev/guide/custom-extensions/#input-rules
44963
+ * @see https://tiptap.dev/docs/editor/extensions/custom-extensions/extend-existing#input-rules
44844
44964
  */
44845
44965
  function markInputRule(config) {
44846
44966
  return new InputRule({
@@ -44894,7 +45014,7 @@ img.ProseMirror-separator {
44894
45014
  * two nodes. You can pass a join predicate, which takes a regular
44895
45015
  * expression match and the node before the wrapped node, and can
44896
45016
  * return a boolean to indicate whether a join should happen.
44897
- * @see https://tiptap.dev/guide/custom-extensions/#input-rules
45017
+ * @see https://tiptap.dev/docs/editor/extensions/custom-extensions/extend-existing#input-rules
44898
45018
  */
44899
45019
  function wrappingInputRule(config) {
44900
45020
  return new InputRule({
@@ -45008,7 +45128,7 @@ img.ProseMirror-separator {
45008
45128
  /**
45009
45129
  * Build an paste rule that adds a mark when the
45010
45130
  * matched text is pasted into it.
45011
- * @see https://tiptap.dev/guide/custom-extensions/#paste-rules
45131
+ * @see https://tiptap.dev/docs/editor/extensions/custom-extensions/extend-existing#paste-rules
45012
45132
  */
45013
45133
  function markPasteRule(config) {
45014
45134
  return new PasteRule({
@@ -45070,6 +45190,7 @@ img.ProseMirror-separator {
45070
45190
  inline: true,
45071
45191
  group: 'inline',
45072
45192
  selectable: false,
45193
+ linebreakReplacement: true,
45073
45194
  parseHTML() {
45074
45195
  return [
45075
45196
  { tag: 'br' },
@@ -56670,7 +56791,7 @@ img.ProseMirror-separator {
56670
56791
  // THIS FILE IS AUTOMATICALLY GENERATED DO NOT EDIT DIRECTLY
56671
56792
  // See update-tlds.js for encoding/decoding format
56672
56793
  // https://data.iana.org/TLD/tlds-alpha-by-domain.txt
56673
- const encodedTlds = 'aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2';
56794
+ const encodedTlds = 'aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2';
56674
56795
  // Internationalized domain names containing non-ASCII
56675
56796
  const encodedUtlds = 'ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2';
56676
56797
 
@@ -56795,10 +56916,7 @@ img.ProseMirror-separator {
56795
56916
  * @template T
56796
56917
  * @param {T} [token] Token that this state emits
56797
56918
  */
56798
- function State(token) {
56799
- if (token === void 0) {
56800
- token = null;
56801
- }
56919
+ function State(token = null) {
56802
56920
  // this.n = null; // DEBUG: State name
56803
56921
  /** @type {{ [input: string]: State<T> }} j */
56804
56922
  this.j = {}; // IMPLEMENTATION 1
@@ -56849,10 +56967,7 @@ img.ProseMirror-separator {
56849
56967
  * @param {string} input
56850
56968
  * @param {boolean} exactOnly
56851
56969
  */
56852
- has(input, exactOnly) {
56853
- if (exactOnly === void 0) {
56854
- exactOnly = false;
56855
- }
56970
+ has(input, exactOnly = false) {
56856
56971
  return exactOnly ? input in this.j : !!this.go(input);
56857
56972
  },
56858
56973
  /**
@@ -56975,7 +57090,6 @@ img.ProseMirror-separator {
56975
57090
  }
56976
57091
  nextState.t = t; // overwrite anything that was previously there
56977
57092
  }
56978
-
56979
57093
  state.j[input] = nextState;
56980
57094
  return nextState;
56981
57095
  }
@@ -57100,6 +57214,7 @@ img.ProseMirror-separator {
57100
57214
  const POUND = 'POUND'; // #
57101
57215
  const QUERY = 'QUERY'; // ?
57102
57216
  const QUOTE = 'QUOTE'; // "
57217
+ const FULLWIDTHMIDDLEDOT = 'FULLWIDTHMIDDLEDOT'; // ・
57103
57218
 
57104
57219
  const SEMI = 'SEMI'; // ;
57105
57220
  const SLASH = 'SLASH'; // /
@@ -57160,6 +57275,7 @@ img.ProseMirror-separator {
57160
57275
  POUND: POUND,
57161
57276
  QUERY: QUERY,
57162
57277
  QUOTE: QUOTE,
57278
+ FULLWIDTHMIDDLEDOT: FULLWIDTHMIDDLEDOT,
57163
57279
  SEMI: SEMI,
57164
57280
  SLASH: SLASH,
57165
57281
  TILDE: TILDE,
@@ -57207,10 +57323,7 @@ img.ProseMirror-separator {
57207
57323
  * item is a length-2 tuple with the first element set to the string scheme, and
57208
57324
  * the second element set to `true` if the `://` after the scheme is optional
57209
57325
  */
57210
- function init$2(customSchemes) {
57211
- if (customSchemes === void 0) {
57212
- customSchemes = [];
57213
- }
57326
+ function init$2(customSchemes = []) {
57214
57327
  // Frequently used states (name argument removed during minification)
57215
57328
  /** @type Collections<string> */
57216
57329
  const groups = {}; // of tokens
@@ -57265,6 +57378,7 @@ img.ProseMirror-separator {
57265
57378
  tt(Start, '~', TILDE);
57266
57379
  tt(Start, '_', UNDERSCORE);
57267
57380
  tt(Start, '\\', BACKSLASH);
57381
+ tt(Start, '・', FULLWIDTHMIDDLEDOT);
57268
57382
  const Num = tr(Start, DIGIT, NUM, {
57269
57383
  [numeric]: true
57270
57384
  });
@@ -57448,7 +57562,6 @@ img.ProseMirror-separator {
57448
57562
  e: cursor // end index (excluding)
57449
57563
  });
57450
57564
  }
57451
-
57452
57565
  return tokens;
57453
57566
  }
57454
57567
 
@@ -57523,7 +57636,6 @@ img.ProseMirror-separator {
57523
57636
  while (digits.indexOf(encoded[i + popDigitCount]) >= 0) {
57524
57637
  popDigitCount++; // encountered some digits, have to pop to go one level up trie
57525
57638
  }
57526
-
57527
57639
  if (popDigitCount > 0) {
57528
57640
  words.push(stack.join('')); // whatever preceded the pop digits must be a word
57529
57641
  for (let popCount = parseInt(encoded.substring(i, i + popDigitCount), 10); popCount > 0; popCount--) {
@@ -57646,10 +57758,7 @@ img.ProseMirror-separator {
57646
57758
  * HTML element based on a link token's derived tagName, attributes and HTML.
57647
57759
  * Similar to render option
57648
57760
  */
57649
- function Options(opts, defaultRender) {
57650
- if (defaultRender === void 0) {
57651
- defaultRender = null;
57652
- }
57761
+ function Options(opts, defaultRender = null) {
57653
57762
  let o = assign({}, defaults);
57654
57763
  if (opts) {
57655
57764
  o = assign(o, opts instanceof Options ? opts.o : opts);
@@ -57792,7 +57901,7 @@ img.ProseMirror-separator {
57792
57901
  * Returns the `.toString` value by default.
57793
57902
  * @param {string} [scheme]
57794
57903
  * @return {string}
57795
- */
57904
+ */
57796
57905
  toHref(scheme) {
57797
57906
  return this.toString();
57798
57907
  },
@@ -57838,10 +57947,7 @@ img.ProseMirror-separator {
57838
57947
  @method toObject
57839
57948
  @param {string} [protocol] `'http'` by default
57840
57949
  */
57841
- toObject(protocol) {
57842
- if (protocol === void 0) {
57843
- protocol = defaults.defaultProtocol;
57844
- }
57950
+ toObject(protocol = defaults.defaultProtocol) {
57845
57951
  return {
57846
57952
  type: this.t,
57847
57953
  value: this.toString(),
@@ -57965,10 +58071,7 @@ img.ProseMirror-separator {
57965
58071
  @param {string} [scheme] default scheme (e.g., 'https')
57966
58072
  @return {string} the full href
57967
58073
  */
57968
- toHref(scheme) {
57969
- if (scheme === void 0) {
57970
- scheme = defaults.defaultProtocol;
57971
- }
58074
+ toHref(scheme = defaults.defaultProtocol) {
57972
58075
  // Check if already has a prefix scheme
57973
58076
  return this.hasProtocol() ? this.v : `${scheme}://${this.v}`;
57974
58077
  },
@@ -58002,10 +58105,9 @@ img.ProseMirror-separator {
58002
58105
  * Generate the parser multi token-based state machine
58003
58106
  * @param {{ groups: Collections<string> }} tokens
58004
58107
  */
58005
- function init$1(_ref) {
58006
- let {
58007
- groups
58008
- } = _ref;
58108
+ function init$1({
58109
+ groups
58110
+ }) {
58009
58111
  // Types of characters the URL can definitely end in
58010
58112
  const qsAccepting = groups.domain.concat([AMPERSAND, ASTERISK, AT, BACKSLASH, BACKTICK, CARET, DOLLAR, EQUALS, HYPHEN, NUM, PERCENT, PIPE, PLUS, POUND, SLASH, SYM, TILDE, UNDERSCORE]);
58011
58113
 
@@ -58140,7 +58242,6 @@ img.ProseMirror-separator {
58140
58242
  // 『』
58141
58243
  [FULLWIDTHLESSTHAN, FULLWIDTHGREATERTHAN] // <>
58142
58244
  ];
58143
-
58144
58245
  for (let i = 0; i < bracketPairs.length; i++) {
58145
58246
  const [OPEN, CLOSE] = bracketPairs[i];
58146
58247
  const UrlOpen = tt(Url$1, OPEN); // URL followed by open bracket
@@ -58318,6 +58419,7 @@ img.ProseMirror-separator {
58318
58419
  INIT.pluginQueue = [];
58319
58420
  INIT.customSchemes = [];
58320
58421
  INIT.initialized = false;
58422
+ return INIT;
58321
58423
  }
58322
58424
 
58323
58425
  /**
@@ -58327,10 +58429,7 @@ img.ProseMirror-separator {
58327
58429
  * @param {string} protocol
58328
58430
  * @param {boolean} [optionalSlashSlash]
58329
58431
  */
58330
- function registerCustomProtocol(scheme, optionalSlashSlash) {
58331
- if (optionalSlashSlash === void 0) {
58332
- optionalSlashSlash = false;
58333
- }
58432
+ function registerCustomProtocol(scheme, optionalSlashSlash = false) {
58334
58433
  if (INIT.initialized) {
58335
58434
  warn(`linkifyjs: already initialized - will not register custom scheme "${scheme}" ${warnAdvice}`);
58336
58435
  }
@@ -58365,6 +58464,7 @@ img.ProseMirror-separator {
58365
58464
  });
58366
58465
  }
58367
58466
  INIT.initialized = true;
58467
+ return INIT;
58368
58468
  }
58369
58469
 
58370
58470
  /**
@@ -58378,6 +58478,7 @@ img.ProseMirror-separator {
58378
58478
  }
58379
58479
  return run(INIT.parser.start, str, run$1(INIT.scanner.start, str));
58380
58480
  }
58481
+ tokenize.scan = run$1; // for testing
58381
58482
 
58382
58483
  /**
58383
58484
  * Find a list of linkable items in the given string.
@@ -58387,13 +58488,7 @@ img.ProseMirror-separator {
58387
58488
  * @param {Opts} [opts] formatting options for final output. Cannot be specified
58388
58489
  * if opts already provided in `type` argument
58389
58490
  */
58390
- function find$1(str, type, opts) {
58391
- if (type === void 0) {
58392
- type = null;
58393
- }
58394
- if (opts === void 0) {
58395
- opts = null;
58396
- }
58491
+ function find$1(str, type = null, opts = null) {
58397
58492
  if (type && typeof type === 'object') {
58398
58493
  if (opts) {
58399
58494
  throw Error(`linkifyjs: Invalid link type ${type}; must be a string`);
@@ -58506,6 +58601,8 @@ img.ProseMirror-separator {
58506
58601
  })
58507
58602
  // validate link
58508
58603
  .filter(link => options.validate(link.value))
58604
+ // check whether should autolink
58605
+ .filter(link => options.shouldAutoLink(link.value))
58509
58606
  // Add link mark.
58510
58607
  .forEach(link => {
58511
58608
  if (getMarksBetween(link.from, link.to, newState.doc).some(item => item.mark.type === options.type)) {
@@ -58592,17 +58689,32 @@ img.ProseMirror-separator {
58592
58689
  // eslint-disable-next-line no-control-regex
58593
58690
  const ATTR_WHITESPACE = /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;
58594
58691
  function isAllowedUri(uri, protocols) {
58595
- const allowedProtocols = ['http', 'https', 'ftp', 'ftps', 'mailto', 'tel', 'callto', 'sms', 'cid', 'xmpp'];
58692
+ const allowedProtocols = [
58693
+ 'http',
58694
+ 'https',
58695
+ 'ftp',
58696
+ 'ftps',
58697
+ 'mailto',
58698
+ 'tel',
58699
+ 'callto',
58700
+ 'sms',
58701
+ 'cid',
58702
+ 'xmpp',
58703
+ ];
58596
58704
  if (protocols) {
58597
58705
  protocols.forEach(protocol => {
58598
- const nextProtocol = (typeof protocol === 'string' ? protocol : protocol.scheme);
58706
+ const nextProtocol = typeof protocol === 'string' ? protocol : protocol.scheme;
58599
58707
  if (nextProtocol) {
58600
58708
  allowedProtocols.push(nextProtocol);
58601
58709
  }
58602
58710
  });
58603
58711
  }
58604
- // eslint-disable-next-line no-useless-escape
58605
- return !uri || uri.replace(ATTR_WHITESPACE, '').match(new RegExp(`^(?:(?:${allowedProtocols.join('|')}):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))`, 'i'));
58712
+ return (!uri
58713
+ || uri
58714
+ .replace(ATTR_WHITESPACE, '')
58715
+ .match(new RegExp(
58716
+ // eslint-disable-next-line no-useless-escape
58717
+ `^(?:(?:${allowedProtocols.join('|')}):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))`, 'i')));
58606
58718
  }
58607
58719
  /**
58608
58720
  * This extension allows you to create links.
@@ -58614,6 +58726,11 @@ img.ProseMirror-separator {
58614
58726
  keepOnSplit: false,
58615
58727
  exitable: true,
58616
58728
  onCreate() {
58729
+ if (this.options.validate && !this.options.shouldAutoLink) {
58730
+ // Copy the validate function to the shouldAutoLink option
58731
+ this.options.shouldAutoLink = this.options.validate;
58732
+ console.warn('The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.');
58733
+ }
58617
58734
  this.options.protocols.forEach(protocol => {
58618
58735
  if (typeof protocol === 'string') {
58619
58736
  registerCustomProtocol(protocol);
@@ -58640,7 +58757,9 @@ img.ProseMirror-separator {
58640
58757
  rel: 'noopener noreferrer nofollow',
58641
58758
  class: null,
58642
58759
  },
58760
+ isAllowedUri: (url, ctx) => !!isAllowedUri(url, ctx.protocols),
58643
58761
  validate: url => !!url,
58762
+ shouldAutoLink: url => !!url,
58644
58763
  };
58645
58764
  },
58646
58765
  addAttributes() {
@@ -58663,23 +58782,38 @@ img.ProseMirror-separator {
58663
58782
  };
58664
58783
  },
58665
58784
  parseHTML() {
58666
- return [{
58785
+ return [
58786
+ {
58667
58787
  tag: 'a[href]',
58668
58788
  getAttrs: dom => {
58669
58789
  const href = dom.getAttribute('href');
58670
58790
  // prevent XSS attacks
58671
- if (!href || !isAllowedUri(href, this.options.protocols)) {
58791
+ if (!href
58792
+ || !this.options.isAllowedUri(href, {
58793
+ defaultValidate: url => !!isAllowedUri(url, this.options.protocols),
58794
+ protocols: this.options.protocols,
58795
+ defaultProtocol: this.options.defaultProtocol,
58796
+ })) {
58672
58797
  return false;
58673
58798
  }
58674
58799
  return null;
58675
58800
  },
58676
- }];
58801
+ },
58802
+ ];
58677
58803
  },
58678
58804
  renderHTML({ HTMLAttributes }) {
58679
58805
  // prevent XSS attacks
58680
- if (!isAllowedUri(HTMLAttributes.href, this.options.protocols)) {
58806
+ if (!this.options.isAllowedUri(HTMLAttributes.href, {
58807
+ defaultValidate: href => !!isAllowedUri(href, this.options.protocols),
58808
+ protocols: this.options.protocols,
58809
+ defaultProtocol: this.options.defaultProtocol,
58810
+ })) {
58681
58811
  // strip out the href
58682
- return ['a', mergeAttributes(this.options.HTMLAttributes, { ...HTMLAttributes, href: '' }), 0];
58812
+ return [
58813
+ 'a',
58814
+ mergeAttributes(this.options.HTMLAttributes, { ...HTMLAttributes, href: '' }),
58815
+ 0,
58816
+ ];
58683
58817
  }
58684
58818
  return ['a', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
58685
58819
  },
@@ -58708,16 +58842,21 @@ img.ProseMirror-separator {
58708
58842
  find: text => {
58709
58843
  const foundLinks = [];
58710
58844
  if (text) {
58711
- const { validate } = this.options;
58712
- const links = find$1(text).filter(item => item.isLink && validate(item.value));
58845
+ const { protocols, defaultProtocol } = this.options;
58846
+ const links = find$1(text).filter(item => item.isLink
58847
+ && this.options.isAllowedUri(item.value, {
58848
+ defaultValidate: href => !!isAllowedUri(href, protocols),
58849
+ protocols,
58850
+ defaultProtocol,
58851
+ }));
58713
58852
  if (links.length) {
58714
- links.forEach(link => (foundLinks.push({
58853
+ links.forEach(link => foundLinks.push({
58715
58854
  text: link.value,
58716
58855
  data: {
58717
58856
  href: link.href,
58718
58857
  },
58719
58858
  index: link.start,
58720
- })));
58859
+ }));
58721
58860
  }
58722
58861
  }
58723
58862
  return foundLinks;
@@ -58734,11 +58873,17 @@ img.ProseMirror-separator {
58734
58873
  },
58735
58874
  addProseMirrorPlugins() {
58736
58875
  const plugins = [];
58876
+ const { protocols, defaultProtocol } = this.options;
58737
58877
  if (this.options.autolink) {
58738
58878
  plugins.push(autolink({
58739
58879
  type: this.type,
58740
58880
  defaultProtocol: this.options.defaultProtocol,
58741
- validate: this.options.validate,
58881
+ validate: url => this.options.isAllowedUri(url, {
58882
+ defaultValidate: href => !!isAllowedUri(href, protocols),
58883
+ protocols,
58884
+ defaultProtocol,
58885
+ }),
58886
+ shouldAutoLink: this.options.shouldAutoLink,
58742
58887
  }));
58743
58888
  }
58744
58889
  if (this.options.openOnClick === true) {
@@ -59505,7 +59650,7 @@ img.ProseMirror-separator {
59505
59650
  // linkOnPaste can be enabled when hyperlink support added
59506
59651
  // See: https://github.com/ni/nimble/issues/1527
59507
59652
  linkOnPaste: false,
59508
- validate: href => validAbsoluteLinkRegex.test(href)
59653
+ shouldAutoLink: href => validAbsoluteLinkRegex.test(href)
59509
59654
  });
59510
59655
  }
59511
59656
  function createCustomMentionExtension(config, activeMentionCharacterEmitter, activeMentionCommandEmitter, mentionListbox) {
@@ -62077,7 +62222,8 @@ img.ProseMirror-separator {
62077
62222
  var(--ni-private-switch-height) - var(
62078
62223
  --ni-private-switch-indicator-size
62079
62224
  )
62080
- ) / 2
62225
+ ) /
62226
+ 2
62081
62227
  );
62082
62228
  border: ${borderWidth} solid
62083
62229
  var(--ni-private-switch-indicator-border-color);
@@ -66202,8 +66348,11 @@ focus outline in that case.
66202
66348
  );
66203
66349
  height: 100%;
66204
66350
  left: calc(
66205
- -1 * (var(--ni-private-column-divider-width) +
66206
- var(--ni-private-column-divider-padding))
66351
+ -1 *
66352
+ (
66353
+ var(--ni-private-column-divider-width) +
66354
+ var(--ni-private-column-divider-padding)
66355
+ )
66207
66356
  );
66208
66357
  }
66209
66358
 
@@ -66552,7 +66701,8 @@ focus outline in that case.
66552
66701
 
66553
66702
  nimble-table-cell:first-of-type${focusVisible} {
66554
66703
  margin-left: calc(
66555
- -1 * (${controlHeight} - ${smallPadding}) * var(--ni-private-table-cell-focus-offset-multiplier)
66704
+ -1 * (${controlHeight} - ${smallPadding}) *
66705
+ var(--ni-private-table-cell-focus-offset-multiplier)
66556
66706
  );
66557
66707
  padding-left: calc(
66558
66708
  (${controlHeight} - ${mediumPadding}) *
@@ -66569,7 +66719,8 @@ focus outline in that case.
66569
66719
  ${controlHeight} *
66570
66720
  var(--ni-private-table-cell-nesting-level) +
66571
66721
  ${smallPadding}
66572
- ) * var(--ni-private-table-cell-focus-offset-multiplier)
66722
+ ) *
66723
+ var(--ni-private-table-cell-focus-offset-multiplier)
66573
66724
  );
66574
66725
  height: ${controlHeight};
66575
66726
  }