@bigbinary/neeto-editor 1.43.16 → 1.43.17

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.
@@ -9,7 +9,7 @@ import { isNil } from 'ramda';
9
9
  import { createRoot } from 'react-dom/client';
10
10
  import { E as EDITOR_SIZES } from './chunk-DpVCSvpe.js';
11
11
  import { n } from './chunk-DmrvuTKK.js';
12
- import { s as substituteVariables, h as highlightCode, a as applyLineHighlighting, E as EDITOR_CONTENT_CLASS_NAME, S as SANITIZE_OPTIONS } from './chunk-CmACYqPa.js';
12
+ import { s as substituteVariables, a as applySyntaxHighlighting, b as applyLineHighlighting, E as EDITOR_CONTENT_CLASS_NAME, S as SANITIZE_OPTIONS, c as EDITOR_CONTENT_DEFAULT_CONFIGURATION } from './chunk-iIt16HM1.js';
13
13
  import { useOnClickOutside } from '@bigbinary/neeto-commons-frontend/react-utils';
14
14
  import Close from '@bigbinary/neeto-icons/Close';
15
15
  import Button from '@bigbinary/neetoui/Button';
@@ -22,7 +22,7 @@ import '@bigbinary/neeto-cist';
22
22
  import 'react-dom/server';
23
23
  import '@babel/runtime/helpers/toConsumableArray';
24
24
 
25
- 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-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-h1-margin:2rem 0 0.25rem;--neeto-editor-content-h2-margin:1.5rem 0 0.25rem;--neeto-editor-content-h3-margin:1rem 0 0.25rem;--neeto-editor-content-h4-margin:0.75rem 0 0.25rem;--neeto-editor-content-h5-margin:0.75rem 0 0.25rem;--neeto-editor-content-h6-margin:0.75rem 0 0.25rem;--neeto-editor-content-heading-font-weight:600;--neeto-editor-content-heading-font-weight-bold:bold;--neeto-editor-content-heading-color:54,55,55,1;--neeto-editor-content-paragraph-font-size:1rem;--neeto-editor-content-paragraph-font-weight:400;--neeto-editor-content-paragraph-color:54,55,55,1;--neeto-editor-content-paragraph-line-height:1.6}@media only screen and (max-width:720px){:root{--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-h4-font-size:1rem}}.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--size-large{--neeto-editor-content-paragraph-font-size:1.125rem}.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:#363737;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:2rem;font-size:var(--neeto-editor-content-h1-font-size);margin:2rem 0 .25rem;margin:var(--neeto-editor-content-h1-margin)}.neeto-editor-content h2{font-size:1.5rem;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:1.25rem;font-size:var(--neeto-editor-content-h3-font-size);margin:1rem 0 .25rem;margin:var(--neeto-editor-content-h3-margin)}.neeto-editor-content h4{font-size:1rem;font-size:var(--neeto-editor-content-h4-font-size);margin:.75rem 0 .25rem;margin:var(--neeto-editor-content-h4-margin)}.neeto-editor-content h5{font-size:.875rem;font-size:var(--neeto-editor-content-h5-font-size);margin:.75rem 0 .25rem;margin:var(--neeto-editor-content-h5-margin)}.neeto-editor-content h6{font-size:.75rem;font-size:var(--neeto-editor-content-h6-font-size);margin:.75rem 0 .25rem;margin:var(--neeto-editor-content-h6-margin)}.neeto-editor-content p{color:#363737;color:rgba(var(--neeto-editor-content-paragraph-color));font-size:1rem;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:1rem;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:#f6f7f8;background-color:rgb(var(--neeto-editor-gray-100));border-radius:3px;border-radius:var(--neeto-editor-rounded-sm);font-family:SFMono-Regular,Menlo,Consolas,PT Mono,Liberation Mono,Courier,monospace;font-size:.875rem;padding:.2em .4em}.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:inherit}.neeto-editor-content pre{background-color:#f7f6f3;border-radius:3px;border-radius:var(--neeto-editor-rounded-sm);font-size:.875rem;line-height:1.5;margin-bottom:1rem;margin-top:1rem;overflow-x:auto;padding:32px 12px 12px;position:relative}.neeto-editor-content pre .neeto-editor-codeblock-options{align-items:center;display:flex;gap:4px;position:absolute;right:4px;top:4px}.neeto-editor-content pre .neeto-editor-codeblock-options__menu{display:flex;flex-direction:column;gap:4px}.neeto-editor-content pre .neeto-editor-codeblock-options__input{margin:4px}.neeto-editor-content pre .highlight-line{position:relative}.neeto-editor-content pre .highlight-line:before{left:-12px}.neeto-editor-content pre .highlight-line:after{right:-12px}.neeto-editor-content pre .highlight-line:after,.neeto-editor-content pre .highlight-line:before{background-color:inherit;content:\"\";height:25px;position:absolute;top:0;width:12px}.neeto-editor-content pre>code{background-color:transparent;border-radius:0;border-width:0;color:inherit;font-family:inherit;font-size:inherit;font-weight:400;line-height:inherit;padding:0;white-space:pre-wrap}.neeto-editor-content blockquote{border-left-color:#e5e7eb;border-left-width:4px;color:#0c111d;color:rgb(var(--neeto-editor-black));font-weight:500;font-weight:var(--neeto-editor-font-medium);margin:8px 0;padding-left:12px;quotes:\"“\" \"”\" \"‘\" \"’\"}.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;padding-left:28px}.neeto-editor-content ol li,.neeto-editor-content ul li{margin-bottom:.5rem;margin-top:.5rem}.neeto-editor-content ol li:before,.neeto-editor-content ul li:before{background-color:#0c111d;background-color:rgb(var(--neeto-editor-black))}.neeto-editor-content a[href]{color:#095aba;color:rgb(var(--neeto-editor-accent-800));font-weight:500}.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}.neeto-editor-content .neeto-editor__video-wrapper .neeto-editor__video-iframe iframe{height:100%;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{display:inline-block;max-width:100%;overflow:hidden;position:relative}.neeto-editor__image-wrapper .neeto-editor__image{display:inline-block;min-height:52px}.neeto-editor__image-wrapper .neeto-editor__image img,.neeto-editor__image-wrapper .neeto-editor__image video{display:inline-block;height:auto;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{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;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:flex;height:100%;justify-content:center;left:0;position:fixed;top:0;width:100%;z-index:999999}.ne-image-preview-wrapper .ne-image-preview{background:#fff;background:rgb(var(--neeto-editor-white));display:flex;flex-direction:column;gap:10px;max-width:60vw;opacity:0;transition:opacity .1s ease-in-out}.ne-image-preview-wrapper .ne-image-preview.image-loaded{border-radius:10px;opacity:1;padding:10px}.ne-image-preview-wrapper .ne-image-preview__caption{color:#101828;color:rgb(var(--neeto-editor-gray-800));line-height:1.5}.ne-image-preview-wrapper .close-button{position:absolute;right:5px;top:5px}.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))}";
25
+ 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-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-h1-margin:2rem 0 0.25rem;--neeto-editor-content-h2-margin:1.5rem 0 0.25rem;--neeto-editor-content-h3-margin:1rem 0 0.25rem;--neeto-editor-content-h4-margin:0.75rem 0 0.25rem;--neeto-editor-content-h5-margin:0.75rem 0 0.25rem;--neeto-editor-content-h6-margin:0.75rem 0 0.25rem;--neeto-editor-content-heading-font-weight:600;--neeto-editor-content-heading-font-weight-bold:bold;--neeto-editor-content-heading-color:54,55,55,1;--neeto-editor-content-paragraph-font-size:1rem;--neeto-editor-content-paragraph-font-weight:400;--neeto-editor-content-paragraph-color:54,55,55,1;--neeto-editor-content-paragraph-line-height:1.6}@media only screen and (max-width:720px){:root{--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-h4-font-size:1rem}}.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--size-large{--neeto-editor-content-paragraph-font-size:1.125rem}.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:#363737;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:2rem;font-size:var(--neeto-editor-content-h1-font-size);margin:2rem 0 .25rem;margin:var(--neeto-editor-content-h1-margin)}.neeto-editor-content h2{font-size:1.5rem;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:1.25rem;font-size:var(--neeto-editor-content-h3-font-size);margin:1rem 0 .25rem;margin:var(--neeto-editor-content-h3-margin)}.neeto-editor-content h4{font-size:1rem;font-size:var(--neeto-editor-content-h4-font-size);margin:.75rem 0 .25rem;margin:var(--neeto-editor-content-h4-margin)}.neeto-editor-content h5{font-size:.875rem;font-size:var(--neeto-editor-content-h5-font-size);margin:.75rem 0 .25rem;margin:var(--neeto-editor-content-h5-margin)}.neeto-editor-content h6{font-size:.75rem;font-size:var(--neeto-editor-content-h6-font-size);margin:.75rem 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:-25px;opacity:0;position:absolute;transition:opacity .15s ease-in;width:25px}.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:1rem;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:1rem;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:#f6f7f8;background-color:rgb(var(--neeto-editor-gray-100));border-radius:3px;border-radius:var(--neeto-editor-rounded-sm);font-family:SFMono-Regular,Menlo,Consolas,PT Mono,Liberation Mono,Courier,monospace;font-size:.875rem;padding:.2em .4em}.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:inherit}.neeto-editor-content pre{background-color:#f7f6f3;border-radius:3px;border-radius:var(--neeto-editor-rounded-sm);font-size:.875rem;line-height:1.5;margin-bottom:1rem;margin-top:1rem;overflow-x:auto;padding:32px 12px 12px;position:relative}.neeto-editor-content pre .neeto-editor-codeblock-options{align-items:center;display:flex;gap:4px;position:absolute;right:4px;top:4px}.neeto-editor-content pre .neeto-editor-codeblock-options__menu{display:flex;flex-direction:column;gap:4px}.neeto-editor-content pre .neeto-editor-codeblock-options__input{margin:4px}.neeto-editor-content pre .highlight-line{position:relative}.neeto-editor-content pre .highlight-line:before{left:-12px}.neeto-editor-content pre .highlight-line:after{right:-12px}.neeto-editor-content pre .highlight-line:after,.neeto-editor-content pre .highlight-line:before{background-color:inherit;content:\"\";height:25px;position:absolute;top:0;width:12px}.neeto-editor-content pre>code{background-color:transparent;border-radius:0;border-width:0;color:inherit;font-family:inherit;font-size:inherit;font-weight:400;line-height:inherit;padding:0;white-space:pre-wrap}.neeto-editor-content blockquote{border-left-color:#e5e7eb;border-left-width:4px;color:#0c111d;color:rgb(var(--neeto-editor-black));font-weight:500;font-weight:var(--neeto-editor-font-medium);margin:8px 0;padding-left:12px;quotes:\"“\" \"”\" \"‘\" \"’\"}.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;padding-left:28px}.neeto-editor-content ol li,.neeto-editor-content ul li{margin-bottom:.5rem;margin-top:.5rem}.neeto-editor-content ol li:before,.neeto-editor-content ul li:before{background-color:#0c111d;background-color:rgb(var(--neeto-editor-black))}.neeto-editor-content a[href]{color:#095aba;color:rgb(var(--neeto-editor-accent-800));font-weight:500}.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}.neeto-editor-content .neeto-editor__video-wrapper .neeto-editor__video-iframe iframe{height:100%;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{display:inline-block;max-width:100%;overflow:hidden;position:relative}.neeto-editor__image-wrapper .neeto-editor__image{display:inline-block;min-height:52px}.neeto-editor__image-wrapper .neeto-editor__image img,.neeto-editor__image-wrapper .neeto-editor__image video{display:inline-block;height:auto;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{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;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:flex;height:100%;justify-content:center;left:0;position:fixed;top:0;width:100%;z-index:999999}.ne-image-preview-wrapper .ne-image-preview{background:#fff;background:rgb(var(--neeto-editor-white));display:flex;flex-direction:column;gap:10px;max-width:60vw;opacity:0;transition:opacity .1s ease-in-out}.ne-image-preview-wrapper .ne-image-preview.image-loaded{border-radius:10px;opacity:1;padding:10px}.ne-image-preview-wrapper .ne-image-preview__caption{color:#101828;color:rgb(var(--neeto-editor-gray-800));line-height:1.5}.ne-image-preview-wrapper .close-button{position:absolute;right:5px;top:5px}.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))}";
26
26
  n(css,{});
27
27
 
28
28
  var ImagePreview = function ImagePreview(_ref) {
@@ -82,7 +82,39 @@ var ImagePreview = function ImagePreview(_ref) {
82
82
  }), document.body);
83
83
  };
84
84
 
85
- var _excluded = ["content", "variables", "className", "size"];
85
+ var buildLinkSVG = function buildLinkSVG() {
86
+ var svgNS = "http://www.w3.org/2000/svg";
87
+ var svgWrapper = document.createElement("span");
88
+ svgWrapper.classList.add("header-link-icon-wrapper");
89
+ var svg = document.createElementNS(svgNS, "svg");
90
+ svg.setAttribute("aria-hidden", "true");
91
+ svg.setAttribute("height", "20");
92
+ svg.setAttribute("viewBox", "0 0 16 16");
93
+ svg.setAttribute("width", "20");
94
+ var path = document.createElementNS(svgNS, "path");
95
+ path.setAttribute("d", "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");
96
+ svg.appendChild(path);
97
+ svgWrapper.appendChild(svg);
98
+ return svgWrapper;
99
+ };
100
+ var convertTextToId = function convertTextToId(text) {
101
+ return text.trim().toLowerCase().replace(/[^a-z0-9\s]/g, "").replace(/\s+/g, "-");
102
+ };
103
+ var makeHeadingsNavigable = function makeHeadingsNavigable(editorContentNode) {
104
+ var headerTags = editorContentNode.querySelectorAll("h1, h2, h3, h4, h5, h6");
105
+ headerTags.forEach(function (heading) {
106
+ var headingId = convertTextToId(heading.textContent);
107
+ heading.setAttribute("id", headingId);
108
+ var anchor = document.createElement("a");
109
+ anchor.setAttribute("href", "#".concat(headingId));
110
+ anchor.classList.add("header-wrapper-link");
111
+ anchor.appendChild(buildLinkSVG());
112
+ anchor.appendChild(heading.cloneNode(true));
113
+ heading.replaceWith(anchor);
114
+ });
115
+ };
116
+
117
+ var _excluded = ["content", "variables", "className", "size", "configuration"];
86
118
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
87
119
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
88
120
  var EditorContent = function EditorContent(_ref) {
@@ -93,13 +125,15 @@ var EditorContent = function EditorContent(_ref) {
93
125
  className = _ref.className,
94
126
  _ref$size = _ref.size,
95
127
  size = _ref$size === void 0 ? EDITOR_SIZES.MEDIUM : _ref$size,
128
+ _ref$configuration = _ref.configuration,
129
+ configuration = _ref$configuration === void 0 ? EDITOR_CONTENT_DEFAULT_CONFIGURATION : _ref$configuration,
96
130
  otherProps = _objectWithoutProperties(_ref, _excluded);
97
131
  var _useState = useState(null),
98
132
  _useState2 = _slicedToArray(_useState, 2),
99
133
  imagePreviewDetails = _useState2[0],
100
134
  setImagePreviewDetails = _useState2[1];
101
135
  var editorContentRef = useRef(null);
102
- var htmlContent = substituteVariables(highlightCode(content), variables);
136
+ var htmlContent = substituteVariables(applySyntaxHighlighting(content), variables);
103
137
  var sanitize = DOMPurify.sanitize;
104
138
  var injectCopyButtonToCodeBlocks = function injectCopyButtonToCodeBlocks() {
105
139
  var _editorContentRef$cur;
@@ -137,6 +171,7 @@ var EditorContent = function EditorContent(_ref) {
137
171
  injectCopyButtonToCodeBlocks();
138
172
  bindImageClickListener();
139
173
  applyLineHighlighting(editorContentRef.current);
174
+ configuration.navigableHeader && makeHeadingsNavigable(editorContentRef.current);
140
175
  }, [content]);
141
176
  return /*#__PURE__*/jsxs(Fragment, {
142
177
  children: [/*#__PURE__*/jsx("div", _objectSpread({
@@ -1 +1 @@
1
- {"version":3,"file":"EditorContent.js","sources":["../src/components/EditorContent/ImagePreview.jsx","../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\">\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","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 { EDITOR_CONTENT_CLASS_NAME, SANITIZE_OPTIONS } from \"./constants\";\nimport ImagePreview from \"./ImagePreview\";\nimport {\n highlightCode,\n substituteVariables,\n applyLineHighlighting,\n} from \"./utils\";\n\nconst EditorContent = ({\n content = \"\",\n variables = [],\n className,\n size = EDITOR_SIZES.MEDIUM,\n ...otherProps\n}) => {\n const [imagePreviewDetails, setImagePreviewDetails] = useState(null);\n const editorContentRef = useRef(null);\n\n const htmlContent = substituteVariables(highlightCode(content), variables);\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=\"text\"\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 }, [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 [`${EDITOR_CONTENT_CLASS_NAME}--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","EditorContent","_ref$content","content","_ref$variables","variables","_ref$size","size","EDITOR_SIZES","MEDIUM","otherProps","_objectWithoutProperties","_excluded","editorContentRef","htmlContent","substituteVariables","highlightCode","sanitize","DOMPurify","injectCopyButtonToCodeBlocks","_editorContentRef$cur","preTags","current","querySelectorAll","concat","EDITOR_CONTENT_CLASS_NAME","forEach","preTag","button","createElement","root","createRoot","render","CopyToClipboardButton","value","textContent","appendChild","bindImageClickListener","_editorContentRef$cur2","figureTags","figureTag","image","querySelector","link","isNil","event","preventDefault","innerText","applyLineHighlighting","_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,QAAQ,CAAC,IAAI,CAAC;IAAAC,UAAA,GAAAC,cAAA,CAAAH,SAAA,EAAA,CAA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AA;AAAQ,SAAC,CAAC,CAAA;AACrD,OAAC,CAAC,CAAA;AACJ,KAAC,CAAC,CAAA;GACH,CAAA;AAEDtB,EAAAA,SAAS,CAAC,YAAM;AACd0C,IAAAA,4BAA4B,EAAE,CAAA;AAC9BkB,IAAAA,sBAAsB,EAAE,CAAA;AACxBW,IAAAA,qBAAqB,CAACnC,gBAAgB,CAACS,OAAO,CAAC,CAAA;AACjD,GAAC,EAAE,CAACnB,OAAO,CAAC,CAAC,CAAA;EAEb,oBACEnB,IAAA,CAAAiE,QAAA,EAAA;IAAA/D,QAAA,EAAA,cACEC,GAAA,CAAA,KAAA,EAAA+D,aAAA,CAAA;AACE,MAAA,SAAA,EAAQ,sBAAsB;AAC9BtD,MAAAA,GAAG,EAAEiB,gBAAiB;MACtB5B,SAAS,EAAES,UAAU,CAAC+B,yBAAyB,EAAA0B,eAAA,CAAAA,eAAA,CAAA,EAAA,EAC5ClE,SAAS,EAAGA,SAAS,CAAAuC,EAAAA,EAAAA,CAAAA,MAAA,CAClBC,yBAAyB,EAAAD,SAAAA,CAAAA,CAAAA,MAAA,CAAUjB,IAAI,CAAA,EAAK,IAAI,CACrD,CAAE;AACH6C,MAAAA,uBAAuB,EAAE;AACvBC,QAAAA,MAAM,EAAEpC,QAAQ,CAACH,WAAW,EAAEwC,gBAAgB,CAAA;AAChD,OAAA;KACI5C,EAAAA,UAAU,CACf,CAAC,EACDhD,mBAAmB,iBAClByB,GAAA,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,YAAe4F,aAAAA,IAAI,CAACtD,aAAa,CAAC;;;;"}
1
+ {"version":3,"file":"EditorContent.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\">\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 makeHeadingsNavigable = editorContentNode => {\n const headerTags = editorContentNode.querySelectorAll(\n \"h1, h2, h3, h4, h5, h6\"\n );\n\n headerTags.forEach(heading => {\n const headingId = convertTextToId(heading.textContent);\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 { makeHeadingsNavigable } from \"./utils/headers\";\n\nconst EditorContent = ({\n content = \"\",\n variables = [],\n className,\n size = EDITOR_SIZES.MEDIUM,\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=\"text\"\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.navigableHeader &&\n makeHeadingsNavigable(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 [`${EDITOR_CONTENT_CLASS_NAME}--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","makeHeadingsNavigable","editorContentNode","headerTags","querySelectorAll","forEach","heading","headingId","textContent","anchor","concat","cloneNode","replaceWith","EditorContent","_ref$content","content","_ref$variables","variables","_ref$size","size","EDITOR_SIZES","MEDIUM","_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","navigableHeader","_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,QAA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mC,eAAe,IAC3BzD,qBAAqB,CAAC2B,gBAAgB,CAACS,OAAO,CAAC,CAAA;AACnD,GAAC,EAAE,CAACtB,OAAO,CAAC,CAAC,CAAA;EAEb,oBACE/C,IAAA,CAAA2F,QAAA,EAAA;IAAAzF,QAAA,EAAA,cACEC,GAAA,CAAA,KAAA,EAAAyF,aAAA,CAAA;AACE,MAAA,SAAA,EAAQ,sBAAsB;AAC9BhF,MAAAA,GAAG,EAAEgD,gBAAiB;MACtB3D,SAAS,EAAES,UAAU,CAAC4D,yBAAyB,EAAAuB,eAAA,CAAAA,eAAA,CAAA,EAAA,EAC5C5F,SAAS,EAAGA,SAAS,CAAAyC,EAAAA,EAAAA,CAAAA,MAAA,CAClB4B,yBAAyB,EAAA5B,SAAAA,CAAAA,CAAAA,MAAA,CAAUS,IAAI,CAAA,EAAK,IAAI,CACrD,CAAE;AACH2C,MAAAA,uBAAuB,EAAE;AACvBC,QAAAA,MAAM,EAAE/B,QAAQ,CAACH,WAAW,EAAEmC,gBAAgB,CAAA;AAChD,OAAA;KACIvC,EAAAA,UAAU,CACf,CAAC,EACD/E,mBAAmB,iBAClByB,GAAA,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,YAAesH,aAAAA,IAAI,CAACpD,aAAa,CAAC;;;;"}
@@ -12519,6 +12519,9 @@ var SANITIZE_OPTIONS = {
12519
12519
  var CODE_BLOCK_REGEX = /<pre(?:\s+[^>]+)?><code(?:\s+class="language-([^"]*)")?>([\S\s]*?)<\/code><\/pre>/gim;
12520
12520
  var VARIABLE_SPAN_REGEX = /<span data-variable="" [^>]*data-label="([^"]+)">{{([^}]+)}}<\/span>/g;
12521
12521
  var LANGUAGE_LIST = [].concat(_toConsumableArray(lowlight.listLanguages()), ["html"]);
12522
+ var EDITOR_CONTENT_DEFAULT_CONFIGURATION = {
12523
+ navigableHeader: false
12524
+ };
12522
12525
 
12523
12526
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike) { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
12524
12527
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
@@ -12578,7 +12581,7 @@ var highlightLinesElement = function highlightLinesElement(code, options) {
12578
12581
  }
12579
12582
  highlightLinesCode(code, options);
12580
12583
  };
12581
- var highlightCode = function highlightCode(content) {
12584
+ var applySyntaxHighlighting = function applySyntaxHighlighting(content) {
12582
12585
  lowlight.highlightAuto("");
12583
12586
  var highlightedAST = {};
12584
12587
  return content.replace(CODE_BLOCK_REGEX, function (_, language, code) {
@@ -12603,7 +12606,7 @@ var applyLineHighlighting = function applyLineHighlighting(editorContent) {
12603
12606
  var highlightedLines = codeTag.closest("pre").getAttribute("data-highlighted-lines");
12604
12607
  if (highlightedLines) {
12605
12608
  var _highlightedLines$spl;
12606
- var linesToHighlight = (_highlightedLines$spl = highlightedLines.split(",")) === null || _highlightedLines$spl === void 0 ? void 0 : _highlightedLines$spl.map(Number);
12609
+ var linesToHighlight = (_highlightedLines$spl = highlightedLines.split(",")) === null || _highlightedLines$spl === void 0 ? void 0 : _highlightedLines$spl.filter(Boolean).map(Number);
12607
12610
  var highlightLinesOptions = linesToHighlight.map(function (line) {
12608
12611
  return {
12609
12612
  start: line,
@@ -12634,5 +12637,5 @@ var substituteVariables = function substituteVariables(highlightedContent, varia
12634
12637
  });
12635
12638
  };
12636
12639
 
12637
- export { EDITOR_CONTENT_CLASS_NAME as E, SANITIZE_OPTIONS as S, applyLineHighlighting as a, highlightCode as h, substituteVariables as s };
12638
- //# sourceMappingURL=chunk-CmACYqPa.js.map
12640
+ export { EDITOR_CONTENT_CLASS_NAME as E, SANITIZE_OPTIONS as S, applySyntaxHighlighting as a, applyLineHighlighting as b, EDITOR_CONTENT_DEFAULT_CONFIGURATION as c, substituteVariables as s };
12641
+ //# sourceMappingURL=chunk-iIt16HM1.js.map