@bigbinary/neeto-editor 1.47.112 → 1.47.113
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Attachments.js +1 -2
- package/dist/Attachments.js.map +1 -1
- package/dist/Editor.js +11 -6
- package/dist/Editor.js.map +1 -1
- package/dist/EditorContent.js +4 -2
- package/dist/EditorContent.js.map +1 -1
- package/dist/FormikEditor.js +5 -6
- package/dist/FormikEditor.js.map +1 -1
- package/dist/Menu.js +8 -8
- package/dist/{chunk-kSsvM8aH.js → chunk--BjpQHaY.js} +2 -3
- package/dist/chunk--BjpQHaY.js.map +1 -0
- package/dist/{chunk-C26VPEID.js → chunk-3JO2B_HR.js} +2 -3
- package/dist/{chunk-C26VPEID.js.map → chunk-3JO2B_HR.js.map} +1 -1
- package/dist/{chunk-BDcN2CWH.js → chunk-BKsyn0lE.js} +6 -2
- package/dist/chunk-BKsyn0lE.js.map +1 -0
- package/dist/{chunk-BOSqhXe9.js → chunk-BLXUWWgi.js} +1 -5
- package/dist/{chunk-BOSqhXe9.js.map → chunk-BLXUWWgi.js.map} +1 -1
- package/dist/{chunk-0yZ5QmzV.js → chunk-BO6bjSuY.js} +6 -3
- package/dist/chunk-BO6bjSuY.js.map +1 -0
- package/dist/{chunk-Zi-ccf09.js → chunk-C9Hjlrrk.js} +2 -2
- package/dist/chunk-C9Hjlrrk.js.map +1 -0
- package/dist/{chunk-DVrXh89W.js → chunk-CNWsmIz_.js} +1 -2
- package/dist/chunk-CNWsmIz_.js.map +1 -0
- package/dist/{chunk-DRyQ5gRT.js → chunk-Dj7lS7Cs.js} +2 -9
- package/dist/{chunk-DRyQ5gRT.js.map → chunk-Dj7lS7Cs.js.map} +1 -1
- package/dist/{chunk-B5ZO6MSb.js → chunk-DtQctlVh.js} +2 -4
- package/dist/{chunk-B5ZO6MSb.js.map → chunk-DtQctlVh.js.map} +1 -1
- package/dist/cjs/Attachments.cjs.js +1 -2
- package/dist/cjs/Attachments.cjs.js.map +1 -1
- package/dist/cjs/Editor.cjs.js +82 -77
- package/dist/cjs/Editor.cjs.js.map +1 -1
- package/dist/cjs/EditorContent.cjs.js +4 -2
- package/dist/cjs/EditorContent.cjs.js.map +1 -1
- package/dist/cjs/FormikEditor.cjs.js +5 -6
- package/dist/cjs/FormikEditor.cjs.js.map +1 -1
- package/dist/cjs/Menu.cjs.js +8 -8
- package/dist/cjs/{chunk-ByqRrEfj.cjs.js → chunk-BYyLrDTW.cjs.js} +2 -3
- package/dist/cjs/{chunk-ByqRrEfj.cjs.js.map → chunk-BYyLrDTW.cjs.js.map} +1 -1
- package/dist/cjs/{chunk-BE_JvlHl.cjs.js → chunk-B_ZuTQG9.cjs.js} +11 -11
- package/dist/cjs/chunk-B_ZuTQG9.cjs.js.map +1 -0
- package/dist/cjs/{chunk-UnFuCCxl.cjs.js → chunk-BrQjqeiG.cjs.js} +15 -11
- package/dist/cjs/chunk-BrQjqeiG.cjs.js.map +1 -0
- package/dist/cjs/{chunk-BJo6VB1g.cjs.js → chunk-CIuJ_EMY.cjs.js} +1 -2
- package/dist/cjs/chunk-CIuJ_EMY.cjs.js.map +1 -0
- package/dist/cjs/{chunk-Cv7rmxCK.cjs.js → chunk-Cv0ocaVh.cjs.js} +1 -5
- package/dist/cjs/{chunk-Cv7rmxCK.cjs.js.map → chunk-Cv0ocaVh.cjs.js.map} +1 -1
- package/dist/cjs/{chunk-LeproQrc.cjs.js → chunk-Cvxaj__T.cjs.js} +2 -3
- package/dist/cjs/chunk-Cvxaj__T.cjs.js.map +1 -0
- package/dist/cjs/{chunk-DQYVBQIk.cjs.js → chunk-DOxH3Agq.cjs.js} +159 -166
- package/dist/cjs/{chunk-DQYVBQIk.cjs.js.map → chunk-DOxH3Agq.cjs.js.map} +1 -1
- package/dist/cjs/{chunk-Gl_OXcUl.cjs.js → chunk-DRB71ojr.cjs.js} +6 -3
- package/dist/cjs/chunk-DRB71ojr.cjs.js.map +1 -0
- package/dist/cjs/{chunk-ColwAO4n.cjs.js → chunk-n7U2G1az.cjs.js} +2 -4
- package/dist/cjs/{chunk-ColwAO4n.cjs.js.map → chunk-n7U2G1az.cjs.js.map} +1 -1
- package/dist/cjs/index.cjs.js +4 -6
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/v2/Attachments.cjs.js +1 -3
- package/dist/cjs/v2/Attachments.cjs.js.map +1 -1
- package/dist/cjs/v2/Editor.cjs.js +75 -77
- package/dist/cjs/v2/Editor.cjs.js.map +1 -1
- package/dist/cjs/v2/EditorContent.cjs.js +1 -3
- package/dist/cjs/v2/EditorContent.cjs.js.map +1 -1
- package/dist/cjs/v2/FormikEditor.cjs.js +4 -6
- package/dist/cjs/v2/FormikEditor.cjs.js.map +1 -1
- package/dist/cjs/v2/Menu.cjs.js +6 -7
- package/dist/cjs/v2/Menu.cjs.js.map +1 -1
- package/dist/cjs/v2/index.cjs.js +8 -11
- package/dist/cjs/v2/index.cjs.js.map +1 -1
- package/dist/editor-stats.html +19 -1
- package/dist/index.js +4 -6
- package/dist/index.js.map +1 -1
- package/dist/v2/Attachments.js +1 -3
- package/dist/v2/Attachments.js.map +1 -1
- package/dist/v2/Editor.js +4 -6
- package/dist/v2/Editor.js.map +1 -1
- package/dist/v2/EditorContent.js +1 -3
- package/dist/v2/EditorContent.js.map +1 -1
- package/dist/v2/FormikEditor.js +4 -6
- package/dist/v2/FormikEditor.js.map +1 -1
- package/dist/v2/Menu.js +6 -7
- package/dist/v2/Menu.js.map +1 -1
- package/dist/v2/index.js +8 -11
- package/dist/v2/index.js.map +1 -1
- package/dist/v2/styles.css +1 -1
- package/dist/v2/styles.js +4 -0
- package/dist/v2/styles.js.map +1 -0
- package/package.json +3 -1
- package/dist/chunk-0yZ5QmzV.js.map +0 -1
- package/dist/chunk-3C7ZroSh.js +0 -5
- package/dist/chunk-3C7ZroSh.js.map +0 -1
- package/dist/chunk-BDcN2CWH.js.map +0 -1
- package/dist/chunk-CVfGOKt4.js +0 -5
- package/dist/chunk-CVfGOKt4.js.map +0 -1
- package/dist/chunk-DVrXh89W.js.map +0 -1
- package/dist/chunk-Zi-ccf09.js.map +0 -1
- package/dist/chunk-kSsvM8aH.js.map +0 -1
- package/dist/cjs/chunk-BE_JvlHl.cjs.js.map +0 -1
- package/dist/cjs/chunk-BJo6VB1g.cjs.js.map +0 -1
- package/dist/cjs/chunk-BaJ2GldN.cjs.js +0 -7
- package/dist/cjs/chunk-BaJ2GldN.cjs.js.map +0 -1
- package/dist/cjs/chunk-DcAwRABD.cjs.js +0 -7
- package/dist/cjs/chunk-DcAwRABD.cjs.js.map +0 -1
- package/dist/cjs/chunk-Gl_OXcUl.cjs.js.map +0 -1
- package/dist/cjs/chunk-LeproQrc.cjs.js.map +0 -1
- package/dist/cjs/chunk-UnFuCCxl.cjs.js.map +0 -1
- package/dist/v2/_styles-bundle.js +0 -4
- package/dist/v2/_styles-bundle.js.map +0 -1
|
@@ -10,7 +10,7 @@ var CopyToClipboardButton = require('@bigbinary/neeto-molecules/CopyToClipboardB
|
|
|
10
10
|
var ramda = require('ramda');
|
|
11
11
|
var client = require('react-dom/client');
|
|
12
12
|
var constants = require('./chunk-2HrSPdAV.cjs.js');
|
|
13
|
-
require('./chunk-
|
|
13
|
+
var injectCss = require('./chunk-B6qYtOJe.cjs.js');
|
|
14
14
|
require('@bigbinary/neeto-cist');
|
|
15
15
|
require('./chunk-BGy3NmZC.cjs.js');
|
|
16
16
|
var index$1 = require('./chunk-TrGAGew5.cjs.js');
|
|
@@ -22,7 +22,6 @@ var Spinner = require('@bigbinary/neetoui/Spinner');
|
|
|
22
22
|
var ReactDOM = require('react-dom');
|
|
23
23
|
var reactI18next = require('react-i18next');
|
|
24
24
|
var jsxRuntime = require('react/jsx-runtime');
|
|
25
|
-
require('./chunk-B6qYtOJe.cjs.js');
|
|
26
25
|
require('i18next');
|
|
27
26
|
require('yup');
|
|
28
27
|
require('./chunk-JCA39oKB.cjs.js');
|
|
@@ -42,6 +41,9 @@ var Close__default = /*#__PURE__*/_interopDefault(Close);
|
|
|
42
41
|
var Button__default = /*#__PURE__*/_interopDefault(Button);
|
|
43
42
|
var Spinner__default = /*#__PURE__*/_interopDefault(Spinner);
|
|
44
43
|
|
|
44
|
+
var css = "@charset \"UTF-8\";.neeto-editor__callout{border-radius:8px;margin:16px 0;padding:16px;position:relative}.neeto-editor__callout .callout-container{align-items:flex-start;display:flex;gap:12px}.neeto-editor__callout .callout-container .callout-emoji{flex-shrink:0;line-height:1}.neeto-editor__callout .callout-container .callout-content{flex-grow:1;min-width:0;outline:none}.neeto-editor__callout .callout-container .callout-content p{margin:0}.neeto-editor__callout .callout-container .callout-content h1:first-child,.neeto-editor__callout .callout-container .callout-content h2:first-child,.neeto-editor__callout .callout-container .callout-content h3:first-child,.neeto-editor__callout .callout-container .callout-content h4:first-child,.neeto-editor__callout .callout-container .callout-content h5:first-child,.neeto-editor__callout .callout-container .callout-content h6:first-child{margin-top:0}.neeto-editor__callout .callout-container .callout-content>p:first-child{margin-top:0}.neeto-editor__callout--default{background-color:#f6f7f8;background-color:rgb(var(--neeto-editor-gray-100))}.neeto-editor__callout--info{background-color:#e2f2ff;background-color:rgb(var(--neeto-editor-info-100))}.neeto-editor__callout--warning{background-color:#fbf2e1;background-color:rgb(var(--neeto-editor-warning-100))}.neeto-editor__callout--error{background-color:#feecf0;background-color:rgb(var(--neeto-editor-error-100))}.neeto-editor__callout--success{background-color:#ebfffa;background-color:rgb(var(--neeto-editor-success-100))}.neeto-ui-dropdown__popup .neeto-ui-dropdown__popup-menu.neeto-editor-callout-dropdown{padding:8px;width:200px}.neeto-editor-callout-dropdown{display:flex;flex-direction:column;gap:8px}.neeto-editor-callout-dropdown .neeto-editor-callout-dropdown__section{width:100%}.neeto-editor-callout-dropdown .neeto-editor-callout-dropdown__section .neeto-editor-callout-dropdown__section-title{color:rgb(var(--neeto-ui-gray-600));font-size:10px;font-weight:500;letter-spacing:.5px;margin-bottom:4px;padding:0 4px;text-transform:uppercase}.neeto-editor-callout-dropdown .neeto-editor-callout-dropdown__section .neeto-editor-callout-dropdown__options-grid{display:flex;flex-direction:column;gap:2px}.neeto-editor-callout-dropdown__type-option{align-items:center;background:none;border:none;border-radius:4px;cursor:pointer;display:flex;font-size:12px;padding-block:6px;padding-inline:8px;text-align:start;transition:all .15s ease;width:100%}.neeto-editor-callout-dropdown__type-option .neeto-editor-callout-dropdown__type-emoji{align-items:center;display:flex;flex-shrink:0;font-size:14px;height:16px;justify-content:center;margin-inline-end:8px;width:16px}.neeto-editor-callout-dropdown__type-option .neeto-editor-callout-dropdown__type-label{color:rgb(var(--neeto-ui-gray-800));flex:1;font-weight:500}.neeto-editor-callout-dropdown__type-option:hover{background-color:rgb(var(--neeto-ui-gray-50))}.neeto-editor-callout-dropdown__type-option--selected{background-color:rgb(var(--neeto-ui-primary-50));border:1px solid rgb(var(--neeto-ui-primary-200))}.neeto-editor-callout-dropdown__type-option--selected .neeto-editor-callout-dropdown__type-label{color:rgb(var(--neeto-ui-primary-900))}.neeto-editor-callout-dropdown__current-emoji{display:inline-block}.ProseMirror ul[data-type=todoList],.neeto-editor-content ul[data-type=todoList]{list-style:none;margin-inline-start:0;padding:0}.ProseMirror ul[data-type=todoList] li,.neeto-editor-content ul[data-type=todoList] li{align-items:flex-start;display:flex;position:relative}.ProseMirror ul[data-type=todoList] li>label,.neeto-editor-content ul[data-type=todoList] li>label{flex:0 0 auto;margin-inline-end:.5rem;pointer-events:none;-moz-user-select:none;user-select:none;z-index:1}.ProseMirror ul[data-type=todoList] li>div,.neeto-editor-content ul[data-type=todoList] li>div{flex:1 1 auto;min-height:1.5rem}.ProseMirror ul[data-type=todoList] input[type=checkbox],.neeto-editor-content ul[data-type=todoList] input[type=checkbox]{border-color:rgb(var(--neeto-ui-gray-800));border-radius:0;border-width:1px;color:rgb(var(--neeto-ui-primary-500));cursor:pointer;pointer-events:auto;position:relative;top:-2px;z-index:2}.ProseMirror ul[data-type=todoList] input[type=checkbox]:checked,.neeto-editor-content ul[data-type=todoList] input[type=checkbox]:checked{border-color:rgb(var(--neeto-ui-primary-500))}.ProseMirror ul[data-type=todoList] ul[data-type=todoList],.neeto-editor-content ul[data-type=todoList] ul[data-type=todoList]{margin:0}.ProseMirror ul[data-type=todoList] li[data-checked=true]>div p,.neeto-editor-content ul[data-type=todoList] li[data-checked=true]>div p{opacity:.65;text-decoration:line-through}.neeto-editor-content .hljs{background:#282c34;color:#abb2bf}.neeto-editor-content .hljs-comment,.neeto-editor-content .hljs-quote{color:#5c6370;font-style:italic}.neeto-editor-content .hljs-doctag,.neeto-editor-content .hljs-formula,.neeto-editor-content .hljs-keyword{color:#c678dd}.neeto-editor-content .hljs-deletion,.neeto-editor-content .hljs-name,.neeto-editor-content .hljs-section,.neeto-editor-content .hljs-selector-tag,.neeto-editor-content .hljs-subst{color:#e06c75}.neeto-editor-content .hljs-literal{color:#56b6c2}.neeto-editor-content .hljs-addition,.neeto-editor-content .hljs-attribute,.neeto-editor-content .hljs-meta .hljs-string,.neeto-editor-content .hljs-regexp,.neeto-editor-content .hljs-string{color:#98c379}.neeto-editor-content .hljs-attr,.neeto-editor-content .hljs-number,.neeto-editor-content .hljs-selector-attr,.neeto-editor-content .hljs-selector-class,.neeto-editor-content .hljs-selector-pseudo,.neeto-editor-content .hljs-template-variable,.neeto-editor-content .hljs-type,.neeto-editor-content .hljs-variable{color:#d19a66}.neeto-editor-content .hljs-bullet,.neeto-editor-content .hljs-link,.neeto-editor-content .hljs-meta,.neeto-editor-content .hljs-selector-id,.neeto-editor-content .hljs-symbol,.neeto-editor-content .hljs-title{color:#61aeee}.neeto-editor-content .hljs-built_in,.neeto-editor-content .hljs-class .hljs-title,.neeto-editor-content .hljs-title.class_{color:#e6c07b}.neeto-editor-content .hljs-emphasis{font-style:italic}.neeto-editor-content .hljs-strong{font-weight:700}.neeto-editor-content .hljs-link{text-decoration:underline}.neeto-ui-theme--dark .hljs{background:#fafafa;color:#383a42}.neeto-ui-theme--dark .hljs-comment,.neeto-ui-theme--dark .hljs-quote{color:#a0a1a7;font-style:italic}.neeto-ui-theme--dark .hljs-doctag,.neeto-ui-theme--dark .hljs-formula,.neeto-ui-theme--dark .hljs-keyword{color:#a626a4}.neeto-ui-theme--dark .hljs-deletion,.neeto-ui-theme--dark .hljs-name,.neeto-ui-theme--dark .hljs-section,.neeto-ui-theme--dark .hljs-selector-tag,.neeto-ui-theme--dark .hljs-subst{color:#e45649}.neeto-ui-theme--dark .hljs-literal{color:#0184bb}.neeto-ui-theme--dark .hljs-addition,.neeto-ui-theme--dark .hljs-attribute,.neeto-ui-theme--dark .hljs-meta .hljs-string,.neeto-ui-theme--dark .hljs-regexp,.neeto-ui-theme--dark .hljs-string{color:#50a14f}.neeto-ui-theme--dark .hljs-attr,.neeto-ui-theme--dark .hljs-number,.neeto-ui-theme--dark .hljs-selector-attr,.neeto-ui-theme--dark .hljs-selector-class,.neeto-ui-theme--dark .hljs-selector-pseudo,.neeto-ui-theme--dark .hljs-template-variable,.neeto-ui-theme--dark .hljs-type,.neeto-ui-theme--dark .hljs-variable{color:#986801}.neeto-ui-theme--dark .hljs-bullet,.neeto-ui-theme--dark .hljs-link,.neeto-ui-theme--dark .hljs-meta,.neeto-ui-theme--dark .hljs-selector-id,.neeto-ui-theme--dark .hljs-symbol,.neeto-ui-theme--dark .hljs-title{color:#4078f2}.neeto-ui-theme--dark .hljs-built_in,.neeto-ui-theme--dark .hljs-class .hljs-title,.neeto-ui-theme--dark .hljs-title.class_{color:#c18401}.neeto-ui-theme--dark .hljs-emphasis{font-style:italic}.neeto-ui-theme--dark .hljs-strong{font-weight:700}.neeto-ui-theme--dark .hljs-link{text-decoration:underline}.neeto-ui-theme--light .hljs{background:#282c34;color:#abb2bf}.neeto-ui-theme--light .hljs-comment,.neeto-ui-theme--light .hljs-quote{color:#5c6370;font-style:italic}.neeto-ui-theme--light .hljs-doctag,.neeto-ui-theme--light .hljs-formula,.neeto-ui-theme--light .hljs-keyword{color:#c678dd}.neeto-ui-theme--light .hljs-deletion,.neeto-ui-theme--light .hljs-name,.neeto-ui-theme--light .hljs-section,.neeto-ui-theme--light .hljs-selector-tag,.neeto-ui-theme--light .hljs-subst{color:#e06c75}.neeto-ui-theme--light .hljs-literal{color:#56b6c2}.neeto-ui-theme--light .hljs-addition,.neeto-ui-theme--light .hljs-attribute,.neeto-ui-theme--light .hljs-meta .hljs-string,.neeto-ui-theme--light .hljs-regexp,.neeto-ui-theme--light .hljs-string{color:#98c379}.neeto-ui-theme--light .hljs-attr,.neeto-ui-theme--light .hljs-number,.neeto-ui-theme--light .hljs-selector-attr,.neeto-ui-theme--light .hljs-selector-class,.neeto-ui-theme--light .hljs-selector-pseudo,.neeto-ui-theme--light .hljs-template-variable,.neeto-ui-theme--light .hljs-type,.neeto-ui-theme--light .hljs-variable{color:#d19a66}.neeto-ui-theme--light .hljs-bullet,.neeto-ui-theme--light .hljs-link,.neeto-ui-theme--light .hljs-meta,.neeto-ui-theme--light .hljs-selector-id,.neeto-ui-theme--light .hljs-symbol,.neeto-ui-theme--light .hljs-title{color:#61aeee}.neeto-ui-theme--light .hljs-built_in,.neeto-ui-theme--light .hljs-class .hljs-title,.neeto-ui-theme--light .hljs-title.class_{color:#e6c07b}.neeto-ui-theme--light .hljs-emphasis{font-style:italic}.neeto-ui-theme--light .hljs-strong{font-weight:700}.neeto-ui-theme--light .hljs-link{text-decoration:underline}.neeto-ui-theme--light,:root{--neeto-editor-white:255,255,255;--neeto-editor-black:12,17,29;--neeto-editor-gray-800:16,24,40;--neeto-editor-gray-700:29,41,57;--neeto-editor-gray-600:52,64,84;--neeto-editor-gray-500:135,146,157;--neeto-editor-gray-400:194,200,204;--neeto-editor-gray-300:216,220,222;--neeto-editor-gray-200:233,235,237;--neeto-editor-gray-100:246,247,248;--neeto-editor-gray-50:250,250,250;--neeto-editor-primary-800:0,102,83;--neeto-editor-primary-600:0,122,100;--neeto-editor-primary-500:0,128,104;--neeto-editor-primary-100:225,243,238;--neeto-editor-primary-50:240,249,247;--neeto-editor-accent-800:9,90,186;--neeto-editor-accent-600:13,102,208;--neeto-editor-accent-500:20,115,230;--neeto-editor-accent-100:230,244,255;--neeto-editor-accent-50:239,248,255;--neeto-editor-success-800:1,121,93;--neeto-editor-success-600:1,141,109;--neeto-editor-success-500:2,162,124;--neeto-editor-success-100:235,255,250;--neeto-editor-error-800:187,18,26;--neeto-editor-error-600:201,37,45;--neeto-editor-error-500:215,55,63;--neeto-editor-error-100:254,236,240;--neeto-editor-info-800:9,90,186;--neeto-editor-info-600:13,102,208;--neeto-editor-info-500:20,115,230;--neeto-editor-info-100:226,242,255;--neeto-editor-warning-800:189,100,13;--neeto-editor-warning-600:203,111,16;--neeto-editor-warning-500:218,123,17;--neeto-editor-warning-100:251,242,225;--neeto-editor-pastel-silver:232,233,237;--neeto-editor-pastel-red:255,229,229;--neeto-editor-pastel-yellow:254,243,197;--neeto-editor-pastel-green:211,249,232;--neeto-editor-pastel-blue:236,244,255;--neeto-editor-pastel-purple:238,235,255;--neeto-editor-pastel-pink:253,226,241;--neeto-editor-rounded-none:0;--neeto-editor-rounded-sm:3px;--neeto-editor-rounded:5px;--neeto-editor-rounded-md:6px;--neeto-editor-rounded-lg:8px;--neeto-editor-rounded-xl:12px;--neeto-editor-rounded-full:999px;--neeto-editor-font-thin:100;--neeto-editor-font-extralight:200;--neeto-editor-font-light:300;--neeto-editor-font-normal:400;--neeto-editor-font-medium:500;--neeto-editor-font-semibold:600;--neeto-editor-font-bold:700;--neeto-editor-font-extrabold:800;--neeto-editor-font-black:900;--neeto-editor-content-h1-margin:1.5rem 0 0.25rem;--neeto-editor-content-h2-margin:1.5rem 0 0.25rem;--neeto-editor-content-h3-margin:1.5rem 0 0.25rem;--neeto-editor-content-h4-margin:1.5rem 0 0.25rem;--neeto-editor-content-h5-margin:1.5rem 0 0.25rem;--neeto-editor-content-h6-margin:1.5rem 0 0.25rem;--neeto-editor-content-heading-font-weight:600;--neeto-editor-content-heading-font-weight-bold:bold;--neeto-editor-content-heading-color:12,17,29,1;--neeto-editor-content-heading-line-height:1.25;--neeto-editor-content-paragraph-color:54,55,55,1;--neeto-editor-content-paragraph-font-weight:400;--neeto-editor-content-paragraph-line-height:1.6;--neeto-editor-content-paragraph-margin-bottom:0.5rem;--neeto-editor-content-list-padding-inline-start:2rem;--neeto-editor-content-list-margin-bottom:1rem;--neeto-editor-content-list-item-margin-bottom:0.5rem;--neeto-editor-content-list-item-margin-top:0.5rem;--neeto-editor-content-code-font-size:85%;--neeto-editor-content-code-background-color:40,44,52,1;--neeto-editor-content-code-line-number-color:89,99,110,1;--neeto-editor-content-code-color:171,178,191,1;--neeto-editor-content-inline-code-color:31,35,40,1;--neeto-editor-content-inline-code-background-color:239,242,246,1;--neeto-editor-content-code-padding:0.2em 0.4em;--neeto-editor-content-blockquote-color:89,99,110,1;--neeto-editor-content-blockquote-border-color:209,217,224,1;--neeto-editor-content-blockquote-border-inline-start-width:4px;--neeto-editor-content-blockquote-margin-bottom:1rem;--neeto-editor-content-blockquote-padding-inline-start:0.75rem;--neeto-editor-content-image-border-color:228,228,231;--neeto-editor-content-image-border-radius:8px;--neeto-editor-highlight-text-1:#32302c;--neeto-editor-highlight-text-2:#787774;--neeto-editor-highlight-text-3:#9f6b53;--neeto-editor-highlight-text-4:#d9730d;--neeto-editor-highlight-text-5:#cb912f;--neeto-editor-highlight-text-6:#448361;--neeto-editor-highlight-text-7:#337ea9;--neeto-editor-highlight-text-8:#9065b0;--neeto-editor-highlight-text-9:#c14c8a;--neeto-editor-highlight-text-10:#d44c47;--neeto-editor-highlight-text-11:#6364dc;--neeto-editor-highlight-text-12:#d99641;--neeto-editor-highlight-text-13:#5a8cd7;--neeto-editor-highlight-text-14:#48a869;--neeto-editor-highlight-text-15:#dc3232;--neeto-editor-highlight-text-16:#af50dc;--neeto-editor-highlight-bg-1:#ff0;--neeto-editor-highlight-bg-2:#e3e3de;--neeto-editor-highlight-bg-3:#dfcece;--neeto-editor-highlight-bg-4:#f9e0c8;--neeto-editor-highlight-bg-5:#f7e7b6;--neeto-editor-highlight-bg-6:#d0e0cd;--neeto-editor-highlight-bg-7:#c0dfec;--neeto-editor-highlight-bg-8:#e3cef3;--neeto-editor-highlight-bg-9:#f4cdde;--neeto-editor-highlight-bg-10:#f9c7ca;--neeto-editor-highlight-bg-11:#b69cff;--neeto-editor-highlight-bg-12:#d9730d;--neeto-editor-highlight-bg-13:#4a85e8;--neeto-editor-highlight-bg-14:#00ff01;--neeto-editor-highlight-bg-15:red;--neeto-editor-highlight-bg-16:#f0f}.neeto-ui-theme--dark{--neeto-editor-white:18,18,18;--neeto-editor-black:224,224,224;--neeto-editor-gray-50:10,10,10;--neeto-editor-gray-100:30,30,30;--neeto-editor-gray-200:44,44,44;--neeto-editor-gray-300:57,57,57;--neeto-editor-gray-400:73,73,73;--neeto-editor-gray-500:92,92,92;--neeto-editor-gray-600:124,124,124;--neeto-editor-gray-700:162,162,162;--neeto-editor-gray-800:200,200,200;--neeto-editor-primary-800:0,245,200;--neeto-editor-primary-600:0,224,183;--neeto-editor-primary-500:0,204,167;--neeto-editor-primary-100:0,61,49;--neeto-editor-primary-50:0,41,33;--neeto-editor-accent-800:142,189,245;--neeto-editor-accent-600:105,167,242;--neeto-editor-accent-500:67,144,239;--neeto-editor-accent-100:10,56,113;--neeto-editor-accent-50:7,37,75;--neeto-editor-error-800:247,109,116;--neeto-editor-error-600:236,91,98;--neeto-editor-error-500:227,72,80;--neeto-editor-error-100:129,33,38;--neeto-editor-success-800:0,245,200;--neeto-editor-success-600:0,224,183;--neeto-editor-success-500:0,204,167;--neeto-editor-success-100:0,61,49;--neeto-editor-warning-800:249,164,63;--neeto-editor-warning-600:242,148,35;--neeto-editor-warning-500:230,134,25;--neeto-editor-warning-100:131,74,11;--neeto-editor-info-800:142,189,245;--neeto-editor-info-600:105,167,242;--neeto-editor-info-500:67,144,239;--neeto-editor-info-100:10,56,113;--neeto-editor-pastel-silver:167,168,170;--neeto-editor-pastel-red:183,164,165;--neeto-editor-pastel-yellow:182,175,143;--neeto-editor-pastel-green:152,179,167;--neeto-editor-pastel-blue:170,175,183;--neeto-editor-pastel-purple:171,169,183;--neeto-editor-pastel-pink:181,162,174;--neeto-editor-content-heading-color:224,224,224,1;--neeto-editor-content-paragraph-color:224,224,224,1;--neeto-editor-content-code-background-color:246,248,250,1;--neeto-editor-content-code-line-number-color:89,99,110,1;--neeto-editor-content-code-color:31,35,40,1;--neeto-editor-content-inline-code-color:212,223,243,1;--neeto-editor-content-inline-code-background-color:67,73,84,1;--neeto-editor-content-blockquote-color:145,152,161,1;--neeto-editor-content-blockquote-border-color:61,68,77,1;--neeto-editor-highlight-text-1:#cdcdcd;--neeto-editor-highlight-text-2:#b4b4b4;--neeto-editor-highlight-text-3:#c89678;--neeto-editor-highlight-text-4:#f0b464;--neeto-editor-highlight-text-5:#e6be78;--neeto-editor-highlight-text-6:#78be96;--neeto-editor-highlight-text-7:#64b4dc;--neeto-editor-highlight-text-8:#be96e6;--neeto-editor-highlight-text-9:#dc78be;--neeto-editor-highlight-text-10:#e6786e;--neeto-editor-highlight-text-11:#9b9cff;--neeto-editor-highlight-text-12:#f5b464;--neeto-editor-highlight-text-13:#78aaf5;--neeto-editor-highlight-text-14:#64c887;--neeto-editor-highlight-text-15:#fa6e6e;--neeto-editor-highlight-text-16:#dc82ff;--neeto-editor-highlight-bg-1:#646400;--neeto-editor-highlight-bg-2:#41413c;--neeto-editor-highlight-bg-3:#413737;--neeto-editor-highlight-bg-4:#504130;--neeto-editor-highlight-bg-5:#554e2d;--neeto-editor-highlight-bg-6:#2d412a;--neeto-editor-highlight-bg-7:#234452;--neeto-editor-highlight-bg-8:#413055;--neeto-editor-highlight-bg-9:#552d44;--neeto-editor-highlight-bg-10:#553030;--neeto-editor-highlight-bg-11:#32145a;--neeto-editor-highlight-bg-12:#643c0a;--neeto-editor-highlight-bg-13:#193c6e;--neeto-editor-highlight-bg-14:#00500a;--neeto-editor-highlight-bg-15:#6e0f0f;--neeto-editor-highlight-bg-16:#640a64}.neeto-ui-theme--dark .neeto-editor-content.neeto-editor-size--small{--neeto-editor-content-heading-color:224,224,224,1;--neeto-editor-content-paragraph-color:224,224,224,1}.neeto-ui-theme--light .neeto-editor-content{--neeto-editor-content-heading-color:12,17,29,1;--neeto-editor-content-paragraph-color:54,55,55,1}.neeto-ui-theme--light .neeto-editor-content.neeto-editor-size--small{--neeto-editor-content-heading-color:31,35,40,1;--neeto-editor-content-paragraph-color:31,35,40,1}.neeto-editor-content{-moz-tab-size:2;-o-tab-size:2;tab-size:2;white-space:pre-wrap;word-break:break-word}.neeto-editor-content hr{border-color:#363737;border-color:rgba(var(--neeto-editor-content-paragraph-color));margin:.5rem 0;opacity:.2}.neeto-editor-content .table-responsive{-webkit-overflow-scrolling:touch;margin:1rem 0;overflow-x:auto}.neeto-editor-content .table-responsive.neeto-editor-table--left table td,.neeto-editor-content .table-responsive.neeto-editor-table--left table th{text-align:start!important}.neeto-editor-content .table-responsive.neeto-editor-table--center table td,.neeto-editor-content .table-responsive.neeto-editor-table--center table th{text-align:center!important}.neeto-editor-content .table-responsive.neeto-editor-table--right table td,.neeto-editor-content .table-responsive.neeto-editor-table--right table th{text-align:end!important}.neeto-editor-content.neeto-editor-size--small{--neeto-editor-content-heading-color:31,35,40,1;--neeto-editor-content-paragraph-color:31,35,40,1;--neeto-editor-content-h1-font-size:1.75rem;--neeto-editor-content-h2-font-size:1.3125rem;--neeto-editor-content-h3-font-size:1.09375rem;--neeto-editor-content-h4-font-size:0.875rem;--neeto-editor-content-h5-font-size:0.765625rem;--neeto-editor-content-h6-font-size:0.74375rem;--neeto-editor-content-paragraph-font-size:0.875rem;--neeto-editor-content-paragraph-line-height:1.5;--neeto-editor-content-list-padding-inline-start:1.5rem;--neeto-editor-content-list-item-margin-bottom:0.25rem;--neeto-editor-content-list-item-margin-top:0.25rem}.neeto-editor-content.neeto-editor-size--medium{--neeto-editor-content-h1-font-size:2rem;--neeto-editor-content-h2-font-size:1.5rem;--neeto-editor-content-h3-font-size:1.25rem;--neeto-editor-content-h4-font-size:1rem;--neeto-editor-content-h5-font-size:0.875rem;--neeto-editor-content-h6-font-size:0.75rem;--neeto-editor-content-paragraph-font-size:1rem}@media only screen and (max-width:767px){.neeto-editor-content.neeto-editor-size--medium{--neeto-editor-content-h1-font-size:1.375rem;--neeto-editor-content-h2-font-size:1.25rem;--neeto-editor-content-h3-font-size:1.125rem}}.neeto-editor-content.neeto-editor-size--large{--neeto-editor-content-h1-font-size:2.375rem;--neeto-editor-content-h2-font-size:1.93rem;--neeto-editor-content-h3-font-size:1.633rem;--neeto-editor-content-h4-font-size:1.336rem;--neeto-editor-content-h5-font-size:0.986rem;--neeto-editor-content-h6-font-size:0.796rem;--neeto-editor-content-paragraph-font-size:1.125rem}@media only screen and (max-width:767px){.neeto-editor-content.neeto-editor-size--large{--neeto-editor-content-h1-font-size:2.125rem;--neeto-editor-content-h2-font-size:1.7266rem;--neeto-editor-content-h3-font-size:1.4609rem;--neeto-editor-content-h4-font-size:1.1953rem;--neeto-editor-content-h5-font-size:0.875rem;--neeto-editor-content-h6-font-size:0.75rem;--neeto-editor-content-paragraph-font-size:1rem}}.neeto-editor-content h1,.neeto-editor-content h2,.neeto-editor-content h3,.neeto-editor-content h4,.neeto-editor-content h5,.neeto-editor-content h6{color:#0c111d;color:rgba(var(--neeto-editor-content-heading-color));font-weight:600;font-weight:var(--neeto-editor-content-heading-font-weight)}.neeto-editor-content h1 strong,.neeto-editor-content h2 strong,.neeto-editor-content h3 strong,.neeto-editor-content h4 strong,.neeto-editor-content h5 strong,.neeto-editor-content h6 strong{font-weight:700!important;font-weight:var(--neeto-editor-content-heading-font-weight-bold)!important}.neeto-editor-content h1{font-size:var(--neeto-editor-content-h1-font-size);margin:1.5rem 0 .25rem;margin:var(--neeto-editor-content-h1-margin)}.neeto-editor-content h2{font-size:var(--neeto-editor-content-h2-font-size);margin:1.5rem 0 .25rem;margin:var(--neeto-editor-content-h2-margin)}.neeto-editor-content h3{font-size:var(--neeto-editor-content-h3-font-size);margin:1.5rem 0 .25rem;margin:var(--neeto-editor-content-h3-margin)}.neeto-editor-content h4{font-size:var(--neeto-editor-content-h4-font-size);margin:1.5rem 0 .25rem;margin:var(--neeto-editor-content-h4-margin)}.neeto-editor-content h5{font-size:var(--neeto-editor-content-h5-font-size);margin:1.5rem 0 .25rem;margin:var(--neeto-editor-content-h5-margin)}.neeto-editor-content h6{font-size:var(--neeto-editor-content-h6-font-size);margin:1.5rem 0 .25rem;margin:var(--neeto-editor-content-h6-margin)}.neeto-editor-content .header-wrapper{position:relative}.neeto-editor-content .header-wrapper__link{position:absolute;top:50%}.neeto-editor-content .header-wrapper h1,.neeto-editor-content .header-wrapper h2,.neeto-editor-content .header-wrapper h3,.neeto-editor-content .header-wrapper h4,.neeto-editor-content .header-wrapper h5,.neeto-editor-content .header-wrapper h6{line-height:1.25;line-height:var(--neeto-editor-content-heading-line-height);transition:color .15s ease-in}.neeto-editor-content .header-wrapper .header-link-icon-wrapper{align-items:center;display:flex;height:100%;inset-inline-start:-1.5625rem;opacity:0;position:absolute;transition:opacity .15s ease-in;width:1.5625rem}.neeto-editor-content .header-wrapper .header-link-icon-wrapper svg{fill:#006653;fill:rgb(var(--neeto-editor-primary-800));transition:fill .15s ease-in}.neeto-editor-content .header-wrapper:hover .header-link-icon-wrapper{opacity:1}.neeto-editor-content .header-wrapper:hover svg{fill:#095aba;fill:rgb(var(--neeto-editor-accent-800))}.neeto-editor-content p{color:#363737;color:rgba(var(--neeto-editor-content-paragraph-color));font-size:var(--neeto-editor-content-paragraph-font-size);font-weight:400;font-weight:var(--neeto-editor-content-paragraph-font-weight);line-height:1.6;line-height:var(--neeto-editor-content-paragraph-line-height);margin-bottom:.5rem;margin-bottom:var(--neeto-editor-content-paragraph-margin-bottom);margin-top:0;min-height:1.3rem}.neeto-editor-content p:empty:after{content:\" \"}.neeto-editor-content p:empty{line-height:1;margin-bottom:0;min-height:1rem}.neeto-editor-content p:last-child{margin-bottom:0}.neeto-editor-content p strong{font-weight:600!important}.neeto-editor-content div{color:#363737;color:rgba(var(--neeto-editor-content-paragraph-color));font-size:var(--neeto-editor-content-paragraph-font-size);font-weight:400;font-weight:var(--neeto-editor-content-paragraph-font-weight);line-height:1.6;line-height:var(--neeto-editor-content-paragraph-line-height)}.neeto-editor-content code{background-color:#282c34;background-color:rgba(var(--neeto-editor-content-code-background-color));border-color:#282c34;border-color:rgba(var(--neeto-editor-content-code-background-color));border-radius:3px;border-radius:var(--neeto-editor-rounded-sm);color:#abb2bf;color:rgba(var(--neeto-editor-content-code-color));font-family:SFMono-Regular,Menlo,Consolas,PT Mono,Liberation Mono,Courier,monospace;font-size:85%;font-size:var(--neeto-editor-content-code-font-size);padding:.2em .4em;padding:var(--neeto-editor-content-code-padding)}.neeto-editor-content code *{font-size:inherit!important}.neeto-editor-content h1 code,.neeto-editor-content h2 code,.neeto-editor-content h3 code,.neeto-editor-content h4 code,.neeto-editor-content h5 code,.neeto-editor-content h6 code,.neeto-editor-content li code,.neeto-editor-content p code,.neeto-editor-content table td code,.neeto-editor-content table th code{background-color:#eff2f6;background-color:rgba(var(--neeto-editor-content-inline-code-background-color));border-radius:3px;border-radius:var(--neeto-editor-rounded-sm);color:#1f2328;color:rgba(var(--neeto-editor-content-inline-code-color));font-size:85%;font-size:var(--neeto-editor-content-code-font-size)}.neeto-editor-content pre{background-color:#282c34;background-color:rgba(var(--neeto-editor-content-code-background-color));border-color:#282c34;border-color:rgba(var(--neeto-editor-content-code-background-color));border-radius:8px;border-radius:var(--neeto-editor-rounded-lg);counter-reset:line-number;font-size:var(--neeto-editor-content-paragraph-font-size);line-height:1.5;margin-bottom:1rem;margin-top:1rem;max-width:100%;padding:0;position:relative}.neeto-editor-content pre,.neeto-editor-content pre div{color:#abb2bf;color:rgba(var(--neeto-editor-content-code-color))}.neeto-editor-content pre .neeto-editor-codeblock-options{align-items:center;display:flex;gap:.25rem;inset-inline-end:.25rem;opacity:0;position:absolute;top:.25rem;visibility:hidden}.neeto-editor-content pre .neeto-editor-codeblock-options__menu{display:flex;flex-direction:column;gap:.25rem}.neeto-editor-content pre .neeto-editor-codeblock-options__input{margin:.25rem}.neeto-editor-content pre:hover .neeto-editor-codeblock-options{opacity:1;visibility:visible}.neeto-editor-content pre:hover .copy-button{opacity:1;visibility:visible}.neeto-editor-content pre .copy-button{inset-inline-end:.25rem;opacity:0;position:absolute;top:.25rem;visibility:hidden}.neeto-editor-content pre[data-linenumbers] .highlight-line{padding-inline-start:3.125rem;position:relative}.neeto-editor-content pre[data-linenumbers] .highlight-line:before{align-items:center;color:#59636e;color:rgba(var(--neeto-editor-content-code-line-number-color));content:counter(line-number);counter-increment:line-number;display:flex;font-size:85%;font-weight:400;height:100%;inset-inline-start:0;justify-content:flex-end;padding-inline-end:1rem;padding-inline-start:.625rem;position:absolute;width:3.125rem}.neeto-editor-content pre[data-linenumbers] .highlight-line:last-child:before{content:\"\"}.neeto-editor-content pre>code{background-color:transparent;border-radius:0;border-radius:8px;border-radius:var(--neeto-editor-rounded-lg);border-width:0;color:inherit;display:block;font-size:85%;font-size:var(--neeto-editor-content-code-font-size);font-weight:400;line-height:inherit;overflow-x:auto;padding:.75rem;white-space:pre!important;width:100%}.neeto-editor-content pre[data-linenumbers]>code{padding-inline-start:0}.neeto-editor-content blockquote{border-inline-start-color:#d1d9e0;border-inline-start-color:rgba(var(--neeto-editor-content-blockquote-border-color));border-inline-start-width:4px;border-inline-start-width:var(--neeto-editor-content-blockquote-border-inline-start-width);color:#59636e;color:rgba(var(--neeto-editor-content-blockquote-color));font-weight:500;font-weight:var(--neeto-editor-font-medium);margin-bottom:1rem;margin-bottom:var(--neeto-editor-content-blockquote-margin-bottom);padding-inline-start:.75rem;padding-inline-start:var(--neeto-editor-content-blockquote-padding-inline-start);quotes:\"“\" \"”\" \"‘\" \"’\"}.neeto-editor-content blockquote div,.neeto-editor-content blockquote p{color:inherit}.neeto-editor-content blockquote>p:before{content:\"\"!important}.neeto-editor-content blockquote>p:after{content:\"\"!important}.neeto-editor-content ol,.neeto-editor-content ul{list-style:revert;margin-bottom:1rem;margin-bottom:var(--neeto-editor-content-list-margin-bottom);padding-inline-start:2rem;padding-inline-start:var(--neeto-editor-content-list-padding-inline-start)}.neeto-editor-content ol li,.neeto-editor-content ul li{color:#363737;color:rgba(var(--neeto-editor-content-paragraph-color));font-size:var(--neeto-editor-content-paragraph-font-size);font-weight:400;font-weight:var(--neeto-editor-content-paragraph-font-weight);line-height:1.6;line-height:var(--neeto-editor-content-paragraph-line-height)}.neeto-editor-content ol li:before,.neeto-editor-content ul li:before{background-color:#363737;background-color:rgba(var(--neeto-editor-content-paragraph-color))}.neeto-editor-content ol li>p,.neeto-editor-content ul li>p{margin-bottom:.5rem!important;margin-bottom:var(--neeto-editor-content-list-item-margin-bottom)!important;margin-top:.5rem!important;margin-top:var(--neeto-editor-content-list-item-margin-top)!important}.neeto-editor-content ol+p,.neeto-editor-content ul+p{margin-top:.5rem!important;margin-top:var(--neeto-editor-content-list-item-margin-top)!important}.neeto-editor-content a[href]{color:#095aba;color:rgb(var(--neeto-editor-accent-800));font-weight:inherit}.neeto-editor-content .neeto-editor__video-wrapper{display:flex;margin:1rem 0;padding-inline-start:3px}.neeto-editor-content .neeto-editor__video-wrapper.neeto-editor__video--bordered iframe,.neeto-editor-content .neeto-editor__video-wrapper.neeto-editor__video--bordered video{border:1px solid #e4e4e7;border-color:rgba(var(--neeto-editor-content-image-border-color));border-radius:8px;border-radius:var(--neeto-editor-content-image-border-radius)}.neeto-editor-content .neeto-editor__video-wrapper .neeto-editor__video-iframe{display:inline-block;height:auto!important;max-width:100%;vertical-align:top}.neeto-editor-content .neeto-editor__video-wrapper .neeto-editor__video-iframe iframe{aspect-ratio:16/9;width:100%}.neeto-editor-content .neeto-editor__video-wrapper .neeto-editor__video-iframe.neeto-editor-aspect-1-1 iframe{aspect-ratio:1/1;width:100%}.neeto-editor-content .neeto-editor__video-wrapper .neeto-editor__video-iframe.neeto-editor-aspect-16-9 iframe{aspect-ratio:16/9;width:100%}.neeto-editor-content .neeto-editor__video-wrapper .neeto-editor__video-iframe.neeto-editor-aspect-9-16 iframe{aspect-ratio:9/16;width:100%}.neeto-editor-content .neeto-editor__video-wrapper .neeto-editor__video-iframe.neeto-editor-aspect-4-3 iframe{aspect-ratio:4/3;width:100%}.neeto-editor-content .neeto-editor__video-wrapper .neeto-editor__video-iframe.neeto-editor-aspect-3-2 iframe{aspect-ratio:3/2;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]{color:#095aba;color:rgb(var(--neeto-editor-accent-800))}.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-inline-start:1px solid #d8dcde;border-inline-start:1px solid rgba(var(--neeto-editor-gray-300));border-top:1px solid #d8dcde;border-top:1px solid rgba(var(--neeto-editor-gray-300));padding-block:8px;padding-inline:12px;position:relative;text-align:start}.neeto-editor-content table td:first-child,.neeto-editor-content table th:first-child{border-inline-start: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-inline-start:3px;text-decoration:none}.neeto-editor__image-wrapper.neeto-editor__image--bordered img,.neeto-editor__image-wrapper.neeto-editor__image--bordered video{border:1px solid #e4e4e7;border-color:rgba(var(--neeto-editor-content-image-border-color));border-radius:8px;border-radius:var(--neeto-editor-content-image-border-radius)}.neeto-editor__image-wrapper figure{cursor:pointer;display:inline-block;margin:0;max-width:100%;overflow:hidden;position:relative;vertical-align:top}.neeto-editor__image-wrapper .neeto-editor__image{display:inline-block;height:auto!important;max-width:100%;min-height:52px;vertical-align:top}.neeto-editor__image-wrapper .neeto-editor__image img,.neeto-editor__image-wrapper .neeto-editor__image video{display:inline-block;height:auto;vertical-align:top!important;width:100%}.neeto-editor__image-wrapper .neeto-editor__image img.hidden,.neeto-editor__image-wrapper .neeto-editor__image video.hidden{display:none}.neeto-editor__image-wrapper .neeto-editor__image img{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])),.neeto-editor__image-wrapper:has(video:not([src]):not(:has(source[src]))){display:none}.neeto-editor-content figcaption{color:#6b7280;font-size:.875rem;font-weight:400;line-height:1.4;max-width:100%;text-align:center}.neeto-editor__image--left{justify-content:flex-start}.neeto-editor__image--center{justify-content:center}.neeto-editor__image--right{justify-content:flex-end}.selected-text{background-color:#d8dcde;background-color:rgb(var(--neeto-editor-gray-300));padding-block:2px;padding-inline:0}.ne-image-preview-wrapper{align-items:center;background:rgba(16,24,40,.5);background:rgba(var(--neeto-editor-gray-800),.5);display:none;height:100%;inset-inline-start:0;justify-content:center;position:fixed;top:0;width:100%;z-index:999999}.ne-image-preview-wrapper.active{display:flex}.ne-image-preview-wrapper .ne-image-preview{background:#fff;background:rgb(var(--neeto-editor-white));display:flex;flex-direction:column;gap:10px;max-height:90vh;max-width:60vw;opacity:0;transition:opacity .1s ease-in-out}.ne-image-preview-wrapper .ne-image-preview img{background:#fff;background:rgb(var(--neeto-editor-white));max-height:100%;max-width:100%;-o-object-fit:contain;object-fit:contain;overflow:hidden;padding:10px;width:-moz-fit-content;width:fit-content}.ne-image-preview-wrapper .ne-image-preview.image-loaded{align-items:center;background:transparent;border-radius:10px;display:flex;opacity:1}.ne-image-preview-wrapper .ne-image-preview__caption{color:#101828;color:rgb(var(--neeto-editor-gray-800));line-height:1.5;margin-top:auto;text-align:center;width:100%}.ne-image-preview-wrapper .close-button{align-items:center;background-color:#fff;background-color:rgb(var(--neeto-editor-white));border-radius:999px;border-radius:var(--neeto-editor-rounded-full);cursor:pointer;display:flex;height:30px;inset-inline-end:12px;justify-content:center;position:absolute;top:12px;width:30px}.ne-image-preview-wrapper .image-preview{max-height:70%;max-width:70%}.ne-image-preview-wrapper__spinner{position:absolute}.ne-image-preview-wrapper__spinner i{background-color:#d8dcde;background-color:rgb(var(--neeto-editor-gray-300))}";
|
|
45
|
+
injectCss.n(css,{});
|
|
46
|
+
|
|
45
47
|
var ImagePreview = function ImagePreview(_ref) {
|
|
46
48
|
var imagePreviewDetails = _ref.imagePreviewDetails,
|
|
47
49
|
setImagePreviewDetails = _ref.setImagePreviewDetails;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditorContent.cjs.js","sources":["../../src/components/EditorContent/ImagePreview.jsx","../../src/components/EditorContent/utils/headers.js","../../src/components/EditorContent/utils/todoCheckbox.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 if (!imagePreviewRef.current) return;\n\n imagePreviewRef.current.setAttribute(\"tabindex\", \"-1\");\n imagePreviewRef.current.focus();\n }, []);\n\n const handleKeyDown = e => {\n e.stopPropagation();\n e.key === \"Escape\" && setImagePreviewDetails(null);\n };\n\n return createPortal(\n <div className=\"ne-image-preview-wrapper active\">\n {isLoading && <Spinner className=\"ne-image-preview-wrapper__spinner\" />}\n {!isLoading && (\n <div className=\"close-button\">\n <Button\n icon={Close}\n style=\"secondary\"\n onClick={() => setImagePreviewDetails(null)}\n />\n </div>\n )}\n <div\n className={classnames(\"ne-image-preview\", {\n \"image-loaded\": !isLoading,\n })}\n >\n <img\n alt={t(\"neetoEditor.editorContent.imagePreviewAltText\")}\n ref={imagePreviewRef}\n src={imagePreviewDetails.src}\n onKeyDown={handleKeyDown}\n onLoad={() => setIsLoading(false)}\n />\n {imagePreviewDetails && (\n <p className=\"ne-image-preview__caption\">\n {imagePreviewDetails.caption}\n </p>\n )}\n </div>\n </div>,\n document.body\n );\n};\n\nexport default ImagePreview;\n","const buildLinkSVG = () => {\n const svgNS = \"http://www.w3.org/2000/svg\";\n\n const svgWrapper = document.createElement(\"span\");\n svgWrapper.classList.add(\"header-link-icon-wrapper\");\n const svg = document.createElementNS(svgNS, \"svg\");\n svg.setAttribute(\"aria-hidden\", \"true\");\n svg.setAttribute(\"height\", \"20\");\n svg.setAttribute(\"viewBox\", \"0 0 16 16\");\n svg.setAttribute(\"width\", \"20\");\n\n const path = document.createElementNS(svgNS, \"path\");\n path.setAttribute(\n \"d\",\n \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n );\n\n svg.appendChild(path);\n svgWrapper.appendChild(svg);\n\n return svgWrapper;\n};\n\nconst convertTextToId = text =>\n text\n .trim()\n .toLowerCase()\n .replace(/[^a-z0-9\\s]/g, \"\")\n .replace(/\\s+/g, \"-\");\n\nexport const buildHeaderLinks = editorContentNode => {\n const headerTags = editorContentNode.querySelectorAll(\n \"h1, h2, h3, h4, h5, h6\"\n );\n const usedIds = new Map();\n\n headerTags.forEach(heading => {\n if (heading.getAttribute(\"data-link\") === \"false\") {\n return;\n }\n\n let headingId = convertTextToId(heading.textContent);\n if (usedIds.has(headingId)) {\n const count = usedIds.get(headingId);\n usedIds.set(headingId, count + 1);\n headingId = `${headingId}-${count}`;\n } else usedIds.set(headingId, 1);\n\n heading.setAttribute(\"id\", headingId);\n\n const wrapper = document.createElement(\"div\");\n const anchor = document.createElement(\"a\");\n\n wrapper.classList.add(\"header-wrapper\");\n anchor.setAttribute(\"href\", `#${headingId}`);\n anchor.classList.add(\"header-wrapper__link\");\n anchor.appendChild(buildLinkSVG());\n\n wrapper.appendChild(heading.cloneNode(true));\n wrapper.appendChild(anchor);\n heading.replaceWith(wrapper);\n });\n};\n","export const handleTodoCheckboxClick = (event, editorContentRef, onChange) => {\n if (\n !(\n event.target.type === \"checkbox\" &&\n event.target.closest('ul[data-type=\"todoList\"] li[data-type=\"taskItem\"]')\n )\n ) {\n return;\n }\n\n const checkbox = event.target;\n const listItem = checkbox.closest(\"li\");\n\n if (listItem) {\n listItem.setAttribute(\"data-checked\", checkbox.checked.toString());\n\n if (checkbox.checked) {\n checkbox.setAttribute(\"checked\", \"checked\");\n } else {\n checkbox.removeAttribute(\"checked\");\n }\n\n onChange?.(editorContentRef?.innerHTML);\n }\n};\n\nexport const syncTodoCheckboxStates = editorContentRef => {\n if (!editorContentRef) return;\n\n const todoItems = editorContentRef.querySelectorAll(\n `ul[data-type=\"todoList\"] li[data-type=\"taskItem\"]`\n );\n\n todoItems.forEach(listItem => {\n const isChecked = listItem.getAttribute(\"data-checked\") === \"true\";\n const checkbox = listItem.querySelector('input[type=\"checkbox\"]');\n\n if (checkbox) {\n checkbox.checked = isChecked;\n\n if (isChecked) {\n checkbox.setAttribute(\"checked\", \"checked\");\n } else {\n checkbox.removeAttribute(\"checked\");\n }\n }\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\";\nimport { removeEmptyTags } from \"utils\";\n\nimport {\n EDITOR_CONTENT_CLASS_NAME,\n EDITOR_CONTENT_DEFAULT_CONFIGURATION,\n SANITIZE_OPTIONS,\n} from \"./constants\";\nimport ImagePreview from \"./ImagePreview\";\nimport {\n substituteVariables,\n applyLineHighlighting,\n applySyntaxHighlightingAndLineNumbers,\n convertPlainTextToHtml,\n} from \"./utils\";\nimport { buildHeaderLinks } from \"./utils/headers\";\nimport {\n handleTodoCheckboxClick,\n syncTodoCheckboxStates,\n} from \"./utils/todoCheckbox\";\n\nconst EditorContent = ({\n content = \"\",\n variables = [],\n className,\n size = EDITOR_SIZES.SMALL,\n configuration = EDITOR_CONTENT_DEFAULT_CONFIGURATION,\n onChange,\n onClick,\n ...otherProps\n}) => {\n const [imagePreviewDetails, setImagePreviewDetails] = useState(null);\n const editorContentRef = useRef(null);\n\n const htmlContent = convertPlainTextToHtml(\n substituteVariables(\n applySyntaxHighlightingAndLineNumbers(removeEmptyTags(content)),\n variables\n )\n );\n const sanitize = DOMPurify.sanitize;\n\n const handleContentClick = event => {\n handleTodoCheckboxClick(event, editorContentRef.current, onChange);\n\n onClick?.(event);\n };\n\n const injectCopyButtonToCodeBlocks = () => {\n const preTags = editorContentRef.current?.querySelectorAll(\n `.${EDITOR_CONTENT_CLASS_NAME} pre`\n );\n\n preTags.forEach(preTag => {\n const button = document.createElement(\"div\");\n button.className = \"neeto-editor-codeblock-options\";\n const root = createRoot(button);\n root.render(\n <CopyToClipboardButton\n size=\"small\"\n style=\"tertiary\"\n value={preTag.textContent}\n />\n );\n preTag.appendChild(button);\n });\n };\n\n const bindImageClickListener = () => {\n const figureTags = editorContentRef.current?.querySelectorAll(\n `.${EDITOR_CONTENT_CLASS_NAME} figure`\n );\n\n figureTags.forEach(figureTag => {\n const image = figureTag.querySelector(\"img\");\n const link = figureTag.querySelector(\"a\");\n if (isNil(image) || isNil(link)) return;\n\n figureTag.addEventListener(\"click\", event => {\n event.preventDefault();\n const caption = figureTag.querySelector(\"figcaption\").innerText;\n setImagePreviewDetails({ src: image.src, caption });\n });\n });\n };\n\n useEffect(() => {\n injectCopyButtonToCodeBlocks();\n bindImageClickListener();\n syncTodoCheckboxStates(editorContentRef.current);\n applyLineHighlighting(editorContentRef.current);\n configuration.enableHeaderLinks &&\n buildHeaderLinks(editorContentRef.current);\n }, [content]);\n\n return (\n <>\n <div\n data-testid=\"neeto-editor-content\"\n ref={editorContentRef}\n className={classnames(EDITOR_CONTENT_CLASS_NAME, {\n [className]: className,\n [`neeto-editor-size--${size}`]: true,\n })}\n dangerouslySetInnerHTML={{\n __html: sanitize(htmlContent, SANITIZE_OPTIONS),\n }}\n onClick={handleContentClick}\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","current","setAttribute","focus","handleKeyDown","e","stopPropagation","key","createPortal","_jsxs","className","children","_jsx","Spinner","Button","icon","Close","style","onClick","classnames","alt","ref","src","onKeyDown","onLoad","caption","document","body","buildLinkSVG","svgNS","svgWrapper","createElement","classList","add","svg","createElementNS","path","appendChild","convertTextToId","text","trim","toLowerCase","replace","buildHeaderLinks","editorContentNode","headerTags","querySelectorAll","usedIds","Map","forEach","heading","getAttribute","headingId","textContent","has","count","get","set","concat","wrapper","anchor","cloneNode","replaceWith","handleTodoCheckboxClick","event","editorContentRef","onChange","target","type","closest","checkbox","listItem","checked","toString","removeAttribute","innerHTML","syncTodoCheckboxStates","todoItems","isChecked","querySelector","EditorContent","_ref$content","content","_ref$variables","variables","_ref$size","size","EDITOR_SIZES","SMALL","_ref$configuration","configuration","EDITOR_CONTENT_DEFAULT_CONFIGURATION","otherProps","_objectWithoutProperties","_excluded","htmlContent","convertPlainTextToHtml","substituteVariables","applySyntaxHighlightingAndLineNumbers","removeEmptyTags","sanitize","DOMPurify","handleContentClick","injectCopyButtonToCodeBlocks","_editorContentRef$cur","preTags","EDITOR_CONTENT_CLASS_NAME","preTag","button","root","createRoot","render","CopyToClipboardButton","value","bindImageClickListener","_editorContentRef$cur2","figureTags","figureTag","image","link","isNil","addEventListener","preventDefault","innerText","applyLineHighlighting","enableHeaderLinks","_Fragment","_objectSpread","_defineProperty","dangerouslySetInnerHTML","__html","SANITIZE_OPTIONS","memo"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,IAAMA,YAAY,GAAG,SAAfA,YAAYA,CAAAC,IAAA,EAAwD;AAAA,EAAA,IAAlDC,mBAAmB,GAAAD,IAAA,CAAnBC,mBAAmB;IAAEC,sBAAsB,GAAAF,IAAA,CAAtBE,sBAAsB;AACjE,EAAA,IAAAC,SAAA,G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,cACEC,cAAA,CAAA,KAAA,EAAAmH,aAAA,CAAA;AACE,MAAA,aAAA,EAAY,sBAAsB;AAClC1G,MAAAA,GAAG,EAAE4C,gBAAiB;AACtBvD,MAAAA,SAAS,EAAES,2BAAU,CAACuF,gCAAyB,EAAAsB,gCAAA,CAAAA,gCAAA,CAAA,EAAA,EAC5CtH,SAAS,EAAGA,SAAS,yBAAAgD,MAAA,CACC4B,IAAI,CAAA,EAAK,IAAI,CACrC,CAAE;AACH2C,MAAAA,uBAAuB,EAAE;AACvBC,QAAAA,MAAM,EAAE9B,QAAQ,CAACL,WAAW,EAAEoC,uBAAgB;OAC9C;AACFjH,MAAAA,OAAO,EAAEoF;KAAmB,EACxBV,UAAU,CACf,CAAC,EACD3G,mBAAmB,iBAClB2B,cAAA,CAAC7B,YAAY,EAAA;AAAOE,MAAAA,mBAAmB,EAAnBA,mBAAmB;AAAEC,MAAAA,sBAAsB,EAAtBA;AAAsB,KAAK,CACrE;AAAA,GACD,CAAC;AAEP,CAAC;AAED,YAAA,aAAekJ,UAAI,CAACpD,aAAa,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"EditorContent.cjs.js","sources":["../../src/components/EditorContent/ImagePreview.jsx","../../src/components/EditorContent/utils/headers.js","../../src/components/EditorContent/utils/todoCheckbox.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 if (!imagePreviewRef.current) return;\n\n imagePreviewRef.current.setAttribute(\"tabindex\", \"-1\");\n imagePreviewRef.current.focus();\n }, []);\n\n const handleKeyDown = e => {\n e.stopPropagation();\n e.key === \"Escape\" && setImagePreviewDetails(null);\n };\n\n return createPortal(\n <div className=\"ne-image-preview-wrapper active\">\n {isLoading && <Spinner className=\"ne-image-preview-wrapper__spinner\" />}\n {!isLoading && (\n <div className=\"close-button\">\n <Button\n icon={Close}\n style=\"secondary\"\n onClick={() => setImagePreviewDetails(null)}\n />\n </div>\n )}\n <div\n className={classnames(\"ne-image-preview\", {\n \"image-loaded\": !isLoading,\n })}\n >\n <img\n alt={t(\"neetoEditor.editorContent.imagePreviewAltText\")}\n ref={imagePreviewRef}\n src={imagePreviewDetails.src}\n onKeyDown={handleKeyDown}\n onLoad={() => setIsLoading(false)}\n />\n {imagePreviewDetails && (\n <p className=\"ne-image-preview__caption\">\n {imagePreviewDetails.caption}\n </p>\n )}\n </div>\n </div>,\n document.body\n );\n};\n\nexport default ImagePreview;\n","const buildLinkSVG = () => {\n const svgNS = \"http://www.w3.org/2000/svg\";\n\n const svgWrapper = document.createElement(\"span\");\n svgWrapper.classList.add(\"header-link-icon-wrapper\");\n const svg = document.createElementNS(svgNS, \"svg\");\n svg.setAttribute(\"aria-hidden\", \"true\");\n svg.setAttribute(\"height\", \"20\");\n svg.setAttribute(\"viewBox\", \"0 0 16 16\");\n svg.setAttribute(\"width\", \"20\");\n\n const path = document.createElementNS(svgNS, \"path\");\n path.setAttribute(\n \"d\",\n \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n );\n\n svg.appendChild(path);\n svgWrapper.appendChild(svg);\n\n return svgWrapper;\n};\n\nconst convertTextToId = text =>\n text\n .trim()\n .toLowerCase()\n .replace(/[^a-z0-9\\s]/g, \"\")\n .replace(/\\s+/g, \"-\");\n\nexport const buildHeaderLinks = editorContentNode => {\n const headerTags = editorContentNode.querySelectorAll(\n \"h1, h2, h3, h4, h5, h6\"\n );\n const usedIds = new Map();\n\n headerTags.forEach(heading => {\n if (heading.getAttribute(\"data-link\") === \"false\") {\n return;\n }\n\n let headingId = convertTextToId(heading.textContent);\n if (usedIds.has(headingId)) {\n const count = usedIds.get(headingId);\n usedIds.set(headingId, count + 1);\n headingId = `${headingId}-${count}`;\n } else usedIds.set(headingId, 1);\n\n heading.setAttribute(\"id\", headingId);\n\n const wrapper = document.createElement(\"div\");\n const anchor = document.createElement(\"a\");\n\n wrapper.classList.add(\"header-wrapper\");\n anchor.setAttribute(\"href\", `#${headingId}`);\n anchor.classList.add(\"header-wrapper__link\");\n anchor.appendChild(buildLinkSVG());\n\n wrapper.appendChild(heading.cloneNode(true));\n wrapper.appendChild(anchor);\n heading.replaceWith(wrapper);\n });\n};\n","export const handleTodoCheckboxClick = (event, editorContentRef, onChange) => {\n if (\n !(\n event.target.type === \"checkbox\" &&\n event.target.closest('ul[data-type=\"todoList\"] li[data-type=\"taskItem\"]')\n )\n ) {\n return;\n }\n\n const checkbox = event.target;\n const listItem = checkbox.closest(\"li\");\n\n if (listItem) {\n listItem.setAttribute(\"data-checked\", checkbox.checked.toString());\n\n if (checkbox.checked) {\n checkbox.setAttribute(\"checked\", \"checked\");\n } else {\n checkbox.removeAttribute(\"checked\");\n }\n\n onChange?.(editorContentRef?.innerHTML);\n }\n};\n\nexport const syncTodoCheckboxStates = editorContentRef => {\n if (!editorContentRef) return;\n\n const todoItems = editorContentRef.querySelectorAll(\n `ul[data-type=\"todoList\"] li[data-type=\"taskItem\"]`\n );\n\n todoItems.forEach(listItem => {\n const isChecked = listItem.getAttribute(\"data-checked\") === \"true\";\n const checkbox = listItem.querySelector('input[type=\"checkbox\"]');\n\n if (checkbox) {\n checkbox.checked = isChecked;\n\n if (isChecked) {\n checkbox.setAttribute(\"checked\", \"checked\");\n } else {\n checkbox.removeAttribute(\"checked\");\n }\n }\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\";\nimport { removeEmptyTags } from \"utils\";\n\nimport {\n EDITOR_CONTENT_CLASS_NAME,\n EDITOR_CONTENT_DEFAULT_CONFIGURATION,\n SANITIZE_OPTIONS,\n} from \"./constants\";\nimport ImagePreview from \"./ImagePreview\";\nimport {\n substituteVariables,\n applyLineHighlighting,\n applySyntaxHighlightingAndLineNumbers,\n convertPlainTextToHtml,\n} from \"./utils\";\nimport { buildHeaderLinks } from \"./utils/headers\";\nimport {\n handleTodoCheckboxClick,\n syncTodoCheckboxStates,\n} from \"./utils/todoCheckbox\";\n\nconst EditorContent = ({\n content = \"\",\n variables = [],\n className,\n size = EDITOR_SIZES.SMALL,\n configuration = EDITOR_CONTENT_DEFAULT_CONFIGURATION,\n onChange,\n onClick,\n ...otherProps\n}) => {\n const [imagePreviewDetails, setImagePreviewDetails] = useState(null);\n const editorContentRef = useRef(null);\n\n const htmlContent = convertPlainTextToHtml(\n substituteVariables(\n applySyntaxHighlightingAndLineNumbers(removeEmptyTags(content)),\n variables\n )\n );\n const sanitize = DOMPurify.sanitize;\n\n const handleContentClick = event => {\n handleTodoCheckboxClick(event, editorContentRef.current, onChange);\n\n onClick?.(event);\n };\n\n const injectCopyButtonToCodeBlocks = () => {\n const preTags = editorContentRef.current?.querySelectorAll(\n `.${EDITOR_CONTENT_CLASS_NAME} pre`\n );\n\n preTags.forEach(preTag => {\n const button = document.createElement(\"div\");\n button.className = \"neeto-editor-codeblock-options\";\n const root = createRoot(button);\n root.render(\n <CopyToClipboardButton\n size=\"small\"\n style=\"tertiary\"\n value={preTag.textContent}\n />\n );\n preTag.appendChild(button);\n });\n };\n\n const bindImageClickListener = () => {\n const figureTags = editorContentRef.current?.querySelectorAll(\n `.${EDITOR_CONTENT_CLASS_NAME} figure`\n );\n\n figureTags.forEach(figureTag => {\n const image = figureTag.querySelector(\"img\");\n const link = figureTag.querySelector(\"a\");\n if (isNil(image) || isNil(link)) return;\n\n figureTag.addEventListener(\"click\", event => {\n event.preventDefault();\n const caption = figureTag.querySelector(\"figcaption\").innerText;\n setImagePreviewDetails({ src: image.src, caption });\n });\n });\n };\n\n useEffect(() => {\n injectCopyButtonToCodeBlocks();\n bindImageClickListener();\n syncTodoCheckboxStates(editorContentRef.current);\n applyLineHighlighting(editorContentRef.current);\n configuration.enableHeaderLinks &&\n buildHeaderLinks(editorContentRef.current);\n }, [content]);\n\n return (\n <>\n <div\n data-testid=\"neeto-editor-content\"\n ref={editorContentRef}\n className={classnames(EDITOR_CONTENT_CLASS_NAME, {\n [className]: className,\n [`neeto-editor-size--${size}`]: true,\n })}\n dangerouslySetInnerHTML={{\n __html: sanitize(htmlContent, SANITIZE_OPTIONS),\n }}\n onClick={handleContentClick}\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","current","setAttribute","focus","handleKeyDown","e","stopPropagation","key","createPortal","_jsxs","className","children","_jsx","Spinner","Button","icon","Close","style","onClick","classnames","alt","ref","src","onKeyDown","onLoad","caption","document","body","buildLinkSVG","svgNS","svgWrapper","createElement","classList","add","svg","createElementNS","path","appendChild","convertTextToId","text","trim","toLowerCase","replace","buildHeaderLinks","editorContentNode","headerTags","querySelectorAll","usedIds","Map","forEach","heading","getAttribute","headingId","textContent","has","count","get","set","concat","wrapper","anchor","cloneNode","replaceWith","handleTodoCheckboxClick","event","editorContentRef","onChange","target","type","closest","checkbox","listItem","checked","toString","removeAttribute","innerHTML","syncTodoCheckboxStates","todoItems","isChecked","querySelector","EditorContent","_ref$content","content","_ref$variables","variables","_ref$size","size","EDITOR_SIZES","SMALL","_ref$configuration","configuration","EDITOR_CONTENT_DEFAULT_CONFIGURATION","otherProps","_objectWithoutProperties","_excluded","htmlContent","convertPlainTextToHtml","substituteVariables","applySyntaxHighlightingAndLineNumbers","removeEmptyTags","sanitize","DOMPurify","handleContentClick","injectCopyButtonToCodeBlocks","_editorContentRef$cur","preTags","EDITOR_CONTENT_CLASS_NAME","preTag","button","root","createRoot","render","CopyToClipboardButton","value","bindImageClickListener","_editorContentRef$cur2","figureTags","figureTag","image","link","isNil","addEventListener","preventDefault","innerText","applyLineHighlighting","enableHeaderLinks","_Fragment","_objectSpread","_defineProperty","dangerouslySetInnerHTML","__html","SANITIZE_OPTIONS","memo"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,IAAMA,YAAY,GAAG,SAAfA,YAAYA,CAAAC,IAAA,EAAwD;AAAA,EAAA,IAAlDC,mBAAmB,GAAAD,IAAA,CAAnBC,mBAAmB;IAAEC,sBAAsB,GAAAF,IAAA,CAAtBE,sBAAsB;AACjE,EAAA,IAAAC,SAAA,GAAkCC,cAAQ,CAAC,IAAI,CAAC;IAAAC,UAAA,GAAAC,+BAAA,CAAAH,SAAA,EAAA,CAAA,CAAA;AAAzCI,IAAAA,SAAS,GAAAF,UAAA,CAAA,CAAA,CAAA;AAAEG,IAAAA,YAAY,GAAAH,UAAA,CAAA,CAAA,CAAA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,CAAA,EAAA,EAC5CtH,SAAS,EAAGA,SAAS,yBAAAgD,MAAA,CACC4B,IAAI,CAAA,EAAK,IAAI,CACrC,CAAE;AACH2C,MAAAA,uBAAuB,EAAE;AACvBC,QAAAA,MAAM,EAAE9B,QAAQ,CAACL,WAAW,EAAEoC,uBAAgB;OAC9C;AACFjH,MAAAA,OAAO,EAAEoF;KAAmB,EACxBV,UAAU,CACf,CAAC,EACD3G,mBAAmB,iBAClB2B,cAAA,CAAC7B,YAAY,EAAA;AAAOE,MAAAA,mBAAmB,EAAnBA,mBAAmB;AAAEC,MAAAA,sBAAsB,EAAtBA;AAAsB,KAAK,CACrE;AAAA,GACD,CAAC;AAEP,CAAC;AAED,YAAA,aAAekJ,UAAI,CAACpD,aAAa,CAAC;;;;"}
|
|
@@ -10,18 +10,17 @@ var Editor = require('./Editor.cjs.js');
|
|
|
10
10
|
var jsxRuntime = require('react/jsx-runtime');
|
|
11
11
|
require('@babel/runtime/helpers/toConsumableArray');
|
|
12
12
|
require('@babel/runtime/helpers/slicedToArray');
|
|
13
|
-
require('./chunk-
|
|
13
|
+
require('./chunk-Cv0ocaVh.cjs.js');
|
|
14
14
|
require('./chunk-eyfbjfPH.cjs.js');
|
|
15
15
|
require('tippy.js');
|
|
16
16
|
require('react-dom');
|
|
17
17
|
require('axios');
|
|
18
18
|
require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
19
19
|
require('zustand');
|
|
20
|
-
require('./chunk-B6qYtOJe.cjs.js');
|
|
21
20
|
require('classnames');
|
|
22
21
|
require('./chunk-2HrSPdAV.cjs.js');
|
|
23
22
|
require('@bigbinary/neetoui/Label');
|
|
24
|
-
require('./chunk-
|
|
23
|
+
require('./chunk-DOxH3Agq.cjs.js');
|
|
25
24
|
require('./chunk-De3nCFAF.cjs.js');
|
|
26
25
|
require('./chunk-BJu3ubxk.cjs.js');
|
|
27
26
|
require('@bigbinary/neeto-commons-frontend/initializers');
|
|
@@ -29,13 +28,14 @@ require('@babel/runtime/helpers/asyncToGenerator');
|
|
|
29
28
|
require('@babel/runtime/regenerator');
|
|
30
29
|
require('@tanstack/react-query');
|
|
31
30
|
require('yjs');
|
|
31
|
+
require('./chunk-B6qYtOJe.cjs.js');
|
|
32
32
|
require('./chunk-4ILtbNxB.cjs.js');
|
|
33
33
|
require('./chunk-BGy3NmZC.cjs.js');
|
|
34
34
|
require('i18next');
|
|
35
35
|
require('yup');
|
|
36
36
|
require('react-dom/server');
|
|
37
37
|
require('@bigbinary/neeto-icons/misc/Megaphone');
|
|
38
|
-
require('./chunk-
|
|
38
|
+
require('./chunk-BrQjqeiG.cjs.js');
|
|
39
39
|
require('@bigbinary/neeto-icons/TextH1');
|
|
40
40
|
require('@bigbinary/neeto-icons/TextH2');
|
|
41
41
|
require('@bigbinary/neeto-icons/TextH3');
|
|
@@ -133,8 +133,7 @@ require('@bigbinary/neeto-icons/MergeSplit');
|
|
|
133
133
|
require('@bigbinary/neeto-icons/ToggleHeaderRow');
|
|
134
134
|
require('@bigbinary/neeto-icons/Edit');
|
|
135
135
|
require('@bigbinary/neeto-icons/Articles');
|
|
136
|
-
require('./chunk-
|
|
137
|
-
require('./chunk-DcAwRABD.cjs.js');
|
|
136
|
+
require('./chunk-DRB71ojr.cjs.js');
|
|
138
137
|
require('@bigbinary/neeto-commons-frontend/react-utils/useOnClickOutside');
|
|
139
138
|
require('@bigbinary/neeto-icons/MenuVertical');
|
|
140
139
|
require('@bigbinary/neetoui/Alert');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormikEditor.cjs.js","sources":["../../src/components/Editor/FormikEditor.jsx"],"sourcesContent":["import { forwardRef, memo } from \"react\";\n\nimport { FastField } from \"formik\";\nimport { noop } from \"neetocist\";\nimport { path, pluck } from \"ramda\";\n\nimport Editor from \".\";\n\nconst FormikEditor = (\n {\n name,\n onChange = noop,\n shouldUpdate,\n attachments = [],\n mentions = [],\n variables = [],\n ...otherProps\n },\n ref\n) => {\n // Similar to the `shouldComponentUpdate` logic of FastField component.\n // https://github.com/jaredpalmer/formik/blob/main/packages/formik/src/FastField.tsx#L75-L93\n // Additionally calls the shouldUpdate function passed from the host application and compares to\n // the rest of the values.\n const internalShouldUpdate = (prevProps, nextProps) => {\n const prevFormikProps = prevProps.formik;\n const nextFormikProps = nextProps.formik;\n\n const pathParts = name.split(\".\");\n const prevError = path(pathParts, prevFormikProps.errors);\n const nextError = path(pathParts, nextFormikProps.errors);\n const prevTouched = path(pathParts, prevFormikProps.touched);\n const nextTouched = path(pathParts, nextFormikProps.touched);\n const prevAttachments = pluck(\"signedId\", prevProps.attachments).join(\"|\");\n const nextAttachments = pluck(\"signedId\", nextProps.attachments).join(\"|\");\n\n return (\n prevError !== nextError ||\n prevTouched !== nextTouched ||\n Object.keys(nextProps).length !== Object.keys(prevProps).length ||\n prevFormikProps.isSubmitting !== nextFormikProps.isSubmitting ||\n prevAttachments !== nextAttachments ||\n Boolean(shouldUpdate?.(prevProps, nextProps))\n );\n };\n\n return (\n <FastField\n {...{ attachments, mentions, name, variables }}\n shouldUpdate={internalShouldUpdate}\n >\n {({ field, form, meta }) => (\n <Editor\n {...{ attachments, mentions, name, ref, variables }}\n error={meta.touched ? meta.error : \"\"}\n initialValue={field.value}\n onBlur={() => {\n form.setFieldTouched(name, true);\n }}\n onChange={value => {\n form.setFieldValue(name, value);\n onChange?.(value);\n }}\n {...otherProps}\n />\n )}\n </FastField>\n );\n};\n\nFormikEditor.displayName = \"FormikNeetoEditor\";\n\nexport default memo(forwardRef(FormikEditor));\n"],"names":["FormikEditor","_ref","ref","name","_ref$onChange","onChange","noop","shouldUpdate","_ref$attachments","attachments","_ref$mentions","mentions","_ref$variables","variables","otherProps","_objectWithoutProperties","_excluded","internalShouldUpdate","prevProps","nextProps","prevFormikProps","formik","nextFormikProps","pathParts","split","prevError","path","errors","nextError","prevTouched","touched","nextTouched","prevAttachments","pluck","join","nextAttachments","Object","keys","length","isSubmitting","Boolean","_jsx","FastField","children","_ref2","field","form","meta","Editor","_objectSpread","error","initialValue","value","onBlur","setFieldTouched","setFieldValue","displayName","memo","forwardRef"],"mappings":"
|
|
1
|
+
{"version":3,"file":"FormikEditor.cjs.js","sources":["../../src/components/Editor/FormikEditor.jsx"],"sourcesContent":["import { forwardRef, memo } from \"react\";\n\nimport { FastField } from \"formik\";\nimport { noop } from \"neetocist\";\nimport { path, pluck } from \"ramda\";\n\nimport Editor from \".\";\n\nconst FormikEditor = (\n {\n name,\n onChange = noop,\n shouldUpdate,\n attachments = [],\n mentions = [],\n variables = [],\n ...otherProps\n },\n ref\n) => {\n // Similar to the `shouldComponentUpdate` logic of FastField component.\n // https://github.com/jaredpalmer/formik/blob/main/packages/formik/src/FastField.tsx#L75-L93\n // Additionally calls the shouldUpdate function passed from the host application and compares to\n // the rest of the values.\n const internalShouldUpdate = (prevProps, nextProps) => {\n const prevFormikProps = prevProps.formik;\n const nextFormikProps = nextProps.formik;\n\n const pathParts = name.split(\".\");\n const prevError = path(pathParts, prevFormikProps.errors);\n const nextError = path(pathParts, nextFormikProps.errors);\n const prevTouched = path(pathParts, prevFormikProps.touched);\n const nextTouched = path(pathParts, nextFormikProps.touched);\n const prevAttachments = pluck(\"signedId\", prevProps.attachments).join(\"|\");\n const nextAttachments = pluck(\"signedId\", nextProps.attachments).join(\"|\");\n\n return (\n prevError !== nextError ||\n prevTouched !== nextTouched ||\n Object.keys(nextProps).length !== Object.keys(prevProps).length ||\n prevFormikProps.isSubmitting !== nextFormikProps.isSubmitting ||\n prevAttachments !== nextAttachments ||\n Boolean(shouldUpdate?.(prevProps, nextProps))\n );\n };\n\n return (\n <FastField\n {...{ attachments, mentions, name, variables }}\n shouldUpdate={internalShouldUpdate}\n >\n {({ field, form, meta }) => (\n <Editor\n {...{ attachments, mentions, name, ref, variables }}\n error={meta.touched ? meta.error : \"\"}\n initialValue={field.value}\n onBlur={() => {\n form.setFieldTouched(name, true);\n }}\n onChange={value => {\n form.setFieldValue(name, value);\n onChange?.(value);\n }}\n {...otherProps}\n />\n )}\n </FastField>\n );\n};\n\nFormikEditor.displayName = \"FormikNeetoEditor\";\n\nexport default memo(forwardRef(FormikEditor));\n"],"names":["FormikEditor","_ref","ref","name","_ref$onChange","onChange","noop","shouldUpdate","_ref$attachments","attachments","_ref$mentions","mentions","_ref$variables","variables","otherProps","_objectWithoutProperties","_excluded","internalShouldUpdate","prevProps","nextProps","prevFormikProps","formik","nextFormikProps","pathParts","split","prevError","path","errors","nextError","prevTouched","touched","nextTouched","prevAttachments","pluck","join","nextAttachments","Object","keys","length","isSubmitting","Boolean","_jsx","FastField","children","_ref2","field","form","meta","Editor","_objectSpread","error","initialValue","value","onBlur","setFieldTouched","setFieldValue","displayName","memo","forwardRef"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,IAAMA,YAAY,GAAG,SAAfA,YAAYA,CAAAC,IAAA,EAUhBC,GAAG,EACA;AAAA,EAAA,IATDC,IAAI,GAAAF,IAAA,CAAJE,IAAI;IAAAC,aAAA,GAAAH,IAAA,CACJI,QAAQ;AAARA,IAAAA,SAAQ,GAAAD,aAAA,KAAA,MAAA,GAAGE,cAAI,GAAAF,aAAA;IACfG,YAAY,GAAAN,IAAA,CAAZM,YAAY;IAAAC,gBAAA,GAAAP,IAAA,CACZQ,WAAW;AAAXA,IAAAA,WAAW,GAAAD,gBAAA,KAAA,MAAA,GAAG,EAAE,GAAAA,gBAAA;IAAAE,aAAA,GAAAT,IAAA,CAChBU,QAAQ;AAARA,IAAAA,QAAQ,GAAAD,aAAA,KAAA,MAAA,GAAG,EAAE,GAAAA,aAAA;IAAAE,cAAA,GAAAX,IAAA,CACbY,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAA,MAAA,GAAG,EAAE,GAAAA,cAAA;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,aAAeC,UAAI,cAACC,gBAAU,CAAC1D,YAAY,CAAC,CAAC;;;;"}
|
package/dist/cjs/Menu.cjs.js
CHANGED
|
@@ -5,16 +5,9 @@ require('@babel/runtime/helpers/toConsumableArray');
|
|
|
5
5
|
require('@babel/runtime/helpers/slicedToArray');
|
|
6
6
|
require('react');
|
|
7
7
|
require('ramda');
|
|
8
|
-
require('./chunk-
|
|
9
|
-
var Menu = require('./chunk-UnFuCCxl.cjs.js');
|
|
8
|
+
var Menu = require('./chunk-BrQjqeiG.cjs.js');
|
|
10
9
|
require('./chunk-BGy3NmZC.cjs.js');
|
|
11
10
|
require('react/jsx-runtime');
|
|
12
|
-
require('./chunk-eyfbjfPH.cjs.js');
|
|
13
|
-
require('tippy.js');
|
|
14
|
-
require('react-dom');
|
|
15
|
-
require('axios');
|
|
16
|
-
require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
17
|
-
require('zustand');
|
|
18
11
|
require('./chunk-B6qYtOJe.cjs.js');
|
|
19
12
|
require('i18next');
|
|
20
13
|
require('@bigbinary/neeto-icons/TextH1');
|
|
@@ -23,6 +16,13 @@ require('@bigbinary/neeto-icons/TextH3');
|
|
|
23
16
|
require('@bigbinary/neeto-icons/TextH4');
|
|
24
17
|
require('@bigbinary/neeto-icons/TextH5');
|
|
25
18
|
require('@bigbinary/neeto-icons/TextP');
|
|
19
|
+
require('./chunk-Cv0ocaVh.cjs.js');
|
|
20
|
+
require('./chunk-eyfbjfPH.cjs.js');
|
|
21
|
+
require('tippy.js');
|
|
22
|
+
require('react-dom');
|
|
23
|
+
require('axios');
|
|
24
|
+
require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
25
|
+
require('zustand');
|
|
26
26
|
require('classnames');
|
|
27
27
|
require('./chunk-2HrSPdAV.cjs.js');
|
|
28
28
|
require('@bigbinary/neeto-cist');
|
|
@@ -11,7 +11,7 @@ var ramda = require('ramda');
|
|
|
11
11
|
var index = require('./chunk-C-VxABfm.cjs.js');
|
|
12
12
|
var reactI18next = require('react-i18next');
|
|
13
13
|
var FileIcon = require('./chunk-yX0BlnxV.cjs.js');
|
|
14
|
-
var Attachments = require('./chunk-
|
|
14
|
+
var Attachments = require('./chunk-DRB71ojr.cjs.js');
|
|
15
15
|
var jsxRuntime = require('react/jsx-runtime');
|
|
16
16
|
require('./chunk-BJu3ubxk.cjs.js');
|
|
17
17
|
require('@babel/runtime/helpers/toConsumableArray');
|
|
@@ -45,7 +45,6 @@ require('@bigbinary/neeto-commons-frontend/initializers');
|
|
|
45
45
|
require('yup');
|
|
46
46
|
require('./chunk-2HrSPdAV.cjs.js');
|
|
47
47
|
require('classnames');
|
|
48
|
-
require('./chunk-DcAwRABD.cjs.js');
|
|
49
48
|
require('./chunk-B6qYtOJe.cjs.js');
|
|
50
49
|
require('@bigbinary/neeto-commons-frontend/react-utils/useOnClickOutside');
|
|
51
50
|
require('@bigbinary/neeto-commons-frontend/utils');
|
|
@@ -211,4 +210,4 @@ var Preview = function Preview(_ref) {
|
|
|
211
210
|
};
|
|
212
211
|
|
|
213
212
|
exports.default = Preview;
|
|
214
|
-
//# sourceMappingURL=chunk-
|
|
213
|
+
//# sourceMappingURL=chunk-BYyLrDTW.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk-ByqRrEfj.cjs.js","sources":["../../src/components/Attachments/Preview.jsx"],"sourcesContent":["import { useEffect, useRef } from \"react\";\n\nimport { findIndexBy, truncate } from \"neetocist\";\nimport { Left, Right } from \"neetoicons\";\nimport { Modal, Typography, Button } from \"neetoui\";\nimport { isEmpty } from \"ramda\";\nimport DocViewer, { DocViewerRenderers } from \"react-doc-viewer\";\nimport { Trans, useTranslation } from \"react-i18next\";\n\nimport { convertToFileSize } from \"components/Editor/MediaUploader/utils\";\n\nimport { ATTACHMENTS_PREVIEW_DATA_CY } from \"./constants\";\nimport { checkPreviewAvailability, downloadFile } from \"./utils\";\n\nconst Preview = ({\n onClose,\n attachments,\n selectedAttachment,\n setSelectedAttachment,\n setDidFetchPreviewBundle,\n}) => {\n const { t } = useTranslation();\n const downloadRef = useRef(null);\n\n const {\n filename = \"\",\n contentType = null,\n url = \"\",\n signedId = \"\",\n size = undefined,\n } = selectedAttachment;\n\n const attachmentIndex = findIndexBy({ signedId }, attachments);\n\n const handleRightArrowClick = () => {\n const newIndex = (attachmentIndex + 1) % attachments.length;\n setSelectedAttachment(attachments[newIndex]);\n downloadRef.current?.focus();\n };\n\n const handleLeftArrowClick = () => {\n const newIndex =\n (attachmentIndex - 1 + attachments.length) % attachments.length;\n setSelectedAttachment(attachments[newIndex]);\n downloadRef.current?.focus();\n };\n\n const handleKeyDown = event => {\n if (event.key === \"ArrowRight\") {\n handleRightArrowClick();\n } else if (event.key === \"ArrowLeft\") {\n handleLeftArrowClick();\n }\n };\n\n useEffect(() => {\n setDidFetchPreviewBundle(true);\n }, []);\n\n const handleDownload = () => downloadFile(url, filename);\n\n const setPreview = () => {\n const isPreviewAvailable = checkPreviewAvailability(contentType);\n\n if (isPreviewAvailable) {\n switch (contentType.split(\"/\")[0]) {\n case \"image\":\n return <img data-testid={ATTACHMENTS_PREVIEW_DATA_CY} src={url} />;\n case \"video\":\n return (\n <video controls data-testid={ATTACHMENTS_PREVIEW_DATA_CY} src={url} />\n );\n case \"application\":\n case \"text\":\n if (contentType === \"application/pdf\") {\n return (\n <iframe\n data-testid={ATTACHMENTS_PREVIEW_DATA_CY}\n src={url}\n width=\"100%\"\n />\n );\n }\n\n return (\n <DocViewer\n className=\"ne-attachments-preview__body-docviewer\"\n data-testid={ATTACHMENTS_PREVIEW_DATA_CY}\n documents={[{ uri: url, fileType: contentType }]}\n pluginRenderers={DocViewerRenderers}\n config={{\n header: { disableHeader: true, disableFileName: true },\n }}\n />\n );\n default:\n return null;\n }\n }\n\n return (\n <Typography>\n <Trans\n i18nKey=\"neetoEditor.attachments.noPreview\"\n components={{\n span: (\n <span\n className=\"ne-attachments-preview__body-download\"\n onClick={handleDownload}\n />\n ),\n }}\n />\n </Typography>\n );\n };\n\n return (\n <Modal\n {...{ onClose }}\n className=\"ne-attachments-preview\"\n isOpen={!isEmpty(selectedAttachment)}\n size=\"fullScreen\"\n onKeyDown={handleKeyDown}\n >\n <Modal.Header className=\"ne-attachments-preview__header\">\n <div className=\"ne-attachments-preview__header__fileinfo\">\n <Typography style=\"h4\">{truncate(filename, 25)}</Typography>\n <Typography style=\"body2\">{convertToFileSize(size)}</Typography>\n </div>\n <Button\n label={t(\"neetoEditor.common.download\")}\n ref={downloadRef}\n style=\"link\"\n onClick={handleDownload}\n />\n </Modal.Header>\n <Modal.Body className=\"ne-attachments-preview__body\">\n <Button\n className=\"ne-attachments-preview__body-left\"\n icon={Left}\n size=\"large\"\n style=\"tertiary\"\n onClick={handleLeftArrowClick}\n />\n <Button\n className=\"ne-attachments-preview__body-right\"\n icon={Right}\n size=\"large\"\n style=\"tertiary\"\n onClick={handleRightArrowClick}\n />\n {setPreview()}\n </Modal.Body>\n </Modal>\n );\n};\n\nexport default Preview;\n"],"names":["Preview","_ref","onClose","attachments","selectedAttachment","setSelectedAttachment","setDidFetchPreviewBundle","_useTranslation","useTranslation","t","downloadRef","useRef","_selectedAttachment$f","filename","_selectedAttachment$c","contentType","_selectedAttachment$u","url","_selectedAttachment$s","signedId","_selectedAttachment$s2","size","undefined","attachmentIndex","findIndexBy","handleRightArrowClick","_downloadRef$current","newIndex","length","current","focus","handleLeftArrowClick","_downloadRef$current2","handleKeyDown","event","key","useEffect","handleDownload","downloadFile","setPreview","isPreviewAvailable","checkPreviewAvailability","split","_jsx","ATTACHMENTS_PREVIEW_DATA_CY","src","controls","width","DocViewer","className","documents","uri","fileType","pluginRenderers","DocViewerRenderers","config","header","disableHeader","disableFileName","Typography","children","Trans","i18nKey","components","span","onClick","_jsxs","Modal","isOpen","isEmpty","onKeyDown","Header","style","truncate","convertToFileSize","Button","label","ref","Body","icon","Left","Right"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAAe,OACzB,CAAC;AAAA,KACU,CAAC,eACf6B,eAAA,CAACC,sBAAK,CAACW,IAAI,EAAA;AAAC7B,MAAAA,SAAS,EAAC,8BAA8B;MAAAW,QAAA,EAAA,cAClDjB,cAAA,CAACgC,uBAAM,EAAA;AACL1B,QAAAA,SAAS,EAAC,mCAAmC;AAC7C8B,QAAAA,IAAI,EAAEC,qBAAK;AACX3D,QAAAA,IAAI,EAAC,OAAO;AACZmD,QAAAA,KAAK,EAAC,UAAU;AAChBP,QAAAA,OAAO,EAAElC;AAAqB,OAC/B,CAAC,eACFY,cAAA,CAACgC,uBAAM,EAAA;AACL1B,QAAAA,SAAS,EAAC,oCAAoC;AAC9C8B,QAAAA,IAAI,EAAEE,sBAAM;AACZ5D,QAAAA,IAAI,EAAC,OAAO;AACZmD,QAAAA,KAAK,EAAC,UAAU;AAChBP,QAAAA,OAAO,EAAExC;AAAsB,OAChC,CAAC,EACDc,UAAU,EAAE;AAAA,KACH,CAAC;AAAA,GACR,CAAC;AAEZ;;;;"}
|
|
1
|
+
{"version":3,"file":"chunk-BYyLrDTW.cjs.js","sources":["../../src/components/Attachments/Preview.jsx"],"sourcesContent":["import { useEffect, useRef } from \"react\";\n\nimport { findIndexBy, truncate } from \"neetocist\";\nimport { Left, Right } from \"neetoicons\";\nimport { Modal, Typography, Button } from \"neetoui\";\nimport { isEmpty } from \"ramda\";\nimport DocViewer, { DocViewerRenderers } from \"react-doc-viewer\";\nimport { Trans, useTranslation } from \"react-i18next\";\n\nimport { convertToFileSize } from \"components/Editor/MediaUploader/utils\";\n\nimport { ATTACHMENTS_PREVIEW_DATA_CY } from \"./constants\";\nimport { checkPreviewAvailability, downloadFile } from \"./utils\";\n\nconst Preview = ({\n onClose,\n attachments,\n selectedAttachment,\n setSelectedAttachment,\n setDidFetchPreviewBundle,\n}) => {\n const { t } = useTranslation();\n const downloadRef = useRef(null);\n\n const {\n filename = \"\",\n contentType = null,\n url = \"\",\n signedId = \"\",\n size = undefined,\n } = selectedAttachment;\n\n const attachmentIndex = findIndexBy({ signedId }, attachments);\n\n const handleRightArrowClick = () => {\n const newIndex = (attachmentIndex + 1) % attachments.length;\n setSelectedAttachment(attachments[newIndex]);\n downloadRef.current?.focus();\n };\n\n const handleLeftArrowClick = () => {\n const newIndex =\n (attachmentIndex - 1 + attachments.length) % attachments.length;\n setSelectedAttachment(attachments[newIndex]);\n downloadRef.current?.focus();\n };\n\n const handleKeyDown = event => {\n if (event.key === \"ArrowRight\") {\n handleRightArrowClick();\n } else if (event.key === \"ArrowLeft\") {\n handleLeftArrowClick();\n }\n };\n\n useEffect(() => {\n setDidFetchPreviewBundle(true);\n }, []);\n\n const handleDownload = () => downloadFile(url, filename);\n\n const setPreview = () => {\n const isPreviewAvailable = checkPreviewAvailability(contentType);\n\n if (isPreviewAvailable) {\n switch (contentType.split(\"/\")[0]) {\n case \"image\":\n return <img data-testid={ATTACHMENTS_PREVIEW_DATA_CY} src={url} />;\n case \"video\":\n return (\n <video controls data-testid={ATTACHMENTS_PREVIEW_DATA_CY} src={url} />\n );\n case \"application\":\n case \"text\":\n if (contentType === \"application/pdf\") {\n return (\n <iframe\n data-testid={ATTACHMENTS_PREVIEW_DATA_CY}\n src={url}\n width=\"100%\"\n />\n );\n }\n\n return (\n <DocViewer\n className=\"ne-attachments-preview__body-docviewer\"\n data-testid={ATTACHMENTS_PREVIEW_DATA_CY}\n documents={[{ uri: url, fileType: contentType }]}\n pluginRenderers={DocViewerRenderers}\n config={{\n header: { disableHeader: true, disableFileName: true },\n }}\n />\n );\n default:\n return null;\n }\n }\n\n return (\n <Typography>\n <Trans\n i18nKey=\"neetoEditor.attachments.noPreview\"\n components={{\n span: (\n <span\n className=\"ne-attachments-preview__body-download\"\n onClick={handleDownload}\n />\n ),\n }}\n />\n </Typography>\n );\n };\n\n return (\n <Modal\n {...{ onClose }}\n className=\"ne-attachments-preview\"\n isOpen={!isEmpty(selectedAttachment)}\n size=\"fullScreen\"\n onKeyDown={handleKeyDown}\n >\n <Modal.Header className=\"ne-attachments-preview__header\">\n <div className=\"ne-attachments-preview__header__fileinfo\">\n <Typography style=\"h4\">{truncate(filename, 25)}</Typography>\n <Typography style=\"body2\">{convertToFileSize(size)}</Typography>\n </div>\n <Button\n label={t(\"neetoEditor.common.download\")}\n ref={downloadRef}\n style=\"link\"\n onClick={handleDownload}\n />\n </Modal.Header>\n <Modal.Body className=\"ne-attachments-preview__body\">\n <Button\n className=\"ne-attachments-preview__body-left\"\n icon={Left}\n size=\"large\"\n style=\"tertiary\"\n onClick={handleLeftArrowClick}\n />\n <Button\n className=\"ne-attachments-preview__body-right\"\n icon={Right}\n size=\"large\"\n style=\"tertiary\"\n onClick={handleRightArrowClick}\n />\n {setPreview()}\n </Modal.Body>\n </Modal>\n );\n};\n\nexport default Preview;\n"],"names":["Preview","_ref","onClose","attachments","selectedAttachment","setSelectedAttachment","setDidFetchPreviewBundle","_useTranslation","useTranslation","t","downloadRef","useRef","_selectedAttachment$f","filename","_selectedAttachment$c","contentType","_selectedAttachment$u","url","_selectedAttachment$s","signedId","_selectedAttachment$s2","size","undefined","attachmentIndex","findIndexBy","handleRightArrowClick","_downloadRef$current","newIndex","length","current","focus","handleLeftArrowClick","_downloadRef$current2","handleKeyDown","event","key","useEffect","handleDownload","downloadFile","setPreview","isPreviewAvailable","checkPreviewAvailability","split","_jsx","ATTACHMENTS_PREVIEW_DATA_CY","src","controls","width","DocViewer","className","documents","uri","fileType","pluginRenderers","DocViewerRenderers","config","header","disableHeader","disableFileName","Typography","children","Trans","i18nKey","components","span","onClick","_jsxs","Modal","isOpen","isEmpty","onKeyDown","Header","style","truncate","convertToFileSize","Button","label","ref","Body","icon","Left","Right"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,IAAMA,OAAO,GAAG,SAAVA,OAAOA,CAAAC,IAAA,EAMP;AAAA,EAAA,IALJC,OAAO,GAAAD,IAAA,CAAP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AA,cAClDjB,cAAA,CAACgC,uBAAM,EAAA;AACL1B,QAAAA,SAAS,EAAC,mCAAmC;AAC7C8B,QAAAA,IAAI,EAAEC,qBAAK;AACX3D,QAAAA,IAAI,EAAC,OAAO;AACZmD,QAAAA,KAAK,EAAC,UAAU;AAChBP,QAAAA,OAAO,EAAElC;AAAqB,OAC/B,CAAC,eACFY,cAAA,CAACgC,uBAAM,EAAA;AACL1B,QAAAA,SAAS,EAAC,oCAAoC;AAC9C8B,QAAAA,IAAI,EAAEE,sBAAM;AACZ5D,QAAAA,IAAI,EAAC,OAAO;AACZmD,QAAAA,KAAK,EAAC,UAAU;AAChBP,QAAAA,OAAO,EAAExC;AAAsB,OAChC,CAAC,EACDc,UAAU,EAAE;AAAA,KACH,CAAC;AAAA,GACR,CAAC;AAEZ;;;;"}
|
|
@@ -5,11 +5,11 @@ var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
|
|
|
5
5
|
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var ramda = require('ramda');
|
|
8
|
-
var menu = require('./chunk-Cv7rmxCK.cjs.js');
|
|
9
8
|
var constants = require('./chunk-2HrSPdAV.cjs.js');
|
|
10
9
|
var i18n = require('i18next');
|
|
11
10
|
var yup = require('yup');
|
|
12
11
|
var lucideReact = require('lucide-react');
|
|
12
|
+
var useEditorStore = require('./chunk-Cv0ocaVh.cjs.js');
|
|
13
13
|
var classnames = require('classnames');
|
|
14
14
|
var neetoCist = require('@bigbinary/neeto-cist');
|
|
15
15
|
var tippy = require('tippy.js');
|
|
@@ -217,7 +217,7 @@ var EmojiPickerMenu = /*#__PURE__*/function (_React$Component) {
|
|
|
217
217
|
case 0:
|
|
218
218
|
_context.prev = 0;
|
|
219
219
|
_context.next = 3;
|
|
220
|
-
return
|
|
220
|
+
return useEditorStore.emojiPickerApi.fetch();
|
|
221
221
|
case 3:
|
|
222
222
|
_yield$emojiPickerApi = _context.sent;
|
|
223
223
|
data = _yield$emojiPickerApi.data;
|
|
@@ -373,7 +373,7 @@ var MenuButton$1 = function MenuButton(_ref) {
|
|
|
373
373
|
_ref$disabled = _ref.disabled,
|
|
374
374
|
isButtonDisabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
375
375
|
label = _ref.label;
|
|
376
|
-
var _useEditorStore =
|
|
376
|
+
var _useEditorStore = useEditorStore.useEditorStore(function (store) {
|
|
377
377
|
var _store$marksState, _store$marksState2;
|
|
378
378
|
return {
|
|
379
379
|
isActive: (_store$marksState = store["marksState"]) === null || _store$marksState === void 0 || (_store$marksState = _store$marksState[optionName]) === null || _store$marksState === void 0 ? void 0 : _store$marksState["isActive"],
|
|
@@ -395,7 +395,7 @@ var MenuButton$1 = function MenuButton(_ref) {
|
|
|
395
395
|
position: "bottom"
|
|
396
396
|
},
|
|
397
397
|
onClick: command
|
|
398
|
-
},
|
|
398
|
+
}, useEditorStore.generateFocusProps(highlight)));
|
|
399
399
|
};
|
|
400
400
|
var MenuButton = /*#__PURE__*/React.memo(MenuButton$1);
|
|
401
401
|
|
|
@@ -1044,7 +1044,7 @@ var renderOptionButton = function renderOptionButton(_ref4) {
|
|
|
1044
1044
|
},
|
|
1045
1045
|
variant: active ? "secondary" : "ghost",
|
|
1046
1046
|
onClick: command
|
|
1047
|
-
},
|
|
1047
|
+
}, useEditorStore.generateFocusProps(highlight)), optionName);
|
|
1048
1048
|
};
|
|
1049
1049
|
|
|
1050
1050
|
var Options = function Options(_ref) {
|
|
@@ -1210,7 +1210,7 @@ var Bubble = function Bubble(_ref) {
|
|
|
1210
1210
|
return null;
|
|
1211
1211
|
}
|
|
1212
1212
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1213
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
1213
|
+
children: /*#__PURE__*/jsxRuntime.jsx(useEditorStore.BubbleMenu, {
|
|
1214
1214
|
editor: editor,
|
|
1215
1215
|
className: classnames__default.default("neeto-editor-bubble-menu", {
|
|
1216
1216
|
"neeto-editor-bubble-menu-animate-shake": isInvalidLink
|
|
@@ -1831,7 +1831,7 @@ var MoreMenu = function MoreMenu(_ref) {
|
|
|
1831
1831
|
}),
|
|
1832
1832
|
tabIndex: "-1",
|
|
1833
1833
|
onClick: props.command
|
|
1834
|
-
}, _objectSpread$8(_objectSpread$8(_objectSpread$8({},
|
|
1834
|
+
}, _objectSpread$8(_objectSpread$8(_objectSpread$8({}, useEditorStore.generateFocusProps(props.highlight)), props), {}, {
|
|
1835
1835
|
editor: editor
|
|
1836
1836
|
})), {}, {
|
|
1837
1837
|
children: props.label
|
|
@@ -1839,7 +1839,7 @@ var MoreMenu = function MoreMenu(_ref) {
|
|
|
1839
1839
|
}
|
|
1840
1840
|
return /*#__PURE__*/jsxRuntime.jsx(Component, _objectSpread$8(_objectSpread$8({}, _objectSpread$8(_objectSpread$8({}, props), {}, {
|
|
1841
1841
|
editor: editor
|
|
1842
|
-
},
|
|
1842
|
+
}, useEditorStore.generateFocusProps(props.highlight))), {}, {
|
|
1843
1843
|
isSecondaryMenu: true
|
|
1844
1844
|
}), props.optionName);
|
|
1845
1845
|
});
|
|
@@ -1855,7 +1855,7 @@ function _objectSpread$7(e) { for (var r = 1; r < arguments.length; r++) { var t
|
|
|
1855
1855
|
var useEditorState = function useEditorState(_ref) {
|
|
1856
1856
|
var editor = _ref.editor,
|
|
1857
1857
|
neetoKbArticleState = _ref.neetoKbArticleState;
|
|
1858
|
-
var _useEditorStore =
|
|
1858
|
+
var _useEditorStore = useEditorStore.useEditorStore(function (store) {
|
|
1859
1859
|
return {
|
|
1860
1860
|
setMarksState: store["setMarksState"],
|
|
1861
1861
|
marksState: store["marksState"]
|
|
@@ -2609,7 +2609,7 @@ var FontSizeOption$1 = function FontSizeOption(_ref) {
|
|
|
2609
2609
|
options = _ref$options === void 0 ? [] : _ref$options;
|
|
2610
2610
|
var dropdownRef = React.useRef(null);
|
|
2611
2611
|
var lastOption = ramda.last(FONT_SIZE_OPTIONS);
|
|
2612
|
-
var _useEditorStore =
|
|
2612
|
+
var _useEditorStore = useEditorStore.useEditorStore(function (store) {
|
|
2613
2613
|
var _store$marksState;
|
|
2614
2614
|
return {
|
|
2615
2615
|
fontSizeOption: (_store$marksState = store["marksState"]) === null || _store$marksState === void 0 ? void 0 : _store$marksState["fontSizeOption"]
|
|
@@ -3404,4 +3404,4 @@ exports.transformEditorContent = transformEditorContent;
|
|
|
3404
3404
|
exports.transformPastedHTML = transformPastedHTML;
|
|
3405
3405
|
exports.validateAndFormatUrl = validateAndFormatUrl;
|
|
3406
3406
|
exports.validateUrl = validateUrl;
|
|
3407
|
-
//# sourceMappingURL=chunk-
|
|
3407
|
+
//# sourceMappingURL=chunk-B_ZuTQG9.cjs.js.map
|