5htp-core 0.4.8 → 0.4.9

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 (187) hide show
  1. package/package.json +5 -1
  2. package/src/client/assets/css/components/table.less +2 -0
  3. package/src/client/components/Form.ts +1 -1
  4. package/src/client/components/button.tsx +2 -1
  5. package/src/client/components/containers/Popover/index.tsx +2 -2
  6. package/src/client/components/dropdown/index.tsx +16 -6
  7. package/src/client/components/input/Slider/index.tsx +0 -2
  8. package/src/client/components/inputv3/Rte/Editor.tsx +271 -0
  9. package/src/client/components/inputv3/Rte/ToolbarPlugin/BlockFormat.tsx +220 -0
  10. package/src/client/components/inputv3/Rte/ToolbarPlugin/ElementFormat.tsx +107 -0
  11. package/src/client/components/inputv3/Rte/ToolbarPlugin/index.tsx +768 -0
  12. package/src/client/components/inputv3/Rte/appSettings.ts +36 -0
  13. package/src/client/components/inputv3/Rte/context/FlashMessageContext.tsx +68 -0
  14. package/src/client/components/inputv3/Rte/context/SettingsContext.tsx +71 -0
  15. package/src/client/components/inputv3/Rte/context/SharedAutocompleteContext.tsx +71 -0
  16. package/src/client/components/inputv3/Rte/context/SharedHistoryContext.tsx +35 -0
  17. package/src/client/components/inputv3/Rte/currentEditor.ts +42 -0
  18. package/src/client/components/inputv3/Rte/hooks/useFlashMessage.tsx +16 -0
  19. package/src/client/components/inputv3/Rte/hooks/useReport.ts +67 -0
  20. package/src/client/components/inputv3/Rte/images/emoji/1F600.png +0 -0
  21. package/src/client/components/inputv3/Rte/images/emoji/1F641.png +0 -0
  22. package/src/client/components/inputv3/Rte/images/emoji/1F642.png +0 -0
  23. package/src/client/components/inputv3/Rte/images/emoji/2764.png +0 -0
  24. package/src/client/components/inputv3/Rte/images/emoji/LICENSE.md +5 -0
  25. package/src/client/components/inputv3/Rte/images/icons/draggable-block-menu.svg +1 -0
  26. package/src/client/components/inputv3/Rte/images/icons/prettier-error.svg +1 -0
  27. package/src/client/components/inputv3/Rte/images/icons/prettier.svg +1 -0
  28. package/src/client/components/inputv3/Rte/images/image/LICENSE.md +5 -0
  29. package/src/client/components/inputv3/Rte/images/image-broken.svg +4 -0
  30. package/src/client/components/inputv3/Rte/images/logo.svg +1 -0
  31. package/src/client/components/inputv3/Rte/index.tsx +63 -79
  32. package/src/client/components/inputv3/Rte/nodes/AutocompleteNode.tsx +119 -0
  33. package/src/client/components/inputv3/Rte/nodes/EmojiNode.tsx +102 -0
  34. package/src/client/components/inputv3/Rte/nodes/EquationComponent.tsx +141 -0
  35. package/src/client/components/inputv3/Rte/nodes/EquationNode.tsx +174 -0
  36. package/src/client/components/inputv3/Rte/nodes/FigmaNode.tsx +135 -0
  37. package/src/client/components/inputv3/Rte/nodes/ImageComponent.tsx +468 -0
  38. package/src/client/components/inputv3/Rte/nodes/ImageNode.css +43 -0
  39. package/src/client/components/inputv3/Rte/nodes/ImageNode.tsx +266 -0
  40. package/src/client/components/inputv3/Rte/nodes/InlineImageNode/InlineImageComponent.tsx +402 -0
  41. package/src/client/components/inputv3/Rte/nodes/InlineImageNode/InlineImageNode.css +94 -0
  42. package/src/client/components/inputv3/Rte/nodes/InlineImageNode/InlineImageNode.tsx +294 -0
  43. package/src/client/components/inputv3/Rte/nodes/KeywordNode.ts +67 -0
  44. package/src/client/components/inputv3/Rte/nodes/LayoutContainerNode.ts +137 -0
  45. package/src/client/components/inputv3/Rte/nodes/LayoutItemNode.ts +71 -0
  46. package/src/client/components/inputv3/Rte/nodes/MentionNode.ts +130 -0
  47. package/src/client/components/inputv3/Rte/nodes/PageBreakNode/index.css +62 -0
  48. package/src/client/components/inputv3/Rte/nodes/PageBreakNode/index.tsx +170 -0
  49. package/src/client/components/inputv3/Rte/nodes/PlaygroundNodes.ts +76 -0
  50. package/src/client/components/inputv3/Rte/nodes/PollComponent.tsx +249 -0
  51. package/src/client/components/inputv3/Rte/nodes/PollNode.css +187 -0
  52. package/src/client/components/inputv3/Rte/nodes/PollNode.tsx +209 -0
  53. package/src/client/components/inputv3/Rte/nodes/StickyComponent.tsx +261 -0
  54. package/src/client/components/inputv3/Rte/nodes/StickyNode.css +37 -0
  55. package/src/client/components/inputv3/Rte/nodes/StickyNode.tsx +150 -0
  56. package/src/client/components/inputv3/Rte/nodes/TweetNode.tsx +223 -0
  57. package/src/client/components/inputv3/Rte/nodes/YouTubeNode.tsx +184 -0
  58. package/src/client/components/inputv3/Rte/plugins/ActionsPlugin/index.tsx +334 -0
  59. package/src/client/components/inputv3/Rte/plugins/AutoEmbedPlugin/index.tsx +352 -0
  60. package/src/client/components/inputv3/Rte/plugins/AutoLinkPlugin/index.tsx +32 -0
  61. package/src/client/components/inputv3/Rte/plugins/AutocompletePlugin/index.tsx +2529 -0
  62. package/src/client/components/inputv3/Rte/plugins/CodeActionMenuPlugin/components/CopyButton/index.tsx +70 -0
  63. package/src/client/components/inputv3/Rte/plugins/CodeActionMenuPlugin/components/PrettierButton/index.css +14 -0
  64. package/src/client/components/inputv3/Rte/plugins/CodeActionMenuPlugin/components/PrettierButton/index.tsx +156 -0
  65. package/src/client/components/inputv3/Rte/plugins/CodeActionMenuPlugin/index.css +54 -0
  66. package/src/client/components/inputv3/Rte/plugins/CodeActionMenuPlugin/index.tsx +190 -0
  67. package/src/client/components/inputv3/Rte/plugins/CodeActionMenuPlugin/utils.ts +33 -0
  68. package/src/client/components/inputv3/Rte/plugins/CodeHighlightPlugin/index.ts +21 -0
  69. package/src/client/components/inputv3/Rte/plugins/CollapsiblePlugin/Collapsible.css +57 -0
  70. package/src/client/components/inputv3/Rte/plugins/CollapsiblePlugin/CollapsibleContainerNode.ts +168 -0
  71. package/src/client/components/inputv3/Rte/plugins/CollapsiblePlugin/CollapsibleContentNode.ts +127 -0
  72. package/src/client/components/inputv3/Rte/plugins/CollapsiblePlugin/CollapsibleTitleNode.ts +152 -0
  73. package/src/client/components/inputv3/Rte/plugins/CollapsiblePlugin/CollapsibleUtils.ts +17 -0
  74. package/src/client/components/inputv3/Rte/plugins/CollapsiblePlugin/index.ts +284 -0
  75. package/src/client/components/inputv3/Rte/plugins/ComponentPickerPlugin/index.tsx +370 -0
  76. package/src/client/components/inputv3/Rte/plugins/ContextMenuPlugin/index.tsx +270 -0
  77. package/src/client/components/inputv3/Rte/plugins/DocsPlugin/index.tsx +20 -0
  78. package/src/client/components/inputv3/Rte/plugins/DragDropPastePlugin/index.ts +51 -0
  79. package/src/client/components/inputv3/Rte/plugins/DraggableBlockPlugin/index.css +36 -0
  80. package/src/client/components/inputv3/Rte/plugins/DraggableBlockPlugin/index.tsx +43 -0
  81. package/src/client/components/inputv3/Rte/plugins/EmojiPickerPlugin/index.tsx +198 -0
  82. package/src/client/components/inputv3/Rte/plugins/EmojisPlugin/index.ts +75 -0
  83. package/src/client/components/inputv3/Rte/plugins/EquationsPlugin/index.tsx +82 -0
  84. package/src/client/components/inputv3/Rte/plugins/FigmaPlugin/index.tsx +40 -0
  85. package/src/client/components/inputv3/Rte/plugins/FloatingLinkEditorPlugin/index.css +41 -0
  86. package/src/client/components/inputv3/Rte/plugins/FloatingLinkEditorPlugin/index.tsx +393 -0
  87. package/src/client/components/inputv3/Rte/plugins/FloatingTextFormatToolbarPlugin/index.css +141 -0
  88. package/src/client/components/inputv3/Rte/plugins/FloatingTextFormatToolbarPlugin/index.tsx +388 -0
  89. package/src/client/components/inputv3/Rte/plugins/ImagesPlugin/index.tsx +350 -0
  90. package/src/client/components/inputv3/Rte/plugins/InlineImagePlugin/index.tsx +336 -0
  91. package/src/client/components/inputv3/Rte/plugins/KeywordsPlugin/index.ts +56 -0
  92. package/src/client/components/inputv3/Rte/plugins/LayoutPlugin/InsertLayoutDialog.tsx +58 -0
  93. package/src/client/components/inputv3/Rte/plugins/LayoutPlugin/LayoutPlugin.tsx +219 -0
  94. package/src/client/components/inputv3/Rte/plugins/LinkPlugin/index.tsx +34 -0
  95. package/src/client/components/inputv3/Rte/plugins/ListMaxIndentLevelPlugin/index.ts +85 -0
  96. package/src/client/components/inputv3/Rte/plugins/MarkdownShortcutPlugin/index.tsx +16 -0
  97. package/src/client/components/inputv3/Rte/plugins/MarkdownTransformers/index.ts +324 -0
  98. package/src/client/components/inputv3/Rte/plugins/MaxLengthPlugin/index.tsx +53 -0
  99. package/src/client/components/inputv3/Rte/plugins/MentionsPlugin/index.tsx +696 -0
  100. package/src/client/components/inputv3/Rte/plugins/PageBreakPlugin/index.tsx +57 -0
  101. package/src/client/components/inputv3/Rte/plugins/PasteLogPlugin/index.tsx +54 -0
  102. package/src/client/components/inputv3/Rte/plugins/PollPlugin/index.tsx +86 -0
  103. package/src/client/components/inputv3/Rte/plugins/SpeechToTextPlugin/index.ts +125 -0
  104. package/src/client/components/inputv3/Rte/plugins/StickyPlugin/index.ts +22 -0
  105. package/src/client/components/inputv3/Rte/plugins/TabFocusPlugin/index.tsx +65 -0
  106. package/src/client/components/inputv3/Rte/plugins/TableActionMenuPlugin/index.tsx +773 -0
  107. package/src/client/components/inputv3/Rte/plugins/TableCellResizer/index.css +12 -0
  108. package/src/client/components/inputv3/Rte/plugins/TableCellResizer/index.tsx +436 -0
  109. package/src/client/components/inputv3/Rte/plugins/TableHoverActionsPlugin/index.tsx +287 -0
  110. package/src/client/components/inputv3/Rte/plugins/TableOfContentsPlugin/index.css +95 -0
  111. package/src/client/components/inputv3/Rte/plugins/TableOfContentsPlugin/index.tsx +197 -0
  112. package/src/client/components/inputv3/Rte/plugins/TablePlugin.tsx +178 -0
  113. package/src/client/components/inputv3/Rte/plugins/TestRecorderPlugin/index.tsx +468 -0
  114. package/src/client/components/inputv3/Rte/plugins/TreeViewPlugin/index.tsx +26 -0
  115. package/src/client/components/inputv3/Rte/plugins/TwitterPlugin/index.ts +41 -0
  116. package/src/client/components/inputv3/Rte/plugins/TypingPerfPlugin/index.ts +117 -0
  117. package/src/client/components/inputv3/Rte/plugins/YouTubePlugin/index.ts +41 -0
  118. package/src/client/components/inputv3/Rte/shared/canUseDOM.ts +4 -0
  119. package/src/client/components/inputv3/Rte/shared/caretFromPoint.ts +40 -0
  120. package/src/client/components/inputv3/Rte/shared/environment.ts +56 -0
  121. package/src/client/components/inputv3/Rte/shared/invariant.ts +26 -0
  122. package/src/client/components/inputv3/Rte/shared/normalizeClassNames.ts +21 -0
  123. package/src/client/components/inputv3/Rte/shared/react-test-utils.ts +18 -0
  124. package/src/client/components/inputv3/Rte/shared/reactPatches.ts +22 -0
  125. package/src/client/components/inputv3/Rte/shared/simpleDiffWithCursor.ts +49 -0
  126. package/src/client/components/inputv3/Rte/shared/useLayoutEffect.ts +19 -0
  127. package/src/client/components/inputv3/Rte/shared/warnOnlyOnce.ts +20 -0
  128. package/src/client/components/inputv3/Rte/style.less +30 -60
  129. package/src/client/components/inputv3/Rte/themes/CommentEditorTheme.css +13 -0
  130. package/src/client/components/inputv3/Rte/themes/CommentEditorTheme.ts +20 -0
  131. package/src/client/components/inputv3/Rte/themes/PlaygroundEditorTheme.css +447 -0
  132. package/src/client/components/inputv3/Rte/themes/PlaygroundEditorTheme.ts +120 -0
  133. package/src/client/components/inputv3/Rte/themes/StickyEditorTheme.css +13 -0
  134. package/src/client/components/inputv3/Rte/themes/StickyEditorTheme.ts +20 -0
  135. package/src/client/components/inputv3/Rte/ui/ColorPicker.css +88 -0
  136. package/src/client/components/inputv3/Rte/ui/ColorPicker.tsx +365 -0
  137. package/src/client/components/inputv3/Rte/ui/ContentEditable.css +44 -0
  138. package/src/client/components/inputv3/Rte/ui/ContentEditable.tsx +36 -0
  139. package/src/client/components/inputv3/Rte/ui/DropDown.tsx +259 -0
  140. package/src/client/components/inputv3/Rte/ui/DropdownColorPicker.tsx +41 -0
  141. package/src/client/components/inputv3/Rte/ui/EquationEditor.css +38 -0
  142. package/src/client/components/inputv3/Rte/ui/EquationEditor.tsx +56 -0
  143. package/src/client/components/inputv3/Rte/ui/FileInput.tsx +38 -0
  144. package/src/client/components/inputv3/Rte/ui/FlashMessage.css +28 -0
  145. package/src/client/components/inputv3/Rte/ui/FlashMessage.tsx +29 -0
  146. package/src/client/components/inputv3/Rte/ui/ImageResizer.tsx +316 -0
  147. package/src/client/components/inputv3/Rte/ui/Input.css +32 -0
  148. package/src/client/components/inputv3/Rte/ui/KatexRenderer.tsx +54 -0
  149. package/src/client/components/inputv3/Rte/ui/Switch.tsx +36 -0
  150. package/src/client/components/inputv3/Rte/utils/docSerialization.ts +77 -0
  151. package/src/client/components/inputv3/Rte/utils/emoji-list.ts +16615 -0
  152. package/src/client/components/inputv3/Rte/utils/getDOMRangeRect.ts +27 -0
  153. package/src/client/components/inputv3/Rte/utils/getSelectedNode.ts +27 -0
  154. package/src/client/components/inputv3/Rte/utils/guard.ts +10 -0
  155. package/src/client/components/inputv3/Rte/utils/isMobileWidth.ts +7 -0
  156. package/src/client/components/inputv3/Rte/utils/joinClasses.ts +13 -0
  157. package/src/client/components/inputv3/Rte/utils/setFloatingElemPosition.ts +51 -0
  158. package/src/client/components/inputv3/Rte/utils/setFloatingElemPositionForLinkEditor.ts +46 -0
  159. package/src/client/components/inputv3/Rte/utils/swipe.ts +127 -0
  160. package/src/client/components/inputv3/Rte/utils/url.ts +38 -0
  161. package/src/client/components/inputv3/base.tsx +8 -5
  162. package/src/client/components/inputv3/file/index.tsx +11 -5
  163. package/src/common/data/rte/nodes.ts +60 -9
  164. package/src/common/validation/index.ts +21 -2
  165. package/src/common/validation/schema.ts +42 -10
  166. package/src/common/validation/validator.ts +12 -4
  167. package/src/common/validation/validators.ts +82 -53
  168. package/src/server/services/router/http/multipart.ts +0 -1
  169. package/src/server/services/schema/index.ts +24 -2
  170. package/src/server/services/schema/request.ts +3 -2
  171. package/src/server/services/schema/rte.ts +110 -0
  172. package/src/{common/data/rte/index.ts → server/utils/rte.ts} +27 -16
  173. package/src/client/components/inputv3/Rte/ExampleTheme.tsx +0 -42
  174. package/src/client/components/inputv3/Rte/ToolbarPlugin.tsx +0 -167
  175. package/src/client/components/inputv3/Rte/icons/LICENSE.md +0 -5
  176. package/src/client/components/inputv3/Rte/icons/arrow-clockwise.svg +0 -4
  177. package/src/client/components/inputv3/Rte/icons/arrow-counterclockwise.svg +0 -4
  178. package/src/client/components/inputv3/Rte/icons/journal-text.svg +0 -5
  179. package/src/client/components/inputv3/Rte/icons/justify.svg +0 -3
  180. package/src/client/components/inputv3/Rte/icons/text-center.svg +0 -3
  181. package/src/client/components/inputv3/Rte/icons/text-left.svg +0 -3
  182. package/src/client/components/inputv3/Rte/icons/text-paragraph.svg +0 -3
  183. package/src/client/components/inputv3/Rte/icons/text-right.svg +0 -3
  184. package/src/client/components/inputv3/Rte/icons/type-bold.svg +0 -3
  185. package/src/client/components/inputv3/Rte/icons/type-italic.svg +0 -3
  186. package/src/client/components/inputv3/Rte/icons/type-strikethrough.svg +0 -3
  187. package/src/client/components/inputv3/Rte/icons/type-underline.svg +0 -3
@@ -0,0 +1,447 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ *
8
+ */
9
+ .PlaygroundEditorTheme__ltr {
10
+ text-align: left;
11
+ }
12
+ .PlaygroundEditorTheme__rtl {
13
+ text-align: right;
14
+ }
15
+ .PlaygroundEditorTheme__paragraph {
16
+ margin: 0;
17
+ position: relative;
18
+ }
19
+ .PlaygroundEditorTheme__quote {
20
+ margin: 0;
21
+ margin-left: 20px;
22
+ margin-bottom: 10px;
23
+ font-size: 15px;
24
+ color: rgb(101, 103, 107);
25
+ border-left-color: rgb(206, 208, 212);
26
+ border-left-width: 4px;
27
+ border-left-style: solid;
28
+ padding-left: 16px;
29
+ }
30
+ .PlaygroundEditorTheme__h1 {
31
+ font-size: 24px;
32
+ color: rgb(5, 5, 5);
33
+ font-weight: 400;
34
+ margin: 0;
35
+ }
36
+ .PlaygroundEditorTheme__h2 {
37
+ font-size: 15px;
38
+ color: rgb(101, 103, 107);
39
+ font-weight: 700;
40
+ margin: 0;
41
+ text-transform: uppercase;
42
+ }
43
+ .PlaygroundEditorTheme__h3 {
44
+ font-size: 12px;
45
+ margin: 0;
46
+ text-transform: uppercase;
47
+ }
48
+ .PlaygroundEditorTheme__indent {
49
+ --lexical-indent-base-value: 40px;
50
+ }
51
+ .PlaygroundEditorTheme__textBold {
52
+ font-weight: bold;
53
+ }
54
+ .PlaygroundEditorTheme__textItalic {
55
+ font-style: italic;
56
+ }
57
+ .PlaygroundEditorTheme__textUnderline {
58
+ text-decoration: underline;
59
+ }
60
+ .PlaygroundEditorTheme__textStrikethrough {
61
+ text-decoration: line-through;
62
+ }
63
+ .PlaygroundEditorTheme__textUnderlineStrikethrough {
64
+ text-decoration: underline line-through;
65
+ }
66
+ .PlaygroundEditorTheme__textSubscript {
67
+ font-size: 0.8em;
68
+ vertical-align: sub !important;
69
+ }
70
+ .PlaygroundEditorTheme__textSuperscript {
71
+ font-size: 0.8em;
72
+ vertical-align: super;
73
+ }
74
+ .PlaygroundEditorTheme__textCode {
75
+ background-color: rgb(240, 242, 245);
76
+ padding: 1px 0.25rem;
77
+ font-family: Menlo, Consolas, Monaco, monospace;
78
+ font-size: 94%;
79
+ }
80
+ .PlaygroundEditorTheme__hashtag {
81
+ background-color: rgba(88, 144, 255, 0.15);
82
+ border-bottom: 1px solid rgba(88, 144, 255, 0.3);
83
+ }
84
+ .PlaygroundEditorTheme__link {
85
+ color: rgb(33, 111, 219);
86
+ text-decoration: none;
87
+ }
88
+ .PlaygroundEditorTheme__link:hover {
89
+ text-decoration: underline;
90
+ cursor: pointer;
91
+ }
92
+ .PlaygroundEditorTheme__code {
93
+ background-color: rgb(240, 242, 245);
94
+ font-family: Menlo, Consolas, Monaco, monospace;
95
+ display: block;
96
+ padding: 8px 8px 8px 52px;
97
+ line-height: 1.53;
98
+ font-size: 13px;
99
+ margin: 0;
100
+ margin-top: 8px;
101
+ margin-bottom: 8px;
102
+ overflow-x: auto;
103
+ position: relative;
104
+ tab-size: 2;
105
+ }
106
+ .PlaygroundEditorTheme__code:before {
107
+ content: attr(data-gutter);
108
+ position: absolute;
109
+ background-color: #eee;
110
+ left: 0;
111
+ top: 0;
112
+ border-right: 1px solid #ccc;
113
+ padding: 8px;
114
+ color: #777;
115
+ white-space: pre-wrap;
116
+ text-align: right;
117
+ min-width: 25px;
118
+ }
119
+ .PlaygroundEditorTheme__table {
120
+ border-collapse: collapse;
121
+ border-spacing: 0;
122
+ overflow-y: scroll;
123
+ overflow-x: scroll;
124
+ table-layout: fixed;
125
+ width: fit-content;
126
+ margin: 0px 25px 30px 0px;
127
+ }
128
+ .PlaygroundEditorTheme__tableRowStriping tr:nth-child(even) {
129
+ background-color: #f2f5fb;
130
+ }
131
+ .PlaygroundEditorTheme__tableSelection *::selection {
132
+ background-color: transparent;
133
+ }
134
+ .PlaygroundEditorTheme__tableSelected {
135
+ outline: 2px solid rgb(60, 132, 244);
136
+ }
137
+ .PlaygroundEditorTheme__tableCell {
138
+ border: 1px solid #bbb;
139
+ width: 75px;
140
+ vertical-align: top;
141
+ text-align: start;
142
+ padding: 6px 8px;
143
+ position: relative;
144
+ outline: none;
145
+ }
146
+ .PlaygroundEditorTheme__tableCellSortedIndicator {
147
+ display: block;
148
+ opacity: 0.5;
149
+ position: absolute;
150
+ bottom: 0;
151
+ left: 0;
152
+ width: 100%;
153
+ height: 4px;
154
+ background-color: #999;
155
+ }
156
+ .PlaygroundEditorTheme__tableCellResizer {
157
+ position: absolute;
158
+ right: -4px;
159
+ height: 100%;
160
+ width: 8px;
161
+ cursor: ew-resize;
162
+ z-index: 10;
163
+ top: 0;
164
+ }
165
+ .PlaygroundEditorTheme__tableCellHeader {
166
+ background-color: #f2f3f5;
167
+ text-align: start;
168
+ }
169
+ .PlaygroundEditorTheme__tableCellSelected {
170
+ background-color: #c9dbf0;
171
+ }
172
+ .PlaygroundEditorTheme__tableCellPrimarySelected {
173
+ border: 2px solid rgb(60, 132, 244);
174
+ display: block;
175
+ height: calc(100% - 2px);
176
+ position: absolute;
177
+ width: calc(100% - 2px);
178
+ left: -1px;
179
+ top: -1px;
180
+ z-index: 2;
181
+ }
182
+ .PlaygroundEditorTheme__tableCellEditing {
183
+ box-shadow: 0 0 5px rgba(0, 0, 0, 0.4);
184
+ border-radius: 3px;
185
+ }
186
+ .PlaygroundEditorTheme__tableAddColumns {
187
+ position: absolute;
188
+ background-color: #eee;
189
+ height: 100%;
190
+ animation: table-controls 0.2s ease;
191
+ border: 0;
192
+ cursor: pointer;
193
+ }
194
+ .PlaygroundEditorTheme__tableAddColumns:after {
195
+ display: block;
196
+ content: ' ';
197
+ position: absolute;
198
+ top: 0;
199
+ left: 0;
200
+ width: 100%;
201
+ height: 100%;
202
+ opacity: 0.4;
203
+ }
204
+ .PlaygroundEditorTheme__tableAddColumns:hover,
205
+ .PlaygroundEditorTheme__tableAddRows:hover {
206
+ background-color: #c9dbf0;
207
+ }
208
+ .PlaygroundEditorTheme__tableAddRows {
209
+ position: absolute;
210
+ width: calc(100% - 25px);
211
+ background-color: #eee;
212
+ animation: table-controls 0.2s ease;
213
+ border: 0;
214
+ cursor: pointer;
215
+ }
216
+ .PlaygroundEditorTheme__tableAddRows:after {
217
+ display: block;
218
+ content: ' ';
219
+ position: absolute;
220
+ top: 0;
221
+ left: 0;
222
+ width: 100%;
223
+ height: 100%;
224
+ opacity: 0.4;
225
+ }
226
+ @keyframes table-controls {
227
+ 0% {
228
+ opacity: 0;
229
+ }
230
+ 100% {
231
+ opacity: 1;
232
+ }
233
+ }
234
+ .PlaygroundEditorTheme__tableCellResizeRuler {
235
+ display: block;
236
+ position: absolute;
237
+ width: 1px;
238
+ background-color: rgb(60, 132, 244);
239
+ height: 100%;
240
+ top: 0;
241
+ }
242
+ .PlaygroundEditorTheme__tableCellActionButtonContainer {
243
+ display: block;
244
+ right: 5px;
245
+ top: 6px;
246
+ position: absolute;
247
+ z-index: 4;
248
+ width: 20px;
249
+ height: 20px;
250
+ }
251
+ .PlaygroundEditorTheme__tableCellActionButton {
252
+ background-color: #eee;
253
+ display: block;
254
+ border: 0;
255
+ border-radius: 20px;
256
+ width: 20px;
257
+ height: 20px;
258
+ color: #222;
259
+ cursor: pointer;
260
+ }
261
+ .PlaygroundEditorTheme__tableCellActionButton:hover {
262
+ background-color: #ddd;
263
+ }
264
+ .PlaygroundEditorTheme__characterLimit {
265
+ display: inline;
266
+ background-color: #ffbbbb !important;
267
+ }
268
+ .PlaygroundEditorTheme__ol1 {
269
+ padding: 0;
270
+ margin: 0;
271
+ list-style-position: outside;
272
+ }
273
+ .PlaygroundEditorTheme__ol2 {
274
+ padding: 0;
275
+ margin: 0;
276
+ list-style-type: upper-alpha;
277
+ list-style-position: outside;
278
+ }
279
+ .PlaygroundEditorTheme__ol3 {
280
+ padding: 0;
281
+ margin: 0;
282
+ list-style-type: lower-alpha;
283
+ list-style-position: outside;
284
+ }
285
+ .PlaygroundEditorTheme__ol4 {
286
+ padding: 0;
287
+ margin: 0;
288
+ list-style-type: upper-roman;
289
+ list-style-position: outside;
290
+ }
291
+ .PlaygroundEditorTheme__ol5 {
292
+ padding: 0;
293
+ margin: 0;
294
+ list-style-type: lower-roman;
295
+ list-style-position: outside;
296
+ }
297
+ .PlaygroundEditorTheme__ul {
298
+ padding: 0;
299
+ margin: 0;
300
+ list-style-position: outside;
301
+ }
302
+ .PlaygroundEditorTheme__listItem {
303
+ margin: 0 32px;
304
+ }
305
+ .PlaygroundEditorTheme__listItemChecked,
306
+ .PlaygroundEditorTheme__listItemUnchecked {
307
+ position: relative;
308
+ margin-left: 8px;
309
+ margin-right: 8px;
310
+ padding-left: 24px;
311
+ padding-right: 24px;
312
+ list-style-type: none;
313
+ outline: none;
314
+ }
315
+ .PlaygroundEditorTheme__listItemChecked {
316
+ text-decoration: line-through;
317
+ }
318
+ .PlaygroundEditorTheme__listItemUnchecked:before,
319
+ .PlaygroundEditorTheme__listItemChecked:before {
320
+ content: '';
321
+ width: 16px;
322
+ height: 16px;
323
+ top: 2px;
324
+ left: 0;
325
+ cursor: pointer;
326
+ display: block;
327
+ background-size: cover;
328
+ position: absolute;
329
+ }
330
+ .PlaygroundEditorTheme__listItemUnchecked[dir='rtl']:before,
331
+ .PlaygroundEditorTheme__listItemChecked[dir='rtl']:before {
332
+ left: auto;
333
+ right: 0;
334
+ }
335
+ .PlaygroundEditorTheme__listItemUnchecked:focus:before,
336
+ .PlaygroundEditorTheme__listItemChecked:focus:before {
337
+ box-shadow: 0 0 0 2px #a6cdfe;
338
+ border-radius: 2px;
339
+ }
340
+ .PlaygroundEditorTheme__listItemUnchecked:before {
341
+ border: 1px solid #999;
342
+ border-radius: 2px;
343
+ }
344
+ .PlaygroundEditorTheme__listItemChecked:before {
345
+ border: 1px solid rgb(61, 135, 245);
346
+ border-radius: 2px;
347
+ background-color: #3d87f5;
348
+ background-repeat: no-repeat;
349
+ }
350
+ .PlaygroundEditorTheme__listItemChecked:after {
351
+ content: '';
352
+ cursor: pointer;
353
+ border-color: #fff;
354
+ border-style: solid;
355
+ position: absolute;
356
+ display: block;
357
+ top: 6px;
358
+ width: 3px;
359
+ left: 7px;
360
+ right: 7px;
361
+ height: 6px;
362
+ transform: rotate(45deg);
363
+ border-width: 0 2px 2px 0;
364
+ }
365
+ .PlaygroundEditorTheme__nestedListItem {
366
+ list-style-type: none;
367
+ }
368
+ .PlaygroundEditorTheme__nestedListItem:before,
369
+ .PlaygroundEditorTheme__nestedListItem:after {
370
+ display: none;
371
+ }
372
+ .PlaygroundEditorTheme__tokenComment {
373
+ color: slategray;
374
+ }
375
+ .PlaygroundEditorTheme__tokenPunctuation {
376
+ color: #999;
377
+ }
378
+ .PlaygroundEditorTheme__tokenProperty {
379
+ color: #905;
380
+ }
381
+ .PlaygroundEditorTheme__tokenSelector {
382
+ color: #690;
383
+ }
384
+ .PlaygroundEditorTheme__tokenOperator {
385
+ color: #9a6e3a;
386
+ }
387
+ .PlaygroundEditorTheme__tokenAttr {
388
+ color: #07a;
389
+ }
390
+ .PlaygroundEditorTheme__tokenVariable {
391
+ color: #e90;
392
+ }
393
+ .PlaygroundEditorTheme__tokenFunction {
394
+ color: #dd4a68;
395
+ }
396
+ .PlaygroundEditorTheme__mark {
397
+ background: rgba(255, 212, 0, 0.14);
398
+ border-bottom: 2px solid rgba(255, 212, 0, 0.3);
399
+ padding-bottom: 2px;
400
+ }
401
+ .PlaygroundEditorTheme__markOverlap {
402
+ background: rgba(255, 212, 0, 0.3);
403
+ border-bottom: 2px solid rgba(255, 212, 0, 0.7);
404
+ }
405
+ .PlaygroundEditorTheme__mark.selected {
406
+ background: rgba(255, 212, 0, 0.5);
407
+ border-bottom: 2px solid rgba(255, 212, 0, 1);
408
+ }
409
+ .PlaygroundEditorTheme__markOverlap.selected {
410
+ background: rgba(255, 212, 0, 0.7);
411
+ border-bottom: 2px solid rgba(255, 212, 0, 0.7);
412
+ }
413
+ .PlaygroundEditorTheme__embedBlock {
414
+ user-select: none;
415
+ }
416
+ .PlaygroundEditorTheme__embedBlockFocus {
417
+ outline: 2px solid rgb(60, 132, 244);
418
+ }
419
+ .PlaygroundEditorTheme__layoutContainer {
420
+ display: grid;
421
+ gap: 10px;
422
+ margin: 10px 0;
423
+ }
424
+ .PlaygroundEditorTheme__layoutItem {
425
+ border: 1px dashed #ddd;
426
+ padding: 8px 16px;
427
+ }
428
+ .PlaygroundEditorTheme__autocomplete {
429
+ color: #ccc;
430
+ }
431
+ .PlaygroundEditorTheme__hr {
432
+ padding: 2px 2px;
433
+ border: none;
434
+ margin: 1em 0;
435
+ cursor: pointer;
436
+ }
437
+ .PlaygroundEditorTheme__hr:after {
438
+ content: '';
439
+ display: block;
440
+ height: 2px;
441
+ background-color: #ccc;
442
+ line-height: 2px;
443
+ }
444
+ .PlaygroundEditorTheme__hr.selected {
445
+ outline: 2px solid rgb(60, 132, 244);
446
+ user-select: none;
447
+ }
@@ -0,0 +1,120 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+
9
+ import type { EditorThemeClasses } from 'lexical';
10
+
11
+ import './PlaygroundEditorTheme.css';
12
+
13
+ const theme: EditorThemeClasses = {
14
+ autocomplete: 'PlaygroundEditorTheme__autocomplete',
15
+ blockCursor: 'PlaygroundEditorTheme__blockCursor',
16
+ characterLimit: 'PlaygroundEditorTheme__characterLimit',
17
+ code: 'PlaygroundEditorTheme__code',
18
+ codeHighlight: {
19
+ atrule: 'PlaygroundEditorTheme__tokenAttr',
20
+ attr: 'PlaygroundEditorTheme__tokenAttr',
21
+ boolean: 'PlaygroundEditorTheme__tokenProperty',
22
+ builtin: 'PlaygroundEditorTheme__tokenSelector',
23
+ cdata: 'PlaygroundEditorTheme__tokenComment',
24
+ char: 'PlaygroundEditorTheme__tokenSelector',
25
+ class: 'PlaygroundEditorTheme__tokenFunction',
26
+ 'class-name': 'PlaygroundEditorTheme__tokenFunction',
27
+ comment: 'PlaygroundEditorTheme__tokenComment',
28
+ constant: 'PlaygroundEditorTheme__tokenProperty',
29
+ deleted: 'PlaygroundEditorTheme__tokenProperty',
30
+ doctype: 'PlaygroundEditorTheme__tokenComment',
31
+ entity: 'PlaygroundEditorTheme__tokenOperator',
32
+ function: 'PlaygroundEditorTheme__tokenFunction',
33
+ important: 'PlaygroundEditorTheme__tokenVariable',
34
+ inserted: 'PlaygroundEditorTheme__tokenSelector',
35
+ keyword: 'PlaygroundEditorTheme__tokenAttr',
36
+ namespace: 'PlaygroundEditorTheme__tokenVariable',
37
+ number: 'PlaygroundEditorTheme__tokenProperty',
38
+ operator: 'PlaygroundEditorTheme__tokenOperator',
39
+ prolog: 'PlaygroundEditorTheme__tokenComment',
40
+ property: 'PlaygroundEditorTheme__tokenProperty',
41
+ punctuation: 'PlaygroundEditorTheme__tokenPunctuation',
42
+ regex: 'PlaygroundEditorTheme__tokenVariable',
43
+ selector: 'PlaygroundEditorTheme__tokenSelector',
44
+ string: 'PlaygroundEditorTheme__tokenSelector',
45
+ symbol: 'PlaygroundEditorTheme__tokenProperty',
46
+ tag: 'PlaygroundEditorTheme__tokenProperty',
47
+ url: 'PlaygroundEditorTheme__tokenOperator',
48
+ variable: 'PlaygroundEditorTheme__tokenVariable',
49
+ },
50
+ embedBlock: {
51
+ base: 'PlaygroundEditorTheme__embedBlock',
52
+ focus: 'PlaygroundEditorTheme__embedBlockFocus',
53
+ },
54
+ hashtag: 'PlaygroundEditorTheme__hashtag',
55
+ heading: {
56
+ h1: 'PlaygroundEditorTheme__h1',
57
+ h2: 'PlaygroundEditorTheme__h2',
58
+ h3: 'PlaygroundEditorTheme__h3',
59
+ h4: 'PlaygroundEditorTheme__h4',
60
+ h5: 'PlaygroundEditorTheme__h5',
61
+ h6: 'PlaygroundEditorTheme__h6',
62
+ },
63
+ hr: 'PlaygroundEditorTheme__hr',
64
+ image: 'editor-image',
65
+ indent: 'PlaygroundEditorTheme__indent',
66
+ inlineImage: 'inline-editor-image',
67
+ layoutContainer: 'PlaygroundEditorTheme__layoutContainer',
68
+ layoutItem: 'PlaygroundEditorTheme__layoutItem',
69
+ link: 'PlaygroundEditorTheme__link',
70
+ list: {
71
+ checklist: 'PlaygroundEditorTheme__checklist',
72
+ listitem: '',
73
+ listitemChecked: 'PlaygroundEditorTheme__listItemChecked',
74
+ listitemUnchecked: 'PlaygroundEditorTheme__listItemUnchecked',
75
+ nested: {
76
+ listitem: 'PlaygroundEditorTheme__nestedListItem',
77
+ },
78
+ olDepth: [
79
+ 'PlaygroundEditorTheme__ol1',
80
+ 'PlaygroundEditorTheme__ol2',
81
+ 'PlaygroundEditorTheme__ol3',
82
+ 'PlaygroundEditorTheme__ol4',
83
+ 'PlaygroundEditorTheme__ol5',
84
+ ],
85
+ ul: 'liste',
86
+ },
87
+ ltr: 'PlaygroundEditorTheme__ltr',
88
+ mark: 'PlaygroundEditorTheme__mark',
89
+ markOverlap: 'PlaygroundEditorTheme__markOverlap',
90
+ paragraph: 'PlaygroundEditorTheme__paragraph',
91
+ quote: 'PlaygroundEditorTheme__quote',
92
+ rtl: 'PlaygroundEditorTheme__rtl',
93
+ table: 'PlaygroundEditorTheme__table',
94
+ tableCell: 'PlaygroundEditorTheme__tableCell',
95
+ tableCellActionButton: 'PlaygroundEditorTheme__tableCellActionButton',
96
+ tableCellActionButtonContainer:
97
+ 'PlaygroundEditorTheme__tableCellActionButtonContainer',
98
+ tableCellEditing: 'PlaygroundEditorTheme__tableCellEditing',
99
+ tableCellHeader: 'PlaygroundEditorTheme__tableCellHeader',
100
+ tableCellPrimarySelected: 'PlaygroundEditorTheme__tableCellPrimarySelected',
101
+ tableCellResizer: 'PlaygroundEditorTheme__tableCellResizer',
102
+ tableCellSelected: 'PlaygroundEditorTheme__tableCellSelected',
103
+ tableCellSortedIndicator: 'PlaygroundEditorTheme__tableCellSortedIndicator',
104
+ tableResizeRuler: 'PlaygroundEditorTheme__tableCellResizeRuler',
105
+ tableRowStriping: 'PlaygroundEditorTheme__tableRowStriping',
106
+ tableSelected: 'PlaygroundEditorTheme__tableSelected',
107
+ tableSelection: 'PlaygroundEditorTheme__tableSelection',
108
+ text: {
109
+ bold: 'PlaygroundEditorTheme__textBold',
110
+ code: 'PlaygroundEditorTheme__textCode',
111
+ italic: 'PlaygroundEditorTheme__textItalic',
112
+ strikethrough: 'PlaygroundEditorTheme__textStrikethrough',
113
+ subscript: 'PlaygroundEditorTheme__textSubscript',
114
+ superscript: 'PlaygroundEditorTheme__textSuperscript',
115
+ underline: 'PlaygroundEditorTheme__textUnderline',
116
+ underlineStrikethrough: 'PlaygroundEditorTheme__textUnderlineStrikethrough',
117
+ },
118
+ };
119
+
120
+ export default theme;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ *
8
+ */
9
+
10
+ .StickyEditorTheme__paragraph {
11
+ margin: 0;
12
+ position: 'relative';
13
+ }
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+
9
+ import type {EditorThemeClasses} from 'lexical';
10
+
11
+ import './StickyEditorTheme.css';
12
+
13
+ import baseTheme from './PlaygroundEditorTheme';
14
+
15
+ const theme: EditorThemeClasses = {
16
+ ...baseTheme,
17
+ paragraph: 'StickyEditorTheme__paragraph',
18
+ };
19
+
20
+ export default theme;
@@ -0,0 +1,88 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+
9
+ .color-picker-wrapper {
10
+ padding: 20px;
11
+ }
12
+
13
+ .color-picker-basic-color {
14
+ display: flex;
15
+ flex-wrap: wrap;
16
+ gap: 10px;
17
+ margin: 0;
18
+ padding: 0;
19
+ }
20
+
21
+ .color-picker-basic-color button {
22
+ border: 1px solid #ccc;
23
+ border-radius: 4px;
24
+ height: 16px;
25
+ width: 16px;
26
+ cursor: pointer;
27
+ list-style-type: none;
28
+ }
29
+
30
+ .color-picker-basic-color button.active {
31
+ box-shadow: 0px 0px 2px 2px rgba(0, 0, 0, 0.3);
32
+ }
33
+
34
+ .color-picker-saturation {
35
+ width: 100%;
36
+ position: relative;
37
+ margin-top: 15px;
38
+ height: 150px;
39
+ background-image: linear-gradient(transparent, black),
40
+ linear-gradient(to right, white, transparent);
41
+ user-select: none;
42
+ }
43
+ .color-picker-saturation_cursor {
44
+ position: absolute;
45
+ width: 20px;
46
+ height: 20px;
47
+ border: 2px solid #ffffff;
48
+ border-radius: 50%;
49
+ box-shadow: 0 0 15px #00000026;
50
+ box-sizing: border-box;
51
+ transform: translate(-10px, -10px);
52
+ }
53
+ .color-picker-hue {
54
+ width: 100%;
55
+ position: relative;
56
+ margin-top: 15px;
57
+ height: 12px;
58
+ background-image: linear-gradient(
59
+ to right,
60
+ rgb(255, 0, 0),
61
+ rgb(255, 255, 0),
62
+ rgb(0, 255, 0),
63
+ rgb(0, 255, 255),
64
+ rgb(0, 0, 255),
65
+ rgb(255, 0, 255),
66
+ rgb(255, 0, 0)
67
+ );
68
+ user-select: none;
69
+ border-radius: 12px;
70
+ }
71
+
72
+ .color-picker-hue_cursor {
73
+ position: absolute;
74
+ width: 20px;
75
+ height: 20px;
76
+ border: 2px solid #ffffff;
77
+ border-radius: 50%;
78
+ box-shadow: #0003 0 0 0 0.5px;
79
+ box-sizing: border-box;
80
+ transform: translate(-10px, -4px);
81
+ }
82
+
83
+ .color-picker-color {
84
+ border: 1px solid #ccc;
85
+ margin-top: 15px;
86
+ width: 100%;
87
+ height: 20px;
88
+ }