diff --git a/build/asset-manifest.json b/build/asset-manifest.json index 639475ba..2ab54163 100644 --- a/build/asset-manifest.json +++ b/build/asset-manifest.json @@ -5,8 +5,8 @@ "static/js/1.94a8704a.chunk.js": "./static/js/1.94a8704a.chunk.js", "static/js/1.94a8704a.chunk.js.map": "./static/js/1.94a8704a.chunk.js.map", "main.css": "./static/css/main.365342b3.chunk.css", - "main.js": "./static/js/main.c30d7197.chunk.js", - "main.js.map": "./static/js/main.c30d7197.chunk.js.map", + "main.js": "./static/js/main.cf56b8e1.chunk.js", + "main.js.map": "./static/js/main.cf56b8e1.chunk.js.map", "runtime-main.js": "./static/js/runtime-main.4405e875.js", "runtime-main.js.map": "./static/js/runtime-main.4405e875.js.map", "static/css/4.7c0a8645.chunk.css": "./static/css/4.7c0a8645.chunk.css", @@ -162,6 +162,6 @@ "static/css/4.7c0a8645.chunk.css", "static/js/4.8f86dee5.chunk.js", "static/css/main.365342b3.chunk.css", - "static/js/main.c30d7197.chunk.js" + "static/js/main.cf56b8e1.chunk.js" ] } \ No newline at end of file diff --git a/build/index.html b/build/index.html index 307ef6c4..016c1622 100644 --- a/build/index.html +++ b/build/index.html @@ -1 +1 @@ -Append Editor
\ No newline at end of file +Append Editor
\ No newline at end of file diff --git a/build/static/js/main.c30d7197.chunk.js b/build/static/js/main.cf56b8e1.chunk.js similarity index 85% rename from build/static/js/main.c30d7197.chunk.js rename to build/static/js/main.cf56b8e1.chunk.js index da6a8b71..efee3315 100644 --- a/build/static/js/main.c30d7197.chunk.js +++ b/build/static/js/main.cf56b8e1.chunk.js @@ -1,2 +1,2 @@ -(this["webpackJsonpappend-editor"]=this["webpackJsonpappend-editor"]||[]).push([[2],{1172:function(e,t,o){},1173:function(e,t,o){"use strict";o.r(t);var n=o(6),i=o(24),s=o.n(i),a=o(152),r=o.n(a);o(454),Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));var c=function(e){e&&e instanceof Function&&o.e(73).then(o.bind(null,1179)).then((function(t){var o=t.getCLS,n=t.getFID,i=t.getFCP,s=t.getLCP,a=t.getTTFB;o(e),n(e),i(e),s(e),a(e)}))},l=o(181),d=o(0),p=o(1),h=o(4),u=o(5),j=o(311),g="var(--sn-stylekit-info-color)",b="var(--sn-stylekit-foreground-color)",f=function(e){var t=e.fill,o=e.role;return Object(n.jsx)("span",{className:"chevron-icon down",children:Object(n.jsx)("svg",{"aria-label":"chevron icon down",role:o,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(n.jsx)("path",{d:"M6.17622 7.15015L10.0012 10.9751L13.8262 7.15015L15.0012 8.33348L10.0012 13.3335L5.00122 8.33348L6.17622 7.15015Z",fill:t||b})})})},x=function(e){var t=e.fill,o=e.role;return Object(n.jsx)("span",{className:"chevron-icon right",children:Object(n.jsx)("svg",{"aria-label":"chevron icon down",role:o,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(n.jsx)("path",{d:"M6.90918 14.0667L10.7342 10.2417L6.90918 6.4167L8.09251 5.2417L13.0925 10.2417L8.09251 15.2417L6.90918 14.0667Z",fill:t||b})})})},m=function(e){var t=e.fill,o=e.role;return Object(n.jsx)("svg",{"aria-label":"close icon",role:o,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(n.jsx)("path",{d:"M15.2459 5.92917C15.5704 5.6047 15.5704 5.07864 15.2459 4.75417C14.9214 4.4297 14.3954 4.4297 14.0709 4.75417L10.0001 8.82501L5.92925 4.75417C5.60478 4.4297 5.07872 4.4297 4.75425 4.75417C4.42978 5.07864 4.42978 5.6047 4.75425 5.92917L8.82508 10L4.75425 14.0708C4.42978 14.3953 4.42978 14.9214 4.75425 15.2458C5.07872 15.5703 5.60478 15.5703 5.92925 15.2458L10.0001 11.175L14.0709 15.2458C14.3954 15.5703 14.9214 15.5703 15.2459 15.2458C15.5704 14.9214 15.5704 14.3953 15.2459 14.0708L11.1751 10L15.2459 5.92917Z",fill:t||b})})},v=function(e){var t=e.fill,o=e.role;return Object(n.jsx)("svg",{"aria-label":"copy icon",role:o,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(n.jsx)("path",{d:"M1.66724 3.66626C1.66724 2.56169 2.56267 1.66626 3.66724 1.66626H11.3339C12.4385 1.66626 13.3339 2.56169 13.3339 3.66626V13.3329H3.66724C2.56267 13.3329 1.66724 12.4375 1.66724 11.3329V3.66626ZM16.3339 6.66626C17.4385 6.66626 18.3339 7.56169 18.3339 8.66626V16.3329C18.3339 17.4375 17.4385 18.3329 16.3339 18.3329H8.66724C7.56267 18.3329 6.66724 17.4375 6.66724 16.3329V14.9996H15.0006V6.66626H16.3339ZM3.3339 3.33293V11.6663H11.6672V3.33293H3.3339Z",fill:t||b})})},O=function(e){var t=e.condition,o=e.fill,i=e.role;return Object(n.jsx)("svg",{"aria-label":"eye icon",role:i,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(n.jsx)("path",{d:"M9.99992 7.5C9.33688 7.5 8.70099 7.76339 8.23215 8.23223C7.76331 8.70107 7.49992 9.33696 7.49992 10C7.49992 10.663 7.76331 11.2989 8.23215 11.7678C8.70099 12.2366 9.33688 12.5 9.99992 12.5C10.663 12.5 11.2988 12.2366 11.7677 11.7678C12.2365 11.2989 12.4999 10.663 12.4999 10C12.4999 9.33696 12.2365 8.70107 11.7677 8.23223C11.2988 7.76339 10.663 7.5 9.99992 7.5ZM9.99992 14.1667C8.89485 14.1667 7.83504 13.7277 7.05364 12.9463C6.27224 12.1649 5.83325 11.1051 5.83325 10C5.83325 8.89493 6.27224 7.83512 7.05364 7.05372C7.83504 6.27232 8.89485 5.83333 9.99992 5.83333C11.105 5.83333 12.1648 6.27232 12.9462 7.05372C13.7276 7.83512 14.1666 8.89493 14.1666 10C14.1666 11.1051 13.7276 12.1649 12.9462 12.9463C12.1648 13.7277 11.105 14.1667 9.99992 14.1667ZM9.99992 3.75C5.83325 3.75 2.27492 6.34167 0.833252 10C2.27492 13.6583 5.83325 16.25 9.99992 16.25C14.1666 16.25 17.7249 13.6583 19.1666 10C17.7249 6.34167 14.1666 3.75 9.99992 3.75Z",fill:o||(t?g:b)})})},w=function(e){var t=e.condition,o=e.fill,i=e.role;return Object(n.jsx)("svg",{"aria-label":"gear icon",role:i,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(n.jsx)("path",{d:"M10.0001 6.66675C10.8842 6.66675 11.732 7.01794 12.3571 7.64306C12.9823 8.26818 13.3334 9.11603 13.3334 10.0001C13.3334 10.8841 12.9823 11.732 12.3571 12.3571C11.732 12.9822 10.8842 13.3334 10.0001 13.3334C9.11606 13.3334 8.26821 12.9822 7.64309 12.3571C7.01797 11.732 6.66678 10.8841 6.66678 10.0001C6.66678 9.11603 7.01797 8.26818 7.64309 7.64306C8.26821 7.01794 9.11606 6.66675 10.0001 6.66675ZM10.0001 8.33342C9.55808 8.33342 9.13416 8.50901 8.8216 8.82157C8.50904 9.13413 8.33344 9.55805 8.33344 10.0001C8.33344 10.4421 8.50904 10.866 8.8216 11.1786C9.13416 11.4912 9.55808 11.6667 10.0001 11.6667C10.4421 11.6667 10.8661 11.4912 11.1786 11.1786C11.4912 10.866 11.6668 10.4421 11.6668 10.0001C11.6668 9.55805 11.4912 9.13413 11.1786 8.82157C10.8661 8.50901 10.4421 8.33342 10.0001 8.33342ZM8.33344 18.3334C8.12511 18.3334 7.95011 18.1834 7.91678 17.9834L7.60844 15.7751C7.08344 15.5667 6.63344 15.2834 6.20011 14.9501L4.12511 15.7917C3.94178 15.8584 3.71678 15.7917 3.61678 15.6084L1.95011 12.7251C1.84178 12.5417 1.89178 12.3167 2.05011 12.1917L3.80844 10.8084L3.75011 10.0001L3.80844 9.16675L2.05011 7.80841C1.89178 7.68341 1.84178 7.45841 1.95011 7.27508L3.61678 4.39175C3.71678 4.20841 3.94178 4.13341 4.12511 4.20842L6.20011 5.04175C6.63344 4.71675 7.08344 4.43341 7.60844 4.22508L7.91678 2.01675C7.95011 1.81675 8.12511 1.66675 8.33344 1.66675H11.6668C11.8751 1.66675 12.0501 1.81675 12.0834 2.01675L12.3918 4.22508C12.9168 4.43341 13.3668 4.71675 13.8001 5.04175L15.8751 4.20842C16.0584 4.13341 16.2834 4.20841 16.3834 4.39175L18.0501 7.27508C18.1584 7.45841 18.1084 7.68341 17.9501 7.80841L16.1918 9.16675L16.2501 10.0001L16.1918 10.8334L17.9501 12.1917C18.1084 12.3167 18.1584 12.5417 18.0501 12.7251L16.3834 15.6084C16.2834 15.7917 16.0584 15.8667 15.8751 15.7917L13.8001 14.9584C13.3668 15.2834 12.9168 15.5667 12.3918 15.7751L12.0834 17.9834C12.0501 18.1834 11.8751 18.3334 11.6668 18.3334H8.33344ZM9.37511 3.33341L9.06678 5.50841C8.06678 5.71675 7.18344 6.25008 6.54178 6.99175L4.53344 6.12508L3.90844 7.20841L5.66678 8.50008C5.33344 9.47508 5.33344 10.5334 5.66678 11.5001L3.90011 12.8001L4.52511 13.8834L6.55011 13.0167C7.19178 13.7501 8.06678 14.2834 9.05844 14.4834L9.36678 16.6667H10.6334L10.9418 14.4917C11.9334 14.2834 12.8084 13.7501 13.4501 13.0167L15.4751 13.8834L16.1001 12.8001L14.3334 11.5084C14.6668 10.5334 14.6668 9.47508 14.3334 8.50008L16.0918 7.20841L15.4668 6.12508L13.4584 6.99175C12.8168 6.25008 11.9334 5.71675 10.9334 5.51675L10.6251 3.33341H9.37511Z",fill:o||(t?g:b)})})},M=function(e){var t=e.condition,o=e.fill,i=e.role;return Object(n.jsx)("svg",{"aria-label":"help icon",role:i,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(n.jsx)("path",{d:"M9.16675 15.0001H10.8334V13.3334H9.16675V15.0001ZM10.0001 1.66675C8.90573 1.66675 7.8221 1.8823 6.81105 2.30109C5.80001 2.71987 4.88135 3.3337 4.10753 4.10753C2.54472 5.67033 1.66675 7.78995 1.66675 10.0001C1.66675 12.2102 2.54472 14.3298 4.10753 15.8926C4.88135 16.6665 5.80001 17.2803 6.81105 17.6991C7.8221 18.1179 8.90573 18.3334 10.0001 18.3334C12.2102 18.3334 14.3298 17.4554 15.8926 15.8926C17.4554 14.3298 18.3334 12.2102 18.3334 10.0001C18.3334 8.90573 18.1179 7.8221 17.6991 6.81105C17.2803 5.80001 16.6665 4.88135 15.8926 4.10753C15.1188 3.3337 14.2002 2.71987 13.1891 2.30109C12.1781 1.8823 11.0944 1.66675 10.0001 1.66675ZM10.0001 16.6668C6.32508 16.6668 3.33342 13.6751 3.33342 10.0001C3.33342 6.32508 6.32508 3.33342 10.0001 3.33342C13.6751 3.33342 16.6668 6.32508 16.6668 10.0001C16.6668 13.6751 13.6751 16.6668 10.0001 16.6668ZM10.0001 5.00008C9.11603 5.00008 8.26818 5.35127 7.64306 5.97639C7.01794 6.60151 6.66675 7.44936 6.66675 8.33342H8.33342C8.33342 7.89139 8.50901 7.46747 8.82157 7.1549C9.13413 6.84234 9.55806 6.66675 10.0001 6.66675C10.4421 6.66675 10.866 6.84234 11.1786 7.1549C11.4912 7.46747 11.6667 7.89139 11.6667 8.33342C11.6667 10.0001 9.16675 9.79175 9.16675 12.5001H10.8334C10.8334 10.6251 13.3334 10.4167 13.3334 8.33342C13.3334 7.44936 12.9822 6.60151 12.3571 5.97639C11.732 5.35127 10.8841 5.00008 10.0001 5.00008Z",fill:o||(t?g:b)})})},y=function(e){var t=e.condition,o=e.fill,i=e.role;return Object(n.jsx)("svg",{"aria-label":"menu icon",role:i,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(n.jsx)("path",{d:"M17 5V6.66667H3V5H17ZM3 15H17V13.3333H3V15ZM3 10.8333H17V9.16667H3V10.8333Z",fill:o||(t?g:b)})})},C=function(e){var t=e.condition,o=e.fill,i=e.role;return Object(n.jsx)("svg",{"aria-label":"pencil icon",role:i,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(n.jsx)("path",{d:"M11.7167 7.5L12.5 8.28333L4.93333 15.8333H4.16667V15.0667L11.7167 7.5ZM14.7167 2.5C14.5083 2.5 14.2917 2.58333 14.1333 2.74167L12.6083 4.26667L15.7333 7.39167L17.2583 5.86667C17.5833 5.54167 17.5833 5 17.2583 4.69167L15.3083 2.74167C15.1417 2.575 14.9333 2.5 14.7167 2.5ZM11.7167 5.15833L2.5 14.375V17.5H5.625L14.8417 8.28333L11.7167 5.15833Z",fill:o||(t?g:b)})})},E=function(e){var t=e.condition,o=e.fill,i=e.role;return Object(n.jsx)("svg",{role:i,"aria-label":"plus icon",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(n.jsx)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.385 11.385H15.615C16.3799 11.385 17 10.7649 17 10C17 9.23507 16.3799 8.61497 15.615 8.61497H11.385V4.38503C11.385 3.6201 10.7649 3 10 3C9.23507 3 8.61497 3.6201 8.61497 4.38503V8.61497H4.38503C3.6201 8.61497 3 9.23507 3 10C3 10.7649 3.6201 11.385 4.38503 11.385H8.61497V15.615C8.61497 16.3799 9.23507 17 10 17C10.7649 17 11.385 16.3799 11.385 15.615V11.385Z",fill:o||(t?g:b)})})},S=function(e){var t=e.fill,o=e.role;return Object(n.jsx)("svg",{"aria-label":"print icon",role:o,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(n.jsx)("path",{d:"M15.0001 2.5H5.00008V5.83333H15.0001V2.5ZM15.8334 10C15.6124 10 15.4004 9.9122 15.2442 9.75592C15.0879 9.59964 15.0001 9.38768 15.0001 9.16667C15.0001 8.94565 15.0879 8.73369 15.2442 8.57741C15.4004 8.42113 15.6124 8.33333 15.8334 8.33333C16.0544 8.33333 16.2664 8.42113 16.4227 8.57741C16.579 8.73369 16.6668 8.94565 16.6668 9.16667C16.6668 9.38768 16.579 9.59964 16.4227 9.75592C16.2664 9.9122 16.0544 10 15.8334 10ZM13.3334 15.8333H6.66675V11.6667H13.3334V15.8333ZM15.8334 6.66667H4.16675C3.50371 6.66667 2.86782 6.93006 2.39898 7.3989C1.93014 7.86774 1.66675 8.50363 1.66675 9.16667V14.1667H5.00008V17.5H15.0001V14.1667H18.3334V9.16667C18.3334 8.50363 18.07 7.86774 17.6012 7.3989C17.1323 6.93006 16.4965 6.66667 15.8334 6.66667Z",fill:t||b})})},k=function(e){var t=e.fill,o=e.role;return Object(n.jsx)("svg",{"aria-label":"refresh icon",role:o,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(n.jsx)("path",{d:"M9.99992 14.9999C8.67384 14.9999 7.40207 14.4731 6.46438 13.5355C5.5267 12.5978 4.99992 11.326 4.99992 9.99992C4.99992 9.16658 5.20825 8.35825 5.58325 7.66658L4.36659 6.44992C3.71659 7.47492 3.33325 8.69158 3.33325 9.99992C3.33325 11.768 4.03563 13.4637 5.28587 14.714C6.53612 15.9642 8.23181 16.6666 9.99992 16.6666V19.1666L13.3333 15.8332L9.99992 12.4999V14.9999ZM9.99992 3.33325V0.833252L6.66658 4.16658L9.99992 7.49992V4.99992C11.326 4.99992 12.5978 5.5267 13.5355 6.46438C14.4731 7.40207 14.9999 8.67383 14.9999 9.99992C14.9999 10.8333 14.7916 11.6416 14.4166 12.3333L15.6333 13.5499C16.2833 12.5249 16.6666 11.3083 16.6666 9.99992C16.6666 8.23181 15.9642 6.53612 14.714 5.28587C13.4637 4.03563 11.768 3.33325 9.99992 3.33325Z",fill:t||b})})},T=function(e){var t=e.fill,o=e.role;return Object(n.jsx)("svg",{"aria-label":"undo icon",role:o,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(n.jsx)("path",{d:"M10.1812 7.66667C8.36883 7.66667 6.72741 8.33333 5.46214 9.4L3 7V13H9.15535L6.67953 10.5867C7.63019 9.81333 8.84074 9.33333 10.1812 9.33333C12.6023 9.33333 14.661 10.8733 15.3791 13L17 12.48C16.0493 9.68667 13.3615 7.66667 10.1812 7.66667Z",fill:t||b})})},L=function(e){var t=e.cancelText,o=e.confirmText,i=e.helpLink,s=e.onCancel,a=e.onConfirm,r=e.onUndo,c=e.title;return Object(n.jsx)("div",{className:"note-overlay",children:Object(n.jsxs)("div",{className:"sk-panel note-dialog",children:[Object(n.jsx)("div",{className:"sk-panel-content",children:Object(n.jsxs)("div",{className:"sk-panel-section",children:[Object(n.jsxs)("div",{className:"sk-panel-row title-section",children:[Object(n.jsx)("h2",{children:c}),Object(n.jsx)("button",{id:"undoDialog",onClick:r,title:"Close",children:Object(n.jsx)(m,{role:"button"})})]}),Object(n.jsxs)("p",{children:["Need help deciding? Check out the"," ",Object(n.jsx)("a",{href:i,target:"_blank",rel:"noopener noreferrer",children:"documentation"}),"."]})]})}),Object(n.jsx)("div",{className:"sk-panel-footer",children:Object(n.jsxs)("div",{className:"sk-button-group stretch",children:[Object(n.jsx)("button",{className:"sk-button neutral",onClick:s,children:Object(n.jsx)("div",{children:t})}),Object(n.jsx)("button",{className:"sk-button info",onClick:a,children:Object(n.jsx)("div",{children:o})})]})})]})})},N=o(242),B="MonacoEditorContainer",D="MonacoDiffEditorContainer";self.MonacoEnvironment={getWorkerUrl:function(e,t){return"json"===t?"./json.worker.bundle.js":"css"===t?"./css.worker.bundle.js":"html"===t?"./html.worker.bundle.js":"typescript"===t||"javascript"===t?"./ts.worker.bundle.js":"./editor.worker.bundle.js"}};var A=function(e){var t,o=e.fontSize,s=void 0===o?"16":o,a=e.id,r=void 0===a?B:a,c=e.language,l=void 0===c?"markdown":c,d=e.saveText,p=e.tabSize,h=void 0===p?2:p,u=e.text,j=e.theme,g=void 0===j?"vs-dark":j,b=e.viewMode,f=void 0!==b&&b,x=Object(i.useRef)(null);""===s&&(s="16px");var m=!0;return f&&(m=!1),Object(i.useEffect)((function(){return x.current&&((t=N.a.create(x.current,{fontSize:parseInt(s.replace("px","")),language:l,tabSize:h,theme:g,scrollBeyondLastLine:m,value:[u].join("\n"),autoClosingOvertype:"auto",formatOnPaste:!0,formatOnType:!0,wordWrap:"on",wrappingStrategy:"advanced"})).onKeyDown((function(e){!function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&console.log("IKeyboardEvent Up: "+e)}(e.code,false),e.ctrlKey&&"KeyS"===e.code&&e.preventDefault()})),t.onKeyUp((function(e){!function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&console.log("IKeyboardEvent Up: "+e)}(e.code,false)})),t.onDidChangeModelContent((function(e){d&&d(t.getValue())}))),function(){t.dispose()}}),[]),Object(n.jsx)("div",{id:r,className:B,ref:x})},V=function(e){var t,o=e.fontSize,s=void 0===o?"16":o,a=e.id,r=void 0===a?D:a,c=e.language,l=void 0===c?"markdown":c,d=e.saveText,p=e.text,h=e.modifiedText,u=e.theme,j=void 0===u?"vs-dark":u,g=Object(i.useRef)(null);return""===s&&(s="16px"),Object(i.useEffect)((function(){if(g.current){var e=N.a.createModel([p].join("\n"),l),o=N.a.createModel([h].join("\n"),l);(t=N.a.createDiffEditor(g.current,{fontSize:parseInt(s.replace("px","")),theme:j,autoClosingOvertype:"auto",formatOnPaste:!0,formatOnType:!0,wordWrap:"on",wrappingStrategy:"advanced",originalEditable:!0,readOnly:!0})).setModel({original:e,modified:o}),e.onDidChangeContent((function(t){d&&d(e.getValue())}))}return function(){t.dispose()}}),[]),Object(n.jsx)("div",{id:r,className:D,ref:g})},H=o(439),K=o.n(H),I=o(440),F=o.n(I),P=function(e){Object(h.a)(o,e);var t=Object(u.a)(o);function o(){return Object(d.a)(this,o),t.apply(this,arguments)}return Object(p.a)(o,[{key:"render",value:function(){var e=this.props.attrs.matches[1];return Object(n.jsx)("iframe",{title:"Youtube Embed ".concat(e),className:this.props.isSelected?"YouTube ProseMirror-selectednode":"YouTube",src:"https://www.youtube.com/embed/".concat(e,"?modestbranding=1")})}}]),o}(i.Component),U=function(e){Object(h.a)(o,e);var t=Object(u.a)(o);function o(e){var n;return Object(d.a)(this,o),(n=t.call(this,e)).handleToggleReadOnly=function(){n.setState({readOnly:!n.state.readOnly})},n.handleChange=K()((function(e){var t=e();n.props.debugMode&&console.log(t),n.props.onChange(t)}),50),n.state={readOnly:n.props.readOnly,template:!1,value:void 0},n}return Object(p.a)(o,[{key:"render",value:function(){var e=this;return Object(n.jsx)(F.a,{className:"DynamicEditor",placeholder:"Type '/' to insert...",id:"DynamicEditor",readOnly:this.state.readOnly,readOnlyWriteCheckboxes:!0,value:this.state.value,defaultValue:this.props.text,scrollTo:window.location.hash,onCancel:function(){e.props.debugMode&&console.log("Cancel triggered")},autoFocus:!0,onChange:function(t){return e.handleChange(t)},embeds:[{title:"YouTube",keywords:"youtube video tube google",icon:function(){return Object(n.jsx)("img",{alt:"YouTube Logo",src:"/icons/ic-YouTube.svg",width:24,height:24})},matcher:function(e){return e.match(/(?:https?:\/\/)?(?:www\.)?youtu\.?be(?:\.com)?\/?.*(?:watch|embed)?(?:.*v=|v\/|\/)([a-zA-Z0-9_-]{11})$/i)},component:P}]})}}]),o}(i.Component),z=function(e){Object(h.a)(o,e);var t=Object(u.a)(o);function o(e){var n;return Object(d.a)(this,o),(n=t.call(this,e)).handleInputChange=function(e){var t=e.target.value;n.setState({text:t},(function(){n.props.saveText(n.state.text)}))},n.saveText=function(e){n.setState({text:e},(function(){n.props.saveText(n.state.text)}))},n.onKeyDown=function(e){n.props.onKeyDown(e),n.props.onKeyDownEditTextArea(e),n.props.onKeyDownTextArea(e)},n.onKeyUp=function(e){n.props.keyMap.delete(e.key),n.props.onKeyUp(e)},n.state={text:n.props.text},n}return Object(p.a)(o,[{key:"render",value:function(){var e=this.state.text;return Object(n.jsx)("div",{className:"sk-panel main edit "+(this.props.editingMode===Xe.useMonacoEditor?"monacoEditor":this.props.editingMode===Xe.useDynamicEditor?"dynamicEditor":"otherEditor"),children:Object(n.jsx)("div",{className:"sk-panel-content edit "+(this.props.editingMode===Xe.useMonacoEditor?"monacoEditor":""),id:Ge.edit,children:this.props.editingMode===Xe.useMonacoEditor?Object(n.jsx)(A,{fontSize:this.props.fontSize,language:this.props.monacoEditorLanguage,saveText:this.saveText,text:e,viewMode:this.props.viewMode}):this.props.editingMode===Xe.useDynamicEditor?Object(n.jsx)("div",{id:"dynamicEditor",children:Object(n.jsx)(U,{debugMode:this.props.debugMode,text:e,onChange:this.saveText,readOnly:!1})}):Object(n.jsx)("textarea",{id:Ge.editTextArea,name:"text",className:"sk-input contrast textarea editnote",placeholder:"Welcome to the Append Editor! \ud83d\ude04",rows:15,spellCheck:"true",value:e,onChange:this.handleInputChange,onKeyDown:this.onKeyDown,onKeyUp:this.onKeyUp})})})}}]),o}(s.a.Component);z.defaultProps={};var R=function(){var e=document.getElementById(Ge.appendButton);e&&e.click()},W=function(){var e=document.getElementById(Ge.editButton);e&&e.click()},_=function(){var e=document.getElementById(Ge.helpButton);e&&e.click()},Z=function(){var e=document.getElementById(Ge.menuButton);e&&e.click()},Y=function(){var e=document.getElementById(Ge.settingsButton);e&&e.click()},G=function(){var e=document.getElementById(Ge.viewButton);e&&e.click()},q=function(e){Object(h.a)(o,e);var t=Object(u.a)(o);function o(e){var n;return Object(d.a)(this,o),(n=t.call(this,e)).onToggleShowFeelings=function(){n.setState({showFeelings:!n.state.showFeelings})},n.onToggleShowMoreQuestions=function(){n.setState({showMoreQuestions:!n.state.showMoreQuestions})},n.onToggleShowFeedback=function(){n.setState({showFeedback:!n.state.showFeedback})},n.state={showFeelings:!1,showMoreQuestions:!1,showFeedback:!1},n}return Object(p.a)(o,[{key:"render",value:function(){return Object(n.jsxs)("div",{id:"help",children:[Object(n.jsx)("hr",{}),Object(n.jsx)("h2",{children:"Append Editor Help"}),Object(n.jsxs)("p",{children:["The Append Editor is an ",Object(n.jsx)("b",{children:"unofficial"})," ",Object(n.jsx)("a",{href:"https://standardnotes.org/help/77/what-are-editors",target:"_blank",rel:"nofollow noreferrer noopener",children:"editor"})," ","for"," ",Object(n.jsx)("a",{href:"https://standardnotes.org/",target:"_blank",rel:"nofollow noreferrer noopener",children:"Standard Notes"}),", a free,"," ",Object(n.jsx)("a",{href:"https://standardnotes.org/knowledge/5/what-is-free-and-open-source-software",target:"_blank",rel:"nofollow noreferrer noopener",children:"open-source"}),", and"," ",Object(n.jsx)("a",{href:"https://standardnotes.org/knowledge/2/what-is-end-to-end-encryption",target:"_blank",rel:"nofollow noreferrer noopener",children:"end-to-end encrypted"})," ","notes app. The Append Editor is also free software licensed under"," ",Object(n.jsx)("a",{href:"https://github.com/TheodoreChu/append-editor/blob/main/LICENSE",target:"_blank",rel:"nofollow noreferrer noopener",children:"AGPL-3.0"}),". Its source code is available on"," ",Object(n.jsx)("a",{href:"https://github.com/TheodoreChu/append-editor",target:"_blank",rel:"nofollow noreferrer noopener",children:"GitHub"}),"."]}),Object(n.jsx)("h3",{children:"Append Editor Features"}),Object(n.jsxs)("p",{children:["The Append Editor supports"," ",Object(n.jsx)("a",{href:"https://guides.github.com/features/mastering-markdown/",target:"_blank",rel:"nofollow noreferrer noopener",children:"Markdown"})," ","with"," ",Object(n.jsx)("a",{href:"https://katex.org/docs/support_table.html",target:"_blank",rel:"nofollow noreferrer noopener",children:"KaTeX"}),", syntax highlighting, in-line HTML, table of contents, footnotes, auto-linking,"," ",Object(n.jsx)("a",{href:"https://github.com/ikatyang/emoji-cheat-sheet/blob/master/README.md",target:"_blank",rel:"nofollow noreferrer noopener",children:"emoji codes"}),", and more."," "]}),Object(n.jsxs)("p",{children:["There are four editing modes: Plain Textarea, CodeMirror, Dynamic, and Monaco. You can read about each mode and choose which to use in the Settings",Object(n.jsxs)("button",{className:"inline-text-and-svg",onClick:Y,title:"Open Settings",children:[Object(n.jsx)("span",{children:"\xa0"}),Object(n.jsx)(w,{role:"button"}),Object(n.jsx)("span",{children:"\xa0"})]}),". You can also choose default and per-note font sizes, font families, and custom styles (CSS)."]}),Object(n.jsxs)("p",{children:["The Menu",Object(n.jsxs)("button",{className:"inline-text-and-svg",onClick:Z,title:"Open the Menu",children:[Object(n.jsx)("span",{children:"\xa0"}),Object(n.jsx)(y,{role:"button"}),Object(n.jsx)("span",{children:"\xa0"})]}),"has additional options to customize the appearance of the editor, share your note, and perform actions to quickly format and edit Markdown text."]}),Object(n.jsxs)("p",{children:["A more detailed documentation of the Append Editor is available at"," ",Object(n.jsx)("a",{href:"https://appendeditor.com",target:"_blank",rel:"noopener noreferrer",children:"appendeditor.com"}),". If you like the Append Editor, please support it by giving it a star on"," ",Object(n.jsx)("a",{href:"https://github.com/TheodoreChu/append-editor/stargazers",target:"_blank",rel:"noopener noreferrer",children:"GitHub"}),"."," ",Object(n.jsx)("span",{role:"img","aria-label":"smile emoji",children:"\ud83d\ude42"})," "]}),Object(n.jsx)("h3",{children:"How to install the Append Editor in Standard Notes"}),Object(n.jsxs)("ol",{children:[Object(n.jsxs)("li",{children:["Download, install, and sign in to the Standard Notes"," ",Object(n.jsx)("a",{href:"https://standardnotes.org/download",target:"_blank",rel:"noopener noreferrer",children:"Desktop"})," ","app."]}),Object(n.jsxs)("li",{children:["In the bottom left corner of the app, click ",Object(n.jsx)("b",{children:"Extensions"}),"."]}),Object(n.jsxs)("li",{children:["Click ",Object(n.jsx)("b",{children:"Import Extensions"})," and paste the following link into the input box. If you want to use the alpha version, replace"," ",Object(n.jsx)("code",{children:"beta"})," with ",Object(n.jsx)("code",{children:"alpha"}),":"," ",Object(n.jsx)("code",{children:Object(n.jsx)("a",{href:"https://raw.githubusercontent.com/TheodoreChu/append-editor/main/public/beta.ext.json",target:"_blank",rel:"noopener noreferrer",children:"https://raw.githubusercontent.com/TheodoreChu/append-editor/main/public/beta.ext.json"})})]}),Object(n.jsxs)("li",{children:["Press ",Object(n.jsx)("b",{children:"Enter"})," or ",Object(n.jsx)("b",{children:"Return"})," on your keyboard."]}),Object(n.jsxs)("li",{children:["The title of your selected note is near the top of the app. Under the title, click ",Object(n.jsx)("b",{children:"Editor"}),", click ",Object(n.jsx)("b",{children:"Append Editor"}),", and click ",Object(n.jsx)("b",{children:"Continue"})," to begin using the editor. Enjoy!"," ",Object(n.jsx)("span",{role:"img","aria-label":"clap emoji",children:"\ud83d\udc4f"})," "]})]}),Object(n.jsxs)("p",{children:["After you install the editor on the desktop app, it will automatically sync to the"," ",Object(n.jsx)("a",{href:"https://app.standardnotes.org",target:"_blank",rel:"noopener noreferrer",children:"web"})," ","and"," ",Object(n.jsx)("a",{href:"https://standardnotes.org/download",target:"_blank",rel:"noopener noreferrer",children:"mobile apps"})," ","after you sign in."]}),Object(n.jsx)("h3",{children:"What to write about"}),Object(n.jsx)("p",{children:"The Append Editor is great for writing articles, blog posts, checklists, code snippets, documentation, emails, essays, journals, lists, logs, notes, tables, todo lists, and much more. Here are some questions to help you get started with today's daily journal:"})," ",Object(n.jsxs)("ul",{children:[Object(n.jsx)("li",{children:"How are you? What's happening?"}),Object(n.jsx)("li",{children:"What might be affecting your mood?"}),Object(n.jsx)("li",{children:"Which feelings fit your mood and to what extent?"}),Object(n.jsxs)("details",{onToggle:this.onToggleShowFeelings,children:[Object(n.jsxs)("summary",{children:[!this.state.showFeelings&&[Object(n.jsx)("p",{className:"link",children:"Show feelings"})],this.state.showFeelings&&[Object(n.jsx)("p",{className:"link",children:"Hide feelings"})]]}),Object(n.jsxs)("li",{children:[Object(n.jsx)("b",{children:"Positive Feelings:"})," bold, calm, cheerful, confident, content, eager, ecstatic, energized, engaged, enthusiastic, excited, grateful, happy, humorous, inspired, joyful, light, lively, loving, motivated, optimistic, passionate, peaceful, playful, proud, reassured, refreshed, relaxed, relieved, satisfied, secure, surprised, thrilled, wonderful"]}),Object(n.jsxs)("li",{children:[Object(n.jsx)("b",{children:"Negative Feelings:"})," afraid, angry, annoyed, anxious, ashamed, bored, burnt out, confused, demoralized, depressed, disappointed, disgusted, distraught, embarrassed, empty, exhausted, frustrated, furious, guilty, heavy, insecure, irritated, jealous, jittery, lethargic, lonely, nervous, numb, resentful, sad, self-conscious, sleepy, stressed, tired, winded, worried"]})]}),Object(n.jsx)("li",{children:"What thoughts are contributing to the way you're feeling?"}),Object(n.jsx)("details",{onToggle:this.onToggleShowMoreQuestions,children:Object(n.jsxs)("summary",{children:[!this.state.showMoreQuestions&&[Object(n.jsx)("p",{className:"link",children:"Show more questions"})],this.state.showMoreQuestions&&[Object(n.jsx)("p",{className:"link",children:"Show fewer questions"})]]})}),this.state.showMoreQuestions&&[Object(n.jsxs)("div",{children:[Object(n.jsx)("li",{children:"What do you hope your life will look like in a week? a month? a year?"}),Object(n.jsx)("li",{children:"What can you do today to make your life the way you want it?"}),Object(n.jsx)("li",{children:"How will you feel when you've realized the goals that you have for yourself?"}),Object(n.jsx)("li",{children:"Who or what do you feel grateful for and why?"}),Object(n.jsx)("li",{children:"What did you enjoy about today?"})]})]]}),Object(n.jsxs)("details",{onToggle:this.onToggleShowFeedback,children:[Object(n.jsx)("summary",{children:Object(n.jsx)("p",{className:"link",children:"Need more help?"})}),this.state.showFeedback&&[Object(n.jsxs)("p",{children:["Feel free to"," ",Object(n.jsx)("a",{href:"https://appendeditor.com/contact",target:"_blank",rel:"noopener noreferrer",children:"reach out"})," ","if you have any questions, comments, concerns, or feedback."," ",Object(n.jsx)("span",{role:"img","aria-label":"wave emoji",children:"\ud83d\udc4b"}),Object(n.jsx)("br",{}),"If you find any bugs or have a feature request, please"," ",Object(n.jsx)("a",{href:"https://github.com/TheodoreChu/append-editor/issues",target:"_blank",rel:"noopener noreferrer",children:"open an issue on GitHub"}),"."," ",Object(n.jsx)("span",{role:"img","aria-label":"smile emoji",children:"\ud83d\ude42"}),Object(n.jsx)("br",{}),"You are using version ",Object(n.jsx)("code",{children:"1.2.0"}),". The release notes and change log are available on"," ",Object(n.jsx)("a",{href:"https://github.com/TheodoreChu/append-editor/releases",target:"_blank",rel:"noopener noreferrer",children:"GitHub"}),"."]})]]}),"Click Help",Object(n.jsxs)("button",{className:"inline-text-and-svg",onClick:_,title:"Close Help",children:[Object(n.jsx)("span",{children:"\xa0"}),Object(n.jsx)(M,{fill:"var(--sn-stylekit-info-color)",role:"button"}),Object(n.jsx)("span",{children:"\xa0"})]}),"to close this section.",Object(n.jsx)("hr",{})]})}}]),o}(s.a.Component),X=function(e){var t=e.appendMode,o=e.editMode,i=e.showHelp;return Object(n.jsx)("div",{id:"intro",children:Object(n.jsxs)("details",{children:[Object(n.jsxs)("summary",{children:["Welcome to the Append Editor!"," ",Object(n.jsx)("span",{role:"img","aria-label":"wave emoji",children:"\ud83d\udc4b"})," ","Your note is empty."," ",Object(n.jsx)("span",{role:"img","aria-label":"smile emoji",children:"\ud83d\ude42"})," ","Click here to get started."," ",Object(n.jsx)("span",{role:"img","aria-label":"memo emoji",children:"\ud83d\udcdd"})]}),Object(n.jsx)("p",{children:"To get started:"}),Object(n.jsxs)("ul",{children:[Object(n.jsx)("li",{children:Object(n.jsxs)("p",{children:["Click the Pencil",Object(n.jsxs)("button",{className:"inline-text-and-svg",onClick:W,title:"Toggle Edit Mode",children:[Object(n.jsx)("span",{children:"\xa0"}),Object(n.jsx)(C,{condition:o,role:"button"}),Object(n.jsx)("span",{children:"\xa0"})]}),"to toggle ",Object(n.jsx)("b",{children:"Edit Mode"})]})}),Object(n.jsx)("li",{children:Object(n.jsxs)("p",{children:["Click the Plus",Object(n.jsxs)("button",{className:"inline-text-and-svg",onClick:R,title:"Toggle Append Mode",children:[Object(n.jsx)("span",{children:"\xa0"}),Object(n.jsx)(E,{condition:t,role:"button"}),Object(n.jsx)("span",{children:"\xa0"})]}),"to toggle ",Object(n.jsx)("b",{children:"Append Mode"})]})})]}),Object(n.jsxs)("p",{children:[Object(n.jsx)("b",{children:"View Mode"})," is currently ",Object(n.jsx)("b",{children:"on"}),". When you type in"," ",Object(n.jsx)("b",{children:"Edit Mode"}),", your note will automatically render here. In"," ",Object(n.jsx)("b",{children:"Append Mode"}),", clicking ",Object(n.jsx)("b",{children:"Append"})," will add the text in the textarea to the end of your note. Click the Eye",Object(n.jsxs)("button",{className:"inline-text-and-svg",onClick:G,title:"Toggle View Mode",children:[Object(n.jsx)("span",{children:"\xa0"}),Object(n.jsx)(O,{condition:!0,role:"button"}),Object(n.jsx)("span",{children:"\xa0"})]}),"to turn View Mode off and switch to ",Object(n.jsx)("b",{children:"Edit Only Mode"}),"."]}),Object(n.jsxs)("p",{children:["If you are using the demo at"," ",Object(n.jsx)("a",{href:"https://beta.appendeditor.com",target:"_blank",rel:"nofollow noreferrer noopener",children:"beta.appendeditor.com"}),", then your notes will be lost after you close the page."]}),Object(n.jsxs)("p",{children:["If you want to save your notes, then click Help",Object(n.jsxs)("button",{className:"inline-text-and-svg",onClick:_,title:"Toggle show Help",children:[Object(n.jsx)("span",{children:"\xa0"}),Object(n.jsx)(M,{condition:i,role:"button"}),Object(n.jsx)("span",{children:"\xa0"})]}),"and follow the instructions on how to install the Append Editor in"," ",Object(n.jsx)("a",{href:"https://standardnotes.org/",target:"_blank",rel:"nofollow noreferrer noopener",children:"Standard Notes"}),", a free,"," ",Object(n.jsx)("a",{href:"https://standardnotes.org/knowledge/5/what-is-free-and-open-source-software",target:"_blank",rel:"nofollow noreferrer noopener",children:"open-source"}),", and"," ",Object(n.jsx)("a",{href:"https://standardnotes.org/knowledge/2/what-is-end-to-end-encryption",target:"_blank",rel:"nofollow noreferrer noopener",children:"end-to-end encrypted"})," ","notes app."]}),Object(n.jsxs)("p",{children:["If you like Standard Notes, please check out Standard Notes"," ",Object(n.jsx)("a",{href:"https://standardnotes.org/extensions",target:"_blank",rel:"nofollow noreferrer noopener",children:"Extended"})," ","for more editors, themes, components, and methods to backup up your data."]}),Object(n.jsxs)("p",{children:["Happy note-taking!"," ",Object(n.jsx)("span",{role:"img","aria-label":"smile emoji",children:"\ud83d\ude04"})]})]})})},Q=o(309),J=o.n(Q),$=o(444),ee=o.n($),te=o(445),oe=o.n(te),ne=o(446),ie=o.n(ne),se=o(278),ae=o(880),re=o(905),ce=o(906),le=o(914),de=o(938),pe=o(1133),he=o(1139),ue=o(1141),je=o(1147),ge=o(1152),be=o(1153),fe=J()().use(ee.a).use(ae).use(re).use(ge).use(ue,{maxDepth:6}).use(he).use(je,{inlineNotes:!0}).use(oe.a,{allowDangerousHtml:!0}).use(be).use(ce).use(le).use(de,{ignoreMissing:!0}).use(pe).use(ie.a,{createElement:s.a.createElement}),xe=function(e){return fe.processSync(e).result},me=Object(se.throttle)((function(e){return e.length>1e4}),1e3),ve=Object(se.debounce)((function(e){return xe(e)}),500),Oe=function(e){Object(h.a)(o,e);var t=Object(u.a)(o);function o(e){var n;return Object(d.a)(this,o),(n=t.call(this,e)).onToggleShowHelp=function(){var e=document.getElementById("helpButton");e&&e.click()},n.renderMarkdown=function(e){return function(e,t){return t?xe(e):me(e)?ve(e):xe(e)}(e,n.props.bypassDebounce)},n.state={showHelp:n.props.showHelp},n}return Object(p.a)(o,[{key:"render",value:function(){var e=this.props.text;return Object(n.jsx)("div",{className:"sk-panel main view"+(this.props.printURL?" printURL":""),children:Object(n.jsxs)("div",{className:"sk-panel-content view",id:Ge.view,children:[!e&&[Object(n.jsx)(X,{appendMode:this.props.appendMode,editMode:this.props.editMode,showHelp:this.props.showHelp})],this.state.showHelp&&[Object(n.jsx)(q,{debugMode:this.props.debugMode,printURL:this.props.printURL})],Object(n.jsx)("div",{id:"renderedNote",className:this.props.editingMode===Xe.useDynamicEditor?"":"rendered-note-section",children:this.props.editingMode===Xe.useMonacoEditor&&"markdown"!==this.props.monacoEditorLanguage&&"html"!==this.props.monacoEditorLanguage&&e?this.renderMarkdown("```"+this.props.monacoEditorLanguage+"\n"+e+"\n```"):this.props.editingMode===Xe.useDynamicEditor?Object(n.jsx)(U,{debugMode:this.props.debugMode,onChange:this.props.saveText,readOnly:!0,text:e}):this.renderMarkdown(e)})]})})}}]),o}(s.a.Component),we=o(38),Me=function(e){Object(h.a)(o,e);var t=Object(u.a)(o);function o(e){var n;return Object(d.a)(this,o),(n=t.call(this,e)).handleInputChange=function(e){var t=e.target,o="checkbox"===t.type?t.checked:t.value,i=t.name;n.setState(Object(we.a)({},i,o),(function(){n.autoSaveCheckBoxes()}))},n.handleTextAreaChange=function(e){var t=e.target.value;n.setState({text:t},(function(){n.autoSaveAppendText()}))},n.saveText=function(e){n.setState({text:e},(function(){n.props.autoSaveAppendText(n.state.text)}))},n.appendTextToNote=function(){n.props.appendTextToNote(),n.setState({text:""});var e=document.getElementById(Ge.appendTextArea);e&&e.focus(),n.state.useMonacoEditor&&n.setState({useMonacoEditor:!1},(function(){n.setState({useMonacoEditor:!0})})),n.state.useDynamicEditor&&n.setState({useDynamicEditor:!1},(function(){n.setState({useDynamicEditor:!0})}))},n.autoSaveAppendText=function(){var e=n.state.text;n.props.autoSaveAppendText(e)},n.autoSaveCheckBoxes=function(){var e=n.state.newLine,t=n.state.newParagraph;n.props.autoSaveCheckBoxes(e,t)},n.onKeyDown=function(e){n.props.keyMap.set(e.key,!0),n.props.debugMode&&(console.log("Keys pressed: "+e.key+"KeyMap for key: "+n.props.keyMap.get(e.key)),console.log("Append Text Value: "+n.state.text)),n.props.onKeyDown(e),n.props.onKeyDownAppendTextArea(e),n.props.onKeyDownTextArea(e),(n.props.keyMap.get("Control")&&n.props.keyMap.get("Enter")||n.props.keyMap.get("Control")&&n.props.keyMap.get("s"))&&(e.preventDefault(),n.appendTextToNote())},n.onKeyUp=function(e){n.props.keyMap.delete(e.key),n.props.onKeyUp(e)},n.state={text:n.props.text,newLine:n.props.appendNewLine,newParagraph:n.props.appendNewParagraph,useMonacoEditor:n.props.editingMode===Xe.useMonacoEditor,useDynamicEditor:n.props.editingMode===Xe.useDynamicEditor},n}return Object(p.a)(o,[{key:"render",value:function(){var e=this.state.text;return Object(n.jsxs)("div",{className:"sk-panel main appendix "+(this.props.editingMode===Xe.useMonacoEditor?"monacoEditor":this.props.editingMode===Xe.useDynamicEditor?"dynamicEditor":"otherEditor"),children:[Object(n.jsx)("div",{className:"sk-panel-content edit "+(this.props.editingMode===Xe.useMonacoEditor?"monacoEditor":""),children:this.state.useMonacoEditor?Object(n.jsx)(A,{fontSize:this.props.fontSize,language:this.props.monacoEditorLanguage,saveText:this.saveText,text:e}):this.state.useDynamicEditor?Object(n.jsx)("div",{id:"appendDynamicEditor",children:Object(n.jsx)(U,{debugMode:this.props.debugMode,onChange:this.saveText,readOnly:!1,text:e})}):Object(n.jsx)("textarea",{id:Ge.appendTextArea,name:"text",className:"sk-input contrast textarea append",placeholder:"Append to your note",rows:this.props.appendRows,spellCheck:"true",value:e,onChange:this.handleTextAreaChange,onKeyDown:this.onKeyDown,onKeyUp:this.onKeyUp})}),Object(n.jsxs)("div",{className:"sk-panel-row",children:[Object(n.jsxs)("form",{className:"checkBoxForm",children:[Object(n.jsxs)("label",{children:[Object(n.jsx)("input",{id:Ge.newLine,name:"newLine",type:"checkbox",checked:this.state.newLine,onChange:this.handleInputChange}),"New Line"]}),Object(n.jsx)("br",{}),Object(n.jsxs)("label",{children:[Object(n.jsx)("input",{id:Ge.newParagraph,name:"newParagraph",type:"checkbox",checked:this.state.newParagraph,onChange:this.handleInputChange}),"New Paragraph"]})]}),Object(n.jsx)("div",{className:"sk-button-group stretch",children:Object(n.jsx)("button",{type:"button",id:"appendTextButton",onClick:this.appendTextToNote,className:"sk-button info",children:Object(n.jsx)("div",{children:"Append"})})})]})]})}}]),o}(s.a.Component);Me.defaultProps={};var ye,Ce=function(e){var t=e.caption,o=e.className,i=e.condition,s=e.onClick,a=e.title;return Object(n.jsxs)("button",{className:o,onClick:s,title:a,children:[i?Object(n.jsx)(f,{role:"button"}):Object(n.jsx)(x,{role:"button"}),Object(n.jsx)("p",{className:"chevron-button-caption",children:t})]})},Ee=function(e){var t=e.caption,o=e.className,i=e.fill,s=e.onClick,a=e.title;return Object(n.jsxs)("button",{className:o,onClick:s,title:a,children:[Object(n.jsx)(v,{fill:i,role:"button"}),Object(n.jsx)("span",{className:"button-caption",children:t})]})},Se=function(e){var t=e.caption,o=e.className,i=e.condition,s=e.messageOn,a=e.messageOff,r=e.onClick,c=e.title;return Object(n.jsxs)("button",{className:o,onClick:r,title:c,children:[Object(n.jsx)(O,{condition:i,role:"button"}),Object(n.jsxs)("span",{className:"button-caption",children:[t,":",Object(n.jsxs)("b",{children:["\xa0",i?s:a]})]})]})},ke=function(e){var t=e.caption,o=e.className,i=e.fill,s=e.onClick,a=e.title;return Object(n.jsxs)("button",{className:o,onClick:s,title:a,children:[Object(n.jsx)(C,{fill:i,role:"button"}),Object(n.jsx)("span",{className:"button-caption",children:t})]})},Te=function(e){var t=e.caption,o=e.className,i=e.fill,s=e.id,a=e.onClick,r=e.title;return Object(n.jsxs)("button",{className:o,id:s,onClick:a,title:r,children:[Object(n.jsx)(S,{fill:i,role:"button"}),Object(n.jsx)("span",{className:"button-caption",children:t})]})},Le=function(e){var t=e.fill,o=e.id,i=e.onClick,s=e.title;return Object(n.jsx)("button",{id:o,onClick:i,title:s,children:Object(n.jsx)(T,{fill:t,role:"button"})})},Ne="editingMode",Be="fontEdit",De="fontSize",Ae="fontView",Ve="monacoEditorLanguage",He="resetAllSettings",Ke="saveAsDefault",Ie=new RegExp(/```css\n/gm),Fe=new RegExp(/```css/gm),Pe=new RegExp(/\n```/gm),Ue=new RegExp(/```/gm),ze=function(e){Object(h.a)(o,e);var t=Object(u.a)(o);function o(e){var n;Object(d.a)(this,o),(n=t.call(this,e)).handleInputChange=function(e){var t=e.target,o="checkbox"===t.type?t.checked:t.value,i=t.name;n.setState(Object(we.a)({},i,o)),n.props.debugMode&&console.log("Settings event name: "+e.target.name+" Value: "+e.target.value)},n.handleSelectChange=function(e){var t=e.target,o=t.value,i=t.name;n.setState(Object(we.a)({},i,o),(function(){n.props.debugMode&&console.log("Saved select. Name: "+e.target.name+" Value: "+e.target.value)}))},n.toggleShowCustomStyles=function(){n.setState({showCustomStyles:!n.state.showCustomStyles})},n.cleanCustomStyles=function(e){return e?e.replace(Ie,"").replace(Fe,"").replace(Pe,"").replace(Ue,""):e},n.saveText=function(e){n.setState({customStyles:e})},n.handleSubmit=function(){if(n.props.debugMode){var e="",t="";""===n.state.fontEdit||void 0===n.state.fontEdit?e="Default":n.state.fontEdit&&(e=n.state.fontEdit),""===n.state.fontView||void 0===n.state.fontView?t="Default":n.state.fontView&&(t=n.state.fontView),console.log("Settings.tsx handleSubmit() triggered: \n - Settings editingMode: "+n.state.editingMode+"\n - Settings fontEdit: "+n.state.fontEdit+"\n - Settings fontView: "+n.state.fontView+"\n - Your chosen font for Edit/Append is: "+e+"\n - Your chosen font for View/Print is: "+t+"\n")}n.setState({customStyles:n.cleanCustomStyles(n.state.customStyles)},(function(){n.props.debugMode&&console.log("Your custom styles: "+n.state.customStyles);var e=n.state,t=e.customStyles,o=e.editingMode,i=e.fontEdit,s=e.fontSize,a=e.fontView,r=e.monacoEditorLanguage,c=e.saveAsDefault;n.props.onConfirm({customStyles:t,editingMode:o,fontEdit:i,fontSize:s,fontView:a,monacoEditorLanguage:r,saveAsDefault:c})}))},n.loadDefaultSettings=function(){var e=n.props.defaultSettings;n.setState(Object(l.a)({},e),(function(){n.refreshCustomStyles()}))},n.refreshCustomStyles=function(){n.setState({showCustomStyles:!n.state.showCustomStyles},(function(){n.setState({showCustomStyles:!n.state.showCustomStyles})}))},n.clearCustomStyles=function(){n.setState({customStyles:""},(function(){n.refreshCustomStyles(),n.props.debugMode&&console.log("customStyles reset: "+n.state.customStyles)}));var e=document.getElementById("customStyles");e&&(e.value="",e.focus())},n.clearFontEdit=function(){n.setState({fontEdit:""});var e=document.getElementById(Be);e&&(e.value="",e.focus())},n.clearFontSize=function(){n.setState({fontSize:""});var e=document.getElementById(De);e&&(e.value="",e.focus())},n.clearFontView=function(){n.setState({fontView:""});var e=document.getElementById(Ae);e&&(e.value="",e.focus())},n.clearEditingMode=function(){n.setState({editingMode:Xe.usePlainText})},n.clearMonacoEditorLanguage=function(){n.setState({monacoEditorLanguage:"markdown"});var e=document.getElementById(Ve);e&&(e.value="markdown",e.focus())},n.clearSaveAsDefault=function(){n.setState({saveAsDefault:!1});var e=document.getElementById(Ke);e.checked=!1,e.focus()},n.clearAllSettings=function(){n.clearSaveAsDefault(),n.clearCustomStyles(),n.clearFontView(),n.clearFontEdit(),n.clearFontSize(),n.clearMonacoEditorLanguage(),n.clearEditingMode();var e=document.getElementById(He);e&&e.focus()},n.onKeyDown=function(e){n.props.keyMap.set(e.key,!0),(n.props.keyMap.get("Control")&&n.props.keyMap.get("s")||n.props.keyMap.get("Control")&&n.props.keyMap.get("Enter"))&&(e.preventDefault(),n.handleSubmit())},n.onKeyUp=function(e){n.props.keyMap.set(e.key,!1)},n.onBlur=function(e){n.props.keyMap.clear()},n.componentWillUnmount=function(){n.props.keyMap.clear()};var i="markdown";n.props.monacoEditorLanguage&&(i=n.props.monacoEditorLanguage);var s="usePlainText";return n.props.editingMode&&(s=n.props.editingMode),n.state={customStyles:n.props.customStyles,editingMode:s,fontEdit:n.props.fontEdit,fontSize:n.props.fontSize,fontView:n.props.fontView,monacoEditorLanguage:i,saveAsDefault:!1,showCustomStyles:!1},n}return Object(p.a)(o,[{key:"render",value:function(){var e=this.props,t=e.title,o=e.onCancel,i=e.confirmText,s=e.cancelText,a=e.helpLink;return Object(n.jsxs)("div",{id:"settings",className:"sk-panel main settings",children:[Object(n.jsx)("div",{className:"sk-panel-content",children:Object(n.jsxs)("div",{className:"sk-panel-section",children:[Object(n.jsxs)("datalist",{id:"fonts",children:[Object(n.jsx)("option",{value:'SFMono-Regular, Consolas, Liberation Mono, Menlo, "Ubuntu Mono", courier, monospace;'}),Object(n.jsx)("option",{value:"Times New Roman"}),Object(n.jsx)("option",{value:"Arial"}),Object(n.jsx)("option",{value:"Arial Black"}),Object(n.jsx)("option",{value:"-apple-system"}),Object(n.jsx)("option",{value:"Bell MT"}),Object(n.jsx)("option",{value:"Baskerville Old Face"}),Object(n.jsx)("option",{value:"Bahnschrift Light"}),Object(n.jsx)("option",{value:"BlinkMacSystemFont"}),Object(n.jsx)("option",{value:"Bodoni MT"}),Object(n.jsx)("option",{value:"Calibri"}),Object(n.jsx)("option",{value:"Calibri Light"}),Object(n.jsx)("option",{value:"Calisto MT"}),Object(n.jsx)("option",{value:"Cambria"}),Object(n.jsx)("option",{value:"Candara"}),Object(n.jsx)("option",{value:"Candara Light"}),Object(n.jsx)("option",{value:"Cantarell"}),Object(n.jsx)("option",{value:"Centaur"}),Object(n.jsx)("option",{value:"Century"}),Object(n.jsx)("option",{value:"Century Gothic"}),Object(n.jsx)("option",{value:"Comic Sans MS"}),Object(n.jsx)("option",{value:"Consolas"}),Object(n.jsx)("option",{value:"Constantia"}),Object(n.jsx)("option",{value:"Courier New"}),Object(n.jsx)("option",{value:"Corbel"}),Object(n.jsx)("option",{value:"Corbel Light"}),Object(n.jsx)("option",{value:"DengXian"}),Object(n.jsx)("option",{value:"Ebrima"}),Object(n.jsx)("option",{value:"Droid Sans"}),Object(n.jsx)("option",{value:"Fira Sans"}),Object(n.jsx)("option",{value:"Gabriola"}),Object(n.jsx)("option",{value:"Garamond"}),Object(n.jsx)("option",{value:"Georgia"}),Object(n.jsx)("option",{value:"Helvetica"}),Object(n.jsx)("option",{value:"Helvetica Neue"}),Object(n.jsx)("option",{value:"Impact"}),Object(n.jsx)("option",{value:"KaTeX_AMS"}),Object(n.jsx)("option",{value:"KaTeX_Caligraphic"}),Object(n.jsx)("option",{value:"KaTeX_Fraktur"}),Object(n.jsx)("option",{value:"KaTeX_Main"}),Object(n.jsx)("option",{value:"KaTeX_Math"}),Object(n.jsx)("option",{value:"KaTeX_SansSerif"}),Object(n.jsx)("option",{value:"KaTeX_Script"}),Object(n.jsx)("option",{value:"KaTeX_Typewriter"}),Object(n.jsx)("option",{value:"Lato"}),Object(n.jsx)("option",{value:"Liberation Mono"}),Object(n.jsx)("option",{value:"Lucida Caligraphy"}),Object(n.jsx)("option",{value:"Lucida Sans"}),Object(n.jsx)("option",{value:"Menlo"}),Object(n.jsx)("option",{value:"Monaco"}),Object(n.jsx)("option",{value:"Monospace"}),Object(n.jsx)("option",{value:"New York"}),Object(n.jsx)("option",{value:"Oxygen"}),Object(n.jsx)("option",{value:"Palatino"}),Object(n.jsx)("option",{value:"Roboto"}),Object(n.jsx)("option",{value:"Sans-Serif"}),Object(n.jsx)("option",{value:"Segoe UI"}),Object(n.jsx)("option",{value:"SFMono-Regular"}),Object(n.jsx)("option",{value:"Serif"}),Object(n.jsx)("option",{value:"Sylfaen"}),Object(n.jsx)("option",{value:"Tahoma"}),Object(n.jsx)("option",{value:"Times New Roman"}),Object(n.jsx)("option",{value:"Trebuchet MS"}),Object(n.jsx)("option",{value:"Ubuntu"}),Object(n.jsx)("option",{value:"Verdana"}),Object(n.jsx)("option",{value:"Yu Gothic"})]}),Object(n.jsxs)("div",{className:"sk-panel-row title-section",children:[Object(n.jsx)("h1",{children:t}),Object(n.jsx)("button",{id:"undoDialog",onClick:o,title:"Close",children:Object(n.jsx)(m,{role:"button"})})]}),Object(n.jsx)("section",{className:"sk-panel-row settings",children:Object(n.jsxs)("div",{className:"text-and-undo-button",children:[Object(n.jsxs)("p",{children:["Need help? Check out the"," ",Object(n.jsx)("a",{href:a,target:"_blank",rel:"noopener noreferrer",children:"documentation"}),". To clear all settings, click undo:\xa0"]}),Object(n.jsx)(Le,{onClick:this.clearAllSettings,title:"Reset all Settings",id:He})]})}),Object(n.jsx)("section",{className:"sk-panel-row settings",children:Object(n.jsxs)("div",{className:"text-and-undo-button",children:[Object(n.jsx)("p",{children:"To load your personal default settings, click:\xa0"}),Object(n.jsx)("button",{onClick:this.loadDefaultSettings,title:"Load personal default settings",children:Object(n.jsx)(k,{role:"button"})})]})}),Object(n.jsx)("section",{className:"sk-panel-row settings",children:Object(n.jsxs)("div",{className:"text-and-undo-button",children:[Object(n.jsx)("p",{children:"Editing Mode: "}),Object(n.jsx)(Le,{onClick:this.clearEditingMode,title:"Reset Editing Mode to Plain Textarea"})]})}),Object(n.jsx)("section",{className:"sk-panel-row settings",children:Object(n.jsxs)("label",{children:[Object(n.jsx)("input",{id:Xe.usePlainText,name:Ne,value:Xe.usePlainText,className:"radio",type:"radio",checked:this.state.editingMode===Xe.usePlainText,onChange:this.handleInputChange}),"Plain Textarea: standard textarea with spellcheck (default, mobile recommended)"]})}),Object(n.jsx)("section",{className:"sk-panel-row settings",children:Object(n.jsxs)("label",{children:[Object(n.jsx)("input",{id:Xe.useCodeMirror,name:Ne,value:Xe.useCodeMirror,type:"radio",className:"radio",checked:this.state.editingMode===Xe.useCodeMirror,onChange:this.handleInputChange}),"CodeMirror: in-line formatting for Markdown"]})}),Object(n.jsx)("section",{className:"sk-panel-row settings",children:Object(n.jsxs)("label",{children:[Object(n.jsx)("input",{id:Xe.useDynamicEditor,name:Ne,value:Xe.useDynamicEditor,type:"radio",className:"radio",checked:this.state.editingMode===Xe.useDynamicEditor,onChange:this.handleInputChange}),"Dynamic: live formatting for Markdown. ",Object(n.jsx)("b",{children:"warning: "}),"existing Markdown may break (not compatible with KaTeX, lists may not render properly; desktop and mobile compatible)"]})}),Object(n.jsx)("section",{className:"sk-panel-row settings",children:Object(n.jsxs)("label",{htmlFor:Xe.useMonacoEditor,children:[Object(n.jsx)("input",{id:Xe.useMonacoEditor,name:Ne,value:Xe.useMonacoEditor,type:"radio",className:"radio",checked:this.state.editingMode===Xe.useMonacoEditor,onChange:this.handleInputChange}),"Monaco: syntax highlighting for Markdown and many other programming languages, intelligent auto-completion, sophisticated search and replace (desktop recommended)"]})}),this.state.editingMode===Xe.useMonacoEditor&&[Object(n.jsxs)("section",{className:"sk-panel-row settings",children:[Object(n.jsxs)("label",{htmlFor:Ve,children:["Monaco Editor Language:"," "]}),Object(n.jsxs)("div",{className:"input-and-undo-button",children:[Object(n.jsx)("label",{children:Object(n.jsxs)("select",{id:Ve,name:Ve,value:this.state.monacoEditorLanguage,onChange:this.handleSelectChange,children:[Object(n.jsx)("option",{children:"abap"}),Object(n.jsx)("option",{children:"aes"}),Object(n.jsx)("option",{children:"apex"}),Object(n.jsx)("option",{children:"azcli"}),Object(n.jsx)("option",{children:"bat"}),Object(n.jsx)("option",{children:"c"}),Object(n.jsx)("option",{children:"cameligo"}),Object(n.jsx)("option",{children:"clojure"}),Object(n.jsx)("option",{children:"coffeescript"}),Object(n.jsx)("option",{children:"cpp"}),Object(n.jsx)("option",{children:"csharp"}),Object(n.jsx)("option",{children:"csp"}),Object(n.jsx)("option",{children:"css"}),Object(n.jsx)("option",{children:"dart"}),Object(n.jsx)("option",{children:"dockerfile"}),Object(n.jsx)("option",{children:"fsharp"}),Object(n.jsx)("option",{children:"go"}),Object(n.jsx)("option",{children:"graphql"}),Object(n.jsx)("option",{children:"handlebars"}),Object(n.jsx)("option",{children:"hcl"}),Object(n.jsx)("option",{children:"html"}),Object(n.jsx)("option",{children:"ini"}),Object(n.jsx)("option",{children:"java"}),Object(n.jsx)("option",{children:"javascript"}),Object(n.jsx)("option",{children:"json"}),Object(n.jsx)("option",{children:"julia"}),Object(n.jsx)("option",{children:"kotlin"}),Object(n.jsx)("option",{children:"less"}),Object(n.jsx)("option",{children:"lexon"}),Object(n.jsx)("option",{children:"lua"}),Object(n.jsx)("option",{children:"markdown"}),Object(n.jsx)("option",{children:"mips"}),Object(n.jsx)("option",{children:"msdax"}),Object(n.jsx)("option",{children:"mysql"}),Object(n.jsx)("option",{children:"objective-c"}),Object(n.jsx)("option",{children:"pascal"}),Object(n.jsx)("option",{children:"pascaligo"}),Object(n.jsx)("option",{children:"perl"}),Object(n.jsx)("option",{children:"pgsql"}),Object(n.jsx)("option",{children:"php"}),Object(n.jsx)("option",{children:"plaintext"}),Object(n.jsx)("option",{children:"postiats"}),Object(n.jsx)("option",{children:"powerquery"}),Object(n.jsx)("option",{children:"powershell"}),Object(n.jsx)("option",{children:"pug"}),Object(n.jsx)("option",{children:"python"}),Object(n.jsx)("option",{children:"r"}),Object(n.jsx)("option",{children:"razor"}),Object(n.jsx)("option",{children:"redis"}),Object(n.jsx)("option",{children:"redshift"}),Object(n.jsx)("option",{children:"restructuredtext"}),Object(n.jsx)("option",{children:"ruby"}),Object(n.jsx)("option",{children:"rust"}),Object(n.jsx)("option",{children:"sb"}),Object(n.jsx)("option",{children:"scala"}),Object(n.jsx)("option",{children:"scheme"}),Object(n.jsx)("option",{children:"scss"}),Object(n.jsx)("option",{children:"shell"}),Object(n.jsx)("option",{children:"sol"}),Object(n.jsx)("option",{children:"sql"}),Object(n.jsx)("option",{children:"st"}),Object(n.jsx)("option",{children:"swift"}),Object(n.jsx)("option",{children:"systemverilog"}),Object(n.jsx)("option",{children:"tcl"}),Object(n.jsx)("option",{children:"twig"}),Object(n.jsx)("option",{children:"typescript"}),Object(n.jsx)("option",{children:"vb"}),Object(n.jsx)("option",{children:"verilog"}),Object(n.jsx)("option",{children:"xml"}),Object(n.jsx)("option",{children:"yaml"})]})}),Object(n.jsx)(Le,{onClick:this.clearMonacoEditorLanguage,title:"Reset Monaco Editor Language to Markdown"})]})]})],Object(n.jsxs)("section",{className:"sk-panel-row settings",children:[Object(n.jsx)("label",{htmlFor:De,children:"Choose a base font size: "}),Object(n.jsxs)("div",{className:"input-and-undo-button",children:[Object(n.jsxs)("select",{id:De,name:De,value:this.state.fontSize,onChange:this.handleSelectChange,children:[Object(n.jsx)("option",{}),Object(n.jsx)("option",{children:"12px"}),Object(n.jsx)("option",{children:"13px"}),Object(n.jsx)("option",{children:"14px"}),Object(n.jsx)("option",{children:"15px"}),Object(n.jsx)("option",{children:"16px"}),Object(n.jsx)("option",{children:"17px"}),Object(n.jsx)("option",{children:"18px"}),Object(n.jsx)("option",{children:"19px"}),Object(n.jsx)("option",{children:"20px"}),Object(n.jsx)("option",{children:"21px"}),Object(n.jsx)("option",{children:"22px"}),Object(n.jsx)("option",{children:"23px"}),Object(n.jsx)("option",{children:"24px"}),Object(n.jsx)("option",{children:"25px"}),Object(n.jsx)("option",{children:"26px"}),Object(n.jsx)("option",{children:"27px"}),Object(n.jsx)("option",{children:"28px"}),Object(n.jsx)("option",{children:"29px"}),Object(n.jsx)("option",{children:"30px"})]}),Object(n.jsx)(Le,{onClick:this.clearFontSize,title:"Reset font size to 16px"})]})]}),this.state.editingMode!==Xe.useMonacoEditor&&[Object(n.jsxs)("section",{className:"sk-panel-row settings",children:[Object(n.jsxs)("label",{htmlFor:Be,children:["Choose a font for Edit/Append:"," "]}),Object(n.jsxs)("div",{className:"input-and-undo-button",children:[Object(n.jsx)("input",{list:"fonts",id:Be,name:Be,value:this.state.fontEdit,onChange:this.handleInputChange,onKeyDown:this.onKeyDown,onKeyUp:this.onKeyUp,type:"text"}),Object(n.jsx)(Le,{onClick:this.clearFontEdit,title:"Reset font for Edit/Append"})]})]})],this.state.editingMode!==Xe.useDynamicEditor&&[Object(n.jsxs)("section",{className:"sk-panel-row settings",children:[Object(n.jsxs)("label",{htmlFor:Ae,children:["Choose a font for View/Print:"," "]}),Object(n.jsxs)("div",{className:"input-and-undo-button",children:[Object(n.jsx)("input",{list:"fonts",id:Ae,name:Ae,value:this.state.fontView,onChange:this.handleInputChange,onKeyDown:this.onKeyDown,onKeyUp:this.onKeyUp,type:"text"}),Object(n.jsx)(Le,{onClick:this.clearFontView,title:"Reset font for View/Print"})]})]})],Object(n.jsxs)("section",{className:"sk-panel-row settings",children:[Object(n.jsx)(Ce,{caption:"Add custom styles (CSS):",className:"chevron-toggle-button",condition:this.state.showCustomStyles,onClick:this.toggleShowCustomStyles,title:"Toggle show add custom styles (CSS)"}),this.state.showCustomStyles&&[Object(n.jsx)("div",{className:"text-and-undo-button",children:Object(n.jsx)(Le,{onClick:this.clearCustomStyles,title:"Reset custom styles (CSS)"})})]]}),this.state.showCustomStyles&&[Object(n.jsx)("section",{className:"sk-panel-row settings",children:Object(n.jsx)(A,{tabSize:2,language:"css",text:this.state.customStyles,onKeyDown:this.onKeyDown,onKeyUp:this.onKeyUp,saveText:this.saveText})})],Object(n.jsxs)("section",{className:"sk-panel-row settings",children:[Object(n.jsxs)("label",{htmlFor:Ke,children:["Save these settings as your personal default:"," "]}),Object(n.jsxs)("div",{className:"input-and-undo-button",children:[Object(n.jsx)("label",{children:Object(n.jsx)("input",{id:Ke,name:Ke,type:"checkbox",checked:this.state.saveAsDefault,onChange:this.handleInputChange})}),Object(n.jsx)(Le,{onClick:this.clearSaveAsDefault,title:"Clear save as default"})]})]})]})}),Object(n.jsx)("div",{className:"sk-panel-footer",children:Object(n.jsxs)("div",{className:"sk-button-group stretch",children:[Object(n.jsx)("button",{className:"sk-button neutral",onClick:o,children:Object(n.jsx)("div",{children:s})}),Object(n.jsx)("button",{className:"sk-button info",onClick:this.handleSubmit,children:Object(n.jsx)("div",{children:i})})]})})]})}}]),o}(s.a.Component),Re=function(e){Object(h.a)(o,e);var t=Object(u.a)(o);function o(e){var n;return Object(d.a)(this,o),(n=t.call(this,e)).state={hasError:!1},n}return Object(p.a)(o,[{key:"componentDidCatch",value:function(e,t){console.log("Error:",e,"\nError Info:",t),this.setState({error:e,errorInfo:t})}},{key:"render",value:function(){var e,t;return this.state.hasError?Object(n.jsx)("div",{className:"sk-panel main",children:Object(n.jsx)("div",{className:"sk-panel-content view",children:Object(n.jsxs)("div",{id:"errorBoundary",children:[Object(n.jsx)("h1",{children:"Something went wrong."}),Object(n.jsxs)("p",{children:["Error Name: ",Object(n.jsx)("code",{children:null===(e=this.state.error)||void 0===e?void 0:e.name})]}),Object(n.jsxs)("p",{children:["Error Message: ",Object(n.jsx)("code",{children:null===(t=this.state.error)||void 0===t?void 0:t.message})]}),Object(n.jsx)("p",{children:"Please see the developer console for details."}),Object(n.jsx)("hr",{}),Object(n.jsxs)("p",{children:["Errors such as ",Object(n.jsx)("code",{children:"TypeError"})," and"," ",Object(n.jsx)("code",{children:"Cannot read property 'type' of undefined"})," usually occur when the editor is unable to process and render your notes because it contains incorrect or incomplete HTML. If you are writing in HTML, then please continue to write and refresh the View Mode when the HTML tags are closed."]}),Object(n.jsxs)("p",{children:["If you are using the Dynamic editing mode, then please switch to the Plain Textarea or Monaco editing modes in the Settings",Object(n.jsxs)("button",{className:"inline-text-and-svg",onClick:Y,title:"Open Settings",children:[Object(n.jsx)("span",{children:"\xa0"}),Object(n.jsx)(w,{role:"button"}),Object(n.jsx)("span",{children:"\xa0"})]}),"and remove or fix the text that is causing the error."]}),Object(n.jsxs)("p",{children:["If the error persists or is not related to the content of your note, then please"," ",Object(n.jsx)("a",{href:"https://github.com/TheodoreChu/append-editor/issues",target:"_blank",rel:"noopener noreferrer",children:"report the issue on GitHub"})," ","and we will try to fix it."," ",Object(n.jsx)("span",{role:"img","aria-label":"smile emoji",children:"\ud83d\ude42"})]})]})})}):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return{hasError:!0}}}]),o}(s.a.Component),We=o(447),_e=o.n(We),Ze=o(448),Ye=o.n(Ze);!function(e){e.chevronToggleButton="menu-button chevron-toggle-button",e.menuButton="menu-button",e.on=" on",e.off=" off"}(ye||(ye={}));var Ge,qe,Xe,Qe=function(e){Object(h.a)(o,e);var t=Object(u.a)(o);function o(e){var n;return Object(d.a)(this,o),(n=t.call(this,e)).clearTooltipTimer=void 0,n.resetMessageTimer=function(){n.clearTooltipTimer&&clearTimeout(n.clearTooltipTimer),n.clearTooltipTimer=setTimeout((function(){n.setState({displayMessageEdit:!1,displayMessageShare:!1})}),5e3)},n.showMessageEdit=function(){n.setState({displayMessageEdit:!0,displayMessageShare:!1},(function(){n.resetMessageTimer()}))},n.showMessageShare=function(){n.setState({displayMessageEdit:!1,displayMessageShare:!0},(function(){n.resetMessageTimer()}))},n.copyToClipboard=function(e){var t=document.createElement("textarea");t.value=e,document.body.appendChild(t),t.select(),document.execCommand("copy"),n.showMessageShare(),t.remove()},n.copyText=function(){n.props.text?n.setState({message:"Copied Text to clipboard"},(function(){n.copyToClipboard(n.props.text)})):n.setState({message:"No text to copy. Your note is empty"},(function(){n.showMessageShare()}))},n.copyHtml=function(){if(n.props.viewMode)if(n.props.text){var e,t=document.getElementById("renderedNote");(null===t||void 0===t||null===(e=t.firstElementChild)||void 0===e?void 0:e.innerHTML)&&(n.setState({message:"Copied HTML to clipboard"}),n.copyToClipboard(null===t||void 0===t?void 0:t.firstElementChild.innerHTML))}else n.setState({message:"No HTML to copy. Your note is empty"},(function(){n.showMessageShare()}));else n.setState({message:"Unable to copy HTML. Please turn View Mode on"},(function(){return n.showMessageShare()}))},n.formatText=function(){"markdown"!==n.props.monacoEditorLanguage&&n.props.editingMode===Xe.useMonacoEditor?n.setState({message:"Error: Your Monaco Editor language is not Markdown. Formatting is only available for Markdown"},(function(){n.showMessageEdit()})):n.props.text?n.setState({message:"Formatted Markdown text with Prettier"},(function(){try{var e=_e.a.format(n.props.text,{parser:"markdown",plugins:[Ye.a]});n.props.saveText(e),n.props.refreshEdit(),n.props.refreshView(),n.showMessageEdit()}catch(t){n.setState({message:"Error formatting text: "+t},(function(){n.showMessageEdit()})),console.log("Error formatting text: "+t)}})):n.setState({message:"No text to format. Your note is empty"},(function(){n.showMessageEdit()}))},n.uncheckBoxes=function(){var e=n.props.text,t=new RegExp(/- \[x\]/gm);if(t.test(e)){var o=e.replace(t,"- [ ]");n.props.saveText(o),n.props.refreshEdit(),n.props.refreshView(),n.setState({message:"Unchecked all checkboxes"},(function(){n.showMessageEdit()}))}else n.setState({message:"No checked checkboxes found"},(function(){n.showMessageEdit()}))},n.state={message:"",displayMessageEdit:!1,displayMessageShare:!1},n}return Object(p.a)(o,[{key:"render",value:function(){return[Object(n.jsx)("div",{className:"menu-overlay",onClick:this.props.toggleShowMenu}),Object(n.jsxs)("div",{id:"menu",children:[Object(n.jsx)(Ce,{caption:"Appearance",className:ye.chevronToggleButton,condition:this.props.showMenuOptionsView,onClick:this.props.toggleShowMenuOptionsView,title:"Toggle show options for the appearance of the editor"}),this.props.showMenuOptionsView&&[Object(n.jsx)(Se,{caption:"Borderless",className:ye.menuButton+(this.props.borderlessMode?ye.on:ye.off),condition:this.props.borderlessMode,messageOn:"on",messageOff:"off",onClick:this.props.toggleBorderlessMode,title:"Toggle Borderless Mode. Blends borders and margins into the background for a cleaner look"}),Object(n.jsx)(Se,{caption:"Fixed Height",className:ye.menuButton+(this.props.fixedHeightMode?ye.on:ye.off),condition:this.props.fixedHeightMode,messageOn:"on",messageOff:"off",onClick:this.props.toggleFixedHeightMode,title:"Toggle Fixed Height Mode. Limits the height of the content container for easier side-by-side editing"}),Object(n.jsx)(Se,{caption:"Full Width",className:ye.menuButton+(this.props.fullWidthMode?ye.on:ye.off),condition:this.props.fullWidthMode,messageOn:"on",messageOff:"off",onClick:this.props.toggleFullWidthMode,title:"Toggle Full Width Mode for unrestricted editing. Borderless mode plus unset maximum container widths"}),Object(n.jsx)(Se,{caption:"Horizontal Overflow",className:ye.menuButton+(this.props.overflowMode?ye.on:ye.off),condition:this.props.overflowMode,messageOn:"visible",messageOff:"auto",onClick:this.props.toggleOverflowMode,title:"Toggle Horizontal Overflow. Visible is great for editing and viewing large tables and preformatted text. Works best with Full Width mode"})],Object(n.jsx)(Ce,{caption:"Share",className:ye.chevronToggleButton,condition:this.props.showMenuOptionsShare,onClick:this.props.toggleShowMenuOptionsShare,title:"Toggle show options to share your note"}),this.props.showMenuOptionsShare&&[Object(n.jsx)(Ee,{caption:"Copy note text",className:ye.menuButton,fill:"var(--sn-stylekit-success-color)",onClick:this.copyText,title:"Copy the text of your note to your device's clipboard"}),Object(n.jsx)(Ee,{caption:"Copy rendered HTML",className:ye.menuButton,fill:"var(--sn-stylekit-success-color)",onClick:this.copyHtml,title:"Copy the rendered HTML from your note text to your device's clipboard"}),Object(n.jsx)(Te,{caption:"Print rendered note",className:"menu-button off",fill:"var(--sn-stylekit-foreground-color)",id:Ge.printButton,onClick:this.props.onConfirmPrintUrl,title:"Print rendered note. Works best on the web app in Chromium browsers (e.g., MS Edge, Google Chrome). Not available on mobile"}),Object(n.jsx)("div",{className:"notification ".concat(this.state.displayMessageShare?"visible":"hidden"),children:Object(n.jsx)("p",{children:Object(n.jsx)("b",{children:this.state.message})})})],Object(n.jsx)(Ce,{caption:"Actions",className:ye.chevronToggleButton,condition:this.props.showMenuOptionsEdit,onClick:this.props.toggleShowMenuOptionsEdit,title:"Toggle show actions to quickly format and edit your note"}),this.props.showMenuOptionsEdit&&[Object(n.jsx)(ke,{caption:"Format Markdown text",className:ye.menuButton,fill:"var(--sn-stylekit-warning-color)",onClick:this.formatText,title:"Format Markdown text with Prettier. WARNING: this may cause undesired changes to your note text. Use the Note History feature to revert unwanted changes"}),Object(n.jsx)(ke,{caption:"Uncheck all checkboxes",className:ye.menuButton,fill:"var(--sn-stylekit-danger-color)",onClick:this.uncheckBoxes,title:"Uncheck all checkboxes. DANGER: this may cause undesired changes to your note text. Use the Note History feature to revert unwanted changes"}),Object(n.jsx)("div",{className:"notification ".concat(this.state.displayMessageEdit?"visible":"hidden"),children:Object(n.jsx)("p",{children:Object(n.jsx)("b",{children:this.state.message})})})],Object(n.jsx)("div",{className:"extra-space"})]})]}}]),o}(s.a.Component),Je=o(108),$e=o.n(Je);o(1161),o(1166),o(1167),o(1168),o(437),o(1170),o(305),o(304),o(1171);!function(e){e.appendButton="appendButton",e.appendTextArea="appendTextArea",e.appendix="appendix",e.content="content",e.edit="edit",e.editButton="editButton",e.editTextArea="editTextArea",e.header="header",e.helpButton="helpButton",e.menuButton="menuButton",e.newLine="newLine",e.newParagraph="newParagraph",e.printButton="printButton",e.settingsButton="settingsButton",e.view="view",e.viewButton="viewButton"}(Ge||(Ge={})),function(e){e.fixed="fixed",e.fixedHeader="fixed-header"}(qe||(qe={})),function(e){e.usePlainText="usePlainText",e.useCodeMirror="useCodeMirror",e.useDynamicEditor="useDynamicEditor",e.useMonacoEditor="useMonacoEditor"}(Xe||(Xe={}));var et={text:"",appendNewLine:!1,appendNewParagraph:!1,appendMode:!1,appendRows:8,appendText:"",bypassDebounce:!1,confirmPrintUrl:!1,customStyles:"",defaultSettings:{customStyles:"",editingMode:"usePlainText",fontEdit:"",fontSize:"",fontView:"",monacoEditorLanguage:"markdown"},fontEdit:"",fontSize:"",fontView:"",monacoEditorLanguage:"markdown",printURL:!0,refreshEdit:!1,refreshView:!1,showAppendix:!0,showHeader:!0,showHelp:!1,showDiff:!1,settingsMode:!1},tt=0,ot=!1,nt=new Map,it=function(e){Object(h.a)(o,e);var t=Object(u.a)(o);function o(e){var n;return Object(d.a)(this,o),(n=t.call(this,e)).editorKit=void 0,n.refreshEditorTimer=void 0,n.saveTimer=void 0,n.componentDidMount=function(){n.onViewMode(),n.loadDefaultMenuState(),document.addEventListener("scroll",n.onScroll)},n.componentWillUnmount=function(){document.removeEventListener("scroll",n.onScroll)},n.configureEditorKit=function(){var e=new j.EditorKitDelegate({setEditorRawText:function(e){n.setState(Object(l.a)(Object(l.a)({},et),{},{bypassDebounce:!0,text:e}),(function(){me.cancel(),me(e),me.flush(),ve.cancel(),me(e)&&(ve(e),ve.flush()),n.state.savingEditorOptions||(n.loadEditorOptions(),n.loadDefaultSettings(),n.loadMetaData()),setTimeout((function(){n.setState({bypassDebounce:!1})}),1e3)}))},clearUndoHistory:function(){},getElementsBySelector:function(){return[]}});n.editorKit=new j.EditorKit({delegate:e,mode:"plaintext",supportsFilesafe:!1})},n.refreshEditor=function(){me(n.state.text)?(n.refreshEditorTimer&&clearTimeout(n.refreshEditorTimer),n.refreshEditorTimer=setTimeout((function(){n.state.savingEditorOptions||(n.refreshEdit(),n.refreshView(),n.activateStyles())}),20)):(n.refreshEditorTimer&&clearTimeout(n.refreshEditorTimer),n.refreshEditorTimer=setTimeout((function(){n.state.savingEditorOptions||(n.refreshEdit(),n.refreshView(),n.activateStyles())}),10))},n.loadDefaultSettings=function(){try{var e=n.editorKit.internal.componentManager.componentDataValueForKey("defaultSettings"),t=n.editorKit.internal.componentManager.componentDataValueForKey("editingMode");if(void 0!==e){var o=JSON.parse(e);ot,n.setState({customStyles:o.customStyles,editingMode:o.editingMode,fontEdit:o.fontEdit,fontSize:o.fontSize,fontView:o.fontView,monacoEditorLanguage:o.monacoEditorLanguage,defaultSettings:o},(function(){n.refreshEditor()}))}else if(void 0!==t){var i=n.editorKit.internal.componentManager.componentDataValueForKey("customStyles"),s=n.editorKit.internal.componentManager.componentDataValueForKey("fontEdit"),a=n.editorKit.internal.componentManager.componentDataValueForKey("fontSize"),r=n.editorKit.internal.componentManager.componentDataValueForKey("fontView"),c=n.editorKit.internal.componentManager.componentDataValueForKey("monacoEditorLanguage");ot,n.setState({customStyles:i,editingMode:t,fontEdit:s,fontSize:a,fontView:r,monacoEditorLanguage:c,defaultSettings:{customStyles:i,editingMode:t,fontEdit:s,fontSize:a,fontView:r,monacoEditorLanguage:c}},(function(){n.refreshEditor()}))}else n.refreshEditor()}catch(l){console.log("Error loading default settings:",l)}},n.loadEditorOptions=function(){try{var e=n.editorKit.internal.componentManager.componentDataValueForKey("menuOptions");if(void 0!==e){var t=JSON.parse(e);n.setState({borderlessMode:t.borderlessMode,fixedHeightMode:t.fixedHeightMode,fullWidthMode:t.fullWidthMode,overflowMode:t.overflowMode},(function(){n.refreshEditor()}))}}catch(o){console.log("Error loading editor options:",o)}},n.loadMetaData=function(){n.editorKit.internal.componentManager.streamContextItem((function(e){(e.content.appendEditorCustomStyles||e.content.appendEditorEditingMode||e.content.appendEditorFontEdit||e.content.appendEditorFontSize||e.content.appendEditorFontView||e.content.appendEditorMonacoEditorLanguage)&&n.setState({customStyles:e.content.appendEditorCustomStyles,editingMode:e.content.appendEditorEditingMode,fontEdit:e.content.appendEditorFontEdit,fontSize:e.content.appendEditorFontSize,fontView:e.content.appendEditorFontView,monacoEditorLanguage:e.content.appendEditorMonacoEditorLanguage},(function(){n.refreshEditor()})),(e.content.appendNewLine||e.content.appendNewParagraph)&&n.setState({appendNewLine:e.content.appendNewLine,appendNewParagraph:e.content.appendNewParagraph}),n.setState({appendText:e.content.appendText},(function(){n.state.text||n.state.appendText||n.state.editMode||n.onEditMode()}))}))},n.saveText=function(e){n.saveNote(e),n.setState({text:e},(function(){n.state.editingMode===Xe.useDynamicEditor?n.refreshView():n.state.viewMode&&me(e)&&(n.saveTimer&&clearTimeout(n.saveTimer),n.saveTimer=setTimeout((function(){if(n.state.fixedHeightMode){var e=document.getElementById(Ge.view);if(e){var t=e.scrollTop;n.refreshView();var o=document.getElementById(Ge.view);o&&(o.scrollTop=t)}else n.refreshView()}else n.refreshView()}),550))}))},n.saveNote=function(e){try{n.editorKit.onEditorValueChanged(e)}catch(t){console.log("Error saving note:",t)}},n.appendTextToNote=function(){if(n.state.appendText){var e=n.state.appendText,t="";t=n.state.appendNewParagraph?" \n\n"+e:n.state.appendNewLine?" \n"+e:e,n.setState({text:n.state.text.concat(t),appendText:""},(function(){var e=n.editorKit.internal.note;e&&n.editorKit.internal.componentManager.saveItemWithPresave(e,(function(){e.content.text=n.state.text,e.content.appendText=n.state.appendText})),n.refreshEdit(),n.state.editingMode===Xe.useDynamicEditor?(n.refreshView(),setTimeout((function(){n.skipToBottom()}),50)):me(n.state.text)?setTimeout((function(){n.refreshView(),n.skipToBottom()}),550):n.skipToBottom()}))}n.state.appendCodeMirror&&n.state.editingMode===Xe.useCodeMirror&&n.state.appendCodeMirror.setValue("")},n.autoSaveAppendText=function(e){n.setState({appendText:e});try{var t=n.editorKit.internal.note;t&&n.editorKit.internal.componentManager.saveItemWithPresave(t,(function(){t.content.appendText=e}))}catch(o){console.log("Error saving appendText:",o)}},n.autoSaveCheckBoxes=function(e,t){n.setState({appendNewLine:e,appendNewParagraph:t});try{var o=n.editorKit.internal.note;o&&n.editorKit.internal.componentManager.saveItemWithPresave(o,(function(){o.content.appendNewLine=e,o.content.appendNewParagraph=t}))}catch(i){console.log("Error saving checkboxes:",i)}},n.refreshEdit=function(){n.setState({refreshEdit:!n.state.refreshEdit},(function(){document.getElementById(Ge.editTextArea)&&n.state.editingMode===Xe.useCodeMirror&&n.configureCodeMirror(Ge.editTextArea)}))},n.refreshView=function(){n.setState({refreshView:!n.state.refreshView})},n.configureCodeMirror=function(e){if(e===Ge.editTextArea){ot;var t=document.getElementById(e);if(t){var o=$e.a.fromTextArea(t,{autocorrect:!0,autocapitalize:!0,extraKeys:{Enter:"newlineAndIndentContinueMarkdownList","Alt-F":"findPersistent"},lineNumbers:!1,lineWrapping:!0,mode:"gfm",spellcheck:!0,styleSelectedText:!0,tabindex:0,theme:"default",value:n.state.text});o.setSize("100%","100%"),o.on("change",(function(){var e=o.getValue();o.save(),n.saveText(e)})),o.on("keydown",(function(e,t){n.onKeyDown(t),n.onKeyDownEditTextArea(t),n.onKeyDownTextArea(t)})),o.on("keyup",(function(e,t){n.onKeyUp(t)})),n.setState({editCodeMirror:o})}}else if(e===Ge.appendTextArea){var i=document.getElementById(Ge.appendTextArea);if(i){var s=$e.a.fromTextArea(i,{autocorrect:!0,autocapitalize:!0,extraKeys:{Enter:"newlineAndIndentContinueMarkdownList","Alt-F":"findPersistent"},lineNumbers:!1,lineWrapping:!0,mode:"gfm",spellcheck:!0,styleSelectedText:!0,tabindex:0,theme:"default",value:n.state.appendText});s.setSize("100%","100%"),s.on("change",(function(){var e=s.getValue();s.save(),n.autoSaveAppendText(e)})),s.on("keydown",(function(e,t){n.onKeyDown(t),n.onKeyDownAppendTextArea(t),n.onKeyDownTextArea(t)})),s.on("keyup",(function(e,t){n.onKeyUp(t)})),n.setState({appendCodeMirror:s})}}},n.makeContentEditable=function(){var e=document.getElementById(Ge.content);e&&(e.setAttribute("contenteditable","true"),e.setAttribute("spellcheck","true"));var t=document.getElementById(Ge.appendix);t&&(t.setAttribute("contenteditable","true"),t.setAttribute("spellcheck","true"));var o=document.getElementById("renderedNote");o&&o.setAttribute("contenteditable","false");var n=document.getElementById("appendCustom");n&&n.setAttribute("contenteditable","false")},n.removeContentEditable=function(e){var t=document.getElementById(e);t&&t.setAttribute("contenteditable","false")},n.onEditMode=function(){n.state.editMode?n.state.editMode&&(n.state.editingMode!==Xe.useMonacoEditor&&n.setState({viewMode:!0}),n.state.editCodeMirror&&n.state.editCodeMirror.toTextArea(),n.setState({editMode:!1},(function(){if(!n.state.appendMode){var e=document.getElementById(Ge.editButton);e&&e.focus()}}))):(n.state.appendMode&&!n.state.appendText&&n.setState({appendMode:!1}),n.setState({editMode:!0},(function(){var e=document.getElementById(Ge.editTextArea);e&&(e.focus(),n.state.editingMode===Xe.useCodeMirror&&n.configureCodeMirror(Ge.editTextArea))})))},n.onAppendMode=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];n.state.appendMode?n.state.appendMode&&(n.state.appendCodeMirror&&n.state.appendCodeMirror.toTextArea(),n.setState({appendMode:!1},(function(){if(n.state.editingMode===Xe.useMonacoEditor&&n.refreshEdit(),o){var e=document.getElementById(Ge.appendButton);e&&e.focus()}}))):(t&&n.setState({editMode:!1}),n.setState({appendMode:!0},(function(){if(e&&n.scrollToBottom(),o){var t=document.getElementById(Ge.appendTextArea);t&&(t.focus(),n.state.editingMode===Xe.useCodeMirror&&n.configureCodeMirror(Ge.appendTextArea))}})))},n.onViewMode=function(){n.state.viewMode||n.setState({viewMode:!0},(function(){n.state.editingMode===Xe.useMonacoEditor&&n.refreshEdit(),n.state.appendMode&&!n.state.editMode&&n.skipToBottom()})),n.state.viewMode&&n.setState({viewMode:!1},(function(){n.state.editingMode===Xe.useMonacoEditor&&n.refreshEdit(),n.state.editMode||n.state.appendMode||n.onEditMode()}))},n.toggleShowHelp=function(){n.state.showHelp?n.setState({showHelp:!1},(function(){n.refreshView();var e=document.getElementById(Ge.helpButton);e&&e.focus()})):n.setState({showHelp:!0},(function(){n.state.viewMode?n.state.viewMode&&n.refreshView():n.onViewMode();var e=document.getElementById(Ge.helpButton);e&&e.focus(),setTimeout((function(){n.scrollToTop()}),50)}))},n.toggleShowMenu=function(){n.setState({showMenu:!n.state.showMenu},(function(){var e=document.getElementById(Ge.menuButton);e&&e.focus()}))},n.loadDefaultMenuState=function(){n.setState({showMenuOptionsEdit:!1,showMenuOptionsShare:!0,showMenuOptionsView:!0})},n.toggleShowMenuOptionsEdit=function(){n.setState({showMenuOptionsEdit:!n.state.showMenuOptionsEdit})},n.toggleShowMenuOptionsShare=function(){n.setState({showMenuOptionsShare:!n.state.showMenuOptionsShare})},n.toggleShowMenuOptionsView=function(){n.setState({showMenuOptionsView:!n.state.showMenuOptionsView})},n.toggleBorderlessMode=function(){n.setState({borderlessMode:!n.state.borderlessMode},(function(){n.activateFixedHeader(),n.saveMenuOptions()}))},n.toggleFixedHeightMode=function(){n.setState({fixedHeightMode:!n.state.fixedHeightMode},(function(){n.activateFixedHeader(),n.saveMenuOptions()}))},n.toggleFullWidthMode=function(){n.setState({fullWidthMode:!n.state.fullWidthMode},(function(){n.activateFixedHeader(),n.saveMenuOptions()}))},n.toggleOverflowMode=function(){n.setState({overflowMode:!n.state.overflowMode},(function(){n.activateFixedHeader(),n.saveMenuOptions()}))},n.saveMenuOptions=function(){var e;e={borderlessMode:n.state.borderlessMode,fixedHeightMode:n.state.fixedHeightMode,fullWidthMode:n.state.fullWidthMode,overflowMode:n.state.overflowMode},n.saveEditorOption("menuOptions",JSON.stringify(e))},n.saveEditorOption=function(e,t){n.setState({savingEditorOptions:!0},(function(){try{n.editorKit.internal.componentManager.setComponentDataValueForKey(e,t),setTimeout((function(){n.setState({savingEditorOptions:!1},(function(){n.loadDefaultSettings(),n.loadMetaData()}))}),250)}catch(o){console.log("Error saving editor option. Your optionKey:",e,"\n - Your optionValue: ",t,"\n - The error: ",o),n.setState({savingEditorOptions:!1},(function(){n.refreshEditor(),n.loadDefaultSettings(),n.loadMetaData()}))}}))},n.onSettingsMode=function(){n.state.settingsMode?n.state.settingsMode&&n.setState(Object(l.a)(Object(l.a)({},n.state.currentState),{},{settingsMode:!1}),(function(){n.refreshEdit();var e=document.getElementById(Ge.settingsButton);e&&e.focus()})):(n.removeFixedHeader(),n.setState({currentState:n.state},(function(){n.setState({appendMode:!1,editMode:!1,fullWidthMode:!1,fixedHeightMode:!1,settingsMode:!0,showAppendix:!1,showHeader:!1,showMenu:!1,viewMode:!1},(function(){var e=document.getElementById("undoDialog");e&&e.focus()}))})))},n.onSaveSettings=function(e){var t=e.customStyles,o=e.editingMode,i=e.fontEdit,s=e.fontSize,a=e.fontView,r=e.monacoEditorLanguage,c=e.saveAsDefault;n.setState(Object(l.a)(Object(l.a)({},n.state.currentState),{},{customStyles:t,editingMode:o,fontEdit:i,fontSize:s,fontView:a,monacoEditorLanguage:r,showAppendix:!0,showHeader:!0,settingsMode:!1}),(function(){n.refreshEditor();var e=document.getElementById(Ge.settingsButton);e&&e.focus()}));var d=n.editorKit.internal.note;d&&n.editorKit.internal.componentManager.saveItemWithPresave(d,(function(){d.content.appendEditorCustomStyles=t,d.content.appendEditorEditingMode=o,d.content.appendEditorFontEdit=i,d.content.appendEditorFontSize=s,d.content.appendEditorFontView=a,d.content.appendEditorMonacoEditorLanguage=r})),c&&n.setState({defaultSettings:{customStyles:t,editingMode:o,fontEdit:i,fontSize:s,fontView:a,monacoEditorLanguage:r}},(function(){n.saveEditorOption("defaultSettings",JSON.stringify(n.state.defaultSettings))}))},n.activateStyles=function(){var e=document.getElementById("customStyleSheet");if(e){var t=e.parentNode;t&&t.removeChild(e)}var o="";n.state.fontSize&&(o=".CodeMirror, .DynamicEditor, .MonacoEditorContainer, .ProseMirror, #editTextArea, #appendTextArea, #renderedNote {font-size: "+n.state.fontSize+";}\n");var i="";n.state.fontEdit&&(i=".CodeMirror, .DynamicEditor, .ProseMirror, #editTextArea, #appendTextArea {font-family: "+n.state.fontEdit+";}\n");var s="";if(n.state.fontView&&(s="#renderedNote {font-family: "+n.state.fontView+";}\n"),n.state.customStyles||n.state.fontEdit||n.state.fontSize||n.state.fontView){var a=document.createElement("style");a.setAttribute("id","customStyleSheet"),a.innerHTML=o+i+s+n.state.customStyles,document.body.appendChild(a)}},n.onCancelPrint=function(){n.setState({confirmPrintUrl:!1},(function(){var e=document.getElementById(Ge.printButton);e&&e.focus()}))},n.onConfirmPrintUrl=function(){n.setState({confirmPrintUrl:!0},(function(){var e=document.getElementById("undoDialog");e&&e.focus()}))},n.onPrintUrlTrue=function(){n.setState({confirmPrintUrl:!1,printURL:!0},(function(){n.printRenderedHtml()}))},n.onPrintUrlFalse=function(){n.setState({confirmPrintUrl:!1,printURL:!1},(function(){n.printRenderedHtml()}))},n.printRenderedHtml=function(){window.print();var e=document.getElementById(Ge.printButton);e&&e.focus()},n.goDown=function(){if(document.body.scrollTop=1e7,n.state.editMode){var e=document.getElementById(Ge.editTextArea);e&&(e.scrollTop=1e7)}if(n.state.appendMode){var t=document.getElementById(Ge.appendTextArea);t&&(t.scrollTop=1e7)}if(n.state.fixedHeightMode){var o=document.getElementById(Ge.view);o&&(o.scrollTop=1e7);var i=document.getElementById(Ge.edit);i&&(i.scrollTop=1e7)}var s=document.getElementsByClassName("CodeMirror-vscrollbar")[0];s&&(s.scrollTop=1e7)},n.scrollToBottom=function(){n.goDown();var e=document.getElementById(Ge.appendix);e&&e.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})},n.skipToBottom=function(){n.goDown();var e=document.getElementById(Ge.appendix);e&&e.scrollIntoView({behavior:"auto",block:"end",inline:"nearest"})},n.goUp=function(){if(document.body.scrollTop=0,n.state.editMode){var e=document.getElementById(Ge.editTextArea);e&&(e.scrollTop=0)}if(n.state.appendMode){var t=document.getElementById(Ge.appendTextArea);t&&(t.scrollTop=0)}if(n.state.fixedHeightMode){var o=document.getElementById(Ge.view);o&&(o.scrollTop=0);var i=document.getElementById(Ge.edit);i&&(i.scrollTop=0)}var s=document.getElementsByClassName("CodeMirror-vscrollbar")[0];s&&(s.scrollTop=0)},n.scrollToTop=function(){n.goUp();var e=document.getElementById("top");e&&e.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"})},n.skipToTop=function(){n.goUp();var e=document.getElementById("top");e&&e.scrollIntoView({behavior:"auto",block:"start",inline:"nearest"})},n.onKeyDown=function(e){nt.set(e.key,!0),nt.get("Control")&&nt.get("e")?(e.preventDefault(),n.onEditMode()):nt.get("Control")&&!nt.get("Alt")&&(nt.get("u")||nt.get("m"))?(e.preventDefault(),n.onAppendMode()):nt.get("Control")&&!nt.get("Alt")&&nt.get("p")?(e.preventDefault(),n.onViewMode()):nt.get("Control")&&nt.get(".")?(e.preventDefault(),n.setState({appendRows:n.state.appendRows+1})):nt.get("Control")&&nt.get(",")?(e.preventDefault(),n.state.appendRows>5&&n.setState({appendRows:n.state.appendRows-1})):nt.get("Control")&&nt.get("<")?(e.preventDefault(),n.setState({appendMode:!1,editMode:!1,viewMode:!1},(function(){n.onEditMode()}))):nt.get("Control")&&nt.get(">")?(e.preventDefault(),n.setState({appendMode:!1,editMode:!1,viewMode:!1},(function(){n.onAppendMode()}))):nt.get("Control")&&nt.get("[")?(e.preventDefault(),n.skipToTop()):nt.get("Control")&&nt.get("]")?(e.preventDefault(),n.skipToBottom()):nt.get("Control")&&!nt.get("Alt")&&!nt.get("Shift")&&nt.get("w")&&nt.delete("w")},n.onKeyDownAppendTextArea=function(e){if(nt.get("Escape"))e.preventDefault(),nt.delete("Escape"),n.onAppendMode();else if(nt.get("Control")&&nt.get("Enter"))e.preventDefault(),n.state.editingMode===Xe.useCodeMirror&&n.appendTextToNote();else if(nt.get("Control")&&nt.get("s"))e.preventDefault(),n.state.editingMode===Xe.useCodeMirror&&n.appendTextToNote();else if(nt.get("Control")&&!nt.get("Shift")&&nt.get("Alt")&&nt.get("n")){e.preventDefault();var t=document.getElementById(Ge.newLine);t&&t.click()}else if(nt.get("Control")&&!nt.get("Shift")&&nt.get("Alt")&&nt.get("p")){e.preventDefault();var o=document.getElementById(Ge.newParagraph);o&&o.click()}},n.onKeyDownEditTextArea=function(e){nt.get("Escape")&&(e.preventDefault(),nt.set("Escape",!1),n.onEditMode())},n.onKeyDownTextArea=function(e){nt.get("Shift")&&nt.get("Enter")?(e.preventDefault(),document.execCommand("insertText",!1," \n")):nt.get("Control")&&nt.get("b")?(e.preventDefault(),document.execCommand("insertText",!1,"**")):nt.get("Control")&&nt.get("h")?(e.preventDefault(),document.execCommand("insertText",!1,"#")):nt.get("Control")&&nt.get("Alt")&&nt.get("i")?(e.preventDefault(),document.execCommand("insertText",!1,"![]()")):nt.get("Control")&&nt.get("i")?(e.preventDefault(),document.execCommand("insertText",!1,"*")):nt.get("Control")&&nt.get("Alt")&&nt.get("k")?(e.preventDefault(),document.execCommand("insertText",!1,"`")):nt.get("Control")&&nt.get("k")?(e.preventDefault(),document.execCommand("insertText",!1,"[]()")):nt.get("Control")&&nt.get("Alt")&&nt.get("l")?(e.preventDefault(),document.execCommand("insertText",!1,"\n1. ")):nt.get("Control")&&nt.get("l")?(e.preventDefault(),document.execCommand("insertText",!1,"\n- ")):nt.get("Control")&&nt.get("Alt")&&nt.get("u")?(e.preventDefault(),document.execCommand("insertText",!1,"~~")):(nt.get("Control")&&nt.get("q")||nt.get("Control")&&nt.get("'")||nt.get("Control")&&nt.get('"'))&&(e.preventDefault(),document.execCommand("insertText",!1,"\n> "))},n.onKeyUp=function(e){nt.delete(e.key)},n.onBlur=function(e){nt.clear()},n.onScroll=function(e){n.state.settingsMode||(window.scrollYtt&&!n.state.showMenu&&n.removeFixedHeader(),tt=window.scrollY)},n.activateFixedHeader=function(){var e=document.getElementById(Ge.header),t=document.getElementById(Ge.content);e&&t&&(e.classList.add(qe.fixed),t.classList.add(qe.fixedHeader))},n.removeFixedHeader=function(){var e=document.getElementById(Ge.header),t=document.getElementById(Ge.content);e&&e.classList.remove(qe.fixed),t&&t.classList.remove(qe.fixedHeader)},n.configureEditorKit(),n.state=et,n}return Object(p.a)(o,[{key:"render",value:function(){var e=this;return[Object(n.jsx)("span",{id:"top"}),Object(n.jsxs)("div",{tabIndex:0,className:"sn-component",onKeyDown:this.onKeyDown,onKeyUp:this.onKeyUp,onBlur:this.onBlur,children:[this.state.showHeader&&[Object(n.jsx)("div",{id:Ge.header,className:"header",children:Object(n.jsxs)("div",{className:"sk-button-group",children:[Object(n.jsx)("button",{type:"button",id:Ge.editButton,onClick:this.onEditMode,title:"Toggle Edit Mode",className:"sk-button "+(this.state.editMode?"on":"off"),children:Object(n.jsx)(C,{condition:this.state.editMode,role:"button"})}),Object(n.jsx)("button",{type:"button",id:Ge.viewButton,onClick:this.onViewMode,title:"Toggle View Mode",className:"sk-button "+(this.state.viewMode?"on":"off"),children:Object(n.jsx)(O,{condition:this.state.viewMode,role:"button"})}),Object(n.jsx)("button",{type:"button",id:Ge.appendButton,onClick:function(){return e.onAppendMode()},title:"Toggle Append Mode",className:"sk-button "+(this.state.appendMode?"on":"off"),children:Object(n.jsx)(E,{condition:this.state.appendMode,role:"button"})}),Object(n.jsx)("div",{className:"sk-button divider",children:Object(n.jsx)("svg",{role:"img","aria-label":"Vertical line divider",width:"1",height:"24",viewBox:"0 0 1 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(n.jsx)("rect",{width:"1",height:"24",fill:"var(--sn-stylekit-foreground-color)"})})}),Object(n.jsx)("button",{type:"button",id:Ge.helpButton,onClick:this.toggleShowHelp,title:"Help",className:"sk-button "+(this.state.showHelp?"on":"off"),children:Object(n.jsx)(M,{condition:this.state.showHelp,role:"button"})}),Object(n.jsx)("button",{type:"button",id:Ge.settingsButton,onClick:this.onSettingsMode,title:"Settings",className:"sk-button "+(this.state.settingsMode?"on":"off"),children:Object(n.jsx)(w,{condition:this.state.settingsMode,role:"button"})}),Object(n.jsx)("div",{className:"sk-button divider",children:Object(n.jsx)("svg",{role:"img","aria-label":"Vertical line divider",width:"1",height:"24",viewBox:"0 0 1 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(n.jsx)("rect",{width:"1",height:"24",fill:"var(--sn-stylekit-foreground-color)"})})}),Object(n.jsx)("button",{type:"button",id:"scrollToBottomButtonHeader",onClick:this.skipToBottom,title:"Scroll to Bottom",className:"sk-button off",children:Object(n.jsx)("svg",{role:"button","aria-label":"Arrow pointing down for scroll to bottom button",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(n.jsx)("path",{d:"M6.17622 7.15015L10.0012 10.9751L13.8262 7.15015L15.0012 8.33348L10.0012 13.3335L5.00122 8.33348L6.17622 7.15015Z",fill:"var(--sn-stylekit-foreground-color)"})})}),Object(n.jsx)("button",{type:"button",id:"scrollToTopButtonHeader",onClick:this.skipToTop,title:"Scroll to Top",className:"sk-button off",children:Object(n.jsx)("svg",{role:"button","aria-label":"Arrow pointing up for scroll to top button",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(n.jsx)("path",{d:"M13.826 13.3335L10.001 9.5085L6.17597 13.3335L5.00097 12.1502L10.001 7.15017L15.001 12.1502L13.826 13.3335Z",fill:"var(--sn-stylekit-foreground-color)"})})}),Object(n.jsx)("button",{type:"button",id:Ge.menuButton,onClick:this.toggleShowMenu,title:"Toggle Menu",className:"sk-button "+(this.state.showMenu?"on":"off"),children:Object(n.jsx)(y,{condition:this.state.showMenu,role:"button"})})]})})],Object(n.jsxs)("div",{id:Ge.content,className:"content"+(this.state.borderlessMode?" borderless":"")+(this.state.fixedHeightMode?" fixed-height":"")+(this.state.fullWidthMode?" full-width":"")+(this.state.overflowMode?" overflow":""),children:[this.state.showMenu&&Object(n.jsx)(Re,{children:Object(n.jsx)(Qe,{borderlessMode:this.state.borderlessMode,editingMode:this.state.editingMode,fixedHeightMode:this.state.fixedHeightMode,fullWidthMode:this.state.fullWidthMode,monacoEditorLanguage:this.state.monacoEditorLanguage,onConfirmPrintUrl:this.onConfirmPrintUrl,overflowMode:this.state.overflowMode,refreshEdit:this.refreshEdit,refreshView:this.refreshView,saveText:this.saveText,showMenuOptionsEdit:this.state.showMenuOptionsEdit,showMenuOptionsShare:this.state.showMenuOptionsShare,showMenuOptionsView:this.state.showMenuOptionsView,text:this.state.text,toggleBorderlessMode:this.toggleBorderlessMode,toggleFixedHeightMode:this.toggleFixedHeightMode,toggleFullWidthMode:this.toggleFullWidthMode,toggleOverflowMode:this.toggleOverflowMode,toggleShowMenu:this.toggleShowMenu,toggleShowMenuOptionsEdit:this.toggleShowMenuOptionsEdit,toggleShowMenuOptionsShare:this.toggleShowMenuOptionsShare,toggleShowMenuOptionsView:this.toggleShowMenuOptionsView,viewMode:this.state.viewMode})}),this.state.settingsMode&&Object(n.jsx)(Re,{children:Object(n.jsx)(ze,{cancelText:"Cancel",confirmText:"Save",customStyles:this.state.customStyles,debugMode:ot,defaultSettings:this.state.defaultSettings,editingMode:this.state.editingMode,fontEdit:this.state.fontEdit,fontSize:this.state.fontSize,fontView:this.state.fontView,helpLink:"https://appendeditor.com/#settings",keyMap:nt,onConfirm:this.onSaveSettings,onCancel:this.onSettingsMode,title:"Append Editor Settings",monacoEditorLanguage:this.state.monacoEditorLanguage})}),this.state.editMode&&!this.state.refreshEdit&&Object(n.jsx)(Re,{children:Object(n.jsx)(z,{debugMode:ot,editingMode:this.state.editingMode,fontSize:this.state.fontSize,keyMap:nt,monacoEditorLanguage:this.state.monacoEditorLanguage,onKeyDown:this.onKeyDown,onKeyDownEditTextArea:this.onKeyDownEditTextArea,onKeyDownTextArea:this.onKeyDownTextArea,onKeyUp:this.onKeyUp,saveText:this.saveText,text:this.state.text,viewMode:this.state.viewMode})}),this.state.editMode&&this.state.refreshEdit&&Object(n.jsx)(Re,{children:Object(n.jsx)(z,{debugMode:ot,editingMode:this.state.editingMode,fontSize:this.state.fontSize,keyMap:nt,monacoEditorLanguage:this.state.monacoEditorLanguage,onKeyDown:this.onKeyDown,onKeyDownEditTextArea:this.onKeyDownEditTextArea,onKeyDownTextArea:this.onKeyDownTextArea,onKeyUp:this.onKeyUp,saveText:this.saveText,text:this.state.text,viewMode:this.state.viewMode})}),this.state.viewMode&&!this.state.refreshView&&Object(n.jsx)(Re,{children:Object(n.jsx)(Oe,{appendMode:this.state.appendMode,bypassDebounce:this.state.bypassDebounce,debugMode:ot,editMode:this.state.editMode,editingMode:this.state.editingMode,monacoEditorLanguage:this.state.monacoEditorLanguage,printURL:this.state.printURL,showHelp:this.state.showHelp,saveText:this.saveText,text:this.state.text})}),this.state.viewMode&&this.state.refreshView&&Object(n.jsx)(Re,{children:Object(n.jsx)(Oe,{appendMode:this.state.appendMode,bypassDebounce:this.state.bypassDebounce,debugMode:ot,editMode:this.state.editMode,editingMode:this.state.editingMode,monacoEditorLanguage:this.state.monacoEditorLanguage,printURL:this.state.printURL,showHelp:this.state.showHelp,saveText:this.saveText,text:this.state.text})}),this.state.confirmPrintUrl&&Object(n.jsxs)(Re,{children:[Object(n.jsx)(L,{title:"Would you like to print URLs?",onUndo:this.onCancelPrint,onConfirm:this.onPrintUrlTrue,onCancel:this.onPrintUrlFalse,helpLink:"https://appendeditor.com/#printing",confirmText:"Yes, print URLs",cancelText:"No, thanks"})," "]}),this.state.showDiff&&[Object(n.jsx)(Re,{children:Object(n.jsx)(V,{text:this.state.text,modifiedText:this.state.appendText,saveText:this.saveText})})]]}),this.state.showAppendix&&[Object(n.jsxs)("div",{id:Ge.appendix,className:"appendix"+(this.state.borderlessMode?" borderless":"")+(this.state.fullWidthMode?" full-width":""),children:[this.state.appendMode&&Object(n.jsx)(Re,{children:Object(n.jsx)(Me,{appendTextToNote:this.appendTextToNote,autoSaveAppendText:this.autoSaveAppendText,autoSaveCheckBoxes:this.autoSaveCheckBoxes,debugMode:ot,editingMode:this.state.editingMode,fontSize:this.state.fontSize,keyMap:nt,appendNewLine:this.state.appendNewLine,appendNewParagraph:this.state.appendNewParagraph,monacoEditorLanguage:this.state.monacoEditorLanguage,onKeyDown:this.onKeyDown,onKeyDownAppendTextArea:this.onKeyDownAppendTextArea,onKeyDownTextArea:this.onKeyDownTextArea,onKeyUp:this.onKeyUp,appendRows:this.state.appendRows,text:this.state.appendText})}),Object(n.jsx)("button",{className:"sk-button info",id:"scrollToTopButton",onClick:this.scrollToTop,title:"Scroll to Top",type:"button",children:Object(n.jsx)("div",{children:" \u25b2 "})}),Object(n.jsx)("button",{className:"sk-button info",id:"scrollToBottomButton",onClick:this.scrollToBottom,title:"Scroll to Bottom",type:"button",children:Object(n.jsx)("div",{children:" \u25bc "})})]})]]})]}}]),o}(s.a.Component);o(1172);r.a.render(Object(n.jsx)(s.a.StrictMode,{children:Object(n.jsx)(it,{})}),document.getElementById("root")),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((function(e){e.unregister()})).catch((function(e){console.error(e.message)})),c()},454:function(e,t,o){}},[[1173,3,4]]]); -//# sourceMappingURL=main.c30d7197.chunk.js.map \ No newline at end of file +(this["webpackJsonpappend-editor"]=this["webpackJsonpappend-editor"]||[]).push([[2],{1172:function(e,t,o){},1173:function(e,t,o){"use strict";o.r(t);var n=o(6),i=o(24),s=o.n(i),a=o(152),r=o.n(a);o(454),Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));var c=function(e){e&&e instanceof Function&&o.e(73).then(o.bind(null,1179)).then((function(t){var o=t.getCLS,n=t.getFID,i=t.getFCP,s=t.getLCP,a=t.getTTFB;o(e),n(e),i(e),s(e),a(e)}))},l=o(181),d=o(0),p=o(1),h=o(4),u=o(5),j=o(311),g="var(--sn-stylekit-info-color)",b="var(--sn-stylekit-foreground-color)",f=function(e){var t=e.fill,o=e.role;return Object(n.jsx)("span",{className:"chevron-icon down",children:Object(n.jsx)("svg",{"aria-label":"chevron icon down",role:o,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(n.jsx)("path",{d:"M6.17622 7.15015L10.0012 10.9751L13.8262 7.15015L15.0012 8.33348L10.0012 13.3335L5.00122 8.33348L6.17622 7.15015Z",fill:t||b})})})},x=function(e){var t=e.fill,o=e.role;return Object(n.jsx)("span",{className:"chevron-icon right",children:Object(n.jsx)("svg",{"aria-label":"chevron icon down",role:o,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(n.jsx)("path",{d:"M6.90918 14.0667L10.7342 10.2417L6.90918 6.4167L8.09251 5.2417L13.0925 10.2417L8.09251 15.2417L6.90918 14.0667Z",fill:t||b})})})},m=function(e){var t=e.fill,o=e.role;return Object(n.jsx)("svg",{"aria-label":"close icon",role:o,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(n.jsx)("path",{d:"M15.2459 5.92917C15.5704 5.6047 15.5704 5.07864 15.2459 4.75417C14.9214 4.4297 14.3954 4.4297 14.0709 4.75417L10.0001 8.82501L5.92925 4.75417C5.60478 4.4297 5.07872 4.4297 4.75425 4.75417C4.42978 5.07864 4.42978 5.6047 4.75425 5.92917L8.82508 10L4.75425 14.0708C4.42978 14.3953 4.42978 14.9214 4.75425 15.2458C5.07872 15.5703 5.60478 15.5703 5.92925 15.2458L10.0001 11.175L14.0709 15.2458C14.3954 15.5703 14.9214 15.5703 15.2459 15.2458C15.5704 14.9214 15.5704 14.3953 15.2459 14.0708L11.1751 10L15.2459 5.92917Z",fill:t||b})})},v=function(e){var t=e.fill,o=e.role;return Object(n.jsx)("svg",{"aria-label":"copy icon",role:o,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(n.jsx)("path",{d:"M1.66724 3.66626C1.66724 2.56169 2.56267 1.66626 3.66724 1.66626H11.3339C12.4385 1.66626 13.3339 2.56169 13.3339 3.66626V13.3329H3.66724C2.56267 13.3329 1.66724 12.4375 1.66724 11.3329V3.66626ZM16.3339 6.66626C17.4385 6.66626 18.3339 7.56169 18.3339 8.66626V16.3329C18.3339 17.4375 17.4385 18.3329 16.3339 18.3329H8.66724C7.56267 18.3329 6.66724 17.4375 6.66724 16.3329V14.9996H15.0006V6.66626H16.3339ZM3.3339 3.33293V11.6663H11.6672V3.33293H3.3339Z",fill:t||b})})},O=function(e){var t=e.condition,o=e.fill,i=e.role;return Object(n.jsx)("svg",{"aria-label":"eye icon",role:i,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(n.jsx)("path",{d:"M9.99992 7.5C9.33688 7.5 8.70099 7.76339 8.23215 8.23223C7.76331 8.70107 7.49992 9.33696 7.49992 10C7.49992 10.663 7.76331 11.2989 8.23215 11.7678C8.70099 12.2366 9.33688 12.5 9.99992 12.5C10.663 12.5 11.2988 12.2366 11.7677 11.7678C12.2365 11.2989 12.4999 10.663 12.4999 10C12.4999 9.33696 12.2365 8.70107 11.7677 8.23223C11.2988 7.76339 10.663 7.5 9.99992 7.5ZM9.99992 14.1667C8.89485 14.1667 7.83504 13.7277 7.05364 12.9463C6.27224 12.1649 5.83325 11.1051 5.83325 10C5.83325 8.89493 6.27224 7.83512 7.05364 7.05372C7.83504 6.27232 8.89485 5.83333 9.99992 5.83333C11.105 5.83333 12.1648 6.27232 12.9462 7.05372C13.7276 7.83512 14.1666 8.89493 14.1666 10C14.1666 11.1051 13.7276 12.1649 12.9462 12.9463C12.1648 13.7277 11.105 14.1667 9.99992 14.1667ZM9.99992 3.75C5.83325 3.75 2.27492 6.34167 0.833252 10C2.27492 13.6583 5.83325 16.25 9.99992 16.25C14.1666 16.25 17.7249 13.6583 19.1666 10C17.7249 6.34167 14.1666 3.75 9.99992 3.75Z",fill:o||(t?g:b)})})},w=function(e){var t=e.condition,o=e.fill,i=e.role;return Object(n.jsx)("svg",{"aria-label":"gear icon",role:i,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(n.jsx)("path",{d:"M10.0001 6.66675C10.8842 6.66675 11.732 7.01794 12.3571 7.64306C12.9823 8.26818 13.3334 9.11603 13.3334 10.0001C13.3334 10.8841 12.9823 11.732 12.3571 12.3571C11.732 12.9822 10.8842 13.3334 10.0001 13.3334C9.11606 13.3334 8.26821 12.9822 7.64309 12.3571C7.01797 11.732 6.66678 10.8841 6.66678 10.0001C6.66678 9.11603 7.01797 8.26818 7.64309 7.64306C8.26821 7.01794 9.11606 6.66675 10.0001 6.66675ZM10.0001 8.33342C9.55808 8.33342 9.13416 8.50901 8.8216 8.82157C8.50904 9.13413 8.33344 9.55805 8.33344 10.0001C8.33344 10.4421 8.50904 10.866 8.8216 11.1786C9.13416 11.4912 9.55808 11.6667 10.0001 11.6667C10.4421 11.6667 10.8661 11.4912 11.1786 11.1786C11.4912 10.866 11.6668 10.4421 11.6668 10.0001C11.6668 9.55805 11.4912 9.13413 11.1786 8.82157C10.8661 8.50901 10.4421 8.33342 10.0001 8.33342ZM8.33344 18.3334C8.12511 18.3334 7.95011 18.1834 7.91678 17.9834L7.60844 15.7751C7.08344 15.5667 6.63344 15.2834 6.20011 14.9501L4.12511 15.7917C3.94178 15.8584 3.71678 15.7917 3.61678 15.6084L1.95011 12.7251C1.84178 12.5417 1.89178 12.3167 2.05011 12.1917L3.80844 10.8084L3.75011 10.0001L3.80844 9.16675L2.05011 7.80841C1.89178 7.68341 1.84178 7.45841 1.95011 7.27508L3.61678 4.39175C3.71678 4.20841 3.94178 4.13341 4.12511 4.20842L6.20011 5.04175C6.63344 4.71675 7.08344 4.43341 7.60844 4.22508L7.91678 2.01675C7.95011 1.81675 8.12511 1.66675 8.33344 1.66675H11.6668C11.8751 1.66675 12.0501 1.81675 12.0834 2.01675L12.3918 4.22508C12.9168 4.43341 13.3668 4.71675 13.8001 5.04175L15.8751 4.20842C16.0584 4.13341 16.2834 4.20841 16.3834 4.39175L18.0501 7.27508C18.1584 7.45841 18.1084 7.68341 17.9501 7.80841L16.1918 9.16675L16.2501 10.0001L16.1918 10.8334L17.9501 12.1917C18.1084 12.3167 18.1584 12.5417 18.0501 12.7251L16.3834 15.6084C16.2834 15.7917 16.0584 15.8667 15.8751 15.7917L13.8001 14.9584C13.3668 15.2834 12.9168 15.5667 12.3918 15.7751L12.0834 17.9834C12.0501 18.1834 11.8751 18.3334 11.6668 18.3334H8.33344ZM9.37511 3.33341L9.06678 5.50841C8.06678 5.71675 7.18344 6.25008 6.54178 6.99175L4.53344 6.12508L3.90844 7.20841L5.66678 8.50008C5.33344 9.47508 5.33344 10.5334 5.66678 11.5001L3.90011 12.8001L4.52511 13.8834L6.55011 13.0167C7.19178 13.7501 8.06678 14.2834 9.05844 14.4834L9.36678 16.6667H10.6334L10.9418 14.4917C11.9334 14.2834 12.8084 13.7501 13.4501 13.0167L15.4751 13.8834L16.1001 12.8001L14.3334 11.5084C14.6668 10.5334 14.6668 9.47508 14.3334 8.50008L16.0918 7.20841L15.4668 6.12508L13.4584 6.99175C12.8168 6.25008 11.9334 5.71675 10.9334 5.51675L10.6251 3.33341H9.37511Z",fill:o||(t?g:b)})})},M=function(e){var t=e.condition,o=e.fill,i=e.role;return Object(n.jsx)("svg",{"aria-label":"help icon",role:i,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(n.jsx)("path",{d:"M9.16675 15.0001H10.8334V13.3334H9.16675V15.0001ZM10.0001 1.66675C8.90573 1.66675 7.8221 1.8823 6.81105 2.30109C5.80001 2.71987 4.88135 3.3337 4.10753 4.10753C2.54472 5.67033 1.66675 7.78995 1.66675 10.0001C1.66675 12.2102 2.54472 14.3298 4.10753 15.8926C4.88135 16.6665 5.80001 17.2803 6.81105 17.6991C7.8221 18.1179 8.90573 18.3334 10.0001 18.3334C12.2102 18.3334 14.3298 17.4554 15.8926 15.8926C17.4554 14.3298 18.3334 12.2102 18.3334 10.0001C18.3334 8.90573 18.1179 7.8221 17.6991 6.81105C17.2803 5.80001 16.6665 4.88135 15.8926 4.10753C15.1188 3.3337 14.2002 2.71987 13.1891 2.30109C12.1781 1.8823 11.0944 1.66675 10.0001 1.66675ZM10.0001 16.6668C6.32508 16.6668 3.33342 13.6751 3.33342 10.0001C3.33342 6.32508 6.32508 3.33342 10.0001 3.33342C13.6751 3.33342 16.6668 6.32508 16.6668 10.0001C16.6668 13.6751 13.6751 16.6668 10.0001 16.6668ZM10.0001 5.00008C9.11603 5.00008 8.26818 5.35127 7.64306 5.97639C7.01794 6.60151 6.66675 7.44936 6.66675 8.33342H8.33342C8.33342 7.89139 8.50901 7.46747 8.82157 7.1549C9.13413 6.84234 9.55806 6.66675 10.0001 6.66675C10.4421 6.66675 10.866 6.84234 11.1786 7.1549C11.4912 7.46747 11.6667 7.89139 11.6667 8.33342C11.6667 10.0001 9.16675 9.79175 9.16675 12.5001H10.8334C10.8334 10.6251 13.3334 10.4167 13.3334 8.33342C13.3334 7.44936 12.9822 6.60151 12.3571 5.97639C11.732 5.35127 10.8841 5.00008 10.0001 5.00008Z",fill:o||(t?g:b)})})},y=function(e){var t=e.condition,o=e.fill,i=e.role;return Object(n.jsx)("svg",{"aria-label":"menu icon",role:i,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(n.jsx)("path",{d:"M17 5V6.66667H3V5H17ZM3 15H17V13.3333H3V15ZM3 10.8333H17V9.16667H3V10.8333Z",fill:o||(t?g:b)})})},C=function(e){var t=e.condition,o=e.fill,i=e.role;return Object(n.jsx)("svg",{"aria-label":"pencil icon",role:i,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(n.jsx)("path",{d:"M11.7167 7.5L12.5 8.28333L4.93333 15.8333H4.16667V15.0667L11.7167 7.5ZM14.7167 2.5C14.5083 2.5 14.2917 2.58333 14.1333 2.74167L12.6083 4.26667L15.7333 7.39167L17.2583 5.86667C17.5833 5.54167 17.5833 5 17.2583 4.69167L15.3083 2.74167C15.1417 2.575 14.9333 2.5 14.7167 2.5ZM11.7167 5.15833L2.5 14.375V17.5H5.625L14.8417 8.28333L11.7167 5.15833Z",fill:o||(t?g:b)})})},E=function(e){var t=e.condition,o=e.fill,i=e.role;return Object(n.jsx)("svg",{role:i,"aria-label":"plus icon",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(n.jsx)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.385 11.385H15.615C16.3799 11.385 17 10.7649 17 10C17 9.23507 16.3799 8.61497 15.615 8.61497H11.385V4.38503C11.385 3.6201 10.7649 3 10 3C9.23507 3 8.61497 3.6201 8.61497 4.38503V8.61497H4.38503C3.6201 8.61497 3 9.23507 3 10C3 10.7649 3.6201 11.385 4.38503 11.385H8.61497V15.615C8.61497 16.3799 9.23507 17 10 17C10.7649 17 11.385 16.3799 11.385 15.615V11.385Z",fill:o||(t?g:b)})})},S=function(e){var t=e.fill,o=e.role;return Object(n.jsx)("svg",{"aria-label":"print icon",role:o,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(n.jsx)("path",{d:"M15.0001 2.5H5.00008V5.83333H15.0001V2.5ZM15.8334 10C15.6124 10 15.4004 9.9122 15.2442 9.75592C15.0879 9.59964 15.0001 9.38768 15.0001 9.16667C15.0001 8.94565 15.0879 8.73369 15.2442 8.57741C15.4004 8.42113 15.6124 8.33333 15.8334 8.33333C16.0544 8.33333 16.2664 8.42113 16.4227 8.57741C16.579 8.73369 16.6668 8.94565 16.6668 9.16667C16.6668 9.38768 16.579 9.59964 16.4227 9.75592C16.2664 9.9122 16.0544 10 15.8334 10ZM13.3334 15.8333H6.66675V11.6667H13.3334V15.8333ZM15.8334 6.66667H4.16675C3.50371 6.66667 2.86782 6.93006 2.39898 7.3989C1.93014 7.86774 1.66675 8.50363 1.66675 9.16667V14.1667H5.00008V17.5H15.0001V14.1667H18.3334V9.16667C18.3334 8.50363 18.07 7.86774 17.6012 7.3989C17.1323 6.93006 16.4965 6.66667 15.8334 6.66667Z",fill:t||b})})},k=function(e){var t=e.fill,o=e.role;return Object(n.jsx)("svg",{"aria-label":"refresh icon",role:o,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(n.jsx)("path",{d:"M9.99992 14.9999C8.67384 14.9999 7.40207 14.4731 6.46438 13.5355C5.5267 12.5978 4.99992 11.326 4.99992 9.99992C4.99992 9.16658 5.20825 8.35825 5.58325 7.66658L4.36659 6.44992C3.71659 7.47492 3.33325 8.69158 3.33325 9.99992C3.33325 11.768 4.03563 13.4637 5.28587 14.714C6.53612 15.9642 8.23181 16.6666 9.99992 16.6666V19.1666L13.3333 15.8332L9.99992 12.4999V14.9999ZM9.99992 3.33325V0.833252L6.66658 4.16658L9.99992 7.49992V4.99992C11.326 4.99992 12.5978 5.5267 13.5355 6.46438C14.4731 7.40207 14.9999 8.67383 14.9999 9.99992C14.9999 10.8333 14.7916 11.6416 14.4166 12.3333L15.6333 13.5499C16.2833 12.5249 16.6666 11.3083 16.6666 9.99992C16.6666 8.23181 15.9642 6.53612 14.714 5.28587C13.4637 4.03563 11.768 3.33325 9.99992 3.33325Z",fill:t||b})})},T=function(e){var t=e.fill,o=e.role;return Object(n.jsx)("svg",{"aria-label":"undo icon",role:o,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(n.jsx)("path",{d:"M10.1812 7.66667C8.36883 7.66667 6.72741 8.33333 5.46214 9.4L3 7V13H9.15535L6.67953 10.5867C7.63019 9.81333 8.84074 9.33333 10.1812 9.33333C12.6023 9.33333 14.661 10.8733 15.3791 13L17 12.48C16.0493 9.68667 13.3615 7.66667 10.1812 7.66667Z",fill:t||b})})},L=function(e){var t=e.cancelText,o=e.confirmText,i=e.helpLink,s=e.onCancel,a=e.onConfirm,r=e.onUndo,c=e.title;return Object(n.jsx)("div",{className:"note-overlay",children:Object(n.jsxs)("div",{className:"sk-panel note-dialog",children:[Object(n.jsx)("div",{className:"sk-panel-content",children:Object(n.jsxs)("div",{className:"sk-panel-section",children:[Object(n.jsxs)("div",{className:"sk-panel-row title-section",children:[Object(n.jsx)("h2",{children:c}),Object(n.jsx)("button",{id:"undoDialog",onClick:r,title:"Close",children:Object(n.jsx)(m,{role:"button"})})]}),Object(n.jsxs)("p",{children:["Need help deciding? Check out the"," ",Object(n.jsx)("a",{href:i,target:"_blank",rel:"noopener noreferrer",children:"documentation"}),"."]})]})}),Object(n.jsx)("div",{className:"sk-panel-footer",children:Object(n.jsxs)("div",{className:"sk-button-group stretch",children:[Object(n.jsx)("button",{className:"sk-button neutral",onClick:s,children:Object(n.jsx)("div",{children:t})}),Object(n.jsx)("button",{className:"sk-button info",onClick:a,children:Object(n.jsx)("div",{children:o})})]})})]})})},N=o(242),B="MonacoEditorContainer",D="MonacoDiffEditorContainer";self.MonacoEnvironment={getWorkerUrl:function(e,t){return"json"===t?"./json.worker.bundle.js":"css"===t?"./css.worker.bundle.js":"html"===t?"./html.worker.bundle.js":"typescript"===t||"javascript"===t?"./ts.worker.bundle.js":"./editor.worker.bundle.js"}};var A=function(e){var t,o=e.fontSize,s=void 0===o?"16":o,a=e.id,r=void 0===a?B:a,c=e.language,l=void 0===c?"markdown":c,d=e.saveText,p=e.tabSize,h=void 0===p?2:p,u=e.text,j=e.theme,g=void 0===j?"vs-dark":j,b=e.viewMode,f=void 0!==b&&b,x=Object(i.useRef)(null);""===s&&(s="16px");var m=!0;return f&&(m=!1),Object(i.useEffect)((function(){return x.current&&((t=N.a.create(x.current,{fontSize:parseInt(s.replace("px","")),language:l,tabSize:h,theme:g,scrollBeyondLastLine:m,value:[u].join("\n"),autoClosingOvertype:"auto",formatOnPaste:!0,formatOnType:!0,wordWrap:"on",wrappingStrategy:"advanced"})).onKeyDown((function(e){!function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&console.log("IKeyboardEvent Up: "+e)}(e.code,false),e.ctrlKey&&"KeyS"===e.code&&e.preventDefault()})),t.onKeyUp((function(e){!function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&console.log("IKeyboardEvent Up: "+e)}(e.code,false)})),t.onDidChangeModelContent((function(e){d&&d(t.getValue())}))),function(){t.dispose()}}),[]),Object(n.jsx)("div",{id:r,className:B,ref:x})},V=function(e){var t,o=e.fontSize,s=void 0===o?"16":o,a=e.id,r=void 0===a?D:a,c=e.language,l=void 0===c?"markdown":c,d=e.saveText,p=e.text,h=e.modifiedText,u=e.theme,j=void 0===u?"vs-dark":u,g=Object(i.useRef)(null);return""===s&&(s="16px"),Object(i.useEffect)((function(){if(g.current){var e=N.a.createModel([p].join("\n"),l),o=N.a.createModel([h].join("\n"),l);(t=N.a.createDiffEditor(g.current,{fontSize:parseInt(s.replace("px","")),theme:j,autoClosingOvertype:"auto",formatOnPaste:!0,formatOnType:!0,wordWrap:"on",wrappingStrategy:"advanced",originalEditable:!0,readOnly:!0})).setModel({original:e,modified:o}),e.onDidChangeContent((function(t){d&&d(e.getValue())}))}return function(){t.dispose()}}),[]),Object(n.jsx)("div",{id:r,className:D,ref:g})},H=o(439),K=o.n(H),I=o(440),F=o.n(I),P=function(e){Object(h.a)(o,e);var t=Object(u.a)(o);function o(){return Object(d.a)(this,o),t.apply(this,arguments)}return Object(p.a)(o,[{key:"render",value:function(){var e=this.props.attrs.matches[1];return Object(n.jsx)("iframe",{title:"Youtube Embed ".concat(e),className:this.props.isSelected?"YouTube ProseMirror-selectednode":"YouTube",src:"https://www.youtube.com/embed/".concat(e,"?modestbranding=1")})}}]),o}(i.Component),U=function(e){Object(h.a)(o,e);var t=Object(u.a)(o);function o(e){var n;return Object(d.a)(this,o),(n=t.call(this,e)).handleToggleReadOnly=function(){n.setState({readOnly:!n.state.readOnly})},n.handleChange=K()((function(e){var t=e();n.props.debugMode&&console.log(t),n.props.onChange(t)}),50),n.state={readOnly:n.props.readOnly,template:!1,value:void 0},n}return Object(p.a)(o,[{key:"render",value:function(){var e=this;return Object(n.jsx)(F.a,{className:"DynamicEditor",placeholder:"Type '/' to insert...",id:"DynamicEditor",readOnly:this.state.readOnly,readOnlyWriteCheckboxes:!0,value:this.state.value,defaultValue:this.props.text,scrollTo:window.location.hash,onCancel:function(){e.props.debugMode&&console.log("Cancel triggered")},autoFocus:!0,onChange:function(t){return e.handleChange(t)},embeds:[{title:"YouTube",keywords:"youtube video tube google",icon:function(){return Object(n.jsx)("img",{alt:"YouTube Logo",src:"/icons/ic-YouTube.svg",width:24,height:24})},matcher:function(e){return e.match(/(?:https?:\/\/)?(?:www\.)?youtu\.?be(?:\.com)?\/?.*(?:watch|embed)?(?:.*v=|v\/|\/)([a-zA-Z0-9_-]{11})$/i)},component:P}]})}}]),o}(i.Component),z=function(e){Object(h.a)(o,e);var t=Object(u.a)(o);function o(e){var n;return Object(d.a)(this,o),(n=t.call(this,e)).handleInputChange=function(e){var t=e.target.value;n.setState({text:t},(function(){n.props.saveText(n.state.text)}))},n.saveText=function(e){n.setState({text:e},(function(){n.props.saveText(n.state.text)}))},n.onKeyDown=function(e){n.props.onKeyDown(e),n.props.onKeyDownEditTextArea(e),n.props.onKeyDownTextArea(e)},n.onKeyUp=function(e){n.props.keyMap.delete(e.key),n.props.onKeyUp(e)},n.state={text:n.props.text},n}return Object(p.a)(o,[{key:"render",value:function(){var e=this.state.text;return Object(n.jsx)("div",{className:"sk-panel main edit "+(this.props.editingMode===Xe.useMonacoEditor?"monacoEditor":this.props.editingMode===Xe.useDynamicEditor?"dynamicEditor":"otherEditor"),children:Object(n.jsx)("div",{className:"sk-panel-content edit "+(this.props.editingMode===Xe.useMonacoEditor?"monacoEditor":""),id:Ge.edit,children:this.props.editingMode===Xe.useMonacoEditor?Object(n.jsx)(A,{fontSize:this.props.fontSize,language:this.props.monacoEditorLanguage,saveText:this.saveText,text:e,viewMode:this.props.viewMode}):this.props.editingMode===Xe.useDynamicEditor?Object(n.jsx)("div",{id:"dynamicEditor",children:Object(n.jsx)(U,{debugMode:this.props.debugMode,text:e,onChange:this.saveText,readOnly:!1})}):Object(n.jsx)("textarea",{id:Ge.editTextArea,name:"text",className:"sk-input contrast textarea editnote",placeholder:"Welcome to the Append Editor! \ud83d\ude04",rows:15,spellCheck:"true",value:e,onChange:this.handleInputChange,onKeyDown:this.onKeyDown,onKeyUp:this.onKeyUp})})})}}]),o}(s.a.Component);z.defaultProps={};var R=function(){var e=document.getElementById(Ge.appendButton);e&&e.click()},W=function(){var e=document.getElementById(Ge.editButton);e&&e.click()},_=function(){var e=document.getElementById(Ge.helpButton);e&&e.click()},Z=function(){var e=document.getElementById(Ge.menuButton);e&&e.click()},Y=function(){var e=document.getElementById(Ge.settingsButton);e&&e.click()},G=function(){var e=document.getElementById(Ge.viewButton);e&&e.click()},q=function(e){Object(h.a)(o,e);var t=Object(u.a)(o);function o(e){var n;return Object(d.a)(this,o),(n=t.call(this,e)).onToggleShowFeelings=function(){n.setState({showFeelings:!n.state.showFeelings})},n.onToggleShowMoreQuestions=function(){n.setState({showMoreQuestions:!n.state.showMoreQuestions})},n.onToggleShowFeedback=function(){n.setState({showFeedback:!n.state.showFeedback})},n.state={showFeelings:!1,showMoreQuestions:!1,showFeedback:!1},n}return Object(p.a)(o,[{key:"render",value:function(){return Object(n.jsxs)("div",{id:"help",children:[Object(n.jsx)("hr",{}),Object(n.jsx)("h2",{children:"Append Editor Help"}),Object(n.jsxs)("p",{children:["The Append Editor is an ",Object(n.jsx)("b",{children:"unofficial"})," ",Object(n.jsx)("a",{href:"https://standardnotes.org/help/77/what-are-editors",target:"_blank",rel:"nofollow noreferrer noopener",children:"editor"})," ","for"," ",Object(n.jsx)("a",{href:"https://standardnotes.org/",target:"_blank",rel:"nofollow noreferrer noopener",children:"Standard Notes"}),", a free,"," ",Object(n.jsx)("a",{href:"https://standardnotes.org/knowledge/5/what-is-free-and-open-source-software",target:"_blank",rel:"nofollow noreferrer noopener",children:"open-source"}),", and"," ",Object(n.jsx)("a",{href:"https://standardnotes.org/knowledge/2/what-is-end-to-end-encryption",target:"_blank",rel:"nofollow noreferrer noopener",children:"end-to-end encrypted"})," ","notes app. The Append Editor is also free software licensed under"," ",Object(n.jsx)("a",{href:"https://github.com/TheodoreChu/append-editor/blob/main/LICENSE",target:"_blank",rel:"nofollow noreferrer noopener",children:"AGPL-3.0"}),". Its source code is available on"," ",Object(n.jsx)("a",{href:"https://github.com/TheodoreChu/append-editor",target:"_blank",rel:"nofollow noreferrer noopener",children:"GitHub"}),"."]}),Object(n.jsx)("h3",{children:"Append Editor Features"}),Object(n.jsxs)("p",{children:["The Append Editor supports"," ",Object(n.jsx)("a",{href:"https://guides.github.com/features/mastering-markdown/",target:"_blank",rel:"nofollow noreferrer noopener",children:"Markdown"})," ","with"," ",Object(n.jsx)("a",{href:"https://katex.org/docs/support_table.html",target:"_blank",rel:"nofollow noreferrer noopener",children:"KaTeX"}),", syntax highlighting, in-line HTML, table of contents, footnotes, auto-linking,"," ",Object(n.jsx)("a",{href:"https://github.com/ikatyang/emoji-cheat-sheet/blob/master/README.md",target:"_blank",rel:"nofollow noreferrer noopener",children:"emoji codes"}),", and more."," "]}),Object(n.jsxs)("p",{children:["There are four editing modes: Plain Textarea, CodeMirror, Dynamic, and Monaco. You can read about each mode and choose which to use in the Settings",Object(n.jsxs)("button",{className:"inline-text-and-svg",onClick:Y,title:"Open Settings",children:[Object(n.jsx)("span",{children:"\xa0"}),Object(n.jsx)(w,{role:"button"}),Object(n.jsx)("span",{children:"\xa0"})]}),". You can also choose default and per-note font sizes, font families, and custom styles (CSS)."]}),Object(n.jsxs)("p",{children:["The Menu",Object(n.jsxs)("button",{className:"inline-text-and-svg",onClick:Z,title:"Open the Menu",children:[Object(n.jsx)("span",{children:"\xa0"}),Object(n.jsx)(y,{role:"button"}),Object(n.jsx)("span",{children:"\xa0"})]}),"has additional options to customize the appearance of the editor, share your note, and perform actions to quickly format and edit Markdown text."]}),Object(n.jsxs)("p",{children:["A more detailed documentation of the Append Editor is available at"," ",Object(n.jsx)("a",{href:"https://appendeditor.com",target:"_blank",rel:"noopener noreferrer",children:"appendeditor.com"}),". If you like the Append Editor, please support it by giving it a star on"," ",Object(n.jsx)("a",{href:"https://github.com/TheodoreChu/append-editor/stargazers",target:"_blank",rel:"noopener noreferrer",children:"GitHub"}),"."," ",Object(n.jsx)("span",{role:"img","aria-label":"smile emoji",children:"\ud83d\ude42"})," "]}),Object(n.jsx)("h3",{children:"How to install the Append Editor in Standard Notes"}),Object(n.jsxs)("ol",{children:[Object(n.jsxs)("li",{children:["Download, install, and sign in to the Standard Notes"," ",Object(n.jsx)("a",{href:"https://standardnotes.org/download",target:"_blank",rel:"noopener noreferrer",children:"Desktop"})," ","app."]}),Object(n.jsxs)("li",{children:["In the bottom left corner of the app, click ",Object(n.jsx)("b",{children:"Extensions"}),"."]}),Object(n.jsxs)("li",{children:["Click ",Object(n.jsx)("b",{children:"Import Extensions"})," and paste the following link into the input box. If you want to use the alpha version, replace"," ",Object(n.jsx)("code",{children:"beta"})," with ",Object(n.jsx)("code",{children:"alpha"}),":"," ",Object(n.jsx)("code",{children:Object(n.jsx)("a",{href:"https://raw.githubusercontent.com/TheodoreChu/append-editor/main/public/beta.ext.json",target:"_blank",rel:"noopener noreferrer",children:"https://raw.githubusercontent.com/TheodoreChu/append-editor/main/public/beta.ext.json"})})]}),Object(n.jsxs)("li",{children:["Press ",Object(n.jsx)("b",{children:"Enter"})," or ",Object(n.jsx)("b",{children:"Return"})," on your keyboard."]}),Object(n.jsxs)("li",{children:["The title of your selected note is near the top of the app. Under the title, click ",Object(n.jsx)("b",{children:"Editor"}),", click ",Object(n.jsx)("b",{children:"Append Editor"}),", and click ",Object(n.jsx)("b",{children:"Continue"})," to begin using the editor. Enjoy!"," ",Object(n.jsx)("span",{role:"img","aria-label":"clap emoji",children:"\ud83d\udc4f"})," "]})]}),Object(n.jsxs)("p",{children:["After you install the editor on the desktop app, it will automatically sync to the"," ",Object(n.jsx)("a",{href:"https://app.standardnotes.org",target:"_blank",rel:"noopener noreferrer",children:"web"})," ","and"," ",Object(n.jsx)("a",{href:"https://standardnotes.org/download",target:"_blank",rel:"noopener noreferrer",children:"mobile apps"})," ","after you sign in."]}),Object(n.jsx)("h3",{children:"What to write about"}),Object(n.jsx)("p",{children:"The Append Editor is great for writing articles, blog posts, checklists, code snippets, documentation, emails, essays, journals, lists, logs, notes, tables, todo lists, and much more. Here are some questions to help you get started with today's daily journal:"})," ",Object(n.jsxs)("ul",{children:[Object(n.jsx)("li",{children:"How are you? What's happening?"}),Object(n.jsx)("li",{children:"What might be affecting your mood?"}),Object(n.jsx)("li",{children:"Which feelings fit your mood and to what extent?"}),Object(n.jsxs)("details",{onToggle:this.onToggleShowFeelings,children:[Object(n.jsxs)("summary",{children:[!this.state.showFeelings&&[Object(n.jsx)("p",{className:"link",children:"Show feelings"})],this.state.showFeelings&&[Object(n.jsx)("p",{className:"link",children:"Hide feelings"})]]}),Object(n.jsxs)("li",{children:[Object(n.jsx)("b",{children:"Positive Feelings:"})," bold, calm, cheerful, confident, content, eager, ecstatic, energized, engaged, enthusiastic, excited, grateful, happy, humorous, inspired, joyful, light, lively, loving, motivated, optimistic, passionate, peaceful, playful, proud, reassured, refreshed, relaxed, relieved, satisfied, secure, surprised, thrilled, wonderful"]}),Object(n.jsxs)("li",{children:[Object(n.jsx)("b",{children:"Negative Feelings:"})," afraid, angry, annoyed, anxious, ashamed, bored, burnt out, confused, demoralized, depressed, disappointed, disgusted, distraught, embarrassed, empty, exhausted, frustrated, furious, guilty, heavy, insecure, irritated, jealous, jittery, lethargic, lonely, nervous, numb, resentful, sad, self-conscious, sleepy, stressed, tired, winded, worried"]})]}),Object(n.jsx)("li",{children:"What thoughts are contributing to the way you're feeling?"}),Object(n.jsx)("details",{onToggle:this.onToggleShowMoreQuestions,children:Object(n.jsxs)("summary",{children:[!this.state.showMoreQuestions&&[Object(n.jsx)("p",{className:"link",children:"Show more questions"})],this.state.showMoreQuestions&&[Object(n.jsx)("p",{className:"link",children:"Show fewer questions"})]]})}),this.state.showMoreQuestions&&[Object(n.jsxs)("div",{children:[Object(n.jsx)("li",{children:"What do you hope your life will look like in a week? a month? a year?"}),Object(n.jsx)("li",{children:"What can you do today to make your life the way you want it?"}),Object(n.jsx)("li",{children:"How will you feel when you've realized the goals that you have for yourself?"}),Object(n.jsx)("li",{children:"Who or what do you feel grateful for and why?"}),Object(n.jsx)("li",{children:"What did you enjoy about today?"})]})]]}),Object(n.jsxs)("details",{onToggle:this.onToggleShowFeedback,children:[Object(n.jsx)("summary",{children:Object(n.jsx)("p",{className:"link",children:"Need more help?"})}),this.state.showFeedback&&[Object(n.jsxs)("p",{children:["Feel free to"," ",Object(n.jsx)("a",{href:"https://appendeditor.com/contact",target:"_blank",rel:"noopener noreferrer",children:"reach out"})," ","if you have any questions, comments, concerns, or feedback."," ",Object(n.jsx)("span",{role:"img","aria-label":"wave emoji",children:"\ud83d\udc4b"}),Object(n.jsx)("br",{}),"If you find any bugs or have a feature request, please"," ",Object(n.jsx)("a",{href:"https://github.com/TheodoreChu/append-editor/issues",target:"_blank",rel:"noopener noreferrer",children:"open an issue on GitHub"}),"."," ",Object(n.jsx)("span",{role:"img","aria-label":"smile emoji",children:"\ud83d\ude42"}),Object(n.jsx)("br",{}),"You are using version ",Object(n.jsx)("code",{children:"1.2.0"}),". The release notes and change log are available on"," ",Object(n.jsx)("a",{href:"https://github.com/TheodoreChu/append-editor/releases",target:"_blank",rel:"noopener noreferrer",children:"GitHub"}),"."]})]]}),"Click Help",Object(n.jsxs)("button",{className:"inline-text-and-svg",onClick:_,title:"Close Help",children:[Object(n.jsx)("span",{children:"\xa0"}),Object(n.jsx)(M,{fill:"var(--sn-stylekit-info-color)",role:"button"}),Object(n.jsx)("span",{children:"\xa0"})]}),"to close this section.",Object(n.jsx)("hr",{})]})}}]),o}(s.a.Component),X=function(e){var t=e.appendMode,o=e.editMode,i=e.showHelp;return Object(n.jsx)("div",{id:"intro",children:Object(n.jsxs)("details",{children:[Object(n.jsxs)("summary",{children:["Welcome to the Append Editor!"," ",Object(n.jsx)("span",{role:"img","aria-label":"wave emoji",children:"\ud83d\udc4b"})," ","Your note is empty."," ",Object(n.jsx)("span",{role:"img","aria-label":"smile emoji",children:"\ud83d\ude42"})," ","Click here to get started."," ",Object(n.jsx)("span",{role:"img","aria-label":"memo emoji",children:"\ud83d\udcdd"})]}),Object(n.jsx)("p",{children:"To get started:"}),Object(n.jsxs)("ul",{children:[Object(n.jsx)("li",{children:Object(n.jsxs)("p",{children:["Click the Pencil",Object(n.jsxs)("button",{className:"inline-text-and-svg",onClick:W,title:"Toggle Edit Mode",children:[Object(n.jsx)("span",{children:"\xa0"}),Object(n.jsx)(C,{condition:o,role:"button"}),Object(n.jsx)("span",{children:"\xa0"})]}),"to toggle ",Object(n.jsx)("b",{children:"Edit Mode"})]})}),Object(n.jsx)("li",{children:Object(n.jsxs)("p",{children:["Click the Plus",Object(n.jsxs)("button",{className:"inline-text-and-svg",onClick:R,title:"Toggle Append Mode",children:[Object(n.jsx)("span",{children:"\xa0"}),Object(n.jsx)(E,{condition:t,role:"button"}),Object(n.jsx)("span",{children:"\xa0"})]}),"to toggle ",Object(n.jsx)("b",{children:"Append Mode"})]})})]}),Object(n.jsxs)("p",{children:[Object(n.jsx)("b",{children:"View Mode"})," is currently ",Object(n.jsx)("b",{children:"on"}),". When you type in"," ",Object(n.jsx)("b",{children:"Edit Mode"}),", your note will automatically render here. In"," ",Object(n.jsx)("b",{children:"Append Mode"}),", clicking ",Object(n.jsx)("b",{children:"Append"})," will add the text in the textarea to the end of your note. Click the Eye",Object(n.jsxs)("button",{className:"inline-text-and-svg",onClick:G,title:"Toggle View Mode",children:[Object(n.jsx)("span",{children:"\xa0"}),Object(n.jsx)(O,{condition:!0,role:"button"}),Object(n.jsx)("span",{children:"\xa0"})]}),"to turn View Mode off and switch to ",Object(n.jsx)("b",{children:"Edit Only Mode"}),"."]}),Object(n.jsxs)("p",{children:["If you are using the demo at"," ",Object(n.jsx)("a",{href:"https://beta.appendeditor.com",target:"_blank",rel:"nofollow noreferrer noopener",children:"beta.appendeditor.com"}),", then your notes will be lost after you close the page."]}),Object(n.jsxs)("p",{children:["If you want to save your notes, then click Help",Object(n.jsxs)("button",{className:"inline-text-and-svg",onClick:_,title:"Toggle show Help",children:[Object(n.jsx)("span",{children:"\xa0"}),Object(n.jsx)(M,{condition:i,role:"button"}),Object(n.jsx)("span",{children:"\xa0"})]}),"and follow the instructions on how to install the Append Editor in"," ",Object(n.jsx)("a",{href:"https://standardnotes.org/",target:"_blank",rel:"nofollow noreferrer noopener",children:"Standard Notes"}),", a free,"," ",Object(n.jsx)("a",{href:"https://standardnotes.org/knowledge/5/what-is-free-and-open-source-software",target:"_blank",rel:"nofollow noreferrer noopener",children:"open-source"}),", and"," ",Object(n.jsx)("a",{href:"https://standardnotes.org/knowledge/2/what-is-end-to-end-encryption",target:"_blank",rel:"nofollow noreferrer noopener",children:"end-to-end encrypted"})," ","notes app."]}),Object(n.jsxs)("p",{children:["If you like Standard Notes, please check out Standard Notes"," ",Object(n.jsx)("a",{href:"https://standardnotes.org/extensions",target:"_blank",rel:"nofollow noreferrer noopener",children:"Extended"})," ","for more editors, themes, components, and methods to backup up your data."]}),Object(n.jsxs)("p",{children:["Happy note-taking!"," ",Object(n.jsx)("span",{role:"img","aria-label":"smile emoji",children:"\ud83d\ude04"})]})]})})},Q=o(309),J=o.n(Q),$=o(444),ee=o.n($),te=o(445),oe=o.n(te),ne=o(446),ie=o.n(ne),se=o(278),ae=o(880),re=o(905),ce=o(906),le=o(914),de=o(938),pe=o(1133),he=o(1139),ue=o(1141),je=o(1147),ge=o(1152),be=o(1153),fe=J()().use(ee.a).use(ae).use(re).use(ge).use(ue,{maxDepth:6}).use(he).use(je,{inlineNotes:!0}).use(oe.a,{allowDangerousHtml:!0}).use(be).use(ce).use(le).use(de,{ignoreMissing:!0}).use(pe).use(ie.a,{createElement:s.a.createElement}),xe=function(e){return fe.processSync(e).result},me=Object(se.throttle)((function(e){return e.length>1e4}),1e3),ve=Object(se.debounce)((function(e){return xe(e)}),500),Oe=function(e){Object(h.a)(o,e);var t=Object(u.a)(o);function o(e){var n;return Object(d.a)(this,o),(n=t.call(this,e)).onToggleShowHelp=function(){var e=document.getElementById("helpButton");e&&e.click()},n.renderMarkdown=function(e){return function(e,t){return t?xe(e):me(e)?ve(e):xe(e)}(e,n.props.bypassDebounce)},n.state={showHelp:n.props.showHelp},n}return Object(p.a)(o,[{key:"render",value:function(){var e=this.props.text;return Object(n.jsx)("div",{className:"sk-panel main view"+(this.props.printURL?" printURL":""),children:Object(n.jsxs)("div",{className:"sk-panel-content view",id:Ge.view,children:[!e&&[Object(n.jsx)(X,{appendMode:this.props.appendMode,editMode:this.props.editMode,showHelp:this.props.showHelp})],this.state.showHelp&&[Object(n.jsx)(q,{debugMode:this.props.debugMode,printURL:this.props.printURL})],Object(n.jsx)("div",{id:"renderedNote",className:this.props.editingMode===Xe.useDynamicEditor?"":"rendered-note-section",children:this.props.editingMode===Xe.useMonacoEditor&&"markdown"!==this.props.monacoEditorLanguage&&"html"!==this.props.monacoEditorLanguage&&e?this.renderMarkdown("```"+this.props.monacoEditorLanguage+"\n"+e+"\n```"):this.props.editingMode===Xe.useDynamicEditor?Object(n.jsx)(U,{debugMode:this.props.debugMode,onChange:this.props.saveText,readOnly:!0,text:e}):this.renderMarkdown(e)})]})})}}]),o}(s.a.Component),we=o(38),Me=function(e){Object(h.a)(o,e);var t=Object(u.a)(o);function o(e){var n;return Object(d.a)(this,o),(n=t.call(this,e)).handleInputChange=function(e){var t=e.target,o="checkbox"===t.type?t.checked:t.value,i=t.name;n.setState(Object(we.a)({},i,o),(function(){n.autoSaveCheckBoxes()}))},n.handleTextAreaChange=function(e){var t=e.target.value;n.setState({text:t},(function(){n.autoSaveAppendText()}))},n.saveText=function(e){n.setState({text:e},(function(){n.props.autoSaveAppendText(n.state.text)}))},n.appendTextToNote=function(){n.props.appendTextToNote(),n.setState({text:""});var e=document.getElementById(Ge.appendTextArea);e&&e.focus(),n.state.useMonacoEditor&&n.setState({useMonacoEditor:!1},(function(){n.setState({useMonacoEditor:!0})})),n.state.useDynamicEditor&&n.setState({useDynamicEditor:!1},(function(){n.setState({useDynamicEditor:!0})}))},n.autoSaveAppendText=function(){var e=n.state.text;n.props.autoSaveAppendText(e)},n.autoSaveCheckBoxes=function(){var e=n.state.newLine,t=n.state.newParagraph;n.props.autoSaveCheckBoxes(e,t)},n.onKeyDown=function(e){n.props.keyMap.set(e.key,!0),n.props.debugMode&&(console.log("Keys pressed: "+e.key+"KeyMap for key: "+n.props.keyMap.get(e.key)),console.log("Append Text Value: "+n.state.text)),n.props.onKeyDown(e),n.props.onKeyDownAppendTextArea(e),n.props.onKeyDownTextArea(e),(n.props.keyMap.get("Control")&&n.props.keyMap.get("Enter")||n.props.keyMap.get("Control")&&n.props.keyMap.get("s"))&&(e.preventDefault(),n.appendTextToNote())},n.onKeyUp=function(e){n.props.keyMap.delete(e.key),n.props.onKeyUp(e)},n.state={text:n.props.text,newLine:n.props.appendNewLine,newParagraph:n.props.appendNewParagraph,useMonacoEditor:n.props.editingMode===Xe.useMonacoEditor,useDynamicEditor:n.props.editingMode===Xe.useDynamicEditor},n}return Object(p.a)(o,[{key:"render",value:function(){var e=this.state.text;return Object(n.jsxs)("div",{className:"sk-panel main appendix "+(this.props.editingMode===Xe.useMonacoEditor?"monacoEditor":this.props.editingMode===Xe.useDynamicEditor?"dynamicEditor":"otherEditor"),children:[Object(n.jsx)("div",{className:"sk-panel-content edit "+(this.props.editingMode===Xe.useMonacoEditor?"monacoEditor":""),children:this.state.useMonacoEditor?Object(n.jsx)(A,{fontSize:this.props.fontSize,language:this.props.monacoEditorLanguage,saveText:this.saveText,text:e}):this.state.useDynamicEditor?Object(n.jsx)("div",{id:"appendDynamicEditor",children:Object(n.jsx)(U,{debugMode:this.props.debugMode,onChange:this.saveText,readOnly:!1,text:e})}):Object(n.jsx)("textarea",{id:Ge.appendTextArea,name:"text",className:"sk-input contrast textarea append",placeholder:"Append to your note",rows:this.props.appendRows,spellCheck:"true",value:e,onChange:this.handleTextAreaChange,onKeyDown:this.onKeyDown,onKeyUp:this.onKeyUp})}),Object(n.jsxs)("div",{className:"sk-panel-row",children:[Object(n.jsxs)("form",{className:"checkBoxForm",children:[Object(n.jsxs)("label",{children:[Object(n.jsx)("input",{id:Ge.newLine,name:"newLine",type:"checkbox",checked:this.state.newLine,onChange:this.handleInputChange}),"New Line"]}),Object(n.jsx)("br",{}),Object(n.jsxs)("label",{children:[Object(n.jsx)("input",{id:Ge.newParagraph,name:"newParagraph",type:"checkbox",checked:this.state.newParagraph,onChange:this.handleInputChange}),"New Paragraph"]})]}),Object(n.jsx)("div",{className:"sk-button-group stretch",children:Object(n.jsx)("button",{type:"button",id:"appendTextButton",onClick:this.appendTextToNote,className:"sk-button info",children:Object(n.jsx)("div",{children:"Append"})})})]})]})}}]),o}(s.a.Component);Me.defaultProps={};var ye,Ce=function(e){var t=e.caption,o=e.className,i=e.condition,s=e.onClick,a=e.title;return Object(n.jsxs)("button",{className:o,onClick:s,title:a,children:[i?Object(n.jsx)(f,{role:"button"}):Object(n.jsx)(x,{role:"button"}),Object(n.jsx)("p",{className:"chevron-button-caption",children:t})]})},Ee=function(e){var t=e.caption,o=e.className,i=e.fill,s=e.onClick,a=e.title;return Object(n.jsxs)("button",{className:o,onClick:s,title:a,children:[Object(n.jsx)(v,{fill:i,role:"button"}),Object(n.jsx)("span",{className:"button-caption",children:t})]})},Se=function(e){var t=e.caption,o=e.className,i=e.condition,s=e.messageOn,a=e.messageOff,r=e.onClick,c=e.title;return Object(n.jsxs)("button",{className:o,onClick:r,title:c,children:[Object(n.jsx)(O,{condition:i,role:"button"}),Object(n.jsxs)("span",{className:"button-caption",children:[t,":",Object(n.jsxs)("b",{children:["\xa0",i?s:a]})]})]})},ke=function(e){var t=e.caption,o=e.className,i=e.fill,s=e.onClick,a=e.title;return Object(n.jsxs)("button",{className:o,onClick:s,title:a,children:[Object(n.jsx)(C,{fill:i,role:"button"}),Object(n.jsx)("span",{className:"button-caption",children:t})]})},Te=function(e){var t=e.caption,o=e.className,i=e.fill,s=e.id,a=e.onClick,r=e.title;return Object(n.jsxs)("button",{className:o,id:s,onClick:a,title:r,children:[Object(n.jsx)(S,{fill:i,role:"button"}),Object(n.jsx)("span",{className:"button-caption",children:t})]})},Le=function(e){var t=e.fill,o=e.id,i=e.onClick,s=e.title;return Object(n.jsx)("button",{id:o,onClick:i,title:s,children:Object(n.jsx)(T,{fill:t,role:"button"})})},Ne="editingMode",Be="fontEdit",De="fontSize",Ae="fontView",Ve="monacoEditorLanguage",He="resetAllSettings",Ke="saveAsDefault",Ie=new RegExp(/```css\n/gm),Fe=new RegExp(/```css/gm),Pe=new RegExp(/\n```/gm),Ue=new RegExp(/```/gm),ze=function(e){Object(h.a)(o,e);var t=Object(u.a)(o);function o(e){var n;Object(d.a)(this,o),(n=t.call(this,e)).handleInputChange=function(e){var t=e.target,o="checkbox"===t.type?t.checked:t.value,i=t.name;n.setState(Object(we.a)({},i,o)),n.props.debugMode&&console.log("Settings event name: "+e.target.name+" Value: "+e.target.value)},n.handleSelectChange=function(e){var t=e.target,o=t.value,i=t.name;n.setState(Object(we.a)({},i,o),(function(){n.props.debugMode&&console.log("Saved select. Name: "+e.target.name+" Value: "+e.target.value)}))},n.toggleShowCustomStyles=function(){n.setState({showCustomStyles:!n.state.showCustomStyles})},n.cleanCustomStyles=function(e){return e?e.replace(Ie,"").replace(Fe,"").replace(Pe,"").replace(Ue,""):e},n.saveText=function(e){n.setState({customStyles:e})},n.handleSubmit=function(){if(n.props.debugMode){var e="",t="";""===n.state.fontEdit||void 0===n.state.fontEdit?e="Default":n.state.fontEdit&&(e=n.state.fontEdit),""===n.state.fontView||void 0===n.state.fontView?t="Default":n.state.fontView&&(t=n.state.fontView),console.log("Settings.tsx handleSubmit() triggered: \n - Settings editingMode: "+n.state.editingMode+"\n - Settings fontEdit: "+n.state.fontEdit+"\n - Settings fontView: "+n.state.fontView+"\n - Your chosen font for Edit/Append is: "+e+"\n - Your chosen font for View/Print is: "+t+"\n")}n.setState({customStyles:n.cleanCustomStyles(n.state.customStyles)},(function(){n.props.debugMode&&console.log("Your custom styles: "+n.state.customStyles);var e=n.state,t=e.customStyles,o=e.editingMode,i=e.fontEdit,s=e.fontSize,a=e.fontView,r=e.monacoEditorLanguage,c=e.saveAsDefault;n.props.onConfirm({customStyles:t,editingMode:o,fontEdit:i,fontSize:s,fontView:a,monacoEditorLanguage:r,saveAsDefault:c})}))},n.loadDefaultSettings=function(){var e=n.props.defaultSettings;n.setState(Object(l.a)({},e),(function(){n.refreshCustomStyles()}))},n.refreshCustomStyles=function(){n.setState({showCustomStyles:!n.state.showCustomStyles},(function(){n.setState({showCustomStyles:!n.state.showCustomStyles})}))},n.clearCustomStyles=function(){n.setState({customStyles:""},(function(){n.refreshCustomStyles(),n.props.debugMode&&console.log("customStyles reset: "+n.state.customStyles)}));var e=document.getElementById("customStyles");e&&(e.value="",e.focus())},n.clearFontEdit=function(){n.setState({fontEdit:""});var e=document.getElementById(Be);e&&(e.value="",e.focus())},n.clearFontSize=function(){n.setState({fontSize:""});var e=document.getElementById(De);e&&(e.value="",e.focus())},n.clearFontView=function(){n.setState({fontView:""});var e=document.getElementById(Ae);e&&(e.value="",e.focus())},n.clearEditingMode=function(){n.setState({editingMode:Xe.usePlainText})},n.clearMonacoEditorLanguage=function(){n.setState({monacoEditorLanguage:"markdown"});var e=document.getElementById(Ve);e&&(e.value="markdown",e.focus())},n.clearSaveAsDefault=function(){n.setState({saveAsDefault:!1});var e=document.getElementById(Ke);e.checked=!1,e.focus()},n.clearAllSettings=function(){n.clearSaveAsDefault(),n.clearCustomStyles(),n.clearFontView(),n.clearFontEdit(),n.clearFontSize(),n.clearMonacoEditorLanguage(),n.clearEditingMode();var e=document.getElementById(He);e&&e.focus()},n.onKeyDown=function(e){n.props.keyMap.set(e.key,!0),(n.props.keyMap.get("Control")&&n.props.keyMap.get("s")||n.props.keyMap.get("Control")&&n.props.keyMap.get("Enter"))&&(e.preventDefault(),n.handleSubmit())},n.onKeyUp=function(e){n.props.keyMap.set(e.key,!1)},n.onBlur=function(e){n.props.keyMap.clear()},n.componentWillUnmount=function(){n.props.keyMap.clear()};var i="markdown";n.props.monacoEditorLanguage&&(i=n.props.monacoEditorLanguage);var s="usePlainText";return n.props.editingMode&&(s=n.props.editingMode),n.state={customStyles:n.props.customStyles,editingMode:s,fontEdit:n.props.fontEdit,fontSize:n.props.fontSize,fontView:n.props.fontView,monacoEditorLanguage:i,saveAsDefault:!1,showCustomStyles:!1},n}return Object(p.a)(o,[{key:"render",value:function(){var e=this.props,t=e.title,o=e.onCancel,i=e.confirmText,s=e.cancelText,a=e.helpLink;return Object(n.jsxs)("div",{id:"settings",className:"sk-panel main settings",children:[Object(n.jsx)("div",{className:"sk-panel-content",children:Object(n.jsxs)("div",{className:"sk-panel-section",children:[Object(n.jsxs)("datalist",{id:"fonts",children:[Object(n.jsx)("option",{value:'SFMono-Regular, Consolas, Liberation Mono, Menlo, "Ubuntu Mono", courier, monospace;'}),Object(n.jsx)("option",{value:"Times New Roman"}),Object(n.jsx)("option",{value:"Arial"}),Object(n.jsx)("option",{value:"Arial Black"}),Object(n.jsx)("option",{value:"-apple-system"}),Object(n.jsx)("option",{value:"Bell MT"}),Object(n.jsx)("option",{value:"Baskerville Old Face"}),Object(n.jsx)("option",{value:"Bahnschrift Light"}),Object(n.jsx)("option",{value:"BlinkMacSystemFont"}),Object(n.jsx)("option",{value:"Bodoni MT"}),Object(n.jsx)("option",{value:"Calibri"}),Object(n.jsx)("option",{value:"Calibri Light"}),Object(n.jsx)("option",{value:"Calisto MT"}),Object(n.jsx)("option",{value:"Cambria"}),Object(n.jsx)("option",{value:"Candara"}),Object(n.jsx)("option",{value:"Candara Light"}),Object(n.jsx)("option",{value:"Cantarell"}),Object(n.jsx)("option",{value:"Centaur"}),Object(n.jsx)("option",{value:"Century"}),Object(n.jsx)("option",{value:"Century Gothic"}),Object(n.jsx)("option",{value:"Comic Sans MS"}),Object(n.jsx)("option",{value:"Consolas"}),Object(n.jsx)("option",{value:"Constantia"}),Object(n.jsx)("option",{value:"Courier New"}),Object(n.jsx)("option",{value:"Corbel"}),Object(n.jsx)("option",{value:"Corbel Light"}),Object(n.jsx)("option",{value:"DengXian"}),Object(n.jsx)("option",{value:"Ebrima"}),Object(n.jsx)("option",{value:"Droid Sans"}),Object(n.jsx)("option",{value:"Fira Sans"}),Object(n.jsx)("option",{value:"Gabriola"}),Object(n.jsx)("option",{value:"Garamond"}),Object(n.jsx)("option",{value:"Georgia"}),Object(n.jsx)("option",{value:"Helvetica"}),Object(n.jsx)("option",{value:"Helvetica Neue"}),Object(n.jsx)("option",{value:"Impact"}),Object(n.jsx)("option",{value:"KaTeX_AMS"}),Object(n.jsx)("option",{value:"KaTeX_Caligraphic"}),Object(n.jsx)("option",{value:"KaTeX_Fraktur"}),Object(n.jsx)("option",{value:"KaTeX_Main"}),Object(n.jsx)("option",{value:"KaTeX_Math"}),Object(n.jsx)("option",{value:"KaTeX_SansSerif"}),Object(n.jsx)("option",{value:"KaTeX_Script"}),Object(n.jsx)("option",{value:"KaTeX_Typewriter"}),Object(n.jsx)("option",{value:"Lato"}),Object(n.jsx)("option",{value:"Liberation Mono"}),Object(n.jsx)("option",{value:"Lucida Caligraphy"}),Object(n.jsx)("option",{value:"Lucida Sans"}),Object(n.jsx)("option",{value:"Menlo"}),Object(n.jsx)("option",{value:"Monaco"}),Object(n.jsx)("option",{value:"Monospace"}),Object(n.jsx)("option",{value:"New York"}),Object(n.jsx)("option",{value:"Oxygen"}),Object(n.jsx)("option",{value:"Palatino"}),Object(n.jsx)("option",{value:"Roboto"}),Object(n.jsx)("option",{value:"Sans-Serif"}),Object(n.jsx)("option",{value:"Segoe UI"}),Object(n.jsx)("option",{value:"SFMono-Regular"}),Object(n.jsx)("option",{value:"Serif"}),Object(n.jsx)("option",{value:"Sylfaen"}),Object(n.jsx)("option",{value:"Tahoma"}),Object(n.jsx)("option",{value:"Times New Roman"}),Object(n.jsx)("option",{value:"Trebuchet MS"}),Object(n.jsx)("option",{value:"Ubuntu"}),Object(n.jsx)("option",{value:"Verdana"}),Object(n.jsx)("option",{value:"Yu Gothic"})]}),Object(n.jsxs)("div",{className:"sk-panel-row title-section",children:[Object(n.jsx)("h1",{children:t}),Object(n.jsx)("button",{id:"undoDialog",onClick:o,title:"Close",children:Object(n.jsx)(m,{role:"button"})})]}),Object(n.jsx)("section",{className:"sk-panel-row settings",children:Object(n.jsxs)("div",{className:"text-and-undo-button",children:[Object(n.jsxs)("p",{children:["Need help? Check out the"," ",Object(n.jsx)("a",{href:a,target:"_blank",rel:"noopener noreferrer",children:"documentation"}),". To clear all settings, click undo:\xa0"]}),Object(n.jsx)(Le,{onClick:this.clearAllSettings,title:"Reset all Settings",id:He})]})}),Object(n.jsx)("section",{className:"sk-panel-row settings",children:Object(n.jsxs)("div",{className:"text-and-undo-button",children:[Object(n.jsx)("p",{children:"To load your personal default settings, click:\xa0"}),Object(n.jsx)("button",{onClick:this.loadDefaultSettings,title:"Load personal default settings",children:Object(n.jsx)(k,{role:"button"})})]})}),Object(n.jsx)("section",{className:"sk-panel-row settings",children:Object(n.jsxs)("div",{className:"text-and-undo-button",children:[Object(n.jsx)("p",{children:"Editing Mode: "}),Object(n.jsx)(Le,{onClick:this.clearEditingMode,title:"Reset Editing Mode to Plain Textarea"})]})}),Object(n.jsx)("section",{className:"sk-panel-row settings",children:Object(n.jsxs)("label",{children:[Object(n.jsx)("input",{id:Xe.usePlainText,name:Ne,value:Xe.usePlainText,className:"radio",type:"radio",checked:this.state.editingMode===Xe.usePlainText,onChange:this.handleInputChange}),"Plain Textarea: standard textarea with spellcheck (default, mobile recommended)"]})}),Object(n.jsx)("section",{className:"sk-panel-row settings",children:Object(n.jsxs)("label",{children:[Object(n.jsx)("input",{id:Xe.useCodeMirror,name:Ne,value:Xe.useCodeMirror,type:"radio",className:"radio",checked:this.state.editingMode===Xe.useCodeMirror,onChange:this.handleInputChange}),"CodeMirror: in-line formatting for Markdown"]})}),Object(n.jsx)("section",{className:"sk-panel-row settings",children:Object(n.jsxs)("label",{children:[Object(n.jsx)("input",{id:Xe.useDynamicEditor,name:Ne,value:Xe.useDynamicEditor,type:"radio",className:"radio",checked:this.state.editingMode===Xe.useDynamicEditor,onChange:this.handleInputChange}),"Dynamic: live formatting for Markdown. ",Object(n.jsx)("b",{children:"warning: "}),"existing Markdown may break (not compatible with KaTeX, lists may not render properly; desktop and mobile compatible)"]})}),Object(n.jsx)("section",{className:"sk-panel-row settings",children:Object(n.jsxs)("label",{htmlFor:Xe.useMonacoEditor,children:[Object(n.jsx)("input",{id:Xe.useMonacoEditor,name:Ne,value:Xe.useMonacoEditor,type:"radio",className:"radio",checked:this.state.editingMode===Xe.useMonacoEditor,onChange:this.handleInputChange}),"Monaco: syntax highlighting for Markdown and many other programming languages, intelligent auto-completion, sophisticated search and replace (desktop recommended)"]})}),this.state.editingMode===Xe.useMonacoEditor&&[Object(n.jsxs)("section",{className:"sk-panel-row settings",children:[Object(n.jsxs)("label",{htmlFor:Ve,children:["Monaco Editor Language:"," "]}),Object(n.jsxs)("div",{className:"input-and-undo-button",children:[Object(n.jsx)("label",{children:Object(n.jsxs)("select",{id:Ve,name:Ve,value:this.state.monacoEditorLanguage,onChange:this.handleSelectChange,children:[Object(n.jsx)("option",{children:"abap"}),Object(n.jsx)("option",{children:"aes"}),Object(n.jsx)("option",{children:"apex"}),Object(n.jsx)("option",{children:"azcli"}),Object(n.jsx)("option",{children:"bat"}),Object(n.jsx)("option",{children:"c"}),Object(n.jsx)("option",{children:"cameligo"}),Object(n.jsx)("option",{children:"clojure"}),Object(n.jsx)("option",{children:"coffeescript"}),Object(n.jsx)("option",{children:"cpp"}),Object(n.jsx)("option",{children:"csharp"}),Object(n.jsx)("option",{children:"csp"}),Object(n.jsx)("option",{children:"css"}),Object(n.jsx)("option",{children:"dart"}),Object(n.jsx)("option",{children:"dockerfile"}),Object(n.jsx)("option",{children:"fsharp"}),Object(n.jsx)("option",{children:"go"}),Object(n.jsx)("option",{children:"graphql"}),Object(n.jsx)("option",{children:"handlebars"}),Object(n.jsx)("option",{children:"hcl"}),Object(n.jsx)("option",{children:"html"}),Object(n.jsx)("option",{children:"ini"}),Object(n.jsx)("option",{children:"java"}),Object(n.jsx)("option",{children:"javascript"}),Object(n.jsx)("option",{children:"json"}),Object(n.jsx)("option",{children:"julia"}),Object(n.jsx)("option",{children:"kotlin"}),Object(n.jsx)("option",{children:"less"}),Object(n.jsx)("option",{children:"lexon"}),Object(n.jsx)("option",{children:"lua"}),Object(n.jsx)("option",{children:"markdown"}),Object(n.jsx)("option",{children:"mips"}),Object(n.jsx)("option",{children:"msdax"}),Object(n.jsx)("option",{children:"mysql"}),Object(n.jsx)("option",{children:"objective-c"}),Object(n.jsx)("option",{children:"pascal"}),Object(n.jsx)("option",{children:"pascaligo"}),Object(n.jsx)("option",{children:"perl"}),Object(n.jsx)("option",{children:"pgsql"}),Object(n.jsx)("option",{children:"php"}),Object(n.jsx)("option",{children:"plaintext"}),Object(n.jsx)("option",{children:"postiats"}),Object(n.jsx)("option",{children:"powerquery"}),Object(n.jsx)("option",{children:"powershell"}),Object(n.jsx)("option",{children:"pug"}),Object(n.jsx)("option",{children:"python"}),Object(n.jsx)("option",{children:"r"}),Object(n.jsx)("option",{children:"razor"}),Object(n.jsx)("option",{children:"redis"}),Object(n.jsx)("option",{children:"redshift"}),Object(n.jsx)("option",{children:"restructuredtext"}),Object(n.jsx)("option",{children:"ruby"}),Object(n.jsx)("option",{children:"rust"}),Object(n.jsx)("option",{children:"sb"}),Object(n.jsx)("option",{children:"scala"}),Object(n.jsx)("option",{children:"scheme"}),Object(n.jsx)("option",{children:"scss"}),Object(n.jsx)("option",{children:"shell"}),Object(n.jsx)("option",{children:"sol"}),Object(n.jsx)("option",{children:"sql"}),Object(n.jsx)("option",{children:"st"}),Object(n.jsx)("option",{children:"swift"}),Object(n.jsx)("option",{children:"systemverilog"}),Object(n.jsx)("option",{children:"tcl"}),Object(n.jsx)("option",{children:"twig"}),Object(n.jsx)("option",{children:"typescript"}),Object(n.jsx)("option",{children:"vb"}),Object(n.jsx)("option",{children:"verilog"}),Object(n.jsx)("option",{children:"xml"}),Object(n.jsx)("option",{children:"yaml"})]})}),Object(n.jsx)(Le,{onClick:this.clearMonacoEditorLanguage,title:"Reset Monaco Editor Language to Markdown"})]})]})],Object(n.jsxs)("section",{className:"sk-panel-row settings",children:[Object(n.jsx)("label",{htmlFor:De,children:"Choose a base font size: "}),Object(n.jsxs)("div",{className:"input-and-undo-button",children:[Object(n.jsxs)("select",{id:De,name:De,value:this.state.fontSize,onChange:this.handleSelectChange,children:[Object(n.jsx)("option",{}),Object(n.jsx)("option",{children:"12px"}),Object(n.jsx)("option",{children:"13px"}),Object(n.jsx)("option",{children:"14px"}),Object(n.jsx)("option",{children:"15px"}),Object(n.jsx)("option",{children:"16px"}),Object(n.jsx)("option",{children:"17px"}),Object(n.jsx)("option",{children:"18px"}),Object(n.jsx)("option",{children:"19px"}),Object(n.jsx)("option",{children:"20px"}),Object(n.jsx)("option",{children:"21px"}),Object(n.jsx)("option",{children:"22px"}),Object(n.jsx)("option",{children:"23px"}),Object(n.jsx)("option",{children:"24px"}),Object(n.jsx)("option",{children:"25px"}),Object(n.jsx)("option",{children:"26px"}),Object(n.jsx)("option",{children:"27px"}),Object(n.jsx)("option",{children:"28px"}),Object(n.jsx)("option",{children:"29px"}),Object(n.jsx)("option",{children:"30px"})]}),Object(n.jsx)(Le,{onClick:this.clearFontSize,title:"Reset font size to 16px"})]})]}),this.state.editingMode!==Xe.useMonacoEditor&&[Object(n.jsxs)("section",{className:"sk-panel-row settings",children:[Object(n.jsxs)("label",{htmlFor:Be,children:["Choose a font for Edit/Append:"," "]}),Object(n.jsxs)("div",{className:"input-and-undo-button",children:[Object(n.jsx)("input",{list:"fonts",id:Be,name:Be,value:this.state.fontEdit,onChange:this.handleInputChange,onKeyDown:this.onKeyDown,onKeyUp:this.onKeyUp,type:"text"}),Object(n.jsx)(Le,{onClick:this.clearFontEdit,title:"Reset font for Edit/Append"})]})]})],this.state.editingMode!==Xe.useDynamicEditor&&[Object(n.jsxs)("section",{className:"sk-panel-row settings",children:[Object(n.jsxs)("label",{htmlFor:Ae,children:["Choose a font for View/Print:"," "]}),Object(n.jsxs)("div",{className:"input-and-undo-button",children:[Object(n.jsx)("input",{list:"fonts",id:Ae,name:Ae,value:this.state.fontView,onChange:this.handleInputChange,onKeyDown:this.onKeyDown,onKeyUp:this.onKeyUp,type:"text"}),Object(n.jsx)(Le,{onClick:this.clearFontView,title:"Reset font for View/Print"})]})]})],Object(n.jsxs)("section",{className:"sk-panel-row settings",children:[Object(n.jsx)(Ce,{caption:"Add custom styles (CSS):",className:"chevron-toggle-button",condition:this.state.showCustomStyles,onClick:this.toggleShowCustomStyles,title:"Toggle show add custom styles (CSS)"}),this.state.showCustomStyles&&[Object(n.jsx)("div",{className:"text-and-undo-button",children:Object(n.jsx)(Le,{onClick:this.clearCustomStyles,title:"Reset custom styles (CSS)"})})]]}),this.state.showCustomStyles&&[Object(n.jsx)("section",{className:"sk-panel-row settings",children:Object(n.jsx)(A,{tabSize:2,language:"css",text:this.state.customStyles,onKeyDown:this.onKeyDown,onKeyUp:this.onKeyUp,saveText:this.saveText})})],Object(n.jsxs)("section",{className:"sk-panel-row settings",children:[Object(n.jsxs)("label",{htmlFor:Ke,children:["Save these settings as your personal default:"," "]}),Object(n.jsxs)("div",{className:"input-and-undo-button",children:[Object(n.jsx)("label",{children:Object(n.jsx)("input",{id:Ke,name:Ke,type:"checkbox",checked:this.state.saveAsDefault,onChange:this.handleInputChange})}),Object(n.jsx)(Le,{onClick:this.clearSaveAsDefault,title:"Clear save as default"})]})]})]})}),Object(n.jsx)("div",{className:"sk-panel-footer",children:Object(n.jsxs)("div",{className:"sk-button-group stretch",children:[Object(n.jsx)("button",{className:"sk-button neutral",onClick:o,children:Object(n.jsx)("div",{children:s})}),Object(n.jsx)("button",{className:"sk-button info",onClick:this.handleSubmit,children:Object(n.jsx)("div",{children:i})})]})})]})}}]),o}(s.a.Component),Re=function(e){Object(h.a)(o,e);var t=Object(u.a)(o);function o(e){var n;return Object(d.a)(this,o),(n=t.call(this,e)).state={hasError:!1},n}return Object(p.a)(o,[{key:"componentDidCatch",value:function(e,t){console.log("Error:",e,"\nError Info:",t),this.setState({error:e,errorInfo:t})}},{key:"render",value:function(){var e,t;return this.state.hasError?Object(n.jsx)("div",{className:"sk-panel main",children:Object(n.jsx)("div",{className:"sk-panel-content view",children:Object(n.jsxs)("div",{id:"errorBoundary",children:[Object(n.jsx)("h1",{children:"Something went wrong."}),Object(n.jsxs)("p",{children:["Error Name: ",Object(n.jsx)("code",{children:null===(e=this.state.error)||void 0===e?void 0:e.name})]}),Object(n.jsxs)("p",{children:["Error Message: ",Object(n.jsx)("code",{children:null===(t=this.state.error)||void 0===t?void 0:t.message})]}),Object(n.jsx)("p",{children:"Please see the developer console for details."}),Object(n.jsx)("hr",{}),Object(n.jsxs)("p",{children:["Errors such as ",Object(n.jsx)("code",{children:"TypeError"})," and"," ",Object(n.jsx)("code",{children:"Cannot read property 'type' of undefined"})," usually occur when the editor is unable to process and render your notes because it contains incorrect or incomplete HTML. If you are writing in HTML, then please continue to write and refresh the View Mode when the HTML tags are closed."]}),Object(n.jsxs)("p",{children:["If you are using the Dynamic editing mode, then please switch to the Plain Textarea or Monaco editing modes in the Settings",Object(n.jsxs)("button",{className:"inline-text-and-svg",onClick:Y,title:"Open Settings",children:[Object(n.jsx)("span",{children:"\xa0"}),Object(n.jsx)(w,{role:"button"}),Object(n.jsx)("span",{children:"\xa0"})]}),"and remove or fix the text that is causing the error."]}),Object(n.jsxs)("p",{children:["If the error persists or is not related to the content of your note, then please"," ",Object(n.jsx)("a",{href:"https://github.com/TheodoreChu/append-editor/issues",target:"_blank",rel:"noopener noreferrer",children:"report the issue on GitHub"})," ","and we will try to fix it."," ",Object(n.jsx)("span",{role:"img","aria-label":"smile emoji",children:"\ud83d\ude42"})]})]})})}):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return{hasError:!0}}}]),o}(s.a.Component),We=o(447),_e=o.n(We),Ze=o(448),Ye=o.n(Ze);!function(e){e.chevronToggleButton="menu-button chevron-toggle-button",e.menuButton="menu-button",e.on=" on",e.off=" off"}(ye||(ye={}));var Ge,qe,Xe,Qe=function(e){Object(h.a)(o,e);var t=Object(u.a)(o);function o(e){var n;return Object(d.a)(this,o),(n=t.call(this,e)).clearTooltipTimer=void 0,n.resetMessageTimer=function(){n.clearTooltipTimer&&clearTimeout(n.clearTooltipTimer),n.clearTooltipTimer=setTimeout((function(){n.setState({displayMessageEdit:!1,displayMessageShare:!1})}),5e3)},n.showMessageEdit=function(){n.setState({displayMessageEdit:!0,displayMessageShare:!1},(function(){n.resetMessageTimer()}))},n.showMessageShare=function(){n.setState({displayMessageEdit:!1,displayMessageShare:!0},(function(){n.resetMessageTimer()}))},n.copyToClipboard=function(e){var t=document.createElement("textarea");t.value=e,document.body.appendChild(t),t.select(),document.execCommand("copy"),n.showMessageShare(),t.remove()},n.copyText=function(){n.props.text?n.setState({message:"Copied Text to clipboard"},(function(){n.copyToClipboard(n.props.text)})):n.setState({message:"No text to copy. Your note is empty"},(function(){n.showMessageShare()}))},n.copyHtml=function(){if(n.props.viewMode)if(n.props.text){var e,t=document.getElementById("renderedNote");(null===t||void 0===t||null===(e=t.firstElementChild)||void 0===e?void 0:e.innerHTML)&&(n.setState({message:"Copied HTML to clipboard"}),n.copyToClipboard(null===t||void 0===t?void 0:t.firstElementChild.innerHTML))}else n.setState({message:"No HTML to copy. Your note is empty"},(function(){n.showMessageShare()}));else n.setState({message:"Unable to copy HTML. Please turn View Mode on"},(function(){return n.showMessageShare()}))},n.formatText=function(){"markdown"!==n.props.monacoEditorLanguage&&n.props.editingMode===Xe.useMonacoEditor?n.setState({message:"Error: Your Monaco Editor language is not Markdown. Formatting is only available for Markdown"},(function(){n.showMessageEdit()})):n.props.text?n.setState({message:"Formatted Markdown text with Prettier"},(function(){try{var e=_e.a.format(n.props.text,{parser:"markdown",plugins:[Ye.a]});n.props.saveText(e),n.props.refreshEdit(),n.props.refreshView(),n.showMessageEdit()}catch(t){n.setState({message:"Error formatting text: "+t},(function(){n.showMessageEdit()})),console.log("Error formatting text: "+t)}})):n.setState({message:"No text to format. Your note is empty"},(function(){n.showMessageEdit()}))},n.uncheckBoxes=function(){var e=n.props.text,t=new RegExp(/- \[x\]/gm);if(t.test(e)){var o=e.replace(t,"- [ ]");n.props.saveText(o),n.props.refreshEdit(),n.props.refreshView(),n.setState({message:"Unchecked all checkboxes"},(function(){n.showMessageEdit()}))}else n.setState({message:"No checked checkboxes found"},(function(){n.showMessageEdit()}))},n.state={message:"",displayMessageEdit:!1,displayMessageShare:!1},n}return Object(p.a)(o,[{key:"render",value:function(){return[Object(n.jsx)("div",{className:"menu-overlay",onClick:this.props.toggleShowMenu}),Object(n.jsxs)("div",{id:"menu",children:[Object(n.jsx)(Ce,{caption:"Appearance",className:ye.chevronToggleButton,condition:this.props.showMenuOptionsView,onClick:this.props.toggleShowMenuOptionsView,title:"Toggle show options for the appearance of the editor"}),this.props.showMenuOptionsView&&[Object(n.jsx)(Se,{caption:"Borderless",className:ye.menuButton+(this.props.borderlessMode?ye.on:ye.off),condition:this.props.borderlessMode,messageOn:"on",messageOff:"off",onClick:this.props.toggleBorderlessMode,title:"Toggle Borderless Mode. Blends borders and margins into the background for a cleaner look"}),Object(n.jsx)(Se,{caption:"Fixed Height",className:ye.menuButton+(this.props.fixedHeightMode?ye.on:ye.off),condition:this.props.fixedHeightMode,messageOn:"on",messageOff:"off",onClick:this.props.toggleFixedHeightMode,title:"Toggle Fixed Height Mode. Limits the height of the content container for easier side-by-side editing"}),Object(n.jsx)(Se,{caption:"Full Width",className:ye.menuButton+(this.props.fullWidthMode?ye.on:ye.off),condition:this.props.fullWidthMode,messageOn:"on",messageOff:"off",onClick:this.props.toggleFullWidthMode,title:"Toggle Full Width Mode for unrestricted editing. Borderless mode plus unset maximum container widths"}),Object(n.jsx)(Se,{caption:"Horizontal Overflow",className:ye.menuButton+(this.props.overflowMode?ye.on:ye.off),condition:this.props.overflowMode,messageOn:"visible",messageOff:"auto",onClick:this.props.toggleOverflowMode,title:"Toggle Horizontal Overflow. Visible is great for editing and viewing large tables and preformatted text. Works best with Full Width mode"})],Object(n.jsx)(Ce,{caption:"Share",className:ye.chevronToggleButton,condition:this.props.showMenuOptionsShare,onClick:this.props.toggleShowMenuOptionsShare,title:"Toggle show options to share your note"}),this.props.showMenuOptionsShare&&[Object(n.jsx)(Ee,{caption:"Copy note text",className:ye.menuButton,fill:"var(--sn-stylekit-success-color)",onClick:this.copyText,title:"Copy the text of your note to your device's clipboard"}),Object(n.jsx)(Ee,{caption:"Copy rendered HTML",className:ye.menuButton,fill:"var(--sn-stylekit-success-color)",onClick:this.copyHtml,title:"Copy the rendered HTML from your note text to your device's clipboard"}),Object(n.jsx)(Te,{caption:"Print rendered note",className:"menu-button off",fill:"var(--sn-stylekit-foreground-color)",id:Ge.printButton,onClick:this.props.onConfirmPrintUrl,title:"Print rendered note. Works best on the web app in Chromium browsers (e.g., MS Edge, Google Chrome). Not available on mobile"}),Object(n.jsx)("div",{className:"notification ".concat(this.state.displayMessageShare?"visible":"hidden"),children:Object(n.jsx)("p",{children:Object(n.jsx)("b",{children:this.state.message})})})],Object(n.jsx)(Ce,{caption:"Actions",className:ye.chevronToggleButton,condition:this.props.showMenuOptionsEdit,onClick:this.props.toggleShowMenuOptionsEdit,title:"Toggle show actions to quickly format and edit your note"}),this.props.showMenuOptionsEdit&&[Object(n.jsx)(ke,{caption:"Format Markdown text",className:ye.menuButton,fill:"var(--sn-stylekit-warning-color)",onClick:this.formatText,title:"Format Markdown text with Prettier. WARNING: this may cause undesired changes to your note text. Use the Note History feature to revert unwanted changes"}),Object(n.jsx)(ke,{caption:"Uncheck all checkboxes",className:ye.menuButton,fill:"var(--sn-stylekit-danger-color)",onClick:this.uncheckBoxes,title:"Uncheck all checkboxes. DANGER: this may cause undesired changes to your note text. Use the Note History feature to revert unwanted changes"}),Object(n.jsx)("div",{className:"notification ".concat(this.state.displayMessageEdit?"visible":"hidden"),children:Object(n.jsx)("p",{children:Object(n.jsx)("b",{children:this.state.message})})})],Object(n.jsx)("div",{className:"extra-space"})]})]}}]),o}(s.a.Component),Je=o(108),$e=o.n(Je);o(1161),o(1166),o(1167),o(1168),o(437),o(1170),o(305),o(304),o(1171);!function(e){e.appendButton="appendButton",e.appendTextArea="appendTextArea",e.appendix="appendix",e.content="content",e.edit="edit",e.editButton="editButton",e.editTextArea="editTextArea",e.header="header",e.helpButton="helpButton",e.menuButton="menuButton",e.newLine="newLine",e.newParagraph="newParagraph",e.printButton="printButton",e.settingsButton="settingsButton",e.view="view",e.viewButton="viewButton"}(Ge||(Ge={})),function(e){e.fixed="fixed",e.fixedHeader="fixed-header"}(qe||(qe={})),function(e){e.usePlainText="usePlainText",e.useCodeMirror="useCodeMirror",e.useDynamicEditor="useDynamicEditor",e.useMonacoEditor="useMonacoEditor"}(Xe||(Xe={}));var et={text:"",appendNewLine:!1,appendNewParagraph:!1,appendMode:!1,appendRows:8,appendText:"",bypassDebounce:!1,confirmPrintUrl:!1,customStyles:"",defaultSettings:{customStyles:"",editingMode:"usePlainText",fontEdit:"",fontSize:"",fontView:"",monacoEditorLanguage:"markdown"},fontEdit:"",fontSize:"",fontView:"",monacoEditorLanguage:"markdown",printURL:!0,refreshEdit:!1,refreshView:!1,showAppendix:!0,showHeader:!0,showHelp:!1,showDiff:!1,settingsMode:!1},tt=0,ot=!1,nt=new Map,it=function(e){Object(h.a)(o,e);var t=Object(u.a)(o);function o(e){var n;return Object(d.a)(this,o),(n=t.call(this,e)).editorKit=void 0,n.refreshEditorTimer=void 0,n.saveTimer=void 0,n.componentDidMount=function(){n.onViewMode(),n.loadDefaultMenuState(),document.addEventListener("scroll",n.onScroll)},n.componentWillUnmount=function(){document.removeEventListener("scroll",n.onScroll)},n.configureEditorKit=function(){var e=new j.EditorKitDelegate({setEditorRawText:function(e){n.setState(Object(l.a)(Object(l.a)({},et),{},{bypassDebounce:!0,text:e}),(function(){me.cancel(),me(e),me.flush(),ve.cancel(),me(e)&&(ve(e),ve.flush()),n.state.savingEditorOptions||(n.loadEditorOptions(),n.loadDefaultSettings(),n.loadMetaData()),setTimeout((function(){n.setState({bypassDebounce:!1})}),1e3)}))},clearUndoHistory:function(){},getElementsBySelector:function(){return[]}});n.editorKit=new j.EditorKit({delegate:e,mode:"plaintext",supportsFilesafe:!1})},n.refreshEditor=function(){me(n.state.text)?(n.refreshEditorTimer&&clearTimeout(n.refreshEditorTimer),n.refreshEditorTimer=setTimeout((function(){n.state.savingEditorOptions||(n.refreshEdit(),n.refreshView(),n.activateStyles())}),20)):(n.refreshEditorTimer&&clearTimeout(n.refreshEditorTimer),n.refreshEditorTimer=setTimeout((function(){n.state.savingEditorOptions||(n.refreshEdit(),n.refreshView(),n.activateStyles())}),10))},n.loadDefaultSettings=function(){try{var e=n.editorKit.internal.componentManager.componentDataValueForKey("defaultSettings"),t=n.editorKit.internal.componentManager.componentDataValueForKey("editingMode");if(void 0!==e){var o=JSON.parse(e);ot,n.setState({customStyles:o.customStyles,editingMode:o.editingMode,fontEdit:o.fontEdit,fontSize:o.fontSize,fontView:o.fontView,monacoEditorLanguage:o.monacoEditorLanguage,defaultSettings:o},(function(){n.refreshEditor()}))}else if(void 0!==t){var i=n.editorKit.internal.componentManager.componentDataValueForKey("customStyles"),s=n.editorKit.internal.componentManager.componentDataValueForKey("fontEdit"),a=n.editorKit.internal.componentManager.componentDataValueForKey("fontSize"),r=n.editorKit.internal.componentManager.componentDataValueForKey("fontView"),c=n.editorKit.internal.componentManager.componentDataValueForKey("monacoEditorLanguage");ot,n.setState({customStyles:i,editingMode:t,fontEdit:s,fontSize:a,fontView:r,monacoEditorLanguage:c,defaultSettings:{customStyles:i,editingMode:t,fontEdit:s,fontSize:a,fontView:r,monacoEditorLanguage:c}},(function(){n.refreshEditor()}))}else n.refreshEditor()}catch(l){console.log("Error loading default settings:",l)}},n.loadEditorOptions=function(){try{var e=n.editorKit.internal.componentManager.componentDataValueForKey("menuOptions");if(void 0!==e){var t=JSON.parse(e);n.setState({borderlessMode:t.borderlessMode,fixedHeightMode:t.fixedHeightMode,fullWidthMode:t.fullWidthMode,overflowMode:t.overflowMode},(function(){n.refreshEditor()}))}}catch(o){console.log("Error loading editor options:",o)}},n.loadMetaData=function(){n.editorKit.internal.componentManager.streamContextItem((function(e){(e.content.appendEditorCustomStyles||e.content.appendEditorEditingMode||e.content.appendEditorFontEdit||e.content.appendEditorFontSize||e.content.appendEditorFontView||e.content.appendEditorMonacoEditorLanguage)&&n.setState({customStyles:e.content.appendEditorCustomStyles,editingMode:e.content.appendEditorEditingMode,fontEdit:e.content.appendEditorFontEdit,fontSize:e.content.appendEditorFontSize,fontView:e.content.appendEditorFontView,monacoEditorLanguage:e.content.appendEditorMonacoEditorLanguage},(function(){n.refreshEditor()})),(e.content.appendNewLine||e.content.appendNewParagraph)&&n.setState({appendNewLine:e.content.appendNewLine,appendNewParagraph:e.content.appendNewParagraph}),n.setState({appendText:e.content.appendText},(function(){n.state.text||n.state.appendText||n.state.editMode||n.onEditMode()}))}))},n.saveText=function(e){n.saveNote(e),n.setState({text:e},(function(){n.state.editingMode===Xe.useDynamicEditor?n.refreshView():n.state.viewMode&&me(e)&&(n.saveTimer&&clearTimeout(n.saveTimer),n.saveTimer=setTimeout((function(){if(n.state.fixedHeightMode){var e=document.getElementById(Ge.view);if(e){var t=e.scrollTop;n.refreshView();var o=document.getElementById(Ge.view);o&&(o.scrollTop=t)}else n.refreshView()}else n.refreshView()}),550))}))},n.saveNote=function(e){try{n.editorKit.onEditorValueChanged(e)}catch(t){console.log("Error saving note:",t)}},n.appendTextToNote=function(){if(n.state.appendText){var e=n.state.appendText,t="";t=n.state.appendNewParagraph?" \n\n"+e:n.state.appendNewLine?" \n"+e:e,n.setState({text:n.state.text.concat(t),appendText:""},(function(){var e=n.editorKit.internal.note;e&&n.editorKit.internal.componentManager.saveItemWithPresave(e,(function(){e.content.text=n.state.text,e.content.appendText=n.state.appendText})),n.refreshEdit(),n.state.editingMode===Xe.useDynamicEditor?(n.refreshView(),setTimeout((function(){n.skipToBottom()}),50)):me(n.state.text)?setTimeout((function(){n.refreshView(),n.skipToBottom()}),550):n.skipToBottom()}))}n.state.appendCodeMirror&&n.state.editingMode===Xe.useCodeMirror&&n.state.appendCodeMirror.setValue("")},n.autoSaveAppendText=function(e){n.setState({appendText:e});try{var t=n.editorKit.internal.note;t&&n.editorKit.internal.componentManager.saveItemWithPresave(t,(function(){t.content.appendText=e}))}catch(o){console.log("Error saving appendText:",o)}},n.autoSaveCheckBoxes=function(e,t){n.setState({appendNewLine:e,appendNewParagraph:t});try{var o=n.editorKit.internal.note;o&&n.editorKit.internal.componentManager.saveItemWithPresave(o,(function(){o.content.appendNewLine=e,o.content.appendNewParagraph=t}))}catch(i){console.log("Error saving checkboxes:",i)}},n.refreshEdit=function(){n.setState({refreshEdit:!n.state.refreshEdit},(function(){document.getElementById(Ge.editTextArea)&&n.state.editingMode===Xe.useCodeMirror&&n.configureCodeMirror(Ge.editTextArea)}))},n.refreshView=function(){n.setState({refreshView:!n.state.refreshView})},n.configureCodeMirror=function(e){if(e===Ge.editTextArea){ot;var t=document.getElementById(e);if(t){var o=$e.a.fromTextArea(t,{autocorrect:!0,autocapitalize:!0,extraKeys:{Enter:"newlineAndIndentContinueMarkdownList","Alt-F":"findPersistent"},lineNumbers:!1,lineWrapping:!0,mode:"gfm",spellcheck:!0,styleSelectedText:!0,tabindex:0,theme:"default",value:n.state.text});o.setSize("100%","100%"),o.on("change",(function(){var e=o.getValue();o.save(),n.saveText(e)})),o.on("keydown",(function(e,t){n.onKeyDown(t),n.onKeyDownEditTextArea(t),n.onKeyDownTextArea(t)})),o.on("keyup",(function(e,t){n.onKeyUp(t)})),n.setState({editCodeMirror:o})}}else if(e===Ge.appendTextArea){var i=document.getElementById(Ge.appendTextArea);if(i){var s=$e.a.fromTextArea(i,{autocorrect:!0,autocapitalize:!0,extraKeys:{Enter:"newlineAndIndentContinueMarkdownList","Alt-F":"findPersistent"},lineNumbers:!1,lineWrapping:!0,mode:"gfm",spellcheck:!0,styleSelectedText:!0,tabindex:0,theme:"default",value:n.state.appendText});s.setSize("100%","100%"),s.on("change",(function(){var e=s.getValue();s.save(),n.autoSaveAppendText(e)})),s.on("keydown",(function(e,t){n.onKeyDown(t),n.onKeyDownAppendTextArea(t),n.onKeyDownTextArea(t)})),s.on("keyup",(function(e,t){n.onKeyUp(t)})),n.setState({appendCodeMirror:s})}}},n.makeContentEditable=function(){var e=document.getElementById(Ge.content);e&&(e.setAttribute("contenteditable","true"),e.setAttribute("spellcheck","true"));var t=document.getElementById(Ge.appendix);t&&(t.setAttribute("contenteditable","true"),t.setAttribute("spellcheck","true"));var o=document.getElementById("renderedNote");o&&o.setAttribute("contenteditable","false");var n=document.getElementById("appendCustom");n&&n.setAttribute("contenteditable","false")},n.removeContentEditable=function(e){var t=document.getElementById(e);t&&t.setAttribute("contenteditable","false")},n.onEditMode=function(){n.state.editMode?n.state.editMode&&(n.state.editingMode!==Xe.useMonacoEditor&&n.setState({viewMode:!0}),n.state.editCodeMirror&&n.state.editCodeMirror.toTextArea(),n.setState({editMode:!1},(function(){if(!n.state.appendMode){var e=document.getElementById(Ge.editButton);e&&e.focus()}}))):(n.state.appendMode&&!n.state.appendText&&n.setState({appendMode:!1}),n.setState({editMode:!0},(function(){var e=document.getElementById(Ge.editTextArea);e&&(e.focus(),n.state.editingMode===Xe.useCodeMirror&&n.configureCodeMirror(Ge.editTextArea))})))},n.onAppendMode=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];n.state.appendMode?n.state.appendMode&&(n.state.appendCodeMirror&&n.state.appendCodeMirror.toTextArea(),n.setState({appendMode:!1},(function(){if(n.state.editingMode===Xe.useMonacoEditor&&n.refreshEdit(),o){var e=document.getElementById(Ge.appendButton);e&&e.focus()}}))):(t&&n.setState({editMode:!1}),n.setState({appendMode:!0},(function(){if(e&&n.scrollToBottom(),o){var t=document.getElementById(Ge.appendTextArea);t&&(t.focus(),n.state.editingMode===Xe.useCodeMirror&&n.configureCodeMirror(Ge.appendTextArea))}})))},n.onViewMode=function(){n.state.viewMode||n.setState({viewMode:!0},(function(){n.state.editingMode===Xe.useMonacoEditor&&n.refreshEdit(),n.state.appendMode&&!n.state.editMode&&n.skipToBottom()})),n.state.viewMode&&n.setState({viewMode:!1},(function(){n.state.editingMode===Xe.useMonacoEditor&&n.refreshEdit(),n.state.editMode||n.state.appendMode||n.onEditMode()}))},n.toggleShowHelp=function(){n.state.showHelp?n.setState({showHelp:!1},(function(){n.refreshView();var e=document.getElementById(Ge.helpButton);e&&e.focus()})):n.setState({showHelp:!0},(function(){n.state.viewMode?n.state.viewMode&&n.refreshView():n.onViewMode();var e=document.getElementById(Ge.helpButton);e&&e.focus(),setTimeout((function(){n.scrollToTop()}),50)}))},n.toggleShowMenu=function(){n.setState({showMenu:!n.state.showMenu},(function(){var e=document.getElementById(Ge.menuButton);e&&e.focus()}))},n.loadDefaultMenuState=function(){n.setState({showMenuOptionsEdit:!1,showMenuOptionsShare:!0,showMenuOptionsView:!0})},n.toggleShowMenuOptionsEdit=function(){n.setState({showMenuOptionsEdit:!n.state.showMenuOptionsEdit})},n.toggleShowMenuOptionsShare=function(){n.setState({showMenuOptionsShare:!n.state.showMenuOptionsShare})},n.toggleShowMenuOptionsView=function(){n.setState({showMenuOptionsView:!n.state.showMenuOptionsView})},n.toggleBorderlessMode=function(){n.setState({borderlessMode:!n.state.borderlessMode},(function(){n.activateFixedHeader(),n.saveMenuOptions()}))},n.toggleFixedHeightMode=function(){n.setState({fixedHeightMode:!n.state.fixedHeightMode},(function(){n.activateFixedHeader(),n.saveMenuOptions()}))},n.toggleFullWidthMode=function(){n.setState({fullWidthMode:!n.state.fullWidthMode},(function(){n.activateFixedHeader(),n.saveMenuOptions()}))},n.toggleOverflowMode=function(){n.setState({overflowMode:!n.state.overflowMode},(function(){n.activateFixedHeader(),n.saveMenuOptions()}))},n.saveMenuOptions=function(){var e;e={borderlessMode:n.state.borderlessMode,fixedHeightMode:n.state.fixedHeightMode,fullWidthMode:n.state.fullWidthMode,overflowMode:n.state.overflowMode},n.saveEditorOption("menuOptions",JSON.stringify(e))},n.saveEditorOption=function(e,t){n.setState({savingEditorOptions:!0},(function(){try{n.editorKit.internal.componentManager.setComponentDataValueForKey(e,t),setTimeout((function(){n.setState({savingEditorOptions:!1},(function(){n.loadDefaultSettings(),n.loadMetaData()}))}),250)}catch(o){console.log("Error saving editor option. Your optionKey:",e,"\n - Your optionValue: ",t,"\n - The error: ",o),n.setState({savingEditorOptions:!1},(function(){n.refreshEditor(),n.loadDefaultSettings(),n.loadMetaData()}))}}))},n.onSettingsMode=function(){n.state.settingsMode?n.state.settingsMode&&n.setState(Object(l.a)(Object(l.a)({},n.state.currentState),{},{settingsMode:!1}),(function(){n.refreshEdit();var e=document.getElementById(Ge.settingsButton);e&&e.focus()})):(n.removeFixedHeader(),n.setState({currentState:n.state},(function(){n.setState({appendMode:!1,editMode:!1,fullWidthMode:!1,fixedHeightMode:!1,settingsMode:!0,showAppendix:!1,showHeader:!1,showMenu:!1,viewMode:!1},(function(){var e=document.getElementById("undoDialog");e&&e.focus()}))})))},n.onSaveSettings=function(e){var t=e.customStyles,o=e.editingMode,i=e.fontEdit,s=e.fontSize,a=e.fontView,r=e.monacoEditorLanguage,c=e.saveAsDefault;n.setState(Object(l.a)(Object(l.a)({},n.state.currentState),{},{customStyles:t,editingMode:o,fontEdit:i,fontSize:s,fontView:a,monacoEditorLanguage:r,showAppendix:!0,showHeader:!0,settingsMode:!1}),(function(){n.refreshEditor();var e=document.getElementById(Ge.settingsButton);e&&e.focus()}));var d=n.editorKit.internal.note;d&&n.editorKit.internal.componentManager.saveItemWithPresave(d,(function(){d.content.appendEditorCustomStyles=t,d.content.appendEditorEditingMode=o,d.content.appendEditorFontEdit=i,d.content.appendEditorFontSize=s,d.content.appendEditorFontView=a,d.content.appendEditorMonacoEditorLanguage=r})),c&&n.setState({defaultSettings:{customStyles:t,editingMode:o,fontEdit:i,fontSize:s,fontView:a,monacoEditorLanguage:r}},(function(){n.saveEditorOption("defaultSettings",JSON.stringify(n.state.defaultSettings))}))},n.activateStyles=function(){var e=document.getElementById("customStyleSheet");if(e){var t=e.parentNode;t&&t.removeChild(e)}var o="";n.state.fontSize&&(o=".CodeMirror, .DynamicEditor, .MonacoEditorContainer, .ProseMirror, #editTextArea, #appendTextArea, #renderedNote {font-size: "+n.state.fontSize+";}\n");var i="";n.state.fontEdit&&(i=".CodeMirror, .DynamicEditor, .ProseMirror, #editTextArea, #appendTextArea {font-family: "+n.state.fontEdit+";}\n");var s="";if(n.state.fontView&&(s="#renderedNote {font-family: "+n.state.fontView+";}\n"),n.state.customStyles||n.state.fontEdit||n.state.fontSize||n.state.fontView){var a=document.createElement("style");a.setAttribute("id","customStyleSheet"),a.innerHTML=o+i+s+n.state.customStyles,document.body.appendChild(a)}},n.onCancelPrint=function(){n.setState({confirmPrintUrl:!1},(function(){var e=document.getElementById(Ge.printButton);e&&e.focus()}))},n.onConfirmPrintUrl=function(){n.setState({confirmPrintUrl:!0},(function(){var e=document.getElementById("undoDialog");e&&e.focus()}))},n.onPrintUrlTrue=function(){n.setState({confirmPrintUrl:!1,printURL:!0},(function(){n.printRenderedHtml()}))},n.onPrintUrlFalse=function(){n.setState({confirmPrintUrl:!1,printURL:!1},(function(){n.printRenderedHtml()}))},n.printRenderedHtml=function(){window.print();var e=document.getElementById(Ge.printButton);e&&e.focus()},n.goDown=function(){if(document.body.scrollTop=1e7,n.state.editMode){var e=document.getElementById(Ge.editTextArea);e&&(e.scrollTop=1e7)}if(n.state.appendMode){var t=document.getElementById(Ge.appendTextArea);t&&(t.scrollTop=1e7)}if(n.state.fixedHeightMode){var o=document.getElementById(Ge.view);o&&(o.scrollTop=1e7);var i=document.getElementById(Ge.edit);i&&(i.scrollTop=1e7);var s=document.getElementsByClassName("CodeMirror-vscrollbar")[0];s&&(s.scrollTop=1e7)}},n.scrollToBottom=function(){n.goDown();var e=document.getElementById(Ge.appendix);e&&e.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})},n.skipToBottom=function(){n.goDown();var e=document.getElementById(Ge.appendix);e&&e.scrollIntoView({behavior:"auto",block:"end",inline:"nearest"})},n.goUp=function(){if(document.body.scrollTop=0,n.state.editMode){var e=document.getElementById(Ge.editTextArea);e&&(e.scrollTop=0)}if(n.state.appendMode){var t=document.getElementById(Ge.appendTextArea);t&&(t.scrollTop=0)}if(n.state.fixedHeightMode){var o=document.getElementById(Ge.view);o&&(o.scrollTop=0);var i=document.getElementById(Ge.edit);i&&(i.scrollTop=0);var s=document.getElementsByClassName("CodeMirror-vscrollbar")[0];s&&(s.scrollTop=0)}},n.scrollToTop=function(){n.goUp();var e=document.getElementById("top");e&&e.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"})},n.skipToTop=function(){n.goUp();var e=document.getElementById("top");e&&e.scrollIntoView({behavior:"auto",block:"start",inline:"nearest"})},n.onKeyDown=function(e){nt.set(e.key,!0),nt.get("Control")&&nt.get("e")?(e.preventDefault(),n.onEditMode()):nt.get("Control")&&!nt.get("Alt")&&(nt.get("u")||nt.get("m"))?(e.preventDefault(),n.onAppendMode()):nt.get("Control")&&!nt.get("Alt")&&nt.get("p")?(e.preventDefault(),n.onViewMode()):nt.get("Control")&&nt.get(".")?(e.preventDefault(),n.setState({appendRows:n.state.appendRows+1})):nt.get("Control")&&nt.get(",")?(e.preventDefault(),n.state.appendRows>5&&n.setState({appendRows:n.state.appendRows-1})):nt.get("Control")&&nt.get("<")?(e.preventDefault(),n.setState({appendMode:!1,editMode:!1,viewMode:!1},(function(){n.onEditMode()}))):nt.get("Control")&&nt.get(">")?(e.preventDefault(),n.setState({appendMode:!1,editMode:!1,viewMode:!1},(function(){n.onAppendMode()}))):nt.get("Control")&&nt.get("[")?(e.preventDefault(),n.skipToTop()):nt.get("Control")&&nt.get("]")?(e.preventDefault(),n.skipToBottom()):nt.get("Control")&&!nt.get("Alt")&&!nt.get("Shift")&&nt.get("w")&&nt.delete("w")},n.onKeyDownAppendTextArea=function(e){if(nt.get("Escape"))e.preventDefault(),nt.delete("Escape"),n.onAppendMode();else if(nt.get("Control")&&nt.get("Enter"))e.preventDefault(),n.state.editingMode===Xe.useCodeMirror&&n.appendTextToNote();else if(nt.get("Control")&&nt.get("s"))e.preventDefault(),n.state.editingMode===Xe.useCodeMirror&&n.appendTextToNote();else if(nt.get("Control")&&!nt.get("Shift")&&nt.get("Alt")&&nt.get("n")){e.preventDefault();var t=document.getElementById(Ge.newLine);t&&t.click()}else if(nt.get("Control")&&!nt.get("Shift")&&nt.get("Alt")&&nt.get("p")){e.preventDefault();var o=document.getElementById(Ge.newParagraph);o&&o.click()}},n.onKeyDownEditTextArea=function(e){nt.get("Escape")&&(e.preventDefault(),nt.set("Escape",!1),n.onEditMode())},n.onKeyDownTextArea=function(e){nt.get("Shift")&&nt.get("Enter")?(e.preventDefault(),document.execCommand("insertText",!1," \n")):nt.get("Control")&&nt.get("b")?(e.preventDefault(),document.execCommand("insertText",!1,"**")):nt.get("Control")&&nt.get("h")?(e.preventDefault(),document.execCommand("insertText",!1,"#")):nt.get("Control")&&nt.get("Alt")&&nt.get("i")?(e.preventDefault(),document.execCommand("insertText",!1,"![]()")):nt.get("Control")&&nt.get("i")?(e.preventDefault(),document.execCommand("insertText",!1,"*")):nt.get("Control")&&nt.get("Alt")&&nt.get("k")?(e.preventDefault(),document.execCommand("insertText",!1,"`")):nt.get("Control")&&nt.get("k")?(e.preventDefault(),document.execCommand("insertText",!1,"[]()")):nt.get("Control")&&nt.get("Alt")&&nt.get("l")?(e.preventDefault(),document.execCommand("insertText",!1,"\n1. ")):nt.get("Control")&&nt.get("l")?(e.preventDefault(),document.execCommand("insertText",!1,"\n- ")):nt.get("Control")&&nt.get("Alt")&&nt.get("u")?(e.preventDefault(),document.execCommand("insertText",!1,"~~")):(nt.get("Control")&&nt.get("q")||nt.get("Control")&&nt.get("'")||nt.get("Control")&&nt.get('"'))&&(e.preventDefault(),document.execCommand("insertText",!1,"\n> "))},n.onKeyUp=function(e){nt.delete(e.key)},n.onBlur=function(e){nt.clear()},n.onScroll=function(e){n.state.settingsMode||(window.scrollYtt&&!n.state.showMenu&&n.removeFixedHeader(),tt=window.scrollY)},n.activateFixedHeader=function(){var e=document.getElementById(Ge.header),t=document.getElementById(Ge.content);e&&t&&(e.classList.add(qe.fixed),t.classList.add(qe.fixedHeader))},n.removeFixedHeader=function(){var e=document.getElementById(Ge.header),t=document.getElementById(Ge.content);e&&e.classList.remove(qe.fixed),t&&t.classList.remove(qe.fixedHeader)},n.configureEditorKit(),n.state=et,n}return Object(p.a)(o,[{key:"render",value:function(){var e=this;return[Object(n.jsx)("span",{id:"top"}),Object(n.jsxs)("div",{tabIndex:0,className:"sn-component",onKeyDown:this.onKeyDown,onKeyUp:this.onKeyUp,onBlur:this.onBlur,children:[this.state.showHeader&&[Object(n.jsx)("div",{id:Ge.header,className:"header",children:Object(n.jsxs)("div",{className:"sk-button-group",children:[Object(n.jsx)("button",{type:"button",id:Ge.editButton,onClick:this.onEditMode,title:"Toggle Edit Mode",className:"sk-button "+(this.state.editMode?"on":"off"),children:Object(n.jsx)(C,{condition:this.state.editMode,role:"button"})}),Object(n.jsx)("button",{type:"button",id:Ge.viewButton,onClick:this.onViewMode,title:"Toggle View Mode",className:"sk-button "+(this.state.viewMode?"on":"off"),children:Object(n.jsx)(O,{condition:this.state.viewMode,role:"button"})}),Object(n.jsx)("button",{type:"button",id:Ge.appendButton,onClick:function(){return e.onAppendMode()},title:"Toggle Append Mode",className:"sk-button "+(this.state.appendMode?"on":"off"),children:Object(n.jsx)(E,{condition:this.state.appendMode,role:"button"})}),Object(n.jsx)("div",{className:"sk-button divider",children:Object(n.jsx)("svg",{role:"img","aria-label":"Vertical line divider",width:"1",height:"24",viewBox:"0 0 1 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(n.jsx)("rect",{width:"1",height:"24",fill:"var(--sn-stylekit-foreground-color)"})})}),Object(n.jsx)("button",{type:"button",id:Ge.helpButton,onClick:this.toggleShowHelp,title:"Help",className:"sk-button "+(this.state.showHelp?"on":"off"),children:Object(n.jsx)(M,{condition:this.state.showHelp,role:"button"})}),Object(n.jsx)("button",{type:"button",id:Ge.settingsButton,onClick:this.onSettingsMode,title:"Settings",className:"sk-button "+(this.state.settingsMode?"on":"off"),children:Object(n.jsx)(w,{condition:this.state.settingsMode,role:"button"})}),Object(n.jsx)("div",{className:"sk-button divider",children:Object(n.jsx)("svg",{role:"img","aria-label":"Vertical line divider",width:"1",height:"24",viewBox:"0 0 1 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(n.jsx)("rect",{width:"1",height:"24",fill:"var(--sn-stylekit-foreground-color)"})})}),Object(n.jsx)("button",{type:"button",id:"scrollToBottomButtonHeader",onClick:this.skipToBottom,title:"Scroll to Bottom",className:"sk-button off",children:Object(n.jsx)("svg",{role:"button","aria-label":"Arrow pointing down for scroll to bottom button",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(n.jsx)("path",{d:"M6.17622 7.15015L10.0012 10.9751L13.8262 7.15015L15.0012 8.33348L10.0012 13.3335L5.00122 8.33348L6.17622 7.15015Z",fill:"var(--sn-stylekit-foreground-color)"})})}),Object(n.jsx)("button",{type:"button",id:"scrollToTopButtonHeader",onClick:this.skipToTop,title:"Scroll to Top",className:"sk-button off",children:Object(n.jsx)("svg",{role:"button","aria-label":"Arrow pointing up for scroll to top button",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(n.jsx)("path",{d:"M13.826 13.3335L10.001 9.5085L6.17597 13.3335L5.00097 12.1502L10.001 7.15017L15.001 12.1502L13.826 13.3335Z",fill:"var(--sn-stylekit-foreground-color)"})})}),Object(n.jsx)("button",{type:"button",id:Ge.menuButton,onClick:this.toggleShowMenu,title:"Toggle Menu",className:"sk-button "+(this.state.showMenu?"on":"off"),children:Object(n.jsx)(y,{condition:this.state.showMenu,role:"button"})})]})})],Object(n.jsxs)("div",{id:Ge.content,className:"content"+(this.state.borderlessMode?" borderless":"")+(this.state.fixedHeightMode?" fixed-height":"")+(this.state.fullWidthMode?" full-width":"")+(this.state.overflowMode?" overflow":""),children:[this.state.showMenu&&Object(n.jsx)(Re,{children:Object(n.jsx)(Qe,{borderlessMode:this.state.borderlessMode,editingMode:this.state.editingMode,fixedHeightMode:this.state.fixedHeightMode,fullWidthMode:this.state.fullWidthMode,monacoEditorLanguage:this.state.monacoEditorLanguage,onConfirmPrintUrl:this.onConfirmPrintUrl,overflowMode:this.state.overflowMode,refreshEdit:this.refreshEdit,refreshView:this.refreshView,saveText:this.saveText,showMenuOptionsEdit:this.state.showMenuOptionsEdit,showMenuOptionsShare:this.state.showMenuOptionsShare,showMenuOptionsView:this.state.showMenuOptionsView,text:this.state.text,toggleBorderlessMode:this.toggleBorderlessMode,toggleFixedHeightMode:this.toggleFixedHeightMode,toggleFullWidthMode:this.toggleFullWidthMode,toggleOverflowMode:this.toggleOverflowMode,toggleShowMenu:this.toggleShowMenu,toggleShowMenuOptionsEdit:this.toggleShowMenuOptionsEdit,toggleShowMenuOptionsShare:this.toggleShowMenuOptionsShare,toggleShowMenuOptionsView:this.toggleShowMenuOptionsView,viewMode:this.state.viewMode})}),this.state.settingsMode&&Object(n.jsx)(Re,{children:Object(n.jsx)(ze,{cancelText:"Cancel",confirmText:"Save",customStyles:this.state.customStyles,debugMode:ot,defaultSettings:this.state.defaultSettings,editingMode:this.state.editingMode,fontEdit:this.state.fontEdit,fontSize:this.state.fontSize,fontView:this.state.fontView,helpLink:"https://appendeditor.com/#settings",keyMap:nt,onConfirm:this.onSaveSettings,onCancel:this.onSettingsMode,title:"Append Editor Settings",monacoEditorLanguage:this.state.monacoEditorLanguage})}),this.state.editMode&&!this.state.refreshEdit&&Object(n.jsx)(Re,{children:Object(n.jsx)(z,{debugMode:ot,editingMode:this.state.editingMode,fontSize:this.state.fontSize,keyMap:nt,monacoEditorLanguage:this.state.monacoEditorLanguage,onKeyDown:this.onKeyDown,onKeyDownEditTextArea:this.onKeyDownEditTextArea,onKeyDownTextArea:this.onKeyDownTextArea,onKeyUp:this.onKeyUp,saveText:this.saveText,text:this.state.text,viewMode:this.state.viewMode})}),this.state.editMode&&this.state.refreshEdit&&Object(n.jsx)(Re,{children:Object(n.jsx)(z,{debugMode:ot,editingMode:this.state.editingMode,fontSize:this.state.fontSize,keyMap:nt,monacoEditorLanguage:this.state.monacoEditorLanguage,onKeyDown:this.onKeyDown,onKeyDownEditTextArea:this.onKeyDownEditTextArea,onKeyDownTextArea:this.onKeyDownTextArea,onKeyUp:this.onKeyUp,saveText:this.saveText,text:this.state.text,viewMode:this.state.viewMode})}),this.state.viewMode&&!this.state.refreshView&&Object(n.jsx)(Re,{children:Object(n.jsx)(Oe,{appendMode:this.state.appendMode,bypassDebounce:this.state.bypassDebounce,debugMode:ot,editMode:this.state.editMode,editingMode:this.state.editingMode,monacoEditorLanguage:this.state.monacoEditorLanguage,printURL:this.state.printURL,showHelp:this.state.showHelp,saveText:this.saveText,text:this.state.text})}),this.state.viewMode&&this.state.refreshView&&Object(n.jsx)(Re,{children:Object(n.jsx)(Oe,{appendMode:this.state.appendMode,bypassDebounce:this.state.bypassDebounce,debugMode:ot,editMode:this.state.editMode,editingMode:this.state.editingMode,monacoEditorLanguage:this.state.monacoEditorLanguage,printURL:this.state.printURL,showHelp:this.state.showHelp,saveText:this.saveText,text:this.state.text})}),this.state.confirmPrintUrl&&Object(n.jsxs)(Re,{children:[Object(n.jsx)(L,{title:"Would you like to print URLs?",onUndo:this.onCancelPrint,onConfirm:this.onPrintUrlTrue,onCancel:this.onPrintUrlFalse,helpLink:"https://appendeditor.com/#printing",confirmText:"Yes, print URLs",cancelText:"No, thanks"})," "]}),this.state.showDiff&&[Object(n.jsx)(Re,{children:Object(n.jsx)(V,{text:this.state.text,modifiedText:this.state.appendText,saveText:this.saveText})})]]}),this.state.showAppendix&&[Object(n.jsxs)("div",{id:Ge.appendix,className:"appendix"+(this.state.borderlessMode?" borderless":"")+(this.state.fullWidthMode?" full-width":""),children:[this.state.appendMode&&Object(n.jsx)(Re,{children:Object(n.jsx)(Me,{appendTextToNote:this.appendTextToNote,autoSaveAppendText:this.autoSaveAppendText,autoSaveCheckBoxes:this.autoSaveCheckBoxes,debugMode:ot,editingMode:this.state.editingMode,fontSize:this.state.fontSize,keyMap:nt,appendNewLine:this.state.appendNewLine,appendNewParagraph:this.state.appendNewParagraph,monacoEditorLanguage:this.state.monacoEditorLanguage,onKeyDown:this.onKeyDown,onKeyDownAppendTextArea:this.onKeyDownAppendTextArea,onKeyDownTextArea:this.onKeyDownTextArea,onKeyUp:this.onKeyUp,appendRows:this.state.appendRows,text:this.state.appendText})}),Object(n.jsx)("button",{className:"sk-button info",id:"scrollToTopButton",onClick:this.scrollToTop,title:"Scroll to Top",type:"button",children:Object(n.jsx)("div",{children:" \u25b2 "})}),Object(n.jsx)("button",{className:"sk-button info",id:"scrollToBottomButton",onClick:this.scrollToBottom,title:"Scroll to Bottom",type:"button",children:Object(n.jsx)("div",{children:" \u25bc "})})]})]]})]}}]),o}(s.a.Component);o(1172);r.a.render(Object(n.jsx)(s.a.StrictMode,{children:Object(n.jsx)(it,{})}),document.getElementById("root")),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((function(e){e.unregister()})).catch((function(e){console.error(e.message)})),c()},454:function(e,t,o){}},[[1173,3,4]]]); +//# sourceMappingURL=main.cf56b8e1.chunk.js.map \ No newline at end of file diff --git a/build/static/js/main.c30d7197.chunk.js.map b/build/static/js/main.cf56b8e1.chunk.js.map similarity index 89% rename from build/static/js/main.c30d7197.chunk.js.map rename to build/static/js/main.cf56b8e1.chunk.js.map index 3572ace0..153b284f 100644 --- a/build/static/js/main.c30d7197.chunk.js.map +++ b/build/static/js/main.cf56b8e1.chunk.js.map @@ -1 +1 @@ -{"version":3,"sources":["serviceWorker.ts","reportWebVitals.ts","components/Icons.tsx","components/PrintDialog.tsx","components/Monaco.tsx","components/DynamicEditor.tsx","components/EditNote.tsx","lib/clickButton.ts","components/Help.tsx","components/Intro.tsx","lib/renderMarkdown.ts","components/ViewNote.tsx","components/AppendText.tsx","components/Buttons.tsx","components/Menu.tsx","components/Settings.tsx","components/ErrorBoundary.tsx","components/AppendEditor.tsx","index.tsx"],"names":["Boolean","window","location","hostname","match","reportWebVitals","onPerfEntry","Function","then","getCLS","getFID","getFCP","getLCP","getTTFB","infoColor","foregroundColor","ChevronIconDown","fill","role","className","aria-label","width","height","viewBox","xmlns","d","ChevronIconRight","CloseIcon","CopyIcon","EyeIcon","condition","GearIcon","HelpIcon","MenuIcon","PencilIcon","PlusIcon","fill-rule","clip-rule","PrintIcon","RefreshIcon","UndoIcon","PrintDialog","cancelText","confirmText","helpLink","onCancel","onConfirm","onUndo","title","id","onClick","href","target","rel","MonacoEditorContainerID","MonacoDiffEditorContainerID","self","MonacoEnvironment","getWorkerUrl","_moduleId","label","MonacoEditor","editor","fontSize","language","saveText","tabSize","text","theme","viewMode","divEl","useRef","scrollBeyondLastLine","useEffect","current","monaco","create","parseInt","replace","value","join","autoClosingOvertype","formatOnPaste","formatOnType","wordWrap","wrappingStrategy","onKeyDown","e","keyCode","console","log","code","ctrlKey","preventDefault","onKeyUp","onDidChangeModelContent","getValue","dispose","ref","MonacoDiffEditor","diffEditor","modifiedText","originalModel","createModel","modifiedModel","createDiffEditor","originalEditable","readOnly","setModel","original","modified","onDidChangeContent","YouTubeEmbed","videoId","this","props","attrs","matches","isSelected","src","React","DynamicEditor","handleToggleReadOnly","setState","state","handleChange","debounce","debugMode","onChange","template","undefined","placeholder","readOnlyWriteCheckboxes","defaultValue","scrollTo","hash","autoFocus","embeds","keywords","icon","alt","matcher","url","component","EditNote","handleInputChange","event","onKeyDownEditTextArea","onKeyDownTextArea","keyMap","delete","key","editingMode","EditingModes","useMonacoEditor","useDynamicEditor","HtmlElementId","edit","monacoEditorLanguage","editTextArea","name","rows","spellCheck","Component","defaultProps","clickAppendButton","appendButton","document","getElementById","click","clickEditButton","editButton","clickHelpButton","helpButton","clickMenuButton","menuButton","clickSettingsButton","settingsButton","clickViewButton","viewButton","Help","onToggleShowFeelings","showFeelings","onToggleShowMoreQuestions","showMoreQuestions","onToggleShowFeedback","showFeedback","onToggle","Intro","appendMode","editMode","showHelp","gfm","require","breaks","math","rehypeKatex","highlight","emoji","externalLinks","toc","footnotes","slug","raw","processor","unified","use","parse","maxDepth","inlineNotes","remark2rehype","allowDangerousHtml","ignoreMissing","rehype2react","createElement","processMarkdown","processSync","result","isLongString","throttle","length","renderLongMarkdown","ViewNote","onToggleShowHelp","renderMarkdown","bypassDebounce","printURL","view","AppendText","type","checked","autoSaveCheckBoxes","handleTextAreaChange","autoSaveAppendText","appendTextToNote","appendTextArea","focus","newLine","newParagraph","set","get","onKeyDownAppendTextArea","appendNewLine","appendNewParagraph","appendRows","HtmlClassName","ChevronToggleButton","caption","CopyButton","EyeButton","messageOn","messageOff","PencilButton","PrintButton","UndoButton","editingModeID","fontEditID","fontSizeID","fontViewID","monacoEditorLanguageID","resetAllSettingsID","saveAsDefaultID","startRegExp","RegExp","cssRegExp","endRegExp","codeRegExp","Settings","handleSelectChange","toggleShowCustomStyles","showCustomStyles","cleanCustomStyles","customStyles","handleSubmit","fontEditMessage","fontViewMessage","fontEdit","fontView","saveAsDefault","loadDefaultSettings","defaultSettings","refreshCustomStyles","clearCustomStyles","clearFontEdit","clearFontSize","clearFontView","clearEditingMode","usePlainText","clearMonacoEditorLanguage","clearSaveAsDefault","clearAllSettings","resetAllSettings","onBlur","clear","componentWillUnmount","useCodeMirror","htmlFor","list","ErrorBoundary","hasError","error","errorInfo","message","children","Menu","clearTooltipTimer","resetMessageTimer","clearTimeout","setTimeout","displayMessageEdit","displayMessageShare","showMessageEdit","showMessageShare","copyToClipboard","textField","body","appendChild","select","execCommand","remove","copyText","copyHtml","renderedNote","firstElementChild","innerHTML","formatText","formattedText","prettier","format","parser","plugins","parserMarkdown","refreshEdit","refreshView","uncheckBoxes","checkedBoxes","test","newText","toggleShowMenu","chevronToggleButton","showMenuOptionsView","toggleShowMenuOptionsView","borderlessMode","on","off","toggleBorderlessMode","fixedHeightMode","toggleFixedHeightMode","fullWidthMode","toggleFullWidthMode","overflowMode","toggleOverflowMode","showMenuOptionsShare","toggleShowMenuOptionsShare","printButton","onConfirmPrintUrl","showMenuOptionsEdit","toggleShowMenuOptionsEdit","initialState","appendText","confirmPrintUrl","showAppendix","showHeader","showDiff","settingsMode","last_known_scroll_position","Map","AppendEditor","editorKit","refreshEditorTimer","saveTimer","componentDidMount","onViewMode","loadDefaultMenuState","addEventListener","onScroll","removeEventListener","configureEditorKit","delegate","EditorKitDelegate","setEditorRawText","cancel","flush","savingEditorOptions","loadEditorOptions","loadMetaData","clearUndoHistory","getElementsBySelector","EditorKit","mode","supportsFilesafe","refreshEditor","activateStyles","defaultSettingsString","internal","componentManager","componentDataValueForKey","defaultEditingMode","defaultSettingsObject","JSON","defaultCustomStyles","defaultFontEdit","defaultFontSize","defaultFontView","defaultMonacoEditorLanguage","menuOptionsString","menuOptionsObject","streamContextItem","note","content","appendEditorCustomStyles","appendEditorEditingMode","appendEditorFontEdit","appendEditorFontSize","appendEditorFontView","appendEditorMonacoEditorLanguage","onEditMode","saveNote","scrollY","scrollTop","refreshedView","onEditorValueChanged","textToAppend","concat","saveItemWithPresave","skipToBottom","appendCodeMirror","setValue","configureCodeMirror","editCodeMirror","CodeMirror","fromTextArea","autocorrect","autocapitalize","extraKeys","Enter","lineNumbers","lineWrapping","spellcheck","styleSelectedText","tabindex","setSize","editCodeMirrorText","save","cm","appendCodeMirrorText","makeContentEditable","setAttribute","appendix","appendCustom","removeContentEditable","container","toTextArea","onAppendMode","scrollDown","closeEdit","scrollToBottom","toggleShowHelp","scrollToTop","showMenu","activateFixedHeader","saveMenuOptions","currentMenuOptions","saveEditorOption","stringify","optionKey","optionValue","setComponentDataValueForKey","onSettingsMode","currentState","removeFixedHeader","undoDialog","onSaveSettings","sheetToBeRemoved","sheetParent","parentNode","removeChild","fontSizeStyle","fontEditStyle","fontViewStyle","sheet","onCancelPrint","onPrintUrlTrue","printRenderedHtml","onPrintUrlFalse","print","goDown","codeMirrorEditMode","getElementsByClassName","scrollIntoView","behavior","block","inline","goUp","top","skipToTop","header","classList","add","fixed","fixedHeader","tabIndex","ReactDOM","render","StrictMode","navigator","serviceWorker","ready","registration","unregister","catch"],"mappings":"0MAYoBA,QACW,cAA7BC,OAAOC,SAASC,UAEe,UAA7BF,OAAOC,SAASC,UAEhBF,OAAOC,SAASC,SAASC,MACvB,2DChBN,IAYeC,EAZS,SAACC,GACnBA,GAAeA,aAAuBC,UACxC,gCAAqBC,MAAK,YAAkD,IAA/CC,EAA8C,EAA9CA,OAAQC,EAAsC,EAAtCA,OAAQC,EAA8B,EAA9BA,OAAQC,EAAsB,EAAtBA,OAAQC,EAAc,EAAdA,QAC3DJ,EAAOH,GACPI,EAAOJ,GACPK,EAAOL,GACPM,EAAON,GACPO,EAAQP,O,8CCPRQ,EAAY,gCACZC,EAAkB,sCAQXC,EAAmC,SAAC,GAAD,IAAGC,EAAH,EAAGA,KAAMC,EAAT,EAASA,KAAT,OAC9C,sBAAMC,UAAU,oBAAhB,SACE,qBACEC,aAAW,oBACXF,KAAMA,EACNG,MAAM,KACNC,OAAO,KACPC,QAAQ,YACRN,KAAK,OACLO,MAAM,6BAPR,SASE,sBACEC,EAAE,oHACFR,KAAMA,GAAcF,SAMfW,EAAoC,SAAC,GAAD,IAAGT,EAAH,EAAGA,KAAMC,EAAT,EAASA,KAAT,OAC/C,sBAAMC,UAAU,qBAAhB,SACE,qBACEC,aAAW,oBACXF,KAAMA,EACNG,MAAM,KACNC,OAAO,KACPC,QAAQ,YACRN,KAAK,OACLO,MAAM,6BAPR,SASE,sBACEC,EAAE,kHACFR,KAAMA,GAAcF,SAMfY,EAA6B,SAAC,GA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pB2E,KAAK,QACLlN,UAAU,QACVmN,QACEpH,KAAKU,MAAM4B,cAAgBC,GAAaC,gBAE1C1B,SAAUd,KAAK+B,oBAVnB,0KAiBD/B,KAAKU,MAAM4B,cAAgBC,GAAaC,iBAAmB,CAC1D,0BAASvI,UAAU,wBAAnB,UACE,wBAAOqR,QAASrC,GAAhB,oCAC0B,OAE1B,sBAAKhP,UAAU,wBAAf,UACE,gCACE,yBACE8B,GAAIkN,GACJnG,KAAMmG,GACNpL,MAAOmC,KAAKU,MAAMkC,qBAClB9B,SAAUd,KAAK0J,mBAJjB,UAME,0CACA,yCACA,0CACA,2CACA,yCACA,uCACA,8CACA,6CACA,kDACA,yCACA,4CACA,yCACA,yCACA,0CACA,gDACA,4CACA,wCACA,6CACA,gDACA,yCACA,0CACA,yCACA,0CACA,gDACA,0CACA,2CACA,4CACA,0CACA,2CACA,yCACA,8CACA,0CACA,2CACA,2CACA,iDACA,4CACA,+CACA,0CACA,2CACA,yCACA,+CACA,8CACA,gDACA,gDACA,yCACA,4CACA,uCACA,2CACA,2CACA,8CACA,sDACA,0CACA,0CACA,wCACA,2CACA,4CACA,0CACA,2CACA,yCACA,yCACA,wCACA,2CACA,mDACA,yCACA,0CACA,gDACA,wCACA,6CACA,yCACA,+CAGJ,cAAC,GAAD,CACE1N,QAASgE,KAAK8K,0BACdhP,MAAM,oDAKd,0BAAS7B,UAAU,wBAAnB,UACE,uBAAOqR,QAASvC,GAAhB,uCACA,sBAAK9O,UAAU,wBAAf,UACE,yBACE8B,GAAIgN,GACJjG,KAAMiG,GACNlL,MAAOmC,KAAKU,MAAM7D,SAClBiE,SAAUd,KAAK0J,mBAJjB,UAME,2BACA,0CACA,0CACA,0CACA,0CACA,0CACA,0CACA,0CACA,0CACA,0CACA,0CACA,0CACA,0CACA,0CACA,0CACA,0CACA,0CACA,0CACA,0CACA,6CAEF,cAAC,GAAD,CACE1N,QAASgE,KAAK0K,cACd5O,MAAM,kCAIXkE,KAAKU,MAAM4B,cA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YACxBzF,SAAUmD,KAAKU,MAAM7D,SACrBsF,OAAQA,GACR6F,cAAehI,KAAKU,MAAMsH,cAC1BC,mBAAoBjI,KAAKU,MAAMuH,mBAC/BrF,qBAAsB5C,KAAKU,MAAMkC,qBACjCxE,UAAW4B,KAAK5B,UAChB2J,wBAAyB/H,KAAK+H,wBAC9B7F,kBAAmBlC,KAAKkC,kBACxBtD,QAASoB,KAAKpB,QACdsJ,WAAYlI,KAAKU,MAAMwH,WACvBjL,KAAM+C,KAAKU,MAAM2O,eAIvB,wBACEpV,UAAU,iBACV8B,GAAG,oBACHC,QAASgE,KAAKwV,YACd1Z,MAAM,gBACNqL,KAAK,SALP,SAOE,6CAEF,wBACElN,UAAU,iBACV8B,GAAG,uBACHC,QAASgE,KAAKsV,eACdxZ,MAAM,mBACNqL,KAAK,SALP,SAOE,yD,GAn9D4B7G,IAAM2C,W,QC7KhDmV,IAASC,OACP,cAAC,IAAMC,WAAP,UACE,cAAC,GAAD,MAEFjV,SAASC,eAAe,SlB4HpB,kBAAmBiV,WACrBA,UAAUC,cAAcC,MACrBnf,MAAK,SAACof,GACLA,EAAaC,gBAEdC,OAAM,SAAClN,GACNnN,QAAQmN,MAAMA,EAAME,YkBvH5BzS,K","file":"static/js/main.c30d7197.chunk.js","sourcesContent":["// This optional code is used to register a service worker.\n// register() is not called by default.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on subsequent visits to a page, after all the\n// existing tabs open on the page have been closed, since previously cached\n// resources are updated in the background.\n\n// To learn more about the benefits of this model and instructions on how to\n// opt-in, read https://bit.ly/CRA-PWA\n\nconst isLocalhost = Boolean(\n window.location.hostname === 'localhost' ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === '[::1]' ||\n // 127.0.0.0/8 are considered localhost for IPv4.\n window.location.hostname.match(\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\n )\n);\n\ntype Config = {\n onSuccess?: (registration: ServiceWorkerRegistration) => void;\n onUpdate?: (registration: ServiceWorkerRegistration) => void;\n};\n\nexport function register(config?: Config) {\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n // The URL constructor is available in all browsers that support SW.\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\n if (publicUrl.origin !== window.location.origin) {\n // Our service worker won't work if PUBLIC_URL is on a different origin\n // from what our page is served on. This might happen if a CDN is used to\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\n return;\n }\n\n window.addEventListener('load', () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\n\n if (isLocalhost) {\n // This is running on localhost. Let's check if a service worker still exists or not.\n checkValidServiceWorker(swUrl, config);\n\n // Add some additional logging to localhost, pointing developers to the\n // service worker/PWA documentation.\n navigator.serviceWorker.ready.then(() => {\n console.log(\n 'This web app is being served cache-first by a service ' +\n 'worker. To learn more, visit https://bit.ly/CRA-PWA'\n );\n });\n } else {\n // Is not localhost. Just register service worker\n registerValidSW(swUrl, config);\n }\n });\n }\n}\n\nfunction registerValidSW(swUrl: string, config?: Config) {\n navigator.serviceWorker\n .register(swUrl)\n .then((registration) => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n if (installingWorker == null) {\n return;\n }\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the updated precached content has been fetched,\n // but the previous service worker will still serve the older\n // content until all client tabs are closed.\n console.log(\n 'New content is available and will be used when all ' +\n 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'\n );\n\n // Execute callback\n if (config && config.onUpdate) {\n config.onUpdate(registration);\n }\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n console.log('Content is cached for offline use.');\n\n // Execute callback\n if (config && config.onSuccess) {\n config.onSuccess(registration);\n }\n }\n }\n };\n };\n })\n .catch((error) => {\n console.error('Error during service worker registration:', error);\n });\n}\n\nfunction checkValidServiceWorker(swUrl: string, config?: Config) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl, {\n headers: { 'Service-Worker': 'script' },\n })\n .then((response) => {\n // Ensure service worker exists, and that we really are getting a JS file.\n const contentType = response.headers.get('content-type');\n if (\n response.status === 404 ||\n (contentType != null && contentType.indexOf('javascript') === -1)\n ) {\n // No service worker found. Probably a different app. Reload the page.\n navigator.serviceWorker.ready.then((registration) => {\n registration.unregister().then(() => {\n window.location.reload();\n });\n });\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl, config);\n }\n })\n .catch(() => {\n console.log(\n 'No internet connection found. App is running in offline mode.'\n );\n });\n}\n\nexport function unregister() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready\n .then((registration) => {\n registration.unregister();\n })\n .catch((error) => {\n console.error(error.message);\n });\n }\n}\n","import { ReportHandler } from 'web-vitals';\n\nconst reportWebVitals = (onPerfEntry?: ReportHandler) => {\n if (onPerfEntry && onPerfEntry instanceof Function) {\n import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {\n getCLS(onPerfEntry);\n getFID(onPerfEntry);\n getFCP(onPerfEntry);\n getLCP(onPerfEntry);\n getTTFB(onPerfEntry);\n });\n }\n};\n\nexport default reportWebVitals;\n","import React from 'react';\n\nconst infoColor = 'var(--sn-stylekit-info-color)';\nconst foregroundColor = 'var(--sn-stylekit-foreground-color)';\n\ninterface Icons {\n condition?: boolean;\n fill?: string;\n role: string;\n}\n\nexport const ChevronIconDown: React.FC = ({ fill, role }) => (\n \n \n \n \n \n);\n\nexport const ChevronIconRight: React.FC = ({ fill, role }) => (\n \n \n \n \n \n);\n\nexport const CloseIcon: React.FC = ({ fill, role }) => (\n \n \n \n);\n\nexport const CopyIcon: React.FC = ({ fill, role }) => (\n \n \n \n);\n\nexport const EyeIcon: React.FC = ({ condition, fill, role }) => (\n \n \n \n);\n\nexport const GearIcon: React.FC = ({ condition, fill, role }) => (\n \n \n \n);\n\nexport const HelpIcon: React.FC = ({ condition, fill, role }) => (\n \n \n \n);\n\nexport const MenuIcon: React.FC = ({ condition, fill, role }) => (\n \n \n \n);\n\nexport const PencilIcon: React.FC = ({ condition, fill, role }) => (\n \n \n \n);\n\nexport const PlusIcon: React.FC = ({ condition, fill, role }) => (\n \n \n \n);\n\nexport const PrintIcon: React.FC = ({ fill, role }) => (\n \n \n \n);\n\nexport const RefreshIcon: React.FC = ({ fill, role }) => (\n \n \n \n);\n\nexport const UndoIcon: React.FC = ({ fill, role }) => (\n \n \n \n);\n","// import { Method } from '@testing-library/react';\nimport React from 'react';\nimport { CloseIcon } from './Icons';\n\ninterface PrintDialogTypes {\n cancelText: string;\n confirmText: string;\n helpLink: string;\n onCancel: () => void;\n onConfirm: () => void;\n onUndo: () => void;\n title: string;\n}\n\nconst PrintDialog: React.FC = ({\n cancelText,\n confirmText,\n helpLink,\n onCancel,\n onConfirm,\n onUndo,\n title,\n}) => (\n
\n
\n
\n
\n
\n

{title}

\n \n
\n

\n Need help deciding? Check out the{' '}\n \n documentation\n \n .\n

\n
\n
\n
\n
\n \n \n
\n
\n
\n
\n);\n\nexport default PrintDialog;\n","/**\n * This component is derived from the \"browser-esm-webpack-typescript-react\" found\n * at https://github.com/microsoft/monaco-editor-samples,\n * which is released under MIT, Copyright (c) 2016 Microsoft Corporation.\n * This modified version is released under AGPL-3.0 as indicated in the README.md\n * in the root directory. A copy of AGPL-3.0 is available there.\n * */\nimport React, { useRef, useEffect } from 'react';\nimport * as monaco from 'monaco-editor';\n\nconst debugMode = false;\nconst MonacoEditorContainerID = 'MonacoEditorContainer';\nconst MonacoDiffEditorContainerID = 'MonacoDiffEditorContainer';\n\n/*eslint no-restricted-globals: [\"error\", \"event\", \"monaco\"]*/\n// @ts-ignore\nself.MonacoEnvironment = {\n getWorkerUrl: function (_moduleId: any, label: string) {\n if (label === 'json') {\n return './json.worker.bundle.js';\n }\n if (label === 'css') {\n return './css.worker.bundle.js';\n }\n if (label === 'html') {\n return './html.worker.bundle.js';\n }\n if (label === 'typescript' || label === 'javascript') {\n return './ts.worker.bundle.js';\n }\n return './editor.worker.bundle.js';\n },\n};\n\nconst onKeyDown = (keyCode: string, debugMode = false) => {\n if (debugMode) {\n console.log('IKeyboardEvent Up: ' + keyCode);\n }\n};\n\nconst onKeyUp = (keyCode: string, debugMode = false) => {\n if (debugMode) {\n console.log('IKeyboardEvent Up: ' + keyCode);\n }\n};\n\ninterface MonacoEditorTypes {\n fontSize?: string;\n id?: string;\n language?: string;\n onKeyDown?: Function;\n onKeyUp?: Function;\n saveText?: Function;\n tabSize?: number;\n text: string;\n theme?: string;\n viewMode?: boolean;\n}\n\nexport const MonacoEditor: React.FC = ({\n fontSize = '16',\n id = MonacoEditorContainerID,\n language = 'markdown',\n saveText,\n tabSize = 2,\n text,\n theme = 'vs-dark',\n viewMode = false,\n}) => {\n const divEl = useRef(null);\n let editor: monaco.editor.IStandaloneCodeEditor;\n\n if (fontSize === '') {\n fontSize = '16px';\n }\n\n let scrollBeyondLastLine = true;\n if (viewMode) {\n scrollBeyondLastLine = false;\n }\n\n useEffect(() => {\n if (divEl.current) {\n editor = monaco.editor.create(divEl.current, {\n // These are variable: customizable by user or dependent on props\n fontSize: parseInt(fontSize.replace('px', '')),\n language: language,\n tabSize: tabSize,\n theme: theme,\n scrollBeyondLastLine: scrollBeyondLastLine,\n value: [text].join('\\n'),\n\n // These are not customizable\n autoClosingOvertype: 'auto',\n formatOnPaste: true,\n formatOnType: true,\n wordWrap: 'on',\n wrappingStrategy: 'advanced',\n });\n\n // Keyboard Events\n editor.onKeyDown((e: monaco.IKeyboardEvent) => {\n onKeyDown(e.code, debugMode);\n if (e.ctrlKey && e.code === 'KeyS') {\n e.preventDefault();\n }\n });\n editor.onKeyUp((e: monaco.IKeyboardEvent) => {\n onKeyUp(e.code, debugMode);\n });\n\n // Content Change Events\n editor.onDidChangeModelContent(\n (e: monaco.editor.IModelContentChangedEvent) => {\n if (saveText) {\n saveText(editor.getValue());\n }\n }\n );\n }\n return () => {\n editor.dispose();\n };\n }, []);\n return
;\n};\n\ninterface MonacoDiffEditorTypes extends MonacoEditorTypes {\n modifiedText: string;\n}\n\nexport const MonacoDiffEditor: React.FC = ({\n fontSize = '16',\n id = MonacoDiffEditorContainerID,\n language = 'markdown',\n saveText,\n text,\n modifiedText,\n theme = 'vs-dark',\n}) => {\n const divEl = useRef(null);\n let diffEditor: monaco.editor.IStandaloneDiffEditor;\n\n if (fontSize === '') {\n fontSize = '16px';\n }\n\n useEffect(() => {\n if (divEl.current) {\n const originalModel = monaco.editor.createModel(\n [text].join('\\n'),\n language\n );\n const modifiedModel = monaco.editor.createModel(\n [modifiedText].join('\\n'),\n language\n );\n\n diffEditor = monaco.editor.createDiffEditor(divEl.current, {\n // Same settings as above\n // These are variable: customizable by user or dependent on props\n fontSize: parseInt(fontSize.replace('px', '')),\n theme: theme,\n\n // These are not customizable\n autoClosingOvertype: 'auto',\n formatOnPaste: true,\n formatOnType: true,\n wordWrap: 'on',\n wrappingStrategy: 'advanced',\n\n // Specific to Diff Editor\n originalEditable: true, // for left panel\n readOnly: true, // for right panel\n });\n diffEditor.setModel({\n original: originalModel,\n modified: modifiedModel,\n });\n\n // Content Change Events\n originalModel.onDidChangeContent(\n (e: monaco.editor.IModelContentChangedEvent) => {\n if (saveText) {\n saveText(originalModel.getValue());\n }\n }\n );\n }\n return () => {\n diffEditor.dispose();\n };\n }, []);\n return (\n
\n );\n};\n","/**\n * This component is derived from the example found at\n * https://github.com/outline/rich-markdown-editor/blob/develop/example/src/index.js,\n * which is released under BSD-3 License, Copyright (c) 2020 General Outline,\n * Inc (https://www.getoutline.com/) and individual contributors.\n * This modified version is released under AGPL-3.0 as indicated in the README.md\n * in the root directory. A copy of AGPL-3.0 is available there.\n * */\n\nimport * as React from 'react';\nimport debounce from 'lodash/debounce';\nimport RichMarkdownEditor from 'rich-markdown-editor';\n\nclass YouTubeEmbed extends React.Component {\n render() {\n const { attrs } = this.props;\n const videoId = attrs.matches[1];\n\n return (\n \n );\n }\n}\n\ninterface DynamicProps {\n debugMode: boolean;\n onChange: (text: string) => void;\n readOnly: boolean;\n text: string;\n}\n\ninterface DynamicState {\n readOnly: boolean;\n template: boolean;\n value: undefined;\n}\n\nexport default class DynamicEditor extends React.Component<\n DynamicProps,\n DynamicState\n> {\n constructor(props: DynamicProps) {\n super(props);\n this.state = {\n readOnly: this.props.readOnly,\n template: false,\n value: undefined,\n };\n }\n\n handleToggleReadOnly = () => {\n this.setState({ readOnly: !this.state.readOnly });\n };\n\n handleChange = debounce((value) => {\n const text = value();\n if (this.props.debugMode) {\n console.log(text);\n }\n this.props.onChange(text);\n }, 50);\n\n render() {\n return (\n {\n if (this.props.debugMode) {\n console.log('Cancel triggered');\n }\n }}\n autoFocus\n onChange={(value) => this.handleChange(value)}\n embeds={[\n {\n title: 'YouTube',\n keywords: 'youtube video tube google',\n icon: () => (\n \n ),\n //@ts-ignore\n matcher: (url) => {\n return url.match(\n /(?:https?:\\/\\/)?(?:www\\.)?youtu\\.?be(?:\\.com)?\\/?.*(?:watch|embed)?(?:.*v=|v\\/|\\/)([a-zA-Z0-9_-]{11})$/i\n );\n },\n component: YouTubeEmbed,\n },\n ]}\n />\n );\n }\n}\n","import React from 'react';\nimport { EditingModes } from './AppendEditor';\nimport { MonacoEditor } from './Monaco';\nimport DynamicEditor from './DynamicEditor';\n\nimport { HtmlElementId } from './AppendEditor';\n\ninterface EditProps {\n debugMode: boolean;\n editingMode?: string;\n fontSize: string;\n keyMap: any;\n monacoEditorLanguage: string;\n onKeyDown: Function;\n onKeyUp: Function;\n onKeyDownEditTextArea: Function;\n onKeyDownTextArea: Function;\n saveText: Function;\n text: string;\n viewMode: boolean | undefined;\n}\n\ninterface EditState {\n text: string;\n}\n\nexport default class EditNote extends React.Component {\n static defaultProps = {\n // none\n };\n\n constructor(props: EditProps) {\n super(props);\n\n this.state = {\n text: this.props.text,\n };\n }\n\n handleInputChange = (event: React.ChangeEvent) => {\n const target = event.target;\n const value = target.value;\n\n this.setState(\n {\n text: value,\n },\n () => {\n this.props.saveText(this.state.text);\n }\n );\n };\n\n saveText = (text: string) => {\n this.setState(\n {\n text,\n },\n () => {\n this.props.saveText(this.state.text);\n }\n );\n };\n\n onKeyDown = (e: React.KeyboardEvent) => {\n this.props.onKeyDown(e);\n this.props.onKeyDownEditTextArea(e);\n this.props.onKeyDownTextArea(e);\n };\n\n onKeyUp = (event: React.KeyboardEvent) => {\n this.props.keyMap.delete(event.key);\n this.props.onKeyUp(event);\n };\n\n render() {\n const { text } = this.state;\n return (\n \n \n {this.props.editingMode === EditingModes.useMonacoEditor ? (\n \n ) : this.props.editingMode === EditingModes.useDynamicEditor ? (\n
\n \n
\n ) : (\n \n )}\n \n \n );\n }\n}\n","import { HtmlElementId } from '../components/AppendEditor';\n\nexport const clickAppendButton = () => {\n const appendButton = document.getElementById(HtmlElementId.appendButton);\n if (appendButton) {\n appendButton.click();\n }\n};\n\nexport const clickEditButton = () => {\n const editButton = document.getElementById(HtmlElementId.editButton);\n if (editButton) {\n editButton.click();\n }\n};\n\nexport const clickHelpButton = () => {\n const helpButton = document.getElementById(HtmlElementId.helpButton);\n if (helpButton) {\n helpButton.click();\n }\n};\n\nexport const clickMenuButton = () => {\n const menuButton = document.getElementById(HtmlElementId.menuButton);\n if (menuButton) {\n menuButton.click();\n }\n};\n\nexport const clickSettingsButton = () => {\n const settingsButton = document.getElementById(HtmlElementId.settingsButton);\n if (settingsButton) {\n settingsButton.click();\n }\n};\n\nexport const clickViewButton = () => {\n const viewButton = document.getElementById(HtmlElementId.viewButton);\n if (viewButton) {\n viewButton.click();\n }\n};\n","import React from 'react';\nimport { GearIcon, HelpIcon, MenuIcon } from './Icons';\nimport {\n clickHelpButton,\n clickMenuButton,\n clickSettingsButton,\n} from '../lib/clickButton';\n\ninterface HelpProps {\n debugMode: boolean;\n printURL: boolean;\n}\n\ninterface HelpState {\n showFeelings: boolean;\n showMoreQuestions: boolean;\n showFeedback: boolean;\n}\n\nexport default class Help extends React.Component {\n constructor(props: HelpProps) {\n super(props);\n\n this.state = {\n showFeelings: false,\n showMoreQuestions: false,\n showFeedback: false,\n };\n }\n\n onToggleShowFeelings = () => {\n this.setState({\n showFeelings: !this.state.showFeelings,\n });\n };\n\n onToggleShowMoreQuestions = () => {\n this.setState({\n showMoreQuestions: !this.state.showMoreQuestions,\n });\n };\n\n onToggleShowFeedback = () => {\n this.setState({\n showFeedback: !this.state.showFeedback,\n });\n };\n\n render() {\n return (\n
\n
\n

Append Editor Help

\n

\n The Append Editor is an unofficial{' '}\n \n editor\n {' '}\n for{' '}\n \n Standard Notes\n \n , a free,{' '}\n \n open-source\n \n , and{' '}\n \n end-to-end encrypted\n {' '}\n notes app. The Append Editor is also free software licensed under{' '}\n \n AGPL-3.0\n \n . Its source code is available on{' '}\n \n GitHub\n \n .\n

\n

Append Editor Features

\n

\n The Append Editor supports{' '}\n \n Markdown\n {' '}\n with{' '}\n \n KaTeX\n \n , syntax highlighting, in-line HTML, table of contents, footnotes,\n auto-linking,{' '}\n \n emoji codes\n \n , and more.{' '}\n

\n

\n There are four editing modes: Plain Textarea, CodeMirror, Dynamic, and\n Monaco. You can read about each mode and choose which to use in the\n Settings\n \n  \n \n  \n \n . You can also choose default and per-note font sizes, font families,\n and custom styles (CSS).\n

\n

\n The Menu\n \n  \n \n  \n \n has additional options to customize the appearance of the editor,\n share your note, and perform actions to quickly format and edit\n Markdown text.\n

\n

\n A more detailed documentation of the Append Editor is available at{' '}\n \n appendeditor.com\n \n . If you like the Append Editor, please support it by giving it a star\n on{' '}\n \n GitHub\n \n .{' '}\n \n 🙂\n {' '}\n

\n

How to install the Append Editor in Standard Notes

\n
    \n
  1. \n Download, install, and sign in to the Standard Notes{' '}\n \n Desktop\n {' '}\n app.\n
  2. \n
  3. \n In the bottom left corner of the app, click Extensions.\n
  4. \n
  5. \n Click Import Extensions and paste the following link into the\n input box. If you want to use the alpha version, replace{' '}\n beta with alpha:{' '}\n \n \n https://raw.githubusercontent.com/TheodoreChu/append-editor/main/public/beta.ext.json\n \n \n
  6. \n
  7. \n Press Enter or Return on your keyboard.\n
  8. \n
  9. \n The title of your selected note is near the top of the app. Under\n the title, click Editor, click Append Editor, and\n click Continue to begin using the editor. Enjoy!{' '}\n \n 👏\n {' '}\n
  10. \n
\n

\n After you install the editor on the desktop app, it will automatically\n sync to the{' '}\n \n web\n {' '}\n and{' '}\n \n mobile apps\n {' '}\n after you sign in.\n

\n

What to write about

\n

\n The Append Editor is great for writing articles, blog posts,\n checklists, code snippets, documentation, emails, essays, journals,\n lists, logs, notes, tables, todo lists, and much more. Here are some\n questions to help you get started with today's daily journal:\n

{' '}\n
    \n
  • How are you? What's happening?
  • \n
  • What might be affecting your mood?
  • \n
  • Which feelings fit your mood and to what extent?
  • \n
    \n \n {!this.state.showFeelings && [\n

    Show feelings

    ,\n ]}\n {this.state.showFeelings && [\n

    Hide feelings

    ,\n ]}\n
    \n
  • \n Positive Feelings: bold, calm, cheerful, confident,\n content, eager, ecstatic, energized, engaged, enthusiastic,\n excited, grateful, happy, humorous, inspired, joyful, light,\n lively, loving, motivated, optimistic, passionate, peaceful,\n playful, proud, reassured, refreshed, relaxed, relieved,\n satisfied, secure, surprised, thrilled, wonderful\n
  • \n
  • \n Negative Feelings: afraid, angry, annoyed, anxious,\n ashamed, bored, burnt out, confused, demoralized, depressed,\n disappointed, disgusted, distraught, embarrassed, empty,\n exhausted, frustrated, furious, guilty, heavy, insecure,\n irritated, jealous, jittery, lethargic, lonely, nervous, numb,\n resentful, sad, self-conscious, sleepy, stressed, tired, winded,\n worried\n
  • \n
    \n
  • What thoughts are contributing to the way you're feeling?
  • \n
    \n \n {!this.state.showMoreQuestions && [\n

    Show more questions

    ,\n ]}\n {this.state.showMoreQuestions && [\n

    Show fewer questions

    ,\n ]}\n
    \n
    \n {this.state.showMoreQuestions && [\n
    \n
  • \n What do you hope your life will look like in a week? a month? a\n year?\n
  • \n
  • \n What can you do today to make your life the way you want it?\n
  • \n
  • \n How will you feel when you've realized the goals that you have\n for yourself?\n
  • \n
  • Who or what do you feel grateful for and why?
  • \n
  • What did you enjoy about today?
  • \n
    ,\n ]}\n
\n
\n \n

Need more help?

\n
\n {this.state.showFeedback && [\n

\n Feel free to{' '}\n \n reach out\n {' '}\n if you have any questions, comments, concerns, or feedback.{' '}\n \n 👋\n \n
\n If you find any bugs or have a feature request, please{' '}\n \n open an issue on GitHub\n \n .{' '}\n \n 🙂\n \n
\n You are using version 1.2.0. The release notes and\n change log are available on{' '}\n \n GitHub\n \n .\n

,\n ]}\n
\n Click Help\n \n  \n \n  \n \n to close this section.\n
\n
\n );\n }\n}\n","import React from 'react';\nimport { EyeIcon, HelpIcon, PencilIcon, PlusIcon } from './Icons';\nimport {\n clickAppendButton,\n clickEditButton,\n clickHelpButton,\n clickViewButton,\n} from '../lib/clickButton';\n\ninterface IntroProps {\n appendMode: boolean;\n editMode: boolean;\n showHelp: boolean;\n}\n\nconst Intro: React.FC = ({ appendMode, editMode, showHelp }) => (\n
\n
\n \n Welcome to the Append Editor!{' '}\n \n 👋\n {' '}\n Your note is empty.{' '}\n \n 🙂\n {' '}\n Click here to get started.{' '}\n \n 📝\n \n \n

To get started:

\n
    \n
  • \n

    \n Click the Pencil\n \n  \n \n  \n \n to toggle Edit Mode\n

    \n
  • \n
  • \n

    \n Click the Plus\n \n  \n \n  \n \n to toggle Append Mode\n

    \n
  • \n
\n

\n View Mode is currently on. When you type in{' '}\n Edit Mode, your note will automatically render here. In{' '}\n Append Mode, clicking Append will add the text in the\n textarea to the end of your note. Click the Eye\n \n  \n \n  \n \n to turn View Mode off and switch to Edit Only Mode.\n

\n

\n If you are using the demo at{' '}\n \n beta.appendeditor.com\n \n , then your notes will be lost after you close the page.\n

\n

\n If you want to save your notes, then click Help\n \n  \n \n  \n \n and follow the instructions on how to install the Append Editor in{' '}\n \n Standard Notes\n \n , a free,{' '}\n \n open-source\n \n , and{' '}\n \n end-to-end encrypted\n {' '}\n notes app.\n

\n

\n If you like Standard Notes, please check out Standard Notes{' '}\n \n Extended\n {' '}\n for more editors, themes, components, and methods to backup up your\n data.\n

\n

\n Happy note-taking!{' '}\n \n 😄\n \n

\n
\n
\n);\n\nexport default Intro;\n","import React, { ReactNode } from 'react';\nimport unified from 'unified';\nimport parse from 'remark-parse';\nimport remark2rehype from 'remark-rehype';\nimport rehype2react from 'rehype-react';\nimport { debounce, throttle } from 'lodash';\n\nconst gfm = require('remark-gfm');\nconst breaks = require('remark-breaks');\nconst math = require('remark-math');\nconst rehypeKatex = require('rehype-katex');\nconst highlight = require('rehype-highlight');\nconst emoji = require('remark-emoji');\nconst externalLinks = require('remark-external-links');\nconst toc = require('remark-toc');\nconst footnotes = require('remark-footnotes');\nconst slug = require('remark-slug');\nconst raw = require('rehype-raw');\n\nconst processor = unified()\n .use(parse)\n .use(gfm)\n .use(breaks)\n .use(slug)\n .use(toc, { maxDepth: 6 })\n .use(externalLinks)\n .use(footnotes, { inlineNotes: true })\n .use(remark2rehype, { allowDangerousHtml: true })\n .use(raw)\n .use(math)\n .use(rehypeKatex)\n .use(highlight, { ignoreMissing: true })\n .use(emoji)\n .use(rehype2react, { createElement: React.createElement });\n\nexport const processMarkdown = (text: string) => {\n const markdown = processor.processSync(text).result as ReactNode;\n return markdown;\n};\n\n/** Throttle instead of debounce because\n * we want it to work even when typing\n * lots of characters in a short amount of time. */\nexport const isLongString = throttle((text: string) => {\n //console.log('length', text.length);\n if (text.length > 10000) {\n return true;\n } else {\n return false;\n }\n}, 1000);\n\n/** Debounce the rendering of long notes to prevent lagging.\n * There is no max on the debounce to prevent lagging\n * even for very, very long notes */\nexport const renderLongMarkdown = debounce((text: string) => {\n //console.log('renderLongMarkdownText');\n const markdown = processMarkdown(text);\n return markdown;\n}, 500);\n\nexport const renderMarkdown = (text: string, bypassDebounce: boolean) => {\n if (bypassDebounce) {\n //console.log('renderBypassDebounceText');\n const markdown = processMarkdown(text);\n return markdown;\n }\n let textIsLong = false as boolean | undefined;\n textIsLong = isLongString(text);\n //console.log('textIsLong', textIsLong);\n if (textIsLong) {\n return renderLongMarkdown(text);\n } else {\n //console.log('renderShortMarkdownText');\n const markdown = processMarkdown(text);\n return markdown;\n }\n};\n","import React from 'react';\nimport { EditingModes, HtmlElementId } from './AppendEditor';\nimport DynamicEditor from './DynamicEditor';\nimport Help from './Help';\nimport Intro from './Intro';\nimport { renderMarkdown } from '../lib/renderMarkdown';\n\ninterface ViewProps {\n appendMode: boolean;\n bypassDebounce: boolean;\n debugMode: boolean;\n editMode: boolean;\n editingMode?: string;\n monacoEditorLanguage: string;\n printURL: boolean;\n saveText: (text: string) => void;\n showHelp: boolean;\n text: string;\n}\n\ninterface ViewState {\n showHelp: boolean;\n}\n\nexport default class ViewNote extends React.Component {\n constructor(props: ViewProps) {\n super(props);\n\n this.state = {\n showHelp: this.props.showHelp,\n };\n }\n\n onToggleShowHelp = () => {\n const helpButton = document.getElementById('helpButton');\n if (helpButton) {\n helpButton.click();\n }\n };\n\n renderMarkdown = (text: string) => {\n const markdown = renderMarkdown(text, this.props.bypassDebounce);\n return markdown;\n };\n\n render() {\n const { text } = this.props;\n return (\n \n
\n {!text && [\n ,\n ]}\n {this.state.showHelp && [\n ,\n ]}\n \n {this.props.editingMode === EditingModes.useMonacoEditor &&\n this.props.monacoEditorLanguage !== 'markdown' &&\n this.props.monacoEditorLanguage !== 'html' &&\n text ? (\n this.renderMarkdown(\n '```' + this.props.monacoEditorLanguage + '\\n' + text + '\\n```'\n )\n ) : this.props.editingMode === EditingModes.useDynamicEditor ? (\n \n ) : (\n this.renderMarkdown(text)\n )}\n
\n \n \n );\n }\n}\n","import React from 'react';\nimport { EditingModes } from './AppendEditor';\nimport DynamicEditor from './DynamicEditor';\nimport { MonacoEditor } from './Monaco';\n\nimport { HtmlElementId } from './AppendEditor';\n\ninterface AppendProps {\n appendNewLine: boolean;\n appendNewParagraph: boolean;\n appendRows: number;\n appendTextToNote: Function;\n editingMode?: string;\n fontSize: string;\n keyMap: Map;\n debugMode: boolean;\n autoSaveAppendText: Function;\n autoSaveCheckBoxes: Function;\n monacoEditorLanguage: string;\n onKeyDown: Function;\n onKeyUp: Function;\n onKeyDownAppendTextArea: Function;\n onKeyDownTextArea: Function;\n text: string;\n}\n\ninterface AppendState {\n text: string;\n newLine: boolean;\n newParagraph: boolean;\n [x: string]: string | boolean;\n}\n\nexport default class AppendText extends React.Component<\n AppendProps,\n AppendState\n> {\n static defaultProps = {\n // none\n };\n\n constructor(props: AppendProps) {\n super(props);\n\n this.state = {\n text: this.props.text,\n newLine: this.props.appendNewLine,\n newParagraph: this.props.appendNewParagraph,\n useMonacoEditor: this.props.editingMode === EditingModes.useMonacoEditor,\n useDynamicEditor:\n this.props.editingMode === EditingModes.useDynamicEditor,\n };\n }\n\n handleInputChange = (event: React.ChangeEvent) => {\n const target = event.target;\n const value = target.type === 'checkbox' ? target.checked : target.value;\n const name = target.name;\n this.setState(\n {\n [name]: value,\n },\n () => {\n // This callback saves the checkboxes\n this.autoSaveCheckBoxes();\n }\n );\n };\n\n // This is an almost duplicate of the above editor. Here we don't save the checkboxes to improve performance\n handleTextAreaChange = (event: any) => {\n const target = event.target;\n const value = target.value;\n this.setState(\n {\n text: value,\n },\n () => {\n // This callback saves the append text\n this.autoSaveAppendText();\n }\n );\n };\n\n saveText = (text: string) => {\n this.setState(\n {\n text,\n },\n () => {\n this.props.autoSaveAppendText(this.state.text);\n }\n );\n };\n\n appendTextToNote = () => {\n this.props.appendTextToNote();\n this.setState({\n text: '',\n });\n const appendTextArea = document.getElementById(\n HtmlElementId.appendTextArea\n );\n if (appendTextArea) {\n appendTextArea.focus();\n }\n // Refresh Monaco Editor after appending text to note\n if (this.state.useMonacoEditor) {\n this.setState(\n {\n useMonacoEditor: false,\n },\n () => {\n this.setState({\n useMonacoEditor: true,\n });\n }\n );\n }\n // Refresh Dynamic Editor after appending text to note\n if (this.state.useDynamicEditor) {\n this.setState(\n {\n useDynamicEditor: false,\n },\n () => {\n this.setState({\n useDynamicEditor: true,\n });\n }\n );\n }\n };\n\n autoSaveAppendText = () => {\n const text = this.state.text;\n this.props.autoSaveAppendText(text);\n };\n\n autoSaveCheckBoxes = () => {\n const newLine = this.state.newLine;\n const newParagraph = this.state.newParagraph;\n this.props.autoSaveCheckBoxes(newLine, newParagraph);\n };\n\n onKeyDown = (e: React.KeyboardEvent) => {\n this.props.keyMap.set(e.key, true);\n if (this.props.debugMode) {\n console.log(\n 'Keys pressed: ' +\n e.key +\n 'KeyMap for key: ' +\n this.props.keyMap.get(e.key)\n );\n console.log('Append Text Value: ' + this.state.text);\n }\n\n this.props.onKeyDown(e);\n this.props.onKeyDownAppendTextArea(e);\n this.props.onKeyDownTextArea(e);\n // Append Text if Ctrl and 'Enter' are pressed\n if (this.props.keyMap.get('Control') && this.props.keyMap.get('Enter')) {\n e.preventDefault();\n this.appendTextToNote();\n }\n // Append Text if Ctrl and 's' are pressed\n else if (this.props.keyMap.get('Control') && this.props.keyMap.get('s')) {\n e.preventDefault();\n this.appendTextToNote();\n }\n };\n\n onKeyUp = (event: React.KeyboardEvent) => {\n this.props.keyMap.delete(event.key);\n this.props.onKeyUp(event);\n };\n\n render() {\n const { text } = this.state;\n\n return (\n \n \n {this.state.useMonacoEditor ? (\n // We use this.state instead of this.props so we can easily refresh it on Append\n \n ) : this.state.useDynamicEditor ? (\n
\n \n
\n ) : (\n \n )}\n \n
\n
\n \n
\n \n
\n
\n \n
Append
\n \n
\n
\n \n );\n }\n}\n","import React from 'react';\nimport {\n ChevronIconDown,\n ChevronIconRight,\n CopyIcon,\n EyeIcon,\n PencilIcon,\n PrintIcon,\n UndoIcon,\n} from './Icons';\n\ninterface ActionButtonTypes {\n caption?: string;\n className?: string;\n fill?: string;\n id?: string;\n title: string;\n onClick: () => void;\n}\n\ninterface ConditionalButtonTypes extends ActionButtonTypes {\n condition?: boolean | undefined;\n messageOn?: string;\n messageOff?: string;\n}\n\nexport const ChevronToggleButton: React.FC = ({\n caption,\n className,\n condition,\n onClick,\n title,\n}) => (\n \n);\n\nexport const CopyButton: React.FC = ({\n caption,\n className,\n fill,\n onClick,\n title,\n}) => (\n \n);\n\nexport const EyeButton: React.FC = ({\n caption,\n className,\n condition,\n messageOn,\n messageOff,\n onClick,\n title,\n}) => (\n \n);\n\nexport const PencilButton: React.FC = ({\n caption,\n className,\n fill,\n onClick,\n title,\n}) => (\n \n);\n\nexport const PrintButton: React.FC = ({\n caption,\n className,\n fill,\n id,\n onClick,\n title,\n}) => (\n \n);\n\nexport const UndoButton: React.FC = ({\n fill,\n id,\n onClick,\n title,\n}) => (\n \n);\n","import React from 'react';\nimport prettier from 'prettier';\nimport parserMarkdown from 'prettier/parser-markdown';\nimport { EditingModes } from './AppendEditor';\nimport {\n ChevronToggleButton,\n CopyButton,\n EyeButton,\n PencilButton,\n PrintButton,\n} from './Buttons';\n\n// Import types\nimport { HtmlElementId } from './AppendEditor';\n\nenum HtmlClassName {\n chevronToggleButton = 'menu-button chevron-toggle-button',\n menuButton = 'menu-button',\n on = ' on',\n off = ' off',\n}\n\ninterface MenuProps {\n borderlessMode?: boolean;\n editingMode?: string;\n fixedHeightMode?: boolean;\n fullWidthMode?: boolean;\n monacoEditorLanguage: string;\n onConfirmPrintUrl: () => void;\n overflowMode?: boolean;\n refreshEdit: () => void;\n refreshView: () => void;\n saveText: (text: string) => void;\n showMenuOptionsEdit?: boolean;\n //showMenuOptionsMonacoEditor?: boolean;\n showMenuOptionsShare?: boolean;\n showMenuOptionsView?: boolean;\n text: string;\n toggleBorderlessMode: () => void;\n toggleFixedHeightMode: () => void;\n toggleFullWidthMode: () => void;\n toggleOverflowMode: () => void;\n toggleShowMenu: () => void;\n toggleShowMenuOptionsEdit: () => void;\n //toggleShowMenuOptionsMonacoEditor?: () => void;\n toggleShowMenuOptionsView: () => void;\n toggleShowMenuOptionsShare: () => void;\n viewMode?: boolean;\n}\n\ninterface MenuState {\n message?: string;\n displayMessageShare: boolean;\n displayMessageEdit: boolean;\n}\n\nexport default class Menu extends React.Component {\n clearTooltipTimer: NodeJS.Timeout | undefined;\n constructor(props: MenuProps) {\n super(props);\n this.state = {\n message: '',\n displayMessageEdit: false,\n displayMessageShare: false,\n };\n }\n\n resetMessageTimer = () => {\n if (this.clearTooltipTimer) {\n clearTimeout(this.clearTooltipTimer);\n }\n this.clearTooltipTimer = setTimeout(() => {\n this.setState({\n displayMessageEdit: false,\n displayMessageShare: false,\n });\n }, 5000);\n };\n\n showMessageEdit = () => {\n this.setState(\n {\n displayMessageEdit: true,\n displayMessageShare: false,\n },\n () => {\n this.resetMessageTimer();\n }\n );\n };\n showMessageShare = () => {\n this.setState(\n {\n displayMessageEdit: false,\n displayMessageShare: true,\n },\n () => {\n this.resetMessageTimer();\n }\n );\n };\n\n copyToClipboard = (text: string) => {\n const textField = document.createElement('textarea');\n textField.value = text;\n document.body.appendChild(textField);\n textField.select();\n document.execCommand('copy');\n this.showMessageShare();\n textField.remove();\n };\n\n copyText = () => {\n if (this.props.text) {\n this.setState({ message: 'Copied Text to clipboard' }, () => {\n this.copyToClipboard(this.props.text);\n });\n } else {\n this.setState({ message: 'No text to copy. Your note is empty' }, () => {\n this.showMessageShare();\n });\n }\n };\n\n copyHtml = () => {\n if (!this.props.viewMode) {\n this.setState(\n { message: 'Unable to copy HTML. Please turn View Mode on' },\n () => this.showMessageShare()\n );\n } else if (!this.props.text) {\n this.setState({ message: 'No HTML to copy. Your note is empty' }, () => {\n this.showMessageShare();\n });\n } else {\n const renderedNote = document.getElementById('renderedNote');\n if (renderedNote?.firstElementChild?.innerHTML) {\n this.setState({ message: 'Copied HTML to clipboard' });\n this.copyToClipboard(renderedNote?.firstElementChild.innerHTML);\n }\n }\n };\n\n formatText = () => {\n if (\n this.props.monacoEditorLanguage !== 'markdown' &&\n this.props.editingMode === EditingModes.useMonacoEditor\n ) {\n this.setState(\n {\n message:\n 'Error: Your Monaco Editor language is not Markdown. Formatting is only available for Markdown',\n },\n () => {\n this.showMessageEdit();\n }\n );\n } else if (this.props.text) {\n this.setState(\n { message: 'Formatted Markdown text with Prettier' },\n () => {\n try {\n const formattedText = prettier.format(this.props.text, {\n parser: 'markdown',\n plugins: [parserMarkdown],\n });\n this.props.saveText(formattedText);\n this.props.refreshEdit();\n this.props.refreshView();\n this.showMessageEdit();\n } catch (e) {\n this.setState({ message: 'Error formatting text: ' + e }, () => {\n this.showMessageEdit();\n });\n console.log('Error formatting text: ' + e);\n }\n }\n );\n } else {\n this.setState(\n { message: 'No text to format. Your note is empty' },\n () => {\n this.showMessageEdit();\n }\n );\n }\n };\n\n uncheckBoxes = () => {\n const { text } = this.props;\n const checkedBoxes = new RegExp(/- \\[x\\]/gm);\n if (checkedBoxes.test(text)) {\n const newText = text.replace(checkedBoxes, '- [ ]');\n this.props.saveText(newText);\n this.props.refreshEdit();\n this.props.refreshView();\n this.setState({ message: 'Unchecked all checkboxes' }, () => {\n this.showMessageEdit();\n });\n } else {\n this.setState({ message: 'No checked checkboxes found' }, () => {\n this.showMessageEdit();\n });\n }\n };\n\n render() {\n // You can render any custom fallback UI\n return [\n
,\n
\n \n {this.props.showMenuOptionsView && [\n ,\n ,\n ,\n ,\n ]}\n \n {this.props.showMenuOptionsShare && [\n ,\n ,\n ,\n \n

\n {this.state.message}\n

\n
,\n ]}\n \n {this.props.showMenuOptionsEdit && [\n ,\n ,\n \n

\n {this.state.message}\n

\n
,\n ]}\n
\n ,\n ];\n }\n}\n","import React from 'react';\nimport { MonacoEditor } from './Monaco';\nimport {\n DefaultSettings,\n EditingModes,\n SaveSettingsInterface,\n} from './AppendEditor';\nimport { CloseIcon, RefreshIcon } from './Icons';\nimport { ChevronToggleButton, UndoButton } from './Buttons';\n\nconst customStylesID = 'customStyles';\nconst editingModeID = 'editingMode';\nconst fontEditID = 'fontEdit';\nconst fontSizeID = 'fontSize';\nconst fontViewID = 'fontView';\nconst monacoEditorLanguageID = 'monacoEditorLanguage';\nconst resetAllSettingsID = 'resetAllSettings';\nconst saveAsDefaultID = 'saveAsDefault';\n\ninterface SettingsProps {\n defaultSettings: DefaultSettings;\n customStyles: string;\n editingMode?: string;\n fontEdit: string;\n fontSize: string;\n fontView: string;\n monacoEditorLanguage: string;\n cancelText: string;\n confirmText: string;\n debugMode: boolean;\n keyMap: Map;\n onCancel: () => void;\n onConfirm: (object: SaveSettingsInterface) => void;\n title: string;\n helpLink: string;\n}\n\ninterface SettingsState {\n customStyles: string;\n editingMode: string;\n fontEdit: string;\n fontSize: string;\n fontView: string;\n monacoEditorLanguage: string;\n saveAsDefault: boolean;\n showCustomStyles: boolean;\n [x: string]: string | boolean;\n}\n\nconst startRegExp = new RegExp(/```css\\n/gm);\nconst cssRegExp = new RegExp(/```css/gm);\nconst endRegExp = new RegExp(/\\n```/gm);\nconst codeRegExp = new RegExp(/```/gm);\n\nexport default class Settings extends React.Component<\n SettingsProps,\n SettingsState\n> {\n constructor(props: SettingsProps) {\n super(props);\n let monacoEditorLanguage = 'markdown';\n if (this.props.monacoEditorLanguage) {\n monacoEditorLanguage = this.props.monacoEditorLanguage;\n }\n let editingMode = 'usePlainText';\n if (this.props.editingMode) {\n editingMode = this.props.editingMode;\n }\n this.state = {\n customStyles: this.props.customStyles,\n editingMode,\n fontEdit: this.props.fontEdit,\n fontSize: this.props.fontSize,\n fontView: this.props.fontView,\n monacoEditorLanguage,\n saveAsDefault: false,\n showCustomStyles: false, // false by default for a mobile-first experience\n };\n }\n\n handleInputChange = (event: React.ChangeEvent) => {\n const target = event.target;\n const value = target.type === 'checkbox' ? target.checked : target.value;\n const name = target.name;\n this.setState({\n [name]: value,\n });\n if (this.props.debugMode) {\n console.log(\n 'Settings event name: ' +\n event.target.name +\n ' Value: ' +\n event.target.value\n );\n }\n };\n\n handleSelectChange = (event: React.ChangeEvent) => {\n const target = event.target;\n const value = target.value;\n const name = target.name;\n this.setState(\n {\n [name]: value,\n },\n () => {\n if (this.props.debugMode) {\n console.log(\n 'Saved select. Name: ' +\n event.target.name +\n ' Value: ' +\n event.target.value\n );\n }\n }\n );\n };\n\n toggleShowCustomStyles = () => {\n this.setState({\n showCustomStyles: !this.state.showCustomStyles,\n });\n };\n\n cleanCustomStyles = (text: string) => {\n if (text) {\n return text\n .replace(startRegExp, '')\n .replace(cssRegExp, '')\n .replace(endRegExp, '')\n .replace(codeRegExp, '');\n } else {\n return text;\n }\n };\n\n saveText = (text: string) => {\n this.setState({\n customStyles: text,\n });\n };\n\n handleSubmit = () => {\n if (this.props.debugMode) {\n let fontEditMessage = '';\n let fontViewMessage = '';\n if (this.state.fontEdit === '' || this.state.fontEdit === undefined) {\n fontEditMessage = 'Default';\n } else if (this.state.fontEdit) {\n fontEditMessage = this.state.fontEdit;\n }\n if (this.state.fontView === '' || this.state.fontView === undefined) {\n fontViewMessage = 'Default';\n } else if (this.state.fontView) {\n fontViewMessage = this.state.fontView;\n }\n console.log(\n 'Settings.tsx handleSubmit() triggered: ' +\n '\\n - Settings editingMode: ' +\n this.state.editingMode +\n '\\n - Settings fontEdit: ' +\n this.state.fontEdit +\n '\\n - Settings fontView: ' +\n this.state.fontView +\n '\\n - Your chosen font for Edit/Append is: ' +\n fontEditMessage +\n '\\n - Your chosen font for View/Print is: ' +\n fontViewMessage +\n '\\n'\n );\n }\n this.setState(\n {\n // clean the custom styles prior to saving them\n customStyles: this.cleanCustomStyles(this.state.customStyles),\n },\n () => {\n if (this.props.debugMode) {\n console.log('Your custom styles: ' + this.state.customStyles);\n }\n const {\n customStyles,\n editingMode,\n fontEdit,\n fontSize,\n fontView,\n monacoEditorLanguage,\n saveAsDefault,\n } = this.state;\n this.props.onConfirm({\n customStyles,\n editingMode,\n fontEdit,\n fontSize,\n fontView,\n monacoEditorLanguage,\n saveAsDefault,\n });\n }\n );\n };\n\n loadDefaultSettings = () => {\n const defaultSettings = this.props.defaultSettings;\n this.setState(\n {\n ...defaultSettings,\n },\n () => {\n this.refreshCustomStyles();\n }\n );\n };\n\n refreshCustomStyles = () => {\n this.setState(\n {\n showCustomStyles: !this.state.showCustomStyles,\n },\n () => {\n this.setState({\n showCustomStyles: !this.state.showCustomStyles,\n });\n }\n );\n };\n\n clearCustomStyles = () => {\n this.setState(\n {\n customStyles: '',\n },\n () => {\n this.refreshCustomStyles();\n if (this.props.debugMode) {\n console.log('customStyles reset: ' + this.state.customStyles);\n }\n }\n );\n const customStyles = document.getElementById(\n customStylesID\n ) as HTMLTextAreaElement;\n if (customStyles) {\n customStyles.value = '';\n customStyles.focus();\n }\n };\n\n clearFontEdit = () => {\n this.setState({\n fontEdit: '',\n });\n const fontEdit = document.getElementById(fontEditID) as HTMLTextAreaElement;\n if (fontEdit) {\n fontEdit.value = '';\n fontEdit.focus();\n }\n };\n\n clearFontSize = () => {\n this.setState({\n fontSize: '',\n });\n const fontSize = document.getElementById(fontSizeID) as HTMLSelectElement;\n if (fontSize) {\n fontSize.value = '';\n fontSize.focus();\n }\n };\n\n clearFontView = () => {\n this.setState({\n fontView: '',\n });\n const fontView = document.getElementById(fontViewID) as HTMLTextAreaElement;\n if (fontView) {\n fontView.value = '';\n fontView.focus();\n }\n };\n\n clearEditingMode = () => {\n this.setState({\n editingMode: EditingModes.usePlainText,\n });\n };\n\n clearMonacoEditorLanguage = () => {\n this.setState({\n monacoEditorLanguage: 'markdown',\n });\n const monacoEditorLanguage = document.getElementById(\n monacoEditorLanguageID\n ) as HTMLSelectElement;\n if (monacoEditorLanguage) {\n monacoEditorLanguage.value = 'markdown';\n monacoEditorLanguage.focus();\n }\n };\n\n clearSaveAsDefault = () => {\n this.setState({\n saveAsDefault: false,\n });\n const saveAsDefault = document.getElementById(\n saveAsDefaultID\n ) as HTMLInputElement;\n saveAsDefault.checked = false;\n saveAsDefault.focus();\n };\n\n clearAllSettings = () => {\n // We clear from bottom settings to top settings so the focus afterwards is on top\n this.clearSaveAsDefault();\n this.clearCustomStyles();\n this.clearFontView();\n this.clearFontEdit();\n this.clearFontSize();\n this.clearMonacoEditorLanguage();\n this.clearEditingMode();\n const resetAllSettings = document.getElementById(resetAllSettingsID);\n if (resetAllSettings) {\n resetAllSettings.focus();\n }\n };\n\n onKeyDown = (e: React.KeyboardEvent) => {\n this.props.keyMap.set(e.key, true);\n //console.log(\"Keys pressed: \" + e.key + \"KeyMap for key: \" + keyMap.get(e.key)) + \"KeyMap for Shift: \" + keyMap.get('Shift');\n // Save settings if Control and 's' are pressed\n if (this.props.keyMap.get('Control') && this.props.keyMap.get('s')) {\n e.preventDefault();\n this.handleSubmit();\n }\n // Save settings if Control and Enter are pressed\n else if (\n this.props.keyMap.get('Control') &&\n this.props.keyMap.get('Enter')\n ) {\n e.preventDefault();\n this.handleSubmit();\n }\n };\n\n onKeyUp = (e: React.KeyboardEvent) => {\n this.props.keyMap.set(e.key, false);\n };\n\n onBlur = (e: React.FocusEvent) => {\n this.props.keyMap.clear();\n };\n\n componentWillUnmount = () => {\n this.props.keyMap.clear();\n };\n\n render() {\n //

\n const { title, onCancel, confirmText, cancelText, helpLink } = this.props;\n return (\n
\n
\n
\n \n \n \n
\n

{title}

\n \n
\n
\n
\n

\n Need help? Check out the{' '}\n \n documentation\n \n . To clear all settings, click undo: \n

\n \n
\n
\n
\n
\n

To load your personal default settings, click: 

\n \n \n \n
\n
\n
\n
\n

Editing Mode:

\n \n
\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n {this.state.editingMode === EditingModes.useMonacoEditor && [\n
\n \n
\n \n \n
\n
,\n ]}\n
\n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n {this.state.editingMode !== EditingModes.useMonacoEditor && [\n
\n \n
\n \n \n
\n
,\n ]}\n {this.state.editingMode !== EditingModes.useDynamicEditor && [\n
\n \n
\n \n \n
\n
,\n ]}\n
\n \n {this.state.showCustomStyles && [\n
\n \n
,\n ]}\n
\n {this.state.showCustomStyles && [\n
\n \n
,\n ]}\n
\n \n
\n \n \n
\n
\n
\n
\n
\n
\n \n \n
\n
\n
\n );\n }\n}\n","import React, { ErrorInfo } from 'react';\nimport { GearIcon } from './Icons';\nimport { clickSettingsButton } from '../lib/clickButton';\n\ninterface ErrorBoundaryState {\n hasError: boolean;\n error?: Error;\n errorInfo?: ErrorInfo;\n}\n\n/**\n * Learn more about Error Boundaries here:\n * https://reactjs.org/docs/error-boundaries.html\n */\n\nexport default class ErrorBoundary extends React.Component<\n any,\n ErrorBoundaryState\n> {\n constructor(props: any) {\n super(props);\n this.state = { hasError: false };\n }\n\n static getDerivedStateFromError(error: Error) {\n // Update state so the next render will show the fallback UI.\n return { hasError: true };\n }\n\n componentDidCatch(error: Error, errorInfo: ErrorInfo) {\n // You can also log the error to an error reporting service\n console.log('Error:', error, '\\nError Info:', errorInfo);\n this.setState({\n error,\n errorInfo,\n });\n }\n\n render() {\n if (this.state.hasError) {\n // You can render any custom fallback UI\n return (\n
\n
\n
\n

Something went wrong.

\n

\n Error Name: {this.state.error?.name}\n

\n

\n Error Message: {this.state.error?.message}\n

\n

Please see the developer console for details.

\n
\n

\n Errors such as TypeError and{' '}\n Cannot read property 'type' of undefined usually\n occur when the editor is unable to process and render your notes\n because it contains incorrect or incomplete HTML. If you are\n writing in HTML, then please continue to write and refresh the\n View Mode when the HTML tags are closed.\n

\n

\n If you are using the Dynamic editing mode, then please switch to\n the Plain Textarea or Monaco editing modes in the Settings\n \n  \n \n  \n \n and remove or fix the text that is causing the error.\n

\n

\n If the error persists or is not related to the content of your\n note, then please{' '}\n \n report the issue on GitHub\n {' '}\n and we will try to fix it.{' '}\n \n 🙂\n \n

\n
\n
\n
\n );\n }\n\n return this.props.children;\n }\n}\n","import React from 'react';\nimport { EditorKit, EditorKitDelegate } from 'sn-editor-kit';\nimport PrintDialog from './PrintDialog';\nimport EditNote from './EditNote';\nimport ViewNote from './ViewNote';\nimport AppendText from './AppendText';\nimport Settings from './Settings';\nimport { MonacoDiffEditor } from './Monaco';\nimport ErrorBoundary from './ErrorBoundary';\nimport Menu from './Menu';\n\nimport CodeMirror, { Editor } from 'codemirror';\nimport 'codemirror/lib/codemirror';\nimport 'codemirror/mode/gfm/gfm';\n\n// CodeMirror addons\n\n// For markdown\nimport 'codemirror/addon/edit/continuelist';\n\n// For search\nimport 'codemirror/addon/search/jump-to-line';\nimport 'codemirror/addon/search/match-highlighter';\nimport 'codemirror/addon/search/matchesonscrollbar';\nimport 'codemirror/addon/search/search';\nimport 'codemirror/addon/search/searchcursor';\nimport 'codemirror/addon/dialog/dialog';\n\n// For styling selected text\nimport 'codemirror/addon/selection/mark-selection';\nimport {\n EyeIcon,\n GearIcon,\n HelpIcon,\n MenuIcon,\n PencilIcon,\n PlusIcon,\n} from './Icons';\n\nimport { isLongString, renderLongMarkdown } from '../lib/renderMarkdown';\n\nexport enum HtmlElementId {\n appendButton = 'appendButton',\n appendTextArea = 'appendTextArea',\n appendix = 'appendix',\n content = 'content',\n edit = 'edit',\n editButton = 'editButton',\n editTextArea = 'editTextArea',\n header = 'header',\n helpButton = 'helpButton',\n menuButton = 'menuButton',\n newLine = 'newLine',\n newParagraph = 'newParagraph',\n printButton = 'printButton',\n settingsButton = 'settingsButton',\n view = 'view',\n viewButton = 'viewButton',\n}\n\nexport enum HtmlClassName {\n fixed = 'fixed',\n fixedHeader = 'fixed-header',\n}\n\nexport enum EditingModes {\n usePlainText = 'usePlainText',\n useCodeMirror = 'useCodeMirror',\n useDynamicEditor = 'useDynamicEditor',\n useMonacoEditor = 'useMonacoEditor',\n}\n\nexport type DefaultSettings = {\n customStyles: string;\n editingMode: string;\n fontEdit: string;\n fontSize: string;\n fontView: string;\n monacoEditorLanguage: string;\n};\n\nexport interface SaveSettingsInterface extends DefaultSettings {\n saveAsDefault: boolean;\n}\n\nexport type menuOptions = {\n borderlessMode?: boolean;\n fixedHeightMode?: boolean;\n fullWidthMode?: boolean;\n overflowMode?: boolean;\n showMenuOptionsEdit?: boolean;\n showMenuOptionsShare?: boolean;\n showMenuOptionsView?: boolean;\n};\n\nexport interface AppendInterface {\n text: string;\n appendCodeMirror?: any;\n appendNewLine: boolean;\n appendNewParagraph: boolean;\n appendMode: boolean;\n appendRows: number;\n appendText: string;\n borderlessMode?: boolean;\n bypassDebounce: boolean;\n confirmPrintUrl: boolean;\n currentState?: object;\n customStyles: string;\n defaultSettings: DefaultSettings;\n editMode?: any;\n editingMode?: string;\n editCodeMirror?: any;\n fontEdit: string;\n fontSize: string;\n fontView: string;\n fixedHeightMode?: boolean;\n fullWidthMode?: boolean;\n overflowMode?: boolean;\n keyMap?: Object;\n monacoEditorLanguage: string;\n printURL: boolean;\n refreshEdit: boolean;\n refreshView: boolean;\n saveAsDefault?: boolean;\n savingEditorOptions?: boolean;\n showAppendix: boolean;\n showDiff: boolean;\n showHeader: boolean;\n showHelp: boolean;\n showMenu?: boolean;\n showMenuOptionsEdit?: boolean;\n showMenuOptionsShare?: boolean;\n showMenuOptionsView?: boolean;\n settingsMode: boolean;\n viewMode?: boolean;\n}\n\n/**\n * Some properties are optional so\n * they do not need to be set\n * when switching between notes.\n */\n\nconst initialState = {\n text: '',\n appendNewLine: false,\n appendNewParagraph: false,\n appendMode: false,\n appendRows: 8,\n appendText: '',\n bypassDebounce: false, // We keep this as false in initialState so debounce works in the demo\n confirmPrintUrl: false,\n customStyles: '',\n defaultSettings: {\n customStyles: '',\n editingMode: 'usePlainText',\n fontEdit: '',\n fontSize: '',\n fontView: '',\n monacoEditorLanguage: 'markdown',\n },\n fontEdit: '',\n fontSize: '',\n fontView: '',\n monacoEditorLanguage: 'markdown',\n printURL: true,\n refreshEdit: false,\n refreshView: false,\n showAppendix: true,\n showHeader: true,\n showHelp: false,\n showDiff: false,\n settingsMode: false,\n};\n\nlet last_known_scroll_position = 0;\n\nconst debugMode = false;\n\nlet keyMap = new Map();\n\nexport default class AppendEditor extends React.Component<{}, AppendInterface> {\n editorKit: any;\n refreshEditorTimer: NodeJS.Timeout | undefined;\n saveTimer: NodeJS.Timeout | undefined;\n\n constructor(props: AppendInterface) {\n super(props);\n this.configureEditorKit();\n this.state = initialState;\n }\n\n /**\n * This loads the first time the editor is loaded\n * This does not load every time a new note is loaded */\n componentDidMount = () => {\n if (debugMode) {\n console.log('AppendEditor.tsx: \\n - this.componentDidMount() triggered');\n }\n this.onViewMode();\n this.loadDefaultMenuState();\n document.addEventListener('scroll', this.onScroll);\n };\n\n componentWillUnmount = () => {\n document.removeEventListener('scroll', this.onScroll);\n };\n\n configureEditorKit = () => {\n if (debugMode) {\n console.log('AppendEditor.tsx: \\n - this.configureEditorKit() triggered');\n }\n let delegate = new EditorKitDelegate({\n /** This loads every time a different note is loaded\n * We turn bypassDebounce to true so\n * the editor always renders the markdown for the latest note\n */\n setEditorRawText: (text: string) => {\n this.setState(\n {\n ...initialState,\n bypassDebounce: true,\n text,\n },\n () => {\n if (debugMode) {\n console.log(\n '#################################################################################\\n' +\n 'AppendEditor.tsx:',\n '\\n - loaded text:',\n text +\n '\\n - this.configureEditorKit() callback triggered:' +\n '\\n - this.state.savingsDefaultSettings: ' +\n this.state.savingEditorOptions +\n '\\n - this.state: ' +\n JSON.stringify(this.state, null, ' ')\n );\n }\n /** Clear the debounce from the previous note and componentDidMount\n * Then call and flush the debounce so the correct markdown will render\n * the first time after turning the bypass off */\n isLongString.cancel();\n isLongString(text);\n isLongString.flush();\n renderLongMarkdown.cancel();\n if (isLongString(text)) {\n renderLongMarkdown(text);\n renderLongMarkdown.flush();\n }\n /** This prevents metadata from loading when saving editor options or default settings */\n if (!this.state.savingEditorOptions) {\n this.loadEditorOptions();\n this.loadDefaultSettings();\n this.loadMetaData();\n }\n /** Turn the debounce bypass off\n * This loads every time, even when saving editor options or default settings\n * because bypassDebounce is set to true every time\n */\n setTimeout(() => {\n this.setState({\n bypassDebounce: false,\n });\n }, 1000);\n }\n );\n },\n clearUndoHistory: () => {},\n getElementsBySelector: () => [],\n });\n\n this.editorKit = new EditorKit({\n delegate: delegate,\n mode: 'plaintext',\n supportsFilesafe: false,\n });\n };\n\n /** Expect this to run three times when loading a note:\n * once when loading editor options,\n * once when loading default settings, and\n * once when loading meta data\n * Use the timer to prevent the function from being executed when it is called\n * repeatedly, as when loading a note or saving a menu option */\n refreshEditor = () => {\n if (isLongString(this.state.text)) {\n if (this.refreshEditorTimer) {\n clearTimeout(this.refreshEditorTimer);\n }\n this.refreshEditorTimer = setTimeout(() => {\n if (!this.state.savingEditorOptions) {\n this.refreshEdit();\n this.refreshView();\n this.activateStyles();\n }\n }, 20);\n } else {\n if (this.refreshEditorTimer) {\n clearTimeout(this.refreshEditorTimer);\n }\n this.refreshEditorTimer = setTimeout(() => {\n if (!this.state.savingEditorOptions) {\n this.refreshEdit();\n this.refreshView();\n this.activateStyles();\n }\n }, 10);\n }\n };\n\n loadDefaultSettings = () => {\n try {\n const defaultSettingsString = this.editorKit.internal.componentManager.componentDataValueForKey(\n 'defaultSettings'\n );\n const defaultEditingMode = this.editorKit.internal.componentManager.componentDataValueForKey(\n 'editingMode'\n );\n if (debugMode) {\n console.log(\n 'AppendEditor.tsx: \\n loadDefaultSetting() default settings loaded: ' +\n '\\n - defaultSettingsString: ' +\n defaultSettingsString,\n '\\n - typeof:',\n typeof defaultSettingsString,\n '\\n - defaultEditingMode:',\n defaultEditingMode,\n '\\n - typeof:',\n typeof defaultEditingMode\n );\n }\n if (defaultSettingsString !== undefined) {\n const defaultSettingsObject = JSON.parse(\n defaultSettingsString\n ) as DefaultSettings;\n if (debugMode) {\n console.log(\n 'AppendEditor.tsx: \\n loadDefaultSetting():',\n 'if (defaultSettingsString !== undefined) triggered',\n '\\n - typeof defaultSettings:',\n typeof defaultSettingsObject\n );\n }\n this.setState(\n {\n customStyles: defaultSettingsObject.customStyles,\n editingMode: defaultSettingsObject.editingMode,\n fontEdit: defaultSettingsObject.fontEdit,\n fontSize: defaultSettingsObject.fontSize,\n fontView: defaultSettingsObject.fontView,\n monacoEditorLanguage: defaultSettingsObject.monacoEditorLanguage,\n defaultSettings: defaultSettingsObject,\n },\n () => {\n if (debugMode) {\n console.log(\n 'AppendEditor.tsx: \\n - loadDefaultSettings() this.state.savingEditorOptions: ' +\n this.state.savingEditorOptions +\n '\\n defaultSettingsObject:',\n defaultSettingsObject,\n '\\n JSON.stringify(this.state.defaultSettings):',\n JSON.stringify(this.state.defaultSettings, null, ' ')\n );\n }\n this.refreshEditor();\n }\n );\n } else if (defaultEditingMode !== undefined) {\n /** This else if loads legacy default settings introduced in v1.1.0\n * We only need to check defaultEditingMode because it is never empty if it is defined\n * */\n const defaultCustomStyles = this.editorKit.internal.componentManager.componentDataValueForKey(\n 'customStyles'\n );\n const defaultFontEdit = this.editorKit.internal.componentManager.componentDataValueForKey(\n 'fontEdit'\n );\n const defaultFontSize = this.editorKit.internal.componentManager.componentDataValueForKey(\n 'fontSize'\n );\n const defaultFontView = this.editorKit.internal.componentManager.componentDataValueForKey(\n 'fontView'\n );\n const defaultMonacoEditorLanguage = this.editorKit.internal.componentManager.componentDataValueForKey(\n 'monacoEditorLanguage'\n );\n if (debugMode) {\n console.log(\n 'AppendEditor.tsx: \\n loadDefaultSetting():',\n 'else if (defaultEditingMode !== undefined) triggered',\n '\\n - default customStyles: ' + defaultCustomStyles,\n '\\n - typeof:',\n typeof defaultCustomStyles +\n '\\n - default fontSize: ' +\n defaultFontSize +\n '\\n - default fontEdit: ' +\n defaultFontEdit +\n '\\n - default fontView: ' +\n defaultFontView +\n '\\n - default monacoEditorLanguage: ' +\n defaultMonacoEditorLanguage\n );\n }\n this.setState(\n {\n customStyles: defaultCustomStyles,\n editingMode: defaultEditingMode,\n fontEdit: defaultFontEdit,\n fontSize: defaultFontSize,\n fontView: defaultFontView,\n monacoEditorLanguage: defaultMonacoEditorLanguage,\n defaultSettings: {\n customStyles: defaultCustomStyles,\n editingMode: defaultEditingMode,\n fontEdit: defaultFontEdit,\n fontSize: defaultFontSize,\n fontView: defaultFontView,\n monacoEditorLanguage: defaultMonacoEditorLanguage,\n },\n },\n () => {\n if (debugMode) {\n console.log(\n 'AppendEditor.tsx: \\n - loadDefaultSettings() this.state.savingEditorOptions: ' +\n this.state.savingEditorOptions\n );\n }\n this.refreshEditor();\n }\n );\n } else {\n if (debugMode) {\n console.log(\n 'AppendEditor.tsx: loadDefaultSettings(), else, current state:',\n JSON.stringify(this.state, null, ' ')\n );\n }\n this.refreshEditor();\n }\n } catch (error) {\n // Log outside debug mode\n console.log('Error loading default settings:', error);\n }\n };\n\n loadEditorOptions = () => {\n try {\n const menuOptionsString = this.editorKit.internal.componentManager.componentDataValueForKey(\n 'menuOptions'\n );\n if (menuOptionsString !== undefined) {\n const menuOptionsObject = JSON.parse(menuOptionsString) as menuOptions;\n this.setState(\n {\n borderlessMode: menuOptionsObject.borderlessMode,\n fixedHeightMode: menuOptionsObject.fixedHeightMode,\n fullWidthMode: menuOptionsObject.fullWidthMode,\n overflowMode: menuOptionsObject.overflowMode,\n //showMenuOptionsEdit: menuOptionsObject.showMenuOptionsEdit,\n //showMenuOptionsShare: menuOptionsObject.showMenuOptionsShare,\n //showMenuOptionsView: menuOptionsObject.showMenuOptionsView,\n },\n () => {\n this.refreshEditor();\n }\n );\n }\n } catch (error) {\n // Log outside debug mode\n console.log('Error loading editor options:', error);\n }\n };\n\n // This loads the Settings and Append Text\n loadMetaData = () => {\n this.editorKit.internal.componentManager.streamContextItem((note: any) => {\n // Load editor settings\n if (\n note.content.appendEditorCustomStyles ||\n note.content.appendEditorEditingMode ||\n note.content.appendEditorFontEdit ||\n note.content.appendEditorFontSize ||\n note.content.appendEditorFontView ||\n note.content.appendEditorMonacoEditorLanguage\n ) {\n this.setState(\n {\n customStyles: note.content.appendEditorCustomStyles,\n editingMode: note.content.appendEditorEditingMode,\n fontEdit: note.content.appendEditorFontEdit,\n fontSize: note.content.appendEditorFontSize,\n fontView: note.content.appendEditorFontView,\n monacoEditorLanguage: note.content.appendEditorMonacoEditorLanguage,\n },\n () => {\n if (debugMode) {\n console.log(\n 'AppendEditor.tsx: \\n - loadMetaData() this.state.savingEditorOptions: ' +\n this.state.savingEditorOptions\n );\n }\n this.refreshEditor();\n if (debugMode) {\n console.log(\n 'editorKit metadata loaded: ' +\n '\\n - loaded customStyles: ' +\n this.state.customStyles +\n '\\n - loaded editingMode: ' +\n this.state.editingMode +\n '\\n - loaded fontEdit: ' +\n this.state.fontEdit +\n '\\n - loaded fontSize: ' +\n this.state.fontSize +\n '\\n - loaded fontView: ' +\n this.state.fontView +\n '\\n - loaded monacoEditorLanguage: ' +\n this.state.monacoEditorLanguage\n );\n }\n }\n );\n }\n // Load append settings\n if (note.content.appendNewLine || note.content.appendNewParagraph) {\n this.setState({\n appendNewLine: note.content.appendNewLine,\n appendNewParagraph: note.content.appendNewParagraph,\n });\n }\n // Finally, load appendText\n this.setState(\n {\n appendText: note.content.appendText,\n },\n () => {\n /**If both text and appendText are empty,\n * such as when creating a new note,\n * and editMode is off,\n * then open the edit mode\n */\n if (\n !this.state.text &&\n !this.state.appendText &&\n !this.state.editMode\n ) {\n this.onEditMode();\n }\n }\n );\n if (debugMode) {\n console.log(\n ' - loaded append text: ' +\n this.state.appendText +\n '\\n - loaded append newline: ' +\n this.state.appendNewLine +\n '\\n - loaded append new paragraph: ' +\n this.state.appendNewParagraph +\n '\\n - loaded editorKit internal appendText: ' +\n this.editorKit.internal.note.content.appendText\n );\n }\n });\n };\n\n saveText = (text: string) => {\n this.saveNote(text);\n this.setState(\n {\n text: text,\n },\n () => {\n if (this.state.editingMode === EditingModes.useDynamicEditor) {\n this.refreshView();\n } else if (this.state.viewMode && isLongString(text)) {\n /** If the note text is long, then rendering its markdown will debounce\n * If the we stop editing for 550 milliseconds, then\n * automatically refresh the view to force the latest markdown to render\n * We use 550 because the debounce is 500.\n */\n if (this.saveTimer) {\n clearTimeout(this.saveTimer);\n }\n this.saveTimer = setTimeout(() => {\n if (this.state.fixedHeightMode) {\n /** This keeps the vertical scroll when refreshing view */\n const view = document.getElementById(HtmlElementId.view);\n if (view) {\n let scrollY = view.scrollTop;\n this.refreshView();\n /** We have to find the new view because\n * the previous one doesn't exist anymore */\n const refreshedView = document.getElementById(\n HtmlElementId.view\n );\n if (refreshedView) {\n refreshedView.scrollTop = scrollY;\n }\n } else {\n this.refreshView();\n }\n } else {\n this.refreshView();\n }\n }, 550);\n }\n if (debugMode) {\n console.log('AppendEditor.tsx: saved text:', this.state.text);\n }\n }\n );\n };\n\n saveNote = (text: string) => {\n // This will work in an SN context, but breaks the standalone editor, so we need to catch the error\n try {\n this.editorKit.onEditorValueChanged(text);\n } catch (error) {\n // Log outside debug mode\n console.log('Error saving note:', error);\n }\n };\n\n // Entry operations\n\n appendTextToNote = () => {\n // Do nothing if there's no append text\n if (this.state.appendText) {\n /*\n * We usually use this.editText() to save the main text\n * However, we want to save the main text and clear the appendText\n * Consecutive calls to the component manager does not work well,\n * so we want to do both with one call to the component manager\n * This means we need multiple versions of this function depending on what we want to save */\n const { appendText } = this.state;\n let textToAppend = '';\n // We test for new paragraph first even though new line is on top and is on by default\n if (this.state.appendNewParagraph) {\n textToAppend = ' \\n\\n' + appendText;\n } else if (this.state.appendNewLine) {\n textToAppend = ' \\n' + appendText;\n } else {\n textToAppend = appendText;\n }\n this.setState(\n {\n text: this.state.text.concat(textToAppend),\n appendText: '',\n },\n () => {\n let note = this.editorKit.internal.note;\n if (note) {\n this.editorKit.internal.componentManager.saveItemWithPresave(\n note,\n () => {\n note.content.text = this.state.text; // this.editorKit.internal.note.content.text\n note.content.appendText = this.state.appendText; // this.editorKit.internal.note.content.appendText\n }\n );\n }\n this.refreshEdit();\n // Refresh view mode if using dynamic\n if (this.state.editingMode === EditingModes.useDynamicEditor) {\n this.refreshView();\n setTimeout(() => {\n this.skipToBottom();\n }, 50);\n } else if (isLongString(this.state.text)) {\n setTimeout(() => {\n this.refreshView();\n this.skipToBottom();\n }, 550);\n } else {\n this.skipToBottom();\n }\n }\n );\n }\n // Refresh appendCodeMirror\n if (\n this.state.appendCodeMirror &&\n this.state.editingMode === EditingModes.useCodeMirror\n ) {\n this.state.appendCodeMirror.setValue('');\n }\n };\n\n autoSaveAppendText = (text: string) => {\n // This code is similar to this.onAppend();, but we only save the appendText and not the main text\n this.setState({\n appendText: text,\n });\n // This will work in an SN context, but breaks the standalone editor, so we need to catch the error\n try {\n let note = this.editorKit.internal.note;\n if (note) {\n this.editorKit.internal.componentManager.saveItemWithPresave(\n note,\n () => {\n note.content.appendText = text;\n }\n );\n }\n } catch (error) {\n // Log outside debug mode\n console.log('Error saving appendText:', error);\n }\n };\n\n autoSaveCheckBoxes = (newLine: boolean, newParagraph: boolean) => {\n // Here we save the appendText, appendNewLine, and appendNewParagraph\n // We have an additional function for this because we only call it when the user clicks a checkbox\n this.setState({\n appendNewLine: newLine,\n appendNewParagraph: newParagraph,\n });\n // This will work in an SN context, but breaks the standalone editor, so we need to catch the error\n try {\n let note = this.editorKit.internal.note;\n if (note) {\n this.editorKit.internal.componentManager.saveItemWithPresave(\n note,\n () => {\n note.content.appendNewLine = newLine;\n note.content.appendNewParagraph = newParagraph;\n }\n );\n }\n } catch (error) {\n // Log outside debug mode\n console.log('Error saving checkboxes:', error);\n }\n };\n\n refreshEdit = () => {\n this.setState(\n {\n refreshEdit: !this.state.refreshEdit,\n },\n () => {\n // We could also check for this.state.editMode,\n // but it might not be loaded yet.\n // Checking for editTextArea checks whether editMode has loaded\n const editTextArea = document.getElementById(\n HtmlElementId.editTextArea\n );\n if (\n editTextArea &&\n this.state.editingMode === EditingModes.useCodeMirror\n ) {\n this.configureCodeMirror(HtmlElementId.editTextArea);\n }\n }\n );\n };\n\n refreshView = () => {\n this.setState({\n refreshView: !this.state.refreshView,\n });\n };\n\n configureCodeMirror = (id: string) => {\n if (id === HtmlElementId.editTextArea) {\n if (debugMode) {\n console.log('this.state.text: ' + this.state.text);\n }\n const editTextArea = document.getElementById(id) as HTMLTextAreaElement;\n if (editTextArea) {\n const editCodeMirror = CodeMirror.fromTextArea(editTextArea, {\n autocorrect: true,\n autocapitalize: true,\n extraKeys: {\n Enter: 'newlineAndIndentContinueMarkdownList',\n 'Alt-F': 'findPersistent',\n },\n lineNumbers: false,\n lineWrapping: true,\n mode: 'gfm',\n spellcheck: true,\n //@ts-ignore\n styleSelectedText: true,\n tabindex: 0,\n theme: 'default',\n value: this.state.text,\n });\n editCodeMirror.setSize('100%', '100%');\n editCodeMirror.on('change', () => {\n const editCodeMirrorText = editCodeMirror.getValue();\n if (debugMode) {\n console.log('editCodeMirror value: ' + editCodeMirrorText);\n }\n editCodeMirror.save();\n this.saveText(editCodeMirrorText);\n });\n editCodeMirror.on('keydown', (cm: Editor, event: KeyboardEvent) => {\n this.onKeyDown(event);\n this.onKeyDownEditTextArea(event);\n this.onKeyDownTextArea(event);\n });\n editCodeMirror.on('keyup', (cm: Editor, event: KeyboardEvent) => {\n this.onKeyUp(event);\n });\n this.setState({\n editCodeMirror: editCodeMirror,\n });\n }\n } else if (id === HtmlElementId.appendTextArea) {\n const appendTextArea = document.getElementById(\n HtmlElementId.appendTextArea\n ) as HTMLTextAreaElement;\n if (appendTextArea) {\n const appendCodeMirror = CodeMirror.fromTextArea(appendTextArea, {\n autocorrect: true,\n autocapitalize: true,\n extraKeys: {\n Enter: 'newlineAndIndentContinueMarkdownList',\n 'Alt-F': 'findPersistent',\n },\n lineNumbers: false,\n lineWrapping: true,\n mode: 'gfm',\n spellcheck: true,\n //@ts-ignore\n styleSelectedText: true,\n tabindex: 0,\n theme: 'default',\n value: this.state.appendText,\n });\n appendCodeMirror.setSize('100%', '100%');\n appendCodeMirror.on('change', () => {\n const appendCodeMirrorText = appendCodeMirror.getValue();\n appendCodeMirror.save();\n this.autoSaveAppendText(appendCodeMirrorText);\n });\n appendCodeMirror.on('keydown', (cm: Editor, event: KeyboardEvent) => {\n this.onKeyDown(event);\n this.onKeyDownAppendTextArea(event);\n this.onKeyDownTextArea(event);\n });\n appendCodeMirror.on('keyup', (cm: Editor, event: KeyboardEvent) => {\n this.onKeyUp(event);\n });\n this.setState({\n appendCodeMirror: appendCodeMirror,\n });\n }\n }\n };\n\n makeContentEditable = () => {\n const content = document.getElementById(HtmlElementId.content);\n if (content) {\n content.setAttribute('contenteditable', 'true');\n content.setAttribute('spellcheck', 'true');\n }\n const appendix = document.getElementById(HtmlElementId.appendix);\n if (appendix) {\n appendix.setAttribute('contenteditable', 'true');\n appendix.setAttribute('spellcheck', 'true');\n }\n // Change contenteditable to false for rendered note\n const renderedNote = document.getElementById('renderedNote');\n if (renderedNote) {\n renderedNote.setAttribute('contenteditable', 'false');\n }\n const appendCustom = document.getElementById('appendCustom');\n if (appendCustom) {\n appendCustom.setAttribute('contenteditable', 'false');\n }\n };\n\n removeContentEditable = (id: string) => {\n const container = document.getElementById(id);\n if (container) {\n container.setAttribute('contenteditable', 'false');\n }\n };\n\n // Event Handlers\n onEditMode = () => {\n // if Append box is empty, close it and open Edit mode\n // if Edit mode is on, then close it, open View mode, and Append mode\n if (!this.state.editMode) {\n if (this.state.appendMode && !this.state.appendText) {\n this.setState({\n appendMode: false,\n });\n }\n this.setState(\n {\n editMode: true,\n },\n () => {\n const editTextArea = document.getElementById(\n HtmlElementId.editTextArea\n );\n if (editTextArea) {\n editTextArea.focus();\n if (this.state.editingMode === EditingModes.useCodeMirror) {\n this.configureCodeMirror(HtmlElementId.editTextArea);\n }\n }\n }\n );\n } else if (this.state.editMode) {\n /**If edit mode is on and Monaco Editor is off,\n * then turn edit mode off and turn view mode on.\n * This automatically renders the text. We do not\n * do this when Monaco is on because refreshing edit Mode\n * with Monaco Editor off allows us to resize the Monaco Editor.\n */\n if (!(this.state.editingMode === EditingModes.useMonacoEditor)) {\n this.setState({\n viewMode: true,\n });\n }\n if (this.state.editCodeMirror) {\n this.state.editCodeMirror.toTextArea();\n }\n this.setState(\n {\n editMode: false,\n },\n () => {\n // if not using append mode, focus on editButton\n if (!this.state.appendMode) {\n const editButton = document.getElementById(\n HtmlElementId.editButton\n );\n if (editButton) {\n editButton.focus();\n }\n }\n }\n );\n }\n };\n\n onAppendMode = (scrollDown = true, closeEdit = true, focus = true) => {\n if (!this.state.appendMode) {\n if (closeEdit) {\n this.setState({\n editMode: false,\n });\n }\n this.setState(\n {\n appendMode: true,\n },\n () => {\n if (scrollDown) {\n this.scrollToBottom();\n }\n if (focus) {\n const appendTextArea = document.getElementById(\n HtmlElementId.appendTextArea\n );\n if (appendTextArea) {\n appendTextArea.focus();\n if (this.state.editingMode === EditingModes.useCodeMirror) {\n this.configureCodeMirror(HtmlElementId.appendTextArea);\n }\n }\n }\n }\n );\n } else if (this.state.appendMode) {\n if (this.state.appendCodeMirror) {\n this.state.appendCodeMirror.toTextArea();\n }\n this.setState(\n {\n appendMode: false,\n },\n () => {\n if (this.state.editingMode === EditingModes.useMonacoEditor) {\n this.refreshEdit();\n }\n if (focus) {\n const appendButton = document.getElementById(\n HtmlElementId.appendButton\n );\n if (appendButton) {\n appendButton.focus();\n }\n }\n }\n );\n }\n };\n\n onViewMode = () => {\n if (!this.state.viewMode) {\n this.setState(\n {\n viewMode: true,\n },\n () => {\n if (this.state.editingMode === EditingModes.useMonacoEditor) {\n this.refreshEdit();\n }\n if (this.state.appendMode && !this.state.editMode) {\n this.skipToBottom();\n }\n }\n );\n }\n if (this.state.viewMode) {\n this.setState(\n {\n viewMode: false,\n },\n () => {\n if (this.state.editingMode === EditingModes.useMonacoEditor) {\n this.refreshEdit();\n }\n if (!this.state.editMode && !this.state.appendMode) {\n this.onEditMode();\n }\n }\n );\n }\n };\n\n toggleShowHelp = () => {\n if (!this.state.showHelp) {\n this.setState(\n {\n showHelp: true,\n },\n () => {\n if (!this.state.viewMode) {\n this.onViewMode();\n } else if (this.state.viewMode) {\n this.refreshView();\n }\n const helpButton = document.getElementById(HtmlElementId.helpButton);\n if (helpButton) {\n helpButton.focus();\n }\n setTimeout(() => {\n this.scrollToTop();\n }, 50);\n }\n );\n } else {\n this.setState(\n {\n showHelp: false,\n },\n () => {\n this.refreshView();\n const helpButton = document.getElementById(HtmlElementId.helpButton);\n if (helpButton) {\n helpButton.focus();\n }\n }\n );\n }\n };\n\n toggleShowMenu = () => {\n this.setState(\n {\n showMenu: !this.state.showMenu,\n },\n () => {\n const menuButton = document.getElementById(HtmlElementId.menuButton);\n if (menuButton) {\n menuButton.focus();\n }\n }\n );\n };\n\n loadDefaultMenuState = () => {\n this.setState({\n showMenuOptionsEdit: false,\n showMenuOptionsShare: true,\n showMenuOptionsView: true,\n });\n };\n\n toggleShowMenuOptionsEdit = () => {\n this.setState({ showMenuOptionsEdit: !this.state.showMenuOptionsEdit });\n };\n\n toggleShowMenuOptionsShare = () => {\n this.setState({ showMenuOptionsShare: !this.state.showMenuOptionsShare });\n };\n\n toggleShowMenuOptionsView = () => {\n this.setState({ showMenuOptionsView: !this.state.showMenuOptionsView });\n };\n\n toggleBorderlessMode = () => {\n this.setState(\n {\n borderlessMode: !this.state.borderlessMode,\n },\n () => {\n this.activateFixedHeader();\n this.saveMenuOptions();\n }\n );\n };\n\n toggleFixedHeightMode = () => {\n this.setState(\n {\n fixedHeightMode: !this.state.fixedHeightMode,\n },\n () => {\n this.activateFixedHeader();\n this.saveMenuOptions();\n }\n );\n };\n\n toggleFullWidthMode = () => {\n this.setState(\n {\n fullWidthMode: !this.state.fullWidthMode,\n },\n () => {\n this.activateFixedHeader();\n this.saveMenuOptions();\n }\n );\n };\n\n toggleOverflowMode = () => {\n this.setState(\n {\n overflowMode: !this.state.overflowMode,\n },\n () => {\n this.activateFixedHeader();\n this.saveMenuOptions();\n }\n );\n };\n\n saveMenuOptions = () => {\n let currentMenuOptions: menuOptions;\n currentMenuOptions = {\n borderlessMode: this.state.borderlessMode,\n fixedHeightMode: this.state.fixedHeightMode,\n fullWidthMode: this.state.fullWidthMode,\n overflowMode: this.state.overflowMode,\n /**These are turned off to prevent excess re-rendering of the note when opening/closing the menu */\n //showMenuOptionsEdit: this.state.showMenuOptionsEdit,\n //showMenuOptionsShare: this.state.showMenuOptionsShare,\n //showMenuOptionsView: this.state.showMenuOptionsView,\n };\n this.saveEditorOption('menuOptions', JSON.stringify(currentMenuOptions));\n };\n\n saveEditorOption = (\n optionKey: string,\n optionValue: string | boolean | undefined\n ) => {\n this.setState(\n {\n savingEditorOptions: true,\n },\n () => {\n try {\n this.editorKit.internal.componentManager.setComponentDataValueForKey(\n optionKey,\n optionValue\n );\n /** this.configureEditorKit() is triggered\n * every time setComponentDataValueForKey is triggered, but\n * savingEditorOptions prevents the callback from triggering.\n * Then, after the timeout, the new default settings or options can\n * take into effect immediately.\n * However, if you switch the note within the timeout, you will get an error.\n * I have tried 150 and 200 but they both are not long enough. 250 is short enough\n * to work, but not long enough to be easily noticeable.\n * We do not load editor options because they are optional and persist through\n * this.configureEditorKit().\n * */\n setTimeout(() => {\n this.setState(\n {\n savingEditorOptions: false,\n },\n () => {\n this.loadDefaultSettings();\n this.loadMetaData();\n }\n );\n }, 250);\n } catch (error) {\n console.log(\n 'Error saving editor option. Your optionKey:',\n optionKey,\n '\\n - Your optionValue: ',\n optionValue,\n '\\n - The error: ',\n error\n );\n this.setState(\n {\n savingEditorOptions: false,\n },\n () => {\n /** We use refreshEditor() if there's an error (such as in the demo)\n * But not in the actual editor because loadDefaultSettings and loadMetaData\n * will run refreshEditor() twice, and if there's no issue saving editor options,\n * then there's probably no issue loading default settings and metadata.\n * */\n this.refreshEditor();\n this.loadDefaultSettings();\n this.loadMetaData();\n }\n );\n }\n }\n );\n };\n\n onSettingsMode = () => {\n // Here we save the current state. We reload the current state if we cancel and after we save\n if (!this.state.settingsMode) {\n this.removeFixedHeader();\n this.setState(\n {\n currentState: this.state,\n },\n () => {\n /** Turn everything off and turn Settings on */\n this.setState(\n {\n appendMode: false,\n editMode: false,\n fullWidthMode: false,\n fixedHeightMode: false,\n settingsMode: true,\n showAppendix: false, // Hides the scroll up/down buttons\n showHeader: false,\n showMenu: false,\n viewMode: false,\n },\n () => {\n const undoDialog = document.getElementById('undoDialog');\n if (undoDialog) {\n undoDialog.focus();\n }\n }\n );\n }\n );\n } else if (this.state.settingsMode) {\n this.setState(\n {\n ...this.state.currentState,\n settingsMode: false,\n },\n () => {\n this.refreshEdit();\n const settingsButton = document.getElementById(\n HtmlElementId.settingsButton\n );\n if (settingsButton) {\n settingsButton.focus();\n }\n }\n );\n }\n };\n\n /** Restore current state but change the items that are saved from the Settings.\n * It's important to restore the current state to restore items that were turned off, such as\n * fixedHeight and fullWidth.\n */\n onSaveSettings = ({\n customStyles,\n editingMode,\n fontEdit,\n fontSize,\n fontView,\n monacoEditorLanguage,\n saveAsDefault,\n }: SaveSettingsInterface) => {\n this.setState(\n {\n ...this.state.currentState,\n customStyles,\n editingMode,\n fontEdit,\n fontSize,\n fontView,\n monacoEditorLanguage,\n showAppendix: true,\n showHeader: true,\n settingsMode: false,\n },\n () => {\n this.refreshEditor();\n const settingsButton = document.getElementById(\n HtmlElementId.settingsButton\n );\n if (settingsButton) {\n settingsButton.focus();\n }\n }\n );\n let note = this.editorKit.internal.note;\n if (note) {\n if (debugMode) {\n console.log(\n 'AppendEditor.tsx: \\n - onSaveSettings() this.editorKit.internal.componentManager.saveItemWithPresave() triggered'\n );\n }\n this.editorKit.internal.componentManager.saveItemWithPresave(note, () => {\n note.content.appendEditorCustomStyles = customStyles;\n note.content.appendEditorEditingMode = editingMode;\n note.content.appendEditorFontEdit = fontEdit;\n note.content.appendEditorFontSize = fontSize;\n note.content.appendEditorFontView = fontView;\n note.content.appendEditorMonacoEditorLanguage = monacoEditorLanguage;\n });\n if (debugMode) {\n console.log(\n 'AppendEditor.tsx: \\n - onSaveSettings() this.editorKit.internal.componentManager.saveItemWithPresave() completed'\n );\n }\n }\n if (saveAsDefault) {\n this.setState(\n {\n defaultSettings: {\n customStyles,\n editingMode,\n fontEdit,\n fontSize,\n fontView,\n monacoEditorLanguage,\n },\n },\n () => {\n if (debugMode) {\n console.log(\n 'AppendEditor.tsx: \\n - onSaveSettings() this.state.savingEditorOptions: ' +\n this.state.savingEditorOptions +\n '\\n JSON.stringify(this.state.defaultSettings):',\n JSON.stringify(this.state.defaultSettings)\n );\n }\n this.saveEditorOption(\n 'defaultSettings',\n JSON.stringify(this.state.defaultSettings)\n );\n }\n );\n }\n };\n\n activateStyles = () => {\n if (debugMode) {\n console.log('AppendEditor.tsx: \\n - this.activateStyles() triggered');\n }\n const sheetToBeRemoved = document.getElementById('customStyleSheet');\n if (sheetToBeRemoved) {\n const sheetParent = sheetToBeRemoved.parentNode;\n if (sheetParent) {\n sheetParent.removeChild(sheetToBeRemoved);\n }\n }\n // Follow the order that appears in the Settings to make the Settings cascade\n let fontSizeStyle = '';\n if (this.state.fontSize) {\n fontSizeStyle =\n '.CodeMirror, .DynamicEditor, .MonacoEditorContainer, .ProseMirror, #editTextArea, #appendTextArea, #renderedNote {font-size: ' +\n this.state.fontSize +\n ';}\\n';\n }\n let fontEditStyle = '';\n if (this.state.fontEdit) {\n fontEditStyle =\n '.CodeMirror, .DynamicEditor, .ProseMirror, #editTextArea, #appendTextArea {font-family: ' +\n this.state.fontEdit +\n ';}\\n';\n }\n let fontViewStyle = '';\n if (this.state.fontView) {\n fontViewStyle =\n '#renderedNote {font-family: ' + this.state.fontView + ';}\\n';\n }\n if (\n this.state.customStyles ||\n this.state.fontEdit ||\n this.state.fontSize ||\n this.state.fontView\n ) {\n const sheet = document.createElement('style');\n sheet.setAttribute('id', 'customStyleSheet');\n // Follow the order that appears in the Settings to make the Settings cascade\n sheet.innerHTML =\n fontSizeStyle + fontEditStyle + fontViewStyle + this.state.customStyles;\n document.body.appendChild(sheet);\n }\n };\n\n onCancelPrint = () => {\n this.setState(\n {\n confirmPrintUrl: false,\n },\n () => {\n const printButton = document.getElementById(HtmlElementId.printButton);\n if (printButton) {\n printButton.focus();\n }\n }\n );\n };\n\n onConfirmPrintUrl = () => {\n this.setState(\n {\n confirmPrintUrl: true,\n },\n () => {\n const undoDialog = document.getElementById('undoDialog');\n if (undoDialog) {\n undoDialog.focus();\n }\n }\n );\n };\n\n onPrintUrlTrue = () => {\n this.setState(\n {\n confirmPrintUrl: false,\n printURL: true,\n },\n () => {\n this.printRenderedHtml();\n }\n );\n };\n\n onPrintUrlFalse = () => {\n this.setState(\n {\n confirmPrintUrl: false,\n printURL: false,\n },\n () => {\n this.printRenderedHtml();\n }\n );\n };\n\n printRenderedHtml = () => {\n window.print();\n const printButton = document.getElementById(HtmlElementId.printButton);\n if (printButton) {\n printButton.focus();\n }\n };\n\n goDown = () => {\n document.body.scrollTop = 10000000; // for Safari\n if (this.state.editMode) {\n const editTextArea = document.getElementById(HtmlElementId.editTextArea);\n if (editTextArea) {\n editTextArea.scrollTop = 10000000;\n }\n }\n if (this.state.appendMode) {\n const appendTextArea = document.getElementById(\n HtmlElementId.appendTextArea\n );\n if (appendTextArea) {\n appendTextArea.scrollTop = 10000000;\n }\n }\n if (this.state.fixedHeightMode) {\n const view = document.getElementById(HtmlElementId.view);\n if (view) {\n view.scrollTop = 10000000;\n }\n /** Need edit for Dynamic */\n const edit = document.getElementById(HtmlElementId.edit);\n if (edit) {\n edit.scrollTop = 10000000;\n }\n }\n /** Scroll down for CodeMirror */\n const codeMirrorList = document.getElementsByClassName(\n 'CodeMirror-vscrollbar'\n );\n const codeMirrorEditMode = codeMirrorList[0];\n if (codeMirrorEditMode) {\n codeMirrorEditMode.scrollTop = 10000000;\n }\n };\n\n scrollToBottom = () => {\n this.goDown();\n const appendix = document.getElementById(HtmlElementId.appendix);\n if (appendix) {\n appendix.scrollIntoView({\n behavior: 'smooth',\n block: 'end', // Bottom\n inline: 'nearest',\n });\n }\n };\n\n // Skip to Bottom is fast \"auto\" behavior instead of \"smooth\" behavior\n skipToBottom = () => {\n this.goDown();\n const appendix = document.getElementById(HtmlElementId.appendix);\n if (appendix) {\n appendix.scrollIntoView({\n behavior: 'auto',\n block: 'end', // Bottom\n inline: 'nearest',\n });\n }\n };\n\n goUp = () => {\n document.body.scrollTop = 0; // for Safari\n if (this.state.editMode) {\n const editTextArea = document.getElementById(HtmlElementId.editTextArea);\n if (editTextArea) {\n editTextArea.scrollTop = 0;\n }\n }\n if (this.state.appendMode) {\n const appendTextArea = document.getElementById(\n HtmlElementId.appendTextArea\n );\n if (appendTextArea) {\n appendTextArea.scrollTop = 0;\n }\n }\n if (this.state.fixedHeightMode) {\n const view = document.getElementById(HtmlElementId.view);\n if (view) {\n view.scrollTop = 0;\n }\n /** Need edit for Dynamic */\n const edit = document.getElementById(HtmlElementId.edit);\n if (edit) {\n edit.scrollTop = 0;\n }\n }\n /** Scroll up for CodeMirror */\n const codeMirrorList = document.getElementsByClassName(\n 'CodeMirror-vscrollbar'\n );\n const codeMirrorEditMode = codeMirrorList[0];\n if (codeMirrorEditMode) {\n codeMirrorEditMode.scrollTop = 0;\n }\n };\n\n scrollToTop = () => {\n this.goUp();\n const top = document.getElementById('top');\n if (top) {\n top.scrollIntoView({\n behavior: 'smooth',\n block: 'start', // Top\n inline: 'nearest',\n });\n }\n };\n\n // Need both content and appendix for mobile\n // Skip to Bottom is fast \"auto\" behavior instead of \"smooth\" behavior\n skipToTop = () => {\n this.goUp();\n const top = document.getElementById('top');\n if (top) {\n top.scrollIntoView({\n behavior: 'auto',\n block: 'start', // Top\n inline: 'nearest',\n });\n }\n };\n\n onKeyDown = (e: React.KeyboardEvent | KeyboardEvent) => {\n keyMap.set(e.key, true);\n // Click the top Append if 'Control' and 'e' are pressed\n if (keyMap.get('Control') && keyMap.get('e')) {\n e.preventDefault();\n this.onEditMode();\n }\n // Click the top Append if 'Control' and 'u' are pressed\n else if (\n keyMap.get('Control') &&\n !keyMap.get('Alt') &&\n (keyMap.get('u') || keyMap.get('m'))\n ) {\n e.preventDefault();\n this.onAppendMode();\n }\n // Click view if 'Control' and 'p' are pressed\n else if (keyMap.get('Control') && !keyMap.get('Alt') && keyMap.get('p')) {\n e.preventDefault();\n this.onViewMode();\n } else if (keyMap.get('Control') && keyMap.get('.')) {\n e.preventDefault();\n this.setState({\n appendRows: this.state.appendRows + 1,\n });\n } else if (keyMap.get('Control') && keyMap.get(',')) {\n e.preventDefault();\n if (this.state.appendRows > 5) {\n this.setState({\n appendRows: this.state.appendRows - 1,\n });\n }\n } else if (keyMap.get('Control') && keyMap.get('<')) {\n // Edit only mode\n e.preventDefault();\n this.setState(\n {\n appendMode: false,\n editMode: false,\n viewMode: false,\n },\n () => {\n this.onEditMode();\n }\n );\n } else if (keyMap.get('Control') && keyMap.get('>')) {\n // Append only mode\n e.preventDefault();\n this.setState(\n {\n appendMode: false,\n editMode: false,\n viewMode: false,\n },\n () => {\n this.onAppendMode();\n }\n );\n } else if (keyMap.get('Control') && keyMap.get('[')) {\n e.preventDefault();\n this.skipToTop();\n } else if (keyMap.get('Control') && keyMap.get(']')) {\n e.preventDefault();\n this.skipToBottom();\n } else if (\n keyMap.get('Control') &&\n !keyMap.get('Alt') &&\n !keyMap.get('Shift') &&\n keyMap.get('w')\n ) {\n keyMap.delete('w');\n }\n };\n\n onKeyDownAppendTextArea = (e: React.KeyboardEvent | KeyboardEvent) => {\n // Close Append Mode if 'Escape' is pressed\n if (keyMap.get('Escape')) {\n e.preventDefault();\n keyMap.delete('Escape');\n this.onAppendMode();\n }\n // Save note if Control and Enter are pressed\n else if (keyMap.get('Control') && keyMap.get('Enter')) {\n e.preventDefault();\n if (this.state.editingMode === EditingModes.useCodeMirror) {\n this.appendTextToNote();\n }\n }\n // Save note if Control and S are pressed\n else if (keyMap.get('Control') && keyMap.get('s')) {\n e.preventDefault();\n if (this.state.editingMode === EditingModes.useCodeMirror) {\n this.appendTextToNote();\n }\n }\n // Toggle Append New Line if Ctrl + Alt + N are pressed\n else if (\n keyMap.get('Control') &&\n !keyMap.get('Shift') &&\n keyMap.get('Alt') &&\n keyMap.get('n')\n ) {\n e.preventDefault();\n const newLine = document.getElementById(HtmlElementId.newLine);\n if (newLine) {\n newLine.click();\n }\n }\n // Toggle Append New Line if Ctrl + Alt + P are pressed\n else if (\n keyMap.get('Control') &&\n !keyMap.get('Shift') &&\n keyMap.get('Alt') &&\n keyMap.get('p')\n ) {\n e.preventDefault();\n const newParagraph = document.getElementById(HtmlElementId.newParagraph);\n if (newParagraph) {\n newParagraph.click();\n }\n }\n };\n\n onKeyDownEditTextArea = (e: React.KeyboardEvent | KeyboardEvent) => {\n // Close EditMode if 'Escape' is pressed\n if (keyMap.get('Escape')) {\n e.preventDefault();\n keyMap.set('Escape', false);\n this.onEditMode();\n }\n };\n\n onKeyDownTextArea = (e: React.KeyboardEvent | KeyboardEvent) => {\n // Add two spaces and line break if Shift and Enter are pressed\n if (keyMap.get('Shift') && keyMap.get('Enter')) {\n e.preventDefault();\n document.execCommand('insertText', false, ' \\n');\n }\n // Add two stars if Control + b are pressed\n else if (keyMap.get('Control') && keyMap.get('b')) {\n e.preventDefault();\n document.execCommand('insertText', false, '**');\n }\n // Add header when pressing Control + H\n else if (keyMap.get('Control') && keyMap.get('h')) {\n e.preventDefault();\n document.execCommand('insertText', false, '#');\n }\n // Add image code if Control + Alt and i are pressed\n else if (keyMap.get('Control') && keyMap.get('Alt') && keyMap.get('i')) {\n e.preventDefault();\n document.execCommand('insertText', false, '![]()');\n }\n // Add one stars if Control + i is pressed\n else if (keyMap.get('Control') && keyMap.get('i')) {\n e.preventDefault();\n document.execCommand('insertText', false, '*');\n }\n // Add inline code if Control + Alt and k are pressed\n else if (keyMap.get('Control') && keyMap.get('Alt') && keyMap.get('k')) {\n e.preventDefault();\n document.execCommand('insertText', false, '`');\n }\n // Add link if Control + k are pressed\n else if (keyMap.get('Control') && keyMap.get('k')) {\n e.preventDefault();\n document.execCommand('insertText', false, '[]()');\n }\n // Add ordered list item if Control + Alt + l are pressed\n else if (keyMap.get('Control') && keyMap.get('Alt') && keyMap.get('l')) {\n e.preventDefault();\n document.execCommand('insertText', false, '\\n1. ');\n }\n // Add unordered list item if Control + l are pressed\n else if (keyMap.get('Control') && keyMap.get('l')) {\n e.preventDefault();\n document.execCommand('insertText', false, '\\n- ');\n }\n // Add strike through if Control + Alt + u are pressed\n else if (keyMap.get('Control') && keyMap.get('Alt') && keyMap.get('u')) {\n e.preventDefault();\n document.execCommand('insertText', false, '~~');\n }\n // Add quote Control + q, Control + ' or Control + \" are pressed\n else if (\n (keyMap.get('Control') && keyMap.get('q')) ||\n (keyMap.get('Control') && keyMap.get(\"'\")) ||\n (keyMap.get('Control') && keyMap.get('\"'))\n ) {\n e.preventDefault();\n document.execCommand('insertText', false, '\\n> ');\n }\n };\n\n onKeyUp = (e: React.KeyboardEvent | KeyboardEvent) => {\n keyMap.delete(e.key);\n };\n\n onBlur = (e: React.FocusEvent) => {\n keyMap.clear();\n };\n\n onScroll = (e: Event) => {\n if (!this.state.settingsMode) {\n if (window.scrollY < last_known_scroll_position) {\n // If scrolling up, fix header\n this.activateFixedHeader();\n } else if (\n // If scrolling down, unfix header\n window.scrollY > last_known_scroll_position &&\n !this.state.showMenu\n ) {\n this.removeFixedHeader();\n }\n last_known_scroll_position = window.scrollY;\n }\n };\n\n activateFixedHeader = () => {\n const header = document.getElementById(HtmlElementId.header);\n const content = document.getElementById(HtmlElementId.content);\n // Activate only if we have both\n if (header && content) {\n header.classList.add(HtmlClassName.fixed);\n content.classList.add(HtmlClassName.fixedHeader);\n }\n };\n\n removeFixedHeader = () => {\n const header = document.getElementById(HtmlElementId.header);\n const content = document.getElementById(HtmlElementId.content);\n /** Remove both even if you don't have both\n * This is needed for loading settings\n */\n if (header) {\n header.classList.remove(HtmlClassName.fixed);\n }\n if (content) {\n content.classList.remove(HtmlClassName.fixedHeader);\n }\n };\n\n render() {\n return [\n ,\n \n {this.state.showHeader && [\n
\n
\n \n \n \n \n \n \n this.onAppendMode()}\n title=\"Toggle Append Mode\"\n className={\n 'sk-button ' + (this.state.appendMode ? 'on' : 'off')\n }\n >\n \n \n
\n \n \n \n
\n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
,\n ]}\n \n {this.state.showMenu && (\n \n \n \n )}\n {this.state.settingsMode && (\n \n \n \n )}\n {this.state.editMode && !this.state.refreshEdit && (\n \n \n \n )}\n {this.state.editMode && this.state.refreshEdit && (\n \n \n \n )}\n {this.state.viewMode && !this.state.refreshView && (\n \n \n \n )}\n {this.state.viewMode && this.state.refreshView && (\n \n \n \n )}\n {this.state.confirmPrintUrl && (\n \n {' '}\n \n )}\n\n {this.state.showDiff && [\n \n \n ,\n ]}\n \n {this.state.showAppendix && [\n \n {this.state.appendMode && (\n \n \n \n )}\n \n
\n \n \n
\n \n ,\n ]}\n ,\n ];\n }\n}\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.scss';\nimport * as serviceWorker from './serviceWorker';\nimport reportWebVitals from './reportWebVitals';\n\nimport AppendEditor from './components/AppendEditor';\nimport './stylesheets/main.scss';\nReactDOM.render(\n \n \n ,\n document.getElementById('root')\n);\n\n// If you want your app to work offline and load faster, you can change\n// unregister() to register() below. Note this comes with some pitfalls.\n// Learn more about service workers: https://bit.ly/CRA-PWA\nserviceWorker.unregister();\n\n// If you want to start measuring performance in your app, pass a function\n// to log results (for example: reportWebVitals(console.log))\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\nreportWebVitals();\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["serviceWorker.ts","reportWebVitals.ts","components/Icons.tsx","components/PrintDialog.tsx","components/Monaco.tsx","components/DynamicEditor.tsx","components/EditNote.tsx","lib/clickButton.ts","components/Help.tsx","components/Intro.tsx","lib/renderMarkdown.ts","components/ViewNote.tsx","components/AppendText.tsx","components/Buttons.tsx","components/Menu.tsx","components/Settings.tsx","components/ErrorBoundary.tsx","components/AppendEditor.tsx","index.tsx"],"names":["Boolean","window","location","hostname","match","reportWebVitals","onPerfEntry","Function","then","getCLS","getFID","getFCP","getLCP","getTTFB","infoColor","foregroundColor","ChevronIconDown","fill","role","className","aria-label","width","height","viewBox","xmlns","d","ChevronIconRight","CloseIcon","CopyIcon","EyeIcon","condition","GearIcon","HelpIcon","MenuIcon","PencilIcon","PlusIcon","fill-rule","clip-rule","PrintIcon","RefreshIcon","UndoIcon","PrintDialog","cancelText","confirmText","helpLink","onCancel","onConfirm","onUndo","title","id","onClick","href","target","rel","MonacoEditorContainerID","MonacoDiffEditorContainerID","self","MonacoEnvironment","getWorkerUrl","_moduleId","label","MonacoEditor","editor","fontSize","language","saveText","tabSize","text","theme","viewMode","divEl","useRef","scrollBeyondLastLine","useEffect","current","monaco","create","parseInt","replace","value","join","autoClosingOvertype","formatOnPaste","formatOnType","wordWrap","wrappingStrategy","onKeyDown","e","keyCode","console","log","code","ctrlKey","preventDefault","onKeyUp","onDidChangeModelContent","getValue","dispose","ref","MonacoDiffEditor","diffEditor","modifiedText","originalModel","createModel","modifiedModel","createDiffEditor","originalEditable","readOnly","setModel","original","modified","onDidChangeContent","YouTubeEmbed","videoId","this","props","attrs","matches","isSelected","src","React","DynamicEditor","handleToggleReadOnly","setState","state","handleChange","debounce","debugMode","onChange","template","undefined","placeholder","readOnlyWriteCheckboxes","defaultValue","scrollTo","hash","autoFocus","embeds","keywords","icon","alt","matcher","url","component","EditNote","handleInputChange","event","onKeyDownEditTextArea","onKeyDownTextArea","keyMap","delete","key","editingMode","EditingModes","useMonacoEditor","useDynamicEditor","HtmlElementId","edit","monacoEditorLanguage","editTextArea","name","rows","spellCheck","Component","defaultProps","clickAppendButton","appendButton","document","getElementById","click","clickEditButton","editButton","clickHelpButton","helpButton","clickMenuButton","menuButton","clickSettingsButton","settingsButton","clickViewButton","viewButton","Help","onToggleShowFeelings","showFeelings","onToggleShowMoreQuestions","showMoreQuestions","onToggleShowFeedback","showFeedback","onToggle","Intro","appendMode","editMode","showHelp","gfm","require","breaks","math","rehypeKatex","highlight","emoji","externalLinks","toc","footnotes","slug","raw","processor","unified","use","parse","maxDepth","inlineNotes","remark2rehype","allowDangerousHtml","ignoreMissing","rehype2react","createElement","processMarkdown","processSync","result","isLongString","throttle","length","renderLongMarkdown","ViewNote","onToggleShowHelp","renderMarkdown","bypassDebounce","printURL","view","AppendText","type","checked","autoSaveCheckBoxes","handleTextAreaChange","autoSaveAppendText","appendTextToNote","appendTextArea","focus","newLine","newParagraph","set","get","onKeyDownAppendTextArea","appendNewLine","appendNewParagraph","appendRows","HtmlClassName","ChevronToggleButton","caption","CopyButton","EyeButton","messageOn","messageOff","PencilButton","PrintButton","UndoButton","editingModeID","fontEditID","fontSizeID","fontViewID","monacoEditorLanguageID","resetAllSettingsID","saveAsDefaultID","startRegExp","RegExp","cssRegExp","endRegExp","codeRegExp","Settings","handleSelectChange","toggleShowCustomStyles","showCustomStyles","cleanCustomStyles","customStyles","handleSubmit","fontEditMessage","fontViewMessage","fontEdit","fontView","saveAsDefault","loadDefaultSettings","defaultSettings","refreshCustomStyles","clearCustomStyles","clearFontEdit","clearFontSize","clearFontView","clearEditingMode","usePlainText","clearMonacoEditorLanguage","clearSaveAsDefault","clearAllSettings","resetAllSettings","onBlur","clear","componentWillUnmount","useCodeMirror","htmlFor","list","ErrorBoundary","hasError","error","errorInfo","message","children","Menu","clearTooltipTimer","resetMessageTimer","clearTimeout","setTimeout","displayMessageEdit","displayMessageShare","showMessageEdit","showMessageShare","copyToClipboard","textField","body","appendChild","select","execCommand","remove","copyText","copyHtml","renderedNote","firstElementChild","innerHTML","formatText","formattedText","prettier","format","parser","plugins","parserMarkdown","refreshEdit","refreshView","uncheckBoxes","checkedBoxes","test","newText","toggleShowMenu","chevronToggleButton","showMenuOptionsView","toggleShowMenuOptionsView","borderlessMode","on","off","toggleBorderlessMode","fixedHeightMode","toggleFixedHeightMode","fullWidthMode","toggleFullWidthMode","overflowMode","toggleOverflowMode","showMenuOptionsShare","toggleShowMenuOptionsShare","printButton","onConfirmPrintUrl","showMenuOptionsEdit","toggleShowMenuOptionsEdit","initialState","appendText","confirmPrintUrl","showAppendix","showHeader","showDiff","settingsMode","last_known_scroll_position","Map","AppendEditor","editorKit","refreshEditorTimer","saveTimer","componentDidMount","onViewMode","loadDefaultMenuState","addEventListener","onScroll","removeEventListener","configureEditorKit","delegate","EditorKitDelegate","setEditorRawText","cancel","flush","savingEditorOptions","loadEditorOptions","loadMetaData","clearUndoHistory","getElementsBySelector","EditorKit","mode","supportsFilesafe","refreshEditor","activateStyles","defaultSettingsString","internal","componentManager","componentDataValueForKey","defaultEditingMode","defaultSettingsObject","JSON","defaultCustomStyles","defaultFontEdit","defaultFontSize","defaultFontView","defaultMonacoEditorLanguage","menuOptionsString","menuOptionsObject","streamContextItem","note","content","appendEditorCustomStyles","appendEditorEditingMode","appendEditorFontEdit","appendEditorFontSize","appendEditorFontView","appendEditorMonacoEditorLanguage","onEditMode","saveNote","scrollY","scrollTop","refreshedView","onEditorValueChanged","textToAppend","concat","saveItemWithPresave","skipToBottom","appendCodeMirror","setValue","configureCodeMirror","editCodeMirror","CodeMirror","fromTextArea","autocorrect","autocapitalize","extraKeys","Enter","lineNumbers","lineWrapping","spellcheck","styleSelectedText","tabindex","setSize","editCodeMirrorText","save","cm","appendCodeMirrorText","makeContentEditable","setAttribute","appendix","appendCustom","removeContentEditable","container","toTextArea","onAppendMode","scrollDown","closeEdit","scrollToBottom","toggleShowHelp","scrollToTop","showMenu","activateFixedHeader","saveMenuOptions","currentMenuOptions","saveEditorOption","stringify","optionKey","optionValue","setComponentDataValueForKey","onSettingsMode","currentState","removeFixedHeader","undoDialog","onSaveSettings","sheetToBeRemoved","sheetParent","parentNode","removeChild","fontSizeStyle","fontEditStyle","fontViewStyle","sheet","onCancelPrint","onPrintUrlTrue","printRenderedHtml","onPrintUrlFalse","print","goDown","codeMirrorEditMode","getElementsByClassName","scrollIntoView","behavior","block","inline","goUp","top","skipToTop","header","classList","add","fixed","fixedHeader","tabIndex","ReactDOM","render","StrictMode","navigator","serviceWorker","ready","registration","unregister","catch"],"mappings":"0MAYoBA,QACW,cAA7BC,OAAOC,SAASC,UAEe,UAA7BF,OAAOC,SAASC,UAEhBF,OAAOC,SAASC,SAASC,MACvB,2DChBN,IAYeC,EAZS,SAACC,GACnBA,GAAeA,aAAuBC,UACxC,gCAAqBC,MAAK,YAAkD,IAA/CC,EAA8C,EAA9CA,OAAQC,EAAsC,EAAtCA,OAAQC,EAA8B,EAA9BA,OAAQC,EAAsB,EAAtBA,OAAQC,EAAc,EAAdA,QAC3DJ,EAAOH,GAC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mBiV,WACrBA,UAAUC,cAAcC,MACrBnf,MAAK,SAACof,GACLA,EAAaC,gBAEdC,OAAM,SAAClN,GACNnN,QAAQmN,MAAMA,EAAME,YkBvH5BzS,K","file":"static/js/main.cf56b8e1.chunk.js","sourcesContent":["// This optional code is used to register a service worker.\n// register() is not called by default.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on subsequent visits to a page, after all the\n// existing tabs open on the page have been closed, since previously cached\n// resources are updated in the background.\n\n// To learn more about the benefits of this model and instructions on how to\n// opt-in, read https://bit.ly/CRA-PWA\n\nconst isLocalhost = Boolean(\n window.location.hostname === 'localhost' ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === '[::1]' ||\n // 127.0.0.0/8 are considered localhost for IPv4.\n window.location.hostname.match(\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\n )\n);\n\ntype Config = {\n onSuccess?: (registration: ServiceWorkerRegistration) => void;\n onUpdate?: (registration: ServiceWorkerRegistration) => void;\n};\n\nexport function register(config?: Config) {\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n // The URL constructor is available in all browsers that support SW.\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\n if (publicUrl.origin !== window.location.origin) {\n // Our service worker won't work if PUBLIC_URL is on a different origin\n // from what our page is served on. This might happen if a CDN is used to\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\n return;\n }\n\n window.addEventListener('load', () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\n\n if (isLocalhost) {\n // This is running on localhost. Let's check if a service worker still exists or not.\n checkValidServiceWorker(swUrl, config);\n\n // Add some additional logging to localhost, pointing developers to the\n // service worker/PWA documentation.\n navigator.serviceWorker.ready.then(() => {\n console.log(\n 'This web app is being served cache-first by a service ' +\n 'worker. To learn more, visit https://bit.ly/CRA-PWA'\n );\n });\n } else {\n // Is not localhost. Just register service worker\n registerValidSW(swUrl, config);\n }\n });\n }\n}\n\nfunction registerValidSW(swUrl: string, config?: Config) {\n navigator.serviceWorker\n .register(swUrl)\n .then((registration) => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n if (installingWorker == null) {\n return;\n }\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the updated precached content has been fetched,\n // but the previous service worker will still serve the older\n // content until all client tabs are closed.\n console.log(\n 'New content is available and will be used when all ' +\n 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'\n );\n\n // Execute callback\n if (config && config.onUpdate) {\n config.onUpdate(registration);\n }\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n console.log('Content is cached for offline use.');\n\n // Execute callback\n if (config && config.onSuccess) {\n config.onSuccess(registration);\n }\n }\n }\n };\n };\n })\n .catch((error) => {\n console.error('Error during service worker registration:', error);\n });\n}\n\nfunction checkValidServiceWorker(swUrl: string, config?: Config) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl, {\n headers: { 'Service-Worker': 'script' },\n })\n .then((response) => {\n // Ensure service worker exists, and that we really are getting a JS file.\n const contentType = response.headers.get('content-type');\n if (\n response.status === 404 ||\n (contentType != null && contentType.indexOf('javascript') === -1)\n ) {\n // No service worker found. Probably a different app. Reload the page.\n navigator.serviceWorker.ready.then((registration) => {\n registration.unregister().then(() => {\n window.location.reload();\n });\n });\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl, config);\n }\n })\n .catch(() => {\n console.log(\n 'No internet connection found. App is running in offline mode.'\n );\n });\n}\n\nexport function unregister() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready\n .then((registration) => {\n registration.unregister();\n })\n .catch((error) => {\n console.error(error.message);\n });\n }\n}\n","import { ReportHandler } from 'web-vitals';\n\nconst reportWebVitals = (onPerfEntry?: ReportHandler) => {\n if (onPerfEntry && onPerfEntry instanceof Function) {\n import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {\n getCLS(onPerfEntry);\n getFID(onPerfEntry);\n getFCP(onPerfEntry);\n getLCP(onPerfEntry);\n getTTFB(onPerfEntry);\n });\n }\n};\n\nexport default reportWebVitals;\n","import React from 'react';\n\nconst infoColor = 'var(--sn-stylekit-info-color)';\nconst foregroundColor = 'var(--sn-stylekit-foreground-color)';\n\ninterface Icons {\n condition?: boolean;\n fill?: string;\n role: string;\n}\n\nexport const ChevronIconDown: React.FC = ({ fill, role }) => (\n \n \n \n \n \n);\n\nexport const ChevronIconRight: React.FC = ({ fill, role }) => (\n \n \n \n \n \n);\n\nexport const CloseIcon: React.FC = ({ fill, role }) => (\n \n \n \n);\n\nexport const CopyIcon: React.FC = ({ fill, role }) => (\n \n \n \n);\n\nexport const EyeIcon: React.FC = ({ condition, fill, role }) => (\n \n \n \n);\n\nexport const GearIcon: React.FC = ({ condition, fill, role }) => (\n \n \n \n);\n\nexport const HelpIcon: React.FC = ({ condition, fill, role }) => (\n \n \n \n);\n\nexport const MenuIcon: React.FC = ({ condition, fill, role }) => (\n \n \n \n);\n\nexport const PencilIcon: React.FC = ({ condition, fill, role }) => (\n \n \n \n);\n\nexport const PlusIcon: React.FC = ({ condition, fill, role }) => (\n \n \n \n);\n\nexport const PrintIcon: React.FC = ({ fill, role }) => (\n \n \n \n);\n\nexport const RefreshIcon: React.FC = ({ fill, role }) => (\n \n \n \n);\n\nexport const UndoIcon: React.FC = ({ fill, role }) => (\n \n \n \n);\n","// import { Method } from '@testing-library/react';\nimport React from 'react';\nimport { CloseIcon } from './Icons';\n\ninterface PrintDialogTypes {\n cancelText: string;\n confirmText: string;\n helpLink: string;\n onCancel: () => void;\n onConfirm: () => void;\n onUndo: () => void;\n title: string;\n}\n\nconst PrintDialog: React.FC = ({\n cancelText,\n confirmText,\n helpLink,\n onCancel,\n onConfirm,\n onUndo,\n title,\n}) => (\n
\n
\n
\n
\n
\n

{title}

\n \n
\n

\n Need help deciding? Check out the{' '}\n \n documentation\n \n .\n

\n
\n
\n
\n
\n \n \n
\n
\n
\n
\n);\n\nexport default PrintDialog;\n","/**\n * This component is derived from the \"browser-esm-webpack-typescript-react\" found\n * at https://github.com/microsoft/monaco-editor-samples,\n * which is released under MIT, Copyright (c) 2016 Microsoft Corporation.\n * This modified version is released under AGPL-3.0 as indicated in the README.md\n * in the root directory. A copy of AGPL-3.0 is available there.\n * */\nimport React, { useRef, useEffect } from 'react';\nimport * as monaco from 'monaco-editor';\n\nconst debugMode = false;\nconst MonacoEditorContainerID = 'MonacoEditorContainer';\nconst MonacoDiffEditorContainerID = 'MonacoDiffEditorContainer';\n\n/*eslint no-restricted-globals: [\"error\", \"event\", \"monaco\"]*/\n// @ts-ignore\nself.MonacoEnvironment = {\n getWorkerUrl: function (_moduleId: any, label: string) {\n if (label === 'json') {\n return './json.worker.bundle.js';\n }\n if (label === 'css') {\n return './css.worker.bundle.js';\n }\n if (label === 'html') {\n return './html.worker.bundle.js';\n }\n if (label === 'typescript' || label === 'javascript') {\n return './ts.worker.bundle.js';\n }\n return './editor.worker.bundle.js';\n },\n};\n\nconst onKeyDown = (keyCode: string, debugMode = false) => {\n if (debugMode) {\n console.log('IKeyboardEvent Up: ' + keyCode);\n }\n};\n\nconst onKeyUp = (keyCode: string, debugMode = false) => {\n if (debugMode) {\n console.log('IKeyboardEvent Up: ' + keyCode);\n }\n};\n\ninterface MonacoEditorTypes {\n fontSize?: string;\n id?: string;\n language?: string;\n onKeyDown?: Function;\n onKeyUp?: Function;\n saveText?: Function;\n tabSize?: number;\n text: string;\n theme?: string;\n viewMode?: boolean;\n}\n\nexport const MonacoEditor: React.FC = ({\n fontSize = '16',\n id = MonacoEditorContainerID,\n language = 'markdown',\n saveText,\n tabSize = 2,\n text,\n theme = 'vs-dark',\n viewMode = false,\n}) => {\n const divEl = useRef(null);\n let editor: monaco.editor.IStandaloneCodeEditor;\n\n if (fontSize === '') {\n fontSize = '16px';\n }\n\n let scrollBeyondLastLine = true;\n if (viewMode) {\n scrollBeyondLastLine = false;\n }\n\n useEffect(() => {\n if (divEl.current) {\n editor = monaco.editor.create(divEl.current, {\n // These are variable: customizable by user or dependent on props\n fontSize: parseInt(fontSize.replace('px', '')),\n language: language,\n tabSize: tabSize,\n theme: theme,\n scrollBeyondLastLine: scrollBeyondLastLine,\n value: [text].join('\\n'),\n\n // These are not customizable\n autoClosingOvertype: 'auto',\n formatOnPaste: true,\n formatOnType: true,\n wordWrap: 'on',\n wrappingStrategy: 'advanced',\n });\n\n // Keyboard Events\n editor.onKeyDown((e: monaco.IKeyboardEvent) => {\n onKeyDown(e.code, debugMode);\n if (e.ctrlKey && e.code === 'KeyS') {\n e.preventDefault();\n }\n });\n editor.onKeyUp((e: monaco.IKeyboardEvent) => {\n onKeyUp(e.code, debugMode);\n });\n\n // Content Change Events\n editor.onDidChangeModelContent(\n (e: monaco.editor.IModelContentChangedEvent) => {\n if (saveText) {\n saveText(editor.getValue());\n }\n }\n );\n }\n return () => {\n editor.dispose();\n };\n }, []);\n return
;\n};\n\ninterface MonacoDiffEditorTypes extends MonacoEditorTypes {\n modifiedText: string;\n}\n\nexport const MonacoDiffEditor: React.FC = ({\n fontSize = '16',\n id = MonacoDiffEditorContainerID,\n language = 'markdown',\n saveText,\n text,\n modifiedText,\n theme = 'vs-dark',\n}) => {\n const divEl = useRef(null);\n let diffEditor: monaco.editor.IStandaloneDiffEditor;\n\n if (fontSize === '') {\n fontSize = '16px';\n }\n\n useEffect(() => {\n if (divEl.current) {\n const originalModel = monaco.editor.createModel(\n [text].join('\\n'),\n language\n );\n const modifiedModel = monaco.editor.createModel(\n [modifiedText].join('\\n'),\n language\n );\n\n diffEditor = monaco.editor.createDiffEditor(divEl.current, {\n // Same settings as above\n // These are variable: customizable by user or dependent on props\n fontSize: parseInt(fontSize.replace('px', '')),\n theme: theme,\n\n // These are not customizable\n autoClosingOvertype: 'auto',\n formatOnPaste: true,\n formatOnType: true,\n wordWrap: 'on',\n wrappingStrategy: 'advanced',\n\n // Specific to Diff Editor\n originalEditable: true, // for left panel\n readOnly: true, // for right panel\n });\n diffEditor.setModel({\n original: originalModel,\n modified: modifiedModel,\n });\n\n // Content Change Events\n originalModel.onDidChangeContent(\n (e: monaco.editor.IModelContentChangedEvent) => {\n if (saveText) {\n saveText(originalModel.getValue());\n }\n }\n );\n }\n return () => {\n diffEditor.dispose();\n };\n }, []);\n return (\n
\n );\n};\n","/**\n * This component is derived from the example found at\n * https://github.com/outline/rich-markdown-editor/blob/develop/example/src/index.js,\n * which is released under BSD-3 License, Copyright (c) 2020 General Outline,\n * Inc (https://www.getoutline.com/) and individual contributors.\n * This modified version is released under AGPL-3.0 as indicated in the README.md\n * in the root directory. A copy of AGPL-3.0 is available there.\n * */\n\nimport * as React from 'react';\nimport debounce from 'lodash/debounce';\nimport RichMarkdownEditor from 'rich-markdown-editor';\n\nclass YouTubeEmbed extends React.Component {\n render() {\n const { attrs } = this.props;\n const videoId = attrs.matches[1];\n\n return (\n \n );\n }\n}\n\ninterface DynamicProps {\n debugMode: boolean;\n onChange: (text: string) => void;\n readOnly: boolean;\n text: string;\n}\n\ninterface DynamicState {\n readOnly: boolean;\n template: boolean;\n value: undefined;\n}\n\nexport default class DynamicEditor extends React.Component<\n DynamicProps,\n DynamicState\n> {\n constructor(props: DynamicProps) {\n super(props);\n this.state = {\n readOnly: this.props.readOnly,\n template: false,\n value: undefined,\n };\n }\n\n handleToggleReadOnly = () => {\n this.setState({ readOnly: !this.state.readOnly });\n };\n\n handleChange = debounce((value) => {\n const text = value();\n if (this.props.debugMode) {\n console.log(text);\n }\n this.props.onChange(text);\n }, 50);\n\n render() {\n return (\n {\n if (this.props.debugMode) {\n console.log('Cancel triggered');\n }\n }}\n autoFocus\n onChange={(value) => this.handleChange(value)}\n embeds={[\n {\n title: 'YouTube',\n keywords: 'youtube video tube google',\n icon: () => (\n \n ),\n //@ts-ignore\n matcher: (url) => {\n return url.match(\n /(?:https?:\\/\\/)?(?:www\\.)?youtu\\.?be(?:\\.com)?\\/?.*(?:watch|embed)?(?:.*v=|v\\/|\\/)([a-zA-Z0-9_-]{11})$/i\n );\n },\n component: YouTubeEmbed,\n },\n ]}\n />\n );\n }\n}\n","import React from 'react';\nimport { EditingModes } from './AppendEditor';\nimport { MonacoEditor } from './Monaco';\nimport DynamicEditor from './DynamicEditor';\n\nimport { HtmlElementId } from './AppendEditor';\n\ninterface EditProps {\n debugMode: boolean;\n editingMode?: string;\n fontSize: string;\n keyMap: any;\n monacoEditorLanguage: string;\n onKeyDown: Function;\n onKeyUp: Function;\n onKeyDownEditTextArea: Function;\n onKeyDownTextArea: Function;\n saveText: Function;\n text: string;\n viewMode: boolean | undefined;\n}\n\ninterface EditState {\n text: string;\n}\n\nexport default class EditNote extends React.Component {\n static defaultProps = {\n // none\n };\n\n constructor(props: EditProps) {\n super(props);\n\n this.state = {\n text: this.props.text,\n };\n }\n\n handleInputChange = (event: React.ChangeEvent) => {\n const target = event.target;\n const value = target.value;\n\n this.setState(\n {\n text: value,\n },\n () => {\n this.props.saveText(this.state.text);\n }\n );\n };\n\n saveText = (text: string) => {\n this.setState(\n {\n text,\n },\n () => {\n this.props.saveText(this.state.text);\n }\n );\n };\n\n onKeyDown = (e: React.KeyboardEvent) => {\n this.props.onKeyDown(e);\n this.props.onKeyDownEditTextArea(e);\n this.props.onKeyDownTextArea(e);\n };\n\n onKeyUp = (event: React.KeyboardEvent) => {\n this.props.keyMap.delete(event.key);\n this.props.onKeyUp(event);\n };\n\n render() {\n const { text } = this.state;\n return (\n \n \n {this.props.editingMode === EditingModes.useMonacoEditor ? (\n \n ) : this.props.editingMode === EditingModes.useDynamicEditor ? (\n
\n \n
\n ) : (\n \n )}\n \n \n );\n }\n}\n","import { HtmlElementId } from '../components/AppendEditor';\n\nexport const clickAppendButton = () => {\n const appendButton = document.getElementById(HtmlElementId.appendButton);\n if (appendButton) {\n appendButton.click();\n }\n};\n\nexport const clickEditButton = () => {\n const editButton = document.getElementById(HtmlElementId.editButton);\n if (editButton) {\n editButton.click();\n }\n};\n\nexport const clickHelpButton = () => {\n const helpButton = document.getElementById(HtmlElementId.helpButton);\n if (helpButton) {\n helpButton.click();\n }\n};\n\nexport const clickMenuButton = () => {\n const menuButton = document.getElementById(HtmlElementId.menuButton);\n if (menuButton) {\n menuButton.click();\n }\n};\n\nexport const clickSettingsButton = () => {\n const settingsButton = document.getElementById(HtmlElementId.settingsButton);\n if (settingsButton) {\n settingsButton.click();\n }\n};\n\nexport const clickViewButton = () => {\n const viewButton = document.getElementById(HtmlElementId.viewButton);\n if (viewButton) {\n viewButton.click();\n }\n};\n","import React from 'react';\nimport { GearIcon, HelpIcon, MenuIcon } from './Icons';\nimport {\n clickHelpButton,\n clickMenuButton,\n clickSettingsButton,\n} from '../lib/clickButton';\n\ninterface HelpProps {\n debugMode: boolean;\n printURL: boolean;\n}\n\ninterface HelpState {\n showFeelings: boolean;\n showMoreQuestions: boolean;\n showFeedback: boolean;\n}\n\nexport default class Help extends React.Component {\n constructor(props: HelpProps) {\n super(props);\n\n this.state = {\n showFeelings: false,\n showMoreQuestions: false,\n showFeedback: false,\n };\n }\n\n onToggleShowFeelings = () => {\n this.setState({\n showFeelings: !this.state.showFeelings,\n });\n };\n\n onToggleShowMoreQuestions = () => {\n this.setState({\n showMoreQuestions: !this.state.showMoreQuestions,\n });\n };\n\n onToggleShowFeedback = () => {\n this.setState({\n showFeedback: !this.state.showFeedback,\n });\n };\n\n render() {\n return (\n
\n
\n

Append Editor Help

\n

\n The Append Editor is an unofficial{' '}\n \n editor\n {' '}\n for{' '}\n \n Standard Notes\n \n , a free,{' '}\n \n open-source\n \n , and{' '}\n \n end-to-end encrypted\n {' '}\n notes app. The Append Editor is also free software licensed under{' '}\n \n AGPL-3.0\n \n . Its source code is available on{' '}\n \n GitHub\n \n .\n

\n

Append Editor Features

\n

\n The Append Editor supports{' '}\n \n Markdown\n {' '}\n with{' '}\n \n KaTeX\n \n , syntax highlighting, in-line HTML, table of contents, footnotes,\n auto-linking,{' '}\n \n emoji codes\n \n , and more.{' '}\n

\n

\n There are four editing modes: Plain Textarea, CodeMirror, Dynamic, and\n Monaco. You can read about each mode and choose which to use in the\n Settings\n \n  \n \n  \n \n . You can also choose default and per-note font sizes, font families,\n and custom styles (CSS).\n

\n

\n The Menu\n \n  \n \n  \n \n has additional options to customize the appearance of the editor,\n share your note, and perform actions to quickly format and edit\n Markdown text.\n

\n

\n A more detailed documentation of the Append Editor is available at{' '}\n \n appendeditor.com\n \n . If you like the Append Editor, please support it by giving it a star\n on{' '}\n \n GitHub\n \n .{' '}\n \n 🙂\n {' '}\n

\n

How to install the Append Editor in Standard Notes

\n
    \n
  1. \n Download, install, and sign in to the Standard Notes{' '}\n \n Desktop\n {' '}\n app.\n
  2. \n
  3. \n In the bottom left corner of the app, click Extensions.\n
  4. \n
  5. \n Click Import Extensions and paste the following link into the\n input box. If you want to use the alpha version, replace{' '}\n beta with alpha:{' '}\n \n \n https://raw.githubusercontent.com/TheodoreChu/append-editor/main/public/beta.ext.json\n \n \n
  6. \n
  7. \n Press Enter or Return on your keyboard.\n
  8. \n
  9. \n The title of your selected note is near the top of the app. Under\n the title, click Editor, click Append Editor, and\n click Continue to begin using the editor. Enjoy!{' '}\n \n 👏\n {' '}\n
  10. \n
\n

\n After you install the editor on the desktop app, it will automatically\n sync to the{' '}\n \n web\n {' '}\n and{' '}\n \n mobile apps\n {' '}\n after you sign in.\n

\n

What to write about

\n

\n The Append Editor is great for writing articles, blog posts,\n checklists, code snippets, documentation, emails, essays, journals,\n lists, logs, notes, tables, todo lists, and much more. Here are some\n questions to help you get started with today's daily journal:\n

{' '}\n
    \n
  • How are you? What's happening?
  • \n
  • What might be affecting your mood?
  • \n
  • Which feelings fit your mood and to what extent?
  • \n
    \n \n {!this.state.showFeelings && [\n

    Show feelings

    ,\n ]}\n {this.state.showFeelings && [\n

    Hide feelings

    ,\n ]}\n
    \n
  • \n Positive Feelings: bold, calm, cheerful, confident,\n content, eager, ecstatic, energized, engaged, enthusiastic,\n excited, grateful, happy, humorous, inspired, joyful, light,\n lively, loving, motivated, optimistic, passionate, peaceful,\n playful, proud, reassured, refreshed, relaxed, relieved,\n satisfied, secure, surprised, thrilled, wonderful\n
  • \n
  • \n Negative Feelings: afraid, angry, annoyed, anxious,\n ashamed, bored, burnt out, confused, demoralized, depressed,\n disappointed, disgusted, distraught, embarrassed, empty,\n exhausted, frustrated, furious, guilty, heavy, insecure,\n irritated, jealous, jittery, lethargic, lonely, nervous, numb,\n resentful, sad, self-conscious, sleepy, stressed, tired, winded,\n worried\n
  • \n
    \n
  • What thoughts are contributing to the way you're feeling?
  • \n
    \n \n {!this.state.showMoreQuestions && [\n

    Show more questions

    ,\n ]}\n {this.state.showMoreQuestions && [\n

    Show fewer questions

    ,\n ]}\n
    \n
    \n {this.state.showMoreQuestions && [\n
    \n
  • \n What do you hope your life will look like in a week? a month? a\n year?\n
  • \n
  • \n What can you do today to make your life the way you want it?\n
  • \n
  • \n How will you feel when you've realized the goals that you have\n for yourself?\n
  • \n
  • Who or what do you feel grateful for and why?
  • \n
  • What did you enjoy about today?
  • \n
    ,\n ]}\n
\n
\n \n

Need more help?

\n
\n {this.state.showFeedback && [\n

\n Feel free to{' '}\n \n reach out\n {' '}\n if you have any questions, comments, concerns, or feedback.{' '}\n \n 👋\n \n
\n If you find any bugs or have a feature request, please{' '}\n \n open an issue on GitHub\n \n .{' '}\n \n 🙂\n \n
\n You are using version 1.2.0. The release notes and\n change log are available on{' '}\n \n GitHub\n \n .\n

,\n ]}\n
\n Click Help\n \n  \n \n  \n \n to close this section.\n
\n
\n );\n }\n}\n","import React from 'react';\nimport { EyeIcon, HelpIcon, PencilIcon, PlusIcon } from './Icons';\nimport {\n clickAppendButton,\n clickEditButton,\n clickHelpButton,\n clickViewButton,\n} from '../lib/clickButton';\n\ninterface IntroProps {\n appendMode: boolean;\n editMode: boolean;\n showHelp: boolean;\n}\n\nconst Intro: React.FC = ({ appendMode, editMode, showHelp }) => (\n
\n
\n \n Welcome to the Append Editor!{' '}\n \n 👋\n {' '}\n Your note is empty.{' '}\n \n 🙂\n {' '}\n Click here to get started.{' '}\n \n 📝\n \n \n

To get started:

\n
    \n
  • \n

    \n Click the Pencil\n \n  \n \n  \n \n to toggle Edit Mode\n

    \n
  • \n
  • \n

    \n Click the Plus\n \n  \n \n  \n \n to toggle Append Mode\n

    \n
  • \n
\n

\n View Mode is currently on. When you type in{' '}\n Edit Mode, your note will automatically render here. In{' '}\n Append Mode, clicking Append will add the text in the\n textarea to the end of your note. Click the Eye\n \n  \n \n  \n \n to turn View Mode off and switch to Edit Only Mode.\n

\n

\n If you are using the demo at{' '}\n \n beta.appendeditor.com\n \n , then your notes will be lost after you close the page.\n

\n

\n If you want to save your notes, then click Help\n \n  \n \n  \n \n and follow the instructions on how to install the Append Editor in{' '}\n \n Standard Notes\n \n , a free,{' '}\n \n open-source\n \n , and{' '}\n \n end-to-end encrypted\n {' '}\n notes app.\n

\n

\n If you like Standard Notes, please check out Standard Notes{' '}\n \n Extended\n {' '}\n for more editors, themes, components, and methods to backup up your\n data.\n

\n

\n Happy note-taking!{' '}\n \n 😄\n \n

\n
\n
\n);\n\nexport default Intro;\n","import React, { ReactNode } from 'react';\nimport unified from 'unified';\nimport parse from 'remark-parse';\nimport remark2rehype from 'remark-rehype';\nimport rehype2react from 'rehype-react';\nimport { debounce, throttle } from 'lodash';\n\nconst gfm = require('remark-gfm');\nconst breaks = require('remark-breaks');\nconst math = require('remark-math');\nconst rehypeKatex = require('rehype-katex');\nconst highlight = require('rehype-highlight');\nconst emoji = require('remark-emoji');\nconst externalLinks = require('remark-external-links');\nconst toc = require('remark-toc');\nconst footnotes = require('remark-footnotes');\nconst slug = require('remark-slug');\nconst raw = require('rehype-raw');\n\nconst processor = unified()\n .use(parse)\n .use(gfm)\n .use(breaks)\n .use(slug)\n .use(toc, { maxDepth: 6 })\n .use(externalLinks)\n .use(footnotes, { inlineNotes: true })\n .use(remark2rehype, { allowDangerousHtml: true })\n .use(raw)\n .use(math)\n .use(rehypeKatex)\n .use(highlight, { ignoreMissing: true })\n .use(emoji)\n .use(rehype2react, { createElement: React.createElement });\n\nexport const processMarkdown = (text: string) => {\n const markdown = processor.processSync(text).result as ReactNode;\n return markdown;\n};\n\n/** Throttle instead of debounce because\n * we want it to work even when typing\n * lots of characters in a short amount of time. */\nexport const isLongString = throttle((text: string) => {\n //console.log('length', text.length);\n if (text.length > 10000) {\n return true;\n } else {\n return false;\n }\n}, 1000);\n\n/** Debounce the rendering of long notes to prevent lagging.\n * There is no max on the debounce to prevent lagging\n * even for very, very long notes */\nexport const renderLongMarkdown = debounce((text: string) => {\n //console.log('renderLongMarkdownText');\n const markdown = processMarkdown(text);\n return markdown;\n}, 500);\n\nexport const renderMarkdown = (text: string, bypassDebounce: boolean) => {\n if (bypassDebounce) {\n //console.log('renderBypassDebounceText');\n const markdown = processMarkdown(text);\n return markdown;\n }\n let textIsLong = false as boolean | undefined;\n textIsLong = isLongString(text);\n //console.log('textIsLong', textIsLong);\n if (textIsLong) {\n return renderLongMarkdown(text);\n } else {\n //console.log('renderShortMarkdownText');\n const markdown = processMarkdown(text);\n return markdown;\n }\n};\n","import React from 'react';\nimport { EditingModes, HtmlElementId } from './AppendEditor';\nimport DynamicEditor from './DynamicEditor';\nimport Help from './Help';\nimport Intro from './Intro';\nimport { renderMarkdown } from '../lib/renderMarkdown';\n\ninterface ViewProps {\n appendMode: boolean;\n bypassDebounce: boolean;\n debugMode: boolean;\n editMode: boolean;\n editingMode?: string;\n monacoEditorLanguage: string;\n printURL: boolean;\n saveText: (text: string) => void;\n showHelp: boolean;\n text: string;\n}\n\ninterface ViewState {\n showHelp: boolean;\n}\n\nexport default class ViewNote extends React.Component {\n constructor(props: ViewProps) {\n super(props);\n\n this.state = {\n showHelp: this.props.showHelp,\n };\n }\n\n onToggleShowHelp = () => {\n const helpButton = document.getElementById('helpButton');\n if (helpButton) {\n helpButton.click();\n }\n };\n\n renderMarkdown = (text: string) => {\n const markdown = renderMarkdown(text, this.props.bypassDebounce);\n return markdown;\n };\n\n render() {\n const { text } = this.props;\n return (\n \n
\n {!text && [\n ,\n ]}\n {this.state.showHelp && [\n ,\n ]}\n \n {this.props.editingMode === EditingModes.useMonacoEditor &&\n this.props.monacoEditorLanguage !== 'markdown' &&\n this.props.monacoEditorLanguage !== 'html' &&\n text ? (\n this.renderMarkdown(\n '```' + this.props.monacoEditorLanguage + '\\n' + text + '\\n```'\n )\n ) : this.props.editingMode === EditingModes.useDynamicEditor ? (\n \n ) : (\n this.renderMarkdown(text)\n )}\n
\n \n \n );\n }\n}\n","import React from 'react';\nimport { EditingModes } from './AppendEditor';\nimport DynamicEditor from './DynamicEditor';\nimport { MonacoEditor } from './Monaco';\n\nimport { HtmlElementId } from './AppendEditor';\n\ninterface AppendProps {\n appendNewLine: boolean;\n appendNewParagraph: boolean;\n appendRows: number;\n appendTextToNote: Function;\n editingMode?: string;\n fontSize: string;\n keyMap: Map;\n debugMode: boolean;\n autoSaveAppendText: Function;\n autoSaveCheckBoxes: Function;\n monacoEditorLanguage: string;\n onKeyDown: Function;\n onKeyUp: Function;\n onKeyDownAppendTextArea: Function;\n onKeyDownTextArea: Function;\n text: string;\n}\n\ninterface AppendState {\n text: string;\n newLine: boolean;\n newParagraph: boolean;\n [x: string]: string | boolean;\n}\n\nexport default class AppendText extends React.Component<\n AppendProps,\n AppendState\n> {\n static defaultProps = {\n // none\n };\n\n constructor(props: AppendProps) {\n super(props);\n\n this.state = {\n text: this.props.text,\n newLine: this.props.appendNewLine,\n newParagraph: this.props.appendNewParagraph,\n useMonacoEditor: this.props.editingMode === EditingModes.useMonacoEditor,\n useDynamicEditor:\n this.props.editingMode === EditingModes.useDynamicEditor,\n };\n }\n\n handleInputChange = (event: React.ChangeEvent) => {\n const target = event.target;\n const value = target.type === 'checkbox' ? target.checked : target.value;\n const name = target.name;\n this.setState(\n {\n [name]: value,\n },\n () => {\n // This callback saves the checkboxes\n this.autoSaveCheckBoxes();\n }\n );\n };\n\n // This is an almost duplicate of the above editor. Here we don't save the checkboxes to improve performance\n handleTextAreaChange = (event: any) => {\n const target = event.target;\n const value = target.value;\n this.setState(\n {\n text: value,\n },\n () => {\n // This callback saves the append text\n this.autoSaveAppendText();\n }\n );\n };\n\n saveText = (text: string) => {\n this.setState(\n {\n text,\n },\n () => {\n this.props.autoSaveAppendText(this.state.text);\n }\n );\n };\n\n appendTextToNote = () => {\n this.props.appendTextToNote();\n this.setState({\n text: '',\n });\n const appendTextArea = document.getElementById(\n HtmlElementId.appendTextArea\n );\n if (appendTextArea) {\n appendTextArea.focus();\n }\n // Refresh Monaco Editor after appending text to note\n if (this.state.useMonacoEditor) {\n this.setState(\n {\n useMonacoEditor: false,\n },\n () => {\n this.setState({\n useMonacoEditor: true,\n });\n }\n );\n }\n // Refresh Dynamic Editor after appending text to note\n if (this.state.useDynamicEditor) {\n this.setState(\n {\n useDynamicEditor: false,\n },\n () => {\n this.setState({\n useDynamicEditor: true,\n });\n }\n );\n }\n };\n\n autoSaveAppendText = () => {\n const text = this.state.text;\n this.props.autoSaveAppendText(text);\n };\n\n autoSaveCheckBoxes = () => {\n const newLine = this.state.newLine;\n const newParagraph = this.state.newParagraph;\n this.props.autoSaveCheckBoxes(newLine, newParagraph);\n };\n\n onKeyDown = (e: React.KeyboardEvent) => {\n this.props.keyMap.set(e.key, true);\n if (this.props.debugMode) {\n console.log(\n 'Keys pressed: ' +\n e.key +\n 'KeyMap for key: ' +\n this.props.keyMap.get(e.key)\n );\n console.log('Append Text Value: ' + this.state.text);\n }\n\n this.props.onKeyDown(e);\n this.props.onKeyDownAppendTextArea(e);\n this.props.onKeyDownTextArea(e);\n // Append Text if Ctrl and 'Enter' are pressed\n if (this.props.keyMap.get('Control') && this.props.keyMap.get('Enter')) {\n e.preventDefault();\n this.appendTextToNote();\n }\n // Append Text if Ctrl and 's' are pressed\n else if (this.props.keyMap.get('Control') && this.props.keyMap.get('s')) {\n e.preventDefault();\n this.appendTextToNote();\n }\n };\n\n onKeyUp = (event: React.KeyboardEvent) => {\n this.props.keyMap.delete(event.key);\n this.props.onKeyUp(event);\n };\n\n render() {\n const { text } = this.state;\n\n return (\n \n \n {this.state.useMonacoEditor ? (\n // We use this.state instead of this.props so we can easily refresh it on Append\n \n ) : this.state.useDynamicEditor ? (\n
\n \n
\n ) : (\n \n )}\n \n
\n
\n \n
\n \n
\n
\n \n
Append
\n \n
\n
\n \n );\n }\n}\n","import React from 'react';\nimport {\n ChevronIconDown,\n ChevronIconRight,\n CopyIcon,\n EyeIcon,\n PencilIcon,\n PrintIcon,\n UndoIcon,\n} from './Icons';\n\ninterface ActionButtonTypes {\n caption?: string;\n className?: string;\n fill?: string;\n id?: string;\n title: string;\n onClick: () => void;\n}\n\ninterface ConditionalButtonTypes extends ActionButtonTypes {\n condition?: boolean | undefined;\n messageOn?: string;\n messageOff?: string;\n}\n\nexport const ChevronToggleButton: React.FC = ({\n caption,\n className,\n condition,\n onClick,\n title,\n}) => (\n \n);\n\nexport const CopyButton: React.FC = ({\n caption,\n className,\n fill,\n onClick,\n title,\n}) => (\n \n);\n\nexport const EyeButton: React.FC = ({\n caption,\n className,\n condition,\n messageOn,\n messageOff,\n onClick,\n title,\n}) => (\n \n);\n\nexport const PencilButton: React.FC = ({\n caption,\n className,\n fill,\n onClick,\n title,\n}) => (\n \n);\n\nexport const PrintButton: React.FC = ({\n caption,\n className,\n fill,\n id,\n onClick,\n title,\n}) => (\n \n);\n\nexport const UndoButton: React.FC = ({\n fill,\n id,\n onClick,\n title,\n}) => (\n \n);\n","import React from 'react';\nimport prettier from 'prettier';\nimport parserMarkdown from 'prettier/parser-markdown';\nimport { EditingModes } from './AppendEditor';\nimport {\n ChevronToggleButton,\n CopyButton,\n EyeButton,\n PencilButton,\n PrintButton,\n} from './Buttons';\n\n// Import types\nimport { HtmlElementId } from './AppendEditor';\n\nenum HtmlClassName {\n chevronToggleButton = 'menu-button chevron-toggle-button',\n menuButton = 'menu-button',\n on = ' on',\n off = ' off',\n}\n\ninterface MenuProps {\n borderlessMode?: boolean;\n editingMode?: string;\n fixedHeightMode?: boolean;\n fullWidthMode?: boolean;\n monacoEditorLanguage: string;\n onConfirmPrintUrl: () => void;\n overflowMode?: boolean;\n refreshEdit: () => void;\n refreshView: () => void;\n saveText: (text: string) => void;\n showMenuOptionsEdit?: boolean;\n //showMenuOptionsMonacoEditor?: boolean;\n showMenuOptionsShare?: boolean;\n showMenuOptionsView?: boolean;\n text: string;\n toggleBorderlessMode: () => void;\n toggleFixedHeightMode: () => void;\n toggleFullWidthMode: () => void;\n toggleOverflowMode: () => void;\n toggleShowMenu: () => void;\n toggleShowMenuOptionsEdit: () => void;\n //toggleShowMenuOptionsMonacoEditor?: () => void;\n toggleShowMenuOptionsView: () => void;\n toggleShowMenuOptionsShare: () => void;\n viewMode?: boolean;\n}\n\ninterface MenuState {\n message?: string;\n displayMessageShare: boolean;\n displayMessageEdit: boolean;\n}\n\nexport default class Menu extends React.Component {\n clearTooltipTimer: NodeJS.Timeout | undefined;\n constructor(props: MenuProps) {\n super(props);\n this.state = {\n message: '',\n displayMessageEdit: false,\n displayMessageShare: false,\n };\n }\n\n resetMessageTimer = () => {\n if (this.clearTooltipTimer) {\n clearTimeout(this.clearTooltipTimer);\n }\n this.clearTooltipTimer = setTimeout(() => {\n this.setState({\n displayMessageEdit: false,\n displayMessageShare: false,\n });\n }, 5000);\n };\n\n showMessageEdit = () => {\n this.setState(\n {\n displayMessageEdit: true,\n displayMessageShare: false,\n },\n () => {\n this.resetMessageTimer();\n }\n );\n };\n showMessageShare = () => {\n this.setState(\n {\n displayMessageEdit: false,\n displayMessageShare: true,\n },\n () => {\n this.resetMessageTimer();\n }\n );\n };\n\n copyToClipboard = (text: string) => {\n const textField = document.createElement('textarea');\n textField.value = text;\n document.body.appendChild(textField);\n textField.select();\n document.execCommand('copy');\n this.showMessageShare();\n textField.remove();\n };\n\n copyText = () => {\n if (this.props.text) {\n this.setState({ message: 'Copied Text to clipboard' }, () => {\n this.copyToClipboard(this.props.text);\n });\n } else {\n this.setState({ message: 'No text to copy. Your note is empty' }, () => {\n this.showMessageShare();\n });\n }\n };\n\n copyHtml = () => {\n if (!this.props.viewMode) {\n this.setState(\n { message: 'Unable to copy HTML. Please turn View Mode on' },\n () => this.showMessageShare()\n );\n } else if (!this.props.text) {\n this.setState({ message: 'No HTML to copy. Your note is empty' }, () => {\n this.showMessageShare();\n });\n } else {\n const renderedNote = document.getElementById('renderedNote');\n if (renderedNote?.firstElementChild?.innerHTML) {\n this.setState({ message: 'Copied HTML to clipboard' });\n this.copyToClipboard(renderedNote?.firstElementChild.innerHTML);\n }\n }\n };\n\n formatText = () => {\n if (\n this.props.monacoEditorLanguage !== 'markdown' &&\n this.props.editingMode === EditingModes.useMonacoEditor\n ) {\n this.setState(\n {\n message:\n 'Error: Your Monaco Editor language is not Markdown. Formatting is only available for Markdown',\n },\n () => {\n this.showMessageEdit();\n }\n );\n } else if (this.props.text) {\n this.setState(\n { message: 'Formatted Markdown text with Prettier' },\n () => {\n try {\n const formattedText = prettier.format(this.props.text, {\n parser: 'markdown',\n plugins: [parserMarkdown],\n });\n this.props.saveText(formattedText);\n this.props.refreshEdit();\n this.props.refreshView();\n this.showMessageEdit();\n } catch (e) {\n this.setState({ message: 'Error formatting text: ' + e }, () => {\n this.showMessageEdit();\n });\n console.log('Error formatting text: ' + e);\n }\n }\n );\n } else {\n this.setState(\n { message: 'No text to format. Your note is empty' },\n () => {\n this.showMessageEdit();\n }\n );\n }\n };\n\n uncheckBoxes = () => {\n const { text } = this.props;\n const checkedBoxes = new RegExp(/- \\[x\\]/gm);\n if (checkedBoxes.test(text)) {\n const newText = text.replace(checkedBoxes, '- [ ]');\n this.props.saveText(newText);\n this.props.refreshEdit();\n this.props.refreshView();\n this.setState({ message: 'Unchecked all checkboxes' }, () => {\n this.showMessageEdit();\n });\n } else {\n this.setState({ message: 'No checked checkboxes found' }, () => {\n this.showMessageEdit();\n });\n }\n };\n\n render() {\n // You can render any custom fallback UI\n return [\n
,\n
\n \n {this.props.showMenuOptionsView && [\n ,\n ,\n ,\n ,\n ]}\n \n {this.props.showMenuOptionsShare && [\n ,\n ,\n ,\n \n

\n {this.state.message}\n

\n
,\n ]}\n \n {this.props.showMenuOptionsEdit && [\n ,\n ,\n \n

\n {this.state.message}\n

\n
,\n ]}\n
\n ,\n ];\n }\n}\n","import React from 'react';\nimport { MonacoEditor } from './Monaco';\nimport {\n DefaultSettings,\n EditingModes,\n SaveSettingsInterface,\n} from './AppendEditor';\nimport { CloseIcon, RefreshIcon } from './Icons';\nimport { ChevronToggleButton, UndoButton } from './Buttons';\n\nconst customStylesID = 'customStyles';\nconst editingModeID = 'editingMode';\nconst fontEditID = 'fontEdit';\nconst fontSizeID = 'fontSize';\nconst fontViewID = 'fontView';\nconst monacoEditorLanguageID = 'monacoEditorLanguage';\nconst resetAllSettingsID = 'resetAllSettings';\nconst saveAsDefaultID = 'saveAsDefault';\n\ninterface SettingsProps {\n defaultSettings: DefaultSettings;\n customStyles: string;\n editingMode?: string;\n fontEdit: string;\n fontSize: string;\n fontView: string;\n monacoEditorLanguage: string;\n cancelText: string;\n confirmText: string;\n debugMode: boolean;\n keyMap: Map;\n onCancel: () => void;\n onConfirm: (object: SaveSettingsInterface) => void;\n title: string;\n helpLink: string;\n}\n\ninterface SettingsState {\n customStyles: string;\n editingMode: string;\n fontEdit: string;\n fontSize: string;\n fontView: string;\n monacoEditorLanguage: string;\n saveAsDefault: boolean;\n showCustomStyles: boolean;\n [x: string]: string | boolean;\n}\n\nconst startRegExp = new RegExp(/```css\\n/gm);\nconst cssRegExp = new RegExp(/```css/gm);\nconst endRegExp = new RegExp(/\\n```/gm);\nconst codeRegExp = new RegExp(/```/gm);\n\nexport default class Settings extends React.Component<\n SettingsProps,\n SettingsState\n> {\n constructor(props: SettingsProps) {\n super(props);\n let monacoEditorLanguage = 'markdown';\n if (this.props.monacoEditorLanguage) {\n monacoEditorLanguage = this.props.monacoEditorLanguage;\n }\n let editingMode = 'usePlainText';\n if (this.props.editingMode) {\n editingMode = this.props.editingMode;\n }\n this.state = {\n customStyles: this.props.customStyles,\n editingMode,\n fontEdit: this.props.fontEdit,\n fontSize: this.props.fontSize,\n fontView: this.props.fontView,\n monacoEditorLanguage,\n saveAsDefault: false,\n showCustomStyles: false, // false by default for a mobile-first experience\n };\n }\n\n handleInputChange = (event: React.ChangeEvent) => {\n const target = event.target;\n const value = target.type === 'checkbox' ? target.checked : target.value;\n const name = target.name;\n this.setState({\n [name]: value,\n });\n if (this.props.debugMode) {\n console.log(\n 'Settings event name: ' +\n event.target.name +\n ' Value: ' +\n event.target.value\n );\n }\n };\n\n handleSelectChange = (event: React.ChangeEvent) => {\n const target = event.target;\n const value = target.value;\n const name = target.name;\n this.setState(\n {\n [name]: value,\n },\n () => {\n if (this.props.debugMode) {\n console.log(\n 'Saved select. Name: ' +\n event.target.name +\n ' Value: ' +\n event.target.value\n );\n }\n }\n );\n };\n\n toggleShowCustomStyles = () => {\n this.setState({\n showCustomStyles: !this.state.showCustomStyles,\n });\n };\n\n cleanCustomStyles = (text: string) => {\n if (text) {\n return text\n .replace(startRegExp, '')\n .replace(cssRegExp, '')\n .replace(endRegExp, '')\n .replace(codeRegExp, '');\n } else {\n return text;\n }\n };\n\n saveText = (text: string) => {\n this.setState({\n customStyles: text,\n });\n };\n\n handleSubmit = () => {\n if (this.props.debugMode) {\n let fontEditMessage = '';\n let fontViewMessage = '';\n if (this.state.fontEdit === '' || this.state.fontEdit === undefined) {\n fontEditMessage = 'Default';\n } else if (this.state.fontEdit) {\n fontEditMessage = this.state.fontEdit;\n }\n if (this.state.fontView === '' || this.state.fontView === undefined) {\n fontViewMessage = 'Default';\n } else if (this.state.fontView) {\n fontViewMessage = this.state.fontView;\n }\n console.log(\n 'Settings.tsx handleSubmit() triggered: ' +\n '\\n - Settings editingMode: ' +\n this.state.editingMode +\n '\\n - Settings fontEdit: ' +\n this.state.fontEdit +\n '\\n - Settings fontView: ' +\n this.state.fontView +\n '\\n - Your chosen font for Edit/Append is: ' +\n fontEditMessage +\n '\\n - Your chosen font for View/Print is: ' +\n fontViewMessage +\n '\\n'\n );\n }\n this.setState(\n {\n // clean the custom styles prior to saving them\n customStyles: this.cleanCustomStyles(this.state.customStyles),\n },\n () => {\n if (this.props.debugMode) {\n console.log('Your custom styles: ' + this.state.customStyles);\n }\n const {\n customStyles,\n editingMode,\n fontEdit,\n fontSize,\n fontView,\n monacoEditorLanguage,\n saveAsDefault,\n } = this.state;\n this.props.onConfirm({\n customStyles,\n editingMode,\n fontEdit,\n fontSize,\n fontView,\n monacoEditorLanguage,\n saveAsDefault,\n });\n }\n );\n };\n\n loadDefaultSettings = () => {\n const defaultSettings = this.props.defaultSettings;\n this.setState(\n {\n ...defaultSettings,\n },\n () => {\n this.refreshCustomStyles();\n }\n );\n };\n\n refreshCustomStyles = () => {\n this.setState(\n {\n showCustomStyles: !this.state.showCustomStyles,\n },\n () => {\n this.setState({\n showCustomStyles: !this.state.showCustomStyles,\n });\n }\n );\n };\n\n clearCustomStyles = () => {\n this.setState(\n {\n customStyles: '',\n },\n () => {\n this.refreshCustomStyles();\n if (this.props.debugMode) {\n console.log('customStyles reset: ' + this.state.customStyles);\n }\n }\n );\n const customStyles = document.getElementById(\n customStylesID\n ) as HTMLTextAreaElement;\n if (customStyles) {\n customStyles.value = '';\n customStyles.focus();\n }\n };\n\n clearFontEdit = () => {\n this.setState({\n fontEdit: '',\n });\n const fontEdit = document.getElementById(fontEditID) as HTMLTextAreaElement;\n if (fontEdit) {\n fontEdit.value = '';\n fontEdit.focus();\n }\n };\n\n clearFontSize = () => {\n this.setState({\n fontSize: '',\n });\n const fontSize = document.getElementById(fontSizeID) as HTMLSelectElement;\n if (fontSize) {\n fontSize.value = '';\n fontSize.focus();\n }\n };\n\n clearFontView = () => {\n this.setState({\n fontView: '',\n });\n const fontView = document.getElementById(fontViewID) as HTMLTextAreaElement;\n if (fontView) {\n fontView.value = '';\n fontView.focus();\n }\n };\n\n clearEditingMode = () => {\n this.setState({\n editingMode: EditingModes.usePlainText,\n });\n };\n\n clearMonacoEditorLanguage = () => {\n this.setState({\n monacoEditorLanguage: 'markdown',\n });\n const monacoEditorLanguage = document.getElementById(\n monacoEditorLanguageID\n ) as HTMLSelectElement;\n if (monacoEditorLanguage) {\n monacoEditorLanguage.value = 'markdown';\n monacoEditorLanguage.focus();\n }\n };\n\n clearSaveAsDefault = () => {\n this.setState({\n saveAsDefault: false,\n });\n const saveAsDefault = document.getElementById(\n saveAsDefaultID\n ) as HTMLInputElement;\n saveAsDefault.checked = false;\n saveAsDefault.focus();\n };\n\n clearAllSettings = () => {\n // We clear from bottom settings to top settings so the focus afterwards is on top\n this.clearSaveAsDefault();\n this.clearCustomStyles();\n this.clearFontView();\n this.clearFontEdit();\n this.clearFontSize();\n this.clearMonacoEditorLanguage();\n this.clearEditingMode();\n const resetAllSettings = document.getElementById(resetAllSettingsID);\n if (resetAllSettings) {\n resetAllSettings.focus();\n }\n };\n\n onKeyDown = (e: React.KeyboardEvent) => {\n this.props.keyMap.set(e.key, true);\n //console.log(\"Keys pressed: \" + e.key + \"KeyMap for key: \" + keyMap.get(e.key)) + \"KeyMap for Shift: \" + keyMap.get('Shift');\n // Save settings if Control and 's' are pressed\n if (this.props.keyMap.get('Control') && this.props.keyMap.get('s')) {\n e.preventDefault();\n this.handleSubmit();\n }\n // Save settings if Control and Enter are pressed\n else if (\n this.props.keyMap.get('Control') &&\n this.props.keyMap.get('Enter')\n ) {\n e.preventDefault();\n this.handleSubmit();\n }\n };\n\n onKeyUp = (e: React.KeyboardEvent) => {\n this.props.keyMap.set(e.key, false);\n };\n\n onBlur = (e: React.FocusEvent) => {\n this.props.keyMap.clear();\n };\n\n componentWillUnmount = () => {\n this.props.keyMap.clear();\n };\n\n render() {\n //

\n const { title, onCancel, confirmText, cancelText, helpLink } = this.props;\n return (\n
\n
\n
\n \n \n \n
\n

{title}

\n \n
\n
\n
\n

\n Need help? Check out the{' '}\n \n documentation\n \n . To clear all settings, click undo: \n

\n \n
\n
\n
\n
\n

To load your personal default settings, click: 

\n \n \n \n
\n
\n
\n
\n

Editing Mode:

\n \n
\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n {this.state.editingMode === EditingModes.useMonacoEditor && [\n
\n \n
\n \n \n
\n
,\n ]}\n
\n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n {this.state.editingMode !== EditingModes.useMonacoEditor && [\n
\n \n
\n \n \n
\n
,\n ]}\n {this.state.editingMode !== EditingModes.useDynamicEditor && [\n
\n \n
\n \n \n
\n
,\n ]}\n
\n \n {this.state.showCustomStyles && [\n
\n \n
,\n ]}\n
\n {this.state.showCustomStyles && [\n
\n \n
,\n ]}\n
\n \n
\n \n \n
\n
\n
\n
\n
\n
\n \n \n
\n
\n
\n );\n }\n}\n","import React, { ErrorInfo } from 'react';\nimport { GearIcon } from './Icons';\nimport { clickSettingsButton } from '../lib/clickButton';\n\ninterface ErrorBoundaryState {\n hasError: boolean;\n error?: Error;\n errorInfo?: ErrorInfo;\n}\n\n/**\n * Learn more about Error Boundaries here:\n * https://reactjs.org/docs/error-boundaries.html\n */\n\nexport default class ErrorBoundary extends React.Component<\n any,\n ErrorBoundaryState\n> {\n constructor(props: any) {\n super(props);\n this.state = { hasError: false };\n }\n\n static getDerivedStateFromError(error: Error) {\n // Update state so the next render will show the fallback UI.\n return { hasError: true };\n }\n\n componentDidCatch(error: Error, errorInfo: ErrorInfo) {\n // You can also log the error to an error reporting service\n console.log('Error:', error, '\\nError Info:', errorInfo);\n this.setState({\n error,\n errorInfo,\n });\n }\n\n render() {\n if (this.state.hasError) {\n // You can render any custom fallback UI\n return (\n
\n
\n
\n

Something went wrong.

\n

\n Error Name: {this.state.error?.name}\n

\n

\n Error Message: {this.state.error?.message}\n

\n

Please see the developer console for details.

\n
\n

\n Errors such as TypeError and{' '}\n Cannot read property 'type' of undefined usually\n occur when the editor is unable to process and render your notes\n because it contains incorrect or incomplete HTML. If you are\n writing in HTML, then please continue to write and refresh the\n View Mode when the HTML tags are closed.\n

\n

\n If you are using the Dynamic editing mode, then please switch to\n the Plain Textarea or Monaco editing modes in the Settings\n \n  \n \n  \n \n and remove or fix the text that is causing the error.\n

\n

\n If the error persists or is not related to the content of your\n note, then please{' '}\n \n report the issue on GitHub\n {' '}\n and we will try to fix it.{' '}\n \n 🙂\n \n

\n
\n
\n
\n );\n }\n\n return this.props.children;\n }\n}\n","import React from 'react';\nimport { EditorKit, EditorKitDelegate } from 'sn-editor-kit';\nimport PrintDialog from './PrintDialog';\nimport EditNote from './EditNote';\nimport ViewNote from './ViewNote';\nimport AppendText from './AppendText';\nimport Settings from './Settings';\nimport { MonacoDiffEditor } from './Monaco';\nimport ErrorBoundary from './ErrorBoundary';\nimport Menu from './Menu';\n\nimport CodeMirror, { Editor } from 'codemirror';\nimport 'codemirror/lib/codemirror';\nimport 'codemirror/mode/gfm/gfm';\n\n// CodeMirror addons\n\n// For markdown\nimport 'codemirror/addon/edit/continuelist';\n\n// For search\nimport 'codemirror/addon/search/jump-to-line';\nimport 'codemirror/addon/search/match-highlighter';\nimport 'codemirror/addon/search/matchesonscrollbar';\nimport 'codemirror/addon/search/search';\nimport 'codemirror/addon/search/searchcursor';\nimport 'codemirror/addon/dialog/dialog';\n\n// For styling selected text\nimport 'codemirror/addon/selection/mark-selection';\nimport {\n EyeIcon,\n GearIcon,\n HelpIcon,\n MenuIcon,\n PencilIcon,\n PlusIcon,\n} from './Icons';\n\nimport { isLongString, renderLongMarkdown } from '../lib/renderMarkdown';\n\nexport enum HtmlElementId {\n appendButton = 'appendButton',\n appendTextArea = 'appendTextArea',\n appendix = 'appendix',\n content = 'content',\n edit = 'edit',\n editButton = 'editButton',\n editTextArea = 'editTextArea',\n header = 'header',\n helpButton = 'helpButton',\n menuButton = 'menuButton',\n newLine = 'newLine',\n newParagraph = 'newParagraph',\n printButton = 'printButton',\n settingsButton = 'settingsButton',\n view = 'view',\n viewButton = 'viewButton',\n}\n\nexport enum HtmlClassName {\n fixed = 'fixed',\n fixedHeader = 'fixed-header',\n}\n\nexport enum EditingModes {\n usePlainText = 'usePlainText',\n useCodeMirror = 'useCodeMirror',\n useDynamicEditor = 'useDynamicEditor',\n useMonacoEditor = 'useMonacoEditor',\n}\n\nexport type DefaultSettings = {\n customStyles: string;\n editingMode: string;\n fontEdit: string;\n fontSize: string;\n fontView: string;\n monacoEditorLanguage: string;\n};\n\nexport interface SaveSettingsInterface extends DefaultSettings {\n saveAsDefault: boolean;\n}\n\nexport type menuOptions = {\n borderlessMode?: boolean;\n fixedHeightMode?: boolean;\n fullWidthMode?: boolean;\n overflowMode?: boolean;\n showMenuOptionsEdit?: boolean;\n showMenuOptionsShare?: boolean;\n showMenuOptionsView?: boolean;\n};\n\nexport interface AppendInterface {\n text: string;\n appendCodeMirror?: any;\n appendNewLine: boolean;\n appendNewParagraph: boolean;\n appendMode: boolean;\n appendRows: number;\n appendText: string;\n borderlessMode?: boolean;\n bypassDebounce: boolean;\n confirmPrintUrl: boolean;\n currentState?: object;\n customStyles: string;\n defaultSettings: DefaultSettings;\n editMode?: any;\n editingMode?: string;\n editCodeMirror?: any;\n fontEdit: string;\n fontSize: string;\n fontView: string;\n fixedHeightMode?: boolean;\n fullWidthMode?: boolean;\n overflowMode?: boolean;\n keyMap?: Object;\n monacoEditorLanguage: string;\n printURL: boolean;\n refreshEdit: boolean;\n refreshView: boolean;\n saveAsDefault?: boolean;\n savingEditorOptions?: boolean;\n showAppendix: boolean;\n showDiff: boolean;\n showHeader: boolean;\n showHelp: boolean;\n showMenu?: boolean;\n showMenuOptionsEdit?: boolean;\n showMenuOptionsShare?: boolean;\n showMenuOptionsView?: boolean;\n settingsMode: boolean;\n viewMode?: boolean;\n}\n\n/**\n * Some properties are optional so\n * they do not need to be set\n * when switching between notes.\n */\n\nconst initialState = {\n text: '',\n appendNewLine: false,\n appendNewParagraph: false,\n appendMode: false,\n appendRows: 8,\n appendText: '',\n bypassDebounce: false, // We keep this as false in initialState so debounce works in the demo\n confirmPrintUrl: false,\n customStyles: '',\n defaultSettings: {\n customStyles: '',\n editingMode: 'usePlainText',\n fontEdit: '',\n fontSize: '',\n fontView: '',\n monacoEditorLanguage: 'markdown',\n },\n fontEdit: '',\n fontSize: '',\n fontView: '',\n monacoEditorLanguage: 'markdown',\n printURL: true,\n refreshEdit: false,\n refreshView: false,\n showAppendix: true,\n showHeader: true,\n showHelp: false,\n showDiff: false,\n settingsMode: false,\n};\n\nlet last_known_scroll_position = 0;\n\nconst debugMode = false;\n\nlet keyMap = new Map();\n\nexport default class AppendEditor extends React.Component<{}, AppendInterface> {\n editorKit: any;\n refreshEditorTimer: NodeJS.Timeout | undefined;\n saveTimer: NodeJS.Timeout | undefined;\n\n constructor(props: AppendInterface) {\n super(props);\n this.configureEditorKit();\n this.state = initialState;\n }\n\n /**\n * This loads the first time the editor is loaded\n * This does not load every time a new note is loaded */\n componentDidMount = () => {\n if (debugMode) {\n console.log('AppendEditor.tsx: \\n - this.componentDidMount() triggered');\n }\n this.onViewMode();\n this.loadDefaultMenuState();\n document.addEventListener('scroll', this.onScroll);\n };\n\n componentWillUnmount = () => {\n document.removeEventListener('scroll', this.onScroll);\n };\n\n configureEditorKit = () => {\n if (debugMode) {\n console.log('AppendEditor.tsx: \\n - this.configureEditorKit() triggered');\n }\n let delegate = new EditorKitDelegate({\n /** This loads every time a different note is loaded\n * We turn bypassDebounce to true so\n * the editor always renders the markdown for the latest note\n */\n setEditorRawText: (text: string) => {\n this.setState(\n {\n ...initialState,\n bypassDebounce: true,\n text,\n },\n () => {\n if (debugMode) {\n console.log(\n '#################################################################################\\n' +\n 'AppendEditor.tsx:',\n '\\n - loaded text:',\n text +\n '\\n - this.configureEditorKit() callback triggered:' +\n '\\n - this.state.savingsDefaultSettings: ' +\n this.state.savingEditorOptions +\n '\\n - this.state: ' +\n JSON.stringify(this.state, null, ' ')\n );\n }\n /** Clear the debounce from the previous note and componentDidMount\n * Then call and flush the debounce so the correct markdown will render\n * the first time after turning the bypass off */\n isLongString.cancel();\n isLongString(text);\n isLongString.flush();\n renderLongMarkdown.cancel();\n if (isLongString(text)) {\n renderLongMarkdown(text);\n renderLongMarkdown.flush();\n }\n /** This prevents metadata from loading when saving editor options or default settings */\n if (!this.state.savingEditorOptions) {\n this.loadEditorOptions();\n this.loadDefaultSettings();\n this.loadMetaData();\n }\n /** Turn the debounce bypass off\n * This loads every time, even when saving editor options or default settings\n * because bypassDebounce is set to true every time\n */\n setTimeout(() => {\n this.setState({\n bypassDebounce: false,\n });\n }, 1000);\n }\n );\n },\n clearUndoHistory: () => {},\n getElementsBySelector: () => [],\n });\n\n this.editorKit = new EditorKit({\n delegate: delegate,\n mode: 'plaintext',\n supportsFilesafe: false,\n });\n };\n\n /** Expect this to run three times when loading a note:\n * once when loading editor options,\n * once when loading default settings, and\n * once when loading meta data\n * Use the timer to prevent the function from being executed when it is called\n * repeatedly, as when loading a note or saving a menu option */\n refreshEditor = () => {\n if (isLongString(this.state.text)) {\n if (this.refreshEditorTimer) {\n clearTimeout(this.refreshEditorTimer);\n }\n this.refreshEditorTimer = setTimeout(() => {\n if (!this.state.savingEditorOptions) {\n this.refreshEdit();\n this.refreshView();\n this.activateStyles();\n }\n }, 20);\n } else {\n if (this.refreshEditorTimer) {\n clearTimeout(this.refreshEditorTimer);\n }\n this.refreshEditorTimer = setTimeout(() => {\n if (!this.state.savingEditorOptions) {\n this.refreshEdit();\n this.refreshView();\n this.activateStyles();\n }\n }, 10);\n }\n };\n\n loadDefaultSettings = () => {\n try {\n const defaultSettingsString = this.editorKit.internal.componentManager.componentDataValueForKey(\n 'defaultSettings'\n );\n const defaultEditingMode = this.editorKit.internal.componentManager.componentDataValueForKey(\n 'editingMode'\n );\n if (debugMode) {\n console.log(\n 'AppendEditor.tsx: \\n loadDefaultSetting() default settings loaded: ' +\n '\\n - defaultSettingsString: ' +\n defaultSettingsString,\n '\\n - typeof:',\n typeof defaultSettingsString,\n '\\n - defaultEditingMode:',\n defaultEditingMode,\n '\\n - typeof:',\n typeof defaultEditingMode\n );\n }\n if (defaultSettingsString !== undefined) {\n const defaultSettingsObject = JSON.parse(\n defaultSettingsString\n ) as DefaultSettings;\n if (debugMode) {\n console.log(\n 'AppendEditor.tsx: \\n loadDefaultSetting():',\n 'if (defaultSettingsString !== undefined) triggered',\n '\\n - typeof defaultSettings:',\n typeof defaultSettingsObject\n );\n }\n this.setState(\n {\n customStyles: defaultSettingsObject.customStyles,\n editingMode: defaultSettingsObject.editingMode,\n fontEdit: defaultSettingsObject.fontEdit,\n fontSize: defaultSettingsObject.fontSize,\n fontView: defaultSettingsObject.fontView,\n monacoEditorLanguage: defaultSettingsObject.monacoEditorLanguage,\n defaultSettings: defaultSettingsObject,\n },\n () => {\n if (debugMode) {\n console.log(\n 'AppendEditor.tsx: \\n - loadDefaultSettings() this.state.savingEditorOptions: ' +\n this.state.savingEditorOptions +\n '\\n defaultSettingsObject:',\n defaultSettingsObject,\n '\\n JSON.stringify(this.state.defaultSettings):',\n JSON.stringify(this.state.defaultSettings, null, ' ')\n );\n }\n this.refreshEditor();\n }\n );\n } else if (defaultEditingMode !== undefined) {\n /** This else if loads legacy default settings introduced in v1.1.0\n * We only need to check defaultEditingMode because it is never empty if it is defined\n * */\n const defaultCustomStyles = this.editorKit.internal.componentManager.componentDataValueForKey(\n 'customStyles'\n );\n const defaultFontEdit = this.editorKit.internal.componentManager.componentDataValueForKey(\n 'fontEdit'\n );\n const defaultFontSize = this.editorKit.internal.componentManager.componentDataValueForKey(\n 'fontSize'\n );\n const defaultFontView = this.editorKit.internal.componentManager.componentDataValueForKey(\n 'fontView'\n );\n const defaultMonacoEditorLanguage = this.editorKit.internal.componentManager.componentDataValueForKey(\n 'monacoEditorLanguage'\n );\n if (debugMode) {\n console.log(\n 'AppendEditor.tsx: \\n loadDefaultSetting():',\n 'else if (defaultEditingMode !== undefined) triggered',\n '\\n - default customStyles: ' + defaultCustomStyles,\n '\\n - typeof:',\n typeof defaultCustomStyles +\n '\\n - default fontSize: ' +\n defaultFontSize +\n '\\n - default fontEdit: ' +\n defaultFontEdit +\n '\\n - default fontView: ' +\n defaultFontView +\n '\\n - default monacoEditorLanguage: ' +\n defaultMonacoEditorLanguage\n );\n }\n this.setState(\n {\n customStyles: defaultCustomStyles,\n editingMode: defaultEditingMode,\n fontEdit: defaultFontEdit,\n fontSize: defaultFontSize,\n fontView: defaultFontView,\n monacoEditorLanguage: defaultMonacoEditorLanguage,\n defaultSettings: {\n customStyles: defaultCustomStyles,\n editingMode: defaultEditingMode,\n fontEdit: defaultFontEdit,\n fontSize: defaultFontSize,\n fontView: defaultFontView,\n monacoEditorLanguage: defaultMonacoEditorLanguage,\n },\n },\n () => {\n if (debugMode) {\n console.log(\n 'AppendEditor.tsx: \\n - loadDefaultSettings() this.state.savingEditorOptions: ' +\n this.state.savingEditorOptions\n );\n }\n this.refreshEditor();\n }\n );\n } else {\n if (debugMode) {\n console.log(\n 'AppendEditor.tsx: loadDefaultSettings(), else, current state:',\n JSON.stringify(this.state, null, ' ')\n );\n }\n this.refreshEditor();\n }\n } catch (error) {\n // Log outside debug mode\n console.log('Error loading default settings:', error);\n }\n };\n\n loadEditorOptions = () => {\n try {\n const menuOptionsString = this.editorKit.internal.componentManager.componentDataValueForKey(\n 'menuOptions'\n );\n if (menuOptionsString !== undefined) {\n const menuOptionsObject = JSON.parse(menuOptionsString) as menuOptions;\n this.setState(\n {\n borderlessMode: menuOptionsObject.borderlessMode,\n fixedHeightMode: menuOptionsObject.fixedHeightMode,\n fullWidthMode: menuOptionsObject.fullWidthMode,\n overflowMode: menuOptionsObject.overflowMode,\n //showMenuOptionsEdit: menuOptionsObject.showMenuOptionsEdit,\n //showMenuOptionsShare: menuOptionsObject.showMenuOptionsShare,\n //showMenuOptionsView: menuOptionsObject.showMenuOptionsView,\n },\n () => {\n this.refreshEditor();\n }\n );\n }\n } catch (error) {\n // Log outside debug mode\n console.log('Error loading editor options:', error);\n }\n };\n\n // This loads the Settings and Append Text\n loadMetaData = () => {\n this.editorKit.internal.componentManager.streamContextItem((note: any) => {\n // Load editor settings\n if (\n note.content.appendEditorCustomStyles ||\n note.content.appendEditorEditingMode ||\n note.content.appendEditorFontEdit ||\n note.content.appendEditorFontSize ||\n note.content.appendEditorFontView ||\n note.content.appendEditorMonacoEditorLanguage\n ) {\n this.setState(\n {\n customStyles: note.content.appendEditorCustomStyles,\n editingMode: note.content.appendEditorEditingMode,\n fontEdit: note.content.appendEditorFontEdit,\n fontSize: note.content.appendEditorFontSize,\n fontView: note.content.appendEditorFontView,\n monacoEditorLanguage: note.content.appendEditorMonacoEditorLanguage,\n },\n () => {\n if (debugMode) {\n console.log(\n 'AppendEditor.tsx: \\n - loadMetaData() this.state.savingEditorOptions: ' +\n this.state.savingEditorOptions\n );\n }\n this.refreshEditor();\n if (debugMode) {\n console.log(\n 'editorKit metadata loaded: ' +\n '\\n - loaded customStyles: ' +\n this.state.customStyles +\n '\\n - loaded editingMode: ' +\n this.state.editingMode +\n '\\n - loaded fontEdit: ' +\n this.state.fontEdit +\n '\\n - loaded fontSize: ' +\n this.state.fontSize +\n '\\n - loaded fontView: ' +\n this.state.fontView +\n '\\n - loaded monacoEditorLanguage: ' +\n this.state.monacoEditorLanguage\n );\n }\n }\n );\n }\n // Load append settings\n if (note.content.appendNewLine || note.content.appendNewParagraph) {\n this.setState({\n appendNewLine: note.content.appendNewLine,\n appendNewParagraph: note.content.appendNewParagraph,\n });\n }\n // Finally, load appendText\n this.setState(\n {\n appendText: note.content.appendText,\n },\n () => {\n /**If both text and appendText are empty,\n * such as when creating a new note,\n * and editMode is off,\n * then open the edit mode\n */\n if (\n !this.state.text &&\n !this.state.appendText &&\n !this.state.editMode\n ) {\n this.onEditMode();\n }\n }\n );\n if (debugMode) {\n console.log(\n ' - loaded append text: ' +\n this.state.appendText +\n '\\n - loaded append newline: ' +\n this.state.appendNewLine +\n '\\n - loaded append new paragraph: ' +\n this.state.appendNewParagraph +\n '\\n - loaded editorKit internal appendText: ' +\n this.editorKit.internal.note.content.appendText\n );\n }\n });\n };\n\n saveText = (text: string) => {\n this.saveNote(text);\n this.setState(\n {\n text: text,\n },\n () => {\n if (this.state.editingMode === EditingModes.useDynamicEditor) {\n this.refreshView();\n } else if (this.state.viewMode && isLongString(text)) {\n /** If the note text is long, then rendering its markdown will debounce\n * If the we stop editing for 550 milliseconds, then\n * automatically refresh the view to force the latest markdown to render\n * We use 550 because the debounce is 500.\n */\n if (this.saveTimer) {\n clearTimeout(this.saveTimer);\n }\n this.saveTimer = setTimeout(() => {\n if (this.state.fixedHeightMode) {\n /** This keeps the vertical scroll when refreshing view */\n const view = document.getElementById(HtmlElementId.view);\n if (view) {\n let scrollY = view.scrollTop;\n this.refreshView();\n /** We have to find the new view because\n * the previous one doesn't exist anymore */\n const refreshedView = document.getElementById(\n HtmlElementId.view\n );\n if (refreshedView) {\n refreshedView.scrollTop = scrollY;\n }\n } else {\n this.refreshView();\n }\n } else {\n this.refreshView();\n }\n }, 550);\n }\n if (debugMode) {\n console.log('AppendEditor.tsx: saved text:', this.state.text);\n }\n }\n );\n };\n\n saveNote = (text: string) => {\n // This will work in an SN context, but breaks the standalone editor, so we need to catch the error\n try {\n this.editorKit.onEditorValueChanged(text);\n } catch (error) {\n // Log outside debug mode\n console.log('Error saving note:', error);\n }\n };\n\n // Entry operations\n\n appendTextToNote = () => {\n // Do nothing if there's no append text\n if (this.state.appendText) {\n /*\n * We usually use this.editText() to save the main text\n * However, we want to save the main text and clear the appendText\n * Consecutive calls to the component manager does not work well,\n * so we want to do both with one call to the component manager\n * This means we need multiple versions of this function depending on what we want to save */\n const { appendText } = this.state;\n let textToAppend = '';\n // We test for new paragraph first even though new line is on top and is on by default\n if (this.state.appendNewParagraph) {\n textToAppend = ' \\n\\n' + appendText;\n } else if (this.state.appendNewLine) {\n textToAppend = ' \\n' + appendText;\n } else {\n textToAppend = appendText;\n }\n this.setState(\n {\n text: this.state.text.concat(textToAppend),\n appendText: '',\n },\n () => {\n let note = this.editorKit.internal.note;\n if (note) {\n this.editorKit.internal.componentManager.saveItemWithPresave(\n note,\n () => {\n note.content.text = this.state.text; // this.editorKit.internal.note.content.text\n note.content.appendText = this.state.appendText; // this.editorKit.internal.note.content.appendText\n }\n );\n }\n this.refreshEdit();\n // Refresh view mode if using dynamic\n if (this.state.editingMode === EditingModes.useDynamicEditor) {\n this.refreshView();\n setTimeout(() => {\n this.skipToBottom();\n }, 50);\n } else if (isLongString(this.state.text)) {\n setTimeout(() => {\n this.refreshView();\n this.skipToBottom();\n }, 550);\n } else {\n this.skipToBottom();\n }\n }\n );\n }\n // Refresh appendCodeMirror\n if (\n this.state.appendCodeMirror &&\n this.state.editingMode === EditingModes.useCodeMirror\n ) {\n this.state.appendCodeMirror.setValue('');\n }\n };\n\n autoSaveAppendText = (text: string) => {\n // This code is similar to this.onAppend();, but we only save the appendText and not the main text\n this.setState({\n appendText: text,\n });\n // This will work in an SN context, but breaks the standalone editor, so we need to catch the error\n try {\n let note = this.editorKit.internal.note;\n if (note) {\n this.editorKit.internal.componentManager.saveItemWithPresave(\n note,\n () => {\n note.content.appendText = text;\n }\n );\n }\n } catch (error) {\n // Log outside debug mode\n console.log('Error saving appendText:', error);\n }\n };\n\n autoSaveCheckBoxes = (newLine: boolean, newParagraph: boolean) => {\n // Here we save the appendText, appendNewLine, and appendNewParagraph\n // We have an additional function for this because we only call it when the user clicks a checkbox\n this.setState({\n appendNewLine: newLine,\n appendNewParagraph: newParagraph,\n });\n // This will work in an SN context, but breaks the standalone editor, so we need to catch the error\n try {\n let note = this.editorKit.internal.note;\n if (note) {\n this.editorKit.internal.componentManager.saveItemWithPresave(\n note,\n () => {\n note.content.appendNewLine = newLine;\n note.content.appendNewParagraph = newParagraph;\n }\n );\n }\n } catch (error) {\n // Log outside debug mode\n console.log('Error saving checkboxes:', error);\n }\n };\n\n refreshEdit = () => {\n this.setState(\n {\n refreshEdit: !this.state.refreshEdit,\n },\n () => {\n // We could also check for this.state.editMode,\n // but it might not be loaded yet.\n // Checking for editTextArea checks whether editMode has loaded\n const editTextArea = document.getElementById(\n HtmlElementId.editTextArea\n );\n if (\n editTextArea &&\n this.state.editingMode === EditingModes.useCodeMirror\n ) {\n this.configureCodeMirror(HtmlElementId.editTextArea);\n }\n }\n );\n };\n\n refreshView = () => {\n this.setState({\n refreshView: !this.state.refreshView,\n });\n };\n\n configureCodeMirror = (id: string) => {\n if (id === HtmlElementId.editTextArea) {\n if (debugMode) {\n console.log('this.state.text: ' + this.state.text);\n }\n const editTextArea = document.getElementById(id) as HTMLTextAreaElement;\n if (editTextArea) {\n const editCodeMirror = CodeMirror.fromTextArea(editTextArea, {\n autocorrect: true,\n autocapitalize: true,\n extraKeys: {\n Enter: 'newlineAndIndentContinueMarkdownList',\n 'Alt-F': 'findPersistent',\n },\n lineNumbers: false,\n lineWrapping: true,\n mode: 'gfm',\n spellcheck: true,\n //@ts-ignore\n styleSelectedText: true,\n tabindex: 0,\n theme: 'default',\n value: this.state.text,\n });\n editCodeMirror.setSize('100%', '100%');\n editCodeMirror.on('change', () => {\n const editCodeMirrorText = editCodeMirror.getValue();\n if (debugMode) {\n console.log('editCodeMirror value: ' + editCodeMirrorText);\n }\n editCodeMirror.save();\n this.saveText(editCodeMirrorText);\n });\n editCodeMirror.on('keydown', (cm: Editor, event: KeyboardEvent) => {\n this.onKeyDown(event);\n this.onKeyDownEditTextArea(event);\n this.onKeyDownTextArea(event);\n });\n editCodeMirror.on('keyup', (cm: Editor, event: KeyboardEvent) => {\n this.onKeyUp(event);\n });\n this.setState({\n editCodeMirror: editCodeMirror,\n });\n }\n } else if (id === HtmlElementId.appendTextArea) {\n const appendTextArea = document.getElementById(\n HtmlElementId.appendTextArea\n ) as HTMLTextAreaElement;\n if (appendTextArea) {\n const appendCodeMirror = CodeMirror.fromTextArea(appendTextArea, {\n autocorrect: true,\n autocapitalize: true,\n extraKeys: {\n Enter: 'newlineAndIndentContinueMarkdownList',\n 'Alt-F': 'findPersistent',\n },\n lineNumbers: false,\n lineWrapping: true,\n mode: 'gfm',\n spellcheck: true,\n //@ts-ignore\n styleSelectedText: true,\n tabindex: 0,\n theme: 'default',\n value: this.state.appendText,\n });\n appendCodeMirror.setSize('100%', '100%');\n appendCodeMirror.on('change', () => {\n const appendCodeMirrorText = appendCodeMirror.getValue();\n appendCodeMirror.save();\n this.autoSaveAppendText(appendCodeMirrorText);\n });\n appendCodeMirror.on('keydown', (cm: Editor, event: KeyboardEvent) => {\n this.onKeyDown(event);\n this.onKeyDownAppendTextArea(event);\n this.onKeyDownTextArea(event);\n });\n appendCodeMirror.on('keyup', (cm: Editor, event: KeyboardEvent) => {\n this.onKeyUp(event);\n });\n this.setState({\n appendCodeMirror: appendCodeMirror,\n });\n }\n }\n };\n\n makeContentEditable = () => {\n const content = document.getElementById(HtmlElementId.content);\n if (content) {\n content.setAttribute('contenteditable', 'true');\n content.setAttribute('spellcheck', 'true');\n }\n const appendix = document.getElementById(HtmlElementId.appendix);\n if (appendix) {\n appendix.setAttribute('contenteditable', 'true');\n appendix.setAttribute('spellcheck', 'true');\n }\n // Change contenteditable to false for rendered note\n const renderedNote = document.getElementById('renderedNote');\n if (renderedNote) {\n renderedNote.setAttribute('contenteditable', 'false');\n }\n const appendCustom = document.getElementById('appendCustom');\n if (appendCustom) {\n appendCustom.setAttribute('contenteditable', 'false');\n }\n };\n\n removeContentEditable = (id: string) => {\n const container = document.getElementById(id);\n if (container) {\n container.setAttribute('contenteditable', 'false');\n }\n };\n\n // Event Handlers\n onEditMode = () => {\n // if Append box is empty, close it and open Edit mode\n // if Edit mode is on, then close it, open View mode, and Append mode\n if (!this.state.editMode) {\n if (this.state.appendMode && !this.state.appendText) {\n this.setState({\n appendMode: false,\n });\n }\n this.setState(\n {\n editMode: true,\n },\n () => {\n const editTextArea = document.getElementById(\n HtmlElementId.editTextArea\n );\n if (editTextArea) {\n editTextArea.focus();\n if (this.state.editingMode === EditingModes.useCodeMirror) {\n this.configureCodeMirror(HtmlElementId.editTextArea);\n }\n }\n }\n );\n } else if (this.state.editMode) {\n /**If edit mode is on and Monaco Editor is off,\n * then turn edit mode off and turn view mode on.\n * This automatically renders the text. We do not\n * do this when Monaco is on because refreshing edit Mode\n * with Monaco Editor off allows us to resize the Monaco Editor.\n */\n if (!(this.state.editingMode === EditingModes.useMonacoEditor)) {\n this.setState({\n viewMode: true,\n });\n }\n if (this.state.editCodeMirror) {\n this.state.editCodeMirror.toTextArea();\n }\n this.setState(\n {\n editMode: false,\n },\n () => {\n // if not using append mode, focus on editButton\n if (!this.state.appendMode) {\n const editButton = document.getElementById(\n HtmlElementId.editButton\n );\n if (editButton) {\n editButton.focus();\n }\n }\n }\n );\n }\n };\n\n onAppendMode = (scrollDown = true, closeEdit = true, focus = true) => {\n if (!this.state.appendMode) {\n if (closeEdit) {\n this.setState({\n editMode: false,\n });\n }\n this.setState(\n {\n appendMode: true,\n },\n () => {\n if (scrollDown) {\n this.scrollToBottom();\n }\n if (focus) {\n const appendTextArea = document.getElementById(\n HtmlElementId.appendTextArea\n );\n if (appendTextArea) {\n appendTextArea.focus();\n if (this.state.editingMode === EditingModes.useCodeMirror) {\n this.configureCodeMirror(HtmlElementId.appendTextArea);\n }\n }\n }\n }\n );\n } else if (this.state.appendMode) {\n if (this.state.appendCodeMirror) {\n this.state.appendCodeMirror.toTextArea();\n }\n this.setState(\n {\n appendMode: false,\n },\n () => {\n if (this.state.editingMode === EditingModes.useMonacoEditor) {\n this.refreshEdit();\n }\n if (focus) {\n const appendButton = document.getElementById(\n HtmlElementId.appendButton\n );\n if (appendButton) {\n appendButton.focus();\n }\n }\n }\n );\n }\n };\n\n onViewMode = () => {\n if (!this.state.viewMode) {\n this.setState(\n {\n viewMode: true,\n },\n () => {\n if (this.state.editingMode === EditingModes.useMonacoEditor) {\n this.refreshEdit();\n }\n if (this.state.appendMode && !this.state.editMode) {\n this.skipToBottom();\n }\n }\n );\n }\n if (this.state.viewMode) {\n this.setState(\n {\n viewMode: false,\n },\n () => {\n if (this.state.editingMode === EditingModes.useMonacoEditor) {\n this.refreshEdit();\n }\n if (!this.state.editMode && !this.state.appendMode) {\n this.onEditMode();\n }\n }\n );\n }\n };\n\n toggleShowHelp = () => {\n if (!this.state.showHelp) {\n this.setState(\n {\n showHelp: true,\n },\n () => {\n if (!this.state.viewMode) {\n this.onViewMode();\n } else if (this.state.viewMode) {\n this.refreshView();\n }\n const helpButton = document.getElementById(HtmlElementId.helpButton);\n if (helpButton) {\n helpButton.focus();\n }\n setTimeout(() => {\n this.scrollToTop();\n }, 50);\n }\n );\n } else {\n this.setState(\n {\n showHelp: false,\n },\n () => {\n this.refreshView();\n const helpButton = document.getElementById(HtmlElementId.helpButton);\n if (helpButton) {\n helpButton.focus();\n }\n }\n );\n }\n };\n\n toggleShowMenu = () => {\n this.setState(\n {\n showMenu: !this.state.showMenu,\n },\n () => {\n const menuButton = document.getElementById(HtmlElementId.menuButton);\n if (menuButton) {\n menuButton.focus();\n }\n }\n );\n };\n\n loadDefaultMenuState = () => {\n this.setState({\n showMenuOptionsEdit: false,\n showMenuOptionsShare: true,\n showMenuOptionsView: true,\n });\n };\n\n toggleShowMenuOptionsEdit = () => {\n this.setState({ showMenuOptionsEdit: !this.state.showMenuOptionsEdit });\n };\n\n toggleShowMenuOptionsShare = () => {\n this.setState({ showMenuOptionsShare: !this.state.showMenuOptionsShare });\n };\n\n toggleShowMenuOptionsView = () => {\n this.setState({ showMenuOptionsView: !this.state.showMenuOptionsView });\n };\n\n toggleBorderlessMode = () => {\n this.setState(\n {\n borderlessMode: !this.state.borderlessMode,\n },\n () => {\n this.activateFixedHeader();\n this.saveMenuOptions();\n }\n );\n };\n\n toggleFixedHeightMode = () => {\n this.setState(\n {\n fixedHeightMode: !this.state.fixedHeightMode,\n },\n () => {\n this.activateFixedHeader();\n this.saveMenuOptions();\n }\n );\n };\n\n toggleFullWidthMode = () => {\n this.setState(\n {\n fullWidthMode: !this.state.fullWidthMode,\n },\n () => {\n this.activateFixedHeader();\n this.saveMenuOptions();\n }\n );\n };\n\n toggleOverflowMode = () => {\n this.setState(\n {\n overflowMode: !this.state.overflowMode,\n },\n () => {\n this.activateFixedHeader();\n this.saveMenuOptions();\n }\n );\n };\n\n saveMenuOptions = () => {\n let currentMenuOptions: menuOptions;\n currentMenuOptions = {\n borderlessMode: this.state.borderlessMode,\n fixedHeightMode: this.state.fixedHeightMode,\n fullWidthMode: this.state.fullWidthMode,\n overflowMode: this.state.overflowMode,\n /**These are turned off to prevent excess re-rendering of the note when opening/closing the menu */\n //showMenuOptionsEdit: this.state.showMenuOptionsEdit,\n //showMenuOptionsShare: this.state.showMenuOptionsShare,\n //showMenuOptionsView: this.state.showMenuOptionsView,\n };\n this.saveEditorOption('menuOptions', JSON.stringify(currentMenuOptions));\n };\n\n saveEditorOption = (\n optionKey: string,\n optionValue: string | boolean | undefined\n ) => {\n this.setState(\n {\n savingEditorOptions: true,\n },\n () => {\n try {\n this.editorKit.internal.componentManager.setComponentDataValueForKey(\n optionKey,\n optionValue\n );\n /** this.configureEditorKit() is triggered\n * every time setComponentDataValueForKey is triggered, but\n * savingEditorOptions prevents the callback from triggering.\n * Then, after the timeout, the new default settings or options can\n * take into effect immediately.\n * However, if you switch the note within the timeout, you will get an error.\n * I have tried 150 and 200 but they both are not long enough. 250 is short enough\n * to work, but not long enough to be easily noticeable.\n * We do not load editor options because they are optional and persist through\n * this.configureEditorKit().\n * */\n setTimeout(() => {\n this.setState(\n {\n savingEditorOptions: false,\n },\n () => {\n this.loadDefaultSettings();\n this.loadMetaData();\n }\n );\n }, 250);\n } catch (error) {\n console.log(\n 'Error saving editor option. Your optionKey:',\n optionKey,\n '\\n - Your optionValue: ',\n optionValue,\n '\\n - The error: ',\n error\n );\n this.setState(\n {\n savingEditorOptions: false,\n },\n () => {\n /** We use refreshEditor() if there's an error (such as in the demo)\n * But not in the actual editor because loadDefaultSettings and loadMetaData\n * will run refreshEditor() twice, and if there's no issue saving editor options,\n * then there's probably no issue loading default settings and metadata.\n * */\n this.refreshEditor();\n this.loadDefaultSettings();\n this.loadMetaData();\n }\n );\n }\n }\n );\n };\n\n onSettingsMode = () => {\n // Here we save the current state. We reload the current state if we cancel and after we save\n if (!this.state.settingsMode) {\n this.removeFixedHeader();\n this.setState(\n {\n currentState: this.state,\n },\n () => {\n /** Turn everything off and turn Settings on */\n this.setState(\n {\n appendMode: false,\n editMode: false,\n fullWidthMode: false,\n fixedHeightMode: false,\n settingsMode: true,\n showAppendix: false, // Hides the scroll up/down buttons\n showHeader: false,\n showMenu: false,\n viewMode: false,\n },\n () => {\n const undoDialog = document.getElementById('undoDialog');\n if (undoDialog) {\n undoDialog.focus();\n }\n }\n );\n }\n );\n } else if (this.state.settingsMode) {\n this.setState(\n {\n ...this.state.currentState,\n settingsMode: false,\n },\n () => {\n this.refreshEdit();\n const settingsButton = document.getElementById(\n HtmlElementId.settingsButton\n );\n if (settingsButton) {\n settingsButton.focus();\n }\n }\n );\n }\n };\n\n /** Restore current state but change the items that are saved from the Settings.\n * It's important to restore the current state to restore items that were turned off, such as\n * fixedHeight and fullWidth.\n */\n onSaveSettings = ({\n customStyles,\n editingMode,\n fontEdit,\n fontSize,\n fontView,\n monacoEditorLanguage,\n saveAsDefault,\n }: SaveSettingsInterface) => {\n this.setState(\n {\n ...this.state.currentState,\n customStyles,\n editingMode,\n fontEdit,\n fontSize,\n fontView,\n monacoEditorLanguage,\n showAppendix: true,\n showHeader: true,\n settingsMode: false,\n },\n () => {\n this.refreshEditor();\n const settingsButton = document.getElementById(\n HtmlElementId.settingsButton\n );\n if (settingsButton) {\n settingsButton.focus();\n }\n }\n );\n let note = this.editorKit.internal.note;\n if (note) {\n if (debugMode) {\n console.log(\n 'AppendEditor.tsx: \\n - onSaveSettings() this.editorKit.internal.componentManager.saveItemWithPresave() triggered'\n );\n }\n this.editorKit.internal.componentManager.saveItemWithPresave(note, () => {\n note.content.appendEditorCustomStyles = customStyles;\n note.content.appendEditorEditingMode = editingMode;\n note.content.appendEditorFontEdit = fontEdit;\n note.content.appendEditorFontSize = fontSize;\n note.content.appendEditorFontView = fontView;\n note.content.appendEditorMonacoEditorLanguage = monacoEditorLanguage;\n });\n if (debugMode) {\n console.log(\n 'AppendEditor.tsx: \\n - onSaveSettings() this.editorKit.internal.componentManager.saveItemWithPresave() completed'\n );\n }\n }\n if (saveAsDefault) {\n this.setState(\n {\n defaultSettings: {\n customStyles,\n editingMode,\n fontEdit,\n fontSize,\n fontView,\n monacoEditorLanguage,\n },\n },\n () => {\n if (debugMode) {\n console.log(\n 'AppendEditor.tsx: \\n - onSaveSettings() this.state.savingEditorOptions: ' +\n this.state.savingEditorOptions +\n '\\n JSON.stringify(this.state.defaultSettings):',\n JSON.stringify(this.state.defaultSettings)\n );\n }\n this.saveEditorOption(\n 'defaultSettings',\n JSON.stringify(this.state.defaultSettings)\n );\n }\n );\n }\n };\n\n activateStyles = () => {\n if (debugMode) {\n console.log('AppendEditor.tsx: \\n - this.activateStyles() triggered');\n }\n const sheetToBeRemoved = document.getElementById('customStyleSheet');\n if (sheetToBeRemoved) {\n const sheetParent = sheetToBeRemoved.parentNode;\n if (sheetParent) {\n sheetParent.removeChild(sheetToBeRemoved);\n }\n }\n // Follow the order that appears in the Settings to make the Settings cascade\n let fontSizeStyle = '';\n if (this.state.fontSize) {\n fontSizeStyle =\n '.CodeMirror, .DynamicEditor, .MonacoEditorContainer, .ProseMirror, #editTextArea, #appendTextArea, #renderedNote {font-size: ' +\n this.state.fontSize +\n ';}\\n';\n }\n let fontEditStyle = '';\n if (this.state.fontEdit) {\n fontEditStyle =\n '.CodeMirror, .DynamicEditor, .ProseMirror, #editTextArea, #appendTextArea {font-family: ' +\n this.state.fontEdit +\n ';}\\n';\n }\n let fontViewStyle = '';\n if (this.state.fontView) {\n fontViewStyle =\n '#renderedNote {font-family: ' + this.state.fontView + ';}\\n';\n }\n if (\n this.state.customStyles ||\n this.state.fontEdit ||\n this.state.fontSize ||\n this.state.fontView\n ) {\n const sheet = document.createElement('style');\n sheet.setAttribute('id', 'customStyleSheet');\n // Follow the order that appears in the Settings to make the Settings cascade\n sheet.innerHTML =\n fontSizeStyle + fontEditStyle + fontViewStyle + this.state.customStyles;\n document.body.appendChild(sheet);\n }\n };\n\n onCancelPrint = () => {\n this.setState(\n {\n confirmPrintUrl: false,\n },\n () => {\n const printButton = document.getElementById(HtmlElementId.printButton);\n if (printButton) {\n printButton.focus();\n }\n }\n );\n };\n\n onConfirmPrintUrl = () => {\n this.setState(\n {\n confirmPrintUrl: true,\n },\n () => {\n const undoDialog = document.getElementById('undoDialog');\n if (undoDialog) {\n undoDialog.focus();\n }\n }\n );\n };\n\n onPrintUrlTrue = () => {\n this.setState(\n {\n confirmPrintUrl: false,\n printURL: true,\n },\n () => {\n this.printRenderedHtml();\n }\n );\n };\n\n onPrintUrlFalse = () => {\n this.setState(\n {\n confirmPrintUrl: false,\n printURL: false,\n },\n () => {\n this.printRenderedHtml();\n }\n );\n };\n\n printRenderedHtml = () => {\n window.print();\n const printButton = document.getElementById(HtmlElementId.printButton);\n if (printButton) {\n printButton.focus();\n }\n };\n\n goDown = () => {\n document.body.scrollTop = 10000000; // for Safari\n if (this.state.editMode) {\n const editTextArea = document.getElementById(HtmlElementId.editTextArea);\n if (editTextArea) {\n editTextArea.scrollTop = 10000000;\n }\n }\n if (this.state.appendMode) {\n const appendTextArea = document.getElementById(\n HtmlElementId.appendTextArea\n );\n if (appendTextArea) {\n appendTextArea.scrollTop = 10000000;\n }\n }\n if (this.state.fixedHeightMode) {\n const view = document.getElementById(HtmlElementId.view);\n if (view) {\n view.scrollTop = 10000000;\n }\n /** Need edit for Dynamic */\n const edit = document.getElementById(HtmlElementId.edit);\n if (edit) {\n edit.scrollTop = 10000000;\n }\n /** Scroll down for CodeMirror */\n const codeMirrorList = document.getElementsByClassName(\n 'CodeMirror-vscrollbar'\n );\n const codeMirrorEditMode = codeMirrorList[0];\n if (codeMirrorEditMode) {\n codeMirrorEditMode.scrollTop = 10000000;\n }\n }\n };\n\n scrollToBottom = () => {\n this.goDown();\n const appendix = document.getElementById(HtmlElementId.appendix);\n if (appendix) {\n appendix.scrollIntoView({\n behavior: 'smooth',\n block: 'end', // Bottom\n inline: 'nearest',\n });\n }\n };\n\n // Skip to Bottom is fast \"auto\" behavior instead of \"smooth\" behavior\n skipToBottom = () => {\n this.goDown();\n const appendix = document.getElementById(HtmlElementId.appendix);\n if (appendix) {\n appendix.scrollIntoView({\n behavior: 'auto',\n block: 'end', // Bottom\n inline: 'nearest',\n });\n }\n };\n\n goUp = () => {\n document.body.scrollTop = 0; // for Safari\n if (this.state.editMode) {\n const editTextArea = document.getElementById(HtmlElementId.editTextArea);\n if (editTextArea) {\n editTextArea.scrollTop = 0;\n }\n }\n if (this.state.appendMode) {\n const appendTextArea = document.getElementById(\n HtmlElementId.appendTextArea\n );\n if (appendTextArea) {\n appendTextArea.scrollTop = 0;\n }\n }\n if (this.state.fixedHeightMode) {\n const view = document.getElementById(HtmlElementId.view);\n if (view) {\n view.scrollTop = 0;\n }\n /** Need edit for Dynamic */\n const edit = document.getElementById(HtmlElementId.edit);\n if (edit) {\n edit.scrollTop = 0;\n }\n /** Scroll up for CodeMirror */\n const codeMirrorList = document.getElementsByClassName(\n 'CodeMirror-vscrollbar'\n );\n const codeMirrorEditMode = codeMirrorList[0];\n if (codeMirrorEditMode) {\n codeMirrorEditMode.scrollTop = 0;\n }\n }\n };\n\n scrollToTop = () => {\n this.goUp();\n const top = document.getElementById('top');\n if (top) {\n top.scrollIntoView({\n behavior: 'smooth',\n block: 'start', // Top\n inline: 'nearest',\n });\n }\n };\n\n // Need both content and appendix for mobile\n // Skip to Bottom is fast \"auto\" behavior instead of \"smooth\" behavior\n skipToTop = () => {\n this.goUp();\n const top = document.getElementById('top');\n if (top) {\n top.scrollIntoView({\n behavior: 'auto',\n block: 'start', // Top\n inline: 'nearest',\n });\n }\n };\n\n onKeyDown = (e: React.KeyboardEvent | KeyboardEvent) => {\n keyMap.set(e.key, true);\n // Click the top Append if 'Control' and 'e' are pressed\n if (keyMap.get('Control') && keyMap.get('e')) {\n e.preventDefault();\n this.onEditMode();\n }\n // Click the top Append if 'Control' and 'u' are pressed\n else if (\n keyMap.get('Control') &&\n !keyMap.get('Alt') &&\n (keyMap.get('u') || keyMap.get('m'))\n ) {\n e.preventDefault();\n this.onAppendMode();\n }\n // Click view if 'Control' and 'p' are pressed\n else if (keyMap.get('Control') && !keyMap.get('Alt') && keyMap.get('p')) {\n e.preventDefault();\n this.onViewMode();\n } else if (keyMap.get('Control') && keyMap.get('.')) {\n e.preventDefault();\n this.setState({\n appendRows: this.state.appendRows + 1,\n });\n } else if (keyMap.get('Control') && keyMap.get(',')) {\n e.preventDefault();\n if (this.state.appendRows > 5) {\n this.setState({\n appendRows: this.state.appendRows - 1,\n });\n }\n } else if (keyMap.get('Control') && keyMap.get('<')) {\n // Edit only mode\n e.preventDefault();\n this.setState(\n {\n appendMode: false,\n editMode: false,\n viewMode: false,\n },\n () => {\n this.onEditMode();\n }\n );\n } else if (keyMap.get('Control') && keyMap.get('>')) {\n // Append only mode\n e.preventDefault();\n this.setState(\n {\n appendMode: false,\n editMode: false,\n viewMode: false,\n },\n () => {\n this.onAppendMode();\n }\n );\n } else if (keyMap.get('Control') && keyMap.get('[')) {\n e.preventDefault();\n this.skipToTop();\n } else if (keyMap.get('Control') && keyMap.get(']')) {\n e.preventDefault();\n this.skipToBottom();\n } else if (\n keyMap.get('Control') &&\n !keyMap.get('Alt') &&\n !keyMap.get('Shift') &&\n keyMap.get('w')\n ) {\n keyMap.delete('w');\n }\n };\n\n onKeyDownAppendTextArea = (e: React.KeyboardEvent | KeyboardEvent) => {\n // Close Append Mode if 'Escape' is pressed\n if (keyMap.get('Escape')) {\n e.preventDefault();\n keyMap.delete('Escape');\n this.onAppendMode();\n }\n // Save note if Control and Enter are pressed\n else if (keyMap.get('Control') && keyMap.get('Enter')) {\n e.preventDefault();\n if (this.state.editingMode === EditingModes.useCodeMirror) {\n this.appendTextToNote();\n }\n }\n // Save note if Control and S are pressed\n else if (keyMap.get('Control') && keyMap.get('s')) {\n e.preventDefault();\n if (this.state.editingMode === EditingModes.useCodeMirror) {\n this.appendTextToNote();\n }\n }\n // Toggle Append New Line if Ctrl + Alt + N are pressed\n else if (\n keyMap.get('Control') &&\n !keyMap.get('Shift') &&\n keyMap.get('Alt') &&\n keyMap.get('n')\n ) {\n e.preventDefault();\n const newLine = document.getElementById(HtmlElementId.newLine);\n if (newLine) {\n newLine.click();\n }\n }\n // Toggle Append New Line if Ctrl + Alt + P are pressed\n else if (\n keyMap.get('Control') &&\n !keyMap.get('Shift') &&\n keyMap.get('Alt') &&\n keyMap.get('p')\n ) {\n e.preventDefault();\n const newParagraph = document.getElementById(HtmlElementId.newParagraph);\n if (newParagraph) {\n newParagraph.click();\n }\n }\n };\n\n onKeyDownEditTextArea = (e: React.KeyboardEvent | KeyboardEvent) => {\n // Close EditMode if 'Escape' is pressed\n if (keyMap.get('Escape')) {\n e.preventDefault();\n keyMap.set('Escape', false);\n this.onEditMode();\n }\n };\n\n onKeyDownTextArea = (e: React.KeyboardEvent | KeyboardEvent) => {\n // Add two spaces and line break if Shift and Enter are pressed\n if (keyMap.get('Shift') && keyMap.get('Enter')) {\n e.preventDefault();\n document.execCommand('insertText', false, ' \\n');\n }\n // Add two stars if Control + b are pressed\n else if (keyMap.get('Control') && keyMap.get('b')) {\n e.preventDefault();\n document.execCommand('insertText', false, '**');\n }\n // Add header when pressing Control + H\n else if (keyMap.get('Control') && keyMap.get('h')) {\n e.preventDefault();\n document.execCommand('insertText', false, '#');\n }\n // Add image code if Control + Alt and i are pressed\n else if (keyMap.get('Control') && keyMap.get('Alt') && keyMap.get('i')) {\n e.preventDefault();\n document.execCommand('insertText', false, '![]()');\n }\n // Add one stars if Control + i is pressed\n else if (keyMap.get('Control') && keyMap.get('i')) {\n e.preventDefault();\n document.execCommand('insertText', false, '*');\n }\n // Add inline code if Control + Alt and k are pressed\n else if (keyMap.get('Control') && keyMap.get('Alt') && keyMap.get('k')) {\n e.preventDefault();\n document.execCommand('insertText', false, '`');\n }\n // Add link if Control + k are pressed\n else if (keyMap.get('Control') && keyMap.get('k')) {\n e.preventDefault();\n document.execCommand('insertText', false, '[]()');\n }\n // Add ordered list item if Control + Alt + l are pressed\n else if (keyMap.get('Control') && keyMap.get('Alt') && keyMap.get('l')) {\n e.preventDefault();\n document.execCommand('insertText', false, '\\n1. ');\n }\n // Add unordered list item if Control + l are pressed\n else if (keyMap.get('Control') && keyMap.get('l')) {\n e.preventDefault();\n document.execCommand('insertText', false, '\\n- ');\n }\n // Add strike through if Control + Alt + u are pressed\n else if (keyMap.get('Control') && keyMap.get('Alt') && keyMap.get('u')) {\n e.preventDefault();\n document.execCommand('insertText', false, '~~');\n }\n // Add quote Control + q, Control + ' or Control + \" are pressed\n else if (\n (keyMap.get('Control') && keyMap.get('q')) ||\n (keyMap.get('Control') && keyMap.get(\"'\")) ||\n (keyMap.get('Control') && keyMap.get('\"'))\n ) {\n e.preventDefault();\n document.execCommand('insertText', false, '\\n> ');\n }\n };\n\n onKeyUp = (e: React.KeyboardEvent | KeyboardEvent) => {\n keyMap.delete(e.key);\n };\n\n onBlur = (e: React.FocusEvent) => {\n keyMap.clear();\n };\n\n onScroll = (e: Event) => {\n if (!this.state.settingsMode) {\n if (window.scrollY < last_known_scroll_position) {\n // If scrolling up, fix header\n this.activateFixedHeader();\n } else if (\n // If scrolling down, unfix header\n window.scrollY > last_known_scroll_position &&\n !this.state.showMenu\n ) {\n this.removeFixedHeader();\n }\n last_known_scroll_position = window.scrollY;\n }\n };\n\n activateFixedHeader = () => {\n const header = document.getElementById(HtmlElementId.header);\n const content = document.getElementById(HtmlElementId.content);\n // Activate only if we have both\n if (header && content) {\n header.classList.add(HtmlClassName.fixed);\n content.classList.add(HtmlClassName.fixedHeader);\n }\n };\n\n removeFixedHeader = () => {\n const header = document.getElementById(HtmlElementId.header);\n const content = document.getElementById(HtmlElementId.content);\n /** Remove both even if you don't have both\n * This is needed for loading settings\n */\n if (header) {\n header.classList.remove(HtmlClassName.fixed);\n }\n if (content) {\n content.classList.remove(HtmlClassName.fixedHeader);\n }\n };\n\n render() {\n return [\n ,\n \n {this.state.showHeader && [\n
\n
\n \n \n \n \n \n \n this.onAppendMode()}\n title=\"Toggle Append Mode\"\n className={\n 'sk-button ' + (this.state.appendMode ? 'on' : 'off')\n }\n >\n \n \n
\n \n \n \n
\n \n \n \n \n \n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
,\n ]}\n \n {this.state.showMenu && (\n \n \n \n )}\n {this.state.settingsMode && (\n \n \n \n )}\n {this.state.editMode && !this.state.refreshEdit && (\n \n \n \n )}\n {this.state.editMode && this.state.refreshEdit && (\n \n \n \n )}\n {this.state.viewMode && !this.state.refreshView && (\n \n \n \n )}\n {this.state.viewMode && this.state.refreshView && (\n \n \n \n )}\n {this.state.confirmPrintUrl && (\n \n {' '}\n \n )}\n\n {this.state.showDiff && [\n \n \n ,\n ]}\n \n {this.state.showAppendix && [\n \n {this.state.appendMode && (\n \n \n \n )}\n \n
\n \n \n
\n \n ,\n ]}\n ,\n ];\n }\n}\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.scss';\nimport * as serviceWorker from './serviceWorker';\nimport reportWebVitals from './reportWebVitals';\n\nimport AppendEditor from './components/AppendEditor';\nimport './stylesheets/main.scss';\nReactDOM.render(\n \n \n ,\n document.getElementById('root')\n);\n\n// If you want your app to work offline and load faster, you can change\n// unregister() to register() below. Note this comes with some pitfalls.\n// Learn more about service workers: https://bit.ly/CRA-PWA\nserviceWorker.unregister();\n\n// If you want to start measuring performance in your app, pass a function\n// to log results (for example: reportWebVitals(console.log))\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\nreportWebVitals();\n"],"sourceRoot":""} \ No newline at end of file diff --git a/src/components/AppendEditor.tsx b/src/components/AppendEditor.tsx index f1a89ad5..aaa60542 100644 --- a/src/components/AppendEditor.tsx +++ b/src/components/AppendEditor.tsx @@ -1490,14 +1490,14 @@ export default class AppendEditor extends React.Component<{}, AppendInterface> { if (edit) { edit.scrollTop = 10000000; } - } - /** Scroll down for CodeMirror */ - const codeMirrorList = document.getElementsByClassName( - 'CodeMirror-vscrollbar' - ); - const codeMirrorEditMode = codeMirrorList[0]; - if (codeMirrorEditMode) { - codeMirrorEditMode.scrollTop = 10000000; + /** Scroll down for CodeMirror */ + const codeMirrorList = document.getElementsByClassName( + 'CodeMirror-vscrollbar' + ); + const codeMirrorEditMode = codeMirrorList[0]; + if (codeMirrorEditMode) { + codeMirrorEditMode.scrollTop = 10000000; + } } }; @@ -1552,14 +1552,14 @@ export default class AppendEditor extends React.Component<{}, AppendInterface> { if (edit) { edit.scrollTop = 0; } - } - /** Scroll up for CodeMirror */ - const codeMirrorList = document.getElementsByClassName( - 'CodeMirror-vscrollbar' - ); - const codeMirrorEditMode = codeMirrorList[0]; - if (codeMirrorEditMode) { - codeMirrorEditMode.scrollTop = 0; + /** Scroll up for CodeMirror */ + const codeMirrorList = document.getElementsByClassName( + 'CodeMirror-vscrollbar' + ); + const codeMirrorEditMode = codeMirrorList[0]; + if (codeMirrorEditMode) { + codeMirrorEditMode.scrollTop = 0; + } } };