@ni/nimble-components 35.2.2 → 35.2.3

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.
@@ -6933,11 +6933,11 @@ let e=this.pendingRecords()
6933
6933
  e.length&&(this.queue=[])
6934
6934
  let n=t.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&lk(t)&&!this.ignoreSelectionChange(n),o=-1,s=-1,r=!1,a=[]
6935
6935
  if(t.editable)for(let t=0;t<e.length;t++){let n=this.registerMutation(e[t],a)
6936
- n&&(o=o<0?n.from:Math.min(n.from,o),s=s<0?n.to:Math.max(n.to,s),n.typeOver&&(r=!0))}if(Xx&&a.length){let e=a.filter((t=>"BR"==t.nodeName))
6936
+ n&&(o=o<0?n.from:Math.min(n.from,o),s=s<0?n.to:Math.max(n.to,s),n.typeOver&&(r=!0))}if(!a.some((t=>"BR"==t.nodeName))||8!=t.input.lastKeyCode&&46!=t.input.lastKeyCode){if(Xx&&a.length){let e=a.filter((t=>"BR"==t.nodeName))
6937
6937
  if(2==e.length){let[t,n]=e
6938
6938
  t.parentNode&&t.parentNode.parentNode==n.parentNode?n.remove():t.remove()}else{let{focusNode:n}=this.currentSelection
6939
6939
  for(let i of e){let e=i.parentNode
6940
- !e||"LI"!=e.nodeName||n&&FS(t,n)==e||i.remove()}}}else if((Qx||eC)&&a.some((t=>"BR"==t.nodeName))&&(8==t.input.lastKeyCode||46==t.input.lastKeyCode))for(let t of a)if("BR"==t.nodeName&&t.parentNode){let e=t.nextSibling
6940
+ !e||"LI"!=e.nodeName||n&&FS(t,n)==e||i.remove()}}}}else for(let t of a)if("BR"==t.nodeName&&t.parentNode){let e=t.nextSibling
6941
6941
  e&&1==e.nodeType&&"false"==e.contentEditable&&t.parentNode.removeChild(t)}let l=null
6942
6942
  o<0&&i&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&Vx(n)&&(l=JC(t))&&l.eq(Pw.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,tk(t),this.currentSelection.set(n),t.scrollToSelection()):(o>-1||i)&&(o>-1&&(t.docView.markDirty(o,s),function(t){if(DS.has(t))return
6943
6943
  if(DS.set(t,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)){if(t.requiresGeckoHackNode=Xx,OS)return
@@ -9143,7 +9143,7 @@ this.inTightList=i,t.forEach(((o,s,r)=>{r&&i&&this.flushClose(1),this.wrapBlock(
9143
9143
  return e[0]+t+e[1]}repeat(t,e){let n=""
9144
9144
  for(let i=0;i<e;i++)n+=t
9145
9145
  return n}markString(t,e,n,i){let o=this.getMark(t.type.name),s=e?o.open:o.close
9146
- return"string"==typeof s?s:s(this,t,n,i)}getEnclosingWhitespace(t){return{leading:(t.match(/^(\s+)/)||[void 0])[0],trailing:(t.match(/(\s+)$/)||[void 0])[0]}}isMarkAhead(t,e,n){for(;;e++){if(e==t.childCount)return!1
9146
+ return"string"==typeof s?s:s(this,t,n,i)}getEnclosingWhitespace(t){return{leading:(t.match(/^(\s+)/)||[void 0])[0],trailing:(t.match(/(\s+)$/)||[void 0])[0]}}isMarkAhead(t,e,n){for(;;e++){if(e>=t.childCount)return!1
9147
9147
  let i=t.child(e)
9148
9148
  if(i.type.name!=this.options.hardBreakNodeName)return n.isInSet(i.marks)
9149
9149
  e++}}}var ET
@@ -9319,10 +9319,10 @@ return e&&e.forEach((t=>{const e="string"==typeof t?t:t.scheme
9319
9319
  e&&n.push(e)})),!t||t.replace(QO,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var eR=kI.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach((t=>{"string"!=typeof t?WO(t.scheme,t.optionalSlashes):WO(t)}))},onDestroy(){gD.groups={},jO.scanner=null,jO.parser=null,jO.tokenQueue=[],jO.pluginQueue=[],jO.customSchemes=[],jO.initialized=!1},inclusive(){return this.options.autolink},addOptions:()=>({openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!tR(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>{const e=/^[a-z][a-z0-9+.-]*:\/\//i.test(t),n=/^[a-z][a-z0-9+.-]*:/i.test(t)
9320
9320
  if(e||n&&!t.includes("@"))return!0
9321
9321
  const i=(t.includes("@")?t.split("@").pop():t).split(/[/?#:]/)[0]
9322
- return!/^\d{1,3}(\.\d{1,3}){3}$/.test(i)&&!!/\./.test(i)}}),addAttributes(){return{href:{default:null,parseHTML:t=>t.getAttribute("href")},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href")
9323
- return!(!e||!this.options.isAllowedUri(e,{defaultValidate:t=>!!tR(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:t=>!!tR(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",MM(this.options.HTMLAttributes,t),0]:["a",MM(this.options.HTMLAttributes,{...t,href:""}),0]},markdownTokenName:"link",parseMarkdown:(t,e)=>e.applyMark("link",e.parseInline(t.tokens||[]),{href:t.href,title:t.title||null}),renderMarkdown:(t,e)=>{var n
9324
- const i=(null==(n=t.attrs)?void 0:n.href)||""
9325
- return`[${e.renderChildren(t)}](${i})`},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t
9322
+ return!/^\d{1,3}(\.\d{1,3}){3}$/.test(i)&&!!/\./.test(i)}}),addAttributes(){return{href:{default:null,parseHTML:t=>t.getAttribute("href")},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href")
9323
+ return!(!e||!this.options.isAllowedUri(e,{defaultValidate:t=>!!tR(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:t=>!!tR(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",MM(this.options.HTMLAttributes,t),0]:["a",MM(this.options.HTMLAttributes,{...t,href:""}),0]},markdownTokenName:"link",parseMarkdown:(t,e)=>e.applyMark("link",e.parseInline(t.tokens||[]),{href:t.href,title:t.title||null}),renderMarkdown:(t,e)=>{var n,i,o,s
9324
+ const r=null!=(i=null==(n=t.attrs)?void 0:n.href)?i:"",a=null!=(s=null==(o=t.attrs)?void 0:o.title)?s:"",l=e.renderChildren(t)
9325
+ return a?`[${l}](${r} "${a}")`:`[${l}](${r})`},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t
9326
9326
  return!!this.options.isAllowedUri(n,{defaultValidate:t=>!!tR(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&e().setMark(this.name,t).setMeta("preventAutolink",!0).run()},toggleLink:t=>({chain:e})=>{const{href:n}=t||{}
9327
9327
  return!(n&&!this.options.isAllowedUri(n,{defaultValidate:t=>!!tR(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[e$({find:t=>{const e=[]
9328
9328
  if(t){const{protocols:n,defaultProtocol:i}=this.options,o=KO(t).filter((t=>t.isLink&&this.options.isAllowedUri(t.value,{defaultValidate:t=>!!tR(t,n),protocols:n,defaultProtocol:i})))