@bigbinary/neeto-editor 1.45.10 → 1.45.11

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.
@@ -11,7 +11,7 @@ var ramda = require('ramda');
11
11
  var client = require('react-dom/client');
12
12
  var _commonjsHelpers = require('./chunk-CuRcjRaU.cjs.js');
13
13
  var injectCss = require('./chunk-vQvjPR2x.cjs.js');
14
- var index$1 = require('./chunk-Bq2DybYJ.cjs.js');
14
+ var index$1 = require('./chunk-CcubW4oN.cjs.js');
15
15
  var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
16
16
  var Close = require('@bigbinary/neeto-icons/Close');
17
17
  var Button = require('@bigbinary/neetoui/Button');
@@ -24,7 +24,7 @@ require('@bigbinary/neeto-cist');
24
24
  require('react-dom/server');
25
25
  require('@babel/runtime/helpers/toConsumableArray');
26
26
 
27
- var css = "@charset \"UTF-8\";@import url(\"https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.7.2/styles/github.min.css\");:root{--neeto-editor-white:255,255,255;--neeto-editor-black:12,17,29;--neeto-editor-gray-800:16,24,40;--neeto-editor-gray-700:29,41,57;--neeto-editor-gray-600:52,64,84;--neeto-editor-gray-500:135,146,157;--neeto-editor-gray-400:194,200,204;--neeto-editor-gray-300:216,220,222;--neeto-editor-gray-200:233,235,237;--neeto-editor-gray-100:246,247,248;--neeto-editor-gray-50:250,250,250;--neeto-editor-primary-800:0,102,83;--neeto-editor-primary-600:0,122,100;--neeto-editor-primary-500:0,128,104;--neeto-editor-primary-100:225,243,238;--neeto-editor-primary-50:240,249,247;--neeto-editor-accent-800:9,90,186;--neeto-editor-accent-600:13,102,208;--neeto-editor-accent-500:20,115,230;--neeto-editor-accent-100:230,244,255;--neeto-editor-accent-50:239,248,255;--neeto-editor-success-800:1,121,93;--neeto-editor-success-600:1,141,109;--neeto-editor-success-500:2,162,124;--neeto-editor-success-100:235,255,250;--neeto-editor-error-800:187,18,26;--neeto-editor-error-600:201,37,45;--neeto-editor-error-500:215,55,63;--neeto-editor-error-100:254,236,240;--neeto-editor-info-800:9,90,186;--neeto-editor-info-600:13,102,208;--neeto-editor-info-500:20,115,230;--neeto-editor-info-100:226,242,255;--neeto-editor-warning-800:189,100,13;--neeto-editor-warning-600:203,111,16;--neeto-editor-warning-500:218,123,17;--neeto-editor-warning-100:251,242,225;--neeto-editor-pastel-silver:232,233,237;--neeto-editor-pastel-red:255,229,229;--neeto-editor-pastel-yellow:254,243,197;--neeto-editor-pastel-green:211,249,232;--neeto-editor-pastel-blue:236,244,255;--neeto-editor-pastel-purple:238,235,255;--neeto-editor-pastel-pink:253,226,241;--neeto-editor-rounded-none:0;--neeto-editor-rounded-sm:3px;--neeto-editor-rounded:5px;--neeto-editor-rounded-md:6px;--neeto-editor-rounded-lg:8px;--neeto-editor-rounded-xl:12px;--neeto-editor-rounded-full:999px;--neeto-editor-font-thin:100;--neeto-editor-font-extralight:200;--neeto-editor-font-light:300;--neeto-editor-font-normal:400;--neeto-editor-font-medium:500;--neeto-editor-font-semibold:600;--neeto-editor-font-bold:700;--neeto-editor-font-extrabold:800;--neeto-editor-font-black:900;--neeto-editor-content-h1-margin:1.5rem 0 0.25rem;--neeto-editor-content-h2-margin:1.5rem 0 0.25rem;--neeto-editor-content-h3-margin:1.5rem 0 0.25rem;--neeto-editor-content-h4-margin:1.5rem 0 0.25rem;--neeto-editor-content-h5-margin:1.5rem 0 0.25rem;--neeto-editor-content-h6-margin:1.5rem 0 0.25rem;--neeto-editor-content-heading-font-weight:600;--neeto-editor-content-heading-font-weight-bold:bold;--neeto-editor-content-heading-color:12,17,29,1;--neeto-editor-content-paragraph-color:54,55,55,1;--neeto-editor-content-paragraph-font-weight:400;--neeto-editor-content-paragraph-line-height:1.6;--neeto-editor-content-list-left-padding:2rem;--neeto-editor-content-list-margin-bottom:1rem;--neeto-editor-content-list-item-margin-bottom:0.5rem;--neeto-editor-content-list-item-margin-top:0.5rem;--neeto-editor-content-code-font-size:85%;--neeto-editor-content-code-background-color:246,248,250,1;--neeto-editor-content-code-line-number-color:89,99,110,1;--neeto-editor-content-code-color:31,35,40,1;--neeto-editor-content-code-padding:0.2em 0.4em;--neeto-editor-content-blockquote-color:89,99,110,1;--neeto-editor-content-blockquote-border-color:209,217,224,1;--neeto-editor-content-blockquote-border-left-width:4px;--neeto-editor-content-blockquote-margin-bottom:1rem;--neeto-editor-content-blockquote-padding-left:0.75rem;--neeto-editor-content-image-border-color:228,228,231;--neeto-editor-content-image-border-radius:8px}.neeto-editor-content{-moz-tab-size:2;-o-tab-size:2;tab-size:2;white-space:pre-wrap;word-break:break-word}.neeto-editor-content hr{margin:.5rem 0}.neeto-editor-content .table-responsive{-webkit-overflow-scrolling:touch;margin:1rem 0;overflow-x:auto}.neeto-editor-content.neeto-editor-size--small{--neeto-editor-content-heading-color:31,35,40,1;--neeto-editor-content-paragraph-color:31,35,40,1;--neeto-editor-content-h1-font-size:1.75rem;--neeto-editor-content-h2-font-size:1.3125rem;--neeto-editor-content-h3-font-size:1.09375rem;--neeto-editor-content-h4-font-size:0.875rem;--neeto-editor-content-h5-font-size:0.765625rem;--neeto-editor-content-h6-font-size:0.74375rem;--neeto-editor-content-paragraph-font-size:0.875rem;--neeto-editor-content-paragraph-line-height:1.5;--neeto-editor-content-list-left-padding:1.5rem;--neeto-editor-content-list-item-margin-bottom:0.25rem;--neeto-editor-content-list-item-margin-top:0.25rem}.neeto-editor-content.neeto-editor-size--medium{--neeto-editor-content-h1-font-size:2rem;--neeto-editor-content-h2-font-size:1.5rem;--neeto-editor-content-h3-font-size:1.25rem;--neeto-editor-content-h4-font-size:1rem;--neeto-editor-content-h5-font-size:0.875rem;--neeto-editor-content-h6-font-size:0.75rem;--neeto-editor-content-paragraph-font-size:1rem}@media only screen and (max-width:767px){.neeto-editor-content.neeto-editor-size--medium{--neeto-editor-content-h1-font-size:1.375rem;--neeto-editor-content-h2-font-size:1.25rem;--neeto-editor-content-h3-font-size:1.125rem}}.neeto-editor-content.neeto-editor-size--large{--neeto-editor-content-h1-font-size:2.375rem;--neeto-editor-content-h2-font-size:1.93rem;--neeto-editor-content-h3-font-size:1.633rem;--neeto-editor-content-h4-font-size:1.336rem;--neeto-editor-content-h5-font-size:0.986rem;--neeto-editor-content-h6-font-size:0.796rem;--neeto-editor-content-paragraph-font-size:1.125rem}@media only screen and (max-width:767px){.neeto-editor-content.neeto-editor-size--large{--neeto-editor-content-h1-font-size:2.125rem;--neeto-editor-content-h2-font-size:1.7266rem;--neeto-editor-content-h3-font-size:1.4609rem;--neeto-editor-content-h4-font-size:1.1953rem;--neeto-editor-content-h5-font-size:0.875rem;--neeto-editor-content-h6-font-size:0.75rem;--neeto-editor-content-paragraph-font-size:1rem}}.neeto-editor-content h1,.neeto-editor-content h2,.neeto-editor-content h3,.neeto-editor-content h4,.neeto-editor-content h5,.neeto-editor-content h6{color:#0c111d;color:rgba(var(--neeto-editor-content-heading-color));font-weight:600;font-weight:var(--neeto-editor-content-heading-font-weight)}.neeto-editor-content h1 strong,.neeto-editor-content h2 strong,.neeto-editor-content h3 strong,.neeto-editor-content h4 strong,.neeto-editor-content h5 strong,.neeto-editor-content h6 strong{font-weight:700!important;font-weight:var(--neeto-editor-content-heading-font-weight-bold)!important}.neeto-editor-content h1{font-size:var(--neeto-editor-content-h1-font-size);margin:1.5rem 0 .25rem;margin:var(--neeto-editor-content-h1-margin)}.neeto-editor-content h2{font-size:var(--neeto-editor-content-h2-font-size);margin:1.5rem 0 .25rem;margin:var(--neeto-editor-content-h2-margin)}.neeto-editor-content h3{font-size:var(--neeto-editor-content-h3-font-size);margin:1.5rem 0 .25rem;margin:var(--neeto-editor-content-h3-margin)}.neeto-editor-content h4{font-size:var(--neeto-editor-content-h4-font-size);margin:1.5rem 0 .25rem;margin:var(--neeto-editor-content-h4-margin)}.neeto-editor-content h5{font-size:var(--neeto-editor-content-h5-font-size);margin:1.5rem 0 .25rem;margin:var(--neeto-editor-content-h5-margin)}.neeto-editor-content h6{font-size:var(--neeto-editor-content-h6-font-size);margin:1.5rem 0 .25rem;margin:var(--neeto-editor-content-h6-margin)}.neeto-editor-content .header-wrapper-link{position:relative}.neeto-editor-content .header-wrapper-link h1,.neeto-editor-content .header-wrapper-link h2,.neeto-editor-content .header-wrapper-link h3,.neeto-editor-content .header-wrapper-link h4,.neeto-editor-content .header-wrapper-link h5,.neeto-editor-content .header-wrapper-link h6{cursor:pointer;transition:color .15s ease-in}.neeto-editor-content .header-wrapper-link .header-link-icon-wrapper{align-items:center;display:flex;height:100%;left:-1.5625rem;opacity:0;position:absolute;transition:opacity .15s ease-in;width:1.5625rem}.neeto-editor-content .header-wrapper-link .header-link-icon-wrapper svg{fill:#006653;fill:rgb(var(--neeto-editor-primary-800));transition:fill .15s ease-in}.neeto-editor-content .header-wrapper-link:hover h1,.neeto-editor-content .header-wrapper-link:hover h2,.neeto-editor-content .header-wrapper-link:hover h3,.neeto-editor-content .header-wrapper-link:hover h4,.neeto-editor-content .header-wrapper-link:hover h5,.neeto-editor-content .header-wrapper-link:hover h6{color:#095aba;color:rgb(var(--neeto-editor-accent-800))}.neeto-editor-content .header-wrapper-link:hover .header-link-icon-wrapper{opacity:1}.neeto-editor-content .header-wrapper-link:hover svg{fill:#095aba;fill:rgb(var(--neeto-editor-accent-800))}.neeto-editor-content p{color:#363737;color:rgba(var(--neeto-editor-content-paragraph-color));font-size:var(--neeto-editor-content-paragraph-font-size);font-weight:400;font-weight:var(--neeto-editor-content-paragraph-font-weight);line-height:1.6;line-height:var(--neeto-editor-content-paragraph-line-height);margin:0}.neeto-editor-content p:empty:after{content:\" \"}.neeto-editor-content p:last-child{margin-bottom:0}.neeto-editor-content p strong{font-weight:600!important}.neeto-editor-content div{color:#363737;color:rgba(var(--neeto-editor-content-paragraph-color));font-size:var(--neeto-editor-content-paragraph-font-size);font-weight:400;font-weight:var(--neeto-editor-content-paragraph-font-weight);line-height:1.6;line-height:var(--neeto-editor-content-paragraph-line-height)}.neeto-editor-content code{background-color:#f6f8fa;background-color:rgba(var(--neeto-editor-content-code-background-color));border-color:#f6f8fa;border-color:rgba(var(--neeto-editor-content-code-background-color));border-radius:3px;border-radius:var(--neeto-editor-rounded-sm);color:#1f2328;color:rgba(var(--neeto-editor-content-code-color));font-family:SFMono-Regular,Menlo,Consolas,PT Mono,Liberation Mono,Courier,monospace;font-size:85%;font-size:var(--neeto-editor-content-code-font-size);padding:.2em .4em;padding:var(--neeto-editor-content-code-padding)}.neeto-editor-content code *{font-size:inherit!important}.neeto-editor-content h1 code,.neeto-editor-content h2 code,.neeto-editor-content h3 code,.neeto-editor-content h4 code,.neeto-editor-content h5 code,.neeto-editor-content h6 code,.neeto-editor-content p code{font-size:85%;font-size:var(--neeto-editor-content-code-font-size)}.neeto-editor-content pre{background-color:#f6f8fa;background-color:rgba(var(--neeto-editor-content-code-background-color));border-color:#f6f8fa;border-color:rgba(var(--neeto-editor-content-code-background-color));border-radius:3px;border-radius:var(--neeto-editor-rounded-sm);counter-reset:line-number;font-size:var(--neeto-editor-content-paragraph-font-size);line-height:1.5;margin-bottom:1rem;margin-top:1rem;max-width:100%;padding:0;position:relative}.neeto-editor-content pre,.neeto-editor-content pre div{color:#1f2328;color:rgba(var(--neeto-editor-content-code-color))}.neeto-editor-content pre .neeto-editor-codeblock-options{align-items:center;display:flex;gap:.25rem;opacity:0;position:absolute;right:.25rem;top:.25rem;visibility:hidden}.neeto-editor-content pre .neeto-editor-codeblock-options__menu{display:flex;flex-direction:column;gap:.25rem}.neeto-editor-content pre .neeto-editor-codeblock-options__input{margin:.25rem}.neeto-editor-content pre:hover .copy-button,.neeto-editor-content pre:hover .neeto-editor-codeblock-options{opacity:1;visibility:visible}.neeto-editor-content pre .copy-button{opacity:0;position:absolute;right:.25rem;top:.25rem;visibility:hidden}.neeto-editor-content pre .highlight-line{padding-left:3.125rem;position:relative}.neeto-editor-content pre .highlight-line:before{align-items:center;color:#59636e;color:rgba(var(--neeto-editor-content-code-line-number-color));content:counter(line-number);counter-increment:line-number;display:flex;font-size:85%;font-weight:400;height:100%;justify-content:flex-end;left:0;padding-left:.625rem;padding-right:1rem;position:absolute;width:3.125rem}.neeto-editor-content pre .highlight-line:last-child:before{content:\"\"}.neeto-editor-content pre>code{background-color:transparent;border-radius:0;border-width:0;color:inherit;display:block;font-size:85%;font-size:var(--neeto-editor-content-code-font-size);font-weight:400;line-height:inherit;overflow-x:auto;padding:.75rem .75rem .75rem 0;white-space:pre!important;width:100%}.neeto-editor-content blockquote{border-left-color:#d1d9e0;border-left-color:rgba(var(--neeto-editor-content-blockquote-border-color));border-left-width:4px;border-left-width:var(--neeto-editor-content-blockquote-border-left-width);color:#59636e;color:rgba(var(--neeto-editor-content-blockquote-color));font-weight:500;font-weight:var(--neeto-editor-font-medium);margin-bottom:1rem;margin-bottom:var(--neeto-editor-content-blockquote-margin-bottom);padding-left:.75rem;padding-left:var(--neeto-editor-content-blockquote-padding-left);quotes:\"“\" \"”\" \"‘\" \"’\"}.neeto-editor-content blockquote div,.neeto-editor-content blockquote p{color:inherit}.neeto-editor-content blockquote>p:after,.neeto-editor-content blockquote>p:before{content:\"\"!important}.neeto-editor-content ol,.neeto-editor-content ul{list-style:revert;margin-bottom:1rem;margin-bottom:var(--neeto-editor-content-list-margin-bottom);padding-left:2rem;padding-left:var(--neeto-editor-content-list-left-padding)}.neeto-editor-content ol li,.neeto-editor-content ul li{color:#363737;color:rgba(var(--neeto-editor-content-paragraph-color));font-size:var(--neeto-editor-content-paragraph-font-size);font-weight:400;font-weight:var(--neeto-editor-content-paragraph-font-weight);line-height:1.6;line-height:var(--neeto-editor-content-paragraph-line-height);margin-bottom:.5rem;margin-bottom:var(--neeto-editor-content-list-item-margin-bottom);margin-top:.5rem;margin-top:var(--neeto-editor-content-list-item-margin-top)}.neeto-editor-content ol li:before,.neeto-editor-content ul li:before{background-color:#363737;background-color:rgba(var(--neeto-editor-content-paragraph-color))}.neeto-editor-content a[href]{color:#095aba;color:rgb(var(--neeto-editor-accent-800));font-weight:inherit}.neeto-editor-content .neeto-editor__video-wrapper{display:flex;margin:1rem 0}.neeto-editor-content .neeto-editor__video-wrapper .neeto-editor__video-iframe{display:inline-block;height:auto!important;max-width:100%;vertical-align:top}.neeto-editor-content .neeto-editor__video-wrapper .neeto-editor__video-iframe iframe{aspect-ratio:16/9;width:100%}.neeto-editor-content .neeto-editor__video--left{justify-content:flex-start}.neeto-editor-content .neeto-editor__video--right{justify-content:flex-end}.neeto-editor-content .neeto-editor__video--center{justify-content:center}.neeto-editor-content mark{border-radius:3px;border-radius:var(--neeto-editor-rounded-sm);padding:0}.neeto-editor-content [data-type=mention],.neeto-editor-content [data-type=special-mention]{color:#095aba;color:rgb(var(--neeto-editor-accent-800))}.neeto-editor-content table{border:1px solid #d8dcde;border:1px solid rgba(var(--neeto-editor-gray-300));border-collapse:separate;border-radius:3px;border-radius:var(--neeto-editor-rounded-sm);border-spacing:0;min-width:300px;overflow:hidden;table-layout:fixed}.neeto-editor-content table td,.neeto-editor-content table th{border-left:1px solid #d8dcde;border-left:1px solid rgba(var(--neeto-editor-gray-300));border-top:1px solid #d8dcde;border-top:1px solid rgba(var(--neeto-editor-gray-300));padding:8px 12px;position:relative}.neeto-editor-content table td:first-child,.neeto-editor-content table th:first-child{border-left:none}.neeto-editor-content table th{background:#f6f7f8;background:rgb(var(--neeto-editor-gray-100));border-top:none}.neeto-editor-content table td{background:#fff;background:rgb(var(--neeto-editor-white))}.neeto-editor-content--hidden{display:none}.neeto-editor__image-wrapper{color:inherit!important;display:flex;font-weight:400!important;margin:1rem 0;padding-left:3px;text-decoration:none}.neeto-editor__image-wrapper figure{cursor:pointer;display:inline-block;margin:0;max-width:100%;overflow:hidden;position:relative;vertical-align:top}.neeto-editor__image-wrapper .neeto-editor__image{display:inline-block;height:auto!important;max-width:100%;min-height:52px;vertical-align:top}.neeto-editor__image-wrapper .neeto-editor__image img,.neeto-editor__image-wrapper .neeto-editor__image video{display:inline-block;height:auto;vertical-align:top!important;width:100%}.neeto-editor__image-wrapper .neeto-editor__image img.hidden,.neeto-editor__image-wrapper .neeto-editor__image video.hidden{display:none}.neeto-editor__image-wrapper .neeto-editor__image img{border:1px solid #e4e4e7;border-color:rgba(var(--neeto-editor-content-image-border-color));border-radius:8px;border-radius:var(--neeto-editor-content-image-border-radius);cursor:zoom-in}.neeto-editor__image-wrapper .neeto-editor__image-placeholder{align-items:center;border:1px solid;border-radius:8px;display:flex;height:200px;justify-content:center;width:400px}.neeto-editor__image-wrapper figcaption div{color:#344054;color:rgb(var(--neeto-editor-gray-600));font-size:.875rem;font-weight:400;font-weight:var(--neeto-editor-font-normal);line-height:1.4;text-align:center}.neeto-editor__image-wrapper figcaption div a{display:inline-block;margin:0;text-align:center}.neeto-editor__image-wrapper figcaption.is-empty div:before{color:#87929d;color:rgb(var(--neeto-editor-gray-500));content:\"Add a caption\";inset:0;position:absolute}.neeto-editor__image-wrapper:has(img:not([src])){display:none}.neeto-editor-content figcaption{color:#6b7280;font-size:.875rem;font-weight:400;line-height:1.4;max-width:100%;text-align:center}.neeto-editor__image--left{justify-content:flex-start}.neeto-editor__image--center{justify-content:center}.neeto-editor__image--right{justify-content:flex-end}.selected-text{background-color:#d8dcde;background-color:rgb(var(--neeto-editor-gray-300));padding:2px 0}.ne-image-preview-wrapper{align-items:center;background:rgba(16,24,40,.5);background:rgba(var(--neeto-editor-gray-800),.5);display:none;height:100%;justify-content:center;left:0;position:fixed;top:0;width:100%;z-index:999999}.ne-image-preview-wrapper.active{display:flex}.ne-image-preview-wrapper .ne-image-preview{background:#fff;background:rgb(var(--neeto-editor-white));display:flex;flex-direction:column;gap:10px;max-height:90vh;max-width:60vw;opacity:0;transition:opacity .1s ease-in-out}.ne-image-preview-wrapper .ne-image-preview img{background:#fff;background:rgb(var(--neeto-editor-white));max-height:100%;max-width:100%;-o-object-fit:contain;object-fit:contain;overflow:hidden;padding:10px;width:-moz-fit-content;width:fit-content}.ne-image-preview-wrapper .ne-image-preview.image-loaded{align-items:center;background:transparent;border-radius:10px;display:flex;opacity:1}.ne-image-preview-wrapper .ne-image-preview__caption{color:#101828;color:rgb(var(--neeto-editor-gray-800));line-height:1.5;margin-top:auto;text-align:center;width:100%}.ne-image-preview-wrapper .close-button{align-items:center;background-color:#fff;background-color:rgb(var(--neeto-editor-white));border-radius:999px;border-radius:var(--neeto-editor-rounded-full);cursor:pointer;display:flex;height:30px;justify-content:center;position:absolute;right:12px;top:12px;width:30px}.ne-image-preview-wrapper .image-preview{max-height:70%;max-width:70%}.ne-image-preview-wrapper__spinner{position:absolute}.ne-image-preview-wrapper__spinner i{background-color:#d8dcde;background-color:rgb(var(--neeto-editor-gray-300))}";
27
+ var css = "@charset \"UTF-8\";@import url(\"https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.7.2/styles/github.min.css\");:root{--neeto-editor-white:255,255,255;--neeto-editor-black:12,17,29;--neeto-editor-gray-800:16,24,40;--neeto-editor-gray-700:29,41,57;--neeto-editor-gray-600:52,64,84;--neeto-editor-gray-500:135,146,157;--neeto-editor-gray-400:194,200,204;--neeto-editor-gray-300:216,220,222;--neeto-editor-gray-200:233,235,237;--neeto-editor-gray-100:246,247,248;--neeto-editor-gray-50:250,250,250;--neeto-editor-primary-800:0,102,83;--neeto-editor-primary-600:0,122,100;--neeto-editor-primary-500:0,128,104;--neeto-editor-primary-100:225,243,238;--neeto-editor-primary-50:240,249,247;--neeto-editor-accent-800:9,90,186;--neeto-editor-accent-600:13,102,208;--neeto-editor-accent-500:20,115,230;--neeto-editor-accent-100:230,244,255;--neeto-editor-accent-50:239,248,255;--neeto-editor-success-800:1,121,93;--neeto-editor-success-600:1,141,109;--neeto-editor-success-500:2,162,124;--neeto-editor-success-100:235,255,250;--neeto-editor-error-800:187,18,26;--neeto-editor-error-600:201,37,45;--neeto-editor-error-500:215,55,63;--neeto-editor-error-100:254,236,240;--neeto-editor-info-800:9,90,186;--neeto-editor-info-600:13,102,208;--neeto-editor-info-500:20,115,230;--neeto-editor-info-100:226,242,255;--neeto-editor-warning-800:189,100,13;--neeto-editor-warning-600:203,111,16;--neeto-editor-warning-500:218,123,17;--neeto-editor-warning-100:251,242,225;--neeto-editor-pastel-silver:232,233,237;--neeto-editor-pastel-red:255,229,229;--neeto-editor-pastel-yellow:254,243,197;--neeto-editor-pastel-green:211,249,232;--neeto-editor-pastel-blue:236,244,255;--neeto-editor-pastel-purple:238,235,255;--neeto-editor-pastel-pink:253,226,241;--neeto-editor-rounded-none:0;--neeto-editor-rounded-sm:3px;--neeto-editor-rounded:5px;--neeto-editor-rounded-md:6px;--neeto-editor-rounded-lg:8px;--neeto-editor-rounded-xl:12px;--neeto-editor-rounded-full:999px;--neeto-editor-font-thin:100;--neeto-editor-font-extralight:200;--neeto-editor-font-light:300;--neeto-editor-font-normal:400;--neeto-editor-font-medium:500;--neeto-editor-font-semibold:600;--neeto-editor-font-bold:700;--neeto-editor-font-extrabold:800;--neeto-editor-font-black:900;--neeto-editor-content-h1-margin:1.5rem 0 0.25rem;--neeto-editor-content-h2-margin:1.5rem 0 0.25rem;--neeto-editor-content-h3-margin:1.5rem 0 0.25rem;--neeto-editor-content-h4-margin:1.5rem 0 0.25rem;--neeto-editor-content-h5-margin:1.5rem 0 0.25rem;--neeto-editor-content-h6-margin:1.5rem 0 0.25rem;--neeto-editor-content-heading-font-weight:600;--neeto-editor-content-heading-font-weight-bold:bold;--neeto-editor-content-heading-color:12,17,29,1;--neeto-editor-content-paragraph-color:54,55,55,1;--neeto-editor-content-paragraph-font-weight:400;--neeto-editor-content-paragraph-line-height:1.6;--neeto-editor-content-list-left-padding:2rem;--neeto-editor-content-list-margin-bottom:1rem;--neeto-editor-content-list-item-margin-bottom:0.5rem;--neeto-editor-content-list-item-margin-top:0.5rem;--neeto-editor-content-code-font-size:85%;--neeto-editor-content-code-background-color:246,248,250,1;--neeto-editor-content-code-line-number-color:89,99,110,1;--neeto-editor-content-code-color:31,35,40,1;--neeto-editor-content-code-padding:0.2em 0.4em;--neeto-editor-content-blockquote-color:89,99,110,1;--neeto-editor-content-blockquote-border-color:209,217,224,1;--neeto-editor-content-blockquote-border-left-width:4px;--neeto-editor-content-blockquote-margin-bottom:1rem;--neeto-editor-content-blockquote-padding-left:0.75rem;--neeto-editor-content-image-border-color:228,228,231;--neeto-editor-content-image-border-radius:8px}.neeto-editor-content{-moz-tab-size:2;-o-tab-size:2;tab-size:2;white-space:pre-wrap;word-break:break-word}.neeto-editor-content hr{margin:.5rem 0}.neeto-editor-content .table-responsive{-webkit-overflow-scrolling:touch;margin:1rem 0;overflow-x:auto}.neeto-editor-content.neeto-editor-size--small{--neeto-editor-content-heading-color:31,35,40,1;--neeto-editor-content-paragraph-color:31,35,40,1;--neeto-editor-content-h1-font-size:1.75rem;--neeto-editor-content-h2-font-size:1.3125rem;--neeto-editor-content-h3-font-size:1.09375rem;--neeto-editor-content-h4-font-size:0.875rem;--neeto-editor-content-h5-font-size:0.765625rem;--neeto-editor-content-h6-font-size:0.74375rem;--neeto-editor-content-paragraph-font-size:0.875rem;--neeto-editor-content-paragraph-line-height:1.5;--neeto-editor-content-list-left-padding:1.5rem;--neeto-editor-content-list-item-margin-bottom:0.25rem;--neeto-editor-content-list-item-margin-top:0.25rem}.neeto-editor-content.neeto-editor-size--medium{--neeto-editor-content-h1-font-size:2rem;--neeto-editor-content-h2-font-size:1.5rem;--neeto-editor-content-h3-font-size:1.25rem;--neeto-editor-content-h4-font-size:1rem;--neeto-editor-content-h5-font-size:0.875rem;--neeto-editor-content-h6-font-size:0.75rem;--neeto-editor-content-paragraph-font-size:1rem}@media only screen and (max-width:767px){.neeto-editor-content.neeto-editor-size--medium{--neeto-editor-content-h1-font-size:1.375rem;--neeto-editor-content-h2-font-size:1.25rem;--neeto-editor-content-h3-font-size:1.125rem}}.neeto-editor-content.neeto-editor-size--large{--neeto-editor-content-h1-font-size:2.375rem;--neeto-editor-content-h2-font-size:1.93rem;--neeto-editor-content-h3-font-size:1.633rem;--neeto-editor-content-h4-font-size:1.336rem;--neeto-editor-content-h5-font-size:0.986rem;--neeto-editor-content-h6-font-size:0.796rem;--neeto-editor-content-paragraph-font-size:1.125rem}@media only screen and (max-width:767px){.neeto-editor-content.neeto-editor-size--large{--neeto-editor-content-h1-font-size:2.125rem;--neeto-editor-content-h2-font-size:1.7266rem;--neeto-editor-content-h3-font-size:1.4609rem;--neeto-editor-content-h4-font-size:1.1953rem;--neeto-editor-content-h5-font-size:0.875rem;--neeto-editor-content-h6-font-size:0.75rem;--neeto-editor-content-paragraph-font-size:1rem}}.neeto-editor-content h1,.neeto-editor-content h2,.neeto-editor-content h3,.neeto-editor-content h4,.neeto-editor-content h5,.neeto-editor-content h6{color:#0c111d;color:rgba(var(--neeto-editor-content-heading-color));font-weight:600;font-weight:var(--neeto-editor-content-heading-font-weight)}.neeto-editor-content h1 strong,.neeto-editor-content h2 strong,.neeto-editor-content h3 strong,.neeto-editor-content h4 strong,.neeto-editor-content h5 strong,.neeto-editor-content h6 strong{font-weight:700!important;font-weight:var(--neeto-editor-content-heading-font-weight-bold)!important}.neeto-editor-content h1{font-size:var(--neeto-editor-content-h1-font-size);margin:1.5rem 0 .25rem;margin:var(--neeto-editor-content-h1-margin)}.neeto-editor-content h2{font-size:var(--neeto-editor-content-h2-font-size);margin:1.5rem 0 .25rem;margin:var(--neeto-editor-content-h2-margin)}.neeto-editor-content h3{font-size:var(--neeto-editor-content-h3-font-size);margin:1.5rem 0 .25rem;margin:var(--neeto-editor-content-h3-margin)}.neeto-editor-content h4{font-size:var(--neeto-editor-content-h4-font-size);margin:1.5rem 0 .25rem;margin:var(--neeto-editor-content-h4-margin)}.neeto-editor-content h5{font-size:var(--neeto-editor-content-h5-font-size);margin:1.5rem 0 .25rem;margin:var(--neeto-editor-content-h5-margin)}.neeto-editor-content h6{font-size:var(--neeto-editor-content-h6-font-size);margin:1.5rem 0 .25rem;margin:var(--neeto-editor-content-h6-margin)}.neeto-editor-content .header-wrapper-link{position:relative}.neeto-editor-content .header-wrapper-link h1,.neeto-editor-content .header-wrapper-link h2,.neeto-editor-content .header-wrapper-link h3,.neeto-editor-content .header-wrapper-link h4,.neeto-editor-content .header-wrapper-link h5,.neeto-editor-content .header-wrapper-link h6{cursor:pointer;transition:color .15s ease-in}.neeto-editor-content .header-wrapper-link .header-link-icon-wrapper{align-items:center;display:flex;height:100%;left:-1.5625rem;opacity:0;position:absolute;transition:opacity .15s ease-in;width:1.5625rem}.neeto-editor-content .header-wrapper-link .header-link-icon-wrapper svg{fill:#006653;fill:rgb(var(--neeto-editor-primary-800));transition:fill .15s ease-in}.neeto-editor-content .header-wrapper-link:hover h1,.neeto-editor-content .header-wrapper-link:hover h2,.neeto-editor-content .header-wrapper-link:hover h3,.neeto-editor-content .header-wrapper-link:hover h4,.neeto-editor-content .header-wrapper-link:hover h5,.neeto-editor-content .header-wrapper-link:hover h6{color:#095aba;color:rgb(var(--neeto-editor-accent-800))}.neeto-editor-content .header-wrapper-link:hover .header-link-icon-wrapper{opacity:1}.neeto-editor-content .header-wrapper-link:hover svg{fill:#095aba;fill:rgb(var(--neeto-editor-accent-800))}.neeto-editor-content p{color:#363737;color:rgba(var(--neeto-editor-content-paragraph-color));font-size:var(--neeto-editor-content-paragraph-font-size);font-weight:400;font-weight:var(--neeto-editor-content-paragraph-font-weight);line-height:1.6;line-height:var(--neeto-editor-content-paragraph-line-height);margin:0}.neeto-editor-content p:empty:after{content:\" \"}.neeto-editor-content p:last-child{margin-bottom:0}.neeto-editor-content p strong{font-weight:600!important}.neeto-editor-content div{color:#363737;color:rgba(var(--neeto-editor-content-paragraph-color));font-size:var(--neeto-editor-content-paragraph-font-size);font-weight:400;font-weight:var(--neeto-editor-content-paragraph-font-weight);line-height:1.6;line-height:var(--neeto-editor-content-paragraph-line-height)}.neeto-editor-content code{background-color:#f6f8fa;background-color:rgba(var(--neeto-editor-content-code-background-color));border-color:#f6f8fa;border-color:rgba(var(--neeto-editor-content-code-background-color));border-radius:3px;border-radius:var(--neeto-editor-rounded-sm);color:#1f2328;color:rgba(var(--neeto-editor-content-code-color));font-family:SFMono-Regular,Menlo,Consolas,PT Mono,Liberation Mono,Courier,monospace;font-size:85%;font-size:var(--neeto-editor-content-code-font-size);padding:.2em .4em;padding:var(--neeto-editor-content-code-padding)}.neeto-editor-content code *{font-size:inherit!important}.neeto-editor-content h1 code,.neeto-editor-content h2 code,.neeto-editor-content h3 code,.neeto-editor-content h4 code,.neeto-editor-content h5 code,.neeto-editor-content h6 code,.neeto-editor-content p code{font-size:85%;font-size:var(--neeto-editor-content-code-font-size)}.neeto-editor-content pre{background-color:#f6f8fa;background-color:rgba(var(--neeto-editor-content-code-background-color));border-color:#f6f8fa;border-color:rgba(var(--neeto-editor-content-code-background-color));border-radius:3px;border-radius:var(--neeto-editor-rounded-sm);counter-reset:line-number;font-size:var(--neeto-editor-content-paragraph-font-size);line-height:1.5;margin-bottom:1rem;margin-top:1rem;max-width:100%;padding:0;position:relative}.neeto-editor-content pre,.neeto-editor-content pre div{color:#1f2328;color:rgba(var(--neeto-editor-content-code-color))}.neeto-editor-content pre .neeto-editor-codeblock-options{align-items:center;display:flex;gap:.25rem;opacity:0;position:absolute;right:.25rem;top:.25rem;visibility:hidden}.neeto-editor-content pre .neeto-editor-codeblock-options__menu{display:flex;flex-direction:column;gap:.25rem}.neeto-editor-content pre .neeto-editor-codeblock-options__input{margin:.25rem}.neeto-editor-content pre:hover .copy-button,.neeto-editor-content pre:hover .neeto-editor-codeblock-options{opacity:1;visibility:visible}.neeto-editor-content pre .copy-button{opacity:0;position:absolute;right:.25rem;top:.25rem;visibility:hidden}.neeto-editor-content pre[data-linenumbers] .highlight-line{padding-left:3.125rem;position:relative}.neeto-editor-content pre[data-linenumbers] .highlight-line:before{align-items:center;color:#59636e;color:rgba(var(--neeto-editor-content-code-line-number-color));content:counter(line-number);counter-increment:line-number;display:flex;font-size:85%;font-weight:400;height:100%;justify-content:flex-end;left:0;padding-left:.625rem;padding-right:1rem;position:absolute;width:3.125rem}.neeto-editor-content pre[data-linenumbers] .highlight-line:last-child:before{content:\"\"}.neeto-editor-content pre>code{background-color:transparent;border-radius:0;border-width:0;color:inherit;display:block;font-size:85%;font-size:var(--neeto-editor-content-code-font-size);font-weight:400;line-height:inherit;overflow-x:auto;padding:.75rem;white-space:pre!important;width:100%}.neeto-editor-content pre[data-linenumbers]>code{padding-left:0}.neeto-editor-content blockquote{border-left-color:#d1d9e0;border-left-color:rgba(var(--neeto-editor-content-blockquote-border-color));border-left-width:4px;border-left-width:var(--neeto-editor-content-blockquote-border-left-width);color:#59636e;color:rgba(var(--neeto-editor-content-blockquote-color));font-weight:500;font-weight:var(--neeto-editor-font-medium);margin-bottom:1rem;margin-bottom:var(--neeto-editor-content-blockquote-margin-bottom);padding-left:.75rem;padding-left:var(--neeto-editor-content-blockquote-padding-left);quotes:\"“\" \"”\" \"‘\" \"’\"}.neeto-editor-content blockquote div,.neeto-editor-content blockquote p{color:inherit}.neeto-editor-content blockquote>p:after,.neeto-editor-content blockquote>p:before{content:\"\"!important}.neeto-editor-content ol,.neeto-editor-content ul{list-style:revert;margin-bottom:1rem;margin-bottom:var(--neeto-editor-content-list-margin-bottom);padding-left:2rem;padding-left:var(--neeto-editor-content-list-left-padding)}.neeto-editor-content ol li,.neeto-editor-content ul li{color:#363737;color:rgba(var(--neeto-editor-content-paragraph-color));font-size:var(--neeto-editor-content-paragraph-font-size);font-weight:400;font-weight:var(--neeto-editor-content-paragraph-font-weight);line-height:1.6;line-height:var(--neeto-editor-content-paragraph-line-height);margin-bottom:.5rem;margin-bottom:var(--neeto-editor-content-list-item-margin-bottom);margin-top:.5rem;margin-top:var(--neeto-editor-content-list-item-margin-top)}.neeto-editor-content ol li:before,.neeto-editor-content ul li:before{background-color:#363737;background-color:rgba(var(--neeto-editor-content-paragraph-color))}.neeto-editor-content a[href]{color:#095aba;color:rgb(var(--neeto-editor-accent-800));font-weight:inherit}.neeto-editor-content .neeto-editor__video-wrapper{display:flex;margin:1rem 0}.neeto-editor-content .neeto-editor__video-wrapper .neeto-editor__video-iframe{display:inline-block;height:auto!important;max-width:100%;vertical-align:top}.neeto-editor-content .neeto-editor__video-wrapper .neeto-editor__video-iframe iframe{aspect-ratio:16/9;width:100%}.neeto-editor-content .neeto-editor__video--left{justify-content:flex-start}.neeto-editor-content .neeto-editor__video--right{justify-content:flex-end}.neeto-editor-content .neeto-editor__video--center{justify-content:center}.neeto-editor-content mark{border-radius:3px;border-radius:var(--neeto-editor-rounded-sm);padding:0}.neeto-editor-content [data-type=mention],.neeto-editor-content [data-type=special-mention]{color:#095aba;color:rgb(var(--neeto-editor-accent-800))}.neeto-editor-content table{border:1px solid #d8dcde;border:1px solid rgba(var(--neeto-editor-gray-300));border-collapse:separate;border-radius:3px;border-radius:var(--neeto-editor-rounded-sm);border-spacing:0;min-width:300px;overflow:hidden;table-layout:fixed}.neeto-editor-content table td,.neeto-editor-content table th{border-left:1px solid #d8dcde;border-left:1px solid rgba(var(--neeto-editor-gray-300));border-top:1px solid #d8dcde;border-top:1px solid rgba(var(--neeto-editor-gray-300));padding:8px 12px;position:relative}.neeto-editor-content table td:first-child,.neeto-editor-content table th:first-child{border-left:none}.neeto-editor-content table th{background:#f6f7f8;background:rgb(var(--neeto-editor-gray-100));border-top:none}.neeto-editor-content table td{background:#fff;background:rgb(var(--neeto-editor-white))}.neeto-editor-content--hidden{display:none}.neeto-editor__image-wrapper{color:inherit!important;display:flex;font-weight:400!important;margin:1rem 0;padding-left:3px;text-decoration:none}.neeto-editor__image-wrapper figure{cursor:pointer;display:inline-block;margin:0;max-width:100%;overflow:hidden;position:relative;vertical-align:top}.neeto-editor__image-wrapper .neeto-editor__image{display:inline-block;height:auto!important;max-width:100%;min-height:52px;vertical-align:top}.neeto-editor__image-wrapper .neeto-editor__image img,.neeto-editor__image-wrapper .neeto-editor__image video{display:inline-block;height:auto;vertical-align:top!important;width:100%}.neeto-editor__image-wrapper .neeto-editor__image img.hidden,.neeto-editor__image-wrapper .neeto-editor__image video.hidden{display:none}.neeto-editor__image-wrapper .neeto-editor__image img{border:1px solid #e4e4e7;border-color:rgba(var(--neeto-editor-content-image-border-color));border-radius:8px;border-radius:var(--neeto-editor-content-image-border-radius);cursor:zoom-in}.neeto-editor__image-wrapper .neeto-editor__image-placeholder{align-items:center;border:1px solid;border-radius:8px;display:flex;height:200px;justify-content:center;width:400px}.neeto-editor__image-wrapper figcaption div{color:#344054;color:rgb(var(--neeto-editor-gray-600));font-size:.875rem;font-weight:400;font-weight:var(--neeto-editor-font-normal);line-height:1.4;text-align:center}.neeto-editor__image-wrapper figcaption div a{display:inline-block;margin:0;text-align:center}.neeto-editor__image-wrapper figcaption.is-empty div:before{color:#87929d;color:rgb(var(--neeto-editor-gray-500));content:\"Add a caption\";inset:0;position:absolute}.neeto-editor__image-wrapper:has(img:not([src])){display:none}.neeto-editor-content figcaption{color:#6b7280;font-size:.875rem;font-weight:400;line-height:1.4;max-width:100%;text-align:center}.neeto-editor__image--left{justify-content:flex-start}.neeto-editor__image--center{justify-content:center}.neeto-editor__image--right{justify-content:flex-end}.selected-text{background-color:#d8dcde;background-color:rgb(var(--neeto-editor-gray-300));padding:2px 0}.ne-image-preview-wrapper{align-items:center;background:rgba(16,24,40,.5);background:rgba(var(--neeto-editor-gray-800),.5);display:none;height:100%;justify-content:center;left:0;position:fixed;top:0;width:100%;z-index:999999}.ne-image-preview-wrapper.active{display:flex}.ne-image-preview-wrapper .ne-image-preview{background:#fff;background:rgb(var(--neeto-editor-white));display:flex;flex-direction:column;gap:10px;max-height:90vh;max-width:60vw;opacity:0;transition:opacity .1s ease-in-out}.ne-image-preview-wrapper .ne-image-preview img{background:#fff;background:rgb(var(--neeto-editor-white));max-height:100%;max-width:100%;-o-object-fit:contain;object-fit:contain;overflow:hidden;padding:10px;width:-moz-fit-content;width:fit-content}.ne-image-preview-wrapper .ne-image-preview.image-loaded{align-items:center;background:transparent;border-radius:10px;display:flex;opacity:1}.ne-image-preview-wrapper .ne-image-preview__caption{color:#101828;color:rgb(var(--neeto-editor-gray-800));line-height:1.5;margin-top:auto;text-align:center;width:100%}.ne-image-preview-wrapper .close-button{align-items:center;background-color:#fff;background-color:rgb(var(--neeto-editor-white));border-radius:999px;border-radius:var(--neeto-editor-rounded-full);cursor:pointer;display:flex;height:30px;justify-content:center;position:absolute;right:12px;top:12px;width:30px}.ne-image-preview-wrapper .image-preview{max-height:70%;max-width:70%}.ne-image-preview-wrapper__spinner{position:absolute}.ne-image-preview-wrapper__spinner i{background-color:#d8dcde;background-color:rgb(var(--neeto-editor-gray-300))}";
28
28
  injectCss.n(css,{});
29
29
 
30
30
  var ImagePreview = function ImagePreview(_ref) {
@@ -141,7 +141,7 @@ var EditorContent = function EditorContent(_ref) {
141
141
  imagePreviewDetails = _useState2[0],
142
142
  setImagePreviewDetails = _useState2[1];
143
143
  var editorContentRef = React.useRef(null);
144
- var htmlContent = index$1.substituteVariables(index$1.applySyntaxHighlighting(content), variables);
144
+ var htmlContent = index$1.substituteVariables(index$1.applySyntaxHighlightingAndLineNumbers(content), variables);
145
145
  var sanitize = DOMPurify.sanitize;
146
146
  var injectCopyButtonToCodeBlocks = function injectCopyButtonToCodeBlocks() {
147
147
  var _editorContentRef$cur;
@@ -1 +1 @@
1
- {"version":3,"file":"EditorContent.cjs.js","sources":["../../src/components/EditorContent/ImagePreview.jsx","../../src/components/EditorContent/utils/headers.js","../../src/components/EditorContent/index.jsx"],"sourcesContent":["import { useEffect, useRef, useState } from \"react\";\n\nimport classnames from \"classnames\";\nimport { useOnClickOutside } from \"neetocommons/react-utils\";\nimport { Close } from \"neetoicons\";\nimport { Button, Spinner } from \"neetoui\";\nimport { createPortal } from \"react-dom\";\nimport { useTranslation } from \"react-i18next\";\n\nconst ImagePreview = ({ imagePreviewDetails, setImagePreviewDetails }) => {\n const [isLoading, setIsLoading] = useState(true);\n\n const { t } = useTranslation();\n\n const imagePreviewRef = useRef(null);\n\n useOnClickOutside(imagePreviewRef, () => setImagePreviewDetails(null), {\n enabled: true,\n });\n\n useEffect(() => {\n document.addEventListener(\n \"keydown\",\n e => e.key === \"Escape\" && setImagePreviewDetails(null)\n );\n\n return () =>\n document.removeEventListener(\n \"keydown\",\n e => e.key === \"Escape\" && setImagePreviewDetails(null)\n );\n }, []);\n\n return createPortal(\n <div className=\"ne-image-preview-wrapper active\">\n {isLoading && <Spinner className=\"ne-image-preview-wrapper__spinner\" />}\n {!isLoading && (\n <div className=\"close-button\">\n <Button\n icon={Close}\n style=\"secondary\"\n onClick={() => setImagePreviewDetails(null)}\n />\n </div>\n )}\n <div\n className={classnames(\"ne-image-preview\", {\n \"image-loaded\": !isLoading,\n })}\n >\n <img\n alt={t(\"neetoEditor.editorContent.imagePreviewAltText\")}\n ref={imagePreviewRef}\n src={imagePreviewDetails.src}\n onLoad={() => setIsLoading(false)}\n />\n {imagePreviewDetails && (\n <p className=\"ne-image-preview__caption\">\n {imagePreviewDetails.caption}\n </p>\n )}\n </div>\n </div>,\n document.body\n );\n};\n\nexport default ImagePreview;\n","const buildLinkSVG = () => {\n const svgNS = \"http://www.w3.org/2000/svg\";\n\n const svgWrapper = document.createElement(\"span\");\n svgWrapper.classList.add(\"header-link-icon-wrapper\");\n const svg = document.createElementNS(svgNS, \"svg\");\n svg.setAttribute(\"aria-hidden\", \"true\");\n svg.setAttribute(\"height\", \"20\");\n svg.setAttribute(\"viewBox\", \"0 0 16 16\");\n svg.setAttribute(\"width\", \"20\");\n\n const path = document.createElementNS(svgNS, \"path\");\n path.setAttribute(\n \"d\",\n \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n );\n\n svg.appendChild(path);\n svgWrapper.appendChild(svg);\n\n return svgWrapper;\n};\n\nconst convertTextToId = text =>\n text\n .trim()\n .toLowerCase()\n .replace(/[^a-z0-9\\s]/g, \"\")\n .replace(/\\s+/g, \"-\");\n\nexport const buildHeaderLinks = editorContentNode => {\n const headerTags = editorContentNode.querySelectorAll(\n \"h1, h2, h3, h4, h5, h6\"\n );\n const usedIds = new Map();\n\n headerTags.forEach(heading => {\n let headingId = convertTextToId(heading.textContent);\n if (usedIds.has(headingId)) {\n const count = usedIds.get(headingId);\n usedIds.set(headingId, count + 1);\n headingId = `${headingId}-${count}`;\n } else usedIds.set(headingId, 1);\n\n heading.setAttribute(\"id\", headingId);\n\n const anchor = document.createElement(\"a\");\n anchor.setAttribute(\"href\", `#${headingId}`);\n anchor.classList.add(\"header-wrapper-link\");\n anchor.appendChild(buildLinkSVG());\n anchor.appendChild(heading.cloneNode(true));\n\n heading.replaceWith(anchor);\n });\n};\n","import { memo, useEffect, useRef, useState } from \"react\";\n\nimport classnames from \"classnames\";\nimport DOMPurify from \"dompurify\";\nimport CopyToClipboardButton from \"neetomolecules/CopyToClipboardButton\";\nimport { isNil } from \"ramda\";\nimport { createRoot } from \"react-dom/client\";\n\nimport { EDITOR_SIZES } from \"src/common/constants\";\nimport \"src/styles/editor/editor-content.scss\";\n\nimport {\n EDITOR_CONTENT_CLASS_NAME,\n EDITOR_CONTENT_DEFAULT_CONFIGURATION,\n SANITIZE_OPTIONS,\n} from \"./constants\";\nimport ImagePreview from \"./ImagePreview\";\nimport {\n substituteVariables,\n applyLineHighlighting,\n applySyntaxHighlighting,\n} from \"./utils\";\nimport { buildHeaderLinks } from \"./utils/headers\";\n\nconst EditorContent = ({\n content = \"\",\n variables = [],\n className,\n size = EDITOR_SIZES.SMALL,\n configuration = EDITOR_CONTENT_DEFAULT_CONFIGURATION,\n ...otherProps\n}) => {\n const [imagePreviewDetails, setImagePreviewDetails] = useState(null);\n const editorContentRef = useRef(null);\n\n const htmlContent = substituteVariables(\n applySyntaxHighlighting(content),\n variables\n );\n const sanitize = DOMPurify.sanitize;\n\n const injectCopyButtonToCodeBlocks = () => {\n const preTags = editorContentRef.current?.querySelectorAll(\n `.${EDITOR_CONTENT_CLASS_NAME} pre`\n );\n\n preTags.forEach(preTag => {\n const button = document.createElement(\"div\");\n button.className = \"neeto-editor-codeblock-options\";\n const root = createRoot(button);\n root.render(\n <CopyToClipboardButton\n size=\"small\"\n style=\"tertiary\"\n value={preTag.textContent}\n />\n );\n preTag.appendChild(button);\n });\n };\n\n const bindImageClickListener = () => {\n const figureTags = editorContentRef.current?.querySelectorAll(\n `.${EDITOR_CONTENT_CLASS_NAME} figure`\n );\n\n figureTags.forEach(figureTag => {\n const image = figureTag.querySelector(\"img\");\n const link = figureTag.querySelector(\"a\");\n if (isNil(image) || isNil(link)) return;\n\n figureTag.addEventListener(\"click\", event => {\n event.preventDefault();\n const caption = figureTag.querySelector(\"figcaption\").innerText;\n setImagePreviewDetails({ src: image.src, caption });\n });\n });\n };\n\n useEffect(() => {\n injectCopyButtonToCodeBlocks();\n bindImageClickListener();\n applyLineHighlighting(editorContentRef.current);\n configuration.enableHeaderLinks &&\n buildHeaderLinks(editorContentRef.current);\n }, [content]);\n\n return (\n <>\n <div\n data-cy=\"neeto-editor-content\"\n ref={editorContentRef}\n className={classnames(EDITOR_CONTENT_CLASS_NAME, {\n [className]: className,\n [`neeto-editor-size--${size}`]: true,\n })}\n dangerouslySetInnerHTML={{\n __html: sanitize(htmlContent, SANITIZE_OPTIONS),\n }}\n {...otherProps}\n />\n {imagePreviewDetails && (\n <ImagePreview {...{ imagePreviewDetails, setImagePreviewDetails }} />\n )}\n </>\n );\n};\n\nexport default memo(EditorContent);\n"],"names":["ImagePreview","_ref","imagePreviewDetails","setImagePreviewDetails","_useState","useState","_useState2","_slicedToArray","isLoading","setIsLoading","_useTranslation","useTranslation","t","imagePreviewRef","useRef","useOnClickOutside","enabled","useEffect","document","addEventListener","e","key","removeEventListener","createPortal","_jsxs","className","children","_jsx","Spinner","Button","icon","Close","style","onClick","classnames","alt","ref","src","onLoad","caption","body","buildLinkSVG","svgNS","svgWrapper","createElement","classList","add","svg","createElementNS","setAttribute","path","appendChild","convertTextToId","text","trim","toLowerCase","replace","buildHeaderLinks","editorContentNode","headerTags","querySelectorAll","usedIds","Map","forEach","heading","headingId","textContent","has","count","get","set","concat","anchor","cloneNode","replaceWith","EditorContent","_ref$content","content","_ref$variables","variables","_ref$size","size","EDITOR_SIZES","SMALL","_ref$configuration","configuration","EDITOR_CONTENT_DEFAULT_CONFIGURATION","otherProps","_objectWithoutProperties","_excluded","editorContentRef","htmlContent","substituteVariables","applySyntaxHighlighting","sanitize","DOMPurify","injectCopyButtonToCodeBlocks","_editorContentRef$cur","preTags","current","EDITOR_CONTENT_CLASS_NAME","preTag","button","root","createRoot","render","CopyToClipboardButton","value","bindImageClickListener","_editorContentRef$cur2","figureTags","figureTag","image","querySelector","link","isNil","event","preventDefault","innerText","applyLineHighlighting","enableHeaderLinks","_Fragment","_objectSpread","_defineProperty","dangerouslySetInnerHTML","__html","SANITIZE_OPTIONS","memo"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,IAAMA,YAAY,GAAG,SAAfA,YAAYA,CAAAC,IAAA,EAAwD;AAAA,EAAA,IAAlDC,mBAAmB,GAAAD,IAAA,CAAnBC,mBAAmB;IAAEC,sBAAsB,GAAAF,IAAA,CAAtBE,sBAAsB,CAAA;AACjE,EAAA,IAAAC,SAAA,GAAkCC,cAAQ,CAAC,IAAI,CAAC;IAAAC,UAAA,GAAAC,cAAA,CAAAH,SAAA,EAAA,CAAA,CAAA;AAAzCI,IAAAA,SAAS,GAAAF,UAAA,CAAA,CAAA,CAAA;AAAEG,IAAAA,YAAY,GAAAH,UAAA,CAAA,CAAA,CAAA,CAAA;AAE9B,EAAA,IAAAI,eAAA,GAAcC,2BAAc,EAAE;IAAtBC,CAAC,GAAAF,eAAA,CAAD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AAAA,eAAS,CAAC,YAAM;AACd+E,IAAAA,4BAA4B,EAAE,CAAA;AAC9BY,IAAAA,sBAAsB,EAAE,CAAA;AACxBW,IAAAA,6BAAqB,CAAC7B,gBAAgB,CAACS,OAAO,CAAC,CAAA;IAC/Cd,aAAa,CAACmC,iBAAiB,IAC7B/D,gBAAgB,CAACiC,gBAAgB,CAACS,OAAO,CAAC,CAAA;AAC9C,GAAC,EAAE,CAACtB,OAAO,CAAC,CAAC,CAAA;EAEb,oBACErD,eAAA,CAAAiG,mBAAA,EAAA;IAAA/F,QAAA,EAAA,cACEC,cAAA,CAAA,KAAA,EAAA+F,aAAA,CAAA;AACE,MAAA,SAAA,EAAQ,sBAAsB;AAC9BtF,MAAAA,GAAG,EAAEsD,gBAAiB;AACtBjE,MAAAA,SAAS,EAAES,UAAU,CAACkE,iCAAyB,EAAAuB,eAAA,CAAAA,eAAA,CAAA,EAAA,EAC5ClG,SAAS,EAAGA,SAAS,yBAAA8C,MAAA,CACCU,IAAI,CAAK,EAAA,IAAI,CACrC,CAAE;AACH2C,MAAAA,uBAAuB,EAAE;AACvBC,QAAAA,MAAM,EAAE/B,QAAQ,CAACH,WAAW,EAAEmC,wBAAgB,CAAA;AAChD,OAAA;KACIvC,EAAAA,UAAU,CACf,CAAC,EACDrF,mBAAmB,iBAClByB,cAAA,CAAC3B,YAAY,EAAA;AAAOE,MAAAA,mBAAmB,EAAnBA,mBAAmB;AAAEC,MAAAA,sBAAsB,EAAtBA,sBAAAA;AAAsB,KAAK,CACrE,CAAA;AAAA,GACD,CAAC,CAAA;AAEP,CAAC,CAAA;AAED,YAAe4H,aAAAA,UAAI,CAACpD,aAAa,CAAC;;;;"}
1
+ {"version":3,"file":"EditorContent.cjs.js","sources":["../../src/components/EditorContent/ImagePreview.jsx","../../src/components/EditorContent/utils/headers.js","../../src/components/EditorContent/index.jsx"],"sourcesContent":["import { useEffect, useRef, useState } from \"react\";\n\nimport classnames from \"classnames\";\nimport { useOnClickOutside } from \"neetocommons/react-utils\";\nimport { Close } from \"neetoicons\";\nimport { Button, Spinner } from \"neetoui\";\nimport { createPortal } from \"react-dom\";\nimport { useTranslation } from \"react-i18next\";\n\nconst ImagePreview = ({ imagePreviewDetails, setImagePreviewDetails }) => {\n const [isLoading, setIsLoading] = useState(true);\n\n const { t } = useTranslation();\n\n const imagePreviewRef = useRef(null);\n\n useOnClickOutside(imagePreviewRef, () => setImagePreviewDetails(null), {\n enabled: true,\n });\n\n useEffect(() => {\n document.addEventListener(\n \"keydown\",\n e => e.key === \"Escape\" && setImagePreviewDetails(null)\n );\n\n return () =>\n document.removeEventListener(\n \"keydown\",\n e => e.key === \"Escape\" && setImagePreviewDetails(null)\n );\n }, []);\n\n return createPortal(\n <div className=\"ne-image-preview-wrapper active\">\n {isLoading && <Spinner className=\"ne-image-preview-wrapper__spinner\" />}\n {!isLoading && (\n <div className=\"close-button\">\n <Button\n icon={Close}\n style=\"secondary\"\n onClick={() => setImagePreviewDetails(null)}\n />\n </div>\n )}\n <div\n className={classnames(\"ne-image-preview\", {\n \"image-loaded\": !isLoading,\n })}\n >\n <img\n alt={t(\"neetoEditor.editorContent.imagePreviewAltText\")}\n ref={imagePreviewRef}\n src={imagePreviewDetails.src}\n onLoad={() => setIsLoading(false)}\n />\n {imagePreviewDetails && (\n <p className=\"ne-image-preview__caption\">\n {imagePreviewDetails.caption}\n </p>\n )}\n </div>\n </div>,\n document.body\n );\n};\n\nexport default ImagePreview;\n","const buildLinkSVG = () => {\n const svgNS = \"http://www.w3.org/2000/svg\";\n\n const svgWrapper = document.createElement(\"span\");\n svgWrapper.classList.add(\"header-link-icon-wrapper\");\n const svg = document.createElementNS(svgNS, \"svg\");\n svg.setAttribute(\"aria-hidden\", \"true\");\n svg.setAttribute(\"height\", \"20\");\n svg.setAttribute(\"viewBox\", \"0 0 16 16\");\n svg.setAttribute(\"width\", \"20\");\n\n const path = document.createElementNS(svgNS, \"path\");\n path.setAttribute(\n \"d\",\n \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n );\n\n svg.appendChild(path);\n svgWrapper.appendChild(svg);\n\n return svgWrapper;\n};\n\nconst convertTextToId = text =>\n text\n .trim()\n .toLowerCase()\n .replace(/[^a-z0-9\\s]/g, \"\")\n .replace(/\\s+/g, \"-\");\n\nexport const buildHeaderLinks = editorContentNode => {\n const headerTags = editorContentNode.querySelectorAll(\n \"h1, h2, h3, h4, h5, h6\"\n );\n const usedIds = new Map();\n\n headerTags.forEach(heading => {\n let headingId = convertTextToId(heading.textContent);\n if (usedIds.has(headingId)) {\n const count = usedIds.get(headingId);\n usedIds.set(headingId, count + 1);\n headingId = `${headingId}-${count}`;\n } else usedIds.set(headingId, 1);\n\n heading.setAttribute(\"id\", headingId);\n\n const anchor = document.createElement(\"a\");\n anchor.setAttribute(\"href\", `#${headingId}`);\n anchor.classList.add(\"header-wrapper-link\");\n anchor.appendChild(buildLinkSVG());\n anchor.appendChild(heading.cloneNode(true));\n\n heading.replaceWith(anchor);\n });\n};\n","import { memo, useEffect, useRef, useState } from \"react\";\n\nimport classnames from \"classnames\";\nimport DOMPurify from \"dompurify\";\nimport CopyToClipboardButton from \"neetomolecules/CopyToClipboardButton\";\nimport { isNil } from \"ramda\";\nimport { createRoot } from \"react-dom/client\";\n\nimport { EDITOR_SIZES } from \"src/common/constants\";\nimport \"src/styles/editor/editor-content.scss\";\n\nimport {\n EDITOR_CONTENT_CLASS_NAME,\n EDITOR_CONTENT_DEFAULT_CONFIGURATION,\n SANITIZE_OPTIONS,\n} from \"./constants\";\nimport ImagePreview from \"./ImagePreview\";\nimport {\n substituteVariables,\n applyLineHighlighting,\n applySyntaxHighlightingAndLineNumbers,\n} from \"./utils\";\nimport { buildHeaderLinks } from \"./utils/headers\";\n\nconst EditorContent = ({\n content = \"\",\n variables = [],\n className,\n size = EDITOR_SIZES.SMALL,\n configuration = EDITOR_CONTENT_DEFAULT_CONFIGURATION,\n ...otherProps\n}) => {\n const [imagePreviewDetails, setImagePreviewDetails] = useState(null);\n const editorContentRef = useRef(null);\n\n const htmlContent = substituteVariables(\n applySyntaxHighlightingAndLineNumbers(content),\n variables\n );\n const sanitize = DOMPurify.sanitize;\n\n const injectCopyButtonToCodeBlocks = () => {\n const preTags = editorContentRef.current?.querySelectorAll(\n `.${EDITOR_CONTENT_CLASS_NAME} pre`\n );\n\n preTags.forEach(preTag => {\n const button = document.createElement(\"div\");\n button.className = \"neeto-editor-codeblock-options\";\n const root = createRoot(button);\n root.render(\n <CopyToClipboardButton\n size=\"small\"\n style=\"tertiary\"\n value={preTag.textContent}\n />\n );\n preTag.appendChild(button);\n });\n };\n\n const bindImageClickListener = () => {\n const figureTags = editorContentRef.current?.querySelectorAll(\n `.${EDITOR_CONTENT_CLASS_NAME} figure`\n );\n\n figureTags.forEach(figureTag => {\n const image = figureTag.querySelector(\"img\");\n const link = figureTag.querySelector(\"a\");\n if (isNil(image) || isNil(link)) return;\n\n figureTag.addEventListener(\"click\", event => {\n event.preventDefault();\n const caption = figureTag.querySelector(\"figcaption\").innerText;\n setImagePreviewDetails({ src: image.src, caption });\n });\n });\n };\n\n useEffect(() => {\n injectCopyButtonToCodeBlocks();\n bindImageClickListener();\n applyLineHighlighting(editorContentRef.current);\n configuration.enableHeaderLinks &&\n buildHeaderLinks(editorContentRef.current);\n }, [content]);\n\n return (\n <>\n <div\n data-cy=\"neeto-editor-content\"\n ref={editorContentRef}\n className={classnames(EDITOR_CONTENT_CLASS_NAME, {\n [className]: className,\n [`neeto-editor-size--${size}`]: true,\n })}\n dangerouslySetInnerHTML={{\n __html: sanitize(htmlContent, SANITIZE_OPTIONS),\n }}\n {...otherProps}\n />\n {imagePreviewDetails && (\n <ImagePreview {...{ imagePreviewDetails, setImagePreviewDetails }} />\n )}\n </>\n );\n};\n\nexport default memo(EditorContent);\n"],"names":["ImagePreview","_ref","imagePreviewDetails","setImagePreviewDetails","_useState","useState","_useState2","_slicedToArray","isLoading","setIsLoading","_useTranslation","useTranslation","t","imagePreviewRef","useRef","useOnClickOutside","enabled","useEffect","document","addEventListener","e","key","removeEventListener","createPortal","_jsxs","className","children","_jsx","Spinner","Button","icon","Close","style","onClick","classnames","alt","ref","src","onLoad","caption","body","buildLinkSVG","svgNS","svgWrapper","createElement","classList","add","svg","createElementNS","setAttribute","path","appendChild","convertTextToId","text","trim","toLowerCase","replace","buildHeaderLinks","editorContentNode","headerTags","querySelectorAll","usedIds","Map","forEach","heading","headingId","textContent","has","count","get","set","concat","anchor","cloneNode","replaceWith","EditorContent","_ref$content","content","_ref$variables","variables","_ref$size","size","EDITOR_SIZES","SMALL","_ref$configuration","configuration","EDITOR_CONTENT_DEFAULT_CONFIGURATION","otherProps","_objectWithoutProperties","_excluded","editorContentRef","htmlContent","substituteVariables","applySyntaxHighlightingAndLineNumbers","sanitize","DOMPurify","injectCopyButtonToCodeBlocks","_editorContentRef$cur","preTags","current","EDITOR_CONTENT_CLASS_NAME","preTag","button","root","createRoot","render","CopyToClipboardButton","value","bindImageClickListener","_editorContentRef$cur2","figureTags","figureTag","image","querySelector","link","isNil","event","preventDefault","innerText","applyLineHighlighting","enableHeaderLinks","_Fragment","_objectSpread","_defineProperty","dangerouslySetInnerHTML","__html","SANITIZE_OPTIONS","memo"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,IAAMA,YAAY,GAAG,SAAfA,YAAYA,CAAAC,IAAA,EAAwD;AAAA,EAAA,IAAlDC,mBAAmB,GAAAD,IAAA,CAAnBC,mBAAmB;IAAE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BAAmB;AAAEC,MAAAA,sBAAsB,EAAtBA,sBAAAA;AAAsB,KAAK,CACrE,CAAA;AAAA,GACD,CAAC,CAAA;AAEP,CAAC,CAAA;AAED,YAAe4H,aAAAA,UAAI,CAACpD,aAAa,CAAC;;;;"}
@@ -12585,13 +12585,14 @@ var highlightLinesElement = function highlightLinesElement(code, options) {
12585
12585
  }
12586
12586
  highlightLinesCode(code, options);
12587
12587
  };
12588
- var applySyntaxHighlighting = function applySyntaxHighlighting(content) {
12588
+ var applySyntaxHighlightingAndLineNumbers = function applySyntaxHighlightingAndLineNumbers(content) {
12589
12589
  common$1.lowlight.highlightAuto("");
12590
12590
  var highlightedAST = {};
12591
12591
  return content.replace(CODE_BLOCK_REGEX, function (_, language, code) {
12592
- var _match$;
12593
- var regex = /data-highlighted-lines="([^"]*)"/;
12594
- var match = content.match(regex);
12592
+ var _highlightMatch$;
12593
+ var highlightRegex = /data-highlighted-lines="([^"]*)"/;
12594
+ var linenumbersRegex = /data-linenumbers/;
12595
+ var highlightMatch = content.match(highlightRegex);
12595
12596
  if (language && LANGUAGE_LIST.includes(language)) {
12596
12597
  highlightedAST = common$1.lowlight.highlight(language, transformCode(code));
12597
12598
  } else {
@@ -12601,7 +12602,9 @@ var applySyntaxHighlighting = function applySyntaxHighlighting(content) {
12601
12602
  }
12602
12603
  }
12603
12604
  var highlightedNode = highlightedAST.children.map(buildReactElementFromAST);
12604
- return "<pre data-highlighted-lines=".concat((_match$ = match === null || match === void 0 ? void 0 : match[1]) !== null && _match$ !== void 0 ? _match$ : "", "><code>").concat(server.renderToString(highlightedNode), "</code></pre>");
12605
+ var dataHighlight = "data-highlighted-lines=".concat((_highlightMatch$ = highlightMatch === null || highlightMatch === void 0 ? void 0 : highlightMatch[1]) !== null && _highlightMatch$ !== void 0 ? _highlightMatch$ : "");
12606
+ var dataLinenumbers = content.match(linenumbersRegex) ? "data-linenumbers=\"true\"" : "";
12607
+ return "<pre ".concat(dataLinenumbers, " ").concat(dataHighlight, "><code>").concat(server.renderToString(highlightedNode), "</code></pre>");
12605
12608
  });
12606
12609
  };
12607
12610
  var applyLineHighlighting = function applyLineHighlighting(editorContent) {
@@ -12645,6 +12648,6 @@ exports.EDITOR_CONTENT_CLASS_NAME = EDITOR_CONTENT_CLASS_NAME;
12645
12648
  exports.EDITOR_CONTENT_DEFAULT_CONFIGURATION = EDITOR_CONTENT_DEFAULT_CONFIGURATION;
12646
12649
  exports.SANITIZE_OPTIONS = SANITIZE_OPTIONS;
12647
12650
  exports.applyLineHighlighting = applyLineHighlighting;
12648
- exports.applySyntaxHighlighting = applySyntaxHighlighting;
12651
+ exports.applySyntaxHighlightingAndLineNumbers = applySyntaxHighlightingAndLineNumbers;
12649
12652
  exports.substituteVariables = substituteVariables;
12650
- //# sourceMappingURL=chunk-Bq2DybYJ.cjs.js.map
12653
+ //# sourceMappingURL=chunk-CcubW4oN.cjs.js.map