@sovann72-dev/lynqify-ui 1.0.0 → 1.0.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.
Files changed (48) hide show
  1. package/dist/components/NoteEditor/BatchImageGalleryNodeView.d.ts +19 -0
  2. package/dist/components/RichTextEditor/Extension/Indent/backspace.indent.handlers.d.ts +18 -0
  3. package/dist/components/RichTextEditor/Extension/Indent/indent.extension.d.ts +26 -0
  4. package/dist/components/RichTextEditor/Extension/Indent/indent.handlers.d.ts +16 -0
  5. package/{src/components/RichTextEditor/Extension/Indent/indent.types.ts → dist/components/RichTextEditor/Extension/Indent/indent.types.d.ts} +10 -35
  6. package/dist/components/RichTextEditor/Extension/Indent/indent.utils.d.ts +8 -0
  7. package/dist/components/RichTextEditor/Extension/Indent/outdent.handlers.d.ts +6 -0
  8. package/dist/components/RichTextEditor/Extension/Indent/shifttab.indent.handlers.d.ts +18 -0
  9. package/dist/components/RichTextEditor/Extension/Indent/tab.indent.handlers.d.ts +21 -0
  10. package/dist/components/RichTextEditor/Extension/List/custom-list-item.extension.d.ts +17 -0
  11. package/dist/components/RichTextEditor/Extension/List/dynamic-bullet-styling.extension.d.ts +2 -0
  12. package/dist/components/RichTextEditor/Extension/batch-segment-images.extension.d.ts +19 -0
  13. package/dist/components/RichTextEditor/Extension/batch-segment-images.types.d.ts +33 -0
  14. package/dist/components/RichTextEditor/Extension/custom-image.extension.d.ts +4 -0
  15. package/dist/components/RichTextEditor/Extension/custom-link.extension.d.ts +3 -0
  16. package/dist/components/RichTextEditor/Extension/custom-mention.extension.d.ts +3 -0
  17. package/dist/components/RichTextEditor/Extension/custom-paragraph.extension.d.ts +6 -0
  18. package/dist/components/RichTextEditor/Extension/extensions.d.ts +4 -0
  19. package/dist/components/RichTextEditor/Extension/file-filtering.extension.d.ts +1 -0
  20. package/dist/components/RichTextEditor/Extension/list-indent-integration.extension.d.ts +2 -0
  21. package/dist/components/RichTextEditor/Extension/mentionstorage.extension.d.ts +9 -0
  22. package/dist/components/RichTextEditor/Extension/tiptap-extension-fontsize.d.ts +21 -0
  23. package/dist/components/RichTextEditor/Extension/tiptap-extension-lineheight.d.ts +21 -0
  24. package/{src/index.ts → dist/index.d.ts} +5 -17
  25. package/dist/lynqify-ui.js +3264 -0
  26. package/dist/lynqify-ui.umd.cjs +30 -0
  27. package/package.json +60 -31
  28. package/src/components/RichTextEditor/Extension/Indent/backspace.indent.handlers.ts +0 -77
  29. package/src/components/RichTextEditor/Extension/Indent/indent.extension.ts +0 -285
  30. package/src/components/RichTextEditor/Extension/Indent/indent.handlers.ts +0 -121
  31. package/src/components/RichTextEditor/Extension/Indent/indent.utils.ts +0 -8
  32. package/src/components/RichTextEditor/Extension/Indent/outdent.handlers.ts +0 -71
  33. package/src/components/RichTextEditor/Extension/Indent/shifttab.indent.handlers.ts +0 -133
  34. package/src/components/RichTextEditor/Extension/Indent/tab.indent.handlers.ts +0 -103
  35. package/src/components/RichTextEditor/Extension/List/custom-list-item.extension.ts +0 -107
  36. package/src/components/RichTextEditor/Extension/List/dynamic-bullet-styling.extension.ts +0 -40
  37. package/src/components/RichTextEditor/Extension/batch-segment-images.extension.ts +0 -486
  38. package/src/components/RichTextEditor/Extension/batch-segment-images.types.ts +0 -35
  39. package/src/components/RichTextEditor/Extension/custom-image.extension.ts +0 -18
  40. package/src/components/RichTextEditor/Extension/custom-link.extension.ts +0 -58
  41. package/src/components/RichTextEditor/Extension/custom-mention.extension.ts +0 -29
  42. package/src/components/RichTextEditor/Extension/custom-paragraph.extension.ts +0 -46
  43. package/src/components/RichTextEditor/Extension/extensions.ts +0 -118
  44. package/src/components/RichTextEditor/Extension/file-filtering.extension.ts +0 -0
  45. package/src/components/RichTextEditor/Extension/list-indent-integration.extension.ts +0 -125
  46. package/src/components/RichTextEditor/Extension/mentionstorage.extension.ts +0 -10
  47. package/src/components/RichTextEditor/Extension/tiptap-extension-fontsize.ts +0 -73
  48. package/src/components/RichTextEditor/Extension/tiptap-extension-lineheight.ts +0 -73
@@ -0,0 +1,30 @@
1
+ (function(h,Y){typeof exports=="object"&&typeof module<"u"?Y(exports,require("@tiptap/extension-bold"),require("@tiptap/extension-color"),require("@tiptap/extension-document"),require("@tiptap/extension-file-handler"),require("@tiptap/extension-hard-break"),require("@tiptap/extension-heading"),require("@tiptap/extension-highlight"),require("@tiptap/extension-image"),require("@tiptap/extension-italic"),require("@tiptap/extension-link"),require("@tiptap/extension-list"),require("@tiptap/extension-mention"),require("@tiptap/extension-paragraph"),require("@tiptap/extension-table"),require("@tiptap/extension-text"),require("@tiptap/extension-text-align"),require("@tiptap/extension-text-style"),require("@tiptap/extension-underline"),require("@tiptap/extensions"),require("@tiptap/react"),require("@tiptap/core"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","@tiptap/extension-bold","@tiptap/extension-color","@tiptap/extension-document","@tiptap/extension-file-handler","@tiptap/extension-hard-break","@tiptap/extension-heading","@tiptap/extension-highlight","@tiptap/extension-image","@tiptap/extension-italic","@tiptap/extension-link","@tiptap/extension-list","@tiptap/extension-mention","@tiptap/extension-paragraph","@tiptap/extension-table","@tiptap/extension-text","@tiptap/extension-text-align","@tiptap/extension-text-style","@tiptap/extension-underline","@tiptap/extensions","@tiptap/react","@tiptap/core","react","react-dom"],Y):(h=typeof globalThis<"u"?globalThis:h||self,Y(h.LynqifyUI={},h.Bold,h.Color,h.Document,h.FileHandler,h.HardBreak,h.Heading,h.Highlight,h.Image,h.Italic,h.Link,h.extensionList,h.Mention,h.Paragraph,h.extensionTable,h.Text,h.TextAlign,h.extensionTextStyle,h.Underline,h.extensions,h.TipTapReact,h.TipTapCore,h.React,h.ReactDOM))})(this,(function(h,Y,Ne,Ae,at,Ce,lt,ut,ct,Le,dt,P,ft,Me,W,Pe,De,ze,_e,K,hr,te,Je,pr){"use strict";function mr(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const Fe=mr(Je),ht=Me.extend({addNodeView(){return({node:n})=>{const e=n.attrs.indent||0,t=document.createElement("p");return t.setAttribute("data-indent",String(e)),e>0&&(t.style.paddingLeft=`${e*20}px`),{dom:t,contentDOM:t}}},addAttributes(){var n;return{...(n=this.parent)==null?void 0:n.call(this),indent:{default:0,parseHTML:e=>parseInt(e.getAttribute("data-indent")||"0"),renderHTML:e=>e.indent?{"data-indent":e.indent,style:`--indent-level: ${e.indent};`}:{}}}}});function pt(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let i=n.child(r),s=e.child(r);if(i==s){t+=i.nodeSize;continue}if(!i.sameMarkup(s))return t;if(i.isText&&i.text!=s.text){for(let l=0;i.text[l]==s.text[l];l++)t++;return t}if(i.content.size||s.content.size){let l=pt(i.content,s.content,t+1);if(l!=null)return l}t+=i.nodeSize}}function mt(n,e,t,r){for(let i=n.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:t,b:r};let l=n.child(--i),a=e.child(--s),u=l.nodeSize;if(l==a){t-=u,r-=u;continue}if(!l.sameMarkup(a))return{a:t,b:r};if(l.isText&&l.text!=a.text){let f=0,d=Math.min(l.text.length,a.text.length);for(;f<d&&l.text[l.text.length-f-1]==a.text[a.text.length-f-1];)f++,t--,r--;return{a:t,b:r}}if(l.content.size||a.content.size){let f=mt(l.content,a.content,t-1,r-1);if(f)return f}t-=u,r-=u}}class k{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,i=0,s){for(let l=0,a=0;a<t;l++){let u=this.content[l],f=a+u.nodeSize;if(f>e&&r(u,i+a,s||null,l)!==!1&&u.content.size){let d=a+1;u.nodesBetween(Math.max(0,e-d),Math.min(u.content.size,t-d),r,i+d)}a=f}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,i){let s="",l=!0;return this.nodesBetween(e,t,(a,u)=>{let f=a.isText?a.text.slice(Math.max(e,u)-u,t-u):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&f||a.isTextblock)&&r&&(l?l=!1:s+=r),s+=f},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,i=this.content.slice(),s=0;for(t.isText&&t.sameMarkup(r)&&(i[i.length-1]=t.withText(t.text+r.text),s=1);s<e.content.length;s++)i.push(e.content[s]);return new k(i,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],i=0;if(t>e)for(let s=0,l=0;l<t;s++){let a=this.content[s],u=l+a.nodeSize;u>e&&((l<e||u>t)&&(a.isText?a=a.cut(Math.max(0,e-l),Math.min(a.text.length,t-l)):a=a.cut(Math.max(0,e-l-1),Math.min(a.content.size,t-l-1))),r.push(a),i+=a.nodeSize),l=u}return new k(r,i)}cutByIndex(e,t){return e==t?k.empty:e==0&&t==this.content.length?this:new k(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let i=this.content.slice(),s=this.size+t.nodeSize-r.nodeSize;return i[e]=t,new k(i,s)}addToStart(e){return new k([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new k(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let i=this.content[t];e(i,r,t),r+=i.nodeSize}}findDiffStart(e,t=0){return pt(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return mt(this,e,t,r)}findIndex(e){if(e==0)return ve(0,e);if(e==this.size)return ve(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,r=0;;t++){let i=this.child(t),s=r+i.nodeSize;if(s>=e)return s==e?ve(t+1,s):ve(t,r);r=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return k.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new k(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return k.empty;let t,r=0;for(let i=0;i<e.length;i++){let s=e[i];r+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(t||(t=e.slice(0,i)),t[t.length-1]=s.withText(t[t.length-1].text+s.text)):t&&t.push(s)}return new k(t||e,r)}static from(e){if(!e)return k.empty;if(e instanceof k)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new k([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}k.empty=new k([],0);const He={index:0,offset:0};function ve(n,e){return He.index=n,He.offset=e,He}class gr extends Error{}class E{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=yt(this.content,e+this.openStart,t);return r&&new E(r,this.openStart,this.openEnd)}removeBetween(e,t){return new E(gt(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return E.empty;let r=t.openStart||0,i=t.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new E(k.fromJSON(e,t.content),r,i)}static maxOpen(e,t=!0){let r=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=e.lastChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.lastChild)i++;return new E(e,r,i)}}E.empty=new E(k.empty,0,0);function gt(n,e,t){let{index:r,offset:i}=n.findIndex(e),s=n.maybeChild(r),{index:l,offset:a}=n.findIndex(t);if(i==e||s.isText){if(a!=t&&!n.child(l).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=l)throw new RangeError("Removing non-flat range");return n.replaceChild(r,s.copy(gt(s.content,e-i-1,t-i-1)))}function yt(n,e,t,r){let{index:i,offset:s}=n.findIndex(e),l=n.maybeChild(i);if(s==e||l.isText)return r&&!r.canReplace(i,i,t)?null:n.cut(0,e).append(t).append(n.cut(e));let a=yt(l.content,e-s-1,t,l);return a&&n.replaceChild(i,l.copy(a))}class vt{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const It=65535,bt=Math.pow(2,16);function yr(n,e){return n+e*bt}function St(n){return n&It}function vr(n){return(n-(n&It))/bt}const wt=1,Tt=2,Ie=4,xt=8;class Et{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&xt)>0}get deletedBefore(){return(this.delInfo&(wt|Ie))>0}get deletedAfter(){return(this.delInfo&(Tt|Ie))>0}get deletedAcross(){return(this.delInfo&Ie)>0}}class B{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&B.empty)return B.empty}recover(e){let t=0,r=St(e);if(!this.inverted)for(let i=0;i<r;i++)t+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+t+vr(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let i=0,s=this.inverted?2:1,l=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let u=this.ranges[a]-(this.inverted?i:0);if(u>e)break;let f=this.ranges[a+s],d=this.ranges[a+l],m=u+f;if(e<=m){let v=f?e==u?-1:e==m?1:t:t,S=u+i+(v<0?0:d);if(r)return S;let g=e==(t<0?u:m)?null:yr(a/3,e-u),T=e==u?Tt:e==m?wt:Ie;return(t<0?e!=u:e!=m)&&(T|=xt),new Et(S,T,g)}i+=d-f}return r?e+i:new Et(e+i,0,null)}touches(e,t){let r=0,i=St(t),s=this.inverted?2:1,l=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let u=this.ranges[a]-(this.inverted?r:0);if(u>e)break;let f=this.ranges[a+s],d=u+f;if(e<=d&&a==i*3)return!0;r+=this.ranges[a+l]-f}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,s=0;i<this.ranges.length;i+=3){let l=this.ranges[i],a=l-(this.inverted?s:0),u=l+(this.inverted?0:s),f=this.ranges[i+t],d=this.ranges[i+r];e(a,a+f,u,u+d),s+=d-f}}invert(){return new B(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?B.empty:new B(e<0?[0,-e,0]:[0,0,e])}}B.empty=new B([]);const Be=Object.create(null);class D{getMap(){return B.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Be[t.stepType];if(!r)throw new RangeError(`No step type ${t.stepType} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in Be)throw new RangeError("Duplicate use of step JSON ID "+e);return Be[e]=t,t.prototype.jsonID=e,t}}class N{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new N(e,null)}static fail(e){return new N(null,e)}static fromReplace(e,t,r,i){try{return N.ok(e.replace(t,r,i))}catch(s){if(s instanceof gr)return N.fail(s.message);throw s}}}function je(n,e,t){let r=[];for(let i=0;i<n.childCount;i++){let s=n.child(i);s.content.size&&(s=s.copy(je(s.content,e,s))),s.isInline&&(s=e(s,t,i)),r.push(s)}return k.fromArray(r)}class G extends D{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),s=new E(je(t.content,(l,a)=>!l.isAtom||!a.type.allowsMarkType(this.mark.type)?l:l.mark(this.mark.addToSet(l.marks)),i),t.openStart,t.openEnd);return N.fromReplace(e,this.from,this.to,s)}invert(){return new X(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new G(t.pos,r.pos,this.mark)}merge(e){return e instanceof G&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new G(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new G(t.from,t.to,e.markFromJSON(t.mark))}}D.jsonID("addMark",G);class X extends D{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new E(je(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return N.fromReplace(e,this.from,this.to,r)}invert(){return new G(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new X(t.pos,r.pos,this.mark)}merge(e){return e instanceof X&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new X(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new X(t.from,t.to,e.markFromJSON(t.mark))}}D.jsonID("removeMark",X);class Z extends D{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return N.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return N.fromReplace(e,this.pos,this.pos+1,new E(k.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let i=0;i<t.marks.length;i++)if(!t.marks[i].isInSet(r))return new Z(this.pos,t.marks[i]);return new Z(this.pos,this.mark)}}return new ae(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Z(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Z(t.pos,e.markFromJSON(t.mark))}}D.jsonID("addNodeMark",Z);class ae extends D{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return N.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return N.fromReplace(e,this.pos,this.pos+1,new E(k.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Z(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new ae(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new ae(t.pos,e.markFromJSON(t.mark))}}D.jsonID("removeNodeMark",ae);class q extends D{constructor(e,t,r,i=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=i}apply(e){return this.structure&&qe(e,this.from,this.to)?N.fail("Structure replace would overwrite content"):N.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new B([this.from,this.to-this.from,this.slice.size])}invert(e){return new q(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.to,-1),r=this.from==this.to&&q.MAP_BIAS<0?t:e.mapResult(this.from,1);return r.deletedAcross&&t.deletedAcross?null:new q(r.pos,Math.max(r.pos,t.pos),this.slice,this.structure)}merge(e){if(!(e instanceof q)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?E.empty:new E(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new q(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?E.empty:new E(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new q(e.from,this.to,t,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new q(t.from,t.to,E.fromJSON(e,t.slice),!!t.structure)}}q.MAP_BIAS=1,D.jsonID("replace",q);class re extends D{constructor(e,t,r,i,s,l,a=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=i,this.slice=s,this.insert=l,this.structure=a}apply(e){if(this.structure&&(qe(e,this.from,this.gapFrom)||qe(e,this.gapTo,this.to)))return N.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return N.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?N.fromReplace(e,this.from,this.to,r):N.fail("Content does not fit in gap")}getMap(){return new B([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new re(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),s=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||i<t.pos||s>r.pos?null:new re(t.pos,r.pos,i,s,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new re(t.from,t.to,t.gapFrom,t.gapTo,E.fromJSON(e,t.slice),t.insert,!!t.structure)}}D.jsonID("replaceAround",re);function qe(n,e,t){let r=n.resolve(e),i=t-e,s=r.depth;for(;i>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,i--;if(i>0){let l=r.node(s).maybeChild(r.indexAfter(s));for(;i>0;){if(!l||l.isLeaf)return!0;l=l.firstChild,i--}}return!1}function Ir(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function kt(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth,i=0,s=0;;--r){let l=n.$from.node(r),a=n.$from.index(r)+i,u=n.$to.indexAfter(r)-s;if(r<n.depth&&l.canReplace(a,u,t))return r;if(r==0||l.type.spec.isolating||!Ir(l,a,u))break;a&&(i=1),u<l.childCount&&(s=1)}return null}class le extends D{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return N.fail("No node at attribute step's position");let r=Object.create(null);for(let s in t.attrs)r[s]=t.attrs[s];r[this.attr]=this.value;let i=t.type.create(r,null,t.marks);return N.fromReplace(e,this.pos,this.pos+1,new E(k.from(i),0,t.isLeaf?0:1))}getMap(){return B.empty}invert(e){return new le(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new le(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new le(t.pos,t.attr,t.value)}}D.jsonID("attr",le);class be extends D{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let i in e.attrs)t[i]=e.attrs[i];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return N.ok(r)}getMap(){return B.empty}invert(e){return new be(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new be(t.attr,t.value)}}D.jsonID("docAttr",be);let ue=class extends Error{};ue=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t},ue.prototype=Object.create(Error.prototype),ue.prototype.constructor=ue,ue.prototype.name="TransformError";const $e=Object.create(null);class L{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new br(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=E.empty){let r=t.content.lastChild,i=null;for(let a=0;a<t.openEnd;a++)i=r,r=r.lastChild;let s=e.steps.length,l=this.ranges;for(let a=0;a<l.length;a++){let{$from:u,$to:f}=l[a],d=e.mapping.slice(s);e.replaceRange(d.map(u.pos),d.map(f.pos),a?E.empty:t),a==0&&Nt(e,s,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,t){let r=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:l,$to:a}=i[s],u=e.mapping.slice(r),f=u.map(l.pos),d=u.map(a.pos);s?e.deleteRange(f,d):(e.replaceRangeWith(f,d,t),Nt(e,r,t.isInline?-1:1))}}static findFrom(e,t,r=!1){let i=e.parent.inlineContent?new z(e):ne(e.node(0),e.parent,e.pos,e.index(),t,r);if(i)return i;for(let s=e.depth-1;s>=0;s--){let l=t<0?ne(e.node(0),e.node(s),e.before(s+1),e.index(s),t,r):ne(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,t,r);if(l)return l}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new V(e.node(0))}static atStart(e){return ne(e,e,0,0,1)||new V(e)}static atEnd(e){return ne(e,e,e.content.size,e.childCount,-1)||new V(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=$e[t.type];if(!r)throw new RangeError(`No selection type ${t.type} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in $e)throw new RangeError("Duplicate use of selection JSON ID "+e);return $e[e]=t,t.prototype.jsonID=e,t}getBookmark(){return z.between(this.$anchor,this.$head).getBookmark()}}L.prototype.visible=!0;class br{constructor(e,t){this.$from=e,this.$to=t}}let Rt=!1;function Ot(n){!Rt&&!n.parent.inlineContent&&(Rt=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class z extends L{constructor(e,t=e){Ot(e),Ot(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let r=e.resolve(t.map(this.head));if(!r.parent.inlineContent)return L.near(r);let i=e.resolve(t.map(this.anchor));return new z(i.parent.inlineContent?i:r,r)}replace(e,t=E.empty){if(super.replace(e,t),t==E.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof z&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Se(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new z(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,r=t){let i=e.resolve(t);return new this(i,r==t?i:e.resolve(r))}static between(e,t,r){let i=e.pos-t.pos;if((!r||i)&&(r=i>=0?1:-1),!t.parent.inlineContent){let s=L.findFrom(t,r,!0)||L.findFrom(t,-r,!0);if(s)t=s.$head;else return L.near(t,r)}return e.parent.inlineContent||(i==0?e=t:(e=(L.findFrom(e,-r,!0)||L.findFrom(e,r,!0)).$anchor,e.pos<t.pos!=i<0&&(e=t))),new z(e,t)}}L.jsonID("text",z);class Se{constructor(e,t){this.anchor=e,this.head=t}map(e){return new Se(e.map(this.anchor),e.map(this.head))}resolve(e){return z.between(e.resolve(this.anchor),e.resolve(this.head))}}class _ extends L{constructor(e){let t=e.nodeAfter,r=e.node(0).resolve(e.pos+t.nodeSize);super(e,r),this.node=t}map(e,t){let{deleted:r,pos:i}=t.mapResult(this.anchor),s=e.resolve(i);return r?L.near(s):new _(s)}content(){return new E(k.from(this.node),0,0)}eq(e){return e instanceof _&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Ve(this.anchor)}static fromJSON(e,t){if(typeof t.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new _(e.resolve(t.anchor))}static create(e,t){return new _(e.resolve(t))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}_.prototype.visible=!1,L.jsonID("node",_);class Ve{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:r}=e.mapResult(this.anchor);return t?new Se(r,r):new Ve(r)}resolve(e){let t=e.resolve(this.anchor),r=t.nodeAfter;return r&&_.isSelectable(r)?new _(t):L.near(t)}}class V extends L{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=E.empty){if(t==E.empty){e.delete(0,e.doc.content.size);let r=L.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new V(e)}map(e){return new V(e)}eq(e){return e instanceof V}getBookmark(){return Sr}}L.jsonID("all",V);const Sr={map(){return this},resolve(n){return new V(n)}};function ne(n,e,t,r,i,s=!1){if(e.inlineContent)return z.create(n,t);for(let l=r-(i>0?0:1);i>0?l<e.childCount:l>=0;l+=i){let a=e.child(l);if(a.isAtom){if(!s&&_.isSelectable(a))return _.create(n,t-(i<0?a.nodeSize:0))}else{let u=ne(n,a,t+i,i<0?a.childCount:0,i,s);if(u)return u}t+=a.nodeSize*i}return null}function Nt(n,e,t){let r=n.steps.length-1;if(r<e)return;let i=n.steps[r];if(!(i instanceof q||i instanceof re))return;let s=n.mapping.maps[r],l;s.forEach((a,u,f,d)=>{l==null&&(l=d)}),n.setSelection(L.near(n.doc.resolve(l),t))}function At(n,e){return!e||!n?n:n.bind(e)}class we{constructor(e,t,r){this.name=e,this.init=At(t.init,r),this.apply=At(t.apply,r)}}new we("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new we("selection",{init(n,e){return n.selection||L.atStart(e.doc)},apply(n){return n.selection}}),new we("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,r){return r.selection.$cursor?n.storedMarks:null}}),new we("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}});function Ct(n,e,t){for(let r in n){let i=n[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=Ct(i,e,{})),t[r]=i}return t}class ce{constructor(e){this.spec=e,this.props={},e.props&&Ct(e.props,this,this.props),this.key=e.key?e.key.key:Lt("plugin")}getState(e){return e[this.key]}}const We=Object.create(null);function Lt(n){return n in We?n+"$"+ ++We[n]:(We[n]=0,n+"$")}class wr{constructor(e="key"){this.key=Lt(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const $=n=>n==="bulletList"||n==="orderedList",Te=n=>n==="listItem",J=n=>n==="paragraph"||n==="heading";function Ue(n,e){for(const t of n)if(t(e))return!0;return!1}function Tr(n,e){for(const t of n)if(t(e))return!0;return!1}const Mt=({state:n,view:e,$from:t,$to:r,selectionIsEmpty:i})=>{if(i)return!1;let s=0;if(n.doc.nodesBetween(t.pos,r.pos,m=>{(Te(m.type.name)||J(m.type.name))&&s++}),!(s>1))return!1;const{tr:a,doc:u}=n;let f=!1;const d=new Set;return u.nodesBetween(t.pos,r.pos,(m,v)=>{if($(m.type.name)&&(m.attrs.indent??0)>0){if(!d.has(v)){d.add(v);const S=m.attrs.indent??0;a.setNodeAttribute(v,"indent",Math.max(0,S-1)),f=!0;const g=n.doc.resolve(v),T=n.doc.resolve(v+m.nodeSize),M=new vt(g,T,g.depth),C=kt(M);C!=null&&(a.lift(M,C),f=!0)}return!1}if(J(m.type.name)&&(m.attrs.indent??0)>0){const S=m.attrs.indent??0;a.setNodeAttribute(v,"indent",Math.max(0,S-1)),f=!0}return!0}),f?(a.setMeta("addToHistory",!0),e.dispatch(a),!0):!1},xr=({editor:n,$from:e,currentNode:t})=>{const r=e.pos===e.start(),i=t.attrs.indent>0;return J(t.type.name)&&i&&r?n.commands.outdent():!1},Er=({state:n,view:e,$from:t,currentNode:r})=>{const i=r.content.size===0,s=r.attrs.indent>0;if(!(J(r.type.name)&&s&&i))return!1;const a=t.before(t.depth),u=n.tr;return u.delete(a,a+r.nodeSize),e.dispatch(u),!0},kr=({state:n,view:e,$from:t,currentNode:r})=>{const i=t.pos===t.start(),s=r.content.size===0,l=r.attrs.indent>0,a=t.before(t.depth),u=n.doc.resolve(a).nodeBefore,f=u!=null&&$(u.type.name);if(J(r.type.name)&&!l&&s&&i&&f){const m=n.tr;return m.delete(a,a+r.nodeSize),e.dispatch(m),!0}return!1},Rr=n=>{const{tr:e,state:t,dispatch:r}=n,{selection:i}=t,{$from:s,$to:l}=i;if(i.empty)return!1;let a=0;if(t.doc.nodesBetween(s.pos,l.pos,d=>{($(d.type.name)||J(d.type.name))&&a++}),a<=1)return!1;const u=new Set;let f=!1;return t.doc.nodesBetween(s.pos,l.pos,(d,m)=>{var S;return!($(d.type.name)||J(d.type.name))||u.has(m)?!0:(u.add(m),e.setNodeAttribute(m,"indent",(((S=d.attrs)==null?void 0:S.indent)??0)+1),f=!0,!1)}),f?(e.setMeta("addToHistory",!0),r==null||r(e),!0):!1},Or=n=>{var f;const{tr:e,state:t,dispatch:r}=n,{selection:i}=t,{$from:s}=i;let l=null,a=null;for(let d=s.depth;d>0;d--){const m=s.node(d);if($(m.type.name)){l={...m,pos:s.before(d)},a={...s.node(d+1),pos:s.before(d+1)};break}}if(!l||!a)return!1;if(((f=l.content)==null?void 0:f.childCount)===1&&i instanceof z){const d=l.attrs.indent??0;return e.setNodeAttribute(l.pos,"indent",d+1),e.setMeta("addToHistory",!1),r==null||r(e),!0}return n.chain().focus().sinkListItem("listItem").updateAttributes("bulletList",{indent:1}).updateAttributes("orderedList",{indent:1}).run(),!0},Nr=n=>{const{tr:e,state:t,dispatch:r}=n,{selection:i}=t,{$from:s}=i,l=s.node();if(!(J(l.type.name)&&i instanceof z))return!1;const u=l.attrs.indent??0;return e.setNodeAttribute(s.before(s.depth),"indent",u+1),e.setMeta("addToHistory",!1),r==null||r(e),!0},Ar=({state:n,view:e,$from:t,$to:r,selectionIsEmpty:i})=>{if(i)return!1;let s=0;if(n.doc.nodesBetween(t.pos,r.pos,m=>{(Te(m.type.name)||J(m.type.name))&&s++}),!(s>1))return!1;const{tr:a,doc:u}=n;let f=!1;const d=new Set;return u.nodesBetween(t.pos,r.pos,(m,v)=>{if($(m.type.name)&&(m.attrs.indent??0)>0){if(!d.has(v)){d.add(v);const S=m.attrs.indent??0;a.setNodeAttribute(v,"indent",Math.max(0,S-1)),f=!0;const g=n.doc.resolve(v),T=n.doc.resolve(v+m.nodeSize),M=new vt(g,T,g.depth),C=kt(M);C!=null&&(a.lift(M,C),f=!0)}return!1}if(J(m.type.name)&&(m.attrs.indent??0)>0){const S=m.attrs.indent??0;a.setNodeAttribute(v,"indent",Math.max(0,S-1)),f=!0}return!0}),f?(a.setMeta("addToHistory",!0),e.dispatch(a),!0):!1},Cr=({$from:n,selectionIsEmpty:e})=>{var l;if(!e)return!1;let t=!1,r=!1,i=0;for(let a=n.depth;a>0;a--){const u=n.node(a);if($(u.type.name))if(!t)t=!0,i=((l=u.attrs)==null?void 0:l.indent)??0;else{r=!0;break}}return t&&!r?i===0:!1},Lr=({state:n,view:e,$from:t,currentNode:r,selectionIsEmpty:i})=>{if(!i||!(r.type.name==="paragraph"&&r.content.size===0))return!1;const l=t.before(t.depth),a=n.doc.resolve(l).nodeBefore;if(!(a!=null&&$(a.type.name)))return!1;const f=n.doc.resolve(l-1),d=n.tr.setSelection(z.near(f,-1));return e.dispatch(d),!0},Mr=({state:n,view:e,$from:t,$to:r,selectionIsEmpty:i})=>{if(i)return!1;let s=0;if(n.doc.nodesBetween(t.pos,r.pos,m=>{(Te(m.type.name)||J(m.type.name))&&s++}),!(s>1))return!1;const{tr:a,doc:u}=n;let f=!1;const d=new Set;return u.nodesBetween(t.pos,r.pos,(m,v)=>{if(($(m.type.name)||J(m.type.name))&&!d.has(v)){d.add(v);const g=m.attrs.indent??0;return a.setNodeAttribute(v,"indent",g+1),f=!0,!1}return!0}),f?(a.setMeta("addToHistory",!0),e.dispatch(a),!0):!1},Pr=({state:n,view:e,$from:t,selectionIsEmpty:r})=>r||t.path.some(s=>{var l;return((l=s==null?void 0:s.type)==null?void 0:l.name)==="listItem"})?!1:(e.dispatch(n.tr.insertText(" ")),!0),Dr=({editor:n,currentNode:e,$from:t})=>{const r=e.content.size===0,i=t.node(t.depth-1);return i&&Te(i.type.name)&&!r?(n.chain().focus().indent().focus().run(),!0):!1},zr=({state:n,view:e,$from:t,currentNode:r})=>{const i=t.pos===t.start(),s=r.content.size===0;return!i&&!s?(e.dispatch(n.tr.insertText(" ")),!0):!1};function Ye(n){const{state:e,view:t}=n,{$from:r,$to:i,empty:s}=e.selection;return{editor:n,state:e,view:t,$from:r,$to:i,selectionIsEmpty:s,currentNode:r.node()}}const Pt=hr.Extension.create({name:"indent",addKeyboardShortcuts(){return{Enter:()=>this.editor.commands._handleEnterKeyDown(),Tab:()=>{const n=Ye(this.editor);return Ue([Mr,Pr,Dr,zr],n)||this.editor.commands.indent()},Backspace:()=>{const n=Ye(this.editor);return Ue([xr,Er,kr],n)},"Shift-Tab":()=>{const n=Ye(this.editor);return Ue([Ar,Lr,Cr],n)||this.editor.chain().outdentShiftTab().run()},Space:()=>this.editor.commands._handleSpaceKeyDown()}},addProseMirrorPlugins(){return[new ce({appendTransaction:(n,e,t)=>{if(!n.some(s=>s.docChanged))return null;let i=null;return t.doc.descendants((s,l)=>{var v;if(!(J(s.type.name)&&(((v=s==null?void 0:s.attrs)==null?void 0:v.indent)??0)>0))return;const u=t.doc.resolve(l);if(!(u.parent.type.name==="listItem"))return;let d=null;for(let S=u.depth-1;S>0;S--)if($(u.node(S).type.name)){d=u.start(S)-1;break}if(d===null||d<0)return;i||(i=t.tr);const m=s.attrs.indent;i.setNodeAttribute(l,"indent",0),i.setNodeAttribute(d,"indent",m)}),i}})]},addGlobalAttributes(){return[{types:this.options.types??["orderedList","bulletList","paragraph","heading"],attributes:{indent:{default:1,parseHTML:n=>parseInt(n.getAttribute("data-indent")||"1",10),renderHTML:n=>n!=null&&n.indent?{style:`padding-left: ${n.indent*20}px`}:{}}}}]},addCommands(){return{_handleEnterKeyDown:()=>n=>{var u;const{tr:e,state:t,dispatch:r}=n,{$from:i}=t.selection,s=i.node();if(!(((u=s==null?void 0:s.type)==null?void 0:u.name)==="paragraph"&&s.attrs.indent))return!1;const a=s.attrs.indent;return e.split(i.pos),e.setNodeAttribute(e.selection.$from.before(),"indent",a),e.scrollIntoView(),e.setMeta("addToHistory",!1),r==null||r(e),!0},_handleSpaceKeyDown:()=>()=>!1,indent:()=>n=>Tr([Rr,Or,Nr],n),outdent:()=>n=>{const{state:e,view:t,tr:r,dispatch:i}=n,{$from:s,$to:l,empty:a}=e.selection,u={editor:n.editor,state:e,view:t,$from:s,$to:l,selectionIsEmpty:a,currentNode:s.node()};if(Mt(u))return!0;const f=s.node();if(!(J(f.type.name)&&f.attrs.indent>0)||!(s.pos===s.start()))return!1;const v=Math.max(0,f.attrs.indent-1);return r.setNodeAttribute(s.before(s.depth),"indent",v),r.setMeta("addToHistory",!1),i==null||i(r),!0},outdentShiftTab:()=>n=>{const{state:e,tr:t,dispatch:r}=n,{$from:i}=e.selection,s=i.node();if(!(J(s.type.name)&&s.attrs.indent>0))return!1;const a=Math.max(0,s.attrs.indent-1);return t.setNodeAttribute(i.before(i.depth),"indent",a),t.setMeta("addToHistory",!1),r==null||r(t),!0},increaseIndent:()=>({commands:n})=>n.indent(),decreaseIndent:()=>n=>{const{state:e,view:t}=n,{$from:r,$to:i,empty:s}=e.selection,l={editor:n.editor,state:e,view:t,$from:r,$to:i,selectionIsEmpty:s,currentNode:r.node()};return Mt(l)?!0:n.chain().outdentShiftTab().run()}}}});var _r=P.BulletList,Jr=P.ListItem,Fr=P.OrderedList;const Dt=_r.extend({addAttributes(){var n;return{...(n=this.parent)==null?void 0:n.call(this),indent:{default:0,parseHTML:e=>parseInt(e.getAttribute("data-indent")||"0",10),renderHTML:e=>e.indent?{"data-indent":e.indent}:{}}}},addNodeView(){return({node:n})=>{const e=n.attrs.indent||0,t=document.createElement("ul");return t.setAttribute("data-indent",String(e)),e>0&&(t.style.paddingLeft=`${e*20}px`),{dom:t,contentDOM:t}}}}),zt=Fr.extend({addAttributes(){var n;return{...(n=this.parent)==null?void 0:n.call(this),indent:{default:0,parseHTML:e=>parseInt(e.getAttribute("data-indent")||"0",10),renderHTML:e=>e.indent?{"data-indent":e.indent}:{}}}},addNodeView(){return({node:n})=>{const e=n.attrs.indent||0,t=document.createElement("ol");return t.setAttribute("data-indent",String(e)),e>0&&(t.style.paddingLeft=`${e*20}px`),{dom:t,contentDOM:t}}}}),Ke=Jr.extend({addAttributes(){var n;return{...(n=this.parent)==null?void 0:n.call(this),class:{default:null,parseHTML:e=>e.getAttribute("class"),renderHTML:e=>e.class?{class:e.class,...e}:{}},indent:{default:0,parseHTML:e=>parseInt(e.getAttribute("data-indent")||"0",10),renderHTML:e=>e.indent?{"data-indent":e.indent}:{}}}}}),Ge=te.Extension.create({name:"dynamicBulletStyling",addProseMirrorPlugins(){return[new ce({key:new wr("dynamicBulletStyling"),appendTransaction:(n,e,t)=>{const r=t.tr;let i=!1;return t.doc.descendants((s,l)=>{if(s.type.name==="listItem"){let a=0;const u=t.doc.resolve(l);for(let f=u.depth;f>0;f--)if(u.node(f).type.name==="bulletList"){a=1;break}a>0&&(r.setNodeAttribute(u.pos,"[data-style]","line-height: inherit"),i=!0)}}),i?r:null}})]}}),Hr=n=>n==="bulletList"||n==="orderedList",Br=n=>n==="paragraph"||n==="heading",_t=te.Extension.create({name:"listIndentIntegration",addProseMirrorPlugins(){return[new ce({appendTransaction:(n,e,t)=>{if(!n.find(i=>i.docChanged))return null;let r=null;return t.doc.descendants((i,s)=>{var l;if(Br(i.type.name)&&(((l=i==null?void 0:i.attrs)==null?void 0:l.indent)??0)>0){const a=t.doc.resolve(s);if(a.parent.type.name==="listItem"){let f=null;for(let d=a.depth-1;d>0;d--){const m=a.node(d);if(Hr(m.type.name)){f=a.start(d)-1;break}}if(f!==null&&f>=0){r||(r=t.tr);const d=i.attrs.indent;r.setNodeAttribute(s,"indent",0),r.setNodeAttribute(f,"indent",d)}}}}),r}}),new ce({props:{transformPastedHTML(n){const e=/<p[^>]*style="[^"]*(?:padding|margin)-left:\s*(\d+)(?:px|pt|em)[^"]*"[^>]*>/gi;n=n.replace(e,(i,s)=>`<p data-indent="${Math.floor(parseInt(s,10)/40)}">`);const t=/<ol[^>]*style="[^"]*list-style-type:\s*(upper-roman|lower-roman|upper-alpha|lower-alpha)[^"]*"[^>]*>/gi;n=n.replace(t,()=>"<ol>");const r=/<li[^>]*style="[^"]*list-style-type:\s*[^;"\s]+[^"]*"[^>]*>/gi;return n=n.replace(r,i=>i.replace(/list-style-type:\s*[^;"\s]+;?/gi,"")),n}}})]}}),Xe=te.Extension.create({name:"fontSize",addOptions(){return{types:["textStyle"],getStyle:n=>`font-size: ${n}`}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:n=>n.style.fontSize.replace(/['"]+/g,""),renderHTML:n=>n.fontSize?{style:this.options.getStyle(n.fontSize)}:{}}}}]},addCommands(){return{setFontSize:n=>({chain:e})=>e().setMark("textStyle",{fontSize:n}).run(),unsetFontSize:()=>({chain:n})=>n().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}}),Ze=te.Extension.create({name:"lineHeight",addOptions(){return{types:["textStyle"],getStyle:n=>`line-height: ${n};`}},addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:n=>n.style.lineHeight.replace(/['"]+/g,""),renderHTML:n=>n.lineHeight?{style:this.options.getStyle(n.lineHeight)}:{}}}}]},addCommands(){return{setLineHeight:n=>({chain:e})=>e().setMark("textStyle",{lineHeight:n}).run(),unsetLineHeight:()=>({chain:n})=>n().setMark("textStyle",{lineHeight:null}).removeEmptyTextStyle().run()}}}),jr=[Y,K.CharacterCount,Ne,Ae,at,lt,ut,ct,dt,P.ListItem,P.ListKeymap,ft,P.OrderedList,K.Placeholder,W.Table,W.TableCell,W.TableHeader,W.TableRow,P.TaskItem,P.TaskList,De,ze.TextStyle,_e,Me,Pe,Le,Ce,K.UndoRedo,Ke,Xe,Ze,P.BulletList,Ge],qr=[ht,ze.TextStyle,Ne,K.UndoRedo.configure({newGroupDelay:500,depth:100}),Ce,_e,Y,Le,P.TaskItem,Ke,Ae,Pe,Xe,Ze,Dt,Ge,_t,De.configure({types:["heading","paragraph"]}),zt.configure({itemTypeName:"listItem",keepMarks:!0,keepAttributes:!0}),Pt],$r=te.Extension.create({name:"MentionStorage",addStorage(){return{suggestions:[]}}});var ie={},Jt;function Vr(){if(Jt)return ie;Jt=1;var n=pr;if(process.env.NODE_ENV==="production")ie.createRoot=n.createRoot,ie.hydrateRoot=n.hydrateRoot;else{var e=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;ie.createRoot=function(t,r){e.usingClientEntryPoint=!0;try{return n.createRoot(t,r)}finally{e.usingClientEntryPoint=!1}},ie.hydrateRoot=function(t,r,i){e.usingClientEntryPoint=!0;try{return n.hydrateRoot(t,r,i)}finally{e.usingClientEntryPoint=!1}}}return ie}var Wr=Vr(),xe={exports:{}},de={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var Ft;function Ur(){if(Ft)return de;Ft=1;var n=Je,e=Symbol.for("react.element"),t=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function l(a,u,f){var d,m={},v=null,S=null;f!==void 0&&(v=""+f),u.key!==void 0&&(v=""+u.key),u.ref!==void 0&&(S=u.ref);for(d in u)r.call(u,d)&&!s.hasOwnProperty(d)&&(m[d]=u[d]);if(a&&a.defaultProps)for(d in u=a.defaultProps,u)m[d]===void 0&&(m[d]=u[d]);return{$$typeof:e,type:a,key:v,ref:S,props:m,_owner:i.current}}return de.Fragment=t,de.jsx=l,de.jsxs=l,de}var fe={};/**
10
+ * @license React
11
+ * react-jsx-runtime.development.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var Ht;function Yr(){return Ht||(Ht=1,process.env.NODE_ENV!=="production"&&(function(){var n=Je,e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),a=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),S=Symbol.for("react.offscreen"),g=Symbol.iterator,T="@@iterator";function M(o){if(o===null||typeof o!="object")return null;var c=g&&o[g]||o[T];return typeof c=="function"?c:null}var C=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function R(o){{for(var c=arguments.length,p=new Array(c>1?c-1:0),y=1;y<c;y++)p[y-1]=arguments[y];me("error",o,p)}}function me(o,c,p){{var y=C.ReactDebugCurrentFrame,w=y.getStackAddendum();w!==""&&(c+="%s",p=p.concat([w]));var x=p.map(function(b){return String(b)});x.unshift("Warning: "+c),Function.prototype.apply.call(console[o],console,x)}}var Zr=!1,Qr=!1,en=!1,tn=!1,rn=!1,jt;jt=Symbol.for("react.module.reference");function nn(o){return!!(typeof o=="string"||typeof o=="function"||o===r||o===s||rn||o===i||o===f||o===d||tn||o===S||Zr||Qr||en||typeof o=="object"&&o!==null&&(o.$$typeof===v||o.$$typeof===m||o.$$typeof===l||o.$$typeof===a||o.$$typeof===u||o.$$typeof===jt||o.getModuleId!==void 0))}function sn(o,c,p){var y=o.displayName;if(y)return y;var w=c.displayName||c.name||"";return w!==""?p+"("+w+")":p}function qt(o){return o.displayName||"Context"}function U(o){if(o==null)return null;if(typeof o.tag=="number"&&R("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case r:return"Fragment";case t:return"Portal";case s:return"Profiler";case i:return"StrictMode";case f:return"Suspense";case d:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case a:var c=o;return qt(c)+".Consumer";case l:var p=o;return qt(p._context)+".Provider";case u:return sn(o,o.render,"ForwardRef");case m:var y=o.displayName||null;return y!==null?y:U(o.type)||"Memo";case v:{var w=o,x=w._payload,b=w._init;try{return U(b(x))}catch{return null}}}return null}var Q=Object.assign,ge=0,$t,Vt,Wt,Ut,Yt,Kt,Gt;function Xt(){}Xt.__reactDisabledLog=!0;function on(){{if(ge===0){$t=console.log,Vt=console.info,Wt=console.warn,Ut=console.error,Yt=console.group,Kt=console.groupCollapsed,Gt=console.groupEnd;var o={configurable:!0,enumerable:!0,value:Xt,writable:!0};Object.defineProperties(console,{info:o,log:o,warn:o,error:o,group:o,groupCollapsed:o,groupEnd:o})}ge++}}function an(){{if(ge--,ge===0){var o={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:Q({},o,{value:$t}),info:Q({},o,{value:Vt}),warn:Q({},o,{value:Wt}),error:Q({},o,{value:Ut}),group:Q({},o,{value:Yt}),groupCollapsed:Q({},o,{value:Kt}),groupEnd:Q({},o,{value:Gt})})}ge<0&&R("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Qe=C.ReactCurrentDispatcher,et;function Ee(o,c,p){{if(et===void 0)try{throw Error()}catch(w){var y=w.stack.trim().match(/\n( *(at )?)/);et=y&&y[1]||""}return`
18
+ `+et+o}}var tt=!1,ke;{var ln=typeof WeakMap=="function"?WeakMap:Map;ke=new ln}function Zt(o,c){if(!o||tt)return"";{var p=ke.get(o);if(p!==void 0)return p}var y;tt=!0;var w=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var x;x=Qe.current,Qe.current=null,on();try{if(c){var b=function(){throw Error()};if(Object.defineProperty(b.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(b,[])}catch(H){y=H}Reflect.construct(o,[],b)}else{try{b.call()}catch(H){y=H}o.call(b.prototype)}}else{try{throw Error()}catch(H){y=H}o()}}catch(H){if(H&&y&&typeof H.stack=="string"){for(var I=H.stack.split(`
19
+ `),F=y.stack.split(`
20
+ `),O=I.length-1,A=F.length-1;O>=1&&A>=0&&I[O]!==F[A];)A--;for(;O>=1&&A>=0;O--,A--)if(I[O]!==F[A]){if(O!==1||A!==1)do if(O--,A--,A<0||I[O]!==F[A]){var j=`
21
+ `+I[O].replace(" at new "," at ");return o.displayName&&j.includes("<anonymous>")&&(j=j.replace("<anonymous>",o.displayName)),typeof o=="function"&&ke.set(o,j),j}while(O>=1&&A>=0);break}}}finally{tt=!1,Qe.current=x,an(),Error.prepareStackTrace=w}var oe=o?o.displayName||o.name:"",ee=oe?Ee(oe):"";return typeof o=="function"&&ke.set(o,ee),ee}function un(o,c,p){return Zt(o,!1)}function cn(o){var c=o.prototype;return!!(c&&c.isReactComponent)}function Re(o,c,p){if(o==null)return"";if(typeof o=="function")return Zt(o,cn(o));if(typeof o=="string")return Ee(o);switch(o){case f:return Ee("Suspense");case d:return Ee("SuspenseList")}if(typeof o=="object")switch(o.$$typeof){case u:return un(o.render);case m:return Re(o.type,c,p);case v:{var y=o,w=y._payload,x=y._init;try{return Re(x(w),c,p)}catch{}}}return""}var ye=Object.prototype.hasOwnProperty,Qt={},er=C.ReactDebugCurrentFrame;function Oe(o){if(o){var c=o._owner,p=Re(o.type,o._source,c?c.type:null);er.setExtraStackFrame(p)}else er.setExtraStackFrame(null)}function dn(o,c,p,y,w){{var x=Function.call.bind(ye);for(var b in o)if(x(o,b)){var I=void 0;try{if(typeof o[b]!="function"){var F=Error((y||"React class")+": "+p+" type `"+b+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[b]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw F.name="Invariant Violation",F}I=o[b](c,b,y,p,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(O){I=O}I&&!(I instanceof Error)&&(Oe(w),R("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",y||"React class",p,b,typeof I),Oe(null)),I instanceof Error&&!(I.message in Qt)&&(Qt[I.message]=!0,Oe(w),R("Failed %s type: %s",p,I.message),Oe(null))}}}var fn=Array.isArray;function rt(o){return fn(o)}function hn(o){{var c=typeof Symbol=="function"&&Symbol.toStringTag,p=c&&o[Symbol.toStringTag]||o.constructor.name||"Object";return p}}function pn(o){try{return tr(o),!1}catch{return!0}}function tr(o){return""+o}function rr(o){if(pn(o))return R("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",hn(o)),tr(o)}var nr=C.ReactCurrentOwner,mn={key:!0,ref:!0,__self:!0,__source:!0},ir,sr;function gn(o){if(ye.call(o,"ref")){var c=Object.getOwnPropertyDescriptor(o,"ref").get;if(c&&c.isReactWarning)return!1}return o.ref!==void 0}function yn(o){if(ye.call(o,"key")){var c=Object.getOwnPropertyDescriptor(o,"key").get;if(c&&c.isReactWarning)return!1}return o.key!==void 0}function vn(o,c){typeof o.ref=="string"&&nr.current}function In(o,c){{var p=function(){ir||(ir=!0,R("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",c))};p.isReactWarning=!0,Object.defineProperty(o,"key",{get:p,configurable:!0})}}function bn(o,c){{var p=function(){sr||(sr=!0,R("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",c))};p.isReactWarning=!0,Object.defineProperty(o,"ref",{get:p,configurable:!0})}}var Sn=function(o,c,p,y,w,x,b){var I={$$typeof:e,type:o,key:c,ref:p,props:b,_owner:x};return I._store={},Object.defineProperty(I._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(I,"_self",{configurable:!1,enumerable:!1,writable:!1,value:y}),Object.defineProperty(I,"_source",{configurable:!1,enumerable:!1,writable:!1,value:w}),Object.freeze&&(Object.freeze(I.props),Object.freeze(I)),I};function wn(o,c,p,y,w){{var x,b={},I=null,F=null;p!==void 0&&(rr(p),I=""+p),yn(c)&&(rr(c.key),I=""+c.key),gn(c)&&(F=c.ref,vn(c,w));for(x in c)ye.call(c,x)&&!mn.hasOwnProperty(x)&&(b[x]=c[x]);if(o&&o.defaultProps){var O=o.defaultProps;for(x in O)b[x]===void 0&&(b[x]=O[x])}if(I||F){var A=typeof o=="function"?o.displayName||o.name||"Unknown":o;I&&In(b,A),F&&bn(b,A)}return Sn(o,I,F,w,y,nr.current,b)}}var nt=C.ReactCurrentOwner,or=C.ReactDebugCurrentFrame;function se(o){if(o){var c=o._owner,p=Re(o.type,o._source,c?c.type:null);or.setExtraStackFrame(p)}else or.setExtraStackFrame(null)}var it;it=!1;function st(o){return typeof o=="object"&&o!==null&&o.$$typeof===e}function ar(){{if(nt.current){var o=U(nt.current.type);if(o)return`
22
+
23
+ Check the render method of \``+o+"`."}return""}}function Tn(o){return""}var lr={};function xn(o){{var c=ar();if(!c){var p=typeof o=="string"?o:o.displayName||o.name;p&&(c=`
24
+
25
+ Check the top-level render call using <`+p+">.")}return c}}function ur(o,c){{if(!o._store||o._store.validated||o.key!=null)return;o._store.validated=!0;var p=xn(c);if(lr[p])return;lr[p]=!0;var y="";o&&o._owner&&o._owner!==nt.current&&(y=" It was passed a child from "+U(o._owner.type)+"."),se(o),R('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',p,y),se(null)}}function cr(o,c){{if(typeof o!="object")return;if(rt(o))for(var p=0;p<o.length;p++){var y=o[p];st(y)&&ur(y,c)}else if(st(o))o._store&&(o._store.validated=!0);else if(o){var w=M(o);if(typeof w=="function"&&w!==o.entries)for(var x=w.call(o),b;!(b=x.next()).done;)st(b.value)&&ur(b.value,c)}}}function En(o){{var c=o.type;if(c==null||typeof c=="string")return;var p;if(typeof c=="function")p=c.propTypes;else if(typeof c=="object"&&(c.$$typeof===u||c.$$typeof===m))p=c.propTypes;else return;if(p){var y=U(c);dn(p,o.props,"prop",y,o)}else if(c.PropTypes!==void 0&&!it){it=!0;var w=U(c);R("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",w||"Unknown")}typeof c.getDefaultProps=="function"&&!c.getDefaultProps.isReactClassApproved&&R("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function kn(o){{for(var c=Object.keys(o.props),p=0;p<c.length;p++){var y=c[p];if(y!=="children"&&y!=="key"){se(o),R("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",y),se(null);break}}o.ref!==null&&(se(o),R("Invalid attribute `ref` supplied to `React.Fragment`."),se(null))}}var dr={};function fr(o,c,p,y,w,x){{var b=nn(o);if(!b){var I="";(o===void 0||typeof o=="object"&&o!==null&&Object.keys(o).length===0)&&(I+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var F=Tn();F?I+=F:I+=ar();var O;o===null?O="null":rt(o)?O="array":o!==void 0&&o.$$typeof===e?(O="<"+(U(o.type)||"Unknown")+" />",I=" Did you accidentally export a JSX literal instead of a component?"):O=typeof o,R("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",O,I)}var A=wn(o,c,p,w,x);if(A==null)return A;if(b){var j=c.children;if(j!==void 0)if(y)if(rt(j)){for(var oe=0;oe<j.length;oe++)cr(j[oe],o);Object.freeze&&Object.freeze(j)}else R("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else cr(j,o)}if(ye.call(c,"key")){var ee=U(o),H=Object.keys(c).filter(function(Ln){return Ln!=="key"}),ot=H.length>0?"{key: someKey, "+H.join(": ..., ")+": ...}":"{key: someKey}";if(!dr[ee+ot]){var Cn=H.length>0?"{"+H.join(": ..., ")+": ...}":"{}";R(`A props object containing a "key" prop is being spread into JSX:
26
+ let props = %s;
27
+ <%s {...props} />
28
+ React keys must be passed directly to JSX without using spread:
29
+ let props = %s;
30
+ <%s key={someKey} {...props} />`,ot,ee,Cn,ee),dr[ee+ot]=!0}}return o===r?kn(A):En(A),A}}function Rn(o,c,p){return fr(o,c,p,!0)}function On(o,c,p){return fr(o,c,p,!1)}var Nn=On,An=Rn;fe.Fragment=r,fe.jsx=Nn,fe.jsxs=An})()),fe}var Bt;function Kr(){return Bt||(Bt=1,process.env.NODE_ENV==="production"?xe.exports=Ur():xe.exports=Yr()),xe.exports}var he=Kr();const Gr=({images:n,onAdd:e,onDelete:t,onImageClick:r,focusedImageIndex:i})=>he.jsxs("div",{className:"batch-image-gallery",style:{display:"flex",gap:"8px",overflowX:"auto",padding:"8px"},children:[n.map((s,l)=>he.jsxs("div",{style:{position:"relative",border:i===l?"2px solid blue":"2px solid transparent",cursor:"pointer"},onClick:()=>r(s),children:[he.jsx("img",{src:s.src,alt:s.alt,style:{width:"80px",height:"80px",objectFit:"cover"}}),he.jsx("button",{onClick:a=>{a.stopPropagation(),t(l)},style:{position:"absolute",top:0,right:0},children:"×"})]},s.id)),he.jsx("button",{onClick:e,style:{width:"80px",height:"80px"},children:"+"})]});let pe=null;const Xr=te.Node.create({name:"batchSegmentImages",group:"block",inline:!1,atom:!0,addOptions(){return{maxImageAmount:void 0,height:void 0,onAdd:void 0,onRemove:void 0,onImageClick:void 0,initialImageRegistry:void 0}},addStorage(){return{imageRegistry:new Map(this.options.initialImageRegistry)}},addAttributes(){return{batchId:{default:null,parseHTML:n=>n.getAttribute("data-batch-id"),renderHTML:n=>({"data-batch-id":n.batchId})},id:{default:null,parseHTML:n=>n.getAttribute("data-id"),renderHTML:n=>({"data-id":n.id})},images:{default:[],parseHTML:n=>{const e=n.querySelectorAll("img"),t=[];return e.forEach(r=>{const i=r.getAttribute("data-id"),s=r.getAttribute("src"),l=r.getAttribute("alt"),a=r.getAttribute("title");i&&s&&t.push({id:i,src:s,alt:l??void 0,title:a??void 0})}),t},renderHTML:()=>({})},imageVersion:{default:0,parseHTML:()=>0,renderHTML:()=>({})},focusedImageIndex:{default:null,parseHTML:()=>null,renderHTML:()=>({})}}},addProseMirrorPlugins(){return[new ce({props:{handleKeyDown(n,e){return e.key==="ArrowLeft"||e.key==="ArrowUp"?pe="left":e.key==="ArrowRight"||e.key==="ArrowDown"?pe="right":pe=null,!1}}})]},addKeyboardShortcuts(){const n=(r,i)=>{const s=this.editor.state.tr.setNodeMarkup(r,void 0,{...i.attrs,focusedImageIndex:null}).setMeta("addToHistory",!1);s.setSelection(z.near(s.doc.resolve(r))),this.editor.view.dispatch(s)},e=(r,i)=>{const s=r+i.nodeSize,l=this.editor.state.tr.setNodeMarkup(r,void 0,{...i.attrs,focusedImageIndex:null}).setMeta("addToHistory",!1);l.setSelection(z.near(l.doc.resolve(s))),this.editor.view.dispatch(l)},t=r=>{var m,v;const{selection:i}=this.editor.state;if(!(i instanceof _))return!1;const s=i.node;if(s.type.name!=="batchSegmentImages")return!1;const l=((v=(m=this.editor.storage.batchSegmentImages)==null?void 0:m.imageRegistry)==null?void 0:v.get(s.attrs.batchId))??s.attrs.images;if(!l.length)return!1;const a=i.from,u=s.attrs.focusedImageIndex,f=!!this.options.onAdd;let d;if(r==="right"){if(u===null)return e(a,s),!0;if(u<l.length-1)d=u+1;else if(u===l.length-1&&f)d=null;else return e(a,s),!0}else if(u===null)d=l.length-1;else if(u>0)d=u-1;else return n(a,s),!0;if(this.editor.view.dispatch(this.editor.state.tr.setNodeMarkup(a,void 0,{...s.attrs,focusedImageIndex:d}).setMeta("addToHistory",!1)),d!==null&&d>=0&&d<l.length){const S=this.editor.view.nodeDOM(a);S instanceof HTMLElement&&requestAnimationFrame(()=>{var T;(T=S.querySelectorAll("img")[d])==null||T.scrollIntoView({block:"nearest",inline:"nearest"})})}return!0};return{ArrowLeft:()=>t("left"),ArrowRight:()=>t("right"),Space:()=>{var u,f,d,m,v,S;const{selection:r}=this.editor.state;if(!(r instanceof _))return!1;const i=r.node;if(i.type.name!=="batchSegmentImages")return!1;const s=((f=(u=this.editor.storage.batchSegmentImages)==null?void 0:u.imageRegistry)==null?void 0:f.get(i.attrs.batchId))??i.attrs.images,l=i.attrs.focusedImageIndex,a=r.from;if(l===null)return(m=(d=this.options).onAdd)==null||m.call(d,{position:"last",batchId:i.attrs.batchId,currentImages:s,getPos:()=>a,editor:this.editor}),!0;if(l>=0&&l<s.length){const g=s[l];return(S=(v=this.options).onImageClick)==null||S.call(v,{imageId:g.id,batchId:i.attrs.batchId,src:g.src,getPos:()=>a,editor:this.editor}),!0}return!1}}},renderHTML({node:n}){const e=n.attrs.images??[];return["div",{"data-batch-id":n.attrs.batchId,style:"display: flex; overflow-x: auto; gap: 10px; white-space: nowrap; padding: 10px 0;"},...e.map(t=>["img",{"data-id":t.id,src:t.src,alt:t.alt??"",title:t.title??"",style:"width: 80px; height: 80px; object-fit: cover; flex-shrink: 0;"}])]},addNodeView(){return({node:n,getPos:e,editor:t})=>{const r=this.options,i=this.storage,s=document.createElement("div");s.style.width="100%",s.classList.add("batch-segment-gallery"),i.imageRegistry.has(n.attrs.batchId)||i.imageRegistry.set(n.attrs.batchId,n.attrs.images??[]);const l=Wr.createRoot(s),a={current:n};let u=null;const f=()=>{var g;(g=r.onAdd)==null||g.call(r,{position:"last",batchId:a.current.attrs.batchId,currentImages:i.imageRegistry.get(a.current.attrs.batchId)??[],getPos:e,editor:t})},d=g=>{var T,M;(M=r.onRemove)==null||M.call(r,{index:g,imageId:(T=(i.imageRegistry.get(a.current.attrs.batchId)??[])[g])==null?void 0:T.id,batchId:a.current.attrs.batchId,getPos:e,editor:t})},m=g=>{var M;const T=e();if(T!==void 0){const C=(i.imageRegistry.get(a.current.attrs.batchId)??[]).findIndex(R=>R.id===g.id);t.view.dispatch(t.state.tr.setNodeMarkup(T,void 0,{...a.current.attrs,focusedImageIndex:C}).setMeta("addToHistory",!1))}(M=r.onImageClick)==null||M.call(r,{imageId:g.id,batchId:a.current.attrs.batchId,src:g.src,getPos:e,editor:t})},v=()=>{const[g,T]=Fe.useState({images:i.imageRegistry.get(n.attrs.batchId)??[],focusedImageIndex:n.attrs.focusedImageIndex,batchId:n.attrs.batchId});return u=T,Fe.createElement(Gr,{batchId:g.batchId,images:g.images,maxImageAmount:r.maxImageAmount,height:r.height,focusedImageIndex:g.focusedImageIndex,onAdd:f,onDelete:d,onImageClick:m})};l.render(Fe.createElement(v));let S=n;return s.addEventListener("click",()=>{const g=e();if(g!==void 0){const{state:T,view:M}=t,C=T.doc.nodeAt(g);if(!C)return;const R=T.tr.setNodeMarkup(g,void 0,{...C.attrs,focusedImageIndex:null}).setMeta("addToHistory",!1);M.dispatch(R.setSelection(_.create(R.doc,g)))}}),{dom:s,update:g=>g.type!==n.type?!1:(g===S||(S=g,a.current=g,u==null||u({images:i.imageRegistry.get(g.attrs.batchId)??[],focusedImageIndex:g.attrs.focusedImageIndex,batchId:g.attrs.batchId})),!0),selectNode:()=>{const g=pe;pe=null;const T=e();if(T===void 0)return;const M=t.state.doc.nodeAt(T);if(!M||M.attrs.focusedImageIndex!==null)return;const C=g==="left"?null:0;queueMicrotask(()=>{const R=e();if(R===void 0)return;const me=t.state.doc.nodeAt(R);!me||me.attrs.focusedImageIndex!==null||t.state.selection instanceof _&&t.view.dispatch(t.state.tr.setNodeMarkup(R,void 0,{...me.attrs,focusedImageIndex:C}).setMeta("addToHistory",!1))})},deselectNode:()=>{const g=e();if(g===void 0)return;const T=t.state.doc.nodeAt(g);!T||T.attrs.focusedImageIndex===null||t.view.dispatch(t.state.tr.setNodeMarkup(g,void 0,{...T.attrs,focusedImageIndex:null}).setMeta("addToHistory",!1))},destroy:()=>{i.imageRegistry.delete(n.attrs.batchId),queueMicrotask(()=>l.unmount())}}}},addCommands(){return{insertBatchImages:({batchId:n,images:e})=>t=>(t.editor.storage.batchSegmentImages.imageRegistry.set(n,e),t.chain().insertContent({type:"batchSegmentImages",attrs:{batchId:n,images:e,id:crypto.randomUUID()}}).run())}},parseHTML(){return[{tag:"div[data-batch-id]"}]}});h.Bold=Y,h.Color=Ne,h.Document=Ae,h.FileHandler=at,h.HardBreak=Ce,h.Heading=lt,h.Highlight=ut,h.Image=ct,h.Italic=Le,h.Link=dt,Object.defineProperty(h,"BulletList",{enumerable:!0,get:()=>P.BulletList}),Object.defineProperty(h,"ListItem",{enumerable:!0,get:()=>P.ListItem}),Object.defineProperty(h,"ListKeymap",{enumerable:!0,get:()=>P.ListKeymap}),Object.defineProperty(h,"OrderedList",{enumerable:!0,get:()=>P.OrderedList}),Object.defineProperty(h,"TaskItem",{enumerable:!0,get:()=>P.TaskItem}),Object.defineProperty(h,"TaskList",{enumerable:!0,get:()=>P.TaskList}),h.Mention=ft,h.Paragraph=Me,Object.defineProperty(h,"Table",{enumerable:!0,get:()=>W.Table}),Object.defineProperty(h,"TableCell",{enumerable:!0,get:()=>W.TableCell}),Object.defineProperty(h,"TableHeader",{enumerable:!0,get:()=>W.TableHeader}),Object.defineProperty(h,"TableRow",{enumerable:!0,get:()=>W.TableRow}),h.Text=Pe,h.TextAlign=De,Object.defineProperty(h,"TextStyle",{enumerable:!0,get:()=>ze.TextStyle}),h.Underline=_e,Object.defineProperty(h,"CharacterCount",{enumerable:!0,get:()=>K.CharacterCount}),Object.defineProperty(h,"History",{enumerable:!0,get:()=>K.UndoRedo}),Object.defineProperty(h,"Placeholder",{enumerable:!0,get:()=>K.Placeholder}),h.ALL_EXTENSIONS=jr,h.BASE_EXTENSIONS=qr,h.BatchSegmentImagesExtension=Xr,h.CustomBulletList=Dt,h.CustomListItem=Ke,h.CustomOrderedList=zt,h.CustomParagraph=ht,h.DynamicBulletStyling=Ge,h.FontSize=Xe,h.IndentExtension=Pt,h.LineHeight=Ze,h.ListIndentIntegration=_t,h.MentionStorage=$r,Object.defineProperty(h,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@sovann72-dev/lynqify-ui",
3
- "version": "1.0.0",
4
- "main": "src/index.ts",
5
- "module": "src/index.ts",
6
- "types": "src/index.ts",
3
+ "version": "1.0.1",
4
+ "main": "dist/lynqify-ui.umd.cjs",
5
+ "module": "dist/lynqify-ui.js",
6
+ "types": "dist/index.d.ts",
7
7
  "files": [
8
- "src"
8
+ "dist"
9
9
  ],
10
10
  "publishConfig": {
11
11
  "access": "public"
@@ -89,30 +89,6 @@
89
89
  "@react-google-maps/api": "^2.20.8",
90
90
  "@tailwindcss/forms": "^0.5.7",
91
91
  "@tanstack/react-table": "^8.12.0",
92
- "@tiptap/core": "^3.22.5",
93
- "@tiptap/extension-bold": "^3.22.5",
94
- "@tiptap/extension-color": "^3.22.5",
95
- "@tiptap/extension-document": "^3.22.5",
96
- "@tiptap/extension-file-handler": "^3.22.5",
97
- "@tiptap/extension-hard-break": "^3.22.5",
98
- "@tiptap/extension-heading": "^3.22.5",
99
- "@tiptap/extension-highlight": "^3.22.5",
100
- "@tiptap/extension-image": "^3.22.5",
101
- "@tiptap/extension-italic": "^3.22.5",
102
- "@tiptap/extension-link": "^3.22.5",
103
- "@tiptap/extension-list": "^3.22.5",
104
- "@tiptap/extension-mention": "^3.22.5",
105
- "@tiptap/extension-paragraph": "^3.22.5",
106
- "@tiptap/extension-table": "^3.22.5",
107
- "@tiptap/extension-text": "^3.22.5",
108
- "@tiptap/extension-text-align": "^3.22.5",
109
- "@tiptap/extension-text-style": "^3.22.5",
110
- "@tiptap/extension-underline": "^3.22.5",
111
- "@tiptap/extensions": "^3.22.5",
112
- "@tiptap/pm": "^3.22.5",
113
- "@tiptap/react": "^3.22.5",
114
- "@tiptap/starter-kit": "^3.22.5",
115
- "@tiptap/suggestion": "^3.22.5",
116
92
  "@types/react-input-mask": "^3.0.6",
117
93
  "@uiw/react-color-sketch": "^2.3.1",
118
94
  "@userback/react": "^0.3.7",
@@ -141,11 +117,9 @@
141
117
  "platform": "^1.3.6",
142
118
  "posthog-js": "^1.310.1",
143
119
  "qs": "^6.14.0",
144
- "react": "^18.2.0",
145
120
  "react-color": "^2.19.3",
146
121
  "react-datepicker": "^8.2.0",
147
122
  "react-day-picker": "^8.10.1",
148
- "react-dom": "^18.2.0",
149
123
  "react-draggable": "^4.4.6",
150
124
  "react-dropzone": "^14.3.8",
151
125
  "react-easy-crop": "^5.0.8",
@@ -179,6 +153,34 @@
179
153
  "yjs": "^13.6.27",
180
154
  "zod": "^3.22.4"
181
155
  },
156
+ "peerDependencies": {
157
+ "@tiptap/core": "^3.0.0",
158
+ "@tiptap/extension-bold": "^3.0.0",
159
+ "@tiptap/extension-color": "^3.0.0",
160
+ "@tiptap/extension-document": "^3.0.0",
161
+ "@tiptap/extension-file-handler": "^3.0.0",
162
+ "@tiptap/extension-hard-break": "^3.0.0",
163
+ "@tiptap/extension-heading": "^3.0.0",
164
+ "@tiptap/extension-highlight": "^3.0.0",
165
+ "@tiptap/extension-image": "^3.0.0",
166
+ "@tiptap/extension-italic": "^3.0.0",
167
+ "@tiptap/extension-link": "^3.0.0",
168
+ "@tiptap/extension-list": "^3.0.0",
169
+ "@tiptap/extension-mention": "^3.0.0",
170
+ "@tiptap/extension-paragraph": "^3.0.0",
171
+ "@tiptap/extension-table": "^3.0.0",
172
+ "@tiptap/extension-text": "^3.0.0",
173
+ "@tiptap/extension-text-align": "^3.0.0",
174
+ "@tiptap/extension-text-style": "^3.0.0",
175
+ "@tiptap/extension-underline": "^3.0.0",
176
+ "@tiptap/extensions": "^3.0.0",
177
+ "@tiptap/pm": "^3.0.0",
178
+ "@tiptap/react": "^3.0.0",
179
+ "@tiptap/starter-kit": "^3.0.0",
180
+ "@tiptap/suggestion": "^3.0.0",
181
+ "react": "^18.2.0",
182
+ "react-dom": "^18.2.0"
183
+ },
182
184
  "devDependencies": {
183
185
  "@babel/plugin-proposal-class-properties": "^7.18.6",
184
186
  "@babel/plugin-proposal-decorators": "^7.25.9",
@@ -191,6 +193,30 @@
191
193
  "@testing-library/jest-dom": "^5.17.0",
192
194
  "@testing-library/react": "^13.4.0",
193
195
  "@testing-library/user-event": "^13.5.0",
196
+ "@tiptap/core": "^3.22.5",
197
+ "@tiptap/extension-bold": "^3.22.5",
198
+ "@tiptap/extension-color": "^3.22.5",
199
+ "@tiptap/extension-document": "^3.22.5",
200
+ "@tiptap/extension-file-handler": "^3.22.5",
201
+ "@tiptap/extension-hard-break": "^3.22.5",
202
+ "@tiptap/extension-heading": "^3.22.5",
203
+ "@tiptap/extension-highlight": "^3.22.5",
204
+ "@tiptap/extension-image": "^3.22.5",
205
+ "@tiptap/extension-italic": "^3.22.5",
206
+ "@tiptap/extension-link": "^3.22.5",
207
+ "@tiptap/extension-list": "^3.22.5",
208
+ "@tiptap/extension-mention": "^3.22.5",
209
+ "@tiptap/extension-paragraph": "^3.22.5",
210
+ "@tiptap/extension-table": "^3.22.5",
211
+ "@tiptap/extension-text": "^3.22.5",
212
+ "@tiptap/extension-text-align": "^3.22.5",
213
+ "@tiptap/extension-text-style": "^3.22.5",
214
+ "@tiptap/extension-underline": "^3.22.5",
215
+ "@tiptap/extensions": "^3.22.5",
216
+ "@tiptap/pm": "^3.22.5",
217
+ "@tiptap/react": "^3.22.5",
218
+ "@tiptap/starter-kit": "^3.22.5",
219
+ "@tiptap/suggestion": "^3.22.5",
194
220
  "@types/jest": "^27.5.2",
195
221
  "@types/js-cookie": "^3.0.6",
196
222
  "@types/lodash": "^4.14.202",
@@ -224,6 +250,8 @@
224
250
  "lint-staged": "^15.2.0",
225
251
  "prettier": "^3.3.3",
226
252
  "prettier-plugin-tailwindcss": "^0.6.6",
253
+ "react": "^18.2.0",
254
+ "react-dom": "^18.2.0",
227
255
  "rollup-plugin-visualizer": "6.0.5",
228
256
  "source-map-explorer": "^2.5.3",
229
257
  "tailwindcss": "^3.4.1",
@@ -232,6 +260,7 @@
232
260
  "vite": "^6.1.0",
233
261
  "vite-plugin-checker": "^0.9.0",
234
262
  "vite-plugin-compression": "^0.5.1",
263
+ "vite-plugin-dts": "^5.0.0",
235
264
  "vite-plugin-svgr": "^4.3.0",
236
265
  "vite-tsconfig-paths": "^5.1.4",
237
266
  "vitest": "^3.0.7"
@@ -1,77 +0,0 @@
1
- import { type ShortcutHandler, isListParent, isTextNode } from './indent.types';
2
-
3
- /**
4
- * WHY: When the cursor is at the very start of an indented text block,
5
- * Backspace should visually un-indent the line rather than delete backwards.
6
- * This mirrors how Google Docs treats Backspace at the start of an indented line.
7
- */
8
- export const handleBackspaceOutdentAtLineStart: ShortcutHandler = ({
9
- editor,
10
- $from,
11
- currentNode,
12
- }) => {
13
- const isAtStart = $from.pos === $from.start();
14
- const hasIndent = currentNode.attrs.indent > 0;
15
- const isIndentedTextNode = isTextNode(currentNode.type.name) && hasIndent;
16
-
17
- if (isIndentedTextNode && isAtStart) {
18
- return editor.commands.outdent();
19
- }
20
-
21
- return false;
22
- };
23
-
24
- /**
25
- * WHY: An empty indented line has no meaningful content to merge with the previous block.
26
- * Deleting it entirely (rather than joining it) keeps the document structure clean.
27
- */
28
- export const handleBackspaceDeleteEmptyIndentedLine: ShortcutHandler = ({
29
- state,
30
- view,
31
- $from,
32
- currentNode,
33
- }) => {
34
- const isEmpty = currentNode.content.size === 0;
35
- const hasIndent = currentNode.attrs.indent > 0;
36
- const isEmptyIndentedTextNode = isTextNode(currentNode.type.name) && hasIndent && isEmpty;
37
-
38
- if (!isEmptyIndentedTextNode) return false;
39
-
40
- const nodePos = $from.before($from.depth);
41
- const tr = state.tr;
42
- tr.delete(nodePos, nodePos + currentNode.nodeSize);
43
- view.dispatch(tr);
44
- return true;
45
- };
46
-
47
- /**
48
- * WHY: Backspace on an empty unindented paragraph right after a list would normally
49
- * cause ProseMirror to merge the paragraph into the last list item, which is confusing.
50
- * We delete the empty paragraph outright to prevent that unwanted merge.
51
- */
52
- export const handleBackspaceDeleteEmptyParagraphAfterList: ShortcutHandler = ({
53
- state,
54
- view,
55
- $from,
56
- currentNode,
57
- }) => {
58
- const isAtStart = $from.pos === $from.start();
59
- const isEmpty = currentNode.content.size === 0;
60
- const hasIndent = currentNode.attrs.indent > 0;
61
-
62
- const nodePos = $from.before($from.depth);
63
- const prevNode = state.doc.resolve(nodePos).nodeBefore;
64
- const prevNodeIsList = prevNode != null && isListParent(prevNode.type.name);
65
-
66
- const isEmptyUnindentedTextNode =
67
- isTextNode(currentNode.type.name) && !hasIndent && isEmpty && isAtStart;
68
-
69
- if (isEmptyUnindentedTextNode && prevNodeIsList) {
70
- const tr = state.tr;
71
- tr.delete(nodePos, nodePos + currentNode.nodeSize);
72
- view.dispatch(tr);
73
- return true;
74
- }
75
-
76
- return false;
77
- };