diff --git a/demos/playground/src/index.css b/demos/playground/src/index.css index 99851c6..68cc9d2 100644 --- a/demos/playground/src/index.css +++ b/demos/playground/src/index.css @@ -682,8 +682,7 @@ i.page-break, .link-editor .link-input a { color: rgb(33, 111, 219); - text-decoration: none; - display: block; + text-decoration: underline; white-space: nowrap; overflow: hidden; margin-right: 30px; @@ -707,10 +706,6 @@ i.page-break, border-radius: 4px; } -.ContentEditable__root .PlaygroundEditorTheme__link { - pointer-events: none; -} - .mention:focus { box-shadow: rgb(180 213 255) 0px 0px 0px 2px; outline: none; @@ -1030,6 +1025,27 @@ i.page-break, background-color: rgba(60, 132, 244, 0.5); } +.editor-shell .editor-image .image-edit-button { + border: 1px solid rgba(0, 0, 0, 0.3); + border-radius: 5px; + background-image: url(images/icons/pencil-fill.svg); + background-size: 16px; + background-position: center; + background-repeat: no-repeat; + width: 35px; + height: 35px; + vertical-align: -0.25em; + position: absolute; + right: 4px; + top: 4px; + cursor: pointer; + user-select: none; +} + +.editor-shell .editor-image .image-edit-button:hover { + background-color: rgba(60, 132, 244, 0.1); +} + .editor-shell .editor-image .image-resizer { display: block; width: 7px; @@ -1087,6 +1103,79 @@ i.page-break, cursor: nw-resize; } +.editor-shell span.inline-editor-image { + cursor: default; + display: inline-block; + position: relative; + z-index: 1; +} + +.editor-shell .inline-editor-image img { + max-width: 100%; + cursor: default; +} + +.editor-shell .inline-editor-image img.focused { + outline: 2px solid rgb(60, 132, 244); +} + +.editor-shell .inline-editor-image img.focused.draggable { + cursor: grab; +} + +.editor-shell .inline-editor-image img.focused.draggable:active { + cursor: grabbing; +} + +.editor-shell .inline-editor-image .image-caption-container .tree-view-output { + margin: 0; + border-radius: 0; +} + +.editor-shell .inline-editor-image.position-full { + margin: 1em 0 1em 0; +} + +.editor-shell .inline-editor-image.position-left { + float: left; + width: 50%; + margin: 1em 1em 0 0; +} + +.editor-shell .inline-editor-image.position-right { + float: right; + width: 50%; + margin: 1em 0 0 1em; +} + +.editor-shell .inline-editor-image .image-edit-button { + display: block; + position: absolute; + top: 12px; + right: 12px; + padding: 6px 8px; + margin: 0 auto; + border: 1px solid rgba(255, 255, 255, 0.3); + border-radius: 5px; + background-color: rgba(0, 0, 0, 0.5); + min-width: 60px; + color: #fff; + cursor: pointer; + user-select: none; +} + +.editor-shell .inline-editor-image .image-edit-button:hover { + background-color: rgba(60, 132, 244, 0.5); +} + +.editor-shell .inline-editor-image .image-caption-container { + display: block; + background-color: #f4f4f4; + min-width: 100%; + color: #000; + overflow: hidden; +} + .emoji { color: transparent; caret-color: rgb(5, 5, 5); @@ -1133,9 +1222,16 @@ i.page-break, } .actions { - position: relative; + position: absolute; text-align: right; - padding: 10px; + margin: 10px; + bottom: 0; + right: 0; +} + +.actions.tree-view { + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; } .actions i { @@ -1194,23 +1290,6 @@ i.page-break, background-image: url(images/icons/plug-fill.svg); } -table.disable-selection { - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - -table.disable-selection span::selection { - background-color: transparent; -} - -table.disable-selection br::selection { - background-color: transparent; -} - .table-cell-action-button-container { position: absolute; top: 0; @@ -1370,7 +1449,7 @@ button.action-button:disabled { z-index: 2; } -.toolbar button.toolbar-item { +button.toolbar-item { border: 0; display: flex; background: none; @@ -1383,15 +1462,15 @@ button.action-button:disabled { justify-content: space-between; } -.toolbar button.toolbar-item:disabled { +button.toolbar-item:disabled { cursor: not-allowed; } -.toolbar button.toolbar-item.spaced { +button.toolbar-item.spaced { margin-right: 2px; } -.toolbar button.toolbar-item i.format { +button.toolbar-item i.format { background-size: contain; display: inline-block; height: 18px; @@ -1401,26 +1480,26 @@ button.action-button:disabled { opacity: 0.6; } -.toolbar button.toolbar-item:disabled .icon, -.toolbar button.toolbar-item:disabled .text, -.toolbar button.toolbar-item:disabled i.format, -.toolbar button.toolbar-item:disabled .chevron-down { +button.toolbar-item:disabled .icon, +button.toolbar-item:disabled .text, +button.toolbar-item:disabled i.format, +button.toolbar-item:disabled .chevron-down { opacity: 0.2; } -.toolbar button.toolbar-item.active { +button.toolbar-item.active { background-color: rgba(223, 232, 250, 0.3); } -.toolbar button.toolbar-item.active i { +button.toolbar-item.active i { opacity: 1; } -.toolbar .toolbar-item:hover:not([disabled]) { +.toolbar-item:hover:not([disabled]) { background-color: #eee; } -.toolbar .toolbar-item.font-family .text { +.toolbar-item.font-family .text { display: block; max-width: 40px; } @@ -1452,7 +1531,8 @@ button.action-button:disabled { background-size: contain; } -.toolbar i.chevron-down { +.toolbar i.chevron-down, +.toolbar-item i.chevron-down { margin-top: 3px; width: 16px; height: 16px; @@ -1649,7 +1729,6 @@ button.item.dropdown-item-active i { cursor: text; display: block; position: relative; - tab-size: 1; outline: 0px; padding: 0; user-select: text; @@ -1681,6 +1760,12 @@ button.item.dropdown-item-active i { } } +.dialog-dropdown { + background-color: #eee !important; + margin-bottom: 10px; + width: 100%; +} + /* START: dialog input fields (InsertImageDialog) */ .Input__wrapper { display: flex; diff --git a/packages/svelte-lexical/src/global.css b/packages/svelte-lexical/src/global.css index ccfc366..aafc0ea 100644 --- a/packages/svelte-lexical/src/global.css +++ b/packages/svelte-lexical/src/global.css @@ -62,7 +62,6 @@ header h1 { .editor-shell .editor-container { background: #fff; position: relative; - cursor: text; display: block; border-bottom-left-radius: 10px; border-bottom-right-radius: 10px; @@ -80,7 +79,6 @@ header h1 { .editor-scroller { min-height: 150px; border: 0; - cursor: text; display: flex; position: relative; outline: 0; @@ -268,7 +266,7 @@ pre::-webkit-scrollbar-thumb { background: #fff; box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.3); border-radius: 8px; - margin-top: 25px; + position: fixed; } .typeahead-popover ul { @@ -444,6 +442,15 @@ i.horizontal-rule { background-image: url(/images/icons/bg-color.svg); } +.icon.table { + background-color: #6c757d; + mask-image: url(/images/icons/table.svg); + -webkit-mask-image: url(/images/icons/table.svg); + mask-repeat: no-repeat; + -webkit-mask-repeat: no-repeat; + mask-size: contain; + -webkit-mask-size: contain; +} i.image { background-image: url(/images/icons/file-image.svg); } @@ -465,7 +472,7 @@ i.poll { } i.columns { - background-image: url(images/icons/3-columns.svg); + background-image: url(/images/icons/3-columns.svg); } i.tweet { @@ -529,6 +536,10 @@ i.export { background-image: url(/images/icons/download.svg); } +i.share { + background-image: url(/images/icons/send.svg); +} + i.diagram-2 { background-image: url(/images/icons/diagram-2.svg); } @@ -561,6 +572,11 @@ i.prettier-error { background-image: url(/images/icons/prettier-error.svg); } +i.page-break, +.icon.page-break { + background-image: url(/images/icons/scissors.svg); +} + .link-editor .button.active, .toolbar .button.active { background-color: rgb(223, 232, 250); @@ -610,6 +626,20 @@ i.prettier-error { width: 35px; vertical-align: -0.25em; position: absolute; + right: 30px; + top: 0; + bottom: 0; + cursor: pointer; +} + +.link-editor div.link-trash { + background-image: url(/images/icons/trash.svg); + background-size: 16px; + background-position: center; + background-repeat: no-repeat; + width: 35px; + vertical-align: -0.25em; + position: absolute; right: 0; top: 0; bottom: 0; @@ -648,8 +678,7 @@ i.prettier-error { .link-editor .link-input a { color: rgb(33, 111, 219); - text-decoration: none; - display: block; + text-decoration: underline; white-space: nowrap; overflow: hidden; margin-right: 30px; @@ -673,85 +702,11 @@ i.prettier-error { border-radius: 4px; } -.ContentEditable__root .PlaygroundEditorTheme__link { - pointer-events: none; -} - .mention:focus { box-shadow: rgb(180 213 255) 0px 0px 0px 2px; outline: none; } -#block-controls { - display: block; - position: absolute; - right: 10px; - width: 32px; - height: 32px; - box-sizing: border-box; - box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 2px 0px; - top: 16px; - z-index: 10; - border-radius: 8px; - border: 1px solid rgb(206, 208, 212); - overflow: hidden; -} - -#block-controls button { - border: 1px solid white; - background-color: #fff; - display: block; - transition: background-color 0.1s ease; - cursor: pointer; - outline: none; - border-radius: 8px; - padding: 3px; -} - -#block-controls button:hover { - background-color: #efefef; -} - -#block-controls button:focus-visible { - border-color: blue; -} - -#block-controls span.block-type { - background-size: contain; - display: block; - width: 18px; - height: 18px; - margin: 2px; -} - -#block-controls span.block-type.paragraph { - background-image: url(/images/icons/text-paragraph.svg); -} - -#block-controls span.block-type.h1 { - background-image: url(/images/icons/type-h1.svg); -} - -#block-controls span.block-type.h2 { - background-image: url(/images/icons/type-h2.svg); -} - -#block-controls span.block-type.quote { - background-image: url(/images/icons/chat-square-quote.svg); -} - -#block-controls span.block-type.ul { - background-image: url(/images/icons/list-ul.svg); -} - -#block-controls span.block-type.ol { - background-image: url(/images/icons/list-ol.svg); -} - -#block-controls span.block-type.code { - background-image: url(/images/icons/code.svg); -} - .characters-limit { color: #888; font-size: 12px; @@ -852,6 +807,9 @@ i.prettier-error { .dropdown-button-text { display: none !important; } + .dialog-dropdown > .dropdown-button-text { + display: flex !important; + } .font-size .dropdown-button-text { display: flex !important; } @@ -1063,6 +1021,27 @@ i.prettier-error { background-color: rgba(60, 132, 244, 0.5); } +.editor-shell .editor-image .image-edit-button { + border: 1px solid rgba(0, 0, 0, 0.3); + border-radius: 5px; + background-image: url(/images/icons/pencil-fill.svg); + background-size: 16px; + background-position: center; + background-repeat: no-repeat; + width: 35px; + height: 35px; + vertical-align: -0.25em; + position: absolute; + right: 4px; + top: 4px; + cursor: pointer; + user-select: none; +} + +.editor-shell .editor-image .image-edit-button:hover { + background-color: rgba(60, 132, 244, 0.1); +} + .editor-shell .editor-image .image-resizer { display: block; width: 7px; @@ -1120,6 +1099,79 @@ i.prettier-error { cursor: nw-resize; } +.editor-shell span.inline-editor-image { + cursor: default; + display: inline-block; + position: relative; + z-index: 1; +} + +.editor-shell .inline-editor-image img { + max-width: 100%; + cursor: default; +} + +.editor-shell .inline-editor-image img.focused { + outline: 2px solid rgb(60, 132, 244); +} + +.editor-shell .inline-editor-image img.focused.draggable { + cursor: grab; +} + +.editor-shell .inline-editor-image img.focused.draggable:active { + cursor: grabbing; +} + +.editor-shell .inline-editor-image .image-caption-container .tree-view-output { + margin: 0; + border-radius: 0; +} + +.editor-shell .inline-editor-image.position-full { + margin: 1em 0 1em 0; +} + +.editor-shell .inline-editor-image.position-left { + float: left; + width: 50%; + margin: 1em 1em 0 0; +} + +.editor-shell .inline-editor-image.position-right { + float: right; + width: 50%; + margin: 1em 0 0 1em; +} + +.editor-shell .inline-editor-image .image-edit-button { + display: block; + position: absolute; + top: 12px; + right: 12px; + padding: 6px 8px; + margin: 0 auto; + border: 1px solid rgba(255, 255, 255, 0.3); + border-radius: 5px; + background-color: rgba(0, 0, 0, 0.5); + min-width: 60px; + color: #fff; + cursor: pointer; + user-select: none; +} + +.editor-shell .inline-editor-image .image-edit-button:hover { + background-color: rgba(60, 132, 244, 0.5); +} + +.editor-shell .inline-editor-image .image-caption-container { + display: block; + background-color: #f4f4f4; + min-width: 100%; + color: #000; + overflow: hidden; +} + .emoji { color: transparent; caret-color: rgb(5, 5, 5); @@ -1166,9 +1218,16 @@ i.prettier-error { } .actions { - position: relative; + position: absolute; text-align: right; - padding: 10px; + margin: 10px; + bottom: 0; + right: 0; +} + +.actions.tree-view { + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; } .actions i { @@ -1227,23 +1286,6 @@ i.prettier-error { background-image: url(/images/icons/plug-fill.svg); } -table.disable-selection { - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - -table.disable-selection span::selection { - background-color: transparent; -} - -table.disable-selection br::selection { - background-color: transparent; -} - .table-cell-action-button-container { position: absolute; top: 0; @@ -1351,6 +1393,21 @@ button.action-button:disabled { text-decoration: underline; } +.debug-treetype-button { + border: 0; + padding: 0; + font-size: 12px; + top: 10px; + right: 85px; + position: absolute; + background: none; + color: #fff; +} + +.debug-treetype-button:hover { + text-decoration: underline; +} + .connecting { font-size: 15px; color: #999; @@ -1388,7 +1445,7 @@ button.action-button:disabled { z-index: 2; } -.toolbar button.toolbar-item { +button.toolbar-item { border: 0; display: flex; background: none; @@ -1401,15 +1458,15 @@ button.action-button:disabled { justify-content: space-between; } -.toolbar button.toolbar-item:disabled { +button.toolbar-item:disabled { cursor: not-allowed; } -.toolbar button.toolbar-item.spaced { +button.toolbar-item.spaced { margin-right: 2px; } -.toolbar button.toolbar-item i.format { +button.toolbar-item i.format { background-size: contain; display: inline-block; height: 18px; @@ -1419,26 +1476,26 @@ button.action-button:disabled { opacity: 0.6; } -.toolbar button.toolbar-item:disabled .icon, -.toolbar button.toolbar-item:disabled .text, -.toolbar button.toolbar-item:disabled i.format, -.toolbar button.toolbar-item:disabled .chevron-down { +button.toolbar-item:disabled .icon, +button.toolbar-item:disabled .text, +button.toolbar-item:disabled i.format, +button.toolbar-item:disabled .chevron-down { opacity: 0.2; } -.toolbar button.toolbar-item.active { +button.toolbar-item.active { background-color: rgba(223, 232, 250, 0.3); } -.toolbar button.toolbar-item.active i { +button.toolbar-item.active i { opacity: 1; } -.toolbar .toolbar-item:hover:not([disabled]) { +.toolbar-item:hover:not([disabled]) { background-color: #eee; } -.toolbar .toolbar-item.font-family .text { +.toolbar-item.font-family .text { display: block; max-width: 40px; } @@ -1470,7 +1527,8 @@ button.action-button:disabled { background-size: contain; } -.toolbar i.chevron-down { +.toolbar i.chevron-down, +.toolbar-item i.chevron-down { margin-top: 3px; width: 16px; height: 16px; @@ -1488,7 +1546,8 @@ button.action-button:disabled { pointer-events: none; } -.toolbar .divider { +.toolbar > .divider { + /* need '>' to avoid conflict with `.dropdown .divider` in svelte-lexical */ width: 1px; background-color: #eee; margin: 0 4px; @@ -1666,7 +1725,6 @@ button.item.dropdown-item-active i { cursor: text; display: block; position: relative; - tab-size: 1; outline: 0px; padding: 0; user-select: text; @@ -1698,6 +1756,12 @@ button.item.dropdown-item-active i { } } +.dialog-dropdown { + background-color: #eee !important; + margin-bottom: 10px; + width: 100%; +} + /* START: dialog input fields (InsertImageDialog) */ .Input__wrapper { display: flex; @@ -1827,13 +1891,13 @@ button.item.dropdown-item-active i { } .sl_add-icon { - background-image: url(images/icons/add-sign.svg); + background-image: url(/images/icons/add-sign.svg); background-repeat: no-repeat; background-position: center; } .sl_minus-icon { - background-image: url(images/icons/minus-sign.svg); + background-image: url(/images/icons/minus-sign.svg); background-repeat: no-repeat; background-position: center; }