@innoviatech/lexical-text-editor 2.0.1 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +237 -236
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lexical-editor.css +1 -1
- package/package.json +1 -1
- package/src/components/AlignmentSelectionList.tsx +2 -2
- package/src/components/ColorPicker.tsx +1 -1
- package/src/components/ContentPreview.tsx +2 -1
- package/src/components/DropdownList.tsx +2 -2
- package/src/components/HeadingSelectionList.tsx +2 -2
- package/src/components/LinkModal.tsx +4 -4
- package/src/components/common/Dialog.tsx +1 -1
- package/src/nodes/ImageNode.tsx +0 -3
- package/src/plugins/ImagePlugin.tsx +4 -4
- package/src/plugins/ListPlugin.tsx +2 -2
- package/src/plugins/ToolbarPlugin.tsx +3 -3
- package/src/plugins/VideoPlugin.tsx +2 -3
- package/src/styles/lexical-editor.css +3 -3
package/dist/lexical-editor.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.lexical-text-editor *{box-sizing:border-box;font-family:inherit;height:fit-content}.lexical-text-editor button{background:transparent;border:1px solid transparent;cursor:pointer}.lexical-text-editor a{color:#646cff;font-weight:500;text-decoration:inherit}.lexical-text-editor a:hover{color:#535bf2}.lexical-text-editor{background-color:#fff;border:1px solid #e5e7eb;border-radius:.5rem;color:#000;font-size:16px!important;padding-bottom:.5rem;scrollbar-color:#9ca3af transparent;scrollbar-width:thin}.lexical-text-editor input{background-color:#fff;color:#000;outline:none}.link-editor-buttons input{stroke:#000;background-color:#220909;color:#000;outline:none}.lexical-text-editor input:focus{border:1px solid #676666}.lexical-toolbar-wrapper{align-items:center;display:flex;flex-wrap:wrap;gap:6px;justify-content:center;row-gap:12px}.lexical-toolbar-wrapper.useScroll{flex-wrap:nowrap}.lexical-text-editor::-webkit-scrollbar{width:6px}.lexical-text-editor::-webkit-scrollbar-track{background:transparent}.lexical-text-editor::-webkit-scrollbar-thumb{background-color:#9ca3af;border-radius:3px}.lexical-text-editor::-webkit-scrollbar-thumb:hover{background-color:#6b7280}.lexical-text-editor [contenteditable=true]{outline:none}.lexical-text-editor h1{font-size:32px;font-weight:700;margin:8px 0}.lexical-text-editor h2{font-size:28.8px;font-weight:700;margin:8px 0}.lexical-text-editor h3{font-size:25.6px;font-weight:700;margin:3.2px 0}.lexical-text-editor h4{font-size:22.4px;font-weight:700;margin:3.2px 0}.lexical-text-editor h5{font-size:19.2px;font-weight:700;margin:3.2px 0}.lexical-text-editor h6{font-size:16px;font-weight:700;margin:3.2px 0}.scrollbar-thin{scrollbar-color:#a5acb6 transparent;scrollbar-width:thin}.scrollbar-thin::-webkit-scrollbar{height:4px;width:4px}.scrollbar-thin::-webkit-scrollbar-track{background:transparent}.scrollbar-thin::-webkit-scrollbar-thumb{background-color:#a5acb6;border-radius:9999px}.lexical-editor-container{box-sizing:border-box;position:relative}.lexical-toolbar-container{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;padding-left:.5rem;padding-right:.5rem}.lexical-editor-inner{height:100%;position:relative}.lexical-content-editable{background-color:#fff;box-sizing:border-box;color:#000;font-size:14px;height:100%;outline:0;overflow:auto;padding:8px;scrollbar-color:#9ca3af transparent;scrollbar-width:thin;text-align:start;width:100%}.lexical-placeholder{color:#999;font-size:14px;left:10px;pointer-events:none;position:absolute;top:8px;user-select:none}.lexical-content-editable::-webkit-scrollbar{height:8px;width:8px}.lexical-content-editable::-webkit-scrollbar-track{background:#f1f1f1;border-radius:4px}.lexical-content-editable::-webkit-scrollbar-thumb{background:#c1c1c1;border-radius:4px}.lexical-content-editable::-webkit-scrollbar-thumb:hover{background:#a8a8a8}.lexical-bold{font-weight:700}.lexical-underline{text-decoration:underline}.lexical-italic{font-style:italic}.lexical-strikethrough{text-decoration:line-through}.lexical-underline-strikethrough{text-decoration:underline line-through}.lexical-uppercase{text-transform:uppercase}.lexical-lowercase{text-transform:lowercase}.lexical-capitalize{text-transform:capitalize}.lexical-code{background-color:#f3f4f6;border:1px solid #d1d5db;border-radius:.25rem;color:#000;font-family:monospace;font-size:.875rem;padding:0 .25rem}.lexical-paragraph{margin-bottom:.5rem}.lexical-list-ul{list-style-type:disc}.lexical-list-ol,.lexical-list-ul{list-style-position:inside;padding-left:1.5rem}.lexical-list-ol{list-style-type:decimal}.lexical-listitem{margin-bottom:.25rem}.lexical-quote{background-color:#f9fafb;border-bottom-right-radius:.25rem;border-left:4px solid #9ca3af;border-top-right-radius:.25rem;color:#374151;font-style:italic;padding-bottom:.5rem;padding-left:1rem;padding-top:.5rem}.lexical-link{color:#2563eb;text-decoration:underline}.lexical-link:hover{color:#1e40af}.lexical-text-editor .lexical-btn{align-items:center;background:#fff;border:none;border-radius:6px;color:#4b5563;cursor:pointer;display:inline-flex;font-size:14px;font-weight:500;gap:8px;height:32px;justify-content:flex-start;outline:none;padding:8px 12px;transition:all .15s ease;user-select:none;white-space:nowrap;width:100%}.lexical-text-editor .lexical-btn svg{flex-shrink:0;height:16px;pointer-events:none;width:16px}.lexical-text-editor .lexical-btn svg[class*=size-]{height:auto;width:auto}.lexical-text-editor .lexical-btn .label{margin-left:8px}.lexical-text-editor .lexical-btn.toolbar{background:#fff;color:#4b5563}.lexical-text-editor .lexical-btn.toolbar:hover{background:rgba(241,245,249,.8)}.lexical-text-editor .lexical-btn.toolbar-active{background:#f1f5f9;color:#111827}.lexical-text-editor .lexical-btn:disabled{opacity:.5;pointer-events:none}.lexical-text-editor .size-8{height:32px!important;width:32px!important}.lexical-text-editor .toolbar{align-items:center;background-color:#fff;border-radius:8px;color:#374151;cursor:pointer;display:inline-flex;justify-content:flex-start;transition:background .15s ease,border-color .15s ease}.lexical-text-editor .toolbar.icon{align-items:center;display:inline-flex;justify-content:center!important}.lexical-text-editor .toolbar:hover:not(:disabled){background-color:#f3f4f6}.lexical-text-editor .toolbarActive{align-items:center;background-color:#eef2ff;border-radius:.5rem;cursor:pointer;display:inline-flex;justify-content:center;padding:0}.lexical-text-editor button:disabled{background-color:#f9fafb;cursor:not-allowed;opacity:.5}.lexical-text-editor .popover-root{display:inline-block;position:relative}.lexical-text-editor .popover-trigger{display:inline-block}.lexical-text-editor .popover-content{animation:popoverFadeIn .15s ease;background:#fff;border-radius:6px;box-shadow:0 2px 6px rgba(0,0,0,.12),0 0 0 1px rgba(0,0,0,.04);padding:8px;position:absolute;top:calc(100% + 4px);z-index:9999}.lexical-text-editor .popover-content.align-start{left:0}.lexical-text-editor .popover-content.align-center{left:50%;transform:translateX(-50%)}.lexical-text-editor .popover-content.align-end{right:0}@keyframes popoverFadeIn{0%{opacity:0;transform:translateY(-3px)}to{opacity:1;transform:translateY(0)}}.lexical-text-editor .heading-select{display:inline-block;position:relative}.lexical-text-editor .heading-trigger{background-color:#fff;border:1px solid #e5e7eb;height:32px;justify-content:space-between;padding:8px}.lexical-text-editor .heading-trigger .chevron{transition:transform .15s ease}.lexical-text-editor .heading-trigger .chevron.rotated{transform:rotate(180deg)}.lexical-text-editor .heading-dropdown{animation:dropdownFadeIn .15s ease;background:#fff;border-radius:6px;box-shadow:0 2px 6px rgba(0,0,0,.12),0 0 0 1px rgba(0,0,0,.04);display:flex;flex-direction:column;gap:4px;left:0;padding:8px;position:absolute;top:calc(100% + 4px);width:max-content;z-index:9999}@keyframes dropdownFadeIn{0%{opacity:0;transform:translateY(-3px)}to{opacity:1;transform:translateY(0)}}.color-picker-wrapper{display:inline-block;position:relative}.toolbar:hover:not(:disabled){background-color:#f3f4f6}.lexical-color-popover{border-radius:.5rem;margin-top:10px;opacity:0;pointer-events:none;transform:scale(.95) translateY(-4px);transform-origin:top left;transition:opacity .15s ease,transform .15s ease;z-index:99}.lexical-color-popover.open{opacity:1;pointer-events:auto;transform:scale(1) translateY(0)}.lexical-text-editor-dialog{.lte-icon-btn{align-items:center;background:none;border:none;border-radius:4px;cursor:pointer;display:flex;padding:6px}.lte-icon-btn:hover{background:#e5e5e5}.lte-outline-btn{background:#f8f8f8;border:1px solid #ccc;border-radius:4px;color:#000;cursor:pointer;font-size:14px;margin:0 auto;padding:8px 12px;width:fit-content}.lte-outline-btn:hover{background:#eee}.lte-primary-btn{background-color:#2563eb!important;border:none;border-radius:4px;color:#fff;cursor:pointer;padding:8px 14px}.lte-primary-btn:hover{background:#1d4ed8}.lte-primary-btn:disabled{cursor:not-allowed;opacity:.5}.lte-input{background-color:#fff;border:1px solid #d0d0d0;border-radius:4px;padding:8px 10px;width:100%}.lte-divider{align-items:center;color:#777;display:flex;font-size:13px;margin:12px 0}.lte-divider:after,.lte-divider:before{background:#ccc;content:"";flex:1;height:1px}.lte-divider span{padding:0 8px}.lte-file-name{color:#666;font-size:13px}.lte-dialog-overlay{align-items:center;background:rgba(0,0,0,.5);display:flex;inset:0;justify-content:center;position:fixed;z-index:50}.lte-dialog{background:#fff;border-radius:8px;margin:10px;max-width:420px;padding:20px;position:relative;width:100%}.lte-dialog.preview{max-width:1024px;width:100%}.lte-dialog-header{color:#333;font-size:18px;font-weight:600;margin-bottom:10px}.lte-dialog-body{display:flex;flex-direction:column;gap:12px;padding:10px 0}.lte-dialog-footer{display:flex;justify-content:flex-end;margin-top:12px}.lte-dialog-close{background:none;border:none;color:#000;cursor:pointer;font-size:26px;opacity:.7;outline:none;padding:0;position:absolute;right:18px;top:10px}.lte-dialog-close:hover{opacity:1}.lte-hidden{display:none}}.lexical-text-editor .lte-toolbar-btn{align-items:center;background:#fff;border:1px solid #e5e7eb;border-radius:6px;cursor:pointer;display:flex;gap:4px;padding:6px 10px;transition:.15s ease;user-select:none}.lexical-text-editor .lte-toolbar-btn:hover{background:#f3f4f6}.lexical-text-editor .lte-toolbar-btn-active{background:#e0e7ff;border-color:#6366f1}.lexical-text-editor .lte-preview-container{background:#fff;border:1px solid #e5e7eb;border-radius:8px;max-height:80vh;min-height:400px;overflow-y:auto;padding:2vw;width:100%}.lexical-text-editor .lte-preview-title{border-bottom:2px solid #e5e7eb;font-size:15px;font-weight:600;margin-bottom:14px;padding-bottom:6px;text-align:start}.lexical-text-editor-html-preview{line-height:1.6;max-width:none;text-align:start}.lexical-text-editor-link.link-editor-container{align-items:center;background:#fff;border:1px solid #e5e7eb;border-radius:12px;bottom:-50px;box-shadow:0 4px 12px rgba(0,0,0,.12);display:flex;gap:8px;padding:6px 10px;position:absolute;right:20px;z-index:99}@media (min-width:640px){.lexical-text-editor-link.link-editor-container{bottom:-60px;padding:8px 14px}}.lexical-text-editor-link .link-editor-input-wrapper{flex:1;min-width:200px}.lexical-text-editor-link .link-editor-input{background-color:#fff;border:1px solid #d1d5db;border-radius:6px;font-size:14px;height:32px;outline:none;padding:4px 8px;width:100%}.lexical-text-editor-link .link-editor-input:focus{border-color:#2563eb}.lexical-text-editor-link .link-editor-url{color:#2563eb;display:block;font-size:14px;max-width:100%;overflow:hidden;text-align:start;text-decoration:underline;text-overflow:ellipsis;white-space:nowrap}.lexical-text-editor-link .link-editor-buttons{display:flex;gap:4px}.lexical-text-editor-link .link-editor-btn{align-items:center;background:transparent;border:none;border-radius:6px;cursor:pointer;display:flex;height:32px;justify-content:center;transition:background .2s ease;width:32px}.lexical-text-editor-link .link-editor-btn:hover{background:#f3f4f6}.Lexical-Tooltip-Wrapper{display:inline-block;position:relative}.Lexical-Tooltip-Tip{background:#5a5a5a;border-radius:4px;color:#fff;font-family:sans-serif;font-size:12px;left:50%;line-height:1;padding:8px 12px;position:absolute;transform:translateX(-50%);transition:all .5s;white-space:nowrap;z-index:100}.Lexical-Tooltip-Tip:before{border:6px solid transparent;content:" ";height:0;left:50%;margin-left:-6px;pointer-events:none;position:absolute;width:0}.Lexical-Tooltip-Tip.top{top:-35px}.Lexical-Tooltip-Tip.top:before{border-top-color:#5a5a5a;top:100%}.Lexical-Tooltip-Tip.right{left:calc(100% + 30px);top:50%;transform:translateX(0) translateY(-50%)}.Lexical-Tooltip-Tip.right:before{border-right-color:#5a5a5a;left:-6px;top:50%;transform:translateX(0) translateY(-50%)}.Lexical-Tooltip-Tip.bottom{bottom:-35px}.Lexical-Tooltip-Tip.bottom:before{border-bottom-color:#5a5a5a;bottom:100%}.Lexical-Tooltip-Tip.left{left:auto;right:calc(100% + 30px);top:50%;transform:translateX(0) translateY(-50%)}.Lexical-Tooltip-Tip.left:before{border-left-color:#5a5a5a;left:auto;right:-12px;top:50%;transform:translateX(0) translateY(-50%)}
|
|
1
|
+
.lexical-text-editor *{box-sizing:border-box;font-family:inherit}.lexical-text-editor{height:fit-content}.lexical-text-editor button{background:transparent;border:1px solid transparent;cursor:pointer}.lexical-text-editor a{color:#646cff;font-weight:500;text-decoration:inherit}.lexical-text-editor a:hover{color:#535bf2}.lexical-text-editor{background-color:#fff;border:1px solid #e5e7eb;border-radius:.5rem;color:#000;font-size:16px!important;padding-bottom:.5rem;scrollbar-color:#9ca3af transparent;scrollbar-width:thin}.lexical-text-editor input{background-color:#fff;color:#000;outline:none}.link-editor-buttons input{stroke:#000;background-color:#220909;color:#000;outline:none}.lexical-text-editor input:focus{border:1px solid #676666}.lexical-toolbar-wrapper{align-items:center;display:flex;flex-wrap:wrap;gap:6px;justify-content:center;row-gap:12px}.lexical-toolbar-wrapper.useScroll{flex-wrap:nowrap}.lexical-text-editor::-webkit-scrollbar{width:6px}.lexical-text-editor::-webkit-scrollbar-track{background:transparent}.lexical-text-editor::-webkit-scrollbar-thumb{background-color:#9ca3af;border-radius:3px}.lexical-text-editor::-webkit-scrollbar-thumb:hover{background-color:#6b7280}.lexical-text-editor [contenteditable=true]{outline:none}.lexical-text-editor h1{font-size:32px;font-weight:700;margin:8px 0}.lexical-text-editor h2{font-size:28.8px;font-weight:700;margin:8px 0}.lexical-text-editor h3{font-size:25.6px;font-weight:700;margin:3.2px 0}.lexical-text-editor h4{font-size:22.4px;font-weight:700;margin:3.2px 0}.lexical-text-editor h5{font-size:19.2px;font-weight:700;margin:3.2px 0}.lexical-text-editor h6{font-size:16px;font-weight:700;margin:3.2px 0}.scrollbar-thin{scrollbar-color:#a5acb6 transparent;scrollbar-width:thin}.scrollbar-thin::-webkit-scrollbar{height:4px;width:4px}.scrollbar-thin::-webkit-scrollbar-track{background:transparent}.scrollbar-thin::-webkit-scrollbar-thumb{background-color:#a5acb6;border-radius:9999px}.lexical-editor-container{box-sizing:border-box;position:relative}.lexical-toolbar-container{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;padding-left:.5rem;padding-right:.5rem}.lexical-editor-inner{height:100%;position:relative}.lexical-content-editable{background-color:#fff;box-sizing:border-box;color:#000;font-size:14px;height:100%;outline:0;overflow:auto;padding:8px;scrollbar-color:#9ca3af transparent;scrollbar-width:thin;text-align:start;width:100%}.lexical-placeholder{color:#999;font-size:14px;left:10px;pointer-events:none;position:absolute;top:8px;user-select:none}.lexical-content-editable::-webkit-scrollbar{height:8px;width:8px}.lexical-content-editable::-webkit-scrollbar-track{background:#f1f1f1;border-radius:4px}.lexical-content-editable::-webkit-scrollbar-thumb{background:#c1c1c1;border-radius:4px}.lexical-content-editable::-webkit-scrollbar-thumb:hover{background:#a8a8a8}.lexical-bold{font-weight:700}.lexical-underline{text-decoration:underline}.lexical-italic{font-style:italic}.lexical-strikethrough{text-decoration:line-through}.lexical-underline-strikethrough{text-decoration:underline line-through}.lexical-uppercase{text-transform:uppercase}.lexical-lowercase{text-transform:lowercase}.lexical-capitalize{text-transform:capitalize}.lexical-code{background-color:#f3f4f6;border:1px solid #d1d5db;border-radius:.25rem;color:#000;font-family:monospace;font-size:.875rem;padding:0 .25rem}.lexical-paragraph{margin-bottom:.5rem}.lexical-list-ul{list-style-type:disc}.lexical-list-ol,.lexical-list-ul{list-style-position:inside;padding-left:1.5rem}.lexical-list-ol{list-style-type:decimal}.lexical-listitem{margin-bottom:.25rem}.lexical-quote{background-color:#f9fafb;border-bottom-right-radius:.25rem;border-left:4px solid #9ca3af;border-top-right-radius:.25rem;color:#374151;font-style:italic;padding-bottom:.5rem;padding-left:1rem;padding-top:.5rem}.lexical-link{color:#2563eb;text-decoration:underline}.lexical-link:hover{color:#1e40af}.lexical-text-editor .lexical-btn{align-items:center;background:#fff;border:none;border-radius:6px;color:#4b5563;cursor:pointer;display:inline-flex;font-size:14px;font-weight:500;gap:8px;height:32px;justify-content:flex-start;outline:none;padding:8px 12px;transition:all .15s ease;user-select:none;white-space:nowrap;width:100%}.lexical-text-editor .lexical-btn svg{flex-shrink:0;height:16px;pointer-events:none;width:16px}.lexical-text-editor .lexical-btn svg[class*=size-]{height:auto;width:auto}.lexical-text-editor .lexical-btn .label{margin-left:8px}.lexical-text-editor .lexical-btn.toolbar{background:#fff;color:#4b5563}.lexical-text-editor .lexical-btn.toolbar:hover{background:rgba(241,245,249,.8)}.lexical-text-editor .lexical-btn.toolbar-active{background:#f1f5f9;color:#111827}.lexical-text-editor .lexical-btn:disabled{opacity:.5;pointer-events:none}.lexical-text-editor .size-8{height:32px!important;width:32px!important}.lexical-text-editor .toolbar{align-items:center;background-color:#fff;border-radius:8px;color:#374151;cursor:pointer;display:inline-flex;justify-content:flex-start;transition:background .15s ease,border-color .15s ease}.lexical-text-editor .toolbar.icon{align-items:center;display:inline-flex;justify-content:center!important}.lexical-text-editor .toolbar:hover:not(:disabled){background-color:#f3f4f6}.lexical-text-editor .toolbarActive{align-items:center;background-color:#eef2ff;border-radius:.5rem;cursor:pointer;display:inline-flex;justify-content:center;padding:0}.lexical-text-editor button:disabled{background-color:#f9fafb;cursor:not-allowed;opacity:.5}.lexical-text-editor .popover-root{display:inline-block;position:relative}.lexical-text-editor .popover-trigger{display:inline-block}.lexical-text-editor .popover-content{animation:popoverFadeIn .15s ease;background:#fff;border-radius:6px;box-shadow:0 2px 6px rgba(0,0,0,.12),0 0 0 1px rgba(0,0,0,.04);padding:8px;position:absolute;top:calc(100% + 4px);z-index:9999}.lexical-text-editor .popover-content.align-start{left:0}.lexical-text-editor .popover-content.align-center{left:50%;transform:translateX(-50%)}.lexical-text-editor .popover-content.align-end{right:0}@keyframes popoverFadeIn{0%{opacity:0;transform:translateY(-3px)}to{opacity:1;transform:translateY(0)}}.lexical-text-editor .heading-select{display:inline-block;position:relative}.lexical-text-editor .heading-trigger{background-color:#fff;border:1px solid #e5e7eb;height:32px;justify-content:space-between;padding:8px}.lexical-text-editor .heading-trigger .chevron{transition:transform .15s ease}.lexical-text-editor .heading-trigger .chevron.rotated{transform:rotate(180deg)}.lexical-text-editor .heading-dropdown{animation:dropdownFadeIn .15s ease;background:#fff;border-radius:6px;box-shadow:0 2px 6px rgba(0,0,0,.12),0 0 0 1px rgba(0,0,0,.04);display:flex;flex-direction:column;gap:4px;left:0;padding:8px;position:absolute;top:calc(100% + 4px);width:max-content;z-index:9999}@keyframes dropdownFadeIn{0%{opacity:0;transform:translateY(-3px)}to{opacity:1;transform:translateY(0)}}.color-picker-wrapper{display:inline-block;position:relative}.toolbar:hover:not(:disabled){background-color:#f3f4f6}.lexical-color-popover{border-radius:.5rem;margin-top:10px;opacity:0;pointer-events:none;transform:scale(.95) translateY(-4px);transform-origin:top left;transition:opacity .15s ease,transform .15s ease;z-index:99}.lexical-color-popover.open{opacity:1;pointer-events:auto;transform:scale(1) translateY(0)}.lexical-text-editor-dialog{.lte-icon-btn{align-items:center;background:none;border:none;border-radius:4px;cursor:pointer;display:flex;padding:6px}.lte-icon-btn:hover{background:#e5e5e5}.lte-outline-btn{background:#f8f8f8;border:1px solid #ccc;border-radius:4px;color:#000;cursor:pointer;font-size:14px;margin:0 auto;padding:8px 12px;width:fit-content}.lte-outline-btn:hover{background:#eee}.lte-primary-btn{background-color:#2563eb!important;border:none;border-radius:4px;color:#fff;cursor:pointer;padding:8px 14px}.lte-primary-btn:hover{background:#1d4ed8}.lte-primary-btn:disabled{cursor:not-allowed;opacity:.5}.lte-input{background-color:#fff;border:1px solid #d0d0d0;border-radius:4px;padding:8px 10px;width:100%}.lte-divider{align-items:center;color:#777;display:flex;font-size:13px;margin:12px 0}.lte-divider:after,.lte-divider:before{background:#ccc;content:"";flex:1;height:1px}.lte-divider span{padding:0 8px}.lte-file-name{color:#666;font-size:13px}.lte-dialog-overlay{align-items:center;background:rgba(0,0,0,.5);display:flex;inset:0;justify-content:center;position:fixed;z-index:50}.lte-dialog{background:#fff;border-radius:8px;margin:10px;max-width:420px;padding:20px;position:relative;width:100%}.lte-dialog.preview{max-width:1024px;width:100%}.lte-dialog-header{color:#333;font-size:18px;font-weight:600;margin-bottom:10px}.lte-dialog-body{display:flex;flex-direction:column;gap:12px;padding:10px 0}.lte-dialog-footer{display:flex;justify-content:flex-end;margin-top:12px}.lte-dialog-close{background:none;border:none;color:#000;cursor:pointer;font-size:26px;opacity:.7;outline:none;padding:0;position:absolute;right:18px;top:10px}.lte-dialog-close:hover{opacity:1}.lte-hidden{display:none}}.lexical-text-editor .lte-toolbar-btn{align-items:center;background:#fff;border:1px solid #e5e7eb;border-radius:6px;cursor:pointer;display:flex;gap:4px;padding:6px 10px;transition:.15s ease;user-select:none}.lexical-text-editor .lte-toolbar-btn:hover{background:#f3f4f6}.lexical-text-editor .lte-toolbar-btn-active{background:#e0e7ff;border-color:#6366f1}.lexical-text-editor .lte-preview-container{background:#fff;border:1px solid #e5e7eb;border-radius:8px;max-height:80vh;min-height:400px;overflow-y:auto;padding:2vw;width:100%}.lexical-text-editor .lte-preview-title{border-bottom:2px solid #e5e7eb;font-size:15px;font-weight:600;margin-bottom:14px;padding-bottom:6px;text-align:start}.lexical-text-editor-html-preview{line-height:1.6;max-width:none;text-align:start}.lexical-text-editor-link.link-editor-container{align-items:center;background:#fff;border:1px solid #e5e7eb;border-radius:12px;bottom:-50px;box-shadow:0 4px 12px rgba(0,0,0,.12);display:flex;gap:8px;padding:6px 10px;position:absolute;right:20px;z-index:99}@media (min-width:640px){.lexical-text-editor-link.link-editor-container{bottom:-60px;padding:8px 14px}}.lexical-text-editor-link .link-editor-input-wrapper{flex:1;min-width:200px}.lexical-text-editor-link .link-editor-input{background-color:#fff;border:1px solid #d1d5db;border-radius:6px;font-size:14px;height:32px;outline:none;padding:4px 8px;width:100%}.lexical-text-editor-link .link-editor-input:focus{border-color:#2563eb}.lexical-text-editor-link .link-editor-url{color:#2563eb;display:block;font-size:14px;max-width:100%;overflow:hidden;text-align:start;text-decoration:underline;text-overflow:ellipsis;white-space:nowrap}.lexical-text-editor-link .link-editor-buttons{display:flex;gap:4px}.lexical-text-editor-link .link-editor-btn{align-items:center;background:transparent;border:none;border-radius:6px;cursor:pointer;display:flex;height:32px;justify-content:center;transition:background .2s ease;width:32px}.lexical-text-editor-link .link-editor-btn:hover{background:#f3f4f6}.Lexical-Tooltip-Wrapper{display:inline-block;position:relative}.Lexical-Tooltip-Tip{background:#5a5a5a;border-radius:4px;color:#fff;font-family:sans-serif;font-size:12px;left:50%;line-height:1;padding:8px 12px;position:absolute;transform:translateX(-50%);transition:all .5s;white-space:nowrap;z-index:100}.Lexical-Tooltip-Tip:before{border:6px solid transparent;content:" ";height:0;left:50%;margin-left:-6px;pointer-events:none;position:absolute;width:0}.Lexical-Tooltip-Tip.top{top:-35px}.Lexical-Tooltip-Tip.top:before{border-top-color:#5a5a5a;top:100%}.Lexical-Tooltip-Tip.right{left:calc(100% + 30px);top:50%;transform:translateX(0) translateY(-50%)}.Lexical-Tooltip-Tip.right:before{border-right-color:#5a5a5a;left:-6px;top:50%;transform:translateX(0) translateY(-50%)}.Lexical-Tooltip-Tip.bottom{bottom:-35px}.Lexical-Tooltip-Tip.bottom:before{border-bottom-color:#5a5a5a;bottom:100%}.Lexical-Tooltip-Tip.left{left:auto;right:calc(100% + 30px);top:50%;transform:translateX(0) translateY(-50%)}.Lexical-Tooltip-Tip.left:before{border-left-color:#5a5a5a;left:auto;right:-12px;top:50%;transform:translateX(0) translateY(-50%)}
|
package/package.json
CHANGED
|
@@ -21,7 +21,7 @@ export function AlignmentSelectionList({ onAction, alignmentSelectionMap }: Prop
|
|
|
21
21
|
<Popover open={isOpen} onOpenChange={setIsOpen}>
|
|
22
22
|
<PopoverTrigger triggerRef={triggerRef}>
|
|
23
23
|
|
|
24
|
-
<button
|
|
24
|
+
<button type="button"
|
|
25
25
|
className={`lexical-btn heading-trigger ${isOpen ? "toolbar-active" : "toolbar"}`}
|
|
26
26
|
onClick={() => setIsOpen((prev) => !prev)}
|
|
27
27
|
style={{
|
|
@@ -40,7 +40,7 @@ export function AlignmentSelectionList({ onAction, alignmentSelectionMap }: Prop
|
|
|
40
40
|
}}>
|
|
41
41
|
{
|
|
42
42
|
RICH_ALIGNMENT_OPTIONS.map(({ id, label, icon }) => (
|
|
43
|
-
<button
|
|
43
|
+
<button type="button"
|
|
44
44
|
key={id}
|
|
45
45
|
className={`lexical-btn ${alignmentSelectionMap[id] ? "toolbar-active" : "toolbar"
|
|
46
46
|
}`}
|
|
@@ -32,7 +32,7 @@ export default function ColorPicker({ color, onChange, icon }: ColorPickerProps)
|
|
|
32
32
|
|
|
33
33
|
return (
|
|
34
34
|
<div className="color-picker-wrapper">
|
|
35
|
-
<button
|
|
35
|
+
<button type="button"
|
|
36
36
|
ref={triggerRef}
|
|
37
37
|
className={`size-8 lexical-btn ${open ? "toolbarActive" : "toolbar"} icon`}
|
|
38
38
|
onClick={() => setOpen((prev) => !prev)}
|
|
@@ -25,11 +25,12 @@ export default function ContentPreviewDialog({
|
|
|
25
25
|
triggerLabel = "Preview",
|
|
26
26
|
}: ContentPreviewDialogProps) {
|
|
27
27
|
const [isOpen, setIsOpen] = useState(false);
|
|
28
|
+
console.log(value);
|
|
28
29
|
return (
|
|
29
30
|
<div className="lexical-text-editor-dialog">
|
|
30
31
|
{/* Trigger button */}
|
|
31
32
|
|
|
32
|
-
<button
|
|
33
|
+
<button type="button"
|
|
33
34
|
className={`lexical-btn heading-trigger ${isOpen ? "toolbar-active" : "toolbar"}`}
|
|
34
35
|
onClick={() => setIsOpen((prev) => !prev)}
|
|
35
36
|
>
|
|
@@ -16,7 +16,7 @@ export function DropdownList({ onAction, selectionMap }: Props) {
|
|
|
16
16
|
return (
|
|
17
17
|
<Popover open={isOpen} onOpenChange={setIsOpen}>
|
|
18
18
|
<PopoverTrigger triggerRef={triggerRef}>
|
|
19
|
-
<button
|
|
19
|
+
<button type="button"
|
|
20
20
|
className={`lexical-btn heading-trigger ${isOpen ? "toolbar-active" : "toolbar"}`}
|
|
21
21
|
onClick={() => setIsOpen((prev) => !prev)}
|
|
22
22
|
>
|
|
@@ -32,7 +32,7 @@ export function DropdownList({ onAction, selectionMap }: Props) {
|
|
|
32
32
|
>
|
|
33
33
|
{
|
|
34
34
|
RICH_TEXT_FORMAT_OPTIONS.map(({ id, label, icon }) => (
|
|
35
|
-
<button
|
|
35
|
+
<button type="button"
|
|
36
36
|
key={id}
|
|
37
37
|
className={`lexical-btn ${selectionMap[id] ? "toolbar-active" : "toolbar"
|
|
38
38
|
}`}
|
|
@@ -21,7 +21,7 @@ export function HeadingSelectionList({ updateHeading, headingSelectionMap }: Pro
|
|
|
21
21
|
return (
|
|
22
22
|
<Popover open={open} onOpenChange={setOpen}>
|
|
23
23
|
<PopoverTrigger triggerRef={triggerRef}>
|
|
24
|
-
<button
|
|
24
|
+
<button type="button"
|
|
25
25
|
className={`lexical-btn heading-trigger ${open ? "toolbar-active" : "toolbar"}`}
|
|
26
26
|
onClick={() => setOpen((prev) => !prev)}
|
|
27
27
|
style={{
|
|
@@ -40,7 +40,7 @@ export function HeadingSelectionList({ updateHeading, headingSelectionMap }: Pro
|
|
|
40
40
|
display: 'flex', flexDirection: 'column', gap: 5
|
|
41
41
|
}}>
|
|
42
42
|
{HEADINGS.map(({ id, label, icon }) => (
|
|
43
|
-
<button
|
|
43
|
+
<button type="button"
|
|
44
44
|
key={id}
|
|
45
45
|
className={`lexical-btn ${headingSelectionMap[id] ? "toolbar-active" : "toolbar"
|
|
46
46
|
}`}
|
|
@@ -79,7 +79,7 @@ export default function LinkModal({
|
|
|
79
79
|
|
|
80
80
|
<div className="link-editor-buttons">
|
|
81
81
|
|
|
82
|
-
<button
|
|
82
|
+
<button type="button"
|
|
83
83
|
className={`lexical-btn heading-trigger toolbar`}
|
|
84
84
|
onClick={() => {
|
|
85
85
|
if (isEditMode) {
|
|
@@ -91,7 +91,7 @@ export default function LinkModal({
|
|
|
91
91
|
{isEditMode ? <MdCheck size={18} /> : <BsPencilSquare size={14} />}
|
|
92
92
|
</button>
|
|
93
93
|
|
|
94
|
-
<button
|
|
94
|
+
<button type="button"
|
|
95
95
|
className={`lexical-btn heading-trigger toolbar`}
|
|
96
96
|
onMouseDown={(e) => e.preventDefault()}
|
|
97
97
|
onClick={removeLink}
|
|
@@ -101,7 +101,7 @@ export default function LinkModal({
|
|
|
101
101
|
|
|
102
102
|
|
|
103
103
|
|
|
104
|
-
{/* <button
|
|
104
|
+
{/* <button type="button"
|
|
105
105
|
onMouseDown={(e) => e.preventDefault()}
|
|
106
106
|
onClick={() => {
|
|
107
107
|
if (isEditMode) {
|
|
@@ -114,7 +114,7 @@ export default function LinkModal({
|
|
|
114
114
|
{isEditMode ? <MdCheck size={18} /> : <BsPencilSquare size={14} />}
|
|
115
115
|
</button> */}
|
|
116
116
|
|
|
117
|
-
{/* <button
|
|
117
|
+
{/* <button type="button"
|
|
118
118
|
onMouseDown={(e) => e.preventDefault()}
|
|
119
119
|
onClick={removeLink}
|
|
120
120
|
className={`size-8 toolbar icon`}
|
|
@@ -37,7 +37,7 @@ export default function RawDialog({ open, onClose, forPreview = false, children
|
|
|
37
37
|
return (
|
|
38
38
|
<div className="lexical-text-editor-dialog lte-dialog-overlay">
|
|
39
39
|
<div ref={dialogRef} className={`lte-dialog ${forPreview ? 'preview' : ''}`}>
|
|
40
|
-
<button className="lte-dialog-close" onClick={onClose}>
|
|
40
|
+
<button type="button" className="lte-dialog-close" onClick={onClose}>
|
|
41
41
|
×
|
|
42
42
|
</button>
|
|
43
43
|
{children}
|
package/src/nodes/ImageNode.tsx
CHANGED
|
@@ -29,7 +29,6 @@ export type ImageNodePayload = {
|
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
|
|
33
32
|
export const $createImageNode = (payload: ImageNodePayload) => {
|
|
34
33
|
return $applyNodeReplacement(new ImageNode(payload));
|
|
35
34
|
};
|
|
@@ -99,7 +98,6 @@ export class ImageNode extends DecoratorNode<JSX.Element> {
|
|
|
99
98
|
this.__height = height;
|
|
100
99
|
}
|
|
101
100
|
|
|
102
|
-
|
|
103
101
|
static getType(): string {
|
|
104
102
|
return "image";
|
|
105
103
|
}
|
|
@@ -175,7 +173,6 @@ export class ImageNode extends DecoratorNode<JSX.Element> {
|
|
|
175
173
|
});
|
|
176
174
|
}
|
|
177
175
|
|
|
178
|
-
|
|
179
176
|
updateDimensions(width: number, height: number) {
|
|
180
177
|
const writable = this.getWritable();
|
|
181
178
|
writable.__width = width;
|
|
@@ -46,7 +46,7 @@ export default function ImagePlugin() {
|
|
|
46
46
|
/>
|
|
47
47
|
|
|
48
48
|
{/* Open dialog button */}
|
|
49
|
-
<button
|
|
49
|
+
<button type="button"
|
|
50
50
|
className={`size-8 lexical-btn ${isOpen ? "toolbarActive" : "toolbar"} icon`}
|
|
51
51
|
onClick={() => setIsOpen((prev) => !prev)}
|
|
52
52
|
>
|
|
@@ -78,7 +78,7 @@ export default function ImagePlugin() {
|
|
|
78
78
|
<span>or</span>
|
|
79
79
|
</div>
|
|
80
80
|
|
|
81
|
-
{/* <button
|
|
81
|
+
{/* <button type="button"
|
|
82
82
|
className="lte-outline-btn"
|
|
83
83
|
onClick={() => inputRef.current?.click()}
|
|
84
84
|
>
|
|
@@ -86,7 +86,7 @@ export default function ImagePlugin() {
|
|
|
86
86
|
Upload Image
|
|
87
87
|
</button> */}
|
|
88
88
|
|
|
89
|
-
<button
|
|
89
|
+
<button type="button"
|
|
90
90
|
className={`lexical-btn heading-trigger toolbar-active`}
|
|
91
91
|
onClick={() => inputRef.current?.click()}
|
|
92
92
|
style={{
|
|
@@ -104,7 +104,7 @@ export default function ImagePlugin() {
|
|
|
104
104
|
</div>
|
|
105
105
|
|
|
106
106
|
<div className="lte-dialog-footer">
|
|
107
|
-
<button
|
|
107
|
+
<button type="button"
|
|
108
108
|
className="lte-primary-btn"
|
|
109
109
|
disabled={!url && !file}
|
|
110
110
|
onClick={addImage}
|
|
@@ -34,7 +34,7 @@ export default function ListPlugin({ blockType }: ListPluginProps) {
|
|
|
34
34
|
return (
|
|
35
35
|
<>
|
|
36
36
|
<TooltipX content="Ordered list" direction="bottom">
|
|
37
|
-
<button
|
|
37
|
+
<button type="button"
|
|
38
38
|
className={`size-8 lexical-btn ${blockType === "ol" ? "toolbarActive" : "toolbar"
|
|
39
39
|
} icon`}
|
|
40
40
|
onClick={handleOrderedList}
|
|
@@ -44,7 +44,7 @@ export default function ListPlugin({ blockType }: ListPluginProps) {
|
|
|
44
44
|
</TooltipX>
|
|
45
45
|
|
|
46
46
|
<TooltipX content="Unordered list" direction="bottom">
|
|
47
|
-
<button
|
|
47
|
+
<button type="button"
|
|
48
48
|
className={`size-8 lexical-btn ${blockType === "ul" ? "toolbarActive" : "toolbar"
|
|
49
49
|
} icon`}
|
|
50
50
|
onClick={handleUnorderedList}
|
|
@@ -392,7 +392,7 @@ export const ToolbarPlugin = ({ value }: { value: string }) => {
|
|
|
392
392
|
RICH_REDO_UNDO_OPTIONS.map(({ id, label, icon }) => (
|
|
393
393
|
id === RichTextAction.Divider ? <Separator key={id} /> :
|
|
394
394
|
<TooltipX content={label} direction="bottom" key={label}>
|
|
395
|
-
<button
|
|
395
|
+
<button type="button"
|
|
396
396
|
className={`size-8 lexical-btn ${selectionMap[id] ? "toolbarActive" : "toolbar"
|
|
397
397
|
} icon`}
|
|
398
398
|
onClick={() => onAction(id)}
|
|
@@ -412,7 +412,7 @@ export const ToolbarPlugin = ({ value }: { value: string }) => {
|
|
|
412
412
|
RICH_TEXT_OPTIONS.map(({ id, label, icon }) => (
|
|
413
413
|
id === RichTextAction.Divider ? <Separator key={id} /> :
|
|
414
414
|
<TooltipX key={id} content={label} direction="bottom">
|
|
415
|
-
<button
|
|
415
|
+
<button type="button"
|
|
416
416
|
className={`size-8 lexical-btn ${selectionMap[id] ? "toolbarActive" : "toolbar"
|
|
417
417
|
} icon`}
|
|
418
418
|
onClick={() => onAction(id)}
|
|
@@ -448,7 +448,7 @@ export const ToolbarPlugin = ({ value }: { value: string }) => {
|
|
|
448
448
|
|
|
449
449
|
|
|
450
450
|
<TooltipX content="Link" direction="bottom">
|
|
451
|
-
<button
|
|
451
|
+
<button type="button"
|
|
452
452
|
className={`size-8 lexical-btn ${selectionMap[RichTextAction.Link] ? "toolbarActive" : "toolbar"
|
|
453
453
|
} icon`}
|
|
454
454
|
onClick={() => onAction(RichTextAction.Link)}
|
|
@@ -59,8 +59,7 @@ export default function VideoPlugin() {
|
|
|
59
59
|
return (
|
|
60
60
|
<div className="lexical-text-editor-dialog">
|
|
61
61
|
{/* Open dialog button */}
|
|
62
|
-
<button
|
|
63
|
-
type="button"
|
|
62
|
+
<button type="button"
|
|
64
63
|
className={`size-8 lexical-btn ${isOpen ? "toolbarActive" : "toolbar"} icon`}
|
|
65
64
|
onClick={() => setIsOpen(true)}
|
|
66
65
|
>
|
|
@@ -87,7 +86,7 @@ export default function VideoPlugin() {
|
|
|
87
86
|
</div>
|
|
88
87
|
|
|
89
88
|
<div className="lte-dialog-footer">
|
|
90
|
-
<button
|
|
89
|
+
<button type="button"
|
|
91
90
|
className="lte-primary-btn"
|
|
92
91
|
disabled={!url}
|
|
93
92
|
onClick={onEmbed}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
|
|
2
|
+
/* Minimal Reset */
|
|
3
|
+
|
|
2
4
|
|
|
3
5
|
.lexical-text-editor * {
|
|
4
6
|
box-sizing: border-box;
|
|
5
7
|
font-family: inherit;
|
|
6
8
|
}
|
|
7
9
|
|
|
8
|
-
.lexical-text-editor
|
|
10
|
+
.lexical-text-editor {
|
|
9
11
|
height: fit-content;
|
|
10
12
|
}
|
|
11
13
|
|
|
12
|
-
|
|
13
|
-
|
|
14
14
|
.lexical-text-editor button {
|
|
15
15
|
background: transparent;
|
|
16
16
|
border: 1px solid transparent;
|