phx-react 1.3.1823 → 1.3.1825
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/TextEditorV2/constants.d.ts +1 -1
- package/dist/cjs/components/TextEditorV2/constants.js +23 -9
- package/dist/cjs/components/TextEditorV2/constants.js.map +1 -1
- package/dist/cjs/components/TextEditorV2/nodes/ImageComponent.js +1 -5
- package/dist/cjs/components/TextEditorV2/nodes/ImageComponent.js.map +1 -1
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/upload-image.d.ts +9 -0
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/upload-image.js +1 -0
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/upload-image.js.map +1 -1
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/upload-pdf.js +20 -8
- package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/upload-pdf.js.map +1 -1
- package/dist/cjs/components/TextEditorV2/style.js +17 -8
- package/dist/cjs/components/TextEditorV2/style.js.map +1 -1
- package/dist/esm/components/TextEditorV2/constants.d.ts +1 -1
- package/dist/esm/components/TextEditorV2/constants.js +23 -9
- package/dist/esm/components/TextEditorV2/constants.js.map +1 -1
- package/dist/esm/components/TextEditorV2/nodes/ImageComponent.js +1 -5
- package/dist/esm/components/TextEditorV2/nodes/ImageComponent.js.map +1 -1
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/upload-image.d.ts +9 -0
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/upload-image.js +1 -1
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/upload-image.js.map +1 -1
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/upload-pdf.js +20 -8
- package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/upload-pdf.js.map +1 -1
- package/dist/esm/components/TextEditorV2/style.js +17 -8
- package/dist/esm/components/TextEditorV2/style.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const styleTag = "\n* {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n}\n.PlaygroundEditorTheme__ltr {\n text-align: left;\n}\n.PlaygroundEditorTheme__rtl {\n text-align: right;\n}\n\n[type='page-break'] {\n position: relative;\n display: block;\n width: calc(100% + var(--editor-input-padding, 28px) * 2);\n overflow: unset;\n margin-left: calc(var(--editor-input-padding, 28px) * -1);\n margin-top: var(--editor-input-padding, 28px);\n margin-bottom: var(--editor-input-padding, 28px);\n\n border: none;\n border-top: 1px dashed var(--editor-color-secondary, #eeeeee);\n border-bottom: 1px dashed var(--editor-color-secondary, #eeeeee);\n background-color: var(--editor-color-secondary, #eeeeee);\n}\n\n[type='page-break']::before {\n content: '';\n\n position: absolute;\n top: 50%;\n left: calc(var(--editor-input-padding, 28px) + 12px);\n transform: translateY(-50%);\n opacity: 0.5;\n\n background-size: cover;\n background-image: url(/icons/scissors.svg);\n width: 16px;\n height: 16px;\n}\n\n[type='page-break']::after {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n\n display: block;\n padding: 2px 6px;\n border: 1px solid #ccc;\n background-color: #fff;\n\n content: 'PAGE BREAK';\n font-size: 12px;\n color: #000;\n font-weight: 600;\n}\n\n.PlaygroundEditorTheme__quote {\n margin: 0;\n margin-left: 20px;\n font-size: 15px;\n color: rgb(101, 103, 107);\n border-left-color: rgb(206, 208, 212);\n border-left-width: 4px;\n border-left-style: solid;\n padding-left: 16px;\n}\n.PlaygroundEditorTheme__h1 {\n font-size: 34px;\n margin-bottom: 10px;\n}\n.PlaygroundEditorTheme__h2 {\n font-size: 29px;\n margin-bottom: 10px;\n}\n.PlaygroundEditorTheme__h3 {\n font-size: 24px;\n margin-bottom: 10px;\n}\n.PlaygroundEditorTheme__h4 {\n font-size: 21px;\n margin-bottom: 10px;\n}\n.PlaygroundEditorTheme__h5 {\n font-size: 18px;\n margin-bottom: 10px;\n}\n.PlaygroundEditorTheme__h6 {\n font-size: 16px;\n margin-bottom: 10px;\n}\n.PlaygroundEditorTheme__indent {\n --lexical-indent-base-value: 40px;\n}\n.PlaygroundEditorTheme__textBold {\n font-weight: bold;\n}\n.PlaygroundEditorTheme__textItalic {\n font-style: italic;\n}\n.PlaygroundEditorTheme__textUnderline {\n text-decoration: underline;\n}\n.PlaygroundEditorTheme__textStrikethrough {\n text-decoration: line-through;\n}\n.PlaygroundEditorTheme__textUnderlineStrikethrough {\n text-decoration: underline line-through;\n}\n.PlaygroundEditorTheme__textSubscript {\n font-size: 0.8em;\n vertical-align: sub !important;\n}\n.PlaygroundEditorTheme__textSuperscript {\n font-size: 0.8em;\n vertical-align: super;\n}\n.PlaygroundEditorTheme__textCode {\n background-color: rgb(240, 242, 245);\n padding: 1px 0.25rem;\n font-family: Menlo, Consolas, Monaco, monospace;\n font-size: 94%;\n}\n.PlaygroundEditorTheme__hashtag {\n background-color: rgba(88, 144, 255, 0.15);\n border-bottom: 1px solid rgba(88, 144, 255, 0.3);\n}\n.PlaygroundEditorTheme__link {\n color: rgb(33, 111, 219);\n text-decoration: none;\n}\n.PlaygroundEditorTheme__link:hover {\n text-decoration: underline;\n cursor: pointer;\n}\n.PlaygroundEditorTheme__code {\n background-color: rgb(240, 242, 245);\n font-family: Menlo, Consolas, Monaco, monospace;\n display: block;\n padding: 8px 8px 8px 52px;\n line-height: 1.53;\n font-size: 13px;\n margin: 0;\n margin-top: 8px;\n margin-bottom: 8px;\n overflow-x: auto;\n position: relative;\n tab-size: 2;\n}\n.PlaygroundEditorTheme__code:before {\n content: attr(data-gutter);\n position: absolute;\n background-color: #eee;\n left: 0;\n top: 0;\n border-right: 1px solid #ccc;\n padding: 8px;\n color: #777;\n white-space: pre-wrap;\n text-align: right;\n min-width: 25px;\n}\n.PlaygroundEditorTheme__table {\n border-collapse: collapse;\n border-spacing: 0;\n overflow-y: scroll;\n overflow-x: scroll;\n table-layout: fixed;\n width: max-content;\n margin: 30px 0;\n}\n.PlaygroundEditorTheme__tableSelection *::selection {\n background-color: transparent;\n}\n.PlaygroundEditorTheme__tableSelected {\n outline: 2px solid rgb(60, 132, 244);\n}\n.PlaygroundEditorTheme__tableCell {\n border: 1px solid #bbb;\n width: 75px;\n min-width: 75px;\n vertical-align: top;\n text-align: start;\n padding: 6px 8px;\n position: relative;\n outline: none;\n}\n.PlaygroundEditorTheme__tableCellSortedIndicator {\n display: block;\n opacity: 0.5;\n position: absolute;\n bottom: 0;\n left: 0;\n width: 100%;\n height: 4px;\n background-color: #999;\n}\n.PlaygroundEditorTheme__tableCellResizer {\n position: absolute;\n right: -4px;\n height: 100%;\n width: 8px;\n cursor: ew-resize;\n z-index: 10;\n top: 0;\n}\n.PlaygroundEditorTheme__tableCellHeader {\n background-color: #f2f3f5;\n text-align: start;\n}\n.PlaygroundEditorTheme__tableCellSelected {\n background-color: #c9dbf0;\n}\n.PlaygroundEditorTheme__tableCellPrimarySelected {\n border: 2px solid rgb(60, 132, 244);\n display: block;\n height: calc(100% - 2px);\n position: absolute;\n width: calc(100% - 2px);\n left: -1px;\n top: -1px;\n z-index: 2;\n}\n.PlaygroundEditorTheme__tableCellEditing {\n box-shadow: 0 0 5px rgba(0, 0, 0, 0.4);\n border-radius: 3px;\n}\n.PlaygroundEditorTheme__tableAddColumns {\n position: absolute;\n top: 0;\n width: 20px;\n background-color: #eee;\n height: 100%;\n right: -25px;\n animation: table-controls 0.2s ease;\n border: 0;\n cursor: pointer;\n}\n.PlaygroundEditorTheme__tableAddColumns:after {\n background-image: url('/icons/plus.svg');\n background-size: contain;\n background-position: center;\n background-repeat: no-repeat;\n display: block;\n content: ' ';\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n opacity: 0.4;\n}\n.PlaygroundEditorTheme__tableAddColumns:hover {\n background-color: #c9dbf0;\n}\n.PlaygroundEditorTheme__tableAddRows {\n position: absolute;\n bottom: -25px;\n width: calc(100% - 25px);\n background-color: #eee;\n height: 20px;\n left: 0;\n animation: table-controls 0.2s ease;\n border: 0;\n cursor: pointer;\n}\n.PlaygroundEditorTheme__tableAddRows:after {\n background-image: url(/icons/plus.svg);\n background-size: contain;\n background-position: center;\n background-repeat: no-repeat;\n display: block;\n content: ' ';\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n opacity: 0.4;\n}\n.PlaygroundEditorTheme__tableAddRows:hover {\n background-color: #c9dbf0;\n}\n@keyframes table-controls {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n.PlaygroundEditorTheme__tableCellResizeRuler {\n display: block;\n position: absolute;\n width: 1px;\n background-color: rgb(60, 132, 244);\n height: 100%;\n top: 0;\n}\n.PlaygroundEditorTheme__tableCellActionButtonContainer {\n display: block;\n right: 5px;\n top: 6px;\n position: absolute;\n z-index: 4;\n width: 20px;\n height: 20px;\n}\n.PlaygroundEditorTheme__tableCellActionButton {\n background-color: #eee;\n display: block;\n border: 0;\n border-radius: 20px;\n width: 20px;\n height: 20px;\n color: #222;\n cursor: pointer;\n}\n.PlaygroundEditorTheme__tableCellActionButton:hover {\n background-color: #ddd;\n}\n.PlaygroundEditorTheme__characterLimit {\n display: inline;\n background-color: #ffbbbb !important;\n}\n.PlaygroundEditorTheme__ol1 {\n padding: 0;\n margin: 0;\n list-style-position: inside;\n list-style-type: decimal;\n margin-left: 20px;\n}\n.PlaygroundEditorTheme__ol2 {\n padding: 0;\n margin: 0;\n list-style-type: upper-alpha;\n list-style-position: inside;\n margin-left: 20px;\n}\n.PlaygroundEditorTheme__ol3 {\n padding: 0;\n margin: 0;\n list-style-type: lower-alpha;\n list-style-position: inside;\n margin-left: 20px;\n}\n.PlaygroundEditorTheme__ol4 {\n padding: 0;\n margin: 0;\n list-style-type: upper-roman;\n list-style-position: inside;\n margin-left: 20px;\n}\n.PlaygroundEditorTheme__ol5 {\n padding: 0;\n margin: 0;\n list-style-type: lower-roman;\n list-style-position: inside;\n margin-left: 20px;\n}\n.PlaygroundEditorTheme__ul {\n padding: 0;\n margin: 0;\n list-style: disc;\n margin-left: 20px;\n list-style-position: inside;\n}\n\n.PlaygroundEditorTheme__listItem {\n font-family: var(--listitem-marker-font-family);\n font-size: var(--listitem-marker-font-size);\n background-color: var(--listitem-marker-background-color);\n}\n\n.PlaygroundEditorTheme__listItem::marker {\n color: var(--listitem-marker-color);\n background-color: var(--listitem-marker-background-color);\n font-family: var(--listitem-marker-font-family);\n font-size: var(--listitem-marker-font-size);\n font-style: var(--listitem-marker-font-style);\n font-weight: var(--listitem-marker-font-weight);\n}\n\n.PlaygroundEditorTheme__listItemChecked,\n.PlaygroundEditorTheme__listItemUnchecked {\n position: relative;\n margin-left: 8px;\n margin-right: 8px;\n padding-left: 24px;\n padding-right: 24px;\n list-style-type: none;\n outline: none;\n}\n.PlaygroundEditorTheme__listItemChecked {\n text-decoration: line-through;\n}\n.PlaygroundEditorTheme__listItemUnchecked:before,\n.PlaygroundEditorTheme__listItemChecked:before {\n content: '';\n width: 16px;\n height: 16px;\n top: 2px;\n left: 0;\n cursor: pointer;\n display: block;\n background-size: cover;\n position: absolute;\n}\n.PlaygroundEditorTheme__listItemUnchecked[dir='rtl']:before,\n.PlaygroundEditorTheme__listItemChecked[dir='rtl']:before {\n left: auto;\n right: 0;\n}\n.PlaygroundEditorTheme__listItemUnchecked:focus:before,\n.PlaygroundEditorTheme__listItemChecked:focus:before {\n box-shadow: 0 0 0 2px #a6cdfe;\n border-radius: 2px;\n}\n.PlaygroundEditorTheme__listItemUnchecked:before {\n border: 1px solid #999;\n border-radius: 2px;\n}\n.PlaygroundEditorTheme__listItemChecked:before {\n border: 1px solid rgb(61, 135, 245);\n border-radius: 2px;\n background-color: #3d87f5;\n background-repeat: no-repeat;\n}\n.PlaygroundEditorTheme__listItemChecked:after {\n content: '';\n cursor: pointer;\n border-color: #fff;\n border-style: solid;\n position: absolute;\n display: block;\n top: 6px;\n width: 3px;\n left: 7px;\n right: 7px;\n height: 6px;\n transform: rotate(45deg);\n border-width: 0 2px 2px 0;\n}\n.PlaygroundEditorTheme__nestedListItem {\n list-style-type: none;\n}\n.PlaygroundEditorTheme__nestedListItem:before,\n.PlaygroundEditorTheme__nestedListItem:after {\n display: none;\n}\n.PlaygroundEditorTheme__tokenComment {\n color: slategray;\n}\n.PlaygroundEditorTheme__tokenPunctuation {\n color: #999;\n}\n.PlaygroundEditorTheme__tokenProperty {\n color: #905;\n}\n.PlaygroundEditorTheme__tokenSelector {\n color: #690;\n}\n.PlaygroundEditorTheme__tokenOperator {\n color: #9a6e3a;\n}\n.PlaygroundEditorTheme__tokenAttr {\n color: #07a;\n}\n.PlaygroundEditorTheme__tokenVariable {\n color: #e90;\n}\n.PlaygroundEditorTheme__tokenFunction {\n color: #dd4a68;\n}\n.PlaygroundEditorTheme__mark {\n background: rgba(255, 212, 0, 0.14);\n border-bottom: 2px solid rgba(255, 212, 0, 0.3);\n padding-bottom: 2px;\n}\n.PlaygroundEditorTheme__markOverlap {\n background: rgba(255, 212, 0, 0.3);\n border-bottom: 2px solid rgba(255, 212, 0, 0.7);\n}\n.PlaygroundEditorTheme__mark.selected {\n background: rgba(255, 212, 0, 0.5);\n border-bottom: 2px solid rgba(255, 212, 0, 1);\n}\n.PlaygroundEditorTheme__markOverlap.selected {\n background: rgba(255, 212, 0, 0.7);\n border-bottom: 2px solid rgba(255, 212, 0, 0.7);\n}\n.PlaygroundEditorTheme__embedBlock {\n user-select: none;\n}\n.PlaygroundEditorTheme__embedBlockFocus {\n outline: 2px solid rgb(60, 132, 244);\n}\n.PlaygroundEditorTheme__layoutContaner {\n display: grid;\n gap: 10px;\n margin: 10px 0;\n}\n.PlaygroundEditorTheme__layoutItem {\n border: 1px dashed #ddd;\n padding: 8px 16px;\n}\n\n.image-resizer-wrapper {\n position: absolute;\n inset: 0;\n pointer-events: none;\n z-index: 1;\n}\n\n.image-resizer {\n position: absolute;\n pointer-events: auto;\n background-color: #fff;\n border: 1px solid rgb(60, 132, 244);\n border-radius: 50%;\n box-sizing: border-box;\n width: 10px;\n height: 10px;\n}\n\n.image-resizer-n,\n.image-resizer-s {\n left: 50%;\n transform: translateX(-50%);\n cursor: ns-resize;\n}\n\n.image-resizer-e,\n.image-resizer-w {\n top: 50%;\n transform: translateY(-50%);\n cursor: ew-resize;\n}\n\n.image-resizer-n {\n top: -5px;\n}\n\n.image-resizer-ne {\n top: -5px;\n right: -5px;\n cursor: nesw-resize;\n}\n\n.image-resizer-e {\n right: -5px;\n}\n\n.image-resizer-se {\n right: -5px;\n bottom: -5px;\n cursor: nwse-resize;\n}\n\n.image-resizer-s {\n bottom: -5px;\n}\n\n.image-resizer-sw {\n bottom: -5px;\n left: -5px;\n cursor: nesw-resize;\n}\n\n.image-resizer-w {\n left: -5px;\n}\n\n.image-resizer-nw {\n top: -5px;\n left: -5px;\n cursor: nwse-resize;\n}\n\n.editor-image {\n display: block;\n position: relative;\n width: fit-content;\n max-width: 100%;\n margin-left: auto;\n margin-right: auto;\n}\n\n.editor-image.position-left,\n.inline-editor-image.position-left {\n display: block;\n position: relative;\n width: fit-content;\n max-width: 100%;\n margin-left: 0;\n margin-right: auto;\n}\n\n.editor-image.position-center,\n.inline-editor-image.position-center {\n display: block;\n position: relative;\n width: fit-content;\n max-width: 100%;\n margin-left: auto;\n margin-right: auto;\n}\n\n.editor-image.position-right,\n.inline-editor-image.position-right {\n display: block;\n position: relative;\n width: fit-content;\n max-width: 100%;\n margin-left: auto;\n margin-right: 0;\n}\n\n.editor-image > div,\n.inline-editor-image > div {\n position: relative;\n}\n\n.editor-image img {\n display: block;\n margin-left: auto;\n margin-right: auto;\n max-width: 90% !important;\n border: 1px solid #e5e7eb;\n margin-bottom: 10px;\n}\n\n.inline-editor-image.position-full {\n display: block;\n position: relative;\n width: 100%;\n max-width: 100%;\n}\n\n.inline-editor-image.position-full img {\n width: 100%;\n max-width: 100%;\n}\n\n.inline-editor-image.position-center img {\n max-width: 100%;\n}\n\n.editor-image img.focused,\n.inline-editor-image img.focused {\n outline: 2px solid rgb(60, 132, 244);\n outline-offset: 2px;\n}\n";
|
|
1
|
+
export declare const styleTag = "\n* {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n}\n.PlaygroundEditorTheme__ltr {\n text-align: left;\n}\n.PlaygroundEditorTheme__rtl {\n text-align: right;\n}\n.PlaygroundEditorTheme__paragraph,\n.PlaygroundEditorTheme__listItem {\n font-size: 14px;\n line-height: normal;\n}\n\n[type='page-break'] {\n position: relative;\n display: block;\n width: calc(100% + var(--editor-input-padding, 28px) * 2);\n overflow: unset;\n margin-left: calc(var(--editor-input-padding, 28px) * -1);\n margin-top: var(--editor-input-padding, 28px);\n margin-bottom: var(--editor-input-padding, 28px);\n\n border: none;\n border-top: 1px dashed var(--editor-color-secondary, #eeeeee);\n border-bottom: 1px dashed var(--editor-color-secondary, #eeeeee);\n background-color: var(--editor-color-secondary, #eeeeee);\n}\n\n[type='page-break']::before {\n content: '';\n\n position: absolute;\n top: 50%;\n left: calc(var(--editor-input-padding, 28px) + 12px);\n transform: translateY(-50%);\n opacity: 0.5;\n\n background-size: cover;\n background-image: url(/icons/scissors.svg);\n width: 16px;\n height: 16px;\n}\n\n[type='page-break']::after {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n\n display: block;\n padding: 2px 6px;\n border: 1px solid #ccc;\n background-color: #fff;\n\n content: 'PAGE BREAK';\n font-size: 12px;\n color: #000;\n font-weight: 600;\n}\n\n.PlaygroundEditorTheme__quote {\n margin: 0;\n margin-left: 20px;\n font-size: 15px;\n color: rgb(101, 103, 107);\n border-left-color: rgb(206, 208, 212);\n border-left-width: 4px;\n border-left-style: solid;\n padding-left: 16px;\n}\n.PlaygroundEditorTheme__h1 {\n font-size: 34px;\n margin-bottom: 10px;\n}\n.PlaygroundEditorTheme__h2 {\n font-size: 29px;\n margin-bottom: 10px;\n}\n.PlaygroundEditorTheme__h3 {\n font-size: 24px;\n margin-bottom: 10px;\n}\n.PlaygroundEditorTheme__h4 {\n font-size: 21px;\n margin-bottom: 10px;\n}\n.PlaygroundEditorTheme__h5 {\n font-size: 18px;\n margin-bottom: 10px;\n}\n.PlaygroundEditorTheme__h6 {\n font-size: 16px;\n margin-bottom: 10px;\n}\n.PlaygroundEditorTheme__indent {\n --lexical-indent-base-value: 40px;\n}\n.PlaygroundEditorTheme__textBold {\n font-weight: bold;\n}\n.PlaygroundEditorTheme__textItalic {\n font-style: italic;\n}\n.PlaygroundEditorTheme__textUnderline {\n text-decoration: underline;\n}\n.PlaygroundEditorTheme__textStrikethrough {\n text-decoration: line-through;\n}\n.PlaygroundEditorTheme__textUnderlineStrikethrough {\n text-decoration: underline line-through;\n}\n.PlaygroundEditorTheme__textSubscript {\n font-size: 0.8em;\n vertical-align: sub !important;\n}\n.PlaygroundEditorTheme__textSuperscript {\n font-size: 0.8em;\n vertical-align: super;\n}\n.PlaygroundEditorTheme__textCode {\n background-color: rgb(240, 242, 245);\n padding: 1px 0.25rem;\n font-family: Menlo, Consolas, Monaco, monospace;\n font-size: 94%;\n}\n.PlaygroundEditorTheme__hashtag {\n background-color: rgba(88, 144, 255, 0.15);\n border-bottom: 1px solid rgba(88, 144, 255, 0.3);\n}\n.PlaygroundEditorTheme__link {\n color: rgb(33, 111, 219);\n text-decoration: none;\n}\n.PlaygroundEditorTheme__link:hover {\n text-decoration: underline;\n cursor: pointer;\n}\n.PlaygroundEditorTheme__code {\n background-color: rgb(240, 242, 245);\n font-family: Menlo, Consolas, Monaco, monospace;\n display: block;\n padding: 8px 8px 8px 52px;\n line-height: 1.53;\n font-size: 13px;\n margin: 0;\n margin-top: 8px;\n margin-bottom: 8px;\n overflow-x: auto;\n position: relative;\n tab-size: 2;\n}\n.PlaygroundEditorTheme__code:before {\n content: attr(data-gutter);\n position: absolute;\n background-color: #eee;\n left: 0;\n top: 0;\n border-right: 1px solid #ccc;\n padding: 8px;\n color: #777;\n white-space: pre-wrap;\n text-align: right;\n min-width: 25px;\n}\n.PlaygroundEditorTheme__table {\n border-collapse: collapse;\n border-spacing: 0;\n overflow-y: scroll;\n overflow-x: scroll;\n table-layout: fixed;\n width: max-content;\n margin: 30px 0;\n}\n.PlaygroundEditorTheme__tableSelection *::selection {\n background-color: transparent;\n}\n.PlaygroundEditorTheme__tableSelected {\n outline: 2px solid rgb(60, 132, 244);\n}\n.PlaygroundEditorTheme__tableCell {\n border: 1px solid #bbb;\n width: 75px;\n min-width: 75px;\n vertical-align: top;\n text-align: start;\n padding: 6px 8px;\n position: relative;\n outline: none;\n}\n.PlaygroundEditorTheme__tableCellSortedIndicator {\n display: block;\n opacity: 0.5;\n position: absolute;\n bottom: 0;\n left: 0;\n width: 100%;\n height: 4px;\n background-color: #999;\n}\n.PlaygroundEditorTheme__tableCellResizer {\n position: absolute;\n right: -4px;\n height: 100%;\n width: 8px;\n cursor: ew-resize;\n z-index: 10;\n top: 0;\n}\n.PlaygroundEditorTheme__tableCellHeader {\n background-color: #f2f3f5;\n text-align: start;\n}\n.PlaygroundEditorTheme__tableCellSelected {\n background-color: #c9dbf0;\n}\n.PlaygroundEditorTheme__tableCellPrimarySelected {\n border: 2px solid rgb(60, 132, 244);\n display: block;\n height: calc(100% - 2px);\n position: absolute;\n width: calc(100% - 2px);\n left: -1px;\n top: -1px;\n z-index: 2;\n}\n.PlaygroundEditorTheme__tableCellEditing {\n box-shadow: 0 0 5px rgba(0, 0, 0, 0.4);\n border-radius: 3px;\n}\n.PlaygroundEditorTheme__tableAddColumns {\n position: absolute;\n top: 0;\n width: 20px;\n background-color: #eee;\n height: 100%;\n right: -25px;\n animation: table-controls 0.2s ease;\n border: 0;\n cursor: pointer;\n}\n.PlaygroundEditorTheme__tableAddColumns:after {\n background-image: url('/icons/plus.svg');\n background-size: contain;\n background-position: center;\n background-repeat: no-repeat;\n display: block;\n content: ' ';\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n opacity: 0.4;\n}\n.PlaygroundEditorTheme__tableAddColumns:hover {\n background-color: #c9dbf0;\n}\n.PlaygroundEditorTheme__tableAddRows {\n position: absolute;\n bottom: -25px;\n width: calc(100% - 25px);\n background-color: #eee;\n height: 20px;\n left: 0;\n animation: table-controls 0.2s ease;\n border: 0;\n cursor: pointer;\n}\n.PlaygroundEditorTheme__tableAddRows:after {\n background-image: url(/icons/plus.svg);\n background-size: contain;\n background-position: center;\n background-repeat: no-repeat;\n display: block;\n content: ' ';\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n opacity: 0.4;\n}\n.PlaygroundEditorTheme__tableAddRows:hover {\n background-color: #c9dbf0;\n}\n@keyframes table-controls {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n.PlaygroundEditorTheme__tableCellResizeRuler {\n display: block;\n position: absolute;\n width: 1px;\n background-color: rgb(60, 132, 244);\n height: 100%;\n top: 0;\n}\n.PlaygroundEditorTheme__tableCellActionButtonContainer {\n display: block;\n right: 5px;\n top: 6px;\n position: absolute;\n z-index: 4;\n width: 20px;\n height: 20px;\n}\n.PlaygroundEditorTheme__tableCellActionButton {\n background-color: #eee;\n display: block;\n border: 0;\n border-radius: 20px;\n width: 20px;\n height: 20px;\n color: #222;\n cursor: pointer;\n}\n.PlaygroundEditorTheme__tableCellActionButton:hover {\n background-color: #ddd;\n}\n.PlaygroundEditorTheme__characterLimit {\n display: inline;\n background-color: #ffbbbb !important;\n}\n.PlaygroundEditorTheme__ol1 {\n padding: 0;\n margin: 0;\n list-style-position: inside;\n list-style-type: decimal;\n margin-left: 20px;\n}\n.PlaygroundEditorTheme__ol2 {\n padding: 0;\n margin: 0;\n list-style-type: upper-alpha;\n list-style-position: inside;\n margin-left: 20px;\n}\n.PlaygroundEditorTheme__ol3 {\n padding: 0;\n margin: 0;\n list-style-type: lower-alpha;\n list-style-position: inside;\n margin-left: 20px;\n}\n.PlaygroundEditorTheme__ol4 {\n padding: 0;\n margin: 0;\n list-style-type: upper-roman;\n list-style-position: inside;\n margin-left: 20px;\n}\n.PlaygroundEditorTheme__ol5 {\n padding: 0;\n margin: 0;\n list-style-type: lower-roman;\n list-style-position: inside;\n margin-left: 20px;\n}\n.PlaygroundEditorTheme__ul {\n padding: 0;\n margin: 0;\n list-style: disc;\n margin-left: 20px;\n list-style-position: inside;\n}\n\n.PlaygroundEditorTheme__listItem {\n font-family: var(--listitem-marker-font-family);\n font-size: var(--listitem-marker-font-size, 14px);\n background-color: var(--listitem-marker-background-color);\n}\n\n.PlaygroundEditorTheme__listItem::marker {\n color: var(--listitem-marker-color);\n background-color: var(--listitem-marker-background-color);\n font-family: var(--listitem-marker-font-family);\n font-size: var(--listitem-marker-font-size);\n font-style: var(--listitem-marker-font-style);\n font-weight: var(--listitem-marker-font-weight);\n}\n\n.PlaygroundEditorTheme__listItemChecked,\n.PlaygroundEditorTheme__listItemUnchecked {\n position: relative;\n margin-left: 8px;\n margin-right: 8px;\n padding-left: 24px;\n padding-right: 24px;\n list-style-type: none;\n outline: none;\n}\n.PlaygroundEditorTheme__listItemChecked {\n text-decoration: line-through;\n}\n.PlaygroundEditorTheme__listItemUnchecked:before,\n.PlaygroundEditorTheme__listItemChecked:before {\n content: '';\n width: 16px;\n height: 16px;\n top: 2px;\n left: 0;\n cursor: pointer;\n display: block;\n background-size: cover;\n position: absolute;\n}\n.PlaygroundEditorTheme__listItemUnchecked[dir='rtl']:before,\n.PlaygroundEditorTheme__listItemChecked[dir='rtl']:before {\n left: auto;\n right: 0;\n}\n.PlaygroundEditorTheme__listItemUnchecked:focus:before,\n.PlaygroundEditorTheme__listItemChecked:focus:before {\n box-shadow: 0 0 0 2px #a6cdfe;\n border-radius: 2px;\n}\n.PlaygroundEditorTheme__listItemUnchecked:before {\n border: 1px solid #999;\n border-radius: 2px;\n}\n.PlaygroundEditorTheme__listItemChecked:before {\n border: 1px solid rgb(61, 135, 245);\n border-radius: 2px;\n background-color: #3d87f5;\n background-repeat: no-repeat;\n}\n.PlaygroundEditorTheme__listItemChecked:after {\n content: '';\n cursor: pointer;\n border-color: #fff;\n border-style: solid;\n position: absolute;\n display: block;\n top: 6px;\n width: 3px;\n left: 7px;\n right: 7px;\n height: 6px;\n transform: rotate(45deg);\n border-width: 0 2px 2px 0;\n}\n.PlaygroundEditorTheme__nestedListItem {\n list-style-type: none;\n}\n.PlaygroundEditorTheme__nestedListItem:before,\n.PlaygroundEditorTheme__nestedListItem:after {\n display: none;\n}\n.PlaygroundEditorTheme__tokenComment {\n color: slategray;\n}\n.PlaygroundEditorTheme__tokenPunctuation {\n color: #999;\n}\n.PlaygroundEditorTheme__tokenProperty {\n color: #905;\n}\n.PlaygroundEditorTheme__tokenSelector {\n color: #690;\n}\n.PlaygroundEditorTheme__tokenOperator {\n color: #9a6e3a;\n}\n.PlaygroundEditorTheme__tokenAttr {\n color: #07a;\n}\n.PlaygroundEditorTheme__tokenVariable {\n color: #e90;\n}\n.PlaygroundEditorTheme__tokenFunction {\n color: #dd4a68;\n}\n.PlaygroundEditorTheme__mark {\n background: rgba(255, 212, 0, 0.14);\n border-bottom: 2px solid rgba(255, 212, 0, 0.3);\n padding-bottom: 2px;\n}\n.PlaygroundEditorTheme__markOverlap {\n background: rgba(255, 212, 0, 0.3);\n border-bottom: 2px solid rgba(255, 212, 0, 0.7);\n}\n.PlaygroundEditorTheme__mark.selected {\n background: rgba(255, 212, 0, 0.5);\n border-bottom: 2px solid rgba(255, 212, 0, 1);\n}\n.PlaygroundEditorTheme__markOverlap.selected {\n background: rgba(255, 212, 0, 0.7);\n border-bottom: 2px solid rgba(255, 212, 0, 0.7);\n}\n.PlaygroundEditorTheme__embedBlock {\n user-select: none;\n}\n.PlaygroundEditorTheme__embedBlockFocus {\n outline: 2px solid rgb(60, 132, 244);\n}\n.PlaygroundEditorTheme__layoutContaner {\n display: grid;\n gap: 10px;\n margin: 10px 0;\n}\n.PlaygroundEditorTheme__layoutItem {\n border: 1px dashed #ddd;\n padding: 8px 16px;\n}\n\n.image-resizer-wrapper {\n position: absolute;\n inset: 0;\n pointer-events: none;\n z-index: 1;\n}\n\n.image-resizer {\n position: absolute;\n pointer-events: auto;\n background-color: #fff;\n border: 1px solid rgb(60, 132, 244);\n border-radius: 50%;\n box-sizing: border-box;\n width: 10px;\n height: 10px;\n}\n\n.image-resizer-n,\n.image-resizer-s {\n left: 50%;\n transform: translateX(-50%);\n cursor: ns-resize;\n}\n\n.image-resizer-e,\n.image-resizer-w {\n top: 50%;\n transform: translateY(-50%);\n cursor: ew-resize;\n}\n\n.image-resizer-n {\n top: -5px;\n}\n\n.image-resizer-ne {\n top: -5px;\n right: -5px;\n cursor: nesw-resize;\n}\n\n.image-resizer-e {\n right: -5px;\n}\n\n.image-resizer-se {\n right: -5px;\n bottom: -5px;\n cursor: nwse-resize;\n}\n\n.image-resizer-s {\n bottom: -5px;\n}\n\n.image-resizer-sw {\n bottom: -5px;\n left: -5px;\n cursor: nesw-resize;\n}\n\n.image-resizer-w {\n left: -5px;\n}\n\n.image-resizer-nw {\n top: -5px;\n left: -5px;\n cursor: nwse-resize;\n}\n\n.editor-image {\n display: flex;\n justify-content: center;\n position: relative;\n width: 100%;\n max-width: 100%;\n margin-left: auto;\n margin-right: auto;\n}\n\n.editor-image.position-left,\n.inline-editor-image.position-left {\n display: flex;\n justify-content: flex-start;\n position: relative;\n width: 100%;\n max-width: 100%;\n margin-left: 0;\n margin-right: auto;\n}\n\n.editor-image.position-center,\n.inline-editor-image.position-center {\n display: flex;\n justify-content: center;\n position: relative;\n width: 100%;\n max-width: 100%;\n margin-left: auto;\n margin-right: auto;\n}\n\n.editor-image.position-right,\n.inline-editor-image.position-right {\n display: flex;\n justify-content: flex-end;\n position: relative;\n width: 100%;\n max-width: 100%;\n margin-left: auto;\n margin-right: 0;\n}\n\n.editor-image > div,\n.inline-editor-image > div {\n position: relative;\n}\n\n.editor-image img {\n display: block;\n margin-left: auto;\n margin-right: auto;\n max-width: 90% !important;\n border: 1px solid #e5e7eb;\n margin-bottom: 10px;\n}\n\n.inline-editor-image img {\n display: block;\n max-width: 100%;\n}\n\n.inline-editor-image.position-full {\n display: block;\n position: relative;\n width: 100%;\n max-width: 100%;\n}\n\n.inline-editor-image.position-full img {\n width: 100%;\n max-width: 100%;\n}\n\n.inline-editor-image.position-center img {\n max-width: 100%;\n}\n\n.editor-image img.focused,\n.inline-editor-image img.focused {\n outline: 2px solid rgb(60, 132, 244);\n outline-offset: 2px;\n}\n";
|
|
@@ -13,6 +13,11 @@ exports.styleTag = `
|
|
|
13
13
|
.PlaygroundEditorTheme__rtl {
|
|
14
14
|
text-align: right;
|
|
15
15
|
}
|
|
16
|
+
.PlaygroundEditorTheme__paragraph,
|
|
17
|
+
.PlaygroundEditorTheme__listItem {
|
|
18
|
+
font-size: 14px;
|
|
19
|
+
line-height: normal;
|
|
20
|
+
}
|
|
16
21
|
|
|
17
22
|
[type='page-break'] {
|
|
18
23
|
position: relative;
|
|
@@ -374,7 +379,7 @@ exports.styleTag = `
|
|
|
374
379
|
|
|
375
380
|
.PlaygroundEditorTheme__listItem {
|
|
376
381
|
font-family: var(--listitem-marker-font-family);
|
|
377
|
-
font-size: var(--listitem-marker-font-size);
|
|
382
|
+
font-size: var(--listitem-marker-font-size, 14px);
|
|
378
383
|
background-color: var(--listitem-marker-background-color);
|
|
379
384
|
}
|
|
380
385
|
|
|
@@ -584,9 +589,10 @@ exports.styleTag = `
|
|
|
584
589
|
}
|
|
585
590
|
|
|
586
591
|
.editor-image {
|
|
587
|
-
display:
|
|
592
|
+
display: flex;
|
|
593
|
+
justify-content: center;
|
|
588
594
|
position: relative;
|
|
589
|
-
width:
|
|
595
|
+
width: 100%;
|
|
590
596
|
max-width: 100%;
|
|
591
597
|
margin-left: auto;
|
|
592
598
|
margin-right: auto;
|
|
@@ -594,9 +600,10 @@ exports.styleTag = `
|
|
|
594
600
|
|
|
595
601
|
.editor-image.position-left,
|
|
596
602
|
.inline-editor-image.position-left {
|
|
597
|
-
display:
|
|
603
|
+
display: flex;
|
|
604
|
+
justify-content: flex-start;
|
|
598
605
|
position: relative;
|
|
599
|
-
width:
|
|
606
|
+
width: 100%;
|
|
600
607
|
max-width: 100%;
|
|
601
608
|
margin-left: 0;
|
|
602
609
|
margin-right: auto;
|
|
@@ -604,9 +611,10 @@ exports.styleTag = `
|
|
|
604
611
|
|
|
605
612
|
.editor-image.position-center,
|
|
606
613
|
.inline-editor-image.position-center {
|
|
607
|
-
display:
|
|
614
|
+
display: flex;
|
|
615
|
+
justify-content: center;
|
|
608
616
|
position: relative;
|
|
609
|
-
width:
|
|
617
|
+
width: 100%;
|
|
610
618
|
max-width: 100%;
|
|
611
619
|
margin-left: auto;
|
|
612
620
|
margin-right: auto;
|
|
@@ -614,9 +622,10 @@ exports.styleTag = `
|
|
|
614
622
|
|
|
615
623
|
.editor-image.position-right,
|
|
616
624
|
.inline-editor-image.position-right {
|
|
617
|
-
display:
|
|
625
|
+
display: flex;
|
|
626
|
+
justify-content: flex-end;
|
|
618
627
|
position: relative;
|
|
619
|
-
width:
|
|
628
|
+
width: 100%;
|
|
620
629
|
max-width: 100%;
|
|
621
630
|
margin-left: auto;
|
|
622
631
|
margin-right: 0;
|
|
@@ -636,6 +645,11 @@ exports.styleTag = `
|
|
|
636
645
|
margin-bottom: 10px;
|
|
637
646
|
}
|
|
638
647
|
|
|
648
|
+
.inline-editor-image img {
|
|
649
|
+
display: block;
|
|
650
|
+
max-width: 100%;
|
|
651
|
+
}
|
|
652
|
+
|
|
639
653
|
.inline-editor-image.position-full {
|
|
640
654
|
display: block;
|
|
641
655
|
position: relative;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/components/TextEditorV2/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,QAAQ,GAAG
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/components/TextEditorV2/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8pBvB,CAAA"}
|
|
@@ -4,8 +4,6 @@ exports.RIGHT_CLICK_IMAGE_COMMAND = void 0;
|
|
|
4
4
|
exports.default = ImageComponent;
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
6
6
|
const LexicalAutoFocusPlugin_1 = require("@lexical/react/LexicalAutoFocusPlugin");
|
|
7
|
-
const LexicalCollaborationContext_1 = require("@lexical/react/LexicalCollaborationContext");
|
|
8
|
-
const LexicalCollaborationPlugin_1 = require("@lexical/react/LexicalCollaborationPlugin");
|
|
9
7
|
const LexicalComposerContext_1 = require("@lexical/react/LexicalComposerContext");
|
|
10
8
|
const LexicalHashtagPlugin_1 = require("@lexical/react/LexicalHashtagPlugin");
|
|
11
9
|
const LexicalHistoryPlugin_1 = require("@lexical/react/LexicalHistoryPlugin");
|
|
@@ -18,7 +16,6 @@ const React = tslib_1.__importStar(require("react"));
|
|
|
18
16
|
const react_1 = require("react");
|
|
19
17
|
const SettingsContext_1 = require("../context/SettingsContext");
|
|
20
18
|
const SharedHistoryContext_1 = require("../context/SharedHistoryContext");
|
|
21
|
-
const collaboration_1 = require("../lib/collaboration");
|
|
22
19
|
const LinkPlugin_1 = tslib_1.__importDefault(require("../plugins/LinkPlugin"));
|
|
23
20
|
const TreeViewPlugin_1 = tslib_1.__importDefault(require("../plugins/TreeViewPlugin"));
|
|
24
21
|
const ContentEditable_1 = tslib_1.__importDefault(require("../ui/ContentEditable"));
|
|
@@ -52,7 +49,6 @@ function ImageComponent({ altText, caption, height, maxWidth, nodeKey, showCapti
|
|
|
52
49
|
const buttonRef = (0, react_1.useRef)(null);
|
|
53
50
|
const [isSelected, setSelected, clearSelection] = (0, useLexicalNodeSelection_1.useLexicalNodeSelection)(nodeKey);
|
|
54
51
|
const [isResizing] = (0, react_1.useState)(false);
|
|
55
|
-
const { isCollabActive } = (0, LexicalCollaborationContext_1.useCollaborationContext)();
|
|
56
52
|
const [editor] = (0, LexicalComposerContext_1.useLexicalComposerContext)();
|
|
57
53
|
const [selection, setSelection] = (0, react_1.useState)(null);
|
|
58
54
|
const activeEditorRef = (0, react_1.useRef)(null);
|
|
@@ -179,7 +175,7 @@ function ImageComponent({ altText, caption, height, maxWidth, nodeKey, showCapti
|
|
|
179
175
|
React.createElement(LexicalAutoFocusPlugin_1.AutoFocusPlugin, null),
|
|
180
176
|
React.createElement(LinkPlugin_1.default, null),
|
|
181
177
|
React.createElement(LexicalHashtagPlugin_1.HashtagPlugin, null),
|
|
182
|
-
|
|
178
|
+
React.createElement(LexicalHistoryPlugin_1.HistoryPlugin, { externalHistoryState: historyState }),
|
|
183
179
|
React.createElement(LexicalRichTextPlugin_1.RichTextPlugin, { contentEditable: React.createElement(ContentEditable_1.default, { className: 'ImageNode__contentEditable' }), ErrorBoundary: LexicalErrorBoundary_1.LexicalErrorBoundary, placeholder: React.createElement(Placeholder_1.default, { className: 'ImageNode__placeholder' }, "Enter a caption...") }),
|
|
184
180
|
showNestedEditorTreeView === true ? React.createElement(TreeViewPlugin_1.default, null) : null))))));
|
|
185
181
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageComponent.js","sourceRoot":"","sources":["../../../../../src/components/TextEditorV2/nodes/ImageComponent.tsx"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"ImageComponent.js","sourceRoot":"","sources":["../../../../../src/components/TextEditorV2/nodes/ImageComponent.tsx"],"names":[],"mappings":";;;AAwFA,iCA4NC;;AAlTD,kFAAuE;AACvE,kFAAiF;AACjF,8EAAmE;AACnE,8EAAmE;AACnE,gFAA4E;AAC5E,gFAAqE;AACrE,oFAAgF;AAChF,0CAA8C;AAC9C,qCAegB;AAChB,qDAA8B;AAC9B,iCAA0E;AAC1E,gEAAwD;AACxD,0EAAyE;AACzE,+EAA8C;AAC9C,uFAAsD;AACtD,oFAAmD;AACnD,4EAA2C;AAC3C,2CAA0C;AAC1C,yEAAqE;AAErE,MAAM,UAAU,GAAG,IAAI,GAAG,EAAE,CAAA;AAEf,QAAA,yBAAyB,GAA+B,IAAA,uBAAa,EAAC,2BAA2B,CAAC,CAAA;AAE/G,SAAS,gBAAgB,CAAC,GAAW;IACnC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;QACzB,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YAC5B,MAAM,GAAG,GAAG,IAAI,KAAK,EAAE,CAAA;YACvB,GAAG,CAAC,GAAG,GAAG,GAAG,CAAA;YACb,GAAG,CAAC,MAAM,GAAG,GAAG,EAAE;gBAChB,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;gBACnB,OAAO,CAAC,IAAI,CAAC,CAAA;YACf,CAAC,CAAA;QACH,CAAC,CAAC,CAAA;IACJ,C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SAAS,CAAC,CAAC,CAAC,WAAW,IAAA,0BAAgB,EAAC,SAAS,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EACzF,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,GACZ,CACE;YACL,WAAW,IAAI,CACd,6BAAK,SAAS,EAAC,yBAAyB;gBACtC,oBAAC,6CAAqB,IAAC,aAAa,EAAE,OAAO;oBAC3C,oBAAC,wCAAe,OAAG;oBACnB,oBAAC,oBAAU,OAAG;oBACd,oBAAC,oCAAa,OAAG;oBACjB,oBAAC,oCAAa,IAAC,oBAAoB,EAAE,YAAY,GAAI;oBACrD,oBAAC,sCAAc,IACb,eAAe,EAAE,oBAAC,yBAAe,IAAC,SAAS,EAAC,4BAA4B,GAAG,EAC3E,aAAa,EAAE,2CAAoB,EACnC,WAAW,EAAE,oBAAC,qBAAW,IAAC,SAAS,EAAC,wBAAwB,yBAAiC,GAC7F;oBACD,wBAAwB,KAAK,IAAI,CAAC,CAAC,CAAC,oBAAC,wBAAc,OAAG,CAAC,CAAC,CAAC,IAAI,CACxC,CACpB,CACP,CACA,CACM,CACZ,CAAA;AACH,CAAC"}
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { LexicalEditor } from 'lexical';
|
|
3
|
+
/**
|
|
4
|
+
* Loads natural dimensions for a remote image URL.
|
|
5
|
+
* @param src Image source URL.
|
|
6
|
+
* @returns Natural width and height, or null when loading fails.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getImageDimensions(src: string): Promise<{
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
} | null>;
|
|
3
12
|
export default function UploadImage({ apiCdnUpload, editor }: {
|
|
4
13
|
apiCdnUpload: string;
|
|
5
14
|
editor: LexicalEditor;
|
package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/upload-image.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload-image.js","sourceRoot":"","sources":["../../../../../../../src/components/TextEditorV2/plugins/ToolbarPlugin/components/upload-image.tsx"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"upload-image.js","sourceRoot":"","sources":["../../../../../../../src/components/TextEditorV2/plugins/ToolbarPlugin/components/upload-image.tsx"],"names":[],"mappings":";;AAWA,gDAWC;AAsBD,8BAmFC;;AA/HD,uDAAuC;AACvC,6CAA4C;AAC5C,uDAAsD;AAEtD,qDAAyD;AAEzD;;;;GAIG;AACH,SAAgB,kBAAkB,CAAC,GAAW;IAC5C,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,MAAM,KAAK,GAAG,IAAI,KAAK,EAAE,CAAA;QACzB,KAAK,CAAC,MAAM,GAAG,GAAG,EAAE;YAClB,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,aAAa,EAAE,KAAK,EAAE,KAAK,CAAC,YAAY,EAAE,CAAC,CAAA;QACrE,CAAC,CAAA;QACD,KAAK,CAAC,OAAO,GAAG,GAAG,EAAE;YACnB,OAAO,CAAC,IAAI,CAAC,CAAA;QACf,CAAC,CAAA;QACD,KAAK,CAAC,GAAG,GAAG,GAAG,CAAA;IACjB,CAAC,CAAC,CAAA;AACJ,CAAC;AAED;;;;;;GAMG;AACH,SAAS,oBAAoB,CAAC,KAAa,EAAE,MAAc,EAAE,QAAgB;IAC3E,IAAI,KAAK,IAAI,QAAQ,EAAE,CAAC;QACtB,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAA;IAC1B,CAAC;IAED,MAAM,KAAK,GAAG,QAAQ,GAAG,KAAK,CAAA;IAE9B,OAAO;QACL,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC;QAClC,KAAK,EAAE,IAAI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
@@ -6,6 +6,7 @@ const react_1 = tslib_1.__importStar(require("react"));
|
|
|
6
6
|
const Modal_1 = require("../../../../Modal");
|
|
7
7
|
const FormUpload_1 = require("../../../../UploadFile/FormUpload");
|
|
8
8
|
const ImagesPlugin_1 = require("../../ImagesPlugin");
|
|
9
|
+
const upload_image_1 = require("./upload-image");
|
|
9
10
|
function UploadPdf({ apiCdnUpload, editor }) {
|
|
10
11
|
const [openPdfModal, setOpenPdfModal] = (0, react_1.useState)(false);
|
|
11
12
|
const [pdfFile, setPdfFile] = (0, react_1.useState)(null);
|
|
@@ -67,6 +68,7 @@ function UploadPdf({ apiCdnUpload, editor }) {
|
|
|
67
68
|
const uploadTasks = [];
|
|
68
69
|
for (let i = 1; i <= numPages; i++) {
|
|
69
70
|
uploadTasks.push(async () => {
|
|
71
|
+
var _a, _b;
|
|
70
72
|
const page = await pdfDoc.getPage(i);
|
|
71
73
|
const viewport = page.getViewport({ scale: 2 });
|
|
72
74
|
const canvas = document.createElement('canvas');
|
|
@@ -74,15 +76,25 @@ function UploadPdf({ apiCdnUpload, editor }) {
|
|
|
74
76
|
canvas.width = viewport.width;
|
|
75
77
|
canvas.height = viewport.height;
|
|
76
78
|
await page.render({ canvasContext: context, viewport }).promise;
|
|
77
|
-
const blob = await new Promise((resolve) => canvas.toBlob(
|
|
78
|
-
|
|
79
|
-
|
|
79
|
+
const blob = await new Promise((resolve) => canvas.toBlob(resolve, 'image/jpeg', 0.92));
|
|
80
|
+
if (!blob) {
|
|
81
|
+
return {
|
|
82
|
+
height: 0,
|
|
83
|
+
index: i,
|
|
84
|
+
src: null,
|
|
85
|
+
width: 0,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
const fileName = `${file.name.replace(/\.[^/.]+$/, '')}-page-${i}.jpg`;
|
|
89
|
+
const imageFile = new File([blob], fileName, { type: 'image/jpeg' });
|
|
80
90
|
const link = await uploadImage(imageFile);
|
|
81
|
-
const
|
|
91
|
+
const dimensions = link === null ? null : await (0, upload_image_1.getImageDimensions)(link);
|
|
92
|
+
const src = dimensions === null ? canvas.toDataURL('image/jpeg', 0.92) : link;
|
|
93
|
+
const scaled = scaleImageToMaxWidth((_a = dimensions === null || dimensions === void 0 ? void 0 : dimensions.width) !== null && _a !== void 0 ? _a : viewport.width, (_b = dimensions === null || dimensions === void 0 ? void 0 : dimensions.height) !== null && _b !== void 0 ? _b : viewport.height, editorWidth);
|
|
82
94
|
return {
|
|
83
95
|
height: scaled.height,
|
|
84
96
|
index: i,
|
|
85
|
-
|
|
97
|
+
src,
|
|
86
98
|
width: scaled.width,
|
|
87
99
|
};
|
|
88
100
|
});
|
|
@@ -95,15 +107,15 @@ function UploadPdf({ apiCdnUpload, editor }) {
|
|
|
95
107
|
const batchResults = await Promise.all(batch.map((fn) => fn()));
|
|
96
108
|
results.push(...batchResults);
|
|
97
109
|
}
|
|
98
|
-
const sorted = results.filter((r) => r.
|
|
110
|
+
const sorted = results.filter((r) => r.src).sort((a, b) => a.index - b.index);
|
|
99
111
|
for (const image of sorted) {
|
|
100
|
-
if (image.
|
|
112
|
+
if (image.src) {
|
|
101
113
|
editor.dispatchCommand(ImagesPlugin_1.INSERT_IMAGE_COMMAND, {
|
|
102
114
|
altText: 'photo',
|
|
103
115
|
height: image.height,
|
|
104
116
|
maxWidth: editorWidth,
|
|
105
117
|
showCaption: false,
|
|
106
|
-
src: image.
|
|
118
|
+
src: image.src,
|
|
107
119
|
width: image.width,
|
|
108
120
|
});
|
|
109
121
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload-pdf.js","sourceRoot":"","sources":["../../../../../../../src/components/TextEditorV2/plugins/ToolbarPlugin/components/upload-pdf.tsx"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"upload-pdf.js","sourceRoot":"","sources":["../../../../../../../src/components/TextEditorV2/plugins/ToolbarPlugin/components/upload-pdf.tsx"],"names":[],"mappings":";;AAaA,4BA2LC;;AAxMD,uDAAuC;AACvC,6CAA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ACX,uCAAK,SAAS,EAAC,2BAA2B;YACxC,0CACE,IAAI,EAAC,QAAQ,uBACK,MAAM,EACxB,SAAS,EAAC,+DAA+D,EACzE,OAAO,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC;gBAEpC;oBACE,uCAAK,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,4BAA4B;wBAC5F,wCACE,QAAQ,EAAC,SAAS,EAClB,QAAQ,EAAC,SAAS,EAClB,CAAC,EAAC,kgBAAkgB,EACpgB,IAAI,EAAC,SAAS,GACR;wBACR,wCACE,CAAC,EAAC,yYAAyY,EAC3Y,IAAI,EAAC,SAAS,GACR,CACJ,CACD,CACA,CACL,CACL,CACJ,CAAA;AACH,CAAC"}
|
|
@@ -1325,9 +1325,10 @@ function EditorStyle() {
|
|
|
1325
1325
|
}
|
|
1326
1326
|
|
|
1327
1327
|
.editor-image {
|
|
1328
|
-
display:
|
|
1328
|
+
display: flex;
|
|
1329
|
+
justify-content: center;
|
|
1329
1330
|
position: relative;
|
|
1330
|
-
width:
|
|
1331
|
+
width: 100%;
|
|
1331
1332
|
max-width: 100%;
|
|
1332
1333
|
margin-left: auto;
|
|
1333
1334
|
margin-right: auto;
|
|
@@ -1335,9 +1336,10 @@ function EditorStyle() {
|
|
|
1335
1336
|
|
|
1336
1337
|
.editor-image.position-left,
|
|
1337
1338
|
.inline-editor-image.position-left {
|
|
1338
|
-
display:
|
|
1339
|
+
display: flex;
|
|
1340
|
+
justify-content: flex-start;
|
|
1339
1341
|
position: relative;
|
|
1340
|
-
width:
|
|
1342
|
+
width: 100%;
|
|
1341
1343
|
max-width: 100%;
|
|
1342
1344
|
margin-left: 0;
|
|
1343
1345
|
margin-right: auto;
|
|
@@ -1345,9 +1347,10 @@ function EditorStyle() {
|
|
|
1345
1347
|
|
|
1346
1348
|
.editor-image.position-center,
|
|
1347
1349
|
.inline-editor-image.position-center {
|
|
1348
|
-
display:
|
|
1350
|
+
display: flex;
|
|
1351
|
+
justify-content: center;
|
|
1349
1352
|
position: relative;
|
|
1350
|
-
width:
|
|
1353
|
+
width: 100%;
|
|
1351
1354
|
max-width: 100%;
|
|
1352
1355
|
margin-left: auto;
|
|
1353
1356
|
margin-right: auto;
|
|
@@ -1355,9 +1358,10 @@ function EditorStyle() {
|
|
|
1355
1358
|
|
|
1356
1359
|
.editor-image.position-right,
|
|
1357
1360
|
.inline-editor-image.position-right {
|
|
1358
|
-
display:
|
|
1361
|
+
display: flex;
|
|
1362
|
+
justify-content: flex-end;
|
|
1359
1363
|
position: relative;
|
|
1360
|
-
width:
|
|
1364
|
+
width: 100%;
|
|
1361
1365
|
max-width: 100%;
|
|
1362
1366
|
margin-left: auto;
|
|
1363
1367
|
margin-right: 0;
|
|
@@ -1377,6 +1381,11 @@ function EditorStyle() {
|
|
|
1377
1381
|
margin-bottom: 10px;
|
|
1378
1382
|
}
|
|
1379
1383
|
|
|
1384
|
+
.inline-editor-image img {
|
|
1385
|
+
display: block;
|
|
1386
|
+
max-width: 100%;
|
|
1387
|
+
}
|
|
1388
|
+
|
|
1380
1389
|
.inline-editor-image.position-full {
|
|
1381
1390
|
display: block;
|
|
1382
1391
|
position: relative;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.js","sourceRoot":"","sources":["../../../../src/components/TextEditorV2/style.tsx"],"names":[],"mappings":";;AAEA,
|
|
1
|
+
{"version":3,"file":"style.js","sourceRoot":"","sources":["../../../../src/components/TextEditorV2/style.tsx"],"names":[],"mappings":";;AAEA,8BAssDC;;AAxsDD,0DAAyB;AAEzB,SAAwB,WAAW;IACjC,OAAO,CACL,6CACG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgsDN,CACW,CACT,CAAA;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const styleTag = "\n* {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n}\n.PlaygroundEditorTheme__ltr {\n text-align: left;\n}\n.PlaygroundEditorTheme__rtl {\n text-align: right;\n}\n\n[type='page-break'] {\n position: relative;\n display: block;\n width: calc(100% + var(--editor-input-padding, 28px) * 2);\n overflow: unset;\n margin-left: calc(var(--editor-input-padding, 28px) * -1);\n margin-top: var(--editor-input-padding, 28px);\n margin-bottom: var(--editor-input-padding, 28px);\n\n border: none;\n border-top: 1px dashed var(--editor-color-secondary, #eeeeee);\n border-bottom: 1px dashed var(--editor-color-secondary, #eeeeee);\n background-color: var(--editor-color-secondary, #eeeeee);\n}\n\n[type='page-break']::before {\n content: '';\n\n position: absolute;\n top: 50%;\n left: calc(var(--editor-input-padding, 28px) + 12px);\n transform: translateY(-50%);\n opacity: 0.5;\n\n background-size: cover;\n background-image: url(/icons/scissors.svg);\n width: 16px;\n height: 16px;\n}\n\n[type='page-break']::after {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n\n display: block;\n padding: 2px 6px;\n border: 1px solid #ccc;\n background-color: #fff;\n\n content: 'PAGE BREAK';\n font-size: 12px;\n color: #000;\n font-weight: 600;\n}\n\n.PlaygroundEditorTheme__quote {\n margin: 0;\n margin-left: 20px;\n font-size: 15px;\n color: rgb(101, 103, 107);\n border-left-color: rgb(206, 208, 212);\n border-left-width: 4px;\n border-left-style: solid;\n padding-left: 16px;\n}\n.PlaygroundEditorTheme__h1 {\n font-size: 34px;\n margin-bottom: 10px;\n}\n.PlaygroundEditorTheme__h2 {\n font-size: 29px;\n margin-bottom: 10px;\n}\n.PlaygroundEditorTheme__h3 {\n font-size: 24px;\n margin-bottom: 10px;\n}\n.PlaygroundEditorTheme__h4 {\n font-size: 21px;\n margin-bottom: 10px;\n}\n.PlaygroundEditorTheme__h5 {\n font-size: 18px;\n margin-bottom: 10px;\n}\n.PlaygroundEditorTheme__h6 {\n font-size: 16px;\n margin-bottom: 10px;\n}\n.PlaygroundEditorTheme__indent {\n --lexical-indent-base-value: 40px;\n}\n.PlaygroundEditorTheme__textBold {\n font-weight: bold;\n}\n.PlaygroundEditorTheme__textItalic {\n font-style: italic;\n}\n.PlaygroundEditorTheme__textUnderline {\n text-decoration: underline;\n}\n.PlaygroundEditorTheme__textStrikethrough {\n text-decoration: line-through;\n}\n.PlaygroundEditorTheme__textUnderlineStrikethrough {\n text-decoration: underline line-through;\n}\n.PlaygroundEditorTheme__textSubscript {\n font-size: 0.8em;\n vertical-align: sub !important;\n}\n.PlaygroundEditorTheme__textSuperscript {\n font-size: 0.8em;\n vertical-align: super;\n}\n.PlaygroundEditorTheme__textCode {\n background-color: rgb(240, 242, 245);\n padding: 1px 0.25rem;\n font-family: Menlo, Consolas, Monaco, monospace;\n font-size: 94%;\n}\n.PlaygroundEditorTheme__hashtag {\n background-color: rgba(88, 144, 255, 0.15);\n border-bottom: 1px solid rgba(88, 144, 255, 0.3);\n}\n.PlaygroundEditorTheme__link {\n color: rgb(33, 111, 219);\n text-decoration: none;\n}\n.PlaygroundEditorTheme__link:hover {\n text-decoration: underline;\n cursor: pointer;\n}\n.PlaygroundEditorTheme__code {\n background-color: rgb(240, 242, 245);\n font-family: Menlo, Consolas, Monaco, monospace;\n display: block;\n padding: 8px 8px 8px 52px;\n line-height: 1.53;\n font-size: 13px;\n margin: 0;\n margin-top: 8px;\n margin-bottom: 8px;\n overflow-x: auto;\n position: relative;\n tab-size: 2;\n}\n.PlaygroundEditorTheme__code:before {\n content: attr(data-gutter);\n position: absolute;\n background-color: #eee;\n left: 0;\n top: 0;\n border-right: 1px solid #ccc;\n padding: 8px;\n color: #777;\n white-space: pre-wrap;\n text-align: right;\n min-width: 25px;\n}\n.PlaygroundEditorTheme__table {\n border-collapse: collapse;\n border-spacing: 0;\n overflow-y: scroll;\n overflow-x: scroll;\n table-layout: fixed;\n width: max-content;\n margin: 30px 0;\n}\n.PlaygroundEditorTheme__tableSelection *::selection {\n background-color: transparent;\n}\n.PlaygroundEditorTheme__tableSelected {\n outline: 2px solid rgb(60, 132, 244);\n}\n.PlaygroundEditorTheme__tableCell {\n border: 1px solid #bbb;\n width: 75px;\n min-width: 75px;\n vertical-align: top;\n text-align: start;\n padding: 6px 8px;\n position: relative;\n outline: none;\n}\n.PlaygroundEditorTheme__tableCellSortedIndicator {\n display: block;\n opacity: 0.5;\n position: absolute;\n bottom: 0;\n left: 0;\n width: 100%;\n height: 4px;\n background-color: #999;\n}\n.PlaygroundEditorTheme__tableCellResizer {\n position: absolute;\n right: -4px;\n height: 100%;\n width: 8px;\n cursor: ew-resize;\n z-index: 10;\n top: 0;\n}\n.PlaygroundEditorTheme__tableCellHeader {\n background-color: #f2f3f5;\n text-align: start;\n}\n.PlaygroundEditorTheme__tableCellSelected {\n background-color: #c9dbf0;\n}\n.PlaygroundEditorTheme__tableCellPrimarySelected {\n border: 2px solid rgb(60, 132, 244);\n display: block;\n height: calc(100% - 2px);\n position: absolute;\n width: calc(100% - 2px);\n left: -1px;\n top: -1px;\n z-index: 2;\n}\n.PlaygroundEditorTheme__tableCellEditing {\n box-shadow: 0 0 5px rgba(0, 0, 0, 0.4);\n border-radius: 3px;\n}\n.PlaygroundEditorTheme__tableAddColumns {\n position: absolute;\n top: 0;\n width: 20px;\n background-color: #eee;\n height: 100%;\n right: -25px;\n animation: table-controls 0.2s ease;\n border: 0;\n cursor: pointer;\n}\n.PlaygroundEditorTheme__tableAddColumns:after {\n background-image: url('/icons/plus.svg');\n background-size: contain;\n background-position: center;\n background-repeat: no-repeat;\n display: block;\n content: ' ';\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n opacity: 0.4;\n}\n.PlaygroundEditorTheme__tableAddColumns:hover {\n background-color: #c9dbf0;\n}\n.PlaygroundEditorTheme__tableAddRows {\n position: absolute;\n bottom: -25px;\n width: calc(100% - 25px);\n background-color: #eee;\n height: 20px;\n left: 0;\n animation: table-controls 0.2s ease;\n border: 0;\n cursor: pointer;\n}\n.PlaygroundEditorTheme__tableAddRows:after {\n background-image: url(/icons/plus.svg);\n background-size: contain;\n background-position: center;\n background-repeat: no-repeat;\n display: block;\n content: ' ';\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n opacity: 0.4;\n}\n.PlaygroundEditorTheme__tableAddRows:hover {\n background-color: #c9dbf0;\n}\n@keyframes table-controls {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n.PlaygroundEditorTheme__tableCellResizeRuler {\n display: block;\n position: absolute;\n width: 1px;\n background-color: rgb(60, 132, 244);\n height: 100%;\n top: 0;\n}\n.PlaygroundEditorTheme__tableCellActionButtonContainer {\n display: block;\n right: 5px;\n top: 6px;\n position: absolute;\n z-index: 4;\n width: 20px;\n height: 20px;\n}\n.PlaygroundEditorTheme__tableCellActionButton {\n background-color: #eee;\n display: block;\n border: 0;\n border-radius: 20px;\n width: 20px;\n height: 20px;\n color: #222;\n cursor: pointer;\n}\n.PlaygroundEditorTheme__tableCellActionButton:hover {\n background-color: #ddd;\n}\n.PlaygroundEditorTheme__characterLimit {\n display: inline;\n background-color: #ffbbbb !important;\n}\n.PlaygroundEditorTheme__ol1 {\n padding: 0;\n margin: 0;\n list-style-position: inside;\n list-style-type: decimal;\n margin-left: 20px;\n}\n.PlaygroundEditorTheme__ol2 {\n padding: 0;\n margin: 0;\n list-style-type: upper-alpha;\n list-style-position: inside;\n margin-left: 20px;\n}\n.PlaygroundEditorTheme__ol3 {\n padding: 0;\n margin: 0;\n list-style-type: lower-alpha;\n list-style-position: inside;\n margin-left: 20px;\n}\n.PlaygroundEditorTheme__ol4 {\n padding: 0;\n margin: 0;\n list-style-type: upper-roman;\n list-style-position: inside;\n margin-left: 20px;\n}\n.PlaygroundEditorTheme__ol5 {\n padding: 0;\n margin: 0;\n list-style-type: lower-roman;\n list-style-position: inside;\n margin-left: 20px;\n}\n.PlaygroundEditorTheme__ul {\n padding: 0;\n margin: 0;\n list-style: disc;\n margin-left: 20px;\n list-style-position: inside;\n}\n\n.PlaygroundEditorTheme__listItem {\n font-family: var(--listitem-marker-font-family);\n font-size: var(--listitem-marker-font-size);\n background-color: var(--listitem-marker-background-color);\n}\n\n.PlaygroundEditorTheme__listItem::marker {\n color: var(--listitem-marker-color);\n background-color: var(--listitem-marker-background-color);\n font-family: var(--listitem-marker-font-family);\n font-size: var(--listitem-marker-font-size);\n font-style: var(--listitem-marker-font-style);\n font-weight: var(--listitem-marker-font-weight);\n}\n\n.PlaygroundEditorTheme__listItemChecked,\n.PlaygroundEditorTheme__listItemUnchecked {\n position: relative;\n margin-left: 8px;\n margin-right: 8px;\n padding-left: 24px;\n padding-right: 24px;\n list-style-type: none;\n outline: none;\n}\n.PlaygroundEditorTheme__listItemChecked {\n text-decoration: line-through;\n}\n.PlaygroundEditorTheme__listItemUnchecked:before,\n.PlaygroundEditorTheme__listItemChecked:before {\n content: '';\n width: 16px;\n height: 16px;\n top: 2px;\n left: 0;\n cursor: pointer;\n display: block;\n background-size: cover;\n position: absolute;\n}\n.PlaygroundEditorTheme__listItemUnchecked[dir='rtl']:before,\n.PlaygroundEditorTheme__listItemChecked[dir='rtl']:before {\n left: auto;\n right: 0;\n}\n.PlaygroundEditorTheme__listItemUnchecked:focus:before,\n.PlaygroundEditorTheme__listItemChecked:focus:before {\n box-shadow: 0 0 0 2px #a6cdfe;\n border-radius: 2px;\n}\n.PlaygroundEditorTheme__listItemUnchecked:before {\n border: 1px solid #999;\n border-radius: 2px;\n}\n.PlaygroundEditorTheme__listItemChecked:before {\n border: 1px solid rgb(61, 135, 245);\n border-radius: 2px;\n background-color: #3d87f5;\n background-repeat: no-repeat;\n}\n.PlaygroundEditorTheme__listItemChecked:after {\n content: '';\n cursor: pointer;\n border-color: #fff;\n border-style: solid;\n position: absolute;\n display: block;\n top: 6px;\n width: 3px;\n left: 7px;\n right: 7px;\n height: 6px;\n transform: rotate(45deg);\n border-width: 0 2px 2px 0;\n}\n.PlaygroundEditorTheme__nestedListItem {\n list-style-type: none;\n}\n.PlaygroundEditorTheme__nestedListItem:before,\n.PlaygroundEditorTheme__nestedListItem:after {\n display: none;\n}\n.PlaygroundEditorTheme__tokenComment {\n color: slategray;\n}\n.PlaygroundEditorTheme__tokenPunctuation {\n color: #999;\n}\n.PlaygroundEditorTheme__tokenProperty {\n color: #905;\n}\n.PlaygroundEditorTheme__tokenSelector {\n color: #690;\n}\n.PlaygroundEditorTheme__tokenOperator {\n color: #9a6e3a;\n}\n.PlaygroundEditorTheme__tokenAttr {\n color: #07a;\n}\n.PlaygroundEditorTheme__tokenVariable {\n color: #e90;\n}\n.PlaygroundEditorTheme__tokenFunction {\n color: #dd4a68;\n}\n.PlaygroundEditorTheme__mark {\n background: rgba(255, 212, 0, 0.14);\n border-bottom: 2px solid rgba(255, 212, 0, 0.3);\n padding-bottom: 2px;\n}\n.PlaygroundEditorTheme__markOverlap {\n background: rgba(255, 212, 0, 0.3);\n border-bottom: 2px solid rgba(255, 212, 0, 0.7);\n}\n.PlaygroundEditorTheme__mark.selected {\n background: rgba(255, 212, 0, 0.5);\n border-bottom: 2px solid rgba(255, 212, 0, 1);\n}\n.PlaygroundEditorTheme__markOverlap.selected {\n background: rgba(255, 212, 0, 0.7);\n border-bottom: 2px solid rgba(255, 212, 0, 0.7);\n}\n.PlaygroundEditorTheme__embedBlock {\n user-select: none;\n}\n.PlaygroundEditorTheme__embedBlockFocus {\n outline: 2px solid rgb(60, 132, 244);\n}\n.PlaygroundEditorTheme__layoutContaner {\n display: grid;\n gap: 10px;\n margin: 10px 0;\n}\n.PlaygroundEditorTheme__layoutItem {\n border: 1px dashed #ddd;\n padding: 8px 16px;\n}\n\n.image-resizer-wrapper {\n position: absolute;\n inset: 0;\n pointer-events: none;\n z-index: 1;\n}\n\n.image-resizer {\n position: absolute;\n pointer-events: auto;\n background-color: #fff;\n border: 1px solid rgb(60, 132, 244);\n border-radius: 50%;\n box-sizing: border-box;\n width: 10px;\n height: 10px;\n}\n\n.image-resizer-n,\n.image-resizer-s {\n left: 50%;\n transform: translateX(-50%);\n cursor: ns-resize;\n}\n\n.image-resizer-e,\n.image-resizer-w {\n top: 50%;\n transform: translateY(-50%);\n cursor: ew-resize;\n}\n\n.image-resizer-n {\n top: -5px;\n}\n\n.image-resizer-ne {\n top: -5px;\n right: -5px;\n cursor: nesw-resize;\n}\n\n.image-resizer-e {\n right: -5px;\n}\n\n.image-resizer-se {\n right: -5px;\n bottom: -5px;\n cursor: nwse-resize;\n}\n\n.image-resizer-s {\n bottom: -5px;\n}\n\n.image-resizer-sw {\n bottom: -5px;\n left: -5px;\n cursor: nesw-resize;\n}\n\n.image-resizer-w {\n left: -5px;\n}\n\n.image-resizer-nw {\n top: -5px;\n left: -5px;\n cursor: nwse-resize;\n}\n\n.editor-image {\n display: block;\n position: relative;\n width: fit-content;\n max-width: 100%;\n margin-left: auto;\n margin-right: auto;\n}\n\n.editor-image.position-left,\n.inline-editor-image.position-left {\n display: block;\n position: relative;\n width: fit-content;\n max-width: 100%;\n margin-left: 0;\n margin-right: auto;\n}\n\n.editor-image.position-center,\n.inline-editor-image.position-center {\n display: block;\n position: relative;\n width: fit-content;\n max-width: 100%;\n margin-left: auto;\n margin-right: auto;\n}\n\n.editor-image.position-right,\n.inline-editor-image.position-right {\n display: block;\n position: relative;\n width: fit-content;\n max-width: 100%;\n margin-left: auto;\n margin-right: 0;\n}\n\n.editor-image > div,\n.inline-editor-image > div {\n position: relative;\n}\n\n.editor-image img {\n display: block;\n margin-left: auto;\n margin-right: auto;\n max-width: 90% !important;\n border: 1px solid #e5e7eb;\n margin-bottom: 10px;\n}\n\n.inline-editor-image.position-full {\n display: block;\n position: relative;\n width: 100%;\n max-width: 100%;\n}\n\n.inline-editor-image.position-full img {\n width: 100%;\n max-width: 100%;\n}\n\n.inline-editor-image.position-center img {\n max-width: 100%;\n}\n\n.editor-image img.focused,\n.inline-editor-image img.focused {\n outline: 2px solid rgb(60, 132, 244);\n outline-offset: 2px;\n}\n";
|
|
1
|
+
export declare const styleTag = "\n* {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n}\n.PlaygroundEditorTheme__ltr {\n text-align: left;\n}\n.PlaygroundEditorTheme__rtl {\n text-align: right;\n}\n.PlaygroundEditorTheme__paragraph,\n.PlaygroundEditorTheme__listItem {\n font-size: 14px;\n line-height: normal;\n}\n\n[type='page-break'] {\n position: relative;\n display: block;\n width: calc(100% + var(--editor-input-padding, 28px) * 2);\n overflow: unset;\n margin-left: calc(var(--editor-input-padding, 28px) * -1);\n margin-top: var(--editor-input-padding, 28px);\n margin-bottom: var(--editor-input-padding, 28px);\n\n border: none;\n border-top: 1px dashed var(--editor-color-secondary, #eeeeee);\n border-bottom: 1px dashed var(--editor-color-secondary, #eeeeee);\n background-color: var(--editor-color-secondary, #eeeeee);\n}\n\n[type='page-break']::before {\n content: '';\n\n position: absolute;\n top: 50%;\n left: calc(var(--editor-input-padding, 28px) + 12px);\n transform: translateY(-50%);\n opacity: 0.5;\n\n background-size: cover;\n background-image: url(/icons/scissors.svg);\n width: 16px;\n height: 16px;\n}\n\n[type='page-break']::after {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n\n display: block;\n padding: 2px 6px;\n border: 1px solid #ccc;\n background-color: #fff;\n\n content: 'PAGE BREAK';\n font-size: 12px;\n color: #000;\n font-weight: 600;\n}\n\n.PlaygroundEditorTheme__quote {\n margin: 0;\n margin-left: 20px;\n font-size: 15px;\n color: rgb(101, 103, 107);\n border-left-color: rgb(206, 208, 212);\n border-left-width: 4px;\n border-left-style: solid;\n padding-left: 16px;\n}\n.PlaygroundEditorTheme__h1 {\n font-size: 34px;\n margin-bottom: 10px;\n}\n.PlaygroundEditorTheme__h2 {\n font-size: 29px;\n margin-bottom: 10px;\n}\n.PlaygroundEditorTheme__h3 {\n font-size: 24px;\n margin-bottom: 10px;\n}\n.PlaygroundEditorTheme__h4 {\n font-size: 21px;\n margin-bottom: 10px;\n}\n.PlaygroundEditorTheme__h5 {\n font-size: 18px;\n margin-bottom: 10px;\n}\n.PlaygroundEditorTheme__h6 {\n font-size: 16px;\n margin-bottom: 10px;\n}\n.PlaygroundEditorTheme__indent {\n --lexical-indent-base-value: 40px;\n}\n.PlaygroundEditorTheme__textBold {\n font-weight: bold;\n}\n.PlaygroundEditorTheme__textItalic {\n font-style: italic;\n}\n.PlaygroundEditorTheme__textUnderline {\n text-decoration: underline;\n}\n.PlaygroundEditorTheme__textStrikethrough {\n text-decoration: line-through;\n}\n.PlaygroundEditorTheme__textUnderlineStrikethrough {\n text-decoration: underline line-through;\n}\n.PlaygroundEditorTheme__textSubscript {\n font-size: 0.8em;\n vertical-align: sub !important;\n}\n.PlaygroundEditorTheme__textSuperscript {\n font-size: 0.8em;\n vertical-align: super;\n}\n.PlaygroundEditorTheme__textCode {\n background-color: rgb(240, 242, 245);\n padding: 1px 0.25rem;\n font-family: Menlo, Consolas, Monaco, monospace;\n font-size: 94%;\n}\n.PlaygroundEditorTheme__hashtag {\n background-color: rgba(88, 144, 255, 0.15);\n border-bottom: 1px solid rgba(88, 144, 255, 0.3);\n}\n.PlaygroundEditorTheme__link {\n color: rgb(33, 111, 219);\n text-decoration: none;\n}\n.PlaygroundEditorTheme__link:hover {\n text-decoration: underline;\n cursor: pointer;\n}\n.PlaygroundEditorTheme__code {\n background-color: rgb(240, 242, 245);\n font-family: Menlo, Consolas, Monaco, monospace;\n display: block;\n padding: 8px 8px 8px 52px;\n line-height: 1.53;\n font-size: 13px;\n margin: 0;\n margin-top: 8px;\n margin-bottom: 8px;\n overflow-x: auto;\n position: relative;\n tab-size: 2;\n}\n.PlaygroundEditorTheme__code:before {\n content: attr(data-gutter);\n position: absolute;\n background-color: #eee;\n left: 0;\n top: 0;\n border-right: 1px solid #ccc;\n padding: 8px;\n color: #777;\n white-space: pre-wrap;\n text-align: right;\n min-width: 25px;\n}\n.PlaygroundEditorTheme__table {\n border-collapse: collapse;\n border-spacing: 0;\n overflow-y: scroll;\n overflow-x: scroll;\n table-layout: fixed;\n width: max-content;\n margin: 30px 0;\n}\n.PlaygroundEditorTheme__tableSelection *::selection {\n background-color: transparent;\n}\n.PlaygroundEditorTheme__tableSelected {\n outline: 2px solid rgb(60, 132, 244);\n}\n.PlaygroundEditorTheme__tableCell {\n border: 1px solid #bbb;\n width: 75px;\n min-width: 75px;\n vertical-align: top;\n text-align: start;\n padding: 6px 8px;\n position: relative;\n outline: none;\n}\n.PlaygroundEditorTheme__tableCellSortedIndicator {\n display: block;\n opacity: 0.5;\n position: absolute;\n bottom: 0;\n left: 0;\n width: 100%;\n height: 4px;\n background-color: #999;\n}\n.PlaygroundEditorTheme__tableCellResizer {\n position: absolute;\n right: -4px;\n height: 100%;\n width: 8px;\n cursor: ew-resize;\n z-index: 10;\n top: 0;\n}\n.PlaygroundEditorTheme__tableCellHeader {\n background-color: #f2f3f5;\n text-align: start;\n}\n.PlaygroundEditorTheme__tableCellSelected {\n background-color: #c9dbf0;\n}\n.PlaygroundEditorTheme__tableCellPrimarySelected {\n border: 2px solid rgb(60, 132, 244);\n display: block;\n height: calc(100% - 2px);\n position: absolute;\n width: calc(100% - 2px);\n left: -1px;\n top: -1px;\n z-index: 2;\n}\n.PlaygroundEditorTheme__tableCellEditing {\n box-shadow: 0 0 5px rgba(0, 0, 0, 0.4);\n border-radius: 3px;\n}\n.PlaygroundEditorTheme__tableAddColumns {\n position: absolute;\n top: 0;\n width: 20px;\n background-color: #eee;\n height: 100%;\n right: -25px;\n animation: table-controls 0.2s ease;\n border: 0;\n cursor: pointer;\n}\n.PlaygroundEditorTheme__tableAddColumns:after {\n background-image: url('/icons/plus.svg');\n background-size: contain;\n background-position: center;\n background-repeat: no-repeat;\n display: block;\n content: ' ';\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n opacity: 0.4;\n}\n.PlaygroundEditorTheme__tableAddColumns:hover {\n background-color: #c9dbf0;\n}\n.PlaygroundEditorTheme__tableAddRows {\n position: absolute;\n bottom: -25px;\n width: calc(100% - 25px);\n background-color: #eee;\n height: 20px;\n left: 0;\n animation: table-controls 0.2s ease;\n border: 0;\n cursor: pointer;\n}\n.PlaygroundEditorTheme__tableAddRows:after {\n background-image: url(/icons/plus.svg);\n background-size: contain;\n background-position: center;\n background-repeat: no-repeat;\n display: block;\n content: ' ';\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n opacity: 0.4;\n}\n.PlaygroundEditorTheme__tableAddRows:hover {\n background-color: #c9dbf0;\n}\n@keyframes table-controls {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n.PlaygroundEditorTheme__tableCellResizeRuler {\n display: block;\n position: absolute;\n width: 1px;\n background-color: rgb(60, 132, 244);\n height: 100%;\n top: 0;\n}\n.PlaygroundEditorTheme__tableCellActionButtonContainer {\n display: block;\n right: 5px;\n top: 6px;\n position: absolute;\n z-index: 4;\n width: 20px;\n height: 20px;\n}\n.PlaygroundEditorTheme__tableCellActionButton {\n background-color: #eee;\n display: block;\n border: 0;\n border-radius: 20px;\n width: 20px;\n height: 20px;\n color: #222;\n cursor: pointer;\n}\n.PlaygroundEditorTheme__tableCellActionButton:hover {\n background-color: #ddd;\n}\n.PlaygroundEditorTheme__characterLimit {\n display: inline;\n background-color: #ffbbbb !important;\n}\n.PlaygroundEditorTheme__ol1 {\n padding: 0;\n margin: 0;\n list-style-position: inside;\n list-style-type: decimal;\n margin-left: 20px;\n}\n.PlaygroundEditorTheme__ol2 {\n padding: 0;\n margin: 0;\n list-style-type: upper-alpha;\n list-style-position: inside;\n margin-left: 20px;\n}\n.PlaygroundEditorTheme__ol3 {\n padding: 0;\n margin: 0;\n list-style-type: lower-alpha;\n list-style-position: inside;\n margin-left: 20px;\n}\n.PlaygroundEditorTheme__ol4 {\n padding: 0;\n margin: 0;\n list-style-type: upper-roman;\n list-style-position: inside;\n margin-left: 20px;\n}\n.PlaygroundEditorTheme__ol5 {\n padding: 0;\n margin: 0;\n list-style-type: lower-roman;\n list-style-position: inside;\n margin-left: 20px;\n}\n.PlaygroundEditorTheme__ul {\n padding: 0;\n margin: 0;\n list-style: disc;\n margin-left: 20px;\n list-style-position: inside;\n}\n\n.PlaygroundEditorTheme__listItem {\n font-family: var(--listitem-marker-font-family);\n font-size: var(--listitem-marker-font-size, 14px);\n background-color: var(--listitem-marker-background-color);\n}\n\n.PlaygroundEditorTheme__listItem::marker {\n color: var(--listitem-marker-color);\n background-color: var(--listitem-marker-background-color);\n font-family: var(--listitem-marker-font-family);\n font-size: var(--listitem-marker-font-size);\n font-style: var(--listitem-marker-font-style);\n font-weight: var(--listitem-marker-font-weight);\n}\n\n.PlaygroundEditorTheme__listItemChecked,\n.PlaygroundEditorTheme__listItemUnchecked {\n position: relative;\n margin-left: 8px;\n margin-right: 8px;\n padding-left: 24px;\n padding-right: 24px;\n list-style-type: none;\n outline: none;\n}\n.PlaygroundEditorTheme__listItemChecked {\n text-decoration: line-through;\n}\n.PlaygroundEditorTheme__listItemUnchecked:before,\n.PlaygroundEditorTheme__listItemChecked:before {\n content: '';\n width: 16px;\n height: 16px;\n top: 2px;\n left: 0;\n cursor: pointer;\n display: block;\n background-size: cover;\n position: absolute;\n}\n.PlaygroundEditorTheme__listItemUnchecked[dir='rtl']:before,\n.PlaygroundEditorTheme__listItemChecked[dir='rtl']:before {\n left: auto;\n right: 0;\n}\n.PlaygroundEditorTheme__listItemUnchecked:focus:before,\n.PlaygroundEditorTheme__listItemChecked:focus:before {\n box-shadow: 0 0 0 2px #a6cdfe;\n border-radius: 2px;\n}\n.PlaygroundEditorTheme__listItemUnchecked:before {\n border: 1px solid #999;\n border-radius: 2px;\n}\n.PlaygroundEditorTheme__listItemChecked:before {\n border: 1px solid rgb(61, 135, 245);\n border-radius: 2px;\n background-color: #3d87f5;\n background-repeat: no-repeat;\n}\n.PlaygroundEditorTheme__listItemChecked:after {\n content: '';\n cursor: pointer;\n border-color: #fff;\n border-style: solid;\n position: absolute;\n display: block;\n top: 6px;\n width: 3px;\n left: 7px;\n right: 7px;\n height: 6px;\n transform: rotate(45deg);\n border-width: 0 2px 2px 0;\n}\n.PlaygroundEditorTheme__nestedListItem {\n list-style-type: none;\n}\n.PlaygroundEditorTheme__nestedListItem:before,\n.PlaygroundEditorTheme__nestedListItem:after {\n display: none;\n}\n.PlaygroundEditorTheme__tokenComment {\n color: slategray;\n}\n.PlaygroundEditorTheme__tokenPunctuation {\n color: #999;\n}\n.PlaygroundEditorTheme__tokenProperty {\n color: #905;\n}\n.PlaygroundEditorTheme__tokenSelector {\n color: #690;\n}\n.PlaygroundEditorTheme__tokenOperator {\n color: #9a6e3a;\n}\n.PlaygroundEditorTheme__tokenAttr {\n color: #07a;\n}\n.PlaygroundEditorTheme__tokenVariable {\n color: #e90;\n}\n.PlaygroundEditorTheme__tokenFunction {\n color: #dd4a68;\n}\n.PlaygroundEditorTheme__mark {\n background: rgba(255, 212, 0, 0.14);\n border-bottom: 2px solid rgba(255, 212, 0, 0.3);\n padding-bottom: 2px;\n}\n.PlaygroundEditorTheme__markOverlap {\n background: rgba(255, 212, 0, 0.3);\n border-bottom: 2px solid rgba(255, 212, 0, 0.7);\n}\n.PlaygroundEditorTheme__mark.selected {\n background: rgba(255, 212, 0, 0.5);\n border-bottom: 2px solid rgba(255, 212, 0, 1);\n}\n.PlaygroundEditorTheme__markOverlap.selected {\n background: rgba(255, 212, 0, 0.7);\n border-bottom: 2px solid rgba(255, 212, 0, 0.7);\n}\n.PlaygroundEditorTheme__embedBlock {\n user-select: none;\n}\n.PlaygroundEditorTheme__embedBlockFocus {\n outline: 2px solid rgb(60, 132, 244);\n}\n.PlaygroundEditorTheme__layoutContaner {\n display: grid;\n gap: 10px;\n margin: 10px 0;\n}\n.PlaygroundEditorTheme__layoutItem {\n border: 1px dashed #ddd;\n padding: 8px 16px;\n}\n\n.image-resizer-wrapper {\n position: absolute;\n inset: 0;\n pointer-events: none;\n z-index: 1;\n}\n\n.image-resizer {\n position: absolute;\n pointer-events: auto;\n background-color: #fff;\n border: 1px solid rgb(60, 132, 244);\n border-radius: 50%;\n box-sizing: border-box;\n width: 10px;\n height: 10px;\n}\n\n.image-resizer-n,\n.image-resizer-s {\n left: 50%;\n transform: translateX(-50%);\n cursor: ns-resize;\n}\n\n.image-resizer-e,\n.image-resizer-w {\n top: 50%;\n transform: translateY(-50%);\n cursor: ew-resize;\n}\n\n.image-resizer-n {\n top: -5px;\n}\n\n.image-resizer-ne {\n top: -5px;\n right: -5px;\n cursor: nesw-resize;\n}\n\n.image-resizer-e {\n right: -5px;\n}\n\n.image-resizer-se {\n right: -5px;\n bottom: -5px;\n cursor: nwse-resize;\n}\n\n.image-resizer-s {\n bottom: -5px;\n}\n\n.image-resizer-sw {\n bottom: -5px;\n left: -5px;\n cursor: nesw-resize;\n}\n\n.image-resizer-w {\n left: -5px;\n}\n\n.image-resizer-nw {\n top: -5px;\n left: -5px;\n cursor: nwse-resize;\n}\n\n.editor-image {\n display: flex;\n justify-content: center;\n position: relative;\n width: 100%;\n max-width: 100%;\n margin-left: auto;\n margin-right: auto;\n}\n\n.editor-image.position-left,\n.inline-editor-image.position-left {\n display: flex;\n justify-content: flex-start;\n position: relative;\n width: 100%;\n max-width: 100%;\n margin-left: 0;\n margin-right: auto;\n}\n\n.editor-image.position-center,\n.inline-editor-image.position-center {\n display: flex;\n justify-content: center;\n position: relative;\n width: 100%;\n max-width: 100%;\n margin-left: auto;\n margin-right: auto;\n}\n\n.editor-image.position-right,\n.inline-editor-image.position-right {\n display: flex;\n justify-content: flex-end;\n position: relative;\n width: 100%;\n max-width: 100%;\n margin-left: auto;\n margin-right: 0;\n}\n\n.editor-image > div,\n.inline-editor-image > div {\n position: relative;\n}\n\n.editor-image img {\n display: block;\n margin-left: auto;\n margin-right: auto;\n max-width: 90% !important;\n border: 1px solid #e5e7eb;\n margin-bottom: 10px;\n}\n\n.inline-editor-image img {\n display: block;\n max-width: 100%;\n}\n\n.inline-editor-image.position-full {\n display: block;\n position: relative;\n width: 100%;\n max-width: 100%;\n}\n\n.inline-editor-image.position-full img {\n width: 100%;\n max-width: 100%;\n}\n\n.inline-editor-image.position-center img {\n max-width: 100%;\n}\n\n.editor-image img.focused,\n.inline-editor-image img.focused {\n outline: 2px solid rgb(60, 132, 244);\n outline-offset: 2px;\n}\n";
|
|
@@ -10,6 +10,11 @@ export const styleTag = `
|
|
|
10
10
|
.PlaygroundEditorTheme__rtl {
|
|
11
11
|
text-align: right;
|
|
12
12
|
}
|
|
13
|
+
.PlaygroundEditorTheme__paragraph,
|
|
14
|
+
.PlaygroundEditorTheme__listItem {
|
|
15
|
+
font-size: 14px;
|
|
16
|
+
line-height: normal;
|
|
17
|
+
}
|
|
13
18
|
|
|
14
19
|
[type='page-break'] {
|
|
15
20
|
position: relative;
|
|
@@ -371,7 +376,7 @@ export const styleTag = `
|
|
|
371
376
|
|
|
372
377
|
.PlaygroundEditorTheme__listItem {
|
|
373
378
|
font-family: var(--listitem-marker-font-family);
|
|
374
|
-
font-size: var(--listitem-marker-font-size);
|
|
379
|
+
font-size: var(--listitem-marker-font-size, 14px);
|
|
375
380
|
background-color: var(--listitem-marker-background-color);
|
|
376
381
|
}
|
|
377
382
|
|
|
@@ -581,9 +586,10 @@ export const styleTag = `
|
|
|
581
586
|
}
|
|
582
587
|
|
|
583
588
|
.editor-image {
|
|
584
|
-
display:
|
|
589
|
+
display: flex;
|
|
590
|
+
justify-content: center;
|
|
585
591
|
position: relative;
|
|
586
|
-
width:
|
|
592
|
+
width: 100%;
|
|
587
593
|
max-width: 100%;
|
|
588
594
|
margin-left: auto;
|
|
589
595
|
margin-right: auto;
|
|
@@ -591,9 +597,10 @@ export const styleTag = `
|
|
|
591
597
|
|
|
592
598
|
.editor-image.position-left,
|
|
593
599
|
.inline-editor-image.position-left {
|
|
594
|
-
display:
|
|
600
|
+
display: flex;
|
|
601
|
+
justify-content: flex-start;
|
|
595
602
|
position: relative;
|
|
596
|
-
width:
|
|
603
|
+
width: 100%;
|
|
597
604
|
max-width: 100%;
|
|
598
605
|
margin-left: 0;
|
|
599
606
|
margin-right: auto;
|
|
@@ -601,9 +608,10 @@ export const styleTag = `
|
|
|
601
608
|
|
|
602
609
|
.editor-image.position-center,
|
|
603
610
|
.inline-editor-image.position-center {
|
|
604
|
-
display:
|
|
611
|
+
display: flex;
|
|
612
|
+
justify-content: center;
|
|
605
613
|
position: relative;
|
|
606
|
-
width:
|
|
614
|
+
width: 100%;
|
|
607
615
|
max-width: 100%;
|
|
608
616
|
margin-left: auto;
|
|
609
617
|
margin-right: auto;
|
|
@@ -611,9 +619,10 @@ export const styleTag = `
|
|
|
611
619
|
|
|
612
620
|
.editor-image.position-right,
|
|
613
621
|
.inline-editor-image.position-right {
|
|
614
|
-
display:
|
|
622
|
+
display: flex;
|
|
623
|
+
justify-content: flex-end;
|
|
615
624
|
position: relative;
|
|
616
|
-
width:
|
|
625
|
+
width: 100%;
|
|
617
626
|
max-width: 100%;
|
|
618
627
|
margin-left: auto;
|
|
619
628
|
margin-right: 0;
|
|
@@ -633,6 +642,11 @@ export const styleTag = `
|
|
|
633
642
|
margin-bottom: 10px;
|
|
634
643
|
}
|
|
635
644
|
|
|
645
|
+
.inline-editor-image img {
|
|
646
|
+
display: block;
|
|
647
|
+
max-width: 100%;
|
|
648
|
+
}
|
|
649
|
+
|
|
636
650
|
.inline-editor-image.position-full {
|
|
637
651
|
display: block;
|
|
638
652
|
position: relative;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/components/TextEditorV2/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/components/TextEditorV2/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8pBvB,CAAA"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { AutoFocusPlugin } from '@lexical/react/LexicalAutoFocusPlugin';
|
|
2
|
-
import { useCollaborationContext } from '@lexical/react/LexicalCollaborationContext';
|
|
3
|
-
import { CollaborationPlugin } from '@lexical/react/LexicalCollaborationPlugin';
|
|
4
2
|
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
|
5
3
|
import { HashtagPlugin } from '@lexical/react/LexicalHashtagPlugin';
|
|
6
4
|
import { HistoryPlugin } from '@lexical/react/LexicalHistoryPlugin';
|
|
@@ -13,7 +11,6 @@ import * as React from 'react';
|
|
|
13
11
|
import { Suspense, useCallback, useEffect, useRef, useState } from 'react';
|
|
14
12
|
import { useSettings } from '../context/SettingsContext';
|
|
15
13
|
import { useSharedHistoryContext } from '../context/SharedHistoryContext';
|
|
16
|
-
import { createWebsocketProvider } from '../lib/collaboration';
|
|
17
14
|
import LinkPlugin from '../plugins/LinkPlugin';
|
|
18
15
|
import TreeViewPlugin from '../plugins/TreeViewPlugin';
|
|
19
16
|
import ContentEditable from '../ui/ContentEditable';
|
|
@@ -47,7 +44,6 @@ export default function ImageComponent({ altText, caption, height, maxWidth, nod
|
|
|
47
44
|
const buttonRef = useRef(null);
|
|
48
45
|
const [isSelected, setSelected, clearSelection] = useLexicalNodeSelection(nodeKey);
|
|
49
46
|
const [isResizing] = useState(false);
|
|
50
|
-
const { isCollabActive } = useCollaborationContext();
|
|
51
47
|
const [editor] = useLexicalComposerContext();
|
|
52
48
|
const [selection, setSelection] = useState(null);
|
|
53
49
|
const activeEditorRef = useRef(null);
|
|
@@ -174,7 +170,7 @@ export default function ImageComponent({ altText, caption, height, maxWidth, nod
|
|
|
174
170
|
React.createElement(AutoFocusPlugin, null),
|
|
175
171
|
React.createElement(LinkPlugin, null),
|
|
176
172
|
React.createElement(HashtagPlugin, null),
|
|
177
|
-
|
|
173
|
+
React.createElement(HistoryPlugin, { externalHistoryState: historyState }),
|
|
178
174
|
React.createElement(RichTextPlugin, { contentEditable: React.createElement(ContentEditable, { className: 'ImageNode__contentEditable' }), ErrorBoundary: LexicalErrorBoundary, placeholder: React.createElement(Placeholder, { className: 'ImageNode__placeholder' }, "Enter a caption...") }),
|
|
179
175
|
showNestedEditorTreeView === true ? React.createElement(TreeViewPlugin, null) : null))))));
|
|
180
176
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageComponent.js","sourceRoot":"","sources":["../../../../../src/components/TextEditorV2/nodes/ImageComponent.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAA;AACvE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ImageComponent.js","sourceRoot":"","sources":["../../../../../src/components/TextEditorV2/nodes/ImageComponent.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAA;AACvE,OAAO,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAA;AACjF,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAA;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAA;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAA;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAA;AACrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAA;AAChF,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EACL,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EAC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AQ,EAClB,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,GACZ,CACE;YACL,WAAW,IAAI,CACd,6BAAK,SAAS,EAAC,yBAAyB;gBACtC,oBAAC,qBAAqB,IAAC,aAAa,EAAE,OAAO;oBAC3C,oBAAC,eAAe,OAAG;oBACnB,oBAAC,UAAU,OAAG;oBACd,oBAAC,aAAa,OAAG;oBACjB,oBAAC,aAAa,IAAC,oBAAoB,EAAE,YAAY,GAAI;oBACrD,oBAAC,cAAc,IACb,eAAe,EAAE,oBAAC,eAAe,IAAC,SAAS,EAAC,4BAA4B,GAAG,EAC3E,aAAa,EAAE,oBAAoB,EACnC,WAAW,EAAE,oBAAC,WAAW,IAAC,SAAS,EAAC,wBAAwB,yBAAiC,GAC7F;oBACD,wBAAwB,KAAK,IAAI,CAAC,CAAC,CAAC,oBAAC,cAAc,OAAG,CAAC,CAAC,CAAC,IAAI,CACxC,CACpB,CACP,CACA,CACM,CACZ,CAAA;AACH,CAAC"}
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { LexicalEditor } from 'lexical';
|
|
3
|
+
/**
|
|
4
|
+
* Loads natural dimensions for a remote image URL.
|
|
5
|
+
* @param src Image source URL.
|
|
6
|
+
* @returns Natural width and height, or null when loading fails.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getImageDimensions(src: string): Promise<{
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
} | null>;
|
|
3
12
|
export default function UploadImage({ apiCdnUpload, editor }: {
|
|
4
13
|
apiCdnUpload: string;
|
|
5
14
|
editor: LexicalEditor;
|
|
@@ -7,7 +7,7 @@ import { INSERT_IMAGE_COMMAND } from '../../ImagesPlugin';
|
|
|
7
7
|
* @param src Image source URL.
|
|
8
8
|
* @returns Natural width and height, or null when loading fails.
|
|
9
9
|
*/
|
|
10
|
-
function getImageDimensions(src) {
|
|
10
|
+
export function getImageDimensions(src) {
|
|
11
11
|
return new Promise((resolve) => {
|
|
12
12
|
const image = new Image();
|
|
13
13
|
image.onload = () => {
|
package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/upload-image.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload-image.js","sourceRoot":"","sources":["../../../../../../../src/components/TextEditorV2/plugins/ToolbarPlugin/components/upload-image.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAEtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AAEzD;;;;GAIG;AACH,
|
|
1
|
+
{"version":3,"file":"upload-image.js","sourceRoot":"","sources":["../../../../../../../src/components/TextEditorV2/plugins/ToolbarPlugin/components/upload-image.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAEtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AAEzD;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,GAAW;IAC5C,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,MAAM,KAAK,GAAG,IAAI,KAAK,EAAE,CAAA;QACzB,KAAK,CAAC,MAAM,GAAG,GAAG,EAAE;YAClB,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,aAAa,EAAE,KAAK,EAAE,KAAK,CAAC,YAAY,EAAE,CAAC,CAAA;QACrE,CAAC,CAAA;QACD,KAAK,CAAC,OAAO,GAAG,GAAG,EAAE;YACnB,OAAO,CAAC,IAAI,CAAC,CAAA;QAC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AG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC;gBAEjC;oBACE,6BAAK,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,4BAA4B;wBAC5F,8BACE,CAAC,EAAC,0HAA0H,EAC5H,IAAI,EAAC,SAAS,GACR;wBACR,8BACE,QAAQ,EAAC,SAAS,EAClB,QAAQ,EAAC,SAAS,EAClB,CAAC,EAAC,qvEAAqvE,EACvvE,IAAI,EAAC,SAAS,GACR,CACJ,CACD,CACA,CACL,CACL,CACJ,CAAA;AACH,CAAC"}
|
|
@@ -2,6 +2,7 @@ import React, { useState } from 'react';
|
|
|
2
2
|
import { PHXModal } from '../../../../Modal';
|
|
3
3
|
import { FormUpload } from '../../../../UploadFile/FormUpload';
|
|
4
4
|
import { INSERT_IMAGE_COMMAND } from '../../ImagesPlugin';
|
|
5
|
+
import { getImageDimensions } from './upload-image';
|
|
5
6
|
export default function UploadPdf({ apiCdnUpload, editor }) {
|
|
6
7
|
const [openPdfModal, setOpenPdfModal] = useState(false);
|
|
7
8
|
const [pdfFile, setPdfFile] = useState(null);
|
|
@@ -63,6 +64,7 @@ export default function UploadPdf({ apiCdnUpload, editor }) {
|
|
|
63
64
|
const uploadTasks = [];
|
|
64
65
|
for (let i = 1; i <= numPages; i++) {
|
|
65
66
|
uploadTasks.push(async () => {
|
|
67
|
+
var _a, _b;
|
|
66
68
|
const page = await pdfDoc.getPage(i);
|
|
67
69
|
const viewport = page.getViewport({ scale: 2 });
|
|
68
70
|
const canvas = document.createElement('canvas');
|
|
@@ -70,15 +72,25 @@ export default function UploadPdf({ apiCdnUpload, editor }) {
|
|
|
70
72
|
canvas.width = viewport.width;
|
|
71
73
|
canvas.height = viewport.height;
|
|
72
74
|
await page.render({ canvasContext: context, viewport }).promise;
|
|
73
|
-
const blob = await new Promise((resolve) => canvas.toBlob(
|
|
74
|
-
|
|
75
|
-
|
|
75
|
+
const blob = await new Promise((resolve) => canvas.toBlob(resolve, 'image/jpeg', 0.92));
|
|
76
|
+
if (!blob) {
|
|
77
|
+
return {
|
|
78
|
+
height: 0,
|
|
79
|
+
index: i,
|
|
80
|
+
src: null,
|
|
81
|
+
width: 0,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
const fileName = `${file.name.replace(/\.[^/.]+$/, '')}-page-${i}.jpg`;
|
|
85
|
+
const imageFile = new File([blob], fileName, { type: 'image/jpeg' });
|
|
76
86
|
const link = await uploadImage(imageFile);
|
|
77
|
-
const
|
|
87
|
+
const dimensions = link === null ? null : await getImageDimensions(link);
|
|
88
|
+
const src = dimensions === null ? canvas.toDataURL('image/jpeg', 0.92) : link;
|
|
89
|
+
const scaled = scaleImageToMaxWidth((_a = dimensions === null || dimensions === void 0 ? void 0 : dimensions.width) !== null && _a !== void 0 ? _a : viewport.width, (_b = dimensions === null || dimensions === void 0 ? void 0 : dimensions.height) !== null && _b !== void 0 ? _b : viewport.height, editorWidth);
|
|
78
90
|
return {
|
|
79
91
|
height: scaled.height,
|
|
80
92
|
index: i,
|
|
81
|
-
|
|
93
|
+
src,
|
|
82
94
|
width: scaled.width,
|
|
83
95
|
};
|
|
84
96
|
});
|
|
@@ -91,15 +103,15 @@ export default function UploadPdf({ apiCdnUpload, editor }) {
|
|
|
91
103
|
const batchResults = await Promise.all(batch.map((fn) => fn()));
|
|
92
104
|
results.push(...batchResults);
|
|
93
105
|
}
|
|
94
|
-
const sorted = results.filter((r) => r.
|
|
106
|
+
const sorted = results.filter((r) => r.src).sort((a, b) => a.index - b.index);
|
|
95
107
|
for (const image of sorted) {
|
|
96
|
-
if (image.
|
|
108
|
+
if (image.src) {
|
|
97
109
|
editor.dispatchCommand(INSERT_IMAGE_COMMAND, {
|
|
98
110
|
altText: 'photo',
|
|
99
111
|
height: image.height,
|
|
100
112
|
maxWidth: editorWidth,
|
|
101
113
|
showCaption: false,
|
|
102
|
-
src: image.
|
|
114
|
+
src: image.src,
|
|
103
115
|
width: image.width,
|
|
104
116
|
});
|
|
105
117
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload-pdf.js","sourceRoot":"","sources":["../../../../../../../src/components/TextEditorV2/plugins/ToolbarPlugin/components/upload-pdf.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAE9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"upload-pdf.js","sourceRoot":"","sources":["../../../../../../../src/components/TextEditorV2/plugins/ToolbarPlugin/components/upload-pdf.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAE9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AAQnD,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAAE,YAAY,EAAE,MAAM,EAAmD;IACzG,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IACvD,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAc,IAAI,CAAC,CAAA;IACzD,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IAEjE;;;;;;OAMG;IACH,MAAM,oBAAoB,GAAG,CAAC,KAAa,EAAE,MAAc,EAAE,QAAgB,EAAqC,EAAE;QACl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R,CACJ,CACD,CACA,CACL,CACL,CACJ,CAAA;AACH,CAAC"}
|
|
@@ -1321,9 +1321,10 @@ export default function EditorStyle() {
|
|
|
1321
1321
|
}
|
|
1322
1322
|
|
|
1323
1323
|
.editor-image {
|
|
1324
|
-
display:
|
|
1324
|
+
display: flex;
|
|
1325
|
+
justify-content: center;
|
|
1325
1326
|
position: relative;
|
|
1326
|
-
width:
|
|
1327
|
+
width: 100%;
|
|
1327
1328
|
max-width: 100%;
|
|
1328
1329
|
margin-left: auto;
|
|
1329
1330
|
margin-right: auto;
|
|
@@ -1331,9 +1332,10 @@ export default function EditorStyle() {
|
|
|
1331
1332
|
|
|
1332
1333
|
.editor-image.position-left,
|
|
1333
1334
|
.inline-editor-image.position-left {
|
|
1334
|
-
display:
|
|
1335
|
+
display: flex;
|
|
1336
|
+
justify-content: flex-start;
|
|
1335
1337
|
position: relative;
|
|
1336
|
-
width:
|
|
1338
|
+
width: 100%;
|
|
1337
1339
|
max-width: 100%;
|
|
1338
1340
|
margin-left: 0;
|
|
1339
1341
|
margin-right: auto;
|
|
@@ -1341,9 +1343,10 @@ export default function EditorStyle() {
|
|
|
1341
1343
|
|
|
1342
1344
|
.editor-image.position-center,
|
|
1343
1345
|
.inline-editor-image.position-center {
|
|
1344
|
-
display:
|
|
1346
|
+
display: flex;
|
|
1347
|
+
justify-content: center;
|
|
1345
1348
|
position: relative;
|
|
1346
|
-
width:
|
|
1349
|
+
width: 100%;
|
|
1347
1350
|
max-width: 100%;
|
|
1348
1351
|
margin-left: auto;
|
|
1349
1352
|
margin-right: auto;
|
|
@@ -1351,9 +1354,10 @@ export default function EditorStyle() {
|
|
|
1351
1354
|
|
|
1352
1355
|
.editor-image.position-right,
|
|
1353
1356
|
.inline-editor-image.position-right {
|
|
1354
|
-
display:
|
|
1357
|
+
display: flex;
|
|
1358
|
+
justify-content: flex-end;
|
|
1355
1359
|
position: relative;
|
|
1356
|
-
width:
|
|
1360
|
+
width: 100%;
|
|
1357
1361
|
max-width: 100%;
|
|
1358
1362
|
margin-left: auto;
|
|
1359
1363
|
margin-right: 0;
|
|
@@ -1373,6 +1377,11 @@ export default function EditorStyle() {
|
|
|
1373
1377
|
margin-bottom: 10px;
|
|
1374
1378
|
}
|
|
1375
1379
|
|
|
1380
|
+
.inline-editor-image img {
|
|
1381
|
+
display: block;
|
|
1382
|
+
max-width: 100%;
|
|
1383
|
+
}
|
|
1384
|
+
|
|
1376
1385
|
.inline-editor-image.position-full {
|
|
1377
1386
|
display: block;
|
|
1378
1387
|
position: relative;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.js","sourceRoot":"","sources":["../../../../src/components/TextEditorV2/style.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,CAAC,OAAO,UAAU,WAAW;IACjC,OAAO,CACL,mCACG
|
|
1
|
+
{"version":3,"file":"style.js","sourceRoot":"","sources":["../../../../src/components/TextEditorV2/style.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,CAAC,OAAO,UAAU,WAAW;IACjC,OAAO,CACL,mCACG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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