@thangph2146/lexical-editor 0.0.4 → 0.0.5
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/editor-x/editor.cjs +721 -432
- package/dist/editor-x/editor.cjs.map +1 -1
- package/dist/editor-x/editor.css +1418 -1120
- package/dist/editor-x/editor.css.map +1 -1
- package/dist/editor-x/editor.js +725 -436
- package/dist/editor-x/editor.js.map +1 -1
- package/dist/index.cjs +757 -469
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1418 -1120
- package/dist/index.css.map +1 -1
- package/dist/index.js +760 -472
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/lexical-editor.tsx +138 -123
- package/src/editor-x/editor.tsx +16 -3
- package/src/editor-x/plugins.tsx +385 -380
- package/src/nodes/list-with-color-node.tsx +160 -160
- package/src/plugins/autocomplete-plugin.tsx +2574 -2574
- package/src/plugins/context-menu-plugin.tsx +239 -9
- package/src/plugins/floating-text-format-plugin.tsx +84 -92
- package/src/plugins/images-plugin.tsx +4 -4
- package/src/plugins/list-color-plugin.tsx +178 -178
- package/src/plugins/tab-focus-plugin.tsx +66 -66
- package/src/plugins/table-column-resizer-plugin.tsx +329 -190
- package/src/plugins/toolbar/block-format/block-format-data.tsx +4 -0
- package/src/plugins/toolbar/block-format/format-bulleted-list.tsx +40 -40
- package/src/plugins/toolbar/block-format/format-list-with-marker.tsx +74 -74
- package/src/plugins/toolbar/block-format/format-numbered-list.tsx +40 -40
- package/src/plugins/toolbar/block-format-toolbar-plugin.tsx +118 -117
- package/src/plugins/toolbar/element-format-toolbar-plugin.tsx +37 -53
- package/src/plugins/toolbar/font-format-toolbar-plugin.tsx +8 -15
- package/src/plugins/toolbar/font-size-toolbar-plugin.tsx +2 -3
- package/src/plugins/toolbar/history-toolbar-plugin.tsx +2 -5
- package/src/plugins/toolbar/subsuper-toolbar-plugin.tsx +15 -23
- package/src/themes/_mixins.scss +158 -10
- package/src/themes/_variables.scss +168 -0
- package/src/themes/core/_code.scss +59 -0
- package/src/themes/core/_images.scss +80 -0
- package/src/themes/core/_lists.scss +214 -0
- package/src/themes/core/_misc.scss +46 -0
- package/src/themes/core/_reset.scss +119 -0
- package/src/themes/core/_tables.scss +145 -0
- package/src/themes/core/_text.scss +35 -0
- package/src/themes/core/_typography.scss +73 -0
- package/src/themes/editor-theme copy.scss +763 -0
- package/src/themes/editor-theme.scss +9 -623
- package/src/themes/editor-theme.ts +118 -118
- package/src/themes/plugins/_auto-embed.scss +11 -0
- package/src/themes/plugins/_color-picker.scss +103 -0
- package/src/themes/plugins/_draggable-block.scss +32 -0
- package/src/themes/plugins/_floating-link-editor.scss +47 -0
- package/src/themes/plugins/_floating-toolbars.scss +61 -0
- package/src/themes/plugins/_image-resizer.scss +38 -0
- package/src/themes/plugins/_image.scss +57 -0
- package/src/themes/plugins/_layout.scss +39 -0
- package/src/themes/plugins/_list-color.scss +23 -0
- package/src/themes/plugins/_mentions.scss +21 -0
- package/src/themes/plugins/_menus-and-pickers.scss +153 -0
- package/src/themes/plugins/_table.scss +20 -0
- package/src/themes/plugins/_toolbar.scss +36 -0
- package/src/themes/plugins/_tree-view.scss +11 -0
- package/src/themes/plugins copy.scss +656 -0
- package/src/themes/plugins.scss +20 -1165
- package/src/themes/ui-components/_animations.scss +31 -0
- package/src/themes/ui-components/_backgrounds.scss +27 -0
- package/src/themes/ui-components/_borders.scss +20 -0
- package/src/themes/ui-components/_button.scss +176 -0
- package/src/themes/ui-components/_checkbox.scss +14 -0
- package/src/themes/ui-components/_cursors.scss +31 -0
- package/src/themes/ui-components/_dialog.scss +86 -0
- package/src/themes/ui-components/_display-sizing.scss +100 -0
- package/src/themes/ui-components/_flex.scss +124 -0
- package/src/themes/ui-components/_form-layout.scss +15 -0
- package/src/themes/ui-components/_icons.scss +23 -0
- package/src/themes/ui-components/_input.scss +86 -0
- package/src/themes/ui-components/_label.scss +19 -0
- package/src/themes/ui-components/_loader.scss +9 -0
- package/src/themes/ui-components/_margins-paddings.scss +45 -0
- package/src/themes/ui-components/_popover.scss +16 -0
- package/src/themes/ui-components/_positioning.scss +73 -0
- package/src/themes/ui-components/_rounded.scss +19 -0
- package/src/themes/ui-components/_scroll-area.scss +11 -0
- package/src/themes/ui-components/_select.scss +110 -0
- package/src/themes/ui-components/_separator.scss +19 -0
- package/src/themes/ui-components/_shadow.scss +15 -0
- package/src/themes/ui-components/_tabs.scss +46 -0
- package/src/themes/ui-components/_text-utilities.scss +48 -0
- package/src/themes/ui-components/_toggle-toolbar.scss +128 -0
- package/src/themes/ui-components/_toggle.scss +80 -0
- package/src/themes/ui-components/_typography.scss +22 -0
- package/src/themes/ui-components copy.scss +1335 -0
- package/src/themes/ui-components.scss +27 -937
- package/src/transformers/markdown-list-transformer.ts +51 -51
- package/src/ui/button.tsx +11 -2
- package/src/ui/collapsible.tsx +1 -1
- package/src/ui/dialog.tsx +2 -2
- package/src/ui/flex.tsx +4 -4
- package/src/ui/popover.tsx +1 -1
- package/src/ui/tooltip.tsx +2 -2
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
@use "../variables" as *;
|
|
2
|
+
@use "../mixins" as *;
|
|
3
|
+
|
|
4
|
+
.lexical-editor-root {
|
|
5
|
+
// Images
|
|
6
|
+
.editor-image {
|
|
7
|
+
display: inline-block;
|
|
8
|
+
position: relative;
|
|
9
|
+
cursor: default;
|
|
10
|
+
user-select: none;
|
|
11
|
+
|
|
12
|
+
img {
|
|
13
|
+
max-width: 100%;
|
|
14
|
+
height: auto;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.editor-inline-image {
|
|
19
|
+
display: inline-block;
|
|
20
|
+
position: relative;
|
|
21
|
+
z-index: $editor-z-index-layer-1;
|
|
22
|
+
|
|
23
|
+
img {
|
|
24
|
+
max-width: 100%;
|
|
25
|
+
height: auto;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.editor-image-focused {
|
|
30
|
+
outline: $editor-outline-width solid $editor-primary-color;
|
|
31
|
+
outline-offset: calc($editor-gap-1 / 2);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.editor-image-draggable {
|
|
35
|
+
cursor: grab;
|
|
36
|
+
|
|
37
|
+
&:active {
|
|
38
|
+
cursor: grabbing;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.editor-image-caption {
|
|
43
|
+
display: block;
|
|
44
|
+
min-width: $editor-image-caption-min-width;
|
|
45
|
+
overflow: hidden;
|
|
46
|
+
padding: 0;
|
|
47
|
+
margin-top: $editor-gap-2;
|
|
48
|
+
|
|
49
|
+
&.editable {
|
|
50
|
+
border: $editor-border-width solid $editor-border-color;
|
|
51
|
+
border-radius: $editor-border-radius;
|
|
52
|
+
background-color: $editor-image-caption-bg;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&.readonly {
|
|
56
|
+
border: 0;
|
|
57
|
+
background-color: transparent;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.editor-lazy-image-wrapper {
|
|
62
|
+
display: inline-block;
|
|
63
|
+
|
|
64
|
+
&.full-width {
|
|
65
|
+
width: 100%;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Broken Image
|
|
70
|
+
.editor-broken-image-container {
|
|
71
|
+
display: inline-block;
|
|
72
|
+
width: $editor-image-broken-size;
|
|
73
|
+
height: $editor-image-broken-size;
|
|
74
|
+
|
|
75
|
+
img {
|
|
76
|
+
opacity: 0.2;
|
|
77
|
+
object-fit: contain;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
@use "../variables" as *;
|
|
2
|
+
@use "../mixins" as *;
|
|
3
|
+
|
|
4
|
+
.lexical-editor-root {
|
|
5
|
+
// Ordered Lists
|
|
6
|
+
.editor-ol {
|
|
7
|
+
list-style-type: decimal !important;
|
|
8
|
+
padding-left: $editor-list-padding-left !important;
|
|
9
|
+
margin-top: $editor-list-margin-vertical !important;
|
|
10
|
+
margin-bottom: $editor-list-margin-vertical !important;
|
|
11
|
+
|
|
12
|
+
&[data-list-marker="alpha"] {
|
|
13
|
+
list-style-type: lower-alpha !important;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&[data-list-marker]:not([data-list-marker="alpha"]):not([data-list-marker="multi-level"]) {
|
|
17
|
+
list-style-type: none !important;
|
|
18
|
+
> li:not(.editor-nested-listitem)::marker {
|
|
19
|
+
content: attr(data-list-marker) !important;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&[data-list-marker="multi-level"] {
|
|
24
|
+
list-style-type: none !important;
|
|
25
|
+
counter-reset: item;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&[data-list-marker="multi-level"] > li {
|
|
29
|
+
counter-increment: item;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&[data-list-marker="multi-level"] > li.editor-nested-listitem {
|
|
33
|
+
counter-increment: none !important;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&[data-list-marker="multi-level"] > li:not(.editor-nested-listitem)::marker {
|
|
37
|
+
content: counters(item, ".") ". " !important;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&[data-list-marker="multi-level"] .editor-ol {
|
|
41
|
+
list-style-type: none !important;
|
|
42
|
+
counter-reset: item;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&[data-list-marker="multi-level"] .editor-ol > li {
|
|
46
|
+
counter-increment: item;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&[data-list-marker="multi-level"] .editor-ol > li.editor-nested-listitem {
|
|
50
|
+
counter-increment: none !important;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&[data-list-marker="multi-level"] .editor-ol > li:not(.editor-nested-listitem)::marker {
|
|
54
|
+
content: counters(item, ".") ". " !important;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&[data-list-color] {
|
|
58
|
+
li::marker { color: var(--list-marker-color, currentColor) !important; }
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Unordered Lists
|
|
63
|
+
.editor-ul:not(.editor-checklist) {
|
|
64
|
+
padding-left: $editor-list-padding-left !important;
|
|
65
|
+
margin-top: $editor-list-margin-vertical !important;
|
|
66
|
+
margin-bottom: $editor-list-margin-vertical !important;
|
|
67
|
+
|
|
68
|
+
&:not([data-list-marker]) {
|
|
69
|
+
list-style-type: disc !important;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&[data-list-marker="-"] {
|
|
73
|
+
list-style-type: none !important;
|
|
74
|
+
> li:not(.editor-nested-listitem)::marker { content: "- " !important; }
|
|
75
|
+
}
|
|
76
|
+
&[data-list-marker="+"] {
|
|
77
|
+
list-style-type: none !important;
|
|
78
|
+
> li:not(.editor-nested-listitem)::marker { content: "+ " !important; }
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&[data-list-marker]:not([data-list-marker="-"]):not([data-list-marker="+"]) {
|
|
82
|
+
list-style-type: none !important;
|
|
83
|
+
> li:not(.editor-nested-listitem)::marker {
|
|
84
|
+
content: attr(data-list-marker) !important;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
&[data-list-color] {
|
|
89
|
+
li::marker { color: var(--list-marker-color, currentColor) !important; }
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.editor-listitem {
|
|
94
|
+
margin-bottom: $editor-list-item-margin-bottom !important;
|
|
95
|
+
line-height: $editor-line-height-relaxed !important;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// Checklists
|
|
99
|
+
.editor-checklist {
|
|
100
|
+
list-style: none !important;
|
|
101
|
+
padding: 0 !important;
|
|
102
|
+
margin-top: $editor-list-margin-vertical !important;
|
|
103
|
+
margin-bottom: $editor-list-margin-vertical !important;
|
|
104
|
+
margin-left: 0 !important;
|
|
105
|
+
margin-right: 0 !important;
|
|
106
|
+
outline: none !important;
|
|
107
|
+
box-shadow: none !important;
|
|
108
|
+
|
|
109
|
+
.editor-listitem-checked,
|
|
110
|
+
.editor-listitem-unchecked {
|
|
111
|
+
@include flex-center;
|
|
112
|
+
align-items: flex-start;
|
|
113
|
+
margin-left: 0;
|
|
114
|
+
padding: $editor-checklist-item-padding-vertical 0;
|
|
115
|
+
list-style: none;
|
|
116
|
+
outline: none;
|
|
117
|
+
gap: $editor-checklist-gap;
|
|
118
|
+
|
|
119
|
+
&::before {
|
|
120
|
+
content: "";
|
|
121
|
+
@include control-size($editor-checklist-icon-size);
|
|
122
|
+
flex-shrink: 0;
|
|
123
|
+
margin-top: $editor-checklist-icon-margin-top;
|
|
124
|
+
cursor: pointer;
|
|
125
|
+
display: block;
|
|
126
|
+
border: $editor-border-width-thick solid var(--list-marker-color, #{$editor-link-color}) !important;
|
|
127
|
+
border-radius: $editor-checklist-icon-border-radius;
|
|
128
|
+
box-sizing: border-box;
|
|
129
|
+
transition: all $editor-transition-fast;
|
|
130
|
+
background-position: center;
|
|
131
|
+
background-repeat: no-repeat;
|
|
132
|
+
background-size: $editor-checklist-icon-checkmark-size;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.editor-listitem-checked {
|
|
137
|
+
text-decoration: line-through;
|
|
138
|
+
color: $editor-muted-foreground-color;
|
|
139
|
+
|
|
140
|
+
&::before {
|
|
141
|
+
background-color: var(--list-marker-color, #{$editor-link-color}) !important;
|
|
142
|
+
border-color: var(--list-marker-color, #{$editor-link-color}) !important;
|
|
143
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M3 7.5L5.5 10L11 4.5'/%3E%3C/svg%3E");
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
&::after {
|
|
147
|
+
display: none;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.editor-nested-listitem {
|
|
153
|
+
list-style: none;
|
|
154
|
+
&::before, &::after { display: none; }
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// List Depths
|
|
158
|
+
$list-styles: (
|
|
159
|
+
1: decimal,
|
|
160
|
+
2: upper-roman,
|
|
161
|
+
3: lower-roman,
|
|
162
|
+
4: upper-alpha,
|
|
163
|
+
5: lower-alpha
|
|
164
|
+
);
|
|
165
|
+
|
|
166
|
+
@each $depth, $style in $list-styles {
|
|
167
|
+
.editor-ol-depth-#{$depth} {
|
|
168
|
+
list-style-type: $style !important;
|
|
169
|
+
|
|
170
|
+
&[data-list-marker]:not([data-list-marker="alpha"]):not([data-list-marker="multi-level"]) {
|
|
171
|
+
list-style-type: none !important;
|
|
172
|
+
> li:not(.editor-nested-listitem)::marker {
|
|
173
|
+
content: attr(data-list-marker) !important;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
&[data-list-marker="multi-level"] {
|
|
178
|
+
list-style-type: none !important;
|
|
179
|
+
counter-reset: item;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
&[data-list-marker="multi-level"] > li {
|
|
183
|
+
counter-increment: item;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
&[data-list-marker="multi-level"] > li.editor-nested-listitem {
|
|
187
|
+
counter-increment: none !important;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
&[data-list-marker="multi-level"] > li:not(.editor-nested-listitem)::marker {
|
|
191
|
+
content: counters(item, ".") ". " !important;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
.editor-ul-depth-#{$depth}:not(.editor-checklist) {
|
|
195
|
+
&[data-list-marker="-"] {
|
|
196
|
+
list-style-type: none !important;
|
|
197
|
+
> li:not(.editor-nested-listitem)::marker { content: "- " !important; }
|
|
198
|
+
}
|
|
199
|
+
&[data-list-marker="+"] {
|
|
200
|
+
list-style-type: none !important;
|
|
201
|
+
> li:not(.editor-nested-listitem)::marker { content: "+ " !important; }
|
|
202
|
+
}
|
|
203
|
+
&[data-list-marker]:not([data-list-marker="-"]):not([data-list-marker="+"]) {
|
|
204
|
+
list-style-type: none !important;
|
|
205
|
+
> li:not(.editor-nested-listitem)::marker {
|
|
206
|
+
content: attr(data-list-marker) !important;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
&:not([data-list-marker]) {
|
|
210
|
+
list-style-type: disc !important;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
@use "../variables" as *;
|
|
2
|
+
@use "../mixins" as *;
|
|
3
|
+
|
|
4
|
+
.lexical-editor-root {
|
|
5
|
+
// Tweet
|
|
6
|
+
.editor-tweet-container {
|
|
7
|
+
display: block;
|
|
8
|
+
width: 100%;
|
|
9
|
+
max-width: $editor-tweet-max-width;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// Horizontal Rule
|
|
13
|
+
.editor-hr {
|
|
14
|
+
padding: calc($editor-gap-1 / 2);
|
|
15
|
+
border: none;
|
|
16
|
+
margin: $editor-hr-margin-vertical 0;
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
|
|
19
|
+
&:after {
|
|
20
|
+
content: "";
|
|
21
|
+
display: block;
|
|
22
|
+
height: $editor-hr-height;
|
|
23
|
+
background-color: $editor-border-color;
|
|
24
|
+
line-height: $editor-hr-height;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&.selected {
|
|
28
|
+
outline: $editor-outline-width solid $editor-primary-color;
|
|
29
|
+
user-select: none;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Embed Block
|
|
34
|
+
.editor-embed-block {
|
|
35
|
+
user-select: none;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.editor-embed-block-focused {
|
|
39
|
+
outline: $editor-outline-width solid $editor-primary-color;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Autocomplete
|
|
43
|
+
.editor-autocomplete {
|
|
44
|
+
color: $editor-muted-foreground-color;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
@use "../variables" as *;
|
|
2
|
+
@use "../mixins" as *;
|
|
3
|
+
|
|
4
|
+
// Editor Root Container
|
|
5
|
+
.editor-root-container {
|
|
6
|
+
border-radius: $editor-border-radius;
|
|
7
|
+
transition: all $editor-transition-normal;
|
|
8
|
+
|
|
9
|
+
&.editor-root-container--shadow:focus-within {
|
|
10
|
+
box-shadow: 0 0 0 $editor-border-width $editor-border-color, 0 0 0 $editor-border-width + $editor-outline-width var(--ring, rgba(59, 130, 246, 0.5));
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// Lexical Editor Root
|
|
15
|
+
.lexical-editor-root {
|
|
16
|
+
font-family: $editor-font-family !important;
|
|
17
|
+
font-size: $editor-font-size-base;
|
|
18
|
+
color: $editor-text-color !important;
|
|
19
|
+
background-color: $editor-bg-color !important;
|
|
20
|
+
position: relative !important;
|
|
21
|
+
width: 100% !important;
|
|
22
|
+
margin: 0 !important;
|
|
23
|
+
padding: 0 !important;
|
|
24
|
+
text-align: left !important;
|
|
25
|
+
box-sizing: border-box !important;
|
|
26
|
+
|
|
27
|
+
// Reset common elements
|
|
28
|
+
*, *::before, *::after {
|
|
29
|
+
box-sizing: border-box;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
p, ul, ol, li, span, strong, em, b, i, blockquote, h1, h2, h3, h4, h5, h6 {
|
|
33
|
+
margin: 0 !important;
|
|
34
|
+
padding: 0;
|
|
35
|
+
border: 0 !important;
|
|
36
|
+
font-size: 100%;
|
|
37
|
+
vertical-align: baseline !important;
|
|
38
|
+
-webkit-font-smoothing: antialiased !important;
|
|
39
|
+
-moz-osx-osx-font-smoothing: grayscale !important;
|
|
40
|
+
letter-spacing: normal !important;
|
|
41
|
+
word-spacing: normal !important;
|
|
42
|
+
text-indent: 0 !important;
|
|
43
|
+
text-transform: none !important;
|
|
44
|
+
text-decoration: none !important;
|
|
45
|
+
line-height: inherit;
|
|
46
|
+
text-align: inherit;
|
|
47
|
+
white-space: inherit !important;
|
|
48
|
+
word-break: normal !important;
|
|
49
|
+
word-wrap: normal !important;
|
|
50
|
+
overflow-wrap: normal !important;
|
|
51
|
+
margin-inline-start: 0 !important;
|
|
52
|
+
margin-inline-end: 0 !important;
|
|
53
|
+
padding-inline-start: 0;
|
|
54
|
+
padding-inline-end: 0;
|
|
55
|
+
margin-block-start: 0 !important;
|
|
56
|
+
margin-block-end: 0 !important;
|
|
57
|
+
-webkit-tap-highlight-color: transparent !important;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
ul, ol {
|
|
61
|
+
list-style-position: outside !important;
|
|
62
|
+
list-style-type: none !important;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
li {
|
|
66
|
+
margin: 0;
|
|
67
|
+
padding: 0;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
span[data-lexical-text="true"] {
|
|
71
|
+
display: inline !important;
|
|
72
|
+
white-space: pre-wrap !important;
|
|
73
|
+
word-break: break-word !important;
|
|
74
|
+
margin: 0 !important;
|
|
75
|
+
padding: 0 !important;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Content Editable
|
|
80
|
+
.editor-content-editable {
|
|
81
|
+
position: relative !important;
|
|
82
|
+
display: block !important;
|
|
83
|
+
outline: none !important;
|
|
84
|
+
|
|
85
|
+
&:not(&--readonly):not(&--review) {
|
|
86
|
+
min-height: $editor-content-min-height !important;
|
|
87
|
+
padding: $editor-content-padding-y $editor-content-padding-x !important;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&:focus {
|
|
91
|
+
outline: none !important;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&--readonly,
|
|
95
|
+
&--review {
|
|
96
|
+
cursor: default !important;
|
|
97
|
+
user-select: text !important;
|
|
98
|
+
min-height: unset !important;
|
|
99
|
+
padding: 0 !important;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// Placeholder
|
|
104
|
+
.editor-placeholder {
|
|
105
|
+
color: var(--muted-foreground) !important;
|
|
106
|
+
pointer-events: none !important;
|
|
107
|
+
position: absolute !important;
|
|
108
|
+
top: 0 !important;
|
|
109
|
+
left: 0 !important;
|
|
110
|
+
overflow: hidden !important;
|
|
111
|
+
padding: $editor-placeholder-padding-y $editor-content-padding-x !important;
|
|
112
|
+
text-overflow: ellipsis !important;
|
|
113
|
+
user-select: none !important;
|
|
114
|
+
|
|
115
|
+
.editor-content-editable--readonly + &,
|
|
116
|
+
.editor-content-editable--review + & {
|
|
117
|
+
display: none !important;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
@use "../variables" as *;
|
|
2
|
+
@use "../mixins" as *;
|
|
3
|
+
|
|
4
|
+
.lexical-editor-root {
|
|
5
|
+
// Table Styles
|
|
6
|
+
.editor-table {
|
|
7
|
+
border-collapse: collapse;
|
|
8
|
+
border-spacing: 0;
|
|
9
|
+
width: 100%;
|
|
10
|
+
table-layout: fixed;
|
|
11
|
+
margin: $editor-table-margin-vertical 0;
|
|
12
|
+
border-radius: $editor-border-radius;
|
|
13
|
+
border: $editor-border-width solid $editor-border-color;
|
|
14
|
+
|
|
15
|
+
.editor-table-cell {
|
|
16
|
+
min-width: 0 !important;
|
|
17
|
+
border: $editor-border-width solid $editor-table-border-color;
|
|
18
|
+
padding: $editor-table-cell-padding-y $editor-table-cell-padding-x;
|
|
19
|
+
position: relative;
|
|
20
|
+
text-align: left;
|
|
21
|
+
vertical-align: top;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.editor-table-cell-header {
|
|
25
|
+
@extend .editor-table-cell;
|
|
26
|
+
background-color: $editor-table-header-bg;
|
|
27
|
+
font-weight: $editor-font-weight-semibold;
|
|
28
|
+
color: $editor-text-color;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.editor-table-cell-selected {
|
|
32
|
+
background-color: rgba($editor-primary-color, $editor-table-cell-selection-opacity) !important;
|
|
33
|
+
outline: 2px solid $editor-primary-color !important;
|
|
34
|
+
outline-offset: -2px;
|
|
35
|
+
|
|
36
|
+
&::after {
|
|
37
|
+
content: "";
|
|
38
|
+
position: absolute;
|
|
39
|
+
top: 0;
|
|
40
|
+
left: 0;
|
|
41
|
+
right: 0;
|
|
42
|
+
bottom: 0;
|
|
43
|
+
background-color: rgba($editor-primary-color, $editor-table-cell-selection-opacity);
|
|
44
|
+
pointer-events: none;
|
|
45
|
+
z-index: 2;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.editor-table-cell-action-button-container {
|
|
50
|
+
display: block;
|
|
51
|
+
right: $editor-table-action-button-right;
|
|
52
|
+
top: $editor-table-action-button-top;
|
|
53
|
+
position: absolute;
|
|
54
|
+
z-index: $editor-z-index-layer-10;
|
|
55
|
+
width: $editor-table-action-button-size;
|
|
56
|
+
height: $editor-table-action-button-size;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.editor-table-cell-action-button {
|
|
60
|
+
background-color: $editor-muted-color;
|
|
61
|
+
display: block;
|
|
62
|
+
border: 0;
|
|
63
|
+
@include rounded-full;
|
|
64
|
+
@include control-size($editor-table-action-button-size);
|
|
65
|
+
color: $editor-text-color;
|
|
66
|
+
cursor: pointer;
|
|
67
|
+
transition: all $editor-transition-fast;
|
|
68
|
+
|
|
69
|
+
@include editor-button-interactive;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.editor-table-cell-editing {
|
|
73
|
+
box-shadow: 0 0 $editor-shadow-blur-sm $editor-table-cell-editing-shadow;
|
|
74
|
+
border-radius: calc($editor-gap-1 / 2);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.editor-table-cell-primary-selected {
|
|
78
|
+
border: $editor-outline-width solid $editor-primary-color;
|
|
79
|
+
display: block;
|
|
80
|
+
height: calc(100% - #{$editor-outline-width});
|
|
81
|
+
width: calc(100% - #{$editor-outline-width});
|
|
82
|
+
position: absolute;
|
|
83
|
+
left: -#{$editor-border-width};
|
|
84
|
+
top: -#{$editor-border-width};
|
|
85
|
+
z-index: $editor-z-index-layer-10;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.editor-table-cell-sorted-indicator {
|
|
89
|
+
display: block;
|
|
90
|
+
opacity: 0.5;
|
|
91
|
+
position: absolute;
|
|
92
|
+
bottom: 0;
|
|
93
|
+
left: 0;
|
|
94
|
+
width: 100%;
|
|
95
|
+
height: $editor-table-sorted-indicator-height;
|
|
96
|
+
background-color: $editor-muted-color;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.editor-table-row-striping {
|
|
100
|
+
margin: 0;
|
|
101
|
+
border-top: $editor-border-width solid $editor-border-color;
|
|
102
|
+
padding: 0;
|
|
103
|
+
|
|
104
|
+
&:nth-child(even) {
|
|
105
|
+
background-color: $editor-muted-color;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.editor-table-selected {
|
|
110
|
+
outline: $editor-outline-width solid $editor-primary-color;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.editor-table-selection {
|
|
114
|
+
background-color: rgba($editor-primary-color, $editor-table-cell-selection-opacity * 0.5) !important;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// Table Cell Resizer
|
|
120
|
+
.editor-table-cell-resizer {
|
|
121
|
+
position: absolute;
|
|
122
|
+
height: 100%;
|
|
123
|
+
width: 16px;
|
|
124
|
+
cursor: col-resize;
|
|
125
|
+
z-index: $editor-z-index-floating;
|
|
126
|
+
top: 0;
|
|
127
|
+
pointer-events: auto !important;
|
|
128
|
+
user-select: none;
|
|
129
|
+
background-color: transparent;
|
|
130
|
+
|
|
131
|
+
&:hover {
|
|
132
|
+
background-color: rgba($editor-primary-color, 0.1);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.editor-table-cell-resize-ruler {
|
|
137
|
+
display: block;
|
|
138
|
+
position: absolute;
|
|
139
|
+
width: 1px;
|
|
140
|
+
height: 100%;
|
|
141
|
+
background-color: $editor-primary-color;
|
|
142
|
+
top: 0;
|
|
143
|
+
left: 8px;
|
|
144
|
+
pointer-events: none;
|
|
145
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
@use "../variables" as *;
|
|
2
|
+
@use "../mixins" as *;
|
|
3
|
+
|
|
4
|
+
.lexical-editor-root {
|
|
5
|
+
// Text Formatting
|
|
6
|
+
.editor-link {
|
|
7
|
+
color: $editor-link-color;
|
|
8
|
+
text-decoration: none;
|
|
9
|
+
&:hover { text-decoration: underline; cursor: pointer; }
|
|
10
|
+
}
|
|
11
|
+
.editor-text-bold { font-weight: $editor-font-weight-bold !important; }
|
|
12
|
+
.editor-text-italic { font-style: italic !important; }
|
|
13
|
+
.editor-text-underline { text-decoration: underline !important; }
|
|
14
|
+
.editor-text-strikethrough { text-decoration: line-through !important; }
|
|
15
|
+
.editor-text-underline-strikethrough { text-decoration: underline line-through !important; }
|
|
16
|
+
.editor-text-subscript { vertical-align: sub !important; font-size: $editor-script-font-size !important; }
|
|
17
|
+
.editor-text-superscript { vertical-align: super !important; font-size: $editor-script-font-size !important; }
|
|
18
|
+
|
|
19
|
+
// Text Alignment
|
|
20
|
+
.editor-text-align-left {
|
|
21
|
+
text-align: left !important;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.editor-text-align-center {
|
|
25
|
+
text-align: center !important;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.editor-text-align-right {
|
|
29
|
+
text-align: right !important;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.editor-text-align-justify {
|
|
33
|
+
text-align: justify !important;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
@use "../variables" as *;
|
|
2
|
+
@use "../mixins" as *;
|
|
3
|
+
|
|
4
|
+
.lexical-editor-root {
|
|
5
|
+
// Paragraphs
|
|
6
|
+
.editor-paragraph {
|
|
7
|
+
font-size: $editor-font-size-base !important;
|
|
8
|
+
line-height: $editor-line-height-base !important;
|
|
9
|
+
margin-top: $editor-paragraph-margin-vertical !important;
|
|
10
|
+
margin-bottom: $editor-paragraph-margin-vertical !important;
|
|
11
|
+
|
|
12
|
+
&:first-child { margin-top: 0 !important; }
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// Headings
|
|
16
|
+
.editor-h1 {
|
|
17
|
+
font-size: $editor-h1-size;
|
|
18
|
+
line-height: $editor-heading-line-height !important;
|
|
19
|
+
font-weight: $editor-font-weight-bold !important;
|
|
20
|
+
letter-spacing: $editor-heading-letter-spacing-tight;
|
|
21
|
+
margin-top: $editor-heading-margin-top * 1.5 !important;
|
|
22
|
+
margin-bottom: $editor-heading-margin-bottom * 1.5 !important;
|
|
23
|
+
}
|
|
24
|
+
.editor-h2 {
|
|
25
|
+
font-size: $editor-h2-size;
|
|
26
|
+
line-height: $editor-heading-line-height !important;
|
|
27
|
+
font-weight: $editor-font-weight-semibold !important;
|
|
28
|
+
margin-top: $editor-heading-margin-top * 1.25 !important;
|
|
29
|
+
margin-bottom: $editor-heading-margin-bottom * 1.25 !important;
|
|
30
|
+
border-bottom: $editor-border-width solid var(--border);
|
|
31
|
+
padding-bottom: $editor-gap-1;
|
|
32
|
+
}
|
|
33
|
+
.editor-h3 {
|
|
34
|
+
font-size: $editor-h3-size;
|
|
35
|
+
line-height: $editor-heading-line-height !important;
|
|
36
|
+
font-weight: $editor-font-weight-semibold !important;
|
|
37
|
+
margin-top: $editor-heading-margin-top !important;
|
|
38
|
+
margin-bottom: $editor-heading-margin-bottom !important;
|
|
39
|
+
}
|
|
40
|
+
.editor-h4 {
|
|
41
|
+
font-size: $editor-h4-size;
|
|
42
|
+
line-height: $editor-heading-line-height !important;
|
|
43
|
+
font-weight: $editor-font-weight-semibold !important;
|
|
44
|
+
margin-top: $editor-heading-margin-top * 0.75 !important;
|
|
45
|
+
margin-bottom: $editor-heading-margin-bottom * 0.75 !important;
|
|
46
|
+
}
|
|
47
|
+
.editor-h5 {
|
|
48
|
+
font-size: $editor-h5-size;
|
|
49
|
+
line-height: $editor-heading-line-height !important;
|
|
50
|
+
font-weight: $editor-font-weight-semibold !important;
|
|
51
|
+
margin-top: $editor-heading-margin-top * 0.5 !important;
|
|
52
|
+
margin-bottom: $editor-heading-margin-bottom * 0.5 !important;
|
|
53
|
+
}
|
|
54
|
+
.editor-h6 {
|
|
55
|
+
font-size: $editor-h6-size;
|
|
56
|
+
line-height: $editor-heading-line-height !important;
|
|
57
|
+
font-weight: $editor-font-weight-semibold !important;
|
|
58
|
+
margin-top: $editor-heading-margin-top * 0.5 !important;
|
|
59
|
+
margin-bottom: $editor-heading-margin-bottom * 0.5 !important;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Quotes
|
|
63
|
+
.editor-quote {
|
|
64
|
+
margin: $editor-code-margin 0 !important;
|
|
65
|
+
padding: $editor-quote-padding $editor-quote-padding $editor-quote-padding ($editor-quote-padding + $editor-gap-2);
|
|
66
|
+
border-left: $editor-quote-border-width solid var(--border);
|
|
67
|
+
font-size: $editor-quote-font-size;
|
|
68
|
+
color: var(--muted-foreground);
|
|
69
|
+
font-style: italic;
|
|
70
|
+
background-color: var(--muted);
|
|
71
|
+
@include rounded-r-md;
|
|
72
|
+
}
|
|
73
|
+
}
|