@ni/spright-components 4.1.14 → 4.1.15
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.
|
@@ -5287,7 +5287,7 @@ return t.eat(")")||t.err("Missing closing paren"),e}if(!/\W/.test(t.next)){let e
|
|
|
5287
5287
|
if(i)return[i]
|
|
5288
5288
|
let s=[]
|
|
5289
5289
|
for(let t in n){let i=n[t]
|
|
5290
|
-
i.
|
|
5290
|
+
i.isInGroup(e)&&s.push(i)}0==s.length&&t.err("No node type or group '"+e+"' found")
|
|
5291
5291
|
return s}(t,t.next).map((e=>(null==t.inline?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e})))
|
|
5292
5292
|
return t.pos++,1==e.length?e[0]:{type:"choice",exprs:e}}t.err("Unexpected token '"+t.next+"'")}(t)
|
|
5293
5293
|
for(;;)if(t.eat("+"))e={type:"plus",expr:e}
|
|
@@ -5313,7 +5313,7 @@ s=e.default}n[i]=s}return n}function Uy(t,e,n,i){for(let i in e)if(!(i in t))thr
|
|
|
5313
5313
|
for(let n in t){let i=t[n]
|
|
5314
5314
|
i.validate&&i.validate(e[n])}}function qy(t,e){let n=Object.create(null)
|
|
5315
5315
|
if(e)for(let i in e)n[i]=new Wy(t,i,e[i])
|
|
5316
|
-
return n}let jy=class t{constructor(t,e,n){this.name=t,this.schema=e,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=qy(t,n.attrs),this.defaultAttrs=Vy(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==t),this.isText="text"==t}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Ty.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0
|
|
5316
|
+
return n}let jy=class t{constructor(t,e,n){this.name=t,this.schema=e,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=qy(t,n.attrs),this.defaultAttrs=Vy(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==t),this.isText="text"==t}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Ty.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(t){return this.groups.indexOf(t)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0
|
|
5317
5317
|
return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:Hy(this.attrs,t)}create(t=null,e,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes")
|
|
5318
5318
|
return new Dy(this,this.computeAttrs(t),oy.from(e),cy.setFrom(n))}createChecked(t=null,e,n){return e=oy.from(e),this.checkContent(e),new Dy(this,this.computeAttrs(t),e,cy.setFrom(n))}createAndFill(t=null,e,n){if(t=this.computeAttrs(t),(e=oy.from(e)).size){let t=this.contentMatch.fillBefore(e)
|
|
5319
5319
|
if(!t)return null
|
|
@@ -5414,7 +5414,7 @@ if(o&&o.isLeaf)this.findInside(t)
|
|
|
5414
5414
|
else if(i)this.addElement(t,n,i)
|
|
5415
5415
|
else if(e.getContent)this.findInside(t),e.getContent(t,this.parser.schema).forEach((t=>this.insertNode(t,n)))
|
|
5416
5416
|
else{let i=t
|
|
5417
|
-
"string"==typeof e.contentElement?i=t.querySelector(e.contentElement):"function"==typeof e.contentElement?i=e.contentElement(t):e.contentElement&&(i=e.contentElement),this.findAround(t,i,!0),this.addAll(i,n)}s&&this.sync(r)&&this.open--}addAll(t,e,n,i){let s=n||0
|
|
5417
|
+
"string"==typeof e.contentElement?i=t.querySelector(e.contentElement):"function"==typeof e.contentElement?i=e.contentElement(t):e.contentElement&&(i=e.contentElement),this.findAround(t,i,!0),this.addAll(i,n),this.findAround(t,i,!1)}s&&this.sync(r)&&this.open--}addAll(t,e,n,i){let s=n||0
|
|
5418
5418
|
for(let o=n?t.childNodes[n]:t.firstChild,r=null==i?null:t.childNodes[i];o!=r;o=o.nextSibling,++s)this.findAtPoint(t,s),this.addDOM(o,e)
|
|
5419
5419
|
this.findAtPoint(t,s)}findPlace(t,e){let n,i
|
|
5420
5420
|
for(let e=this.open;e>=0;e--){let s=this.nodes[e],o=s.findWrapping(t)
|
|
@@ -5448,7 +5448,7 @@ let e=t.split("/"),n=this.options.context,i=!(this.isOpen||n&&n.parent.type!=thi
|
|
|
5448
5448
|
if(""==a){if(t==e.length-1||0==t)continue
|
|
5449
5449
|
for(;r>=s;r--)if(o(t-1,r))return!0
|
|
5450
5450
|
return!1}{let t=r>0||0==r&&i?this.nodes[r].type:n&&r>=s?n.node(r-s).type:null
|
|
5451
|
-
if(!t||t.name!=a
|
|
5451
|
+
if(!t||t.name!=a&&!t.isInGroup(a))return!1
|
|
5452
5452
|
r--}}return!0}
|
|
5453
5453
|
return o(e.length-1,this.open)}textblockFromContext(){let t=this.options.context
|
|
5454
5454
|
if(t)for(let e=t.depth;e>=0;e--){let n=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType
|
|
@@ -6946,7 +6946,7 @@ return R_(i,{from:r,to:a},{...void 0!==this.options.blockSeparator?{blockSeparat
|
|
|
6946
6946
|
function L_(t,e,n={strict:!0}){const i=Object.keys(e)
|
|
6947
6947
|
return!i.length||i.every((i=>n.strict?e[i]===t[i]:x_(e[i])?e[i].test(t[i]):e[i]===t[i]))}function B_(t,e,n={}){return t.find((t=>t.type===e&&L_(t.attrs,n)))}function P_(t,e,n={}){return!!B_(t,e,n)}function z_(t,e,n={}){if(!t||!e)return
|
|
6948
6948
|
let i=t.parent.childAfter(t.parentOffset)
|
|
6949
|
-
if(
|
|
6949
|
+
if(i.node&&i.node.marks.some((t=>t.type===e))||(i=t.parent.childBefore(t.parentOffset)),!i.node||!i.node.marks.some((t=>t.type===e)))return
|
|
6950
6950
|
const s=B_([...i.node.marks],e,n)
|
|
6951
6951
|
if(!s)return
|
|
6952
6952
|
let o=i.index,r=t.start()+i.offset,a=o+1,l=r+i.node.nodeSize
|
|
@@ -7063,8 +7063,8 @@ if(o&&null===t&&!H_(n.state.selection))return r(),!0
|
|
|
7063
7063
|
const a=q_(s.doc,t)||n.state.selection,l=n.state.selection.eq(a)
|
|
7064
7064
|
return o&&(l||s.setSelection(a),l&&s.storedMarks&&s.setStoredMarks(s.storedMarks),r()),!0},forEach:(t,e)=>n=>t.every(((t,i)=>e(t,{...n,index:i}))),insertContent:(t,e)=>({tr:n,commands:i})=>i.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),insertContentAt:(t,e,n)=>({tr:i,dispatch:s,editor:o})=>{var r
|
|
7065
7065
|
if(s){let s
|
|
7066
|
-
n={parseOptions:
|
|
7067
|
-
try{s=Z_(e,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:null!==(r=n.errorOnInvalidContent)&&void 0!==r?r:o.options.enableContentCheck})}catch(t){return o.emit("contentError",{editor:o,error:t,disableCollaboration:()=>{
|
|
7066
|
+
n={parseOptions:o.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n}
|
|
7067
|
+
try{s=Z_(e,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:null!==(r=n.errorOnInvalidContent)&&void 0!==r?r:o.options.enableContentCheck})}catch(t){return o.emit("contentError",{editor:o,error:t,disableCollaboration:()=>{o.storage.collaboration&&(o.storage.collaboration.isDisabled=!0)}}),!1}let{from:a,to:l}="number"==typeof t?{from:t,to:t}:{from:t.from,to:t.to},c=!0,d=!0
|
|
7068
7068
|
if(("type"in s?[s]:s).forEach((t=>{t.check(),c=!!c&&(t.isText&&0===t.marks.length),d=!!d&&t.isBlock})),a===l&&d){const{parent:t}=i.doc.resolve(a)
|
|
7069
7069
|
t.isTextblock&&!t.type.spec.code&&!t.childCount&&(a-=1,l+=1)}let h
|
|
7070
7070
|
c?(h=Array.isArray(e)?e.map((t=>t.text||"")).join(""):"object"==typeof e&&e&&e.text?e.text:e,i.insertText(h,a,l)):(h=s,i.replaceWith(a,l,h)),n.updateSelection&&function(t,e,n){const i=t.steps.length-1
|
|
@@ -7240,10 +7240,10 @@ const t=this.resolvedPos.start(this.resolvedPos.depth-1),e=this.resolvedPos.doc.
|
|
|
7240
7240
|
return new wI(e,this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2))
|
|
7241
7241
|
return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new wI(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1))
|
|
7242
7242
|
return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new wI(t,this.editor)}get children(){const t=[]
|
|
7243
|
-
return this.node.content.forEach(((e,n)=>{const i=e.isBlock&&!e.isTextblock,s=this.pos+n+1,
|
|
7244
|
-
if(!i&&
|
|
7245
|
-
const
|
|
7246
|
-
i&&(
|
|
7243
|
+
return this.node.content.forEach(((e,n)=>{const i=e.isBlock&&!e.isTextblock,s=e.isAtom&&!e.isText,o=this.pos+n+(s?0:1),r=this.resolvedPos.doc.resolve(o)
|
|
7244
|
+
if(!i&&r.depth<=this.depth)return
|
|
7245
|
+
const a=new wI(r,this.editor,i,i?e:null)
|
|
7246
|
+
i&&(a.actualDepth=this.depth+1),t.push(new wI(r,this.editor,i,i?e:null))})),t}get firstChild(){return this.children[0]||null}get lastChild(){const t=this.children
|
|
7247
7247
|
return t[t.length-1]||null}closest(t,e={}){let n=null,i=this.parent
|
|
7248
7248
|
for(;i&&!n;){if(i.node.type.name===t)if(Object.keys(e).length>0){const t=i.node.attrs,n=Object.keys(e)
|
|
7249
7249
|
for(let i=0;i<n.length;i+=1){const s=n[i]
|
|
@@ -7251,19 +7251,23 @@ if(t[s]!==e[s])break}}else n=i
|
|
|
7251
7251
|
i=i.parent}return n}querySelector(t,e={}){return this.querySelectorAll(t,e,!0)[0]||null}querySelectorAll(t,e={},n=!1){let i=[]
|
|
7252
7252
|
if(!this.children||0===this.children.length)return i
|
|
7253
7253
|
const s=Object.keys(e)
|
|
7254
|
-
return this.children.forEach((o=>{if(!(n&&i.length>0)){if(o.node.type.name===t){s.every((t=>e[t]===o.node.attrs[t]))&&i.push(o)}n&&i.length>0||(i=i.concat(o.querySelectorAll(t,e,n)))}})),i}setAttribute(t){const
|
|
7255
|
-
|
|
7254
|
+
return this.children.forEach((o=>{if(!(n&&i.length>0)){if(o.node.type.name===t){s.every((t=>e[t]===o.node.attrs[t]))&&i.push(o)}n&&i.length>0||(i=i.concat(o.querySelectorAll(t,e,n)))}})),i}setAttribute(t){const{tr:e}=this.editor.state
|
|
7255
|
+
e.setNodeMarkup(this.from,void 0,{...this.node.attrs,...t}),this.editor.view.dispatch(e)}}class xI extends a_{constructor(t={}){super(),this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:t})=>{throw t},onPaste:()=>null,onDrop:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",(({event:t,slice:e,moved:n})=>this.options.onDrop(t,e,n))),this.on("paste",(({event:t,slice:e})=>this.options.onPaste(t,e))),window.setTimeout((()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)}),0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=function(t,e,n){const i=document.querySelector("style[data-tiptap-style]")
|
|
7256
7256
|
if(null!==i)return i
|
|
7257
7257
|
const s=document.createElement("style")
|
|
7258
7258
|
return e&&s.setAttribute("nonce",e),s.setAttribute("data-tiptap-style",""),s.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(s),s}('.ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: "liga" 0; /* the above doesn\'t seem to work in Edge */\n}\n\n.ProseMirror [contenteditable="false"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable="false"] [contenteditable="true"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n display: inline !important;\n border: none !important;\n margin: 0 !important;\n width: 0 !important;\n height: 0 !important;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n margin: 0;\n}\n\n.ProseMirror-gapcursor:after {\n content: "";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}\n\n.tippy-box[data-animation=fade][data-state=hidden] {\n opacity: 0\n}',this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},this.view&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,e=!0){this.setOptions({editable:t}),e&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(t,e){const n=f_(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],i=this.state.reconfigure({plugins:n})
|
|
7259
7259
|
return this.view.updateState(i),i}unregisterPlugin(t){if(this.isDestroyed)return
|
|
7260
|
-
const e=
|
|
7261
|
-
|
|
7260
|
+
const e=this.state.plugins
|
|
7261
|
+
let n=e
|
|
7262
|
+
if([].concat(t).forEach((t=>{const i="string"==typeof t?`${t}$`:t.key
|
|
7263
|
+
n=e.filter((t=>!t.key.startsWith(i)))})),e.length===n.length)return
|
|
7264
|
+
const i=this.state.reconfigure({plugins:n})
|
|
7265
|
+
return this.view.updateState(i),i}createExtensionManager(){var t,e
|
|
7262
7266
|
const n=[...this.options.enableCoreExtensions?[mI,N_.configure({blockSeparator:null===(e=null===(t=this.options.coreExtensionOptions)||void 0===t?void 0:t.clipboardTextSerializer)||void 0===e?void 0:e.blockSeparator}),pI,gI,vI,yI,fI,bI].filter((t=>"object"!=typeof this.options.enableCoreExtensions||!1!==this.options.enableCoreExtensions[t.name])):[],...this.options.extensions].filter((t=>["extension","node","mark"].includes(null==t?void 0:t.type)))
|
|
7263
7267
|
this.extensionManager=new T_(n,this)}createCommandManager(){this.commandManager=new r_({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){let t
|
|
7264
7268
|
try{t=Q_(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error&&["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(e.message)))throw e
|
|
7265
|
-
this.emit("contentError",{editor:this,error:e,disableCollaboration:()=>{this.options.extensions=this.options.extensions.filter((t=>"collaboration"!==t.name)),this.createExtensionManager()}}),t=Q_(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const e=q_(t,this.options.autofocus)
|
|
7266
|
-
this.view=new DS(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:mx.create({doc:t,selection:e||void 0})})
|
|
7269
|
+
this.emit("contentError",{editor:this,error:e,disableCollaboration:()=>{this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter((t=>"collaboration"!==t.name)),this.createExtensionManager()}}),t=Q_(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const e=q_(t,this.options.autofocus)
|
|
7270
|
+
this.view=new DS(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:mx.create({doc:t,selection:e||void 0})}),this.view.dom.setAttribute("role","textbox"),this.view.dom.getAttribute("aria-label")||this.view.dom.setAttribute("aria-label","Rich-Text Editor")
|
|
7267
7271
|
const n=this.state.reconfigure({plugins:this.extensionManager.plugins})
|
|
7268
7272
|
this.view.updateState(n),this.createNodeViews(),this.prependClass()
|
|
7269
7273
|
this.view.dom.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1
|
|
@@ -8709,7 +8713,7 @@ return this.duplicateMentionConfiguration=e.length!==new Set(e).size,!this.dupli
|
|
|
8709
8713
|
await Promise.all(e)}class uE extends We{constructor(){super(...arguments),this.mentionInternalsNotifiers=[],this.childItems=[],this.richTextUpdateTracker=new cE(this),this.richTextValidator=new dE}get validity(){return this.richTextValidator.getValidity()}checkValidity(){return this.richTextValidator.isValid()}handleChange(t,e){t instanceof nE&&"string"==typeof e&&this.richTextUpdateTracker.trackMentionInternalsPropertyChanged(e)}createConfig(){this.validate(),this.richTextValidator.isValid()?(this.richTextUpdateTracker.updateMappingConfigs||this.richTextUpdateTracker.updatePattern)&&(this.configuration=new oE(this.mentionElements)):this.configuration=void 0}validate(){this.richTextValidator.validate(this.mentionElements)}childItemsChanged(t,e){void 0!==t&&this.updateMentionElementsFromChildItems()}async updateMentionElementsFromChildItems(){await hE(this.childItems),this.mentionElements=this.childItems.filter((t=>t instanceof iE)),this.observeMentionInternals(),this.richTextUpdateTracker.trackMentionElementsInstancesChanged()}observeMentionInternals(){this.removeMentionInternalsObservers()
|
|
8710
8714
|
for(const t of this.mentionElements){const e=x.getNotifier(t.mentionInternals)
|
|
8711
8715
|
e.subscribe(this),this.mentionInternalsNotifiers.push(e)}}removeMentionInternalsObservers(){this.mentionInternalsNotifiers.forEach((t=>{t.unsubscribe(this)})),this.mentionInternalsNotifiers=[]}}t([C],uE.prototype,"childItems",void 0),t([C],uE.prototype,"configuration",void 0)
|
|
8712
|
-
const pE=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,fE=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,mE=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,gE=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,vE=$_.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML
|
|
8716
|
+
const pE=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,fE=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,mE=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,gE=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,vE=$_.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>"normal"!==t.style.fontWeight&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",u_(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[CI({find:pE,type:this.type}),CI({find:mE,type:this.type})]},addPasteRules(){return[_I({find:fE,type:this.type}),_I({find:gE,type:this.type})]}}),bE=SI.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",u_(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),yE=$_.create({name:"textStyle",priority:101,addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:t=>!!t.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:t}){return["span",u_(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=tI(t,this.type)
|
|
8713
8717
|
return!!Object.entries(n).some((([,t])=>!!t))||e.unsetMark(this.name)}}}}),wE=/^\s*([-+*])\s$/,xE=SI.create({name:"bulletList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:t}){return["ul",u_(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(bE.name,this.editor.getAttributes(yE.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=kI({find:wE,type:this.type})
|
|
8714
8718
|
return(this.options.keepMarks||this.options.keepAttributes)&&(t=kI({find:wE,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(yE.name),editor:this.editor})),[t]}}),CE=SI.create({name:"doc",topNode:!0,content:"block+"})
|
|
8715
8719
|
var kE=200,SE=function(){}
|
|
@@ -8791,7 +8795,7 @@ if(i){let o=function(t,e,n){let i=FE(e),s=NE.get(e).spec.config,o=(n?t.undone:t.
|
|
|
8791
8795
|
if(!o)return null
|
|
8792
8796
|
let r=o.selection.resolve(o.transform.doc),a=(n?t.done:t.undone).addTransform(o.transform,e.selection.getBookmark(),s,i),l=new DE(n?a:o.remaining,n?o.remaining:a,null,0,-1)
|
|
8793
8797
|
return o.transform.setSelection(r).setMeta(NE,{redo:n,historyState:l})}(s,n,t)
|
|
8794
|
-
o&&i(e?o.scrollIntoView():o)}return!0}}const zE=PE(!1,!0),VE=PE(!0,!0),HE=O_.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:t,dispatch:e})=>zE(t,e),redo:()=>({state:t,dispatch:e})=>VE(t,e)}),addProseMirrorPlugins(){return[BE(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),UE=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,qE=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,jE=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,WE=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,GE=$_.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML
|
|
8798
|
+
o&&i(e?o.scrollIntoView():o)}return!0}}const zE=PE(!1,!0),VE=PE(!0,!0),HE=O_.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:t,dispatch:e})=>zE(t,e),redo:()=>({state:t,dispatch:e})=>VE(t,e)}),addProseMirrorPlugins(){return[BE(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),UE=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,qE=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,jE=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,WE=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,GE=$_.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>"normal"!==t.style.fontStyle&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",u_(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[CI({find:UE,type:this.type}),CI({find:jE,type:this.type})]},addPasteRules(){return[_I({find:qE,type:this.type}),_I({find:WE,type:this.type})]}}),ZE="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",KE="ελ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",YE=(t,e)=>{for(const n in e)t[n]=e[n]
|
|
8795
8799
|
return t},XE="numeric",JE="ascii",QE="alpha",tA="asciinumeric",eA="alphanumeric",nA="domain",iA="emoji",sA="scheme",oA="slashscheme",rA="whitespace"
|
|
8796
8800
|
function aA(t,e){return t in e||(e[t]=[]),e[t]}function lA(t,e,n){e[XE]&&(e[tA]=!0,e[eA]=!0),e[JE]&&(e[tA]=!0,e[QE]=!0),e[tA]&&(e[eA]=!0),e[QE]&&(e[eA]=!0),e[eA]&&(e[nA]=!0),e[iA]&&(e[nA]=!0)
|
|
8797
8801
|
for(const i in e){const e=aA(i,n)
|
|
@@ -8992,7 +8996,7 @@ return g.active||(g.decorationId=null,g.range={from:0,to:0},g.query=null,g.text=
|
|
|
8992
8996
|
const{active:i,range:s}=m.getState(t.state)
|
|
8993
8997
|
return i&&(null===(n=null==f?void 0:f.onKeyDown)||void 0===n?void 0:n.call(f,{view:t,event:e,range:s}))||!1},decorations(t){const{active:e,range:n,decorationId:i}=m.getState(t)
|
|
8994
8998
|
return e?sS.create(t.doc,[eS.inline(n.from,n.to,{nodeName:r,class:a,"data-decoration-id":i})]):null}}})
|
|
8995
|
-
return m}const KT=new wx("mention"),YT=SI.create({name:"mention",addOptions(){return{HTMLAttributes:{},renderText({options:t,node:e}){var n
|
|
8999
|
+
return m}const KT=new wx("mention"),YT=SI.create({name:"mention",priority:101,addOptions(){return{HTMLAttributes:{},renderText({options:t,node:e}){var n
|
|
8996
9000
|
return`${t.suggestion.char}${null!==(n=e.attrs.label)&&void 0!==n?n:e.attrs.id}`},deleteTriggerWithBackspace:!1,renderHTML({options:t,node:e}){var n
|
|
8997
9001
|
return["span",u_(this.HTMLAttributes,t.HTMLAttributes),`${t.suggestion.char}${null!==(n=e.attrs.label)&&void 0!==n?n:e.attrs.id}`]},suggestion:{char:"@",pluginKey:KT,command:({editor:t,range:e,props:n})=>{var i,s,o
|
|
8998
9002
|
const r=t.view.state.selection.$to.nodeAfter;(null===(i=null==r?void 0:r.text)||void 0===i?void 0:i.startsWith(" "))&&(e.to+=1),t.chain().focus().insertContentAt(e,[{type:this.name,attrs:n},{type:"text",text:" "}]).run(),null===(o=null===(s=t.view.dom.ownerDocument.defaultView)||void 0===s?void 0:s.getSelection())||void 0===o||o.collapseToEnd()},allow:({state:t,range:e})=>{const n=t.doc.resolve(e.from),i=t.schema.nodes[this.name]
|