@bigbinary/neeto-editor 1.43.16 → 1.43.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/dist/Attachments.js +1 -1
  2. package/dist/Editor.js +3 -3
  3. package/dist/Editor.js.map +1 -1
  4. package/dist/EditorContent.js +39 -4
  5. package/dist/EditorContent.js.map +1 -1
  6. package/dist/FormikEditor.js +1 -1
  7. package/dist/{chunk-CBTV1FAG.js → chunk-Cgqbplpd.js} +16 -50
  8. package/dist/chunk-Cgqbplpd.js.map +1 -0
  9. package/dist/{chunk-DM4b9jQa.js → chunk-DhfTt4iI.js} +2 -2
  10. package/dist/{chunk-DM4b9jQa.js.map → chunk-DhfTt4iI.js.map} +1 -1
  11. package/dist/{chunk-CmACYqPa.js → chunk-iIt16HM1.js} +7 -4
  12. package/dist/chunk-iIt16HM1.js.map +1 -0
  13. package/dist/cjs/Attachments.cjs.js +1 -1
  14. package/dist/cjs/Editor.cjs.js +3 -3
  15. package/dist/cjs/Editor.cjs.js.map +1 -1
  16. package/dist/cjs/EditorContent.cjs.js +44 -9
  17. package/dist/cjs/EditorContent.cjs.js.map +1 -1
  18. package/dist/cjs/FormikEditor.cjs.js +1 -1
  19. package/dist/cjs/{chunk-Dy-jMvft.cjs.js → chunk-BleZrnmm.cjs.js} +8 -4
  20. package/dist/cjs/chunk-BleZrnmm.cjs.js.map +1 -0
  21. package/dist/cjs/{chunk-BHAmnpMT.cjs.js → chunk-CL7Cm_kh.cjs.js} +16 -50
  22. package/dist/cjs/chunk-CL7Cm_kh.cjs.js.map +1 -0
  23. package/dist/cjs/{chunk-DerluPOE.cjs.js → chunk-DSLOSnI8.cjs.js} +2 -2
  24. package/dist/cjs/{chunk-DerluPOE.cjs.js.map → chunk-DSLOSnI8.cjs.js.map} +1 -1
  25. package/dist/cjs/index.cjs.js +8 -8
  26. package/dist/cjs/utils.cjs.js +2 -2
  27. package/dist/editor-content.min.css +1 -1
  28. package/dist/editor-output-pdf-email.css +1 -1
  29. package/dist/editor-output.js +1 -1
  30. package/dist/editor-stats.html +1 -1
  31. package/dist/index.js +3 -3
  32. package/dist/navigableHeadings.js +39 -0
  33. package/dist/navigableHeadings.js.map +1 -0
  34. package/dist/utils.js +1 -1
  35. package/package.json +1 -1
  36. package/types.d.ts +5 -0
  37. package/dist/chunk-CBTV1FAG.js.map +0 -1
  38. package/dist/chunk-CmACYqPa.js.map +0 -1
  39. package/dist/cjs/chunk-BHAmnpMT.cjs.js.map +0 -1
  40. package/dist/cjs/chunk-Dy-jMvft.cjs.js.map +0 -1
@@ -11,7 +11,7 @@ var ramda = require('ramda');
11
11
  var client = require('react-dom/client');
12
12
  var _commonjsHelpers = require('./chunk-CxLkn3xO.cjs.js');
13
13
  var injectCss = require('./chunk-vQvjPR2x.cjs.js');
14
- var utils = require('./chunk-Dy-jMvft.cjs.js');
14
+ var index$1 = require('./chunk-BleZrnmm.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-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))}";
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-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))}";
28
28
  injectCss.n(css,{});
29
29
 
30
30
  var ImagePreview = function ImagePreview(_ref) {
@@ -84,7 +84,39 @@ var ImagePreview = function ImagePreview(_ref) {
84
84
  }), document.body);
85
85
  };
86
86
 
87
- var _excluded = ["content", "variables", "className", "size"];
87
+ var buildLinkSVG = function buildLinkSVG() {
88
+ var svgNS = "http://www.w3.org/2000/svg";
89
+ var svgWrapper = document.createElement("span");
90
+ svgWrapper.classList.add("header-link-icon-wrapper");
91
+ var svg = document.createElementNS(svgNS, "svg");
92
+ svg.setAttribute("aria-hidden", "true");
93
+ svg.setAttribute("height", "20");
94
+ svg.setAttribute("viewBox", "0 0 16 16");
95
+ svg.setAttribute("width", "20");
96
+ var path = document.createElementNS(svgNS, "path");
97
+ 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");
98
+ svg.appendChild(path);
99
+ svgWrapper.appendChild(svg);
100
+ return svgWrapper;
101
+ };
102
+ var convertTextToId = function convertTextToId(text) {
103
+ return text.trim().toLowerCase().replace(/[^a-z0-9\s]/g, "").replace(/\s+/g, "-");
104
+ };
105
+ var makeHeadingsNavigable = function makeHeadingsNavigable(editorContentNode) {
106
+ var headerTags = editorContentNode.querySelectorAll("h1, h2, h3, h4, h5, h6");
107
+ headerTags.forEach(function (heading) {
108
+ var headingId = convertTextToId(heading.textContent);
109
+ heading.setAttribute("id", headingId);
110
+ var anchor = document.createElement("a");
111
+ anchor.setAttribute("href", "#".concat(headingId));
112
+ anchor.classList.add("header-wrapper-link");
113
+ anchor.appendChild(buildLinkSVG());
114
+ anchor.appendChild(heading.cloneNode(true));
115
+ heading.replaceWith(anchor);
116
+ });
117
+ };
118
+
119
+ var _excluded = ["content", "variables", "className", "size", "configuration"];
88
120
  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; }
89
121
  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; }
90
122
  var EditorContent = function EditorContent(_ref) {
@@ -95,17 +127,19 @@ var EditorContent = function EditorContent(_ref) {
95
127
  className = _ref.className,
96
128
  _ref$size = _ref.size,
97
129
  size = _ref$size === void 0 ? _commonjsHelpers.EDITOR_SIZES.MEDIUM : _ref$size,
130
+ _ref$configuration = _ref.configuration,
131
+ configuration = _ref$configuration === void 0 ? index$1.EDITOR_CONTENT_DEFAULT_CONFIGURATION : _ref$configuration,
98
132
  otherProps = _objectWithoutProperties(_ref, _excluded);
99
133
  var _useState = React.useState(null),
100
134
  _useState2 = _slicedToArray(_useState, 2),
101
135
  imagePreviewDetails = _useState2[0],
102
136
  setImagePreviewDetails = _useState2[1];
103
137
  var editorContentRef = React.useRef(null);
104
- var htmlContent = utils.substituteVariables(utils.highlightCode(content), variables);
138
+ var htmlContent = index$1.substituteVariables(index$1.applySyntaxHighlighting(content), variables);
105
139
  var sanitize = DOMPurify.sanitize;
106
140
  var injectCopyButtonToCodeBlocks = function injectCopyButtonToCodeBlocks() {
107
141
  var _editorContentRef$cur;
108
- var preTags = (_editorContentRef$cur = editorContentRef.current) === null || _editorContentRef$cur === void 0 ? void 0 : _editorContentRef$cur.querySelectorAll(".".concat(utils.EDITOR_CONTENT_CLASS_NAME, " pre"));
142
+ var preTags = (_editorContentRef$cur = editorContentRef.current) === null || _editorContentRef$cur === void 0 ? void 0 : _editorContentRef$cur.querySelectorAll(".".concat(index$1.EDITOR_CONTENT_CLASS_NAME, " pre"));
109
143
  preTags.forEach(function (preTag) {
110
144
  var button = document.createElement("div");
111
145
  button.className = "neeto-editor-codeblock-options";
@@ -120,7 +154,7 @@ var EditorContent = function EditorContent(_ref) {
120
154
  };
121
155
  var bindImageClickListener = function bindImageClickListener() {
122
156
  var _editorContentRef$cur2;
123
- var figureTags = (_editorContentRef$cur2 = editorContentRef.current) === null || _editorContentRef$cur2 === void 0 ? void 0 : _editorContentRef$cur2.querySelectorAll(".".concat(utils.EDITOR_CONTENT_CLASS_NAME, " figure"));
157
+ var figureTags = (_editorContentRef$cur2 = editorContentRef.current) === null || _editorContentRef$cur2 === void 0 ? void 0 : _editorContentRef$cur2.querySelectorAll(".".concat(index$1.EDITOR_CONTENT_CLASS_NAME, " figure"));
124
158
  figureTags.forEach(function (figureTag) {
125
159
  var image = figureTag.querySelector("img");
126
160
  var link = figureTag.querySelector("a");
@@ -138,15 +172,16 @@ var EditorContent = function EditorContent(_ref) {
138
172
  React.useEffect(function () {
139
173
  injectCopyButtonToCodeBlocks();
140
174
  bindImageClickListener();
141
- utils.applyLineHighlighting(editorContentRef.current);
175
+ index$1.applyLineHighlighting(editorContentRef.current);
176
+ configuration.navigableHeader && makeHeadingsNavigable(editorContentRef.current);
142
177
  }, [content]);
143
178
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
144
179
  children: [/*#__PURE__*/jsxRuntime.jsx("div", _objectSpread({
145
180
  "data-cy": "neeto-editor-content",
146
181
  ref: editorContentRef,
147
- className: classnames(utils.EDITOR_CONTENT_CLASS_NAME, _defineProperty(_defineProperty({}, className, className), "".concat(utils.EDITOR_CONTENT_CLASS_NAME, "--size-").concat(size), true)),
182
+ className: classnames(index$1.EDITOR_CONTENT_CLASS_NAME, _defineProperty(_defineProperty({}, className, className), "".concat(index$1.EDITOR_CONTENT_CLASS_NAME, "--size-").concat(size), true)),
148
183
  dangerouslySetInnerHTML: {
149
- __html: sanitize(htmlContent, utils.SANITIZE_OPTIONS)
184
+ __html: sanitize(htmlContent, index$1.SANITIZE_OPTIONS)
150
185
  }
151
186
  }, otherProps)), imagePreviewDetails && /*#__PURE__*/jsxRuntime.jsx(ImagePreview, {
152
187
  imagePreviewDetails: imagePreviewDetails,
@@ -1 +1 @@
1
- {"version":3,"file":"EditorContent.cjs.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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;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AnBA,mBAAmB;AAAEC,MAAAA,sBAAsB,EAAtBA,sBAAAA;AAAsB,KAAK,CACrE,CAAA;AAAA,GACD,CAAC,CAAA;AAEP,CAAC,CAAA;AAED,YAAe4F,aAAAA,UAAI,CAACtD,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\">\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","_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}
@@ -102,7 +102,7 @@ require('@bigbinary/neeto-icons/MergeSplit');
102
102
  require('@bigbinary/neeto-icons/ToggleHeaderRow');
103
103
  require('@bigbinary/neetoui/formik/Form');
104
104
  require('@bigbinary/neetoui/formik/Input');
105
- require('./chunk-BHAmnpMT.cjs.js');
105
+ require('./chunk-CL7Cm_kh.cjs.js');
106
106
  require('@bigbinary/neeto-icons/MenuVertical');
107
107
  require('@bigbinary/neetoui/Alert');
108
108
 
@@ -12521,6 +12521,9 @@ var SANITIZE_OPTIONS = {
12521
12521
  var CODE_BLOCK_REGEX = /<pre(?:\s+[^>]+)?><code(?:\s+class="language-([^"]*)")?>([\S\s]*?)<\/code><\/pre>/gim;
12522
12522
  var VARIABLE_SPAN_REGEX = /<span data-variable="" [^>]*data-label="([^"]+)">{{([^}]+)}}<\/span>/g;
12523
12523
  var LANGUAGE_LIST = [].concat(_toConsumableArray(common$1.lowlight.listLanguages()), ["html"]);
12524
+ var EDITOR_CONTENT_DEFAULT_CONFIGURATION = {
12525
+ navigableHeader: false
12526
+ };
12524
12527
 
12525
12528
  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; } } }; }
12526
12529
  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); }
@@ -12580,7 +12583,7 @@ var highlightLinesElement = function highlightLinesElement(code, options) {
12580
12583
  }
12581
12584
  highlightLinesCode(code, options);
12582
12585
  };
12583
- var highlightCode = function highlightCode(content) {
12586
+ var applySyntaxHighlighting = function applySyntaxHighlighting(content) {
12584
12587
  common$1.lowlight.highlightAuto("");
12585
12588
  var highlightedAST = {};
12586
12589
  return content.replace(CODE_BLOCK_REGEX, function (_, language, code) {
@@ -12605,7 +12608,7 @@ var applyLineHighlighting = function applyLineHighlighting(editorContent) {
12605
12608
  var highlightedLines = codeTag.closest("pre").getAttribute("data-highlighted-lines");
12606
12609
  if (highlightedLines) {
12607
12610
  var _highlightedLines$spl;
12608
- var linesToHighlight = (_highlightedLines$spl = highlightedLines.split(",")) === null || _highlightedLines$spl === void 0 ? void 0 : _highlightedLines$spl.map(Number);
12611
+ var linesToHighlight = (_highlightedLines$spl = highlightedLines.split(",")) === null || _highlightedLines$spl === void 0 ? void 0 : _highlightedLines$spl.filter(Boolean).map(Number);
12609
12612
  var highlightLinesOptions = linesToHighlight.map(function (line) {
12610
12613
  return {
12611
12614
  start: line,
@@ -12637,8 +12640,9 @@ var substituteVariables = function substituteVariables(highlightedContent, varia
12637
12640
  };
12638
12641
 
12639
12642
  exports.EDITOR_CONTENT_CLASS_NAME = EDITOR_CONTENT_CLASS_NAME;
12643
+ exports.EDITOR_CONTENT_DEFAULT_CONFIGURATION = EDITOR_CONTENT_DEFAULT_CONFIGURATION;
12640
12644
  exports.SANITIZE_OPTIONS = SANITIZE_OPTIONS;
12641
12645
  exports.applyLineHighlighting = applyLineHighlighting;
12642
- exports.highlightCode = highlightCode;
12646
+ exports.applySyntaxHighlighting = applySyntaxHighlighting;
12643
12647
  exports.substituteVariables = substituteVariables;
12644
- //# sourceMappingURL=chunk-Dy-jMvft.cjs.js.map
12648
+ //# sourceMappingURL=chunk-BleZrnmm.cjs.js.map