@thangph2146/lexical-editor 0.0.4 → 0.0.6
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/README.md +47 -0
- package/dist/editor-x/editor.cjs +732 -443
- 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.d.cts +2 -1
- package/dist/editor-x/editor.d.ts +2 -1
- package/dist/editor-x/editor.js +736 -447
- package/dist/editor-x/editor.js.map +1 -1
- package/dist/index.cjs +772 -482
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1418 -1120
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +775 -485
- package/dist/index.js.map +1 -1
- package/package.json +86 -84
- package/src/components/lexical-editor.tsx +140 -123
- package/src/editor-x/editor.tsx +20 -5
- 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.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.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.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,86 @@
|
|
|
1
|
+
@use "../variables" as *;
|
|
2
|
+
@use "../mixins" as *;
|
|
3
|
+
|
|
4
|
+
/* --- INPUT --- */
|
|
5
|
+
.editor-input {
|
|
6
|
+
@include flex-center;
|
|
7
|
+
height: $editor-control-size-md;
|
|
8
|
+
width: 100%;
|
|
9
|
+
@include rounded-md;
|
|
10
|
+
border: $editor-border-width solid var(--input);
|
|
11
|
+
background-color: var(--background);
|
|
12
|
+
padding: $editor-gap-2 $editor-gap-3;
|
|
13
|
+
@include text-sm;
|
|
14
|
+
|
|
15
|
+
&::file-selector-button {
|
|
16
|
+
border: 0;
|
|
17
|
+
background-color: transparent;
|
|
18
|
+
@include text-sm;
|
|
19
|
+
font-weight: $editor-font-weight-medium;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&::placeholder {
|
|
23
|
+
color: var(--muted-foreground);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@include editor-input-interactive;
|
|
27
|
+
|
|
28
|
+
&:focus-visible {
|
|
29
|
+
outline: none;
|
|
30
|
+
box-shadow: 0 0 0 $editor-outline-width var(--ring), 0 0 0 $editor-outline-width * 2 var(--background);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&:disabled {
|
|
34
|
+
cursor: not-allowed;
|
|
35
|
+
opacity: $editor-opacity-disabled;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&::-webkit-outer-spin-button,
|
|
39
|
+
&::-webkit-inner-spin-button {
|
|
40
|
+
-webkit-appearance: none;
|
|
41
|
+
margin: 0;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&[type=number] {
|
|
45
|
+
-moz-appearance: textfield;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.editor-input-lg {
|
|
50
|
+
height: $editor-control-size-xl;
|
|
51
|
+
width: 100%;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.editor-input-wrapper {
|
|
55
|
+
@include flex-center;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/* --- INPUT GROUP ITEM --- */
|
|
59
|
+
.editor-input-group-item {
|
|
60
|
+
height: $editor-control-size-sm;
|
|
61
|
+
-moz-appearance: textfield;
|
|
62
|
+
|
|
63
|
+
&::-webkit-inner-spin-button,
|
|
64
|
+
&::-webkit-outer-spin-button {
|
|
65
|
+
-webkit-appearance: none;
|
|
66
|
+
margin: 0;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&--first {
|
|
70
|
+
border-top-right-radius: 0;
|
|
71
|
+
border-bottom-right-radius: 0;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
&--middle {
|
|
75
|
+
border-radius: 0;
|
|
76
|
+
border-left-width: 0;
|
|
77
|
+
margin-inline-start: -1px;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&--last {
|
|
81
|
+
border-top-left-radius: 0;
|
|
82
|
+
border-bottom-left-radius: 0;
|
|
83
|
+
border-left-width: 0;
|
|
84
|
+
margin-inline-start: -1px;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
@use "../variables" as *;
|
|
2
|
+
@use "../mixins" as *;
|
|
3
|
+
|
|
4
|
+
/* --- LABEL --- */
|
|
5
|
+
.editor-label {
|
|
6
|
+
@include text-sm;
|
|
7
|
+
font-weight: $editor-font-weight-medium;
|
|
8
|
+
line-height: 1;
|
|
9
|
+
|
|
10
|
+
&--disabled {
|
|
11
|
+
cursor: not-allowed;
|
|
12
|
+
opacity: $editor-opacity-muted;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
&--normal {
|
|
16
|
+
font-weight: $editor-font-weight-normal;
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
@use "../variables" as *;
|
|
2
|
+
@use "../mixins" as *;
|
|
3
|
+
|
|
4
|
+
/* --- MARGINS & PADDINGS (Optimized) --- */
|
|
5
|
+
$gaps: (
|
|
6
|
+
"0": 0,
|
|
7
|
+
"1": $editor-gap-1,
|
|
8
|
+
"1-5": $editor-gap-1-5,
|
|
9
|
+
"2": $editor-gap-2,
|
|
10
|
+
"3": $editor-gap-3,
|
|
11
|
+
"4": $editor-gap-4,
|
|
12
|
+
"5": $editor-gap-5,
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
@each $key, $val in $gaps {
|
|
16
|
+
.editor-m-#{$key} { margin: $val; }
|
|
17
|
+
.editor-mt-#{$key} { margin-top: $val; }
|
|
18
|
+
.editor-mb-#{$key} { margin-bottom: $val; }
|
|
19
|
+
.editor-ml-#{$key} { margin-left: $val; }
|
|
20
|
+
.editor-mr-#{$key} { margin-right: $val; }
|
|
21
|
+
|
|
22
|
+
.editor-p-#{$key} { padding: $val; }
|
|
23
|
+
.editor-pt-#{$key} { padding-top: $val; }
|
|
24
|
+
.editor-pb-#{$key} { padding-bottom: $val; }
|
|
25
|
+
.editor-pl-#{$key} { padding-left: $val; }
|
|
26
|
+
.editor-pr-#{$key} { padding-right: $val; }
|
|
27
|
+
|
|
28
|
+
.editor-px-#{$key} { padding-left: $val; padding-right: $val; }
|
|
29
|
+
.editor-py-#{$key} { padding-top: $val; padding-bottom: $val; }
|
|
30
|
+
|
|
31
|
+
.editor-gap-#{$key} { gap: $val; }
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.editor-ml-auto { margin-left: auto; }
|
|
35
|
+
.editor-mr-auto { margin-right: auto; }
|
|
36
|
+
|
|
37
|
+
.editor-px-2\.5 {
|
|
38
|
+
padding-left: $editor-gap-2 + $editor-outline-width;
|
|
39
|
+
padding-right: $editor-gap-2 + $editor-outline-width;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.editor-py-18 {
|
|
43
|
+
padding-top: $editor-placeholder-padding-y;
|
|
44
|
+
padding-bottom: $editor-placeholder-padding-y;
|
|
45
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
@use "../variables" as *;
|
|
2
|
+
@use "../mixins" as *;
|
|
3
|
+
|
|
4
|
+
/* --- POPOVER --- */
|
|
5
|
+
.editor-popover-content {
|
|
6
|
+
z-index: $editor-z-index-floating;
|
|
7
|
+
width: $editor-popover-width;
|
|
8
|
+
@include rounded-md;
|
|
9
|
+
border: $editor-border-width solid var(--border);
|
|
10
|
+
background-color: var(--popover);
|
|
11
|
+
color: var(--popover-foreground);
|
|
12
|
+
@include shadow-md;
|
|
13
|
+
padding: $editor-gap-4;
|
|
14
|
+
outline: none;
|
|
15
|
+
animation: editor-popover-zoom-in $editor-transition-fast;
|
|
16
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
@use "../variables" as *;
|
|
2
|
+
@use "../mixins" as *;
|
|
3
|
+
|
|
4
|
+
/* --- POSITIONING --- */
|
|
5
|
+
.editor-fixed {
|
|
6
|
+
position: fixed;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.editor-absolute {
|
|
10
|
+
position: absolute;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.editor-absolute-full {
|
|
14
|
+
@include absolute-full;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.editor-relative {
|
|
18
|
+
position: relative;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.editor-relative-full {
|
|
22
|
+
position: relative;
|
|
23
|
+
width: 100%;
|
|
24
|
+
height: 100%;
|
|
25
|
+
|
|
26
|
+
&--padding {
|
|
27
|
+
padding: $editor-gap-2 $editor-gap-5;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.editor-inset-0 {
|
|
32
|
+
inset: 0;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.editor-top-0 {
|
|
36
|
+
top: 0;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.editor-left-0 {
|
|
40
|
+
left: 0;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.editor-top-1-2 {
|
|
44
|
+
top: 50%;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.editor-left-1-2 {
|
|
48
|
+
left: 50%;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.editor-translate-x-1-2 {
|
|
52
|
+
transform: translateX(-50%);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.editor-translate-y-1-2 {
|
|
56
|
+
transform: translateY(-50%);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.editor--top-2-5 {
|
|
60
|
+
top: -($editor-gap-2 + $editor-outline-width);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.editor--right-2-5 {
|
|
64
|
+
right: -($editor-gap-2 + $editor-outline-width);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.editor--bottom-2-5 {
|
|
68
|
+
bottom: -($editor-gap-2 + $editor-outline-width);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.editor--left-2-5 {
|
|
72
|
+
left: -($editor-gap-2 + $editor-outline-width);
|
|
73
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
@use "../variables" as *;
|
|
2
|
+
@use "../mixins" as *;
|
|
3
|
+
|
|
4
|
+
/* --- ROUNDED --- */
|
|
5
|
+
.editor-rounded-sm {
|
|
6
|
+
@include rounded-sm;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.editor-rounded-md {
|
|
10
|
+
@include rounded-md;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.editor-rounded-lg {
|
|
14
|
+
@include rounded-lg;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.editor-rounded-full {
|
|
18
|
+
@include rounded-full;
|
|
19
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
@use "../variables" as *;
|
|
2
|
+
@use "../mixins" as *;
|
|
3
|
+
|
|
4
|
+
/* --- SCROLL AREA --- */
|
|
5
|
+
.editor-scroll-area {
|
|
6
|
+
max-height: $editor-scroll-area-max-height;
|
|
7
|
+
overflow-y: auto;
|
|
8
|
+
padding: $editor-gap-2;
|
|
9
|
+
border: $editor-border-width solid var(--border);
|
|
10
|
+
@include rounded-sm;
|
|
11
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
@use "../variables" as *;
|
|
2
|
+
@use "../mixins" as *;
|
|
3
|
+
|
|
4
|
+
/* --- SELECT (Native styling wrapper) --- */
|
|
5
|
+
.editor-select {
|
|
6
|
+
@include flex-center;
|
|
7
|
+
height: $editor-control-size-md;
|
|
8
|
+
width: 100%;
|
|
9
|
+
justify-content: space-between;
|
|
10
|
+
@include rounded-md;
|
|
11
|
+
border: $editor-border-width solid var(--input);
|
|
12
|
+
background-color: var(--background);
|
|
13
|
+
padding: 0 $editor-gap-3;
|
|
14
|
+
@include text-sm;
|
|
15
|
+
|
|
16
|
+
&:focus {
|
|
17
|
+
outline: none;
|
|
18
|
+
box-shadow: 0 0 0 $editor-outline-width var(--ring), 0 0 0 $editor-outline-width * 2 var(--background);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&:disabled {
|
|
22
|
+
cursor: not-allowed;
|
|
23
|
+
opacity: $editor-opacity-disabled;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/* Sizes */
|
|
27
|
+
&--size-default {
|
|
28
|
+
height: $editor-control-size-md;
|
|
29
|
+
padding: 0 $editor-gap-3;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&--size-sm {
|
|
33
|
+
height: $editor-control-size-sm;
|
|
34
|
+
padding: 0 $editor-gap-2;
|
|
35
|
+
font-size: $editor-font-size-xs;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&--size-lg {
|
|
39
|
+
height: $editor-control-size-lg;
|
|
40
|
+
padding: 0 $editor-gap-4;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&--size-icon {
|
|
44
|
+
@include control-size($editor-control-size-md);
|
|
45
|
+
padding: 0;
|
|
46
|
+
justify-content: center;
|
|
47
|
+
|
|
48
|
+
.editor-select-icon {
|
|
49
|
+
display: none;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&--w-auto {
|
|
54
|
+
width: auto;
|
|
55
|
+
padding: 0 $editor-gap-3;
|
|
56
|
+
min-width: $editor-select-min-width-auto;
|
|
57
|
+
justify-content: space-between;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&--gap-sm {
|
|
61
|
+
gap: $editor-gap-2;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.editor-select-item {
|
|
66
|
+
position: relative;
|
|
67
|
+
@include flex-center;
|
|
68
|
+
width: 100%;
|
|
69
|
+
cursor: pointer;
|
|
70
|
+
user-select: none;
|
|
71
|
+
gap: $editor-gap-2;
|
|
72
|
+
@include rounded-sm;
|
|
73
|
+
padding: $editor-select-item-padding-vertical $editor-gap-2 $editor-select-item-padding-vertical $editor-gap-5;
|
|
74
|
+
@include text-sm;
|
|
75
|
+
outline: none;
|
|
76
|
+
|
|
77
|
+
&:hover {
|
|
78
|
+
background-color: $editor-accent-color;
|
|
79
|
+
color: $editor-accent-foreground-color;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
&[data-selected="true"] {
|
|
83
|
+
background-color: $editor-accent-color;
|
|
84
|
+
color: $editor-accent-foreground-color;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
&__check {
|
|
88
|
+
position: absolute;
|
|
89
|
+
left: $editor-gap-1;
|
|
90
|
+
display: flex;
|
|
91
|
+
@include icon-size($editor-icon-size-sm);
|
|
92
|
+
align-items: center;
|
|
93
|
+
justify-content: center;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.editor-select-label {
|
|
98
|
+
padding: $editor-select-item-padding-vertical $editor-gap-2 $editor-select-item-padding-vertical $editor-gap-5;
|
|
99
|
+
font-size: $editor-font-size-sm;
|
|
100
|
+
font-weight: $editor-font-weight-semibold;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.editor-block-format-label {
|
|
104
|
+
flex: 1 1 auto;
|
|
105
|
+
min-width: 0;
|
|
106
|
+
max-width: none;
|
|
107
|
+
@include truncate;
|
|
108
|
+
line-height: 1.25;
|
|
109
|
+
text-align: left;
|
|
110
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
@use "../variables" as *;
|
|
2
|
+
@use "../mixins" as *;
|
|
3
|
+
|
|
4
|
+
/* --- SEPARATOR --- */
|
|
5
|
+
.editor-separator {
|
|
6
|
+
background-color: var(--border);
|
|
7
|
+
flex-shrink: 0;
|
|
8
|
+
|
|
9
|
+
&--horizontal {
|
|
10
|
+
height: $editor-border-width;
|
|
11
|
+
width: 100%;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&--vertical {
|
|
15
|
+
width: $editor-border-width;
|
|
16
|
+
height: 100%;
|
|
17
|
+
min-height: $editor-separator-min-height-vertical;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
@use "../variables" as *;
|
|
2
|
+
@use "../mixins" as *;
|
|
3
|
+
|
|
4
|
+
/* --- TABS --- */
|
|
5
|
+
.editor-tabs-trigger {
|
|
6
|
+
@include flex-center-justify;
|
|
7
|
+
white-space: nowrap;
|
|
8
|
+
@include rounded-sm;
|
|
9
|
+
padding: $editor-gap-1-5 $editor-gap-2;
|
|
10
|
+
@include text-sm;
|
|
11
|
+
font-weight: $editor-font-weight-medium;
|
|
12
|
+
transition: all $editor-transition-normal;
|
|
13
|
+
cursor: pointer;
|
|
14
|
+
border: none;
|
|
15
|
+
background: transparent;
|
|
16
|
+
color: var(--muted-foreground);
|
|
17
|
+
flex: 1;
|
|
18
|
+
|
|
19
|
+
@include focus-ring;
|
|
20
|
+
|
|
21
|
+
&:disabled {
|
|
22
|
+
pointer-events: none;
|
|
23
|
+
opacity: $editor-opacity-disabled;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&[data-state="active"] {
|
|
27
|
+
background-color: var(--background);
|
|
28
|
+
color: var(--foreground);
|
|
29
|
+
@include shadow-sm;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.editor-tabs-list {
|
|
34
|
+
@include flex-center-justify;
|
|
35
|
+
height: $editor-control-size-lg;
|
|
36
|
+
@include rounded-md;
|
|
37
|
+
background-color: var(--muted);
|
|
38
|
+
padding: $editor-gap-1;
|
|
39
|
+
color: var(--muted-foreground);
|
|
40
|
+
width: 100%;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.editor-tabs-content {
|
|
44
|
+
margin-top: $editor-gap-2;
|
|
45
|
+
@include focus-ring;
|
|
46
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
@use "../variables" as *;
|
|
2
|
+
@use "../mixins" as *;
|
|
3
|
+
|
|
4
|
+
/* --- TEXT UTILITIES --- */
|
|
5
|
+
.editor-text-muted-xs {
|
|
6
|
+
font-size: $editor-font-size-xs;
|
|
7
|
+
color: $editor-muted-foreground-color;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.editor-text-sm {
|
|
11
|
+
@include text-sm;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.editor-font-medium {
|
|
15
|
+
font-weight: $editor-font-weight-medium;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.editor-font-mono {
|
|
19
|
+
font-family: $editor-font-family-mono;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.editor-text-muted-foreground {
|
|
23
|
+
color: $editor-muted-foreground-color;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.editor-text-foreground-50 {
|
|
27
|
+
color: color-mix(in srgb, var(--foreground), transparent 50%);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.editor-uppercase {
|
|
31
|
+
text-transform: uppercase;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.editor-whitespace-nowrap {
|
|
35
|
+
white-space: nowrap;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.editor-whitespace-pre-wrap {
|
|
39
|
+
white-space: pre-wrap;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.editor-word-break-break-word {
|
|
43
|
+
word-break: break-word;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.editor-caret-primary {
|
|
47
|
+
caret-color: var(--primary);
|
|
48
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
@use "../variables" as *;
|
|
2
|
+
@use "../mixins" as *;
|
|
3
|
+
|
|
4
|
+
/* --- TOGGLE GROUP & TOOLBAR ITEMS --- */
|
|
5
|
+
.editor-toggle-group {
|
|
6
|
+
@include flex-center-justify;
|
|
7
|
+
flex-wrap: wrap;
|
|
8
|
+
gap: $editor-gap-1;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.editor-toolbar-item,
|
|
12
|
+
.editor-toggle-group-item {
|
|
13
|
+
@include flex-center-justify;
|
|
14
|
+
@include rounded-md;
|
|
15
|
+
@include text-sm;
|
|
16
|
+
font-weight: $editor-font-weight-medium;
|
|
17
|
+
color: var(--foreground);
|
|
18
|
+
transition: all $editor-transition-normal;
|
|
19
|
+
cursor: pointer;
|
|
20
|
+
line-height: 1;
|
|
21
|
+
padding: $editor-gap-2;
|
|
22
|
+
@include editor-button-interactive;
|
|
23
|
+
|
|
24
|
+
&--size-sm {
|
|
25
|
+
padding: $editor-gap-1;
|
|
26
|
+
font-size: $editor-font-size-xs;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&--size-lg {
|
|
30
|
+
padding: $editor-gap-3;
|
|
31
|
+
font-size: $editor-font-size-md;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&--outline {
|
|
35
|
+
border-color: var(--border);
|
|
36
|
+
|
|
37
|
+
&:hover {
|
|
38
|
+
background-color: $editor-accent-color;
|
|
39
|
+
border-color: $editor-accent-color;
|
|
40
|
+
color: $editor-accent-foreground-color !important;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&:hover {
|
|
45
|
+
background-color: var(--muted);
|
|
46
|
+
color: var(--muted-foreground);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&[data-state="on"],
|
|
50
|
+
&[data-state="active"] {
|
|
51
|
+
background-color: $editor-accent-color;
|
|
52
|
+
color: $editor-accent-foreground-color !important;
|
|
53
|
+
border-color: $editor-accent-color;
|
|
54
|
+
|
|
55
|
+
&:hover {
|
|
56
|
+
@include editor-hover-base;
|
|
57
|
+
background-color: color-mix(in srgb, $editor-accent-color, black 10%);
|
|
58
|
+
border-color: $editor-accent-color;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
&:disabled {
|
|
63
|
+
pointer-events: none;
|
|
64
|
+
opacity: $editor-opacity-disabled;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.editor-toolbar-item {
|
|
69
|
+
@include control-size($editor-control-size-md);
|
|
70
|
+
padding: 0;
|
|
71
|
+
background-color: var(--background);
|
|
72
|
+
border: $editor-border-width solid var(--border);
|
|
73
|
+
|
|
74
|
+
&--lg {
|
|
75
|
+
@include control-size($editor-control-size-lg);
|
|
76
|
+
min-height: $editor-control-size-lg;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
&--w-fit { width: fit-content; }
|
|
80
|
+
&--w-auto {
|
|
81
|
+
width: auto;
|
|
82
|
+
padding-left: $editor-gap-2;
|
|
83
|
+
padding-right: $editor-gap-2;
|
|
84
|
+
}
|
|
85
|
+
&--gap-sm { gap: $editor-gap-1; }
|
|
86
|
+
&--text-center { text-align: center; }
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.editor-toolbar-select-trigger {
|
|
90
|
+
display: flex;
|
|
91
|
+
justify-content: space-between;
|
|
92
|
+
align-items: center;
|
|
93
|
+
height: auto;
|
|
94
|
+
width: 220px;
|
|
95
|
+
min-width: 220px;
|
|
96
|
+
min-height: $editor-control-size-md;
|
|
97
|
+
width: auto;
|
|
98
|
+
gap: $editor-gap-2;
|
|
99
|
+
padding: calc($editor-gap-1 + 2px) $editor-gap-2;
|
|
100
|
+
@include text-sm;
|
|
101
|
+
font-weight: $editor-font-weight-medium;
|
|
102
|
+
border: $editor-border-width solid var(--border);
|
|
103
|
+
@include rounded-md;
|
|
104
|
+
transition: all $editor-transition-normal;
|
|
105
|
+
|
|
106
|
+
@include editor-button-interactive;
|
|
107
|
+
|
|
108
|
+
&:focus {
|
|
109
|
+
@include focus-ring;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
&--w-md {
|
|
113
|
+
width: $editor-toolbar-select-width;
|
|
114
|
+
min-width: $editor-toolbar-select-width;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.editor-toolbar-select-icon {
|
|
119
|
+
@include icon-size($editor-icon-size-sm);
|
|
120
|
+
@include flex-center-justify;
|
|
121
|
+
margin-right: $editor-gap-2;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.editor-format-select-trigger {
|
|
125
|
+
width: $editor-format-select-width !important;
|
|
126
|
+
min-width: $editor-format-select-width !important;
|
|
127
|
+
flex-shrink: 0;
|
|
128
|
+
}
|