@wrdagency/blockout 1.0.11 → 1.0.12
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.
- package/dist/assets/style13.css +1 -1
- package/dist/components/controls/markdown-control/editor.d.ts +3 -1
- package/dist/components/controls/markdown-control/editor.js +212 -193
- package/dist/components/controls/markdown-control/index.d.ts +3 -1
- package/dist/primitives/link/index.d.ts +5 -2
- package/dist/primitives/link/index.js +22 -17
- package/package.json +1 -1
package/dist/assets/style13.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.component-markdown-control__input{padding:calc(var(--base-control__padding) * 2);border-radius:var(--blockout__radius--md)}.component-markdown-control__input .editor:focus{outline:none}.component-markdown-editor{display:flex!important;flex-direction:column;gap:var(--base-control__padding)}.component-markdown-editor .component-markdown-editor__toolbar{padding:var(--base-control__padding) 0;border-bottom:1px solid var(--blockout__colours__surface--300)}.component-markdown-editor .component-markdown-editor__toolbar .component-button{-webkit-user-select:none;user-select:none}.component-markdown-editor:has(.component-markdown-editor__toolbar){padding-top:0}.component-markdown-editor:has(.component-markdown-editor__toolbar) .component-markdown-editor__content{padding:var(--base-control__padding)}.component-markdown-editor.component-markdown-editor--toolbar-bottom{padding-top:var(--base-control__padding);padding-bottom:0}.component-markdown-editor.component-markdown-editor--toolbar-bottom .component-markdown-editor__toolbar{order:10;border-bottom:none;border-top:1px solid var(--blockout__colours__surface--300)}.component-markdown-editor .component-markdown-editor__content{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;margin:0;color:var(--blockout__colours__surface--700);background-color:transparent;line-height:1.5;word-wrap:break-word}.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit{--blockout__colours__surface--950: #fafaf9;--blockout__colours__surface--900: #f5f5f4;--blockout__colours__surface--800: #e7e5e4;--blockout__colours__surface--700: #d6d3d1;--blockout__colours__surface--600: #a8a29e;--blockout__colours__surface--500: #78716c;--blockout__colours__surface--400: #57534e;--blockout__colours__surface--300: #44403c;--blockout__colours__surface--200: #292524;--blockout__colours__surface--100: #1c1917;--blockout__colours__surface--50: #0c0a09;--blockout__colours__surface--0: #000000;--blockout__colours__primary--950: #fffbeb;--blockout__colours__primary--900: #fef3c6;--blockout__colours__primary--800: #fee685;--blockout__colours__primary--700: #ffd230;--blockout__colours__primary--600: #ffb900;--blockout__colours__primary--500: #fe9a00;--blockout__colours__primary--400: #e17100;--blockout__colours__primary--300: #bb4d00;--blockout__colours__primary--200: #973c00;--blockout__colours__primary--100: #7a3306;--blockout__colours__primary--50: #461901;color-scheme:dark;color:var(--blockout__colours__surface--950);background-color:var(--blockout__colours__surface--200);position:absolute;z-index:90;padding:.25rem;border-radius:var(--blockout__radius--sm);border:1px solid var(--blockout__colours__surface--300);box-shadow:0 .175rem .375rem #0000001a;transition:opacity .25s ease,transform .25s ease}.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview[data-show=false],.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit[data-show=false]{opacity:0;transform:translateY(-.25rem);pointer-events:none}.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-preview,.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-edit,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-preview,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-edit{display:flex;align-items:center;gap:.25rem;width:fit-content;max-width:25rem}.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-preview .button,.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-edit .button,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-preview .button,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-edit .button{display:flex;align-items:center;justify-content:center;width:2rem;height:2rem;border-radius:var(--blockout__radius--xs);flex-shrink:0;cursor:pointer;transform:background-color .15s ease;color:transparent}.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-preview .button:hover,.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-preview .button:focus,.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-edit .button:hover,.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-edit .button:focus,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-preview .button:hover,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-preview .button:focus,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-edit .button:hover,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-edit .button:focus{background-color:var(--blockout__colours__surface--0)}.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-preview .milkdown-icon,.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-edit .milkdown-icon,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-preview .milkdown-icon,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-edit .milkdown-icon{background-size:66%;background-repeat:no-repeat;background-position:center}.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-preview .link-icon,.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-edit .link-icon,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-preview .link-icon,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-edit .link-icon{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='%2378716c' viewBox='0 0 256 256'%3E%3Cpath d='M117.18,188.74a12,12,0,0,1,0,17l-5.12,5.12A58.26,58.26,0,0,1,70.6,228h0A58.62,58.62,0,0,1,29.14,127.92L63.89,93.17a58.64,58.64,0,0,1,98.56,28.11,12,12,0,1,1-23.37,5.44,34.65,34.65,0,0,0-58.22-16.58L46.11,144.89A34.62,34.62,0,0,0,70.57,204h0a34.41,34.41,0,0,0,24.49-10.14l5.11-5.12A12,12,0,0,1,117.18,188.74ZM226.83,45.17a58.65,58.65,0,0,0-82.93,0l-5.11,5.11a12,12,0,0,0,17,17l5.12-5.12a34.63,34.63,0,1,1,49,49L175.1,145.86A34.39,34.39,0,0,1,150.61,156h0a34.63,34.63,0,0,1-33.69-26.72,12,12,0,0,0-23.38,5.44A58.64,58.64,0,0,0,150.56,180h.05a58.28,58.28,0,0,0,41.47-17.17l34.75-34.75a58.62,58.62,0,0,0,0-82.91Z'%3E%3C/path%3E%3C/svg%3E");cursor:default}.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-preview .link-icon:hover,.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-preview .link-icon:focus,.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-edit .link-icon:hover,.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-edit .link-icon:focus,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-preview .link-icon:hover,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-preview .link-icon:focus,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-edit .link-icon:hover,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-edit .link-icon:focus{background-color:transparent}.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-preview .link-edit-button,.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-edit .link-edit-button,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-preview .link-edit-button,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-edit .link-edit-button{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='%23fff' viewBox='0 0 256 256'%3E%3Cpath d='M230.14,70.54,185.46,25.85a20,20,0,0,0-28.29,0L33.86,149.17A19.85,19.85,0,0,0,28,163.31V208a20,20,0,0,0,20,20H92.69a19.86,19.86,0,0,0,14.14-5.86L230.14,98.82a20,20,0,0,0,0-28.28ZM91,204H52V165l84-84,39,39ZM192,103,153,64l18.34-18.34,39,39Z'%3E%3C/path%3E%3C/svg%3E")}.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-preview .link-remove-button,.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-edit .link-remove-button,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-preview .link-remove-button,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-edit .link-remove-button{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='%23fff' viewBox='0 0 256 256'%3E%3Cpath d='M195.8,60.2a28,28,0,0,0-39.51-.09L144.68,72.28a12,12,0,1,1-17.36-16.56L139,43.43l.2-.2a52,52,0,0,1,73.54,73.54l-.2.2-12.29,11.71a12,12,0,0,1-16.56-17.36l12.17-11.61A28,28,0,0,0,195.8,60.2ZM111.32,183.72,99.71,195.89a28,28,0,0,1-39.6-39.6l12.17-11.61a12,12,0,0,0-16.56-17.36L43.43,139l-.2.2a52,52,0,0,0,73.54,73.54l.2-.2,11.71-12.29a12,12,0,1,0-17.36-16.56ZM216,148H192a12,12,0,0,0,0,24h24a12,12,0,0,0,0-24ZM40,108H64a12,12,0,0,0,0-24H40a12,12,0,0,0,0,24Zm120,72a12,12,0,0,0-12,12v24a12,12,0,0,0,24,0V192A12,12,0,0,0,160,180ZM96,76a12,12,0,0,0,12-12V40a12,12,0,0,0-24,0V64A12,12,0,0,0,96,76Z'%3E%3C/path%3E%3C/svg%3E")}.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-preview .confirm,.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-edit .confirm,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-preview .confirm,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-edit .confirm{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='%23fff' viewBox='0 0 256 256'%3E%3Cpath d='M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z'%3E%3C/path%3E%3C/svg%3E")}.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-preview .link-display,.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-edit .link-display,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-preview .link-display,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-edit .link-display{flex-grow:1;color:var(--blockout__colours__primary--500);text-decoration:underline;display:block;min-width:0px;max-width:60vw;width:35ch;white-space:nowrap;text-overflow:ellipsis;overflow:clip;transition:color .15s ease}.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-preview .link-display:hover,.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-preview .link-display:focus,.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-edit .link-display:hover,.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-edit .link-display:focus,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-preview .link-display:hover,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-preview .link-display:focus,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-edit .link-display:hover,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-edit .link-display:focus{color:var(--blockout__colours__primary--600);text-decoration:none}.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-preview .input-area,.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-edit .input-area,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-preview .input-area,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-edit .input-area{flex-grow:1;display:block;min-width:0px;max-width:60vw;width:35ch;height:2rem;transition:background-color .15s ease;border-radius:var(--blockout__radius--xs)}.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-preview .input-area:hover,.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-preview .input-area:focus,.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-edit .input-area:hover,.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-edit .input-area:focus,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-preview .input-area:hover,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-preview .input-area:focus,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-edit .input-area:hover,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-edit .input-area:focus{background-color:var(--blockout__colours__surface--0);outline:none}.component-markdown-editor .component-markdown-editor__content .component-markdown-editor__slash{--blockout__colours__surface--950: #fafaf9;--blockout__colours__surface--900: #f5f5f4;--blockout__colours__surface--800: #e7e5e4;--blockout__colours__surface--700: #d6d3d1;--blockout__colours__surface--600: #a8a29e;--blockout__colours__surface--500: #78716c;--blockout__colours__surface--400: #57534e;--blockout__colours__surface--300: #44403c;--blockout__colours__surface--200: #292524;--blockout__colours__surface--100: #1c1917;--blockout__colours__surface--50: #0c0a09;--blockout__colours__surface--0: #000000;--blockout__colours__primary--950: #fffbeb;--blockout__colours__primary--900: #fef3c6;--blockout__colours__primary--800: #fee685;--blockout__colours__primary--700: #ffd230;--blockout__colours__primary--600: #ffb900;--blockout__colours__primary--500: #fe9a00;--blockout__colours__primary--400: #e17100;--blockout__colours__primary--300: #bb4d00;--blockout__colours__primary--200: #973c00;--blockout__colours__primary--100: #7a3306;--blockout__colours__primary--50: #461901;color-scheme:dark;color:var(--blockout__colours__surface--950);background-color:var(--blockout__colours__surface--200);position:absolute;z-index:900;border-radius:var(--blockout__radius--sm);border:1px solid var(--blockout__colours__surface--300);box-shadow:0 .175rem .375rem #0000001a;display:flex;flex-direction:column;gap:.25rem;padding:.25rem}.component-markdown-editor .component-markdown-editor__content .component-markdown-editor__slash[data-show=false]{opacity:0;pointer-events:none}.component-markdown-editor .component-markdown-editor__content .component-markdown-editor__slash .component-markdown-editor__slash__option{display:flex;justify-content:center;align-items:start;flex-direction:column;gap:.25rem;padding:.375rem .5rem .375rem .675rem;min-height:2.25rem;border-radius:var(--blockout__radius--sm);cursor:pointer;transition:background-color .25s ease}.component-markdown-editor .component-markdown-editor__content .component-markdown-editor__slash .component-markdown-editor__slash__option:focus{outline:none}.component-markdown-editor .component-markdown-editor__content .component-markdown-editor__slash .component-markdown-editor__slash__option:first-child{border-top:none}.component-markdown-editor .component-markdown-editor__content .component-markdown-editor__slash .component-markdown-editor__slash__option[aria-disabled=true] .component-markdown-editor__slash__option__label{color:var(--blockout__colours__surface--400)}.component-markdown-editor .component-markdown-editor__content .component-markdown-editor__slash .component-markdown-editor__slash__option[aria-disabled=true] .component-markdown-editor__slash__option__description{color:var(--blockout__colours__surface--300)}.component-markdown-editor .component-markdown-editor__content .component-markdown-editor__slash .component-markdown-editor__slash__option__label{display:flex;align-items:center;gap:.5rem;font-weight:500;color:var(--blockout__colours__surface--900);transition:color .25s ease;white-space:nowrap}.component-markdown-editor .component-markdown-editor__content .component-markdown-editor__slash .component-markdown-editor__slash__option__label>svg{width:1.25rem;height:1.25rem;flex-shrink:0;color:var(--blockout__colours__surface--500);fill:var(--blockout__colours__surface--500)}.component-markdown-editor .component-markdown-editor__content .component-markdown-editor__slash .component-markdown-editor__slash__option__description{font-weight:400;color:var(--blockout__colours__surface--600);font-size:.875rem;transition:color .25s ease,opacity .25s ease}.component-markdown-editor .component-markdown-editor__content .component-markdown-editor__slash .component-markdown-editor__slash__option:is([data-active-item=true],:hover,:focus){background-color:var(--blockout__colours__surface--50)}.component-markdown-editor .component-markdown-editor__content .component-markdown-editor__slash .component-markdown-editor__slash__option:is([data-active-item=true],:hover,:focus) .component-markdown-editor__slash__option__label{color:var(--blockout__colours__surface--900)}.component-markdown-editor .component-markdown-editor__content .component-markdown-editor__slash .component-markdown-editor__slash__option:is([data-active-item=true],:hover,:focus) .component-markdown-editor__slash__option__description{color:var(--blockout__colours__surface--700)}.component-markdown-editor .component-markdown-editor__content details,.component-markdown-editor .component-markdown-editor__content figcaption,.component-markdown-editor .component-markdown-editor__content figure{display:block}.component-markdown-editor .component-markdown-editor__content a{background-color:transparent;color:var(--blockout__colours__primary--500);text-decoration:underline;transition:color .15s ease}.component-markdown-editor .component-markdown-editor__content a:hover{color:var(--blockout__colours__primary--600);text-decoration:none}.component-markdown-editor .component-markdown-editor__content b,.component-markdown-editor .component-markdown-editor__content strong{font-weight:500;color:var(--blockout__colours__surface--950)}.component-markdown-editor .component-markdown-editor__content mark{background-color:var(--blockout__colours__primary--100);color:var(--blockout__colours__surface--800)}.component-markdown-editor .component-markdown-editor__content small{font-size:90%}.component-markdown-editor .component-markdown-editor__content sub,.component-markdown-editor .component-markdown-editor__content sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}.component-markdown-editor .component-markdown-editor__content sub{bottom:-.25em}.component-markdown-editor .component-markdown-editor__content sup{top:-.5em}.component-markdown-editor .component-markdown-editor__content img{border-style:none;max-width:100%;box-sizing:content-box}.component-markdown-editor .component-markdown-editor__content figure{margin:1em 2.5rem}.component-markdown-editor .component-markdown-editor__content hr{box-sizing:content-box;overflow:hidden;background:transparent;border-bottom:1px solid var(--blockout__colours__surface--300);height:.25em;padding:0;margin:1.5rem 0;background-color:var(--blockout__colours__surface--300);border:0}.component-markdown-editor .component-markdown-editor__content hr:before{display:table;content:""}.component-markdown-editor .component-markdown-editor__content hr:after{display:table;clear:both;content:""}.component-markdown-editor .component-markdown-editor__content h1,.component-markdown-editor .component-markdown-editor__content h2,.component-markdown-editor .component-markdown-editor__content h3,.component-markdown-editor .component-markdown-editor__content h4,.component-markdown-editor .component-markdown-editor__content h5,.component-markdown-editor .component-markdown-editor__content h6{margin-top:1.5rem;margin-bottom:1rem;font-weight:600;line-height:1.25;color:var(--blockout__colours__surface--950)}.component-markdown-editor .component-markdown-editor__content h1:before,.component-markdown-editor .component-markdown-editor__content h2:before,.component-markdown-editor .component-markdown-editor__content h3:before,.component-markdown-editor .component-markdown-editor__content h4:before,.component-markdown-editor .component-markdown-editor__content h5:before,.component-markdown-editor .component-markdown-editor__content h6:before{content:"#";font-weight:400;font-size:.75em;color:var(--blockout__colours__surface--400);margin-right:1ch}.component-markdown-editor .component-markdown-editor__content h1{margin:.67em 0;font-weight:600;padding-bottom:.3em;font-size:2em;border-bottom:1px solid var(--blockout__colours__surface--300)}.component-markdown-editor .component-markdown-editor__content h1:before{content:"#"}.component-markdown-editor .component-markdown-editor__content h2{font-weight:600;padding-bottom:.3em;font-size:1.5em;border-bottom:1px solid var(--blockout__colours__surface--300)}.component-markdown-editor .component-markdown-editor__content h2:before{content:"##"}.component-markdown-editor .component-markdown-editor__content h3{font-weight:600;font-size:1.25em}.component-markdown-editor .component-markdown-editor__content h3:before{content:"###"}.component-markdown-editor .component-markdown-editor__content h4{font-weight:600;font-size:1em}.component-markdown-editor .component-markdown-editor__content h4:before{content:"####"}.component-markdown-editor .component-markdown-editor__content h5{font-weight:600;font-size:.875em}.component-markdown-editor .component-markdown-editor__content h6{font-weight:600;font-size:.85em;color:#59636e}.component-markdown-editor .component-markdown-editor__content p{margin-top:0;margin-bottom:10px}.component-markdown-editor .component-markdown-editor__content blockquote{margin:0;padding:0 1em;color:#59636e;border-left:.25em solid var(--blockout__colours__surface--300)}.component-markdown-editor .component-markdown-editor__content ul,.component-markdown-editor .component-markdown-editor__content ol{margin-top:0;margin-bottom:0;padding-left:2em;list-style:disc}.component-markdown-editor .component-markdown-editor__content ol{list-style:decimal}.component-markdown-editor .component-markdown-editor__content ol ol,.component-markdown-editor .component-markdown-editor__content ul ol{list-style-type:lower-roman}.component-markdown-editor .component-markdown-editor__content ul ul ol,.component-markdown-editor .component-markdown-editor__content ul ol ol,.component-markdown-editor .component-markdown-editor__content ol ul ol,.component-markdown-editor .component-markdown-editor__content ol ol ol{list-style-type:lower-alpha}.component-markdown-editor .component-markdown-editor__content .milkdown-list-item-block,.component-markdown-editor .component-markdown-editor__content .milkdown-list-item-block .list-item{list-style:inherit}.component-markdown-editor .component-markdown-editor__content :is(ul,ol):has(.milkdown-icon.unchecked,.milkdown-icon.checked){padding-left:1em}.component-markdown-editor .component-markdown-editor__content :is(ul,ol):has(.milkdown-icon.unchecked,.milkdown-icon.checked) .list-item{display:flex;align-items:start;gap:.5em;margin-bottom:1rem}.component-markdown-editor .component-markdown-editor__content :is(ul,ol):has(.milkdown-icon.unchecked,.milkdown-icon.checked) .list-item p{flex-grow:1;margin-bottom:0}.component-markdown-editor .component-markdown-editor__content :is(ul,ol):has(.milkdown-icon.unchecked,.milkdown-icon.checked) .list-item .milkdown-icon{display:block;width:1.25rem;height:1.25rem;border:1px solid var(--blockout__colours__surface--300);border-radius:var(--blockout__radius--xs);cursor:pointer;background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="%23fff" viewBox="0 0 256 256"><path d="M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z"></path></svg>');background-size:80%;background-repeat:no-repeat;background-position:center;transition:background-color .15s ease,border-color .15s ease;position:relative;top:.125rem}.component-markdown-editor .component-markdown-editor__content :is(ul,ol):has(.milkdown-icon.unchecked,.milkdown-icon.checked) .list-item .milkdown-icon:hover{border-color:var(--blockout__colours__primary--500)}.component-markdown-editor .component-markdown-editor__content :is(ul,ol):has(.milkdown-icon.unchecked,.milkdown-icon.checked) .list-item .milkdown-icon.checked{background-color:var(--blockout__colours__primary--500);border-color:var(--blockout__colours__primary--500)}.component-markdown-editor .component-markdown-editor__content .editor>*:first-child{margin-top:0!important}.component-markdown-editor .component-markdown-editor__content .editor>*:last-child{margin-bottom:0!important}.component-markdown-editor .component-markdown-editor__content a:not([href]){color:inherit;text-decoration:none}.component-markdown-editor .component-markdown-editor__content p,.component-markdown-editor .component-markdown-editor__content blockquote,.component-markdown-editor .component-markdown-editor__content ul,.component-markdown-editor .component-markdown-editor__content ol,.component-markdown-editor .component-markdown-editor__content table{margin-top:0;margin-bottom:1rem}.component-markdown-editor .component-markdown-editor__content blockquote>:first-child{margin-top:0}.component-markdown-editor .component-markdown-editor__content blockquote>:last-child{margin-bottom:0}.component-markdown-editor .component-markdown-editor__content ul ul,.component-markdown-editor .component-markdown-editor__content ul ol,.component-markdown-editor .component-markdown-editor__content ol ol,.component-markdown-editor .component-markdown-editor__content ol ul{margin-top:0;margin-bottom:0}.component-markdown-editor .component-markdown-editor__content li>p{margin:0}.component-markdown-editor .component-markdown-editor__content li+li{margin-top:.25em}.component-markdown-editor .component-markdown-editor__content table{border-spacing:0;border-collapse:collapse;display:block;width:max-content;max-width:100%;overflow:auto;font-variant:tabular-nums}.component-markdown-editor .component-markdown-editor__content td,.component-markdown-editor .component-markdown-editor__content th{padding:0}.component-markdown-editor .component-markdown-editor__content table th{font-weight:600}.component-markdown-editor .component-markdown-editor__content table th,.component-markdown-editor .component-markdown-editor__content table td{padding:6px 13px;border:1px solid var(--blockout__colours__surface--300)}.component-markdown-editor .component-markdown-editor__content table th>:last-child,.component-markdown-editor .component-markdown-editor__content table td>:last-child{margin-bottom:0}.component-markdown-editor .component-markdown-editor__content table tr{background-color:var(--blockout__colours__surface--0);border-top:1px solid var(--blockout__colours__surface--300)}.component-markdown-editor .component-markdown-editor__content table tr:nth-child(2n){background-color:var(--blockout__colours__surface--50)}.component-markdown-editor .component-markdown-editor__content table img{background-color:transparent}.component-markdown-editor .component-markdown-editor__content img.emoji{display:inline;height:1rem;width:1rem}
|
|
1
|
+
.component-markdown-control__input{padding:calc(var(--base-control__padding) * 2);border-radius:var(--blockout__radius--md)}.component-markdown-control__input .editor:focus{outline:none}.component-markdown-editor{display:flex!important;flex-direction:column;padding:0!important}.component-markdown-editor .component-markdown-editor__toolbar{padding:var(--base-control__padding) 0;margin:0 var(--base-control__padding);border-bottom:1px solid var(--blockout__colours__surface--300)}.component-markdown-editor .component-markdown-editor__toolbar .component-button{-webkit-user-select:none;user-select:none}.component-markdown-editor:has(.component-markdown-editor__toolbar){padding-top:0}.component-markdown-editor:has(.component-markdown-editor__toolbar) .component-markdown-editor__content{padding:calc(var(--base-control__padding) * 2)}.component-markdown-editor.component-markdown-editor--toolbar-bottom{padding-top:var(--base-control__padding);padding-bottom:0}.component-markdown-editor.component-markdown-editor--toolbar-bottom .component-markdown-editor__toolbar{order:10;border-bottom:none;border-top:1px solid var(--blockout__colours__surface--300)}.component-markdown-editor .component-markdown-editor__content{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;margin:0;color:var(--blockout__colours__surface--700);background-color:transparent;line-height:1.5;word-wrap:break-word}.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit{--blockout__colours__surface--950: #fafaf9;--blockout__colours__surface--900: #f5f5f4;--blockout__colours__surface--800: #e7e5e4;--blockout__colours__surface--700: #d6d3d1;--blockout__colours__surface--600: #a8a29e;--blockout__colours__surface--500: #78716c;--blockout__colours__surface--400: #57534e;--blockout__colours__surface--300: #44403c;--blockout__colours__surface--200: #292524;--blockout__colours__surface--100: #1c1917;--blockout__colours__surface--50: #0c0a09;--blockout__colours__surface--0: #000000;--blockout__colours__primary--950: #fffbeb;--blockout__colours__primary--900: #fef3c6;--blockout__colours__primary--800: #fee685;--blockout__colours__primary--700: #ffd230;--blockout__colours__primary--600: #ffb900;--blockout__colours__primary--500: #fe9a00;--blockout__colours__primary--400: #e17100;--blockout__colours__primary--300: #bb4d00;--blockout__colours__primary--200: #973c00;--blockout__colours__primary--100: #7a3306;--blockout__colours__primary--50: #461901;color-scheme:dark;color:var(--blockout__colours__surface--950);background-color:var(--blockout__colours__surface--200);position:absolute;z-index:90;padding:.25rem;border-radius:var(--blockout__radius--sm);border:1px solid var(--blockout__colours__surface--300);box-shadow:0 .175rem .375rem #0000001a;transition:opacity .25s ease,transform .25s ease}.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview[data-show=false],.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit[data-show=false]{opacity:0;transform:translateY(-.25rem);pointer-events:none}.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-preview,.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-edit,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-preview,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-edit{display:flex;align-items:center;gap:.25rem;width:fit-content;max-width:25rem}.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-preview .button,.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-edit .button,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-preview .button,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-edit .button{display:flex;align-items:center;justify-content:center;width:2rem;height:2rem;border-radius:var(--blockout__radius--xs);flex-shrink:0;cursor:pointer;transform:background-color .15s ease;color:transparent}.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-preview .button:hover,.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-preview .button:focus,.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-edit .button:hover,.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-edit .button:focus,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-preview .button:hover,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-preview .button:focus,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-edit .button:hover,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-edit .button:focus{background-color:var(--blockout__colours__surface--0)}.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-preview .milkdown-icon,.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-edit .milkdown-icon,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-preview .milkdown-icon,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-edit .milkdown-icon{background-size:66%;background-repeat:no-repeat;background-position:center}.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-preview .link-icon,.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-edit .link-icon,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-preview .link-icon,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-edit .link-icon{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='%2378716c' viewBox='0 0 256 256'%3E%3Cpath d='M117.18,188.74a12,12,0,0,1,0,17l-5.12,5.12A58.26,58.26,0,0,1,70.6,228h0A58.62,58.62,0,0,1,29.14,127.92L63.89,93.17a58.64,58.64,0,0,1,98.56,28.11,12,12,0,1,1-23.37,5.44,34.65,34.65,0,0,0-58.22-16.58L46.11,144.89A34.62,34.62,0,0,0,70.57,204h0a34.41,34.41,0,0,0,24.49-10.14l5.11-5.12A12,12,0,0,1,117.18,188.74ZM226.83,45.17a58.65,58.65,0,0,0-82.93,0l-5.11,5.11a12,12,0,0,0,17,17l5.12-5.12a34.63,34.63,0,1,1,49,49L175.1,145.86A34.39,34.39,0,0,1,150.61,156h0a34.63,34.63,0,0,1-33.69-26.72,12,12,0,0,0-23.38,5.44A58.64,58.64,0,0,0,150.56,180h.05a58.28,58.28,0,0,0,41.47-17.17l34.75-34.75a58.62,58.62,0,0,0,0-82.91Z'%3E%3C/path%3E%3C/svg%3E");cursor:default}.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-preview .link-icon:hover,.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-preview .link-icon:focus,.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-edit .link-icon:hover,.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-edit .link-icon:focus,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-preview .link-icon:hover,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-preview .link-icon:focus,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-edit .link-icon:hover,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-edit .link-icon:focus{background-color:transparent}.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-preview .link-edit-button,.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-edit .link-edit-button,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-preview .link-edit-button,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-edit .link-edit-button{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='%23fff' viewBox='0 0 256 256'%3E%3Cpath d='M230.14,70.54,185.46,25.85a20,20,0,0,0-28.29,0L33.86,149.17A19.85,19.85,0,0,0,28,163.31V208a20,20,0,0,0,20,20H92.69a19.86,19.86,0,0,0,14.14-5.86L230.14,98.82a20,20,0,0,0,0-28.28ZM91,204H52V165l84-84,39,39ZM192,103,153,64l18.34-18.34,39,39Z'%3E%3C/path%3E%3C/svg%3E")}.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-preview .link-remove-button,.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-edit .link-remove-button,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-preview .link-remove-button,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-edit .link-remove-button{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='%23fff' viewBox='0 0 256 256'%3E%3Cpath d='M195.8,60.2a28,28,0,0,0-39.51-.09L144.68,72.28a12,12,0,1,1-17.36-16.56L139,43.43l.2-.2a52,52,0,0,1,73.54,73.54l-.2.2-12.29,11.71a12,12,0,0,1-16.56-17.36l12.17-11.61A28,28,0,0,0,195.8,60.2ZM111.32,183.72,99.71,195.89a28,28,0,0,1-39.6-39.6l12.17-11.61a12,12,0,0,0-16.56-17.36L43.43,139l-.2.2a52,52,0,0,0,73.54,73.54l.2-.2,11.71-12.29a12,12,0,1,0-17.36-16.56ZM216,148H192a12,12,0,0,0,0,24h24a12,12,0,0,0,0-24ZM40,108H64a12,12,0,0,0,0-24H40a12,12,0,0,0,0,24Zm120,72a12,12,0,0,0-12,12v24a12,12,0,0,0,24,0V192A12,12,0,0,0,160,180ZM96,76a12,12,0,0,0,12-12V40a12,12,0,0,0-24,0V64A12,12,0,0,0,96,76Z'%3E%3C/path%3E%3C/svg%3E")}.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-preview .confirm,.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-edit .confirm,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-preview .confirm,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-edit .confirm{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='%23fff' viewBox='0 0 256 256'%3E%3Cpath d='M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z'%3E%3C/path%3E%3C/svg%3E")}.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-preview .link-display,.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-edit .link-display,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-preview .link-display,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-edit .link-display{flex-grow:1;color:var(--blockout__colours__primary--500);text-decoration:underline;display:block;min-width:0px;max-width:60vw;width:35ch;white-space:nowrap;text-overflow:ellipsis;overflow:clip;transition:color .15s ease}.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-preview .link-display:hover,.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-preview .link-display:focus,.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-edit .link-display:hover,.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-edit .link-display:focus,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-preview .link-display:hover,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-preview .link-display:focus,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-edit .link-display:hover,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-edit .link-display:focus{color:var(--blockout__colours__primary--600);text-decoration:none}.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-preview .input-area,.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-edit .input-area,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-preview .input-area,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-edit .input-area{flex-grow:1;display:block;min-width:0px;max-width:60vw;width:35ch;height:2rem;transition:background-color .15s ease;border-radius:var(--blockout__radius--xs)}.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-preview .input-area:hover,.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-preview .input-area:focus,.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-edit .input-area:hover,.component-markdown-editor .component-markdown-editor__content .milkdown-link-preview .link-edit .input-area:focus,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-preview .input-area:hover,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-preview .input-area:focus,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-edit .input-area:hover,.component-markdown-editor .component-markdown-editor__content .milkdown-link-edit .link-edit .input-area:focus{background-color:var(--blockout__colours__surface--0);outline:none}.component-markdown-editor .component-markdown-editor__content .component-markdown-editor__slash{--blockout__colours__surface--950: #fafaf9;--blockout__colours__surface--900: #f5f5f4;--blockout__colours__surface--800: #e7e5e4;--blockout__colours__surface--700: #d6d3d1;--blockout__colours__surface--600: #a8a29e;--blockout__colours__surface--500: #78716c;--blockout__colours__surface--400: #57534e;--blockout__colours__surface--300: #44403c;--blockout__colours__surface--200: #292524;--blockout__colours__surface--100: #1c1917;--blockout__colours__surface--50: #0c0a09;--blockout__colours__surface--0: #000000;--blockout__colours__primary--950: #fffbeb;--blockout__colours__primary--900: #fef3c6;--blockout__colours__primary--800: #fee685;--blockout__colours__primary--700: #ffd230;--blockout__colours__primary--600: #ffb900;--blockout__colours__primary--500: #fe9a00;--blockout__colours__primary--400: #e17100;--blockout__colours__primary--300: #bb4d00;--blockout__colours__primary--200: #973c00;--blockout__colours__primary--100: #7a3306;--blockout__colours__primary--50: #461901;color-scheme:dark;color:var(--blockout__colours__surface--950);background-color:var(--blockout__colours__surface--200);position:absolute;z-index:900;border-radius:var(--blockout__radius--sm);border:1px solid var(--blockout__colours__surface--300);box-shadow:0 .175rem .375rem #0000001a;display:flex;flex-direction:column;gap:.25rem;padding:.25rem}.component-markdown-editor .component-markdown-editor__content .component-markdown-editor__slash[data-show=false]{opacity:0;pointer-events:none}.component-markdown-editor .component-markdown-editor__content .component-markdown-editor__slash .component-markdown-editor__slash__option{display:flex;justify-content:center;align-items:start;flex-direction:column;gap:.25rem;padding:.375rem .5rem .375rem .675rem;min-height:2.25rem;border-radius:var(--blockout__radius--sm);cursor:pointer;transition:background-color .25s ease}.component-markdown-editor .component-markdown-editor__content .component-markdown-editor__slash .component-markdown-editor__slash__option:focus{outline:none}.component-markdown-editor .component-markdown-editor__content .component-markdown-editor__slash .component-markdown-editor__slash__option:first-child{border-top:none}.component-markdown-editor .component-markdown-editor__content .component-markdown-editor__slash .component-markdown-editor__slash__option[aria-disabled=true] .component-markdown-editor__slash__option__label{color:var(--blockout__colours__surface--400)}.component-markdown-editor .component-markdown-editor__content .component-markdown-editor__slash .component-markdown-editor__slash__option[aria-disabled=true] .component-markdown-editor__slash__option__description{color:var(--blockout__colours__surface--300)}.component-markdown-editor .component-markdown-editor__content .component-markdown-editor__slash .component-markdown-editor__slash__option__label{display:flex;align-items:center;gap:.5rem;font-weight:500;color:var(--blockout__colours__surface--900);transition:color .25s ease;white-space:nowrap}.component-markdown-editor .component-markdown-editor__content .component-markdown-editor__slash .component-markdown-editor__slash__option__label>svg{width:1.25rem;height:1.25rem;flex-shrink:0;color:var(--blockout__colours__surface--500);fill:var(--blockout__colours__surface--500)}.component-markdown-editor .component-markdown-editor__content .component-markdown-editor__slash .component-markdown-editor__slash__option__description{font-weight:400;color:var(--blockout__colours__surface--600);font-size:.875rem;transition:color .25s ease,opacity .25s ease}.component-markdown-editor .component-markdown-editor__content .component-markdown-editor__slash .component-markdown-editor__slash__option:is([data-active-item=true],:hover,:focus){background-color:var(--blockout__colours__surface--50)}.component-markdown-editor .component-markdown-editor__content .component-markdown-editor__slash .component-markdown-editor__slash__option:is([data-active-item=true],:hover,:focus) .component-markdown-editor__slash__option__label{color:var(--blockout__colours__surface--900)}.component-markdown-editor .component-markdown-editor__content .component-markdown-editor__slash .component-markdown-editor__slash__option:is([data-active-item=true],:hover,:focus) .component-markdown-editor__slash__option__description{color:var(--blockout__colours__surface--700)}.component-markdown-editor .component-markdown-editor__content details,.component-markdown-editor .component-markdown-editor__content figcaption,.component-markdown-editor .component-markdown-editor__content figure{display:block}.component-markdown-editor .component-markdown-editor__content a{background-color:transparent;color:var(--blockout__colours__primary--500);text-decoration:underline;transition:color .15s ease}.component-markdown-editor .component-markdown-editor__content a:hover{color:var(--blockout__colours__primary--600);text-decoration:none}.component-markdown-editor .component-markdown-editor__content b,.component-markdown-editor .component-markdown-editor__content strong{font-weight:500;color:var(--blockout__colours__surface--950)}.component-markdown-editor .component-markdown-editor__content mark{background-color:var(--blockout__colours__primary--100);color:var(--blockout__colours__surface--800)}.component-markdown-editor .component-markdown-editor__content small{font-size:90%}.component-markdown-editor .component-markdown-editor__content sub,.component-markdown-editor .component-markdown-editor__content sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}.component-markdown-editor .component-markdown-editor__content sub{bottom:-.25em}.component-markdown-editor .component-markdown-editor__content sup{top:-.5em}.component-markdown-editor .component-markdown-editor__content img{border-style:none;max-width:100%;box-sizing:content-box}.component-markdown-editor .component-markdown-editor__content figure{margin:1em 2.5rem}.component-markdown-editor .component-markdown-editor__content hr{box-sizing:content-box;overflow:hidden;background:transparent;border-bottom:1px solid var(--blockout__colours__surface--300);height:.25em;padding:0;margin:1.5rem 0;background-color:var(--blockout__colours__surface--300);border:0}.component-markdown-editor .component-markdown-editor__content hr:before{display:table;content:""}.component-markdown-editor .component-markdown-editor__content hr:after{display:table;clear:both;content:""}.component-markdown-editor .component-markdown-editor__content h1,.component-markdown-editor .component-markdown-editor__content h2,.component-markdown-editor .component-markdown-editor__content h3,.component-markdown-editor .component-markdown-editor__content h4,.component-markdown-editor .component-markdown-editor__content h5,.component-markdown-editor .component-markdown-editor__content h6{margin-top:1.5rem;margin-bottom:1rem;font-weight:600;line-height:1.25;color:var(--blockout__colours__surface--950)}.component-markdown-editor .component-markdown-editor__content h1:before,.component-markdown-editor .component-markdown-editor__content h2:before,.component-markdown-editor .component-markdown-editor__content h3:before,.component-markdown-editor .component-markdown-editor__content h4:before,.component-markdown-editor .component-markdown-editor__content h5:before,.component-markdown-editor .component-markdown-editor__content h6:before{content:"#";font-weight:400;font-size:.75em;color:var(--blockout__colours__surface--400);margin-right:1ch}.component-markdown-editor .component-markdown-editor__content h1{margin:.67em 0;font-weight:600;padding-bottom:.3em;font-size:2em;border-bottom:1px solid var(--blockout__colours__surface--300)}.component-markdown-editor .component-markdown-editor__content h1:before{content:"#"}.component-markdown-editor .component-markdown-editor__content h2{font-weight:600;padding-bottom:.3em;font-size:1.5em;border-bottom:1px solid var(--blockout__colours__surface--300)}.component-markdown-editor .component-markdown-editor__content h2:before{content:"##"}.component-markdown-editor .component-markdown-editor__content h3{font-weight:600;font-size:1.25em}.component-markdown-editor .component-markdown-editor__content h3:before{content:"###"}.component-markdown-editor .component-markdown-editor__content h4{font-weight:600;font-size:1em}.component-markdown-editor .component-markdown-editor__content h4:before{content:"####"}.component-markdown-editor .component-markdown-editor__content h5{font-weight:600;font-size:.875em}.component-markdown-editor .component-markdown-editor__content h6{font-weight:600;font-size:.85em;color:#59636e}.component-markdown-editor .component-markdown-editor__content p{margin-top:0;margin-bottom:10px}.component-markdown-editor .component-markdown-editor__content blockquote{margin:0;padding:0 1em;color:#59636e;border-left:.25em solid var(--blockout__colours__surface--300)}.component-markdown-editor .component-markdown-editor__content ul,.component-markdown-editor .component-markdown-editor__content ol{margin-top:0;margin-bottom:0;padding-left:2em;list-style:disc}.component-markdown-editor .component-markdown-editor__content ol{list-style:decimal}.component-markdown-editor .component-markdown-editor__content ol ol,.component-markdown-editor .component-markdown-editor__content ul ol{list-style-type:lower-roman}.component-markdown-editor .component-markdown-editor__content ul ul ol,.component-markdown-editor .component-markdown-editor__content ul ol ol,.component-markdown-editor .component-markdown-editor__content ol ul ol,.component-markdown-editor .component-markdown-editor__content ol ol ol{list-style-type:lower-alpha}.component-markdown-editor .component-markdown-editor__content .milkdown-list-item-block,.component-markdown-editor .component-markdown-editor__content .milkdown-list-item-block .list-item{list-style:inherit}.component-markdown-editor .component-markdown-editor__content :is(ul,ol):has(.milkdown-icon.unchecked,.milkdown-icon.checked){padding-left:1em}.component-markdown-editor .component-markdown-editor__content :is(ul,ol):has(.milkdown-icon.unchecked,.milkdown-icon.checked) .list-item{display:flex;align-items:start;gap:.5em;margin-bottom:1rem}.component-markdown-editor .component-markdown-editor__content :is(ul,ol):has(.milkdown-icon.unchecked,.milkdown-icon.checked) .list-item p{flex-grow:1;margin-bottom:0}.component-markdown-editor .component-markdown-editor__content :is(ul,ol):has(.milkdown-icon.unchecked,.milkdown-icon.checked) .list-item .milkdown-icon{display:block;width:1.25rem;height:1.25rem;border:1px solid var(--blockout__colours__surface--300);border-radius:var(--blockout__radius--xs);cursor:pointer;background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="%23fff" viewBox="0 0 256 256"><path d="M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z"></path></svg>');background-size:80%;background-repeat:no-repeat;background-position:center;transition:background-color .15s ease,border-color .15s ease;position:relative;top:.125rem}.component-markdown-editor .component-markdown-editor__content :is(ul,ol):has(.milkdown-icon.unchecked,.milkdown-icon.checked) .list-item .milkdown-icon:hover{border-color:var(--blockout__colours__primary--500)}.component-markdown-editor .component-markdown-editor__content :is(ul,ol):has(.milkdown-icon.unchecked,.milkdown-icon.checked) .list-item .milkdown-icon.checked{background-color:var(--blockout__colours__primary--500);border-color:var(--blockout__colours__primary--500)}.component-markdown-editor .component-markdown-editor__content .editor>*:first-child{margin-top:0!important}.component-markdown-editor .component-markdown-editor__content .editor>*:last-child{margin-bottom:0!important}.component-markdown-editor .component-markdown-editor__content a:not([href]){color:inherit;text-decoration:none}.component-markdown-editor .component-markdown-editor__content p,.component-markdown-editor .component-markdown-editor__content blockquote,.component-markdown-editor .component-markdown-editor__content ul,.component-markdown-editor .component-markdown-editor__content ol,.component-markdown-editor .component-markdown-editor__content table{margin-top:0;margin-bottom:1rem}.component-markdown-editor .component-markdown-editor__content blockquote>:first-child{margin-top:0}.component-markdown-editor .component-markdown-editor__content blockquote>:last-child{margin-bottom:0}.component-markdown-editor .component-markdown-editor__content ul ul,.component-markdown-editor .component-markdown-editor__content ul ol,.component-markdown-editor .component-markdown-editor__content ol ol,.component-markdown-editor .component-markdown-editor__content ol ul{margin-top:0;margin-bottom:0}.component-markdown-editor .component-markdown-editor__content li>p{margin:0}.component-markdown-editor .component-markdown-editor__content li+li{margin-top:.25em}.component-markdown-editor .component-markdown-editor__content table{border-spacing:0;border-collapse:collapse;display:block;width:max-content;max-width:100%;overflow:auto;font-variant:tabular-nums}.component-markdown-editor .component-markdown-editor__content td,.component-markdown-editor .component-markdown-editor__content th{padding:0}.component-markdown-editor .component-markdown-editor__content table th{font-weight:600}.component-markdown-editor .component-markdown-editor__content table th,.component-markdown-editor .component-markdown-editor__content table td{padding:6px 13px;border:1px solid var(--blockout__colours__surface--300)}.component-markdown-editor .component-markdown-editor__content table th>:last-child,.component-markdown-editor .component-markdown-editor__content table td>:last-child{margin-bottom:0}.component-markdown-editor .component-markdown-editor__content table tr{background-color:var(--blockout__colours__surface--0);border-top:1px solid var(--blockout__colours__surface--300)}.component-markdown-editor .component-markdown-editor__content table tr:nth-child(2n){background-color:var(--blockout__colours__surface--50)}.component-markdown-editor .component-markdown-editor__content table img{background-color:transparent}.component-markdown-editor .component-markdown-editor__content img.emoji{display:inline;height:1rem;width:1rem}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Editor } from '@milkdown/kit/core';
|
|
2
|
+
import { FC, PropsWithChildren, RefObject } from 'react';
|
|
2
3
|
interface MarkdownEditorProps extends PropsWithChildren {
|
|
3
4
|
className?: string;
|
|
4
5
|
value?: string;
|
|
5
6
|
onChangeValue?: (value: string) => void;
|
|
6
7
|
placeholder?: string;
|
|
7
8
|
toolbar?: "top" | "bottom" | false;
|
|
9
|
+
milkdownRef?: RefObject<Editor | undefined>;
|
|
8
10
|
}
|
|
9
11
|
export declare const MarkdownEditor: FC<MarkdownEditorProps>;
|
|
10
12
|
export {};
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as C, jsxs as ge } from "react/jsx-runtime";
|
|
2
2
|
import { cn as ye } from "../../../utils/css.js";
|
|
3
|
-
import { r as T, w as ve, c as we, d as be, a as W, h as S, b as F, p as
|
|
4
|
-
import { $ as X, d as
|
|
5
|
-
import { l as
|
|
3
|
+
import { r as T, w as ve, c as we, d as be, a as W, h as S, b as F, p as Ie, E as Me, l as ke, e as Ee, f as Ce } from "../../../toolbar-CCiZ_PIy.js";
|
|
4
|
+
import { $ as X, d as Le, T as Y, a as ee, s as Pe, g as Oe, b as N, P as z, h as te, i as Te, j as Se, k as _e, l as Ae, m as De, M as Ne, n as je, o as ne, q as G, r as xe, I as Ue, S as Fe, t as Be, E as qe, e as ze, u as $e, v as He, w as Ke } from "../../../index-EPj3dCzl.js";
|
|
5
|
+
import { l as Re, c as We, g as Ge, w as Ve } from "../../../commands-IQnqt4xL.js";
|
|
6
6
|
import '../../../assets/prosemirror.css';/* empty css */
|
|
7
|
-
import { d as
|
|
8
|
-
import { P as
|
|
9
|
-
import "react";
|
|
10
|
-
import { useMentionsPlugin as
|
|
11
|
-
var
|
|
7
|
+
import { d as Je, M as Ze, a as Qe, u as Xe, b as Ye } from "../../../index-CwFPDtaz.js";
|
|
8
|
+
import { P as et } from "../../../base-jB1DIMnz.js";
|
|
9
|
+
import { useEffect as tt } from "react";
|
|
10
|
+
import { useMentionsPlugin as nt } from "./slash/mentions.js";
|
|
11
|
+
var rt = Object.defineProperty, V = Object.getOwnPropertySymbols, st = Object.prototype.hasOwnProperty, it = Object.prototype.propertyIsEnumerable, J = (n, e, t) => e in n ? rt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, ot = (n, e) => {
|
|
12
12
|
for (var t in e || (e = {}))
|
|
13
|
-
|
|
13
|
+
st.call(e, t) && J(n, t, e[t]);
|
|
14
14
|
if (V)
|
|
15
15
|
for (var t of V(e))
|
|
16
|
-
|
|
16
|
+
it.call(e, t) && J(n, t, e[t]);
|
|
17
17
|
return n;
|
|
18
18
|
};
|
|
19
19
|
function re(n, e) {
|
|
20
20
|
return Object.assign(n, {
|
|
21
|
-
meta:
|
|
21
|
+
meta: ot({
|
|
22
22
|
package: "@milkdown/components"
|
|
23
23
|
}, e)
|
|
24
24
|
}), n;
|
|
25
25
|
}
|
|
26
|
-
const
|
|
26
|
+
const at = {
|
|
27
27
|
renderLabel: ({ label: n, listType: e, checked: t }) => t == null ? e === "bullet" ? "⦿" : n : t ? "☑" : "□"
|
|
28
|
-
},
|
|
29
|
-
|
|
28
|
+
}, j = X(
|
|
29
|
+
at,
|
|
30
30
|
"listItemBlockConfigCtx"
|
|
31
31
|
);
|
|
32
|
-
re(
|
|
32
|
+
re(j, {
|
|
33
33
|
displayName: "Config<list-item-block>",
|
|
34
34
|
group: "ListItemBlock"
|
|
35
35
|
});
|
|
@@ -39,7 +39,7 @@ function se({ icon: n, class: e, onClick: t }) {
|
|
|
39
39
|
{
|
|
40
40
|
class: F("milkdown-icon", e),
|
|
41
41
|
onPointerdown: t,
|
|
42
|
-
innerHTML: n ?
|
|
42
|
+
innerHTML: n ? Ie.sanitize(n.trim()) : void 0
|
|
43
43
|
}
|
|
44
44
|
);
|
|
45
45
|
}
|
|
@@ -57,7 +57,7 @@ se.props = {
|
|
|
57
57
|
required: !1
|
|
58
58
|
}
|
|
59
59
|
};
|
|
60
|
-
const
|
|
60
|
+
const lt = be({
|
|
61
61
|
props: {
|
|
62
62
|
label: {
|
|
63
63
|
type: Object,
|
|
@@ -100,13 +100,13 @@ const it = be({
|
|
|
100
100
|
readonly: r,
|
|
101
101
|
setAttr: i,
|
|
102
102
|
onMount: o,
|
|
103
|
-
selected:
|
|
103
|
+
selected: l
|
|
104
104
|
}) {
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
},
|
|
108
|
-
|
|
109
|
-
},
|
|
105
|
+
const a = (c) => {
|
|
106
|
+
c != null && c instanceof Element && o(c);
|
|
107
|
+
}, u = (c) => {
|
|
108
|
+
c.stopPropagation(), c.preventDefault(), e.value != null && i("checked", !e.value);
|
|
109
|
+
}, d = W(() => s.renderLabel({
|
|
110
110
|
label: n.value,
|
|
111
111
|
listType: t.value,
|
|
112
112
|
checked: e.value,
|
|
@@ -117,14 +117,14 @@ const it = be({
|
|
|
117
117
|
{
|
|
118
118
|
class: F(
|
|
119
119
|
"list-item",
|
|
120
|
-
|
|
120
|
+
l.value && "ProseMirror-selectednode"
|
|
121
121
|
)
|
|
122
122
|
},
|
|
123
123
|
/* @__PURE__ */ S(
|
|
124
124
|
"div",
|
|
125
125
|
{
|
|
126
126
|
class: "label-wrapper",
|
|
127
|
-
onPointerdown:
|
|
127
|
+
onPointerdown: u,
|
|
128
128
|
contenteditable: !1
|
|
129
129
|
},
|
|
130
130
|
/* @__PURE__ */ S(
|
|
@@ -135,39 +135,39 @@ const it = be({
|
|
|
135
135
|
r.value && "readonly",
|
|
136
136
|
p.value
|
|
137
137
|
),
|
|
138
|
-
icon:
|
|
138
|
+
icon: d.value
|
|
139
139
|
}
|
|
140
140
|
)
|
|
141
141
|
),
|
|
142
|
-
/* @__PURE__ */ S("div", { class: "children", ref:
|
|
142
|
+
/* @__PURE__ */ S("div", { class: "children", ref: a })
|
|
143
143
|
);
|
|
144
144
|
}
|
|
145
|
-
}), ie =
|
|
146
|
-
|
|
145
|
+
}), ie = Le(
|
|
146
|
+
Re.node,
|
|
147
147
|
(n) => (e, t, s) => {
|
|
148
148
|
const r = document.createElement("div");
|
|
149
149
|
r.className = "milkdown-list-item-block";
|
|
150
150
|
const i = document.createElement("div");
|
|
151
151
|
i.setAttribute("data-content-dom", "true"), i.classList.add("content-dom");
|
|
152
|
-
const o = T(e.attrs.label),
|
|
152
|
+
const o = T(e.attrs.label), l = T(e.attrs.checked), a = T(e.attrs.listType), u = T(!t.editable), d = n.get(j.key), p = T(!1), c = (f, E) => {
|
|
153
153
|
if (!t.editable) return;
|
|
154
154
|
const w = s();
|
|
155
|
-
w != null && (t.hasFocus() || t.focus(), t.dispatch(t.state.tr.setNodeAttribute(w,
|
|
155
|
+
w != null && (t.hasFocus() || t.focus(), t.dispatch(t.state.tr.setNodeAttribute(w, f, E)));
|
|
156
156
|
}, h = ve(() => {
|
|
157
157
|
p.value ? r.classList.add("selected") : r.classList.remove("selected");
|
|
158
158
|
});
|
|
159
159
|
let g = 0;
|
|
160
|
-
const b = we(
|
|
160
|
+
const b = we(lt, {
|
|
161
161
|
label: o,
|
|
162
|
-
checked:
|
|
163
|
-
listType:
|
|
164
|
-
readonly:
|
|
165
|
-
config:
|
|
162
|
+
checked: l,
|
|
163
|
+
listType: a,
|
|
164
|
+
readonly: u,
|
|
165
|
+
config: d,
|
|
166
166
|
selected: p,
|
|
167
|
-
setAttr:
|
|
168
|
-
onMount: (
|
|
167
|
+
setAttr: c,
|
|
168
|
+
onMount: (f) => {
|
|
169
169
|
const { anchor: E, head: w } = t.state.selection;
|
|
170
|
-
|
|
170
|
+
f.appendChild(i);
|
|
171
171
|
const _ = t.state.doc.resolve(E), he = t.state.doc.resolve(w);
|
|
172
172
|
g = requestAnimationFrame(() => {
|
|
173
173
|
if (cancelAnimationFrame(g), !_.doc.eq(t.state.doc)) return;
|
|
@@ -177,16 +177,16 @@ const it = be({
|
|
|
177
177
|
}
|
|
178
178
|
});
|
|
179
179
|
b.mount(r);
|
|
180
|
-
const O = (
|
|
181
|
-
|
|
180
|
+
const O = (f) => {
|
|
181
|
+
a.value = f.attrs.listType, o.value = f.attrs.label, l.value = f.attrs.checked, u.value = !t.editable;
|
|
182
182
|
};
|
|
183
183
|
O(e);
|
|
184
184
|
let k = e;
|
|
185
185
|
return {
|
|
186
186
|
dom: r,
|
|
187
187
|
contentDOM: i,
|
|
188
|
-
update: (
|
|
189
|
-
ignoreMutation: (
|
|
188
|
+
update: (f) => f.type !== e.type ? !1 : (f.sameMarkup(k) && f.content.eq(k.content) || (k = f, O(f)), !0),
|
|
189
|
+
ignoreMutation: (f) => !r || !i ? !0 : f.type === "selection" ? !1 : i === f.target && f.type === "attributes" ? !0 : !i.contains(f.target),
|
|
190
190
|
selectNode: () => {
|
|
191
191
|
p.value = !0;
|
|
192
192
|
},
|
|
@@ -203,8 +203,8 @@ re(ie, {
|
|
|
203
203
|
displayName: "NodeView<list-item-block>",
|
|
204
204
|
group: "ListItemBlock"
|
|
205
205
|
});
|
|
206
|
-
const
|
|
207
|
-
|
|
206
|
+
const pt = [
|
|
207
|
+
j,
|
|
208
208
|
ie
|
|
209
209
|
];
|
|
210
210
|
function B(n) {
|
|
@@ -214,7 +214,7 @@ function B(n) {
|
|
|
214
214
|
const e = n.content;
|
|
215
215
|
return e ? B(e) : n.type === "text";
|
|
216
216
|
}
|
|
217
|
-
function
|
|
217
|
+
function ct(n, e) {
|
|
218
218
|
return Object.assign(n, {
|
|
219
219
|
meta: {
|
|
220
220
|
package: "@milkdown/plugin-clipboard",
|
|
@@ -223,51 +223,51 @@ function at(n, e) {
|
|
|
223
223
|
}), n;
|
|
224
224
|
}
|
|
225
225
|
const oe = ee((n) => {
|
|
226
|
-
const e = n.get(
|
|
226
|
+
const e = n.get(Pe);
|
|
227
227
|
n.update(Oe, (r) => ({
|
|
228
228
|
...r,
|
|
229
229
|
editable: r.editable ?? (() => !0)
|
|
230
230
|
}));
|
|
231
|
-
const t = new
|
|
231
|
+
const t = new N("MILKDOWN_CLIPBOARD");
|
|
232
232
|
return new z({
|
|
233
233
|
key: t,
|
|
234
234
|
props: {
|
|
235
235
|
handlePaste: (r, i) => {
|
|
236
236
|
var O, k;
|
|
237
|
-
const o = n.get(Te),
|
|
238
|
-
if (!
|
|
239
|
-
const
|
|
237
|
+
const o = n.get(Te), l = (k = (O = r.props).editable) == null ? void 0 : k.call(O, r.state), { clipboardData: a } = i;
|
|
238
|
+
if (!l || !a || r.state.selection.$from.node().type.spec.code) return !1;
|
|
239
|
+
const d = a.getData("text/plain"), p = a.getData("vscode-editor-data");
|
|
240
240
|
if (p) {
|
|
241
|
-
const
|
|
242
|
-
if (
|
|
241
|
+
const f = JSON.parse(p), E = f == null ? void 0 : f.mode;
|
|
242
|
+
if (d && E) {
|
|
243
243
|
const { tr: w } = r.state, _ = Se("code_block", e);
|
|
244
244
|
return w.replaceSelectionWith(_.create({ language: E })).setSelection(
|
|
245
245
|
Y.near(
|
|
246
246
|
w.doc.resolve(Math.max(0, w.selection.from - 2))
|
|
247
247
|
)
|
|
248
|
-
).insertText(
|
|
248
|
+
).insertText(d.replace(/\r\n?/g, `
|
|
249
249
|
`)), r.dispatch(w), !0;
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
|
-
const
|
|
253
|
-
if (
|
|
252
|
+
const c = a.getData("text/html");
|
|
253
|
+
if (c.length === 0 && d.length === 0) return !1;
|
|
254
254
|
const h = _e.fromSchema(e);
|
|
255
255
|
let g;
|
|
256
|
-
if (
|
|
257
|
-
const
|
|
258
|
-
if (!
|
|
256
|
+
if (c.length === 0) {
|
|
257
|
+
const f = o(d);
|
|
258
|
+
if (!f || typeof f == "string") return !1;
|
|
259
259
|
g = Ae.fromSchema(e).serializeFragment(
|
|
260
|
-
|
|
260
|
+
f.content
|
|
261
261
|
);
|
|
262
262
|
} else {
|
|
263
|
-
const
|
|
264
|
-
|
|
263
|
+
const f = document.createElement("template");
|
|
264
|
+
f.innerHTML = c, g = f.content.cloneNode(!0), f.remove();
|
|
265
265
|
}
|
|
266
|
-
const
|
|
266
|
+
const P = h.parseSlice(g), b = De(P);
|
|
267
267
|
if (b)
|
|
268
268
|
return r.dispatch(r.state.tr.replaceSelectionWith(b, !0)), !0;
|
|
269
269
|
try {
|
|
270
|
-
return r.dispatch(r.state.tr.replaceSelection(
|
|
270
|
+
return r.dispatch(r.state.tr.replaceSelection(P)), !0;
|
|
271
271
|
} catch {
|
|
272
272
|
return !1;
|
|
273
273
|
}
|
|
@@ -282,13 +282,13 @@ const oe = ee((n) => {
|
|
|
282
282
|
|
|
283
283
|
`
|
|
284
284
|
);
|
|
285
|
-
const
|
|
286
|
-
return
|
|
285
|
+
const l = e.topNodeType.createAndFill(void 0, r.content);
|
|
286
|
+
return l ? i(l) : "";
|
|
287
287
|
}
|
|
288
288
|
}
|
|
289
289
|
});
|
|
290
290
|
});
|
|
291
|
-
|
|
291
|
+
ct(oe, { displayName: "Prose<clipboard>" });
|
|
292
292
|
var D = 200, m = function() {
|
|
293
293
|
};
|
|
294
294
|
m.prototype.append = function(e) {
|
|
@@ -298,7 +298,7 @@ m.prototype.prepend = function(e) {
|
|
|
298
298
|
return e.length ? m.from(e).append(this) : this;
|
|
299
299
|
};
|
|
300
300
|
m.prototype.appendInner = function(e) {
|
|
301
|
-
return new
|
|
301
|
+
return new ut(this, e);
|
|
302
302
|
};
|
|
303
303
|
m.prototype.slice = function(e, t) {
|
|
304
304
|
return e === void 0 && (e = 0), t === void 0 && (t = this.length), e >= t ? m.empty : this.sliceInner(Math.max(0, e), Math.min(this.length, t));
|
|
@@ -332,13 +332,13 @@ var ae = /* @__PURE__ */ function(n) {
|
|
|
332
332
|
return r == 0 && i == this.length ? this : new e(this.values.slice(r, i));
|
|
333
333
|
}, e.prototype.getInner = function(r) {
|
|
334
334
|
return this.values[r];
|
|
335
|
-
}, e.prototype.forEachInner = function(r, i, o,
|
|
336
|
-
for (var
|
|
337
|
-
if (r(this.values[
|
|
335
|
+
}, e.prototype.forEachInner = function(r, i, o, l) {
|
|
336
|
+
for (var a = i; a < o; a++)
|
|
337
|
+
if (r(this.values[a], l + a) === !1)
|
|
338
338
|
return !1;
|
|
339
|
-
}, e.prototype.forEachInvertedInner = function(r, i, o,
|
|
340
|
-
for (var
|
|
341
|
-
if (r(this.values[
|
|
339
|
+
}, e.prototype.forEachInvertedInner = function(r, i, o, l) {
|
|
340
|
+
for (var a = i - 1; a >= o; a--)
|
|
341
|
+
if (r(this.values[a], l + a) === !1)
|
|
342
342
|
return !1;
|
|
343
343
|
}, e.prototype.leafAppend = function(r) {
|
|
344
344
|
if (this.length + r.length <= D)
|
|
@@ -353,7 +353,7 @@ var ae = /* @__PURE__ */ function(n) {
|
|
|
353
353
|
}, Object.defineProperties(e.prototype, t), e;
|
|
354
354
|
}(m);
|
|
355
355
|
m.empty = new ae([]);
|
|
356
|
-
var
|
|
356
|
+
var ut = /* @__PURE__ */ function(n) {
|
|
357
357
|
function e(t, s) {
|
|
358
358
|
n.call(this), this.left = t, this.right = s, this.length = t.length + s.length, this.depth = Math.max(t.depth, s.depth) + 1;
|
|
359
359
|
}
|
|
@@ -362,12 +362,12 @@ var lt = /* @__PURE__ */ function(n) {
|
|
|
362
362
|
}, e.prototype.getInner = function(s) {
|
|
363
363
|
return s < this.left.length ? this.left.get(s) : this.right.get(s - this.left.length);
|
|
364
364
|
}, e.prototype.forEachInner = function(s, r, i, o) {
|
|
365
|
-
var
|
|
366
|
-
if (r <
|
|
365
|
+
var l = this.left.length;
|
|
366
|
+
if (r < l && this.left.forEachInner(s, r, Math.min(i, l), o) === !1 || i > l && this.right.forEachInner(s, Math.max(r - l, 0), Math.min(this.length, i) - l, o + l) === !1)
|
|
367
367
|
return !1;
|
|
368
368
|
}, e.prototype.forEachInvertedInner = function(s, r, i, o) {
|
|
369
|
-
var
|
|
370
|
-
if (r >
|
|
369
|
+
var l = this.left.length;
|
|
370
|
+
if (r > l && this.right.forEachInvertedInner(s, r - l, Math.max(i, l) - l, o + l) === !1 || i < l && this.left.forEachInvertedInner(s, Math.min(r, l), i, o) === !1)
|
|
371
371
|
return !1;
|
|
372
372
|
}, e.prototype.sliceInner = function(s, r) {
|
|
373
373
|
if (s == 0 && r == this.length)
|
|
@@ -386,7 +386,7 @@ var lt = /* @__PURE__ */ function(n) {
|
|
|
386
386
|
return this.left.depth >= Math.max(this.right.depth, s.depth) + 1 ? new e(this.left, new e(this.right, s)) : new e(this, s);
|
|
387
387
|
}, e;
|
|
388
388
|
}(m);
|
|
389
|
-
const
|
|
389
|
+
const dt = 500;
|
|
390
390
|
class y {
|
|
391
391
|
constructor(e, t) {
|
|
392
392
|
this.items = e, this.eventCount = t;
|
|
@@ -404,34 +404,34 @@ class y {
|
|
|
404
404
|
}
|
|
405
405
|
let r, i;
|
|
406
406
|
t && (r = this.remapping(s, this.items.length), i = r.maps.length);
|
|
407
|
-
let o = e.tr,
|
|
408
|
-
return this.items.forEach((p,
|
|
407
|
+
let o = e.tr, l, a, u = [], d = [];
|
|
408
|
+
return this.items.forEach((p, c) => {
|
|
409
409
|
if (!p.step) {
|
|
410
|
-
r || (r = this.remapping(s,
|
|
410
|
+
r || (r = this.remapping(s, c + 1), i = r.maps.length), i--, d.push(p);
|
|
411
411
|
return;
|
|
412
412
|
}
|
|
413
413
|
if (r) {
|
|
414
|
-
|
|
414
|
+
d.push(new v(p.map));
|
|
415
415
|
let h = p.step.map(r.slice(i)), g;
|
|
416
|
-
h && o.maybeStep(h).doc && (g = o.mapping.maps[o.mapping.maps.length - 1],
|
|
416
|
+
h && o.maybeStep(h).doc && (g = o.mapping.maps[o.mapping.maps.length - 1], u.push(new v(g, void 0, void 0, u.length + d.length))), i--, g && r.appendMap(g, i);
|
|
417
417
|
} else
|
|
418
418
|
o.maybeStep(p.step);
|
|
419
419
|
if (p.selection)
|
|
420
|
-
return
|
|
421
|
-
}, this.items.length, 0), { remaining:
|
|
420
|
+
return l = r ? p.selection.map(r.slice(i)) : p.selection, a = new y(this.items.slice(0, s).append(d.reverse().concat(u)), this.eventCount - 1), !1;
|
|
421
|
+
}, this.items.length, 0), { remaining: a, transform: o, selection: l };
|
|
422
422
|
}
|
|
423
423
|
// Create a new branch with the given transform added.
|
|
424
424
|
addTransform(e, t, s, r) {
|
|
425
|
-
let i = [], o = this.eventCount,
|
|
426
|
-
for (let
|
|
427
|
-
let p = e.steps[
|
|
428
|
-
(h =
|
|
425
|
+
let i = [], o = this.eventCount, l = this.items, a = !r && l.length ? l.get(l.length - 1) : null;
|
|
426
|
+
for (let d = 0; d < e.steps.length; d++) {
|
|
427
|
+
let p = e.steps[d].invert(e.docs[d]), c = new v(e.mapping.maps[d], p, t), h;
|
|
428
|
+
(h = a && a.merge(c)) && (c = h, d ? i.pop() : l = l.slice(0, l.length - 1)), i.push(c), t && (o++, t = void 0), r || (a = c);
|
|
429
429
|
}
|
|
430
|
-
let
|
|
431
|
-
return
|
|
430
|
+
let u = o - s.depth;
|
|
431
|
+
return u > ht && (l = ft(l, u), o -= u), new y(l.append(i), o);
|
|
432
432
|
}
|
|
433
433
|
remapping(e, t) {
|
|
434
|
-
let s = new
|
|
434
|
+
let s = new Ne();
|
|
435
435
|
return this.items.forEach((r, i) => {
|
|
436
436
|
let o = r.mirrorOffset != null && i - r.mirrorOffset >= e ? s.maps.length - r.mirrorOffset : void 0;
|
|
437
437
|
s.appendMap(r.map, o);
|
|
@@ -447,28 +447,28 @@ class y {
|
|
|
447
447
|
rebased(e, t) {
|
|
448
448
|
if (!this.eventCount)
|
|
449
449
|
return this;
|
|
450
|
-
let s = [], r = Math.max(0, this.items.length - t), i = e.mapping, o = e.steps.length,
|
|
451
|
-
this.items.forEach((
|
|
452
|
-
|
|
450
|
+
let s = [], r = Math.max(0, this.items.length - t), i = e.mapping, o = e.steps.length, l = this.eventCount;
|
|
451
|
+
this.items.forEach((c) => {
|
|
452
|
+
c.selection && l--;
|
|
453
453
|
}, r);
|
|
454
|
-
let
|
|
455
|
-
this.items.forEach((
|
|
456
|
-
let h = i.getMirror(--
|
|
454
|
+
let a = t;
|
|
455
|
+
this.items.forEach((c) => {
|
|
456
|
+
let h = i.getMirror(--a);
|
|
457
457
|
if (h == null)
|
|
458
458
|
return;
|
|
459
459
|
o = Math.min(o, h);
|
|
460
460
|
let g = i.maps[h];
|
|
461
|
-
if (
|
|
462
|
-
let
|
|
463
|
-
b &&
|
|
461
|
+
if (c.step) {
|
|
462
|
+
let P = e.steps[h].invert(e.docs[h]), b = c.selection && c.selection.map(i.slice(a + 1, h));
|
|
463
|
+
b && l++, s.push(new v(g, P, b));
|
|
464
464
|
} else
|
|
465
465
|
s.push(new v(g));
|
|
466
466
|
}, r);
|
|
467
|
-
let
|
|
468
|
-
for (let
|
|
469
|
-
|
|
470
|
-
let
|
|
471
|
-
return p.emptyItemCount() >
|
|
467
|
+
let u = [];
|
|
468
|
+
for (let c = t; c < o; c++)
|
|
469
|
+
u.push(new v(i.maps[c]));
|
|
470
|
+
let d = this.items.slice(0, r).append(u).append(s), p = new y(d, l);
|
|
471
|
+
return p.emptyItemCount() > dt && (p = p.compress(this.items.length - s.length)), p;
|
|
472
472
|
}
|
|
473
473
|
emptyItemCount() {
|
|
474
474
|
let e = 0;
|
|
@@ -484,23 +484,23 @@ class y {
|
|
|
484
484
|
// order to associate old items with rebased steps.
|
|
485
485
|
compress(e = this.items.length) {
|
|
486
486
|
let t = this.remapping(0, e), s = t.maps.length, r = [], i = 0;
|
|
487
|
-
return this.items.forEach((o,
|
|
488
|
-
if (
|
|
487
|
+
return this.items.forEach((o, l) => {
|
|
488
|
+
if (l >= e)
|
|
489
489
|
r.push(o), o.selection && i++;
|
|
490
490
|
else if (o.step) {
|
|
491
|
-
let
|
|
492
|
-
if (s--,
|
|
493
|
-
let
|
|
494
|
-
|
|
495
|
-
let p = new v(
|
|
496
|
-
(
|
|
491
|
+
let a = o.step.map(t.slice(s)), u = a && a.getMap();
|
|
492
|
+
if (s--, u && t.appendMap(u, s), a) {
|
|
493
|
+
let d = o.selection && o.selection.map(t.slice(s));
|
|
494
|
+
d && i++;
|
|
495
|
+
let p = new v(u.invert(), a, d), c, h = r.length - 1;
|
|
496
|
+
(c = r.length && r[h].merge(p)) ? r[h] = c : r.push(p);
|
|
497
497
|
}
|
|
498
498
|
} else o.map && s--;
|
|
499
499
|
}, this.items.length, 0), new y(m.from(r.reverse()), i);
|
|
500
500
|
}
|
|
501
501
|
}
|
|
502
502
|
y.empty = new y(m.empty, 0);
|
|
503
|
-
function
|
|
503
|
+
function ft(n, e) {
|
|
504
504
|
let t;
|
|
505
505
|
return n.forEach((s, r) => {
|
|
506
506
|
if (s.selection && e-- == 0)
|
|
@@ -519,28 +519,28 @@ class v {
|
|
|
519
519
|
}
|
|
520
520
|
}
|
|
521
521
|
}
|
|
522
|
-
class
|
|
522
|
+
class I {
|
|
523
523
|
constructor(e, t, s, r, i) {
|
|
524
524
|
this.done = e, this.undone = t, this.prevRanges = s, this.prevTime = r, this.prevComposition = i;
|
|
525
525
|
}
|
|
526
526
|
}
|
|
527
|
-
const
|
|
528
|
-
function
|
|
529
|
-
let r = t.getMeta(
|
|
527
|
+
const ht = 20;
|
|
528
|
+
function mt(n, e, t, s) {
|
|
529
|
+
let r = t.getMeta(M), i;
|
|
530
530
|
if (r)
|
|
531
531
|
return r.historyState;
|
|
532
|
-
t.getMeta(
|
|
532
|
+
t.getMeta(vt) && (n = new I(n.done, n.undone, null, 0, -1));
|
|
533
533
|
let o = t.getMeta("appendedTransaction");
|
|
534
534
|
if (t.steps.length == 0)
|
|
535
535
|
return n;
|
|
536
|
-
if (o && o.getMeta(
|
|
537
|
-
return o.getMeta(
|
|
536
|
+
if (o && o.getMeta(M))
|
|
537
|
+
return o.getMeta(M).redo ? new I(n.done.addTransform(t, void 0, s, A(e)), n.undone, Z(t.mapping.maps), n.prevTime, n.prevComposition) : new I(n.done, n.undone.addTransform(t, void 0, s, A(e)), null, n.prevTime, n.prevComposition);
|
|
538
538
|
if (t.getMeta("addToHistory") !== !1 && !(o && o.getMeta("addToHistory") === !1)) {
|
|
539
|
-
let
|
|
540
|
-
return new
|
|
541
|
-
} else return (i = t.getMeta("rebased")) ? new
|
|
539
|
+
let l = t.getMeta("composition"), a = n.prevTime == 0 || !o && n.prevComposition != l && (n.prevTime < (t.time || 0) - s.newGroupDelay || !gt(t, n.prevRanges)), u = o ? x(n.prevRanges, t.mapping) : Z(t.mapping.maps);
|
|
540
|
+
return new I(n.done.addTransform(t, a ? e.selection.getBookmark() : void 0, s, A(e)), y.empty, u, t.time, l ?? n.prevComposition);
|
|
541
|
+
} else return (i = t.getMeta("rebased")) ? new I(n.done.rebased(t, i), n.undone.rebased(t, i), x(n.prevRanges, t.mapping), n.prevTime, n.prevComposition) : new I(n.done.addMaps(t.mapping.maps), n.undone.addMaps(t.mapping.maps), x(n.prevRanges, t.mapping), n.prevTime, n.prevComposition);
|
|
542
542
|
}
|
|
543
|
-
function
|
|
543
|
+
function gt(n, e) {
|
|
544
544
|
if (!e)
|
|
545
545
|
return !1;
|
|
546
546
|
if (!n.docChanged)
|
|
@@ -567,12 +567,12 @@ function x(n, e) {
|
|
|
567
567
|
}
|
|
568
568
|
return t;
|
|
569
569
|
}
|
|
570
|
-
function
|
|
571
|
-
let s = A(e), r =
|
|
570
|
+
function yt(n, e, t) {
|
|
571
|
+
let s = A(e), r = M.get(e).spec.config, i = (t ? n.undone : n.done).popEvent(e, s);
|
|
572
572
|
if (!i)
|
|
573
573
|
return null;
|
|
574
|
-
let o = i.selection.resolve(i.transform.doc),
|
|
575
|
-
return i.transform.setSelection(o).setMeta(
|
|
574
|
+
let o = i.selection.resolve(i.transform.doc), l = (t ? n.done : n.undone).addTransform(i.transform, e.selection.getBookmark(), r, s), a = new I(t ? l : i.remaining, t ? i.remaining : l, null, 0, -1);
|
|
575
|
+
return i.transform.setSelection(o).setMeta(M, { redo: t, historyState: a });
|
|
576
576
|
}
|
|
577
577
|
let U = !1, Q = null;
|
|
578
578
|
function A(n) {
|
|
@@ -587,26 +587,26 @@ function A(n) {
|
|
|
587
587
|
}
|
|
588
588
|
return U;
|
|
589
589
|
}
|
|
590
|
-
const
|
|
591
|
-
function
|
|
590
|
+
const M = new N("history"), vt = new N("closeHistory");
|
|
591
|
+
function wt(n = {}) {
|
|
592
592
|
return n = {
|
|
593
593
|
depth: n.depth || 100,
|
|
594
594
|
newGroupDelay: n.newGroupDelay || 500
|
|
595
595
|
}, new z({
|
|
596
|
-
key:
|
|
596
|
+
key: M,
|
|
597
597
|
state: {
|
|
598
598
|
init() {
|
|
599
|
-
return new
|
|
599
|
+
return new I(y.empty, y.empty, null, 0, -1);
|
|
600
600
|
},
|
|
601
601
|
apply(e, t, s) {
|
|
602
|
-
return
|
|
602
|
+
return mt(t, s, e, n);
|
|
603
603
|
}
|
|
604
604
|
},
|
|
605
605
|
config: n,
|
|
606
606
|
props: {
|
|
607
607
|
handleDOMEvents: {
|
|
608
608
|
beforeinput(e, t) {
|
|
609
|
-
let s = t.inputType, r = s == "historyUndo" ? pe : s == "historyRedo" ?
|
|
609
|
+
let s = t.inputType, r = s == "historyUndo" ? pe : s == "historyRedo" ? ce : null;
|
|
610
610
|
return !r || !e.editable ? !1 : (t.preventDefault(), r(e.state, e.dispatch));
|
|
611
611
|
}
|
|
612
612
|
}
|
|
@@ -615,18 +615,18 @@ function gt(n = {}) {
|
|
|
615
615
|
}
|
|
616
616
|
function le(n, e) {
|
|
617
617
|
return (t, s) => {
|
|
618
|
-
let r =
|
|
618
|
+
let r = M.getState(t);
|
|
619
619
|
if (!r || (n ? r.undone : r.done).eventCount == 0)
|
|
620
620
|
return !1;
|
|
621
621
|
if (s) {
|
|
622
|
-
let i =
|
|
622
|
+
let i = yt(r, t, n);
|
|
623
623
|
i && s(e ? i.scrollIntoView() : i);
|
|
624
624
|
}
|
|
625
625
|
return !0;
|
|
626
626
|
};
|
|
627
627
|
}
|
|
628
|
-
const pe = le(!1, !0),
|
|
629
|
-
function
|
|
628
|
+
const pe = le(!1, !0), ce = le(!0, !0);
|
|
629
|
+
function L(n, e) {
|
|
630
630
|
return Object.assign(n, {
|
|
631
631
|
meta: {
|
|
632
632
|
package: "@milkdown/plugin-history",
|
|
@@ -635,24 +635,24 @@ function P(n, e) {
|
|
|
635
635
|
}), n;
|
|
636
636
|
}
|
|
637
637
|
const $ = ne("Undo", () => () => pe);
|
|
638
|
-
|
|
638
|
+
L($, {
|
|
639
639
|
displayName: "Command<undo>"
|
|
640
640
|
});
|
|
641
|
-
const H = ne("Redo", () => () =>
|
|
642
|
-
|
|
641
|
+
const H = ne("Redo", () => () => ce);
|
|
642
|
+
L(H, {
|
|
643
643
|
displayName: "Command<redo>"
|
|
644
644
|
});
|
|
645
645
|
const K = X({}, "historyProviderConfig");
|
|
646
|
-
|
|
646
|
+
L(K, {
|
|
647
647
|
displayName: "Ctx<historyProviderConfig>"
|
|
648
648
|
});
|
|
649
|
-
const
|
|
650
|
-
(n) =>
|
|
649
|
+
const ue = ee(
|
|
650
|
+
(n) => wt(n.get(K.key))
|
|
651
651
|
);
|
|
652
|
-
|
|
652
|
+
L(ue, {
|
|
653
653
|
displayName: "Ctx<historyProviderPlugin>"
|
|
654
654
|
});
|
|
655
|
-
const R =
|
|
655
|
+
const R = je("historyKeymap", {
|
|
656
656
|
Undo: {
|
|
657
657
|
shortcuts: "Mod-z",
|
|
658
658
|
command: (n) => {
|
|
@@ -668,15 +668,15 @@ const R = Ne("historyKeymap", {
|
|
|
668
668
|
}
|
|
669
669
|
}
|
|
670
670
|
});
|
|
671
|
-
|
|
671
|
+
L(R.ctx, {
|
|
672
672
|
displayName: "KeymapCtx<history>"
|
|
673
673
|
});
|
|
674
|
-
|
|
674
|
+
L(R.shortcuts, {
|
|
675
675
|
displayName: "Keymap<history>"
|
|
676
676
|
});
|
|
677
|
-
const
|
|
677
|
+
const bt = [
|
|
678
678
|
K,
|
|
679
|
-
|
|
679
|
+
ue,
|
|
680
680
|
R,
|
|
681
681
|
$,
|
|
682
682
|
H
|
|
@@ -728,78 +728,90 @@ class de {
|
|
|
728
728
|
const q = xe(
|
|
729
729
|
new de(),
|
|
730
730
|
"listener"
|
|
731
|
-
),
|
|
731
|
+
), It = new N("MILKDOWN_LISTENER"), fe = (n) => (n.inject(q, new de()), async () => {
|
|
732
732
|
await n.wait(Ue);
|
|
733
733
|
const e = n.get(q), { listeners: t } = e;
|
|
734
|
-
t.beforeMount.forEach((
|
|
734
|
+
t.beforeMount.forEach((a) => a(n)), await n.wait(Fe);
|
|
735
735
|
const s = n.get(te);
|
|
736
736
|
let r = null, i = null, o = null;
|
|
737
|
-
const
|
|
738
|
-
key:
|
|
737
|
+
const l = new z({
|
|
738
|
+
key: It,
|
|
739
739
|
view: () => ({
|
|
740
740
|
destroy: () => {
|
|
741
|
-
t.destroy.forEach((
|
|
741
|
+
t.destroy.forEach((a) => a(n));
|
|
742
742
|
}
|
|
743
743
|
}),
|
|
744
744
|
props: {
|
|
745
745
|
handleDOMEvents: {
|
|
746
|
-
focus: () => (t.focus.forEach((
|
|
747
|
-
blur: () => (t.blur.forEach((
|
|
746
|
+
focus: () => (t.focus.forEach((a) => a(n)), !1),
|
|
747
|
+
blur: () => (t.blur.forEach((a) => a(n)), !1)
|
|
748
748
|
}
|
|
749
749
|
},
|
|
750
750
|
state: {
|
|
751
|
-
init: (
|
|
752
|
-
r =
|
|
751
|
+
init: (a, u) => {
|
|
752
|
+
r = u.doc, i = s(u.doc);
|
|
753
753
|
},
|
|
754
|
-
apply: (
|
|
755
|
-
const
|
|
756
|
-
return (!o &&
|
|
757
|
-
p(n,
|
|
758
|
-
}), o =
|
|
759
|
-
const { doc: p } =
|
|
760
|
-
if (t.updated.length > 0 && r && !r.eq(p) && t.updated.forEach((
|
|
761
|
-
|
|
754
|
+
apply: (a) => {
|
|
755
|
+
const u = a.selection;
|
|
756
|
+
return (!o && u || o && !u.eq(o)) && (t.selectionUpdated.forEach((p) => {
|
|
757
|
+
p(n, u, o);
|
|
758
|
+
}), o = u), !(a.docChanged || a.storedMarksSet) || a.getMeta("addToHistory") === !1 ? void 0 : Je(() => {
|
|
759
|
+
const { doc: p } = a;
|
|
760
|
+
if (t.updated.length > 0 && r && !r.eq(p) && t.updated.forEach((c) => {
|
|
761
|
+
c(n, p, r);
|
|
762
762
|
}), t.markdownUpdated.length > 0 && r && !r.eq(p)) {
|
|
763
|
-
const
|
|
763
|
+
const c = s(p);
|
|
764
764
|
t.markdownUpdated.forEach((h) => {
|
|
765
|
-
h(n,
|
|
766
|
-
}), i =
|
|
765
|
+
h(n, c, i);
|
|
766
|
+
}), i = c;
|
|
767
767
|
}
|
|
768
768
|
r = p;
|
|
769
769
|
}, 200)();
|
|
770
770
|
}
|
|
771
771
|
}
|
|
772
772
|
});
|
|
773
|
-
n.update(Be, (
|
|
773
|
+
n.update(Be, (a) => a.concat(l)), await n.wait(qe), t.mounted.forEach((a) => a(n));
|
|
774
774
|
});
|
|
775
775
|
fe.meta = {
|
|
776
776
|
package: "@milkdown/plugin-listener",
|
|
777
777
|
displayName: "Listener"
|
|
778
778
|
};
|
|
779
|
-
const
|
|
779
|
+
const Mt = ({
|
|
780
780
|
className: n,
|
|
781
781
|
value: e,
|
|
782
782
|
onChangeValue: t,
|
|
783
783
|
children: s,
|
|
784
|
-
toolbar: r = "top"
|
|
784
|
+
toolbar: r = "top",
|
|
785
|
+
milkdownRef: i
|
|
785
786
|
}) => {
|
|
786
|
-
const
|
|
787
|
-
|
|
788
|
-
(
|
|
789
|
-
|
|
790
|
-
t == null || t(
|
|
791
|
-
}),
|
|
787
|
+
const o = nt();
|
|
788
|
+
Qe(
|
|
789
|
+
(d) => $e.make().config((p) => {
|
|
790
|
+
p.set(He, d), p.set(Ke, e || ""), p.get(q).markdownUpdated((h, g) => {
|
|
791
|
+
t == null || t(g);
|
|
792
|
+
}), p.set(j.key, {
|
|
792
793
|
renderLabel: () => ""
|
|
793
|
-
}),
|
|
794
|
-
...
|
|
794
|
+
}), p.update(ke.key, (h) => ({
|
|
795
|
+
...h,
|
|
795
796
|
linkIcon: "",
|
|
796
797
|
editButton: "",
|
|
797
798
|
removeButton: "",
|
|
798
799
|
confirmButton: "",
|
|
799
800
|
inputPlaceholder: "Enter a URL..."
|
|
800
|
-
})),
|
|
801
|
-
}).use(fe).use(
|
|
802
|
-
)
|
|
801
|
+
})), o.config(p);
|
|
802
|
+
}).use(fe).use(We).use(Ge).use(oe).use(bt).use(pt).use(Ve).config(Ee).use(Ce).use(o.plugin)
|
|
803
|
+
);
|
|
804
|
+
const [l, a] = Xe();
|
|
805
|
+
tt(() => {
|
|
806
|
+
i && (i.current = a());
|
|
807
|
+
}, [l, a]);
|
|
808
|
+
const u = () => {
|
|
809
|
+
var d;
|
|
810
|
+
(d = a()) == null || d.action((p) => {
|
|
811
|
+
p.get(ze).focus();
|
|
812
|
+
});
|
|
813
|
+
};
|
|
814
|
+
return /* @__PURE__ */ ge(
|
|
803
815
|
"div",
|
|
804
816
|
{
|
|
805
817
|
className: ye(
|
|
@@ -808,12 +820,19 @@ const wt = ({
|
|
|
808
820
|
n
|
|
809
821
|
),
|
|
810
822
|
children: [
|
|
811
|
-
r && /* @__PURE__ */
|
|
812
|
-
/* @__PURE__ */
|
|
823
|
+
r && /* @__PURE__ */ C(Me, { className: "component-markdown-editor__toolbar", children: s }),
|
|
824
|
+
/* @__PURE__ */ C(
|
|
825
|
+
"div",
|
|
826
|
+
{
|
|
827
|
+
className: "component-markdown-editor__content",
|
|
828
|
+
onClick: u,
|
|
829
|
+
children: /* @__PURE__ */ C(Ye, {})
|
|
830
|
+
}
|
|
831
|
+
)
|
|
813
832
|
]
|
|
814
833
|
}
|
|
815
834
|
);
|
|
816
|
-
},
|
|
835
|
+
}, Dt = (n) => /* @__PURE__ */ C(Ze, { children: /* @__PURE__ */ C(et, { children: /* @__PURE__ */ C(Mt, { ...n }) }) });
|
|
817
836
|
export {
|
|
818
|
-
|
|
837
|
+
Dt as MarkdownEditor
|
|
819
838
|
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Editor } from '@milkdown/kit/core';
|
|
2
|
+
import { PropsWithChildren, RefObject } from 'react';
|
|
2
3
|
import { ControlFC } from '../base-control/props';
|
|
3
4
|
interface MarkdownControlProps extends PropsWithChildren {
|
|
4
5
|
value?: string;
|
|
5
6
|
onChangeValue?: (value: string) => void;
|
|
6
7
|
toolbar?: "top" | "bottom" | false;
|
|
8
|
+
milkdownRef?: RefObject<Editor | undefined>;
|
|
7
9
|
}
|
|
8
10
|
export declare const MarkdownControl: ControlFC<MarkdownControlProps>;
|
|
9
11
|
export {};
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import { AnchorHTMLAttributes, FC } from 'react';
|
|
1
|
+
import { AnchorHTMLAttributes, ElementType, FC } from 'react';
|
|
2
2
|
interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
3
3
|
}
|
|
4
|
-
|
|
4
|
+
type AnchorElement = ElementType<LinkProps>;
|
|
5
|
+
export declare const Link: FC<LinkProps> & {
|
|
6
|
+
anchorElement?: AnchorElement;
|
|
7
|
+
};
|
|
5
8
|
export {};
|
|
@@ -1,24 +1,29 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { cn as
|
|
3
|
-
import { isOutbound as
|
|
4
|
-
import { useMemo as
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { cn as u } from "../../utils/css.js";
|
|
3
|
+
import { isOutbound as p } from "../../utils/url.js";
|
|
4
|
+
import { useMemo as c } from "react";
|
|
5
5
|
import '../../assets/style2.css';/* empty css */
|
|
6
|
-
const
|
|
6
|
+
const l = ({
|
|
7
7
|
className: n,
|
|
8
8
|
children: m,
|
|
9
9
|
href: o,
|
|
10
10
|
target: i,
|
|
11
|
-
...
|
|
12
|
-
}) =>
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
11
|
+
...t
|
|
12
|
+
}) => {
|
|
13
|
+
if (c(() => o && p(o), [o]) && !i && (i = "_blank"), !o)
|
|
14
|
+
return m;
|
|
15
|
+
const r = l.anchorElement || "a";
|
|
16
|
+
return /* @__PURE__ */ s(
|
|
17
|
+
r,
|
|
18
|
+
{
|
|
19
|
+
className: u("primitive-link", n),
|
|
20
|
+
href: o,
|
|
21
|
+
target: i,
|
|
22
|
+
...t,
|
|
23
|
+
children: m
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
};
|
|
22
27
|
export {
|
|
23
|
-
|
|
28
|
+
l as Link
|
|
24
29
|
};
|