@ni/spright-components 6.6.5 → 6.7.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.
@@ -6936,11 +6936,11 @@ let e=this.pendingRecords()
6936
6936
  e.length&&(this.queue=[])
6937
6937
  let n=t.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&uk(t)&&!this.ignoreSelectionChange(n),o=-1,s=-1,r=!1,a=[]
6938
6938
  if(t.editable)for(let t=0;t<e.length;t++){let n=this.registerMutation(e[t],a)
6939
- 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(eC&&a.length){let e=a.filter((t=>"BR"==t.nodeName))
6939
+ 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(eC&&a.length){let e=a.filter((t=>"BR"==t.nodeName))
6940
6940
  if(2==e.length){let[t,n]=e
6941
6941
  t.parentNode&&t.parentNode.parentNode==n.parentNode?n.remove():t.remove()}else{let{focusNode:n}=this.currentSelection
6942
6942
  for(let i of e){let e=i.parentNode
6943
- !e||"LI"!=e.nodeName||n&&PS(t,n)==e||i.remove()}}}else if((iC||sC)&&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
6943
+ !e||"LI"!=e.nodeName||n&&PS(t,n)==e||i.remove()}}}}else for(let t of a)if("BR"==t.nodeName&&t.parentNode){let e=t.nextSibling
6944
6944
  e&&1==e.nodeType&&"false"==e.contentEditable&&t.parentNode.removeChild(t)}let l=null
6945
6945
  o<0&&i&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&jx(n)&&(l=nk(t))&&l.eq(Uw.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,ok(t),this.currentSelection.set(n),t.scrollToSelection()):(o>-1||i)&&(o>-1&&(t.docView.markDirty(o,s),function(t){if(NS.has(t))return
6946
6946
  if(NS.set(t,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)){if(t.requiresGeckoHackNode=eC,LS)return
@@ -9146,7 +9146,7 @@ this.inTightList=i,t.forEach(((o,s,r)=>{r&&i&&this.flushClose(1),this.wrapBlock(
9146
9146
  return e[0]+t+e[1]}repeat(t,e){let n=""
9147
9147
  for(let i=0;i<e;i++)n+=t
9148
9148
  return n}markString(t,e,n,i){let o=this.getMark(t.type.name),s=e?o.open:o.close
9149
- 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
9149
+ 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
9150
9150
  let i=t.child(e)
9151
9151
  if(i.type.name!=this.options.hardBreakNodeName)return n.isInSet(i.marks)
9152
9152
  e++}}}var OT
@@ -9322,10 +9322,10 @@ return e&&e.forEach((t=>{const e="string"==typeof t?t:t.scheme
9322
9322
  e&&n.push(e)})),!t||t.replace(iR,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var sR=$$.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?YO(t.scheme,t.optionalSlashes):YO(t)}))},onDestroy(){wD.groups={},KO.scanner=null,KO.parser=null,KO.tokenQueue=[],KO.pluginQueue=[],KO.customSchemes=[],KO.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)=>!!oR(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)
9323
9323
  if(e||n&&!t.includes("@"))return!0
9324
9324
  const i=(t.includes("@")?t.split("@").pop():t).split(/[/?#:]/)[0]
9325
- 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")
9326
- return!(!e||!this.options.isAllowedUri(e,{defaultValidate:t=>!!oR(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:t=>!!oR(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",AM(this.options.HTMLAttributes,t),0]:["a",AM(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
9327
- const i=(null==(n=t.attrs)?void 0:n.href)||""
9328
- return`[${e.renderChildren(t)}](${i})`},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t
9325
+ 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")
9326
+ return!(!e||!this.options.isAllowedUri(e,{defaultValidate:t=>!!oR(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:t=>!!oR(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",AM(this.options.HTMLAttributes,t),0]:["a",AM(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
9327
+ 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)
9328
+ return a?`[${l}](${r} "${a}")`:`[${l}](${r})`},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t
9329
9329
  return!!this.options.isAllowedUri(n,{defaultValidate:t=>!!oR(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||{}
9330
9330
  return!(n&&!this.options.isAllowedUri(n,{defaultValidate:t=>!!oR(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[sI({find:t=>{const e=[]
9331
9331
  if(t){const{protocols:n,defaultProtocol:i}=this.options,o=QO(t).filter((t=>t.isLink&&this.options.isAllowedUri(t.value,{defaultValidate:t=>!!oR(t,n),protocols:n,defaultProtocol:i})))
@@ -15865,6 +15865,7 @@ const LQ=$t`
15865
15865
  placeholder="${t=>t.placeholder}"
15866
15866
  rows="1"
15867
15867
  tabindex="${t=>t.tabIndex}"
15868
+ maxlength="${t=>t.maxLength}"
15868
15869
  @keydown="${(t,e)=>t.textAreaKeydownHandler(e.event)}"
15869
15870
  @input="${t=>t.textAreaInputHandler()}"
15870
15871
  ></textarea>
@@ -15882,9 +15883,9 @@ const LQ=$t`
15882
15883
  <${lv} slot="start"><${lv}/>
15883
15884
  </${Rd}>
15884
15885
  </div>`
15885
- class PQ extends Ve{constructor(){super(...arguments),this.value="",this.disableSendButton=!0}textAreaKeydownHandler(t){return!(t.key===rn&&!t.shiftKey)||(this.sendButtonClickHandler(),!1)}textAreaInputHandler(){this.value=this.textArea.value,this.disableSendButton=this.shouldDisableSendButton()}valueChanged(){this.textArea&&(this.textArea.value=this.value,this.disableSendButton=this.shouldDisableSendButton())}connectedCallback(){super.connectedCallback(),this.textArea.value=this.value,this.disableSendButton=this.shouldDisableSendButton()}sendButtonClickHandler(){if(this.shouldDisableSendButton())return
15886
+ class PQ extends Ve{constructor(){super(...arguments),this.value="",this.maxLength=-1,this.disableSendButton=!0}textAreaKeydownHandler(t){return!(t.key===rn&&!t.shiftKey)||(this.sendButtonClickHandler(),!1)}textAreaInputHandler(){this.value=this.textArea.value,this.disableSendButton=this.shouldDisableSendButton()}valueChanged(){this.textArea&&(this.textArea.value=this.value,this.disableSendButton=this.shouldDisableSendButton())}connectedCallback(){super.connectedCallback(),this.textArea.value=this.value,this.disableSendButton=this.shouldDisableSendButton()}sendButtonClickHandler(){if(this.shouldDisableSendButton())return
15886
15887
  const t={text:this.textArea.value}
15887
- this.resetInput(),this.$emit("send",t)}shouldDisableSendButton(){return 0===this.textArea.value.length}resetInput(){this.value="",this.disableSendButton=!0,this.textArea&&(this.textArea.value="",this.textArea.focus())}}t([ft],PQ.prototype,"placeholder",void 0),t([ft({attribute:"send-button-label"})],PQ.prototype,"sendButtonLabel",void 0),t([ft],PQ.prototype,"value",void 0),t([ft({attribute:"tabindex",converter:ut})],PQ.prototype,"tabIndex",void 0),t([C],PQ.prototype,"textArea",void 0),t([C],PQ.prototype,"disableSendButton",void 0)
15888
+ this.resetInput(),this.$emit("send",t)}shouldDisableSendButton(){return 0===this.textArea.value.length}resetInput(){this.value="",this.disableSendButton=!0,this.textArea&&(this.textArea.value="",this.textArea.focus())}}t([ft],PQ.prototype,"placeholder",void 0),t([ft({attribute:"send-button-label"})],PQ.prototype,"sendButtonLabel",void 0),t([ft],PQ.prototype,"value",void 0),t([ft({attribute:"tabindex",converter:ut})],PQ.prototype,"tabIndex",void 0),t([ft({attribute:"maxlength",converter:ut})],PQ.prototype,"maxLength",void 0),t([C],PQ.prototype,"textArea",void 0),t([C],PQ.prototype,"disableSendButton",void 0)
15888
15889
  const zQ=PQ.compose({baseName:"chat-input",template:BQ,styles:LQ,shadowOptions:{delegatesFocus:!0}})
15889
15890
  $i.getOrCreate().withPrefix("spright").register(zQ())
15890
15891
  const VQ={system:void 0,outbound:"outbound",inbound:"inbound"},HQ=$t`