@webiny/lexical-editor 5.44.1-beta.1 → 5.45.0-beta.0

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.
Files changed (252) hide show
  1. package/README.md +6 -12
  2. package/commands/image.d.ts +2 -2
  3. package/commands/image.js +2 -8
  4. package/commands/image.js.map +1 -1
  5. package/commands/index.d.ts +5 -4
  6. package/commands/index.js +5 -49
  7. package/commands/index.js.map +1 -1
  8. package/commands/list.d.ts +1 -1
  9. package/commands/list.js +4 -10
  10. package/commands/list.js.map +1 -1
  11. package/commands/quote.d.ts +1 -1
  12. package/commands/quote.js +2 -8
  13. package/commands/quote.js.map +1 -1
  14. package/commands/toolbar.js +2 -8
  15. package/commands/toolbar.js.map +1 -1
  16. package/commands/typography.d.ts +8 -0
  17. package/commands/typography.js +4 -0
  18. package/commands/typography.js.map +1 -0
  19. package/components/Editor/EnsureHeadingTagPlugin.js +10 -16
  20. package/components/Editor/EnsureHeadingTagPlugin.js.map +1 -1
  21. package/components/Editor/RichTextEditor.d.ts +12 -8
  22. package/components/Editor/RichTextEditor.js +89 -102
  23. package/components/Editor/RichTextEditor.js.map +1 -1
  24. package/components/Editor/normalizeInputValue.d.ts +1 -1
  25. package/components/Editor/normalizeInputValue.js +2 -8
  26. package/components/Editor/normalizeInputValue.js.map +1 -1
  27. package/components/LexicalEditorConfig/LexicalEditorConfig.d.ts +2 -3
  28. package/components/LexicalEditorConfig/LexicalEditorConfig.js +21 -32
  29. package/components/LexicalEditorConfig/LexicalEditorConfig.js.map +1 -1
  30. package/components/LexicalEditorConfig/components/Node.d.ts +1 -1
  31. package/components/LexicalEditorConfig/components/Node.js +17 -26
  32. package/components/LexicalEditorConfig/components/Node.js.map +1 -1
  33. package/components/LexicalEditorConfig/components/Plugin.js +17 -26
  34. package/components/LexicalEditorConfig/components/Plugin.js.map +1 -1
  35. package/components/LexicalEditorConfig/components/ToolbarElement.js +17 -26
  36. package/components/LexicalEditorConfig/components/ToolbarElement.js.map +1 -1
  37. package/components/LexicalHtmlRenderer.d.ts +4 -7
  38. package/components/LexicalHtmlRenderer.js +35 -53
  39. package/components/LexicalHtmlRenderer.js.map +1 -1
  40. package/components/Toolbar/StaticToolbar.css +416 -0
  41. package/components/Toolbar/StaticToolbar.d.ts +3 -1
  42. package/components/Toolbar/StaticToolbar.js +19 -23
  43. package/components/Toolbar/StaticToolbar.js.map +1 -1
  44. package/components/ToolbarActions/BoldAction.js +16 -21
  45. package/components/ToolbarActions/BoldAction.js.map +1 -1
  46. package/components/ToolbarActions/BulletListAction.js +25 -31
  47. package/components/ToolbarActions/BulletListAction.js.map +1 -1
  48. package/components/ToolbarActions/CodeHighlightAction.js +16 -21
  49. package/components/ToolbarActions/CodeHighlightAction.js.map +1 -1
  50. package/components/ToolbarActions/FontColorAction.js +32 -42
  51. package/components/ToolbarActions/FontColorAction.js.map +1 -1
  52. package/components/ToolbarActions/ImageAction.js +19 -34
  53. package/components/ToolbarActions/ImageAction.js.map +1 -1
  54. package/components/ToolbarActions/ItalicAction.js +16 -21
  55. package/components/ToolbarActions/ItalicAction.js.map +1 -1
  56. package/components/ToolbarActions/LinkAction.js +19 -24
  57. package/components/ToolbarActions/LinkAction.js.map +1 -1
  58. package/components/ToolbarActions/NumberedListAction.js +25 -36
  59. package/components/ToolbarActions/NumberedListAction.js.map +1 -1
  60. package/components/ToolbarActions/QuoteAction.js +20 -25
  61. package/components/ToolbarActions/QuoteAction.js.map +1 -1
  62. package/components/ToolbarActions/TextAlignmentAction.js +36 -45
  63. package/components/ToolbarActions/TextAlignmentAction.js.map +1 -1
  64. package/components/ToolbarActions/TypographyAction.js +57 -79
  65. package/components/ToolbarActions/TypographyAction.js.map +1 -1
  66. package/components/ToolbarActions/UnderlineAction.js +16 -21
  67. package/components/ToolbarActions/UnderlineAction.js.map +1 -1
  68. package/context/FontColorActionContext.js +2 -9
  69. package/context/FontColorActionContext.js.map +1 -1
  70. package/context/RichTextEditorContext.d.ts +6 -7
  71. package/context/RichTextEditorContext.js +28 -26
  72. package/context/RichTextEditorContext.js.map +1 -1
  73. package/context/SharedHistoryContext.d.ts +2 -2
  74. package/context/SharedHistoryContext.js +12 -20
  75. package/context/SharedHistoryContext.js.map +1 -1
  76. package/context/TextAlignmentActionContextProps.d.ts +1 -1
  77. package/context/TextAlignmentActionContextProps.js +2 -9
  78. package/context/TextAlignmentActionContextProps.js.map +1 -1
  79. package/context/TypographyActionContext.d.ts +3 -2
  80. package/context/TypographyActionContext.js +2 -9
  81. package/context/TypographyActionContext.js.map +1 -1
  82. package/exports/admin/lexical.d.ts +15 -0
  83. package/exports/admin/lexical.js +23 -0
  84. package/exports/admin/lexical.js.map +1 -0
  85. package/hooks/index.d.ts +7 -8
  86. package/hooks/index.js +7 -93
  87. package/hooks/index.js.map +1 -1
  88. package/hooks/useCurrentElement.d.ts +3 -3
  89. package/hooks/useCurrentElement.js +11 -18
  90. package/hooks/useCurrentElement.js.map +1 -1
  91. package/hooks/useCurrentSelection.d.ts +2 -1
  92. package/hooks/useCurrentSelection.js +27 -40
  93. package/hooks/useCurrentSelection.js.map +1 -1
  94. package/hooks/useFontColorPicker.d.ts +1 -1
  95. package/hooks/useFontColorPicker.js +5 -11
  96. package/hooks/useFontColorPicker.js.map +1 -1
  97. package/hooks/useIsMounted.js +6 -14
  98. package/hooks/useIsMounted.js.map +1 -1
  99. package/hooks/useRichTextEditor.d.ts +1 -1
  100. package/hooks/useRichTextEditor.js +5 -11
  101. package/hooks/useRichTextEditor.js.map +1 -1
  102. package/hooks/useTextAlignmentAction.d.ts +1 -1
  103. package/hooks/useTextAlignmentAction.js +5 -11
  104. package/hooks/useTextAlignmentAction.js.map +1 -1
  105. package/hooks/useTypographyAction.d.ts +1 -1
  106. package/hooks/useTypographyAction.js +5 -11
  107. package/hooks/useTypographyAction.js.map +1 -1
  108. package/index.d.ts +33 -38
  109. package/index.js +44 -322
  110. package/index.js.map +1 -1
  111. package/package.json +18 -22
  112. package/plugins/BlurEventPlugin/BlurEventPlugin.d.ts +2 -2
  113. package/plugins/BlurEventPlugin/BlurEventPlugin.js +16 -22
  114. package/plugins/BlurEventPlugin/BlurEventPlugin.js.map +1 -1
  115. package/plugins/CodeHighlightPlugin/CodeHighlightPlugin.js +9 -14
  116. package/plugins/CodeHighlightPlugin/CodeHighlightPlugin.js.map +1 -1
  117. package/plugins/CodeHighlightPlugin/index.d.ts +1 -1
  118. package/plugins/CodeHighlightPlugin/index.js +1 -16
  119. package/plugins/CodeHighlightPlugin/index.js.map +1 -1
  120. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditor.d.ts +10 -0
  121. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditor.js +28 -0
  122. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditor.js.map +1 -0
  123. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorController.d.ts +7 -0
  124. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorController.js +61 -0
  125. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorController.js.map +1 -0
  126. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin.css +2 -136
  127. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin.d.ts +4 -16
  128. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin.js +7 -180
  129. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin.js.map +1 -1
  130. package/plugins/FloatingLinkEditorPlugin/index.d.ts +1 -1
  131. package/plugins/FloatingLinkEditorPlugin/index.js +1 -16
  132. package/plugins/FloatingLinkEditorPlugin/index.js.map +1 -1
  133. package/plugins/FloatingLinkEditorPlugin/isChildOfLinkEditor.js +3 -9
  134. package/plugins/FloatingLinkEditorPlugin/isChildOfLinkEditor.js.map +1 -1
  135. package/plugins/FloatingLinkEditorPlugin/types.d.ts +10 -0
  136. package/plugins/FloatingLinkEditorPlugin/types.js +3 -0
  137. package/plugins/FloatingLinkEditorPlugin/types.js.map +1 -0
  138. package/plugins/FloatingLinkEditorPlugin/useFloatingLinkEditor.d.ts +8 -2
  139. package/plugins/FloatingLinkEditorPlugin/useFloatingLinkEditor.js +120 -88
  140. package/plugins/FloatingLinkEditorPlugin/useFloatingLinkEditor.js.map +1 -1
  141. package/plugins/FontColorPlugin/FontColorPlugin.js +19 -22
  142. package/plugins/FontColorPlugin/FontColorPlugin.js.map +1 -1
  143. package/plugins/FontColorPlugin/applyColorToNode.d.ts +2 -2
  144. package/plugins/FontColorPlugin/applyColorToNode.js +4 -10
  145. package/plugins/FontColorPlugin/applyColorToNode.js.map +1 -1
  146. package/plugins/FontColorPlugin/applyColorToSelection.d.ts +2 -2
  147. package/plugins/FontColorPlugin/applyColorToSelection.js +28 -44
  148. package/plugins/FontColorPlugin/applyColorToSelection.js.map +1 -1
  149. package/plugins/ImagesPlugin/ImagesPlugin.d.ts +1 -2
  150. package/plugins/ImagesPlugin/ImagesPlugin.js +58 -60
  151. package/plugins/ImagesPlugin/ImagesPlugin.js.map +1 -1
  152. package/plugins/LinkPlugin/LinkPlugin.js +29 -37
  153. package/plugins/LinkPlugin/LinkPlugin.js.map +1 -1
  154. package/plugins/ListPLugin/ListPlugin.js +52 -15
  155. package/plugins/ListPLugin/ListPlugin.js.map +1 -1
  156. package/plugins/QuoteNodePlugin/QuoteNodePlugin.js +19 -16
  157. package/plugins/QuoteNodePlugin/QuoteNodePlugin.js.map +1 -1
  158. package/plugins/StateHandlingPlugin.d.ts +1 -1
  159. package/plugins/StateHandlingPlugin.js +32 -39
  160. package/plugins/StateHandlingPlugin.js.map +1 -1
  161. package/plugins/TypographyPlugin/TypographyPlugin.js +17 -21
  162. package/plugins/TypographyPlugin/TypographyPlugin.js.map +1 -1
  163. package/types.d.ts +4 -4
  164. package/types.js +6 -38
  165. package/types.js.map +1 -1
  166. package/ui/ContentEditable.d.ts +0 -1
  167. package/ui/ContentEditable.js +7 -14
  168. package/ui/ContentEditable.js.map +1 -1
  169. package/ui/Divider.d.ts +0 -1
  170. package/ui/Divider.js +3 -10
  171. package/ui/Divider.js.map +1 -1
  172. package/ui/DropDown.d.ts +1 -1
  173. package/ui/DropDown.js +64 -90
  174. package/ui/DropDown.js.map +1 -1
  175. package/ui/ImageResizer.d.ts +0 -1
  176. package/ui/ImageResizer.js +78 -83
  177. package/ui/ImageResizer.js.map +1 -1
  178. package/ui/LinkPreview.d.ts +0 -1
  179. package/ui/LinkPreview.js +22 -29
  180. package/ui/LinkPreview.js.map +1 -1
  181. package/ui/Placeholder.d.ts +1 -1
  182. package/ui/Placeholder.js +10 -16
  183. package/ui/Placeholder.js.map +1 -1
  184. package/ui/TextInput.d.ts +0 -1
  185. package/ui/TextInput.js +11 -18
  186. package/ui/TextInput.js.map +1 -1
  187. package/ui/ToolbarActionDialog.js +30 -42
  188. package/ui/ToolbarActionDialog.js.map +1 -1
  189. package/utils/canUseDOM.js +1 -7
  190. package/utils/canUseDOM.js.map +1 -1
  191. package/utils/files.d.ts +6 -6
  192. package/utils/files.js +5 -32
  193. package/utils/files.js.map +1 -1
  194. package/utils/getDOMRangeRect.js +4 -10
  195. package/utils/getDOMRangeRect.js.map +1 -1
  196. package/utils/getSelectedNode.d.ts +1 -1
  197. package/utils/getSelectedNode.js +9 -16
  198. package/utils/getSelectedNode.js.map +1 -1
  199. package/utils/getTransparentImage.js +1 -7
  200. package/utils/getTransparentImage.js.map +1 -1
  201. package/utils/insertImage.d.ts +1 -1
  202. package/utils/insertImage.js +8 -14
  203. package/utils/insertImage.js.map +1 -1
  204. package/utils/isAnchorLink.js +1 -7
  205. package/utils/isAnchorLink.js.map +1 -1
  206. package/utils/isChildOfFloatingToolbar.js +3 -12
  207. package/utils/isChildOfFloatingToolbar.js.map +1 -1
  208. package/utils/isHTMLElement.js +1 -7
  209. package/utils/isHTMLElement.js.map +1 -1
  210. package/utils/isValidJSON.js +3 -9
  211. package/utils/isValidJSON.js.map +1 -1
  212. package/utils/isValidLexicalData.d.ts +3 -3
  213. package/utils/isValidLexicalData.js +6 -12
  214. package/utils/isValidLexicalData.js.map +1 -1
  215. package/utils/point.js +35 -60
  216. package/utils/point.js.map +1 -1
  217. package/utils/rect.d.ts +1 -1
  218. package/utils/rect.js +115 -149
  219. package/utils/rect.js.map +1 -1
  220. package/utils/sanitizeUrl.js +6 -13
  221. package/utils/sanitizeUrl.js.map +1 -1
  222. package/utils/setFloatingElemPosition.d.ts +1 -1
  223. package/utils/setFloatingElemPosition.js +24 -30
  224. package/utils/setFloatingElemPosition.js.map +1 -1
  225. package/components/Editor/HeadingEditor.d.ts +0 -7
  226. package/components/Editor/HeadingEditor.js +0 -30
  227. package/components/Editor/HeadingEditor.js.map +0 -1
  228. package/components/Editor/ParagraphEditor.d.ts +0 -7
  229. package/components/Editor/ParagraphEditor.js +0 -29
  230. package/components/Editor/ParagraphEditor.js.map +0 -1
  231. package/components/Toolbar/Toolbar.css +0 -643
  232. package/components/Toolbar/Toolbar.d.ts +0 -11
  233. package/components/Toolbar/Toolbar.js +0 -165
  234. package/components/Toolbar/Toolbar.js.map +0 -1
  235. package/components/ToolbarActions/FontSizeAction.d.ts +0 -14
  236. package/components/ToolbarActions/FontSizeAction.js +0 -109
  237. package/components/ToolbarActions/FontSizeAction.js.map +0 -1
  238. package/hooks/useList.d.ts +0 -2
  239. package/hooks/useList.js +0 -54
  240. package/hooks/useList.js.map +0 -1
  241. package/hooks/useQuote.d.ts +0 -2
  242. package/hooks/useQuote.js +0 -22
  243. package/hooks/useQuote.js.map +0 -1
  244. package/plugins/FloatingLinkEditorPlugin/LinkEditForm.d.ts +0 -9
  245. package/plugins/FloatingLinkEditorPlugin/LinkEditForm.js +0 -118
  246. package/plugins/FloatingLinkEditorPlugin/LinkEditForm.js.map +0 -1
  247. package/plugins/FloatingLinkEditorPlugin/LinkPreviewForm.d.ts +0 -9
  248. package/plugins/FloatingLinkEditorPlugin/LinkPreviewForm.js +0 -44
  249. package/plugins/FloatingLinkEditorPlugin/LinkPreviewForm.js.map +0 -1
  250. package/utils/generateInitialLexicalValue.d.ts +0 -4
  251. package/utils/generateInitialLexicalValue.js +0 -33
  252. package/utils/generateInitialLexicalValue.js.map +0 -1
@@ -1,643 +0,0 @@
1
- .floating-toolbar {
2
- display: flex;
3
- padding: 4px;
4
- vertical-align: middle;
5
- position: absolute;
6
- top: 0;
7
- left: 0;
8
- z-index: 30;
9
- opacity: 0;
10
- background-color: #fff;
11
- box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.3);
12
- border-radius: 8px;
13
- transition: opacity 0.5s;
14
- height: 35px;
15
- will-change: transform;
16
- }
17
-
18
- .floating-toolbar button.popup-item {
19
- border: 0;
20
- display: flex;
21
- background: none;
22
- border-radius: 10px;
23
- padding: 8px;
24
- cursor: pointer;
25
- vertical-align: middle;
26
- }
27
-
28
- .floating-toolbar button.popup-item:disabled {
29
- cursor: not-allowed;
30
- }
31
-
32
- .floating-toolbar button.popup-item.spaced {
33
- margin-right: 2px;
34
- }
35
-
36
- .floating-toolbar button.popup-item i.format {
37
- background-size: contain;
38
- display: inline-block;
39
- height: 18px;
40
- width: 18px;
41
- margin-top: 2px;
42
- vertical-align: -0.25em;
43
- display: flex;
44
- opacity: 0.6;
45
- }
46
-
47
- .floating-toolbar button.popup-item:disabled i.format {
48
- opacity: 0.2;
49
- }
50
-
51
- .floating-toolbar button.popup-item.active {
52
- background-color: rgba(223, 232, 250, 0.3);
53
- }
54
-
55
- .floating-toolbar button.popup-item.active i {
56
- opacity: 1;
57
- }
58
-
59
- .floating-toolbar .popup-item:hover:not([disabled]) {
60
- background-color: #eee;
61
- }
62
-
63
- .floating-toolbar select.popup-item {
64
- border: 0;
65
- display: flex;
66
- background: none;
67
- border-radius: 10px;
68
- padding: 8px;
69
- vertical-align: middle;
70
- -webkit-appearance: none;
71
- -moz-appearance: none;
72
- width: 70px;
73
- font-size: 14px;
74
- color: #777;
75
- text-overflow: ellipsis;
76
- }
77
-
78
- .floating-toolbar select.code-language {
79
- text-transform: capitalize;
80
- width: 130px;
81
- }
82
-
83
- .floating-toolbar .popup-item .text {
84
- display: flex;
85
- line-height: 20px;
86
- width: 200px;
87
- vertical-align: middle;
88
- font-size: 14px;
89
- color: #777;
90
- text-overflow: ellipsis;
91
- width: 70px;
92
- overflow: hidden;
93
- height: 20px;
94
- text-align: left;
95
- }
96
-
97
- .floating-toolbar .popup-item .icon {
98
- display: flex;
99
- width: 20px;
100
- height: 20px;
101
- user-select: none;
102
- margin-right: 8px;
103
- line-height: 16px;
104
- background-size: contain;
105
- }
106
-
107
- .floating-toolbar i.chevron-down {
108
- margin-top: 3px;
109
- width: 16px;
110
- height: 16px;
111
- display: flex;
112
- user-select: none;
113
- }
114
-
115
- .floating-toolbar i.chevron-down.inside {
116
- width: 16px;
117
- height: 16px;
118
- display: flex;
119
- margin-left: -25px;
120
- margin-top: 11px;
121
- margin-right: 10px;
122
- pointer-events: none;
123
- }
124
-
125
- .floating-toolbar .divider {
126
- width: 1px;
127
- background-color: #eee;
128
- margin: 0 4px;
129
- }
130
-
131
- i.bold {
132
- background-image: url("../../images/icons/type-bold.svg");
133
- }
134
-
135
- i.italic {
136
- background-image: url("../../images/icons/type-italic.svg");
137
- }
138
-
139
- i.code {
140
- background-image: url("../../images/icons/code.svg");
141
- }
142
-
143
- i.underline {
144
- background-image: url("../../images/icons/type-underline.svg");
145
- }
146
-
147
- i.strikethrough {
148
- background-image: url("../../images/icons/type-strikethrough.svg");
149
- }
150
-
151
- i.link {
152
- background-image: url("../../images/icons/link.svg");
153
- }
154
-
155
- i.quote {
156
- background-image: url("../../images/icons/chat-square-quote.svg");
157
- }
158
-
159
- .icon.left-align,
160
- i.left-align {
161
- background-image: url("../../images/icons/text-left.svg");
162
- }
163
-
164
- i.center-align {
165
- background-image: url("../../images/icons/text-center.svg");
166
- }
167
-
168
- i.right-align {
169
- background-image: url("../../images/icons/text-right.svg");
170
- }
171
-
172
- i.indent {
173
- background-image: url("../../images/icons/indent.svg");
174
- }
175
-
176
- i.outdent {
177
- background-image: url("../../images/icons/outdent.svg");
178
- }
179
-
180
- i.justify-align {
181
- background-image: url("../../images/icons/justify.svg");
182
- }
183
-
184
- i.chevron-down {
185
- background-color: transparent;
186
- background-size: contain;
187
- display: inline-block;
188
- height: 8px;
189
- width: 8px;
190
- background-image: url("../../images/icons/chevron-down.svg");
191
- }
192
-
193
- i.insert-image,
194
- .icon.insert-image {
195
- background-color: transparent;
196
- background-size: contain;
197
- display: inline-block;
198
- height: 8px;
199
- width: 8px;
200
- background-image: url("../../images/icons/insert-image.svg");
201
- }
202
-
203
- .icon.bullet-list,
204
- .icon.bullet {
205
- background-image: url("../../images/icons/list-ul.svg");
206
- }
207
-
208
- .icon.numbered-list,
209
- .icon.number {
210
- background-image: url("../../images/icons/list-ol.svg");
211
- }
212
-
213
- i.font-color,
214
- .icon.font-color {
215
- background-image: url("../../images/icons/font-color.svg");
216
- }
217
-
218
- .link-editor .button.active,
219
- .toolbar .button.active {
220
- background-color: rgb(223, 232, 250);
221
- }
222
-
223
- .floating-toolbar button.toolbar-item {
224
- border: 0;
225
- display: flex;
226
- background: none;
227
- border-radius: 10px;
228
- padding: 8px;
229
- cursor: pointer;
230
- vertical-align: middle;
231
- flex-shrink: 0;
232
- align-items: center;
233
- justify-content: space-between;
234
- }
235
-
236
- .floating-toolbar button.toolbar-item:disabled {
237
- cursor: not-allowed;
238
- }
239
-
240
- .floating-toolbar button.toolbar-item.spaced {
241
- margin-right: 2px;
242
- }
243
-
244
- .floating-toolbar button.toolbar-item i.format {
245
- background-size: contain;
246
- display: inline-block;
247
- height: 18px;
248
- width: 18px;
249
- vertical-align: -0.25em;
250
- display: flex;
251
- opacity: 0.6;
252
- }
253
-
254
- .floating-toolbar button.toolbar-item:disabled .icon,
255
- .floating-toolbar button.toolbar-item:disabled .text,
256
- .floating-toolbar button.toolbar-item:disabled i.format,
257
- .floating-toolbar button.toolbar-item:disabled .chevron-down {
258
- opacity: 0.2;
259
- }
260
-
261
- .floating-toolbar button.toolbar-item.active {
262
- background-color: rgba(223, 232, 250, 0.3);
263
- }
264
-
265
- .floating-toolbar button.toolbar-item.active i {
266
- opacity: 1;
267
- }
268
-
269
- .floating-toolbar .toolbar-item:hover:not([disabled]) {
270
- background-color: #eee;
271
- }
272
-
273
- .floating-toolbar .toolbar-item.font-family .text {
274
- display: block;
275
- max-width: 40px;
276
- }
277
-
278
- .floating-toolbar .code-language {
279
- width: 150px;
280
- }
281
-
282
- .floating-toolbar .toolbar-item .text {
283
- display: flex;
284
- line-height: 20px;
285
- vertical-align: middle;
286
- font-size: 14px;
287
- color: #777;
288
- text-overflow: ellipsis;
289
- overflow: hidden;
290
- height: 20px;
291
- text-align: left;
292
- padding-right: 10px;
293
- }
294
-
295
- .floating-toolbar .toolbar-item .icon {
296
- display: flex;
297
- width: 20px;
298
- height: 20px;
299
- user-select: none;
300
- margin-right: 8px;
301
- line-height: 16px;
302
- background-size: contain;
303
- }
304
-
305
- .floating-toolbar i.chevron-down {
306
- margin-top: 3px;
307
- width: 16px;
308
- height: 16px;
309
- display: flex;
310
- user-select: none;
311
- }
312
-
313
- .floating-toolbar i.chevron-down.inside {
314
- width: 16px;
315
- height: 16px;
316
- display: flex;
317
- margin-left: -25px;
318
- margin-top: 11px;
319
- margin-right: 10px;
320
- pointer-events: none;
321
- }
322
-
323
- .toolbar .divider {
324
- width: 1px;
325
- background-color: #eee;
326
- margin: 0 4px;
327
- }
328
-
329
- .lexical-dropdown-container {
330
- position: absolute;
331
- bottom: -5px;
332
- left: 0;
333
- }
334
-
335
- .lexical-dropdown {
336
- z-index: 10;
337
- display: block;
338
- position: fixed;
339
- box-shadow: 0 12px 28px 0 rgba(0, 0, 0, 0.2), 0 2px 4px 0 rgba(0, 0, 0, 0.1),
340
- inset 0 0 0 1px rgba(255, 255, 255, 0.5);
341
- border-radius: 8px;
342
- min-height: 40px;
343
- background-color: #fff;
344
- max-height: 250px;
345
- overflow: hidden;
346
- overflow-y: auto;
347
- }
348
-
349
- .lexical-dropdown.no-scroll {
350
- max-height: inherit;
351
- overflow: auto;
352
- overflow-y: auto;
353
- }
354
-
355
- .lexical-dropdown .item {
356
- margin: 0 8px 0 8px;
357
- padding: 8px;
358
- color: #050505;
359
- cursor: pointer;
360
- line-height: 16px;
361
- font-size: 15px;
362
- display: flex;
363
- align-content: center;
364
- flex-direction: row;
365
- flex-shrink: 0;
366
- justify-content: space-between;
367
- background-color: #fff;
368
- border-radius: 8px;
369
- border: 0;
370
- max-width: 250px;
371
- min-width: 100px;
372
- }
373
-
374
- .lexical-dropdown .item.fontsize-item,
375
- .lexical-dropdown .item.fontsize-item .text {
376
- min-width: unset;
377
- }
378
-
379
- .lexical-dropdown .item .active {
380
- display: flex;
381
- width: 20px;
382
- height: 20px;
383
- background-size: contain;
384
- }
385
-
386
- .lexical-dropdown .item:first-child {
387
- margin-top: 8px;
388
- }
389
-
390
- .lexical-dropdown .item:last-child {
391
- margin-bottom: 8px;
392
- }
393
-
394
- .lexical-dropdown .item:hover {
395
- background-color: #eee;
396
- }
397
-
398
- .lexical-dropdown .item .text {
399
- display: flex;
400
- line-height: 20px;
401
- flex-grow: 1;
402
- min-width: 150px;
403
- }
404
-
405
- .lexical-dropdown .item .icon {
406
- display: flex;
407
- width: 20px;
408
- height: 20px;
409
- user-select: none;
410
- margin-right: 12px;
411
- line-height: 16px;
412
- background-size: contain;
413
- background-position: center;
414
- background-repeat: no-repeat;
415
- }
416
-
417
- .lexical-dropdown .divider {
418
- width: auto;
419
- background-color: #eee;
420
- margin: 4px 8px;
421
- height: 1px;
422
- }
423
-
424
- @media screen and (max-width: 1100px) {
425
- .dropdown-button-text {
426
- display: none !important;
427
- }
428
- .font-size .dropdown-button-text {
429
- display: flex !important;
430
- }
431
- .code-language .dropdown-button-text {
432
- display: flex !important;
433
- }
434
- }
435
-
436
- button.item i {
437
- opacity: 0.6;
438
- }
439
-
440
- button.item.dropdown-item-active {
441
- background-color: rgba(223, 232, 250, 0.3);
442
- }
443
-
444
- button.item.dropdown-item-active i {
445
- opacity: 1;
446
- }
447
-
448
- .editor-shell span.editor-image {
449
- cursor: default;
450
- display: inline-block;
451
- position: relative;
452
- user-select: none;
453
- }
454
-
455
- .editor-shell .editor-image img {
456
- max-width: 100%;
457
- cursor: default;
458
- }
459
-
460
- .editor-shell .editor-image img.focused {
461
- outline: 2px solid rgb(60, 132, 244);
462
- user-select: none;
463
- }
464
-
465
- .editor-shell .editor-image img.focused.draggable {
466
- cursor: grab;
467
- }
468
-
469
- .editor-shell .editor-image img.focused.draggable:active {
470
- cursor: grabbing;
471
- }
472
-
473
- .editor-shell .editor-image .image-caption-container .tree-view-output {
474
- margin: 0;
475
- border-radius: 0;
476
- }
477
-
478
- .editor-shell .editor-image .image-caption-container {
479
- display: block;
480
- position: absolute;
481
- bottom: 4px;
482
- left: 0;
483
- right: 0;
484
- padding: 0;
485
- margin: 0;
486
- border-top: 1px solid #fff;
487
- background-color: #ffffffe6;
488
- min-width: 100px;
489
- color: #000;
490
- overflow: hidden;
491
- }
492
-
493
- .editor-shell .editor-image .image-caption-button {
494
- display: block;
495
- position: absolute;
496
- bottom: 20px;
497
- left: 0;
498
- right: 0;
499
- width: 30%;
500
- padding: 10px;
501
- margin: 0 auto;
502
- border: 1px solid rgba(255, 255, 255, 0.3);
503
- border-radius: 5px;
504
- background-color: #00000080;
505
- min-width: 100px;
506
- color: #fff;
507
- cursor: pointer;
508
- user-select: none;
509
- }
510
-
511
- .editor-shell .editor-image .image-caption-button:hover {
512
- background-color: #3c84f480;
513
- }
514
-
515
- .editor-shell .editor-image .image-resizer {
516
- display: block;
517
- width: 7px;
518
- height: 7px;
519
- position: absolute;
520
- background-color: #3c84f4;
521
- border: 1px solid #fff;
522
- }
523
-
524
- .editor-shell .editor-image .image-resizer.image-resizer-n {
525
- top: -6px;
526
- left: 48%;
527
- cursor: n-resize;
528
- }
529
-
530
- .editor-shell .editor-image .image-resizer.image-resizer-ne {
531
- top: -6px;
532
- right: -6px;
533
- cursor: ne-resize;
534
- }
535
-
536
- .editor-shell .editor-image .image-resizer.image-resizer-e {
537
- bottom: 48%;
538
- right: -6px;
539
- cursor: e-resize;
540
- }
541
-
542
- .editor-shell .editor-image .image-resizer.image-resizer-se {
543
- bottom: -2px;
544
- right: -6px;
545
- cursor: nwse-resize;
546
- }
547
-
548
- .editor-shell .editor-image .image-resizer.image-resizer-s {
549
- bottom: -2px;
550
- left: 48%;
551
- cursor: s-resize;
552
- }
553
-
554
- .editor-shell .editor-image .image-resizer.image-resizer-sw {
555
- bottom: -2px;
556
- left: -6px;
557
- cursor: sw-resize;
558
- }
559
-
560
- .editor-shell .editor-image .image-resizer.image-resizer-w {
561
- bottom: 48%;
562
- left: -6px;
563
- cursor: w-resize;
564
- }
565
-
566
- .editor-shell .editor-image .image-resizer.image-resizer-nw {
567
- top: -6px;
568
- left: -6px;
569
- cursor: nw-resize;
570
- }
571
-
572
- .editor-shell span.inline-editor-image {
573
- cursor: default;
574
- display: inline-block;
575
- position: relative;
576
- z-index: 1;
577
- }
578
-
579
- .editor-shell .inline-editor-image img {
580
- max-width: 100%;
581
- cursor: default;
582
- }
583
-
584
- .editor-shell .inline-editor-image img.focused {
585
- outline: 2px solid rgb(60, 132, 244);
586
- }
587
-
588
- .editor-shell .inline-editor-image img.focused.draggable {
589
- cursor: grab;
590
- }
591
-
592
- .editor-shell .inline-editor-image img.focused.draggable:active {
593
- cursor: grabbing;
594
- }
595
-
596
- .editor-shell .inline-editor-image .image-caption-container .tree-view-output {
597
- margin: 0;
598
- border-radius: 0;
599
- }
600
-
601
- .editor-shell .inline-editor-image.position-full {
602
- margin: 1em 0;
603
- }
604
-
605
- .editor-shell .inline-editor-image.position-left {
606
- float: left;
607
- width: 50%;
608
- margin: 1em 1em 0 0;
609
- }
610
-
611
- .editor-shell .inline-editor-image.position-right {
612
- float: right;
613
- width: 50%;
614
- margin: 1em 0 0 1em;
615
- }
616
-
617
- .editor-shell .inline-editor-image .image-edit-button {
618
- display: block;
619
- position: absolute;
620
- top: 12px;
621
- right: 12px;
622
- padding: 6px 8px;
623
- margin: 0 auto;
624
- border: 1px solid rgba(255, 255, 255, 0.3);
625
- border-radius: 5px;
626
- background-color: #00000080;
627
- min-width: 60px;
628
- color: #fff;
629
- cursor: pointer;
630
- user-select: none;
631
- }
632
-
633
- .editor-shell .inline-editor-image .image-edit-button:hover {
634
- background-color: #3c84f480;
635
- }
636
-
637
- .editor-shell .inline-editor-image .image-caption-container {
638
- display: block;
639
- background-color: #f4f4f4;
640
- min-width: 100%;
641
- color: #000;
642
- overflow: hidden;
643
- }
@@ -1,11 +0,0 @@
1
- import React from "react";
2
- import "./Toolbar.css";
3
- declare global {
4
- interface Document {
5
- floatingToolbar: boolean;
6
- }
7
- }
8
- export interface ToolbarProps {
9
- anchorElem?: HTMLElement;
10
- }
11
- export declare const Toolbar: ({ anchorElem }: ToolbarProps) => React.ReactPortal | null;