@licklist/design 0.78.5-dev.43 → 0.78.5-dev.45
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/v2/components/Alert/Alert.scss.js +1 -1
- package/dist/v2/components/Button/Button.scss.js +1 -1
- package/dist/v2/components/Checkbox/Checkbox.scss.js +1 -1
- package/dist/v2/components/FormField/FormField.scss.js +1 -1
- package/dist/v2/components/NewPageHeader/NewPageHeader.scss.js +1 -1
- package/dist/v2/components/Select/Select.scss.js +1 -1
- package/dist/v2/components/WYSIWYGEditor/Icons.d.ts +0 -3
- package/dist/v2/components/WYSIWYGEditor/Icons.d.ts.map +1 -1
- package/dist/v2/components/WYSIWYGEditor/Icons.js +2 -41
- package/dist/v2/components/WYSIWYGEditor/WYSIWYGEditor.d.ts.map +1 -1
- package/dist/v2/components/WYSIWYGEditor/WYSIWYGEditor.js +39 -42
- package/dist/v2/components/WYSIWYGEditor/WYSIWYGEditor.scss.js +1 -1
- package/dist/v2/styles/components/Button.scss +3 -3
- package/dist/v2/styles/form/NewInput.scss +33 -21
- package/dist/v2/styles/form/NewInput.scss.js +1 -1
- package/dist/v2/styles/tokens/_colors.scss +1 -1
- package/package.json +3 -3
- package/src/v2/components/Checkbox/Checkbox.scss +28 -13
- package/src/v2/components/FormField/FormField.scss +9 -9
- package/src/v2/components/NewPageHeader/NewPageHeader.scss +12 -0
- package/src/v2/components/Select/Select.scss +5 -5
- package/src/v2/components/WYSIWYGEditor/Icons.tsx +1 -18
- package/src/v2/components/WYSIWYGEditor/WYSIWYGEditor.scss +50 -32
- package/src/v2/components/WYSIWYGEditor/WYSIWYGEditor.tsx +48 -35
- package/src/v2/styles/components/Button.scss +3 -3
- package/src/v2/styles/form/NewInput.scss +33 -21
- package/src/v2/styles/tokens/_colors.scss +1 -1
|
@@ -6,6 +6,12 @@
|
|
|
6
6
|
align-self: stretch;
|
|
7
7
|
padding-left: 32px;
|
|
8
8
|
padding-right: 32px;
|
|
9
|
+
|
|
10
|
+
@media (max-width: 768px) {
|
|
11
|
+
padding-left: 16px;
|
|
12
|
+
padding-right: 16px;
|
|
13
|
+
gap: 16px;
|
|
14
|
+
}
|
|
9
15
|
}
|
|
10
16
|
|
|
11
17
|
.new-page-header {
|
|
@@ -14,6 +20,12 @@
|
|
|
14
20
|
align-items: center;
|
|
15
21
|
align-self: stretch;
|
|
16
22
|
width: 100%;
|
|
23
|
+
gap: 16px;
|
|
24
|
+
|
|
25
|
+
@media (max-width: 768px) {
|
|
26
|
+
gap: 8px;
|
|
27
|
+
padding-top: 16px;
|
|
28
|
+
}
|
|
17
29
|
|
|
18
30
|
&__title {
|
|
19
31
|
color: var(--label-primary);
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
|
|
70
70
|
&--error {
|
|
71
71
|
background-color: var(--surface-status-error);
|
|
72
|
-
border-color: var(--
|
|
72
|
+
border-color: var(--borders-status-border-error);
|
|
73
73
|
|
|
74
74
|
&:hover:not(:disabled) {
|
|
75
75
|
background-color: var(--errors-lighter);
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
&:focus {
|
|
80
|
-
border-color: var(--
|
|
80
|
+
border-color: var(--borders-status-border-error);
|
|
81
81
|
background-color: var(--surface-status-error);
|
|
82
82
|
}
|
|
83
83
|
}
|
|
@@ -141,7 +141,7 @@
|
|
|
141
141
|
height: 6px;
|
|
142
142
|
stroke: var(--label-secondary);
|
|
143
143
|
transition: all 0.2s ease-in-out;
|
|
144
|
-
|
|
144
|
+
|
|
145
145
|
.select:focus + & {
|
|
146
146
|
transform: translateY(-50%) rotate(180deg);
|
|
147
147
|
}
|
|
@@ -164,7 +164,7 @@
|
|
|
164
164
|
opacity: 0.8;
|
|
165
165
|
transform: scale(0.98);
|
|
166
166
|
border-color: var(--cyan-700);
|
|
167
|
-
|
|
167
|
+
|
|
168
168
|
&:focus {
|
|
169
169
|
transform: scale(0.98) translateY(-1px);
|
|
170
170
|
}
|
|
@@ -185,4 +185,4 @@
|
|
|
185
185
|
|
|
186
186
|
.select--filter-active {
|
|
187
187
|
animation: filterPulse 0.6s ease-out;
|
|
188
|
-
}
|
|
188
|
+
}
|
|
@@ -53,12 +53,6 @@ export const NumberedListIcon = () => (
|
|
|
53
53
|
</svg>
|
|
54
54
|
);
|
|
55
55
|
|
|
56
|
-
export const TaskListIcon = () => (
|
|
57
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
58
|
-
<path d="M9.00006 7.5V9.75H6.75006V7.5H9.00006ZM5.25006 6V11.25H10.5001V6H5.25006ZM12.7501 6H18.7501V7.5H12.7501V6ZM12.7501 11.25H18.7501V12.75H12.7501V11.25ZM12.7501 16.5H18.7501V18H12.7501V16.5ZM11.0304 15.1553L9.96973 14.0947L7.50006 16.5644L6.15538 15.2197L5.09473 16.2803L7.50006 18.6856L11.0304 15.1553Z" fill="#626A90"/>
|
|
59
|
-
</svg>
|
|
60
|
-
);
|
|
61
|
-
|
|
62
56
|
export const QuoteAltIcon = () => (
|
|
63
57
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
64
58
|
<path d="M6.43756 15.9909C5.66487 15.1706 5.25 14.25 5.25 12.7578C5.25 10.1332 7.09238 7.78029 9.77294 6.61743L10.4425 7.65064C7.94103 9.00409 7.45214 10.7595 7.25673 11.8665C7.65947 11.6583 8.18669 11.585 8.70353 11.6329C10.0568 11.7584 11.1234 12.8693 11.1234 14.25C11.1234 15.6998 9.94812 16.875 8.49837 16.875C7.69357 16.875 6.92397 16.5072 6.43756 15.9909ZM13.9375 15.9909C13.1649 15.1706 12.75 14.25 12.75 12.7578C12.75 10.1332 14.5924 7.78029 17.2729 6.61743L17.9425 7.65064C15.441 9.00409 14.9522 10.7595 14.7567 11.8665C15.1594 11.6583 15.6867 11.585 16.2035 11.6329C17.5568 11.7584 18.6234 12.8693 18.6234 14.25C18.6234 15.6998 17.4481 16.875 15.9984 16.875C15.1936 16.875 14.424 16.5072 13.9375 15.9909Z" fill="#626A90"/>
|
|
@@ -81,18 +75,7 @@ export const UndoIcon = () => (
|
|
|
81
75
|
|
|
82
76
|
export const RedoIcon = () => (
|
|
83
77
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
84
|
-
<path d="M6.06131 6.
|
|
78
|
+
<path d="M6.06131 6.69136C7.57508 5.61718 9.42169 5.01103 11.2847 5.00012C13.6826 4.98606 15.9892 5.92634 17.705 7.61633C19.4208 9.30632 20.4039 11.6033 20.4411 14.0084C20.4784 16.4135 19.5668 18.7239 17.9042 20.4371C16.2415 22.1504 13.9686 23.123 11.5794 23.1437C9.19013 23.1643 6.87707 22.2312 5.14341 20.5472L6.18225 19.4716C7.62779 20.8757 9.55655 21.6538 11.5488 21.6366C13.5411 21.6193 15.4363 20.8083 16.8227 19.3798C18.2091 17.9513 18.9692 16.0248 18.9381 14.0194C18.9071 12.014 18.0873 10.0987 16.6567 8.68961C15.2261 7.28052 13.3028 6.49646 11.3033 6.50818C9.75051 6.51728 8.21142 7.02243 6.94998 7.91782L10.25 11.25H5.25V6.25L6.06131 6.69136Z" fill="#626A90"/>
|
|
85
79
|
</svg>
|
|
86
80
|
);
|
|
87
81
|
|
|
88
|
-
export const RedoAltIcon = () => (
|
|
89
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
90
|
-
<path d="M14.7783 5.1401C16.899 5.98783 18.6074 7.79081 19.244 10.1665C19.2815 10.3065 19.3136 10.4469 19.3428 10.587C19.3503 10.6234 19.3579 10.6598 19.3649 10.6961C19.3758 10.7532 19.3856 10.8103 19.3952 10.8674C19.3988 10.8883 19.4022 10.9093 19.4056 10.9302C19.4295 11.0794 19.4496 11.2283 19.4643 11.377C19.4663 11.397 19.4673 11.4171 19.4691 11.4371C19.571 12.5575 19.4176 13.6601 19.0465 14.6757L15.6222 11.1367L17.7946 10.5539C17.741 10.3542 17.6779 10.1596 17.6061 9.97039C17.57 9.87555 17.5318 9.7821 17.4914 9.69003C17.0879 8.77009 16.4702 7.99017 15.7147 7.39538C15.4122 7.15727 15.0875 6.94923 14.7459 6.77321C14.2774 6.53178 13.7765 6.35274 13.2564 6.24081C12.3559 6.04711 11.3975 6.05715 10.4466 6.31194C10.2147 6.37407 9.9903 6.45035 9.77265 6.53705C9.61715 6.59899 9.46465 6.66505 9.31689 6.73869C8.29847 7.24626 7.46969 8.02427 6.8945 8.95668C6.05731 10.3136 5.75827 11.9985 6.20328 13.6599C6.92179 16.3414 9.34799 18.1081 11.9982 18.1069L11.9989 19.6061C8.68576 19.608 5.65276 17.4002 4.75454 14.048C4.16791 11.8578 4.61554 9.63526 5.79586 7.89533L5.79448 7.89395C5.81581 7.86251 5.83827 7.83185 5.86008 7.80073C5.8864 7.76317 5.91317 7.72595 5.94018 7.68886C5.97698 7.63833 6.01398 7.58795 6.05205 7.53833C6.08438 7.49618 6.11687 7.45413 6.15011 7.41265C6.19423 7.35758 6.24044 7.30422 6.28614 7.25037C6.31108 7.22099 6.33532 7.191 6.36072 7.16198C6.41092 7.10463 6.46271 7.04867 6.51471 6.9928C6.54488 6.96039 6.5744 6.92734 6.60517 6.89544C6.84601 6.64568 7.10482 6.41165 7.38064 6.19593C7.41173 6.17161 7.44441 6.14934 7.47593 6.12549C7.53489 6.08087 7.59366 6.03587 7.65409 5.99291C7.69049 5.96703 7.72765 5.94221 7.76457 5.91695C7.82724 5.87408 7.89031 5.83165 7.95447 5.79058C7.9885 5.76881 8.02292 5.74762 8.05736 5.72636C8.11894 5.68835 8.18092 5.65082 8.2438 5.6145C8.28971 5.58798 8.33601 5.56206 8.3826 5.53647C8.44512 5.50212 8.50807 5.46832 8.57181 5.43565C8.60987 5.41614 8.64794 5.39654 8.68644 5.37764C8.75026 5.34631 8.8148 5.31612 8.87979 5.28649C8.93014 5.26354 8.98066 5.24074 9.0317 5.21882C9.0919 5.19297 9.15286 5.16861 9.214 5.14424C9.262 5.12511 9.30976 5.10513 9.35833 5.08693C9.54044 5.01866 9.72708 4.95876 9.91697 4.90394C9.96389 4.89039 10.0105 4.8752 10.0578 4.86251C10.395 4.77217 10.7333 4.70888 11.0702 4.66639C11.2333 4.64581 11.3959 4.62849 11.5584 4.61875C12.6773 4.55174 13.7742 4.73862 14.7783 5.1401Z" fill="#626A90"/>
|
|
91
|
-
</svg>
|
|
92
|
-
);
|
|
93
|
-
|
|
94
|
-
export const ClearFormattingIcon = () => (
|
|
95
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
96
|
-
<path d="M12.4884 13.549L11.7035 18H10.1804L11.1935 12.2542L5.63599 6.69664L6.69664 5.63599L18.3639 17.3033L17.3032 18.3639L12.4884 13.549ZM11.8295 8.64752L12.0319 7.49995H10.6819L9.18193 5.99995H17.9999V7.49995H13.555L13.1243 9.94234L11.8295 8.64752Z" fill="#626A90"/>
|
|
97
|
-
</svg>
|
|
98
|
-
);
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
&__label {
|
|
12
12
|
font-family: var(--font-family-sans, 'Geist', sans-serif);
|
|
13
13
|
color: var(--label-primary);
|
|
14
|
-
font-size:
|
|
14
|
+
font-size: 15px;
|
|
15
15
|
font-style: normal;
|
|
16
|
-
font-weight:
|
|
17
|
-
line-height:
|
|
16
|
+
font-weight: 600;
|
|
17
|
+
line-height: 20px;
|
|
18
18
|
margin: 0;
|
|
19
19
|
}
|
|
20
20
|
|
|
@@ -36,32 +36,31 @@
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
&--error {
|
|
39
|
-
border-color: var(--
|
|
39
|
+
border-color: var(--borders-status-border-error, #ef4444);
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
&__toolbar {
|
|
44
44
|
display: flex;
|
|
45
45
|
flex-wrap: wrap;
|
|
46
|
-
padding: 4px
|
|
47
|
-
align-items:
|
|
48
|
-
gap:
|
|
46
|
+
padding: 0 4px;
|
|
47
|
+
align-items: center;
|
|
48
|
+
gap: 0;
|
|
49
49
|
align-self: stretch;
|
|
50
|
-
border-radius:
|
|
51
|
-
border-top: 2px solid var(--border-primary);
|
|
52
|
-
border-right: 2px solid var(--border-primary);
|
|
53
|
-
border-left: 2px solid var(--border-primary);
|
|
50
|
+
border-radius: 2px 2px 0 0;
|
|
54
51
|
background: var(--surface-tertiary);
|
|
52
|
+
border-bottom: 2px solid var(--border-primary);
|
|
55
53
|
}
|
|
56
54
|
|
|
57
55
|
&__toolbar-btn {
|
|
58
56
|
display: flex;
|
|
59
57
|
align-items: center;
|
|
60
58
|
justify-content: center;
|
|
61
|
-
|
|
59
|
+
width: 40px;
|
|
60
|
+
height: 40px;
|
|
62
61
|
border: none;
|
|
63
62
|
background: transparent;
|
|
64
|
-
border-radius:
|
|
63
|
+
border-radius: 4px;
|
|
65
64
|
cursor: pointer;
|
|
66
65
|
color: var(--label-secondary);
|
|
67
66
|
transition: all 0.2s ease;
|
|
@@ -72,9 +71,14 @@
|
|
|
72
71
|
flex-shrink: 0;
|
|
73
72
|
}
|
|
74
73
|
|
|
74
|
+
&[title="Heading 1"] svg,
|
|
75
|
+
&[title="Heading 2"] svg {
|
|
76
|
+
transform: scale(0.8);
|
|
77
|
+
}
|
|
78
|
+
|
|
75
79
|
&:hover {
|
|
76
|
-
background-color: var(--surface-secondary
|
|
77
|
-
color: var(--label-primary
|
|
80
|
+
background-color: var(--surface-secondary);
|
|
81
|
+
color: var(--label-primary);
|
|
78
82
|
}
|
|
79
83
|
|
|
80
84
|
&--active {
|
|
@@ -87,7 +91,8 @@
|
|
|
87
91
|
width: 1px;
|
|
88
92
|
height: 18px;
|
|
89
93
|
background-color: var(--border-primary, #e8e9ef);
|
|
90
|
-
margin: 0
|
|
94
|
+
margin: 0 8px;
|
|
95
|
+
display: block;
|
|
91
96
|
}
|
|
92
97
|
|
|
93
98
|
&__content {
|
|
@@ -95,13 +100,17 @@
|
|
|
95
100
|
padding: 12px;
|
|
96
101
|
outline: none;
|
|
97
102
|
font-family: var(--font-family-sans, 'Geist', sans-serif);
|
|
98
|
-
font-size: var(--text-
|
|
99
|
-
line-height:
|
|
103
|
+
font-size: var(--text-regular-size, 15px);
|
|
104
|
+
line-height: var(--text-regular-line, 20px);
|
|
100
105
|
color: var(--label-primary, #121e52);
|
|
101
106
|
background-color: var(--surface-secondary, #f8f8fa);
|
|
102
107
|
overflow-y: auto;
|
|
103
108
|
text-align: left;
|
|
104
109
|
|
|
110
|
+
@media (max-width: 768px) {
|
|
111
|
+
font-size: 16px;
|
|
112
|
+
}
|
|
113
|
+
|
|
105
114
|
&--disabled {
|
|
106
115
|
background-color: var(--surface-status-disabled, #f8f8fa);
|
|
107
116
|
cursor: not-allowed;
|
|
@@ -116,13 +125,17 @@
|
|
|
116
125
|
|
|
117
126
|
// Styles for content elements
|
|
118
127
|
h1, h2, p, ul, ol, blockquote, hr {
|
|
119
|
-
font-family: var(--font-family-sans, 'Geist', sans-serif)
|
|
120
|
-
font-size: var(--text-
|
|
121
|
-
line-height:
|
|
128
|
+
font-family: var(--font-family-sans, 'Geist', sans-serif);
|
|
129
|
+
font-size: var(--text-regular-size, 15px);
|
|
130
|
+
line-height: var(--text-regular-line, 20px);
|
|
122
131
|
color: var(--label-primary, #121e52);
|
|
123
132
|
overflow-y: auto;
|
|
124
133
|
text-align: left;
|
|
125
134
|
|
|
135
|
+
@media (max-width: 768px) {
|
|
136
|
+
font-size: 16px;
|
|
137
|
+
}
|
|
138
|
+
|
|
126
139
|
&:first-child {
|
|
127
140
|
margin-top: 0;
|
|
128
141
|
}
|
|
@@ -154,9 +167,9 @@
|
|
|
154
167
|
|
|
155
168
|
p {
|
|
156
169
|
margin: 8px 0;
|
|
157
|
-
font-family: var(--font-family-sans, 'Geist', sans-serif)
|
|
158
|
-
font-size: var(--text-
|
|
159
|
-
line-height:
|
|
170
|
+
font-family: var(--font-family-sans, 'Geist', sans-serif);
|
|
171
|
+
font-size: var(--text-regular-size, 15px);
|
|
172
|
+
line-height: var(--text-regular-line, 20px);
|
|
160
173
|
color: var(--label-primary, #121e52);
|
|
161
174
|
|
|
162
175
|
&:first-child {
|
|
@@ -172,8 +185,8 @@
|
|
|
172
185
|
margin: 8px 0;
|
|
173
186
|
padding-left: 24px;
|
|
174
187
|
font-family: var(--font-family-sans, 'Geist', sans-serif);
|
|
175
|
-
font-size: var(--text-
|
|
176
|
-
line-height:
|
|
188
|
+
font-size: var(--text-regular-size, 15px);
|
|
189
|
+
line-height: var(--text-regular-line, 20px);
|
|
177
190
|
color: var(--label-primary, #121e52);
|
|
178
191
|
|
|
179
192
|
&:first-child {
|
|
@@ -188,8 +201,8 @@
|
|
|
188
201
|
li {
|
|
189
202
|
margin: 4px 0;
|
|
190
203
|
font-family: var(--font-family-sans, 'Geist', sans-serif);
|
|
191
|
-
font-size: var(--text-
|
|
192
|
-
line-height:
|
|
204
|
+
font-size: var(--text-regular-size, 15px);
|
|
205
|
+
line-height: var(--text-regular-line, 20px);
|
|
193
206
|
color: var(--label-primary, #121e52);
|
|
194
207
|
}
|
|
195
208
|
|
|
@@ -199,8 +212,8 @@
|
|
|
199
212
|
border-left: 4px solid var(--border-selected, #121e52);
|
|
200
213
|
background-color: var(--surface-tertiary, #efefef);
|
|
201
214
|
font-family: var(--font-family-sans, 'Geist', sans-serif);
|
|
202
|
-
font-size: var(--text-
|
|
203
|
-
line-height:
|
|
215
|
+
font-size: var(--text-regular-size, 15px);
|
|
216
|
+
line-height: var(--text-regular-line, 20px);
|
|
204
217
|
color: var(--label-secondary, #626a90);
|
|
205
218
|
font-style: italic;
|
|
206
219
|
|
|
@@ -214,10 +227,14 @@
|
|
|
214
227
|
}
|
|
215
228
|
|
|
216
229
|
hr {
|
|
230
|
+
display: block;
|
|
217
231
|
margin: 16px 0;
|
|
218
232
|
border: none;
|
|
219
233
|
border-top: 2px solid var(--border-primary, #e8e9ef);
|
|
220
234
|
height: 0;
|
|
235
|
+
box-sizing: content-box;
|
|
236
|
+
opacity: 1;
|
|
237
|
+
visibility: visible;
|
|
221
238
|
|
|
222
239
|
&:first-child {
|
|
223
240
|
margin-top: 0;
|
|
@@ -284,10 +301,10 @@
|
|
|
284
301
|
|
|
285
302
|
&__help-text {
|
|
286
303
|
font-family: var(--font-family-sans, 'Geist', sans-serif);
|
|
287
|
-
font-size:
|
|
304
|
+
font-size: var(--text-regular-size, 15px);
|
|
288
305
|
font-style: normal;
|
|
289
306
|
font-weight: 400;
|
|
290
|
-
line-height:
|
|
307
|
+
line-height: var(--text-regular-line, 20px);
|
|
291
308
|
margin-top: -5px;
|
|
292
309
|
color: var(--label-secondary);
|
|
293
310
|
}
|
|
@@ -297,4 +314,5 @@
|
|
|
297
314
|
color: var(--label-status-error, #ef4444);
|
|
298
315
|
margin-top: 2px;
|
|
299
316
|
}
|
|
317
|
+
|
|
300
318
|
}
|
|
@@ -10,12 +10,9 @@ import {
|
|
|
10
10
|
NumberedListIcon,
|
|
11
11
|
UndoIcon,
|
|
12
12
|
RedoIcon,
|
|
13
|
-
ClearFormattingIcon,
|
|
14
13
|
ParagraphIcon,
|
|
15
14
|
QuoteAltIcon,
|
|
16
|
-
TaskListIcon,
|
|
17
15
|
DividerIcon,
|
|
18
|
-
RedoAltIcon,
|
|
19
16
|
} from './Icons'
|
|
20
17
|
import './WYSIWYGEditor.scss'
|
|
21
18
|
|
|
@@ -43,13 +40,17 @@ export const WYSIWYGEditor: React.FC<WYSIWYGEditorProps> = ({
|
|
|
43
40
|
|
|
44
41
|
// Only update innerHTML when value changes externally (not from user input)
|
|
45
42
|
React.useEffect(() => {
|
|
46
|
-
if (contentRef.current
|
|
43
|
+
if (contentRef.current) {
|
|
44
|
+
if (isInternalChange.current) {
|
|
45
|
+
isInternalChange.current = false
|
|
46
|
+
return
|
|
47
|
+
}
|
|
48
|
+
|
|
47
49
|
const currentHTML = contentRef.current.innerHTML
|
|
48
50
|
if (currentHTML !== value) {
|
|
49
51
|
contentRef.current.innerHTML = value || ''
|
|
50
52
|
}
|
|
51
53
|
}
|
|
52
|
-
isInternalChange.current = false
|
|
53
54
|
}, [value])
|
|
54
55
|
|
|
55
56
|
const handleInput = () => {
|
|
@@ -60,6 +61,32 @@ export const WYSIWYGEditor: React.FC<WYSIWYGEditorProps> = ({
|
|
|
60
61
|
}
|
|
61
62
|
|
|
62
63
|
const execCommand = (command: string, value?: string) => {
|
|
64
|
+
if (command === 'insertHorizontalRule') {
|
|
65
|
+
const selection = window.getSelection()
|
|
66
|
+
if (selection && selection.rangeCount > 0) {
|
|
67
|
+
const range = selection.getRangeAt(0)
|
|
68
|
+
range.deleteContents()
|
|
69
|
+
|
|
70
|
+
const hr = document.createElement('hr')
|
|
71
|
+
const p = document.createElement('p')
|
|
72
|
+
p.innerHTML = '<br>' // Ensure the paragraph is "typeable"
|
|
73
|
+
|
|
74
|
+
// Insert HR and then the paragraph after it
|
|
75
|
+
range.insertNode(p)
|
|
76
|
+
range.insertNode(hr)
|
|
77
|
+
|
|
78
|
+
// Move cursor to the new paragraph
|
|
79
|
+
const newRange = document.createRange()
|
|
80
|
+
newRange.setStart(p, 0)
|
|
81
|
+
newRange.setEnd(p, 0)
|
|
82
|
+
newRange.collapse(true)
|
|
83
|
+
selection.removeAllRanges()
|
|
84
|
+
selection.addRange(newRange)
|
|
85
|
+
|
|
86
|
+
handleInput()
|
|
87
|
+
return
|
|
88
|
+
}
|
|
89
|
+
}
|
|
63
90
|
document.execCommand(command, false, value)
|
|
64
91
|
handleInput()
|
|
65
92
|
}
|
|
@@ -105,7 +132,6 @@ export const WYSIWYGEditor: React.FC<WYSIWYGEditorProps> = ({
|
|
|
105
132
|
>
|
|
106
133
|
<StrikeThroughIcon />
|
|
107
134
|
</button>
|
|
108
|
-
<div className="wysiwyg-editor__toolbar-divider" />
|
|
109
135
|
<button
|
|
110
136
|
type="button"
|
|
111
137
|
className="wysiwyg-editor__toolbar-btn"
|
|
@@ -126,7 +152,10 @@ export const WYSIWYGEditor: React.FC<WYSIWYGEditorProps> = ({
|
|
|
126
152
|
type="button"
|
|
127
153
|
className="wysiwyg-editor__toolbar-btn"
|
|
128
154
|
title="Paragraph"
|
|
129
|
-
onClick={() =>
|
|
155
|
+
onClick={() => {
|
|
156
|
+
execCommand('formatBlock', 'P')
|
|
157
|
+
execCommand('removeFormat')
|
|
158
|
+
}}
|
|
130
159
|
>
|
|
131
160
|
<ParagraphIcon />
|
|
132
161
|
</button>
|
|
@@ -138,7 +167,6 @@ export const WYSIWYGEditor: React.FC<WYSIWYGEditorProps> = ({
|
|
|
138
167
|
>
|
|
139
168
|
<QuoteAltIcon />
|
|
140
169
|
</button>
|
|
141
|
-
<div className="wysiwyg-editor__toolbar-divider" />
|
|
142
170
|
<button
|
|
143
171
|
type="button"
|
|
144
172
|
className="wysiwyg-editor__toolbar-btn"
|
|
@@ -155,14 +183,6 @@ export const WYSIWYGEditor: React.FC<WYSIWYGEditorProps> = ({
|
|
|
155
183
|
>
|
|
156
184
|
<NumberedListIcon />
|
|
157
185
|
</button>
|
|
158
|
-
<button
|
|
159
|
-
type="button"
|
|
160
|
-
className="wysiwyg-editor__toolbar-btn"
|
|
161
|
-
title="Task List"
|
|
162
|
-
onClick={() => execCommand('insertUnorderedList')}
|
|
163
|
-
>
|
|
164
|
-
<TaskListIcon />
|
|
165
|
-
</button>
|
|
166
186
|
<button
|
|
167
187
|
type="button"
|
|
168
188
|
className="wysiwyg-editor__toolbar-btn"
|
|
@@ -171,12 +191,16 @@ export const WYSIWYGEditor: React.FC<WYSIWYGEditorProps> = ({
|
|
|
171
191
|
>
|
|
172
192
|
<DividerIcon />
|
|
173
193
|
</button>
|
|
174
|
-
<div className="wysiwyg-editor__toolbar-divider" />
|
|
175
194
|
<button
|
|
176
195
|
type="button"
|
|
177
196
|
className="wysiwyg-editor__toolbar-btn"
|
|
178
197
|
title="Undo"
|
|
179
|
-
onClick={() =>
|
|
198
|
+
onClick={() => {
|
|
199
|
+
if (document.queryCommandEnabled('undo')) {
|
|
200
|
+
document.execCommand('undo', false)
|
|
201
|
+
handleInput()
|
|
202
|
+
}
|
|
203
|
+
}}
|
|
180
204
|
>
|
|
181
205
|
<UndoIcon />
|
|
182
206
|
</button>
|
|
@@ -184,26 +208,15 @@ export const WYSIWYGEditor: React.FC<WYSIWYGEditorProps> = ({
|
|
|
184
208
|
type="button"
|
|
185
209
|
className="wysiwyg-editor__toolbar-btn"
|
|
186
210
|
title="Redo"
|
|
187
|
-
onClick={() =>
|
|
211
|
+
onClick={() => {
|
|
212
|
+
if (document.queryCommandEnabled('redo')) {
|
|
213
|
+
document.execCommand('redo', false)
|
|
214
|
+
handleInput()
|
|
215
|
+
}
|
|
216
|
+
}}
|
|
188
217
|
>
|
|
189
218
|
<RedoIcon />
|
|
190
219
|
</button>
|
|
191
|
-
<button
|
|
192
|
-
type="button"
|
|
193
|
-
className="wysiwyg-editor__toolbar-btn"
|
|
194
|
-
title="Redo Alt"
|
|
195
|
-
onClick={() => execCommand('redo')}
|
|
196
|
-
>
|
|
197
|
-
<RedoAltIcon />
|
|
198
|
-
</button>
|
|
199
|
-
<button
|
|
200
|
-
type="button"
|
|
201
|
-
className="wysiwyg-editor__toolbar-btn"
|
|
202
|
-
title="Clear"
|
|
203
|
-
onClick={() => execCommand('removeFormat')}
|
|
204
|
-
>
|
|
205
|
-
<ClearFormattingIcon />
|
|
206
|
-
</button>
|
|
207
220
|
</div>
|
|
208
221
|
<div
|
|
209
222
|
ref={contentRef}
|
|
@@ -20,16 +20,16 @@
|
|
|
20
20
|
|
|
21
21
|
// Primary Button - Solid purple
|
|
22
22
|
&--primary {
|
|
23
|
-
background: #
|
|
23
|
+
background: #6200EE;
|
|
24
24
|
color: #ffffff;
|
|
25
25
|
|
|
26
26
|
&:hover {
|
|
27
|
-
background: #
|
|
27
|
+
background: #360083;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
&:active,
|
|
31
31
|
&:focus {
|
|
32
|
-
background: #
|
|
32
|
+
background: #360083;
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
|
|
@@ -9,19 +9,19 @@
|
|
|
9
9
|
width: 100%;
|
|
10
10
|
|
|
11
11
|
&__label {
|
|
12
|
-
font-family: var(--font-family-sans, 'Geist', sans-serif)
|
|
13
|
-
font-size:
|
|
12
|
+
font-family: var(--font-family-sans, 'Geist', sans-serif);
|
|
13
|
+
font-size: 15px;
|
|
14
14
|
font-style: normal;
|
|
15
|
-
font-weight:
|
|
16
|
-
line-height:
|
|
15
|
+
font-weight: 600;
|
|
16
|
+
line-height: 20px;
|
|
17
17
|
color: var(--label-primary, #121E52);
|
|
18
18
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
&__label-optional {
|
|
22
|
-
font-family: var(--font-family-sans, 'Geist', sans-serif)
|
|
22
|
+
font-family: var(--font-family-sans, 'Geist', sans-serif);
|
|
23
23
|
font-size: var(--text-xs-size, 11px);
|
|
24
|
-
font-weight:
|
|
24
|
+
font-weight: 400;
|
|
25
25
|
line-height: var(--text-xs-line, 14px);
|
|
26
26
|
color: var(--labels-main-label-secondary, #626a90);
|
|
27
27
|
text-align: right;
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
&__input {
|
|
39
|
-
font-family: var(--font-family-sans, 'Geist', sans-serif)
|
|
40
|
-
font-size: var(--text-
|
|
41
|
-
line-height: var(--text-
|
|
39
|
+
font-family: var(--font-family-sans, 'Geist', sans-serif);
|
|
40
|
+
font-size: var(--text-regular-size, 15px);
|
|
41
|
+
line-height: var(--text-regular-line, 20px);
|
|
42
42
|
flex: 1 0 0;
|
|
43
43
|
background-color: var(--surfaces-main-background-secondary);
|
|
44
44
|
border: 2px solid var(--border-primary);
|
|
@@ -49,6 +49,10 @@
|
|
|
49
49
|
width: 100%;
|
|
50
50
|
transition: all 0.2s ease;
|
|
51
51
|
|
|
52
|
+
@media (max-width: 768px) {
|
|
53
|
+
font-size: 16px;
|
|
54
|
+
}
|
|
55
|
+
|
|
52
56
|
&:focus {
|
|
53
57
|
outline: none;
|
|
54
58
|
border-color: var(--border-selected, #6200EE);
|
|
@@ -61,9 +65,9 @@
|
|
|
61
65
|
}
|
|
62
66
|
|
|
63
67
|
&__textarea {
|
|
64
|
-
font-family: var(--font-family-sans, 'Geist', sans-serif)
|
|
65
|
-
font-size: var(--text-
|
|
66
|
-
line-height: var(--text-
|
|
68
|
+
font-family: var(--font-family-sans, 'Geist', sans-serif);
|
|
69
|
+
font-size: var(--text-regular-size, 15px);
|
|
70
|
+
line-height: var(--text-regular-line, 20px);
|
|
67
71
|
color: var(--labels-main-label-primary, #121e52);
|
|
68
72
|
background-color: var(--surfaces-main-background-secondary, #f8f8fa);
|
|
69
73
|
border: 1px solid var(--borders-main-border-primary, #e8e9ef);
|
|
@@ -74,6 +78,10 @@
|
|
|
74
78
|
resize: vertical;
|
|
75
79
|
transition: all 0.2s ease;
|
|
76
80
|
|
|
81
|
+
@media (max-width: 768px) {
|
|
82
|
+
font-size: 16px;
|
|
83
|
+
}
|
|
84
|
+
|
|
77
85
|
&:focus {
|
|
78
86
|
outline: none;
|
|
79
87
|
border-color: var(--border-selected, #6200EE);
|
|
@@ -98,10 +106,14 @@
|
|
|
98
106
|
flex: 1;
|
|
99
107
|
border: none;
|
|
100
108
|
background: transparent;
|
|
101
|
-
font-family: var(--font-family-sans, 'Geist', sans-serif)
|
|
102
|
-
font-size: var(--text-
|
|
103
|
-
line-height: var(--text-
|
|
104
|
-
color: var(--
|
|
109
|
+
font-family: var(--font-family-sans, 'Geist', sans-serif);
|
|
110
|
+
font-size: var(--text-regular-size, 15px);
|
|
111
|
+
line-height: var(--text-regular-line, 20px);
|
|
112
|
+
color: var(--label-primary);
|
|
113
|
+
|
|
114
|
+
@media (max-width: 768px) {
|
|
115
|
+
font-size: 16px;
|
|
116
|
+
}
|
|
105
117
|
|
|
106
118
|
&:focus {
|
|
107
119
|
outline: none;
|
|
@@ -130,7 +142,7 @@
|
|
|
130
142
|
border: 2px solid var(--borders-main-border-primary, #e8e9ef);
|
|
131
143
|
border-radius: var(--radius-md, 4px);
|
|
132
144
|
text-align: center;
|
|
133
|
-
font-family: var(--font-family-sans, 'Geist', sans-serif)
|
|
145
|
+
font-family: var(--font-family-sans, 'Geist', sans-serif);
|
|
134
146
|
font-size: var(--text-lg-size, 18px);
|
|
135
147
|
font-weight: var(--heading-h3-weight, 600);
|
|
136
148
|
color: var(--labels-main-label-primary, #121e52);
|
|
@@ -144,17 +156,17 @@
|
|
|
144
156
|
}
|
|
145
157
|
|
|
146
158
|
&__helper-text {
|
|
147
|
-
font-family: var(--font-family-sans, 'Geist', sans-serif)
|
|
148
|
-
font-size:
|
|
159
|
+
font-family: var(--font-family-sans, 'Geist', sans-serif);
|
|
160
|
+
font-size: var(--text-regular-size, 15px);
|
|
149
161
|
font-style: normal;
|
|
150
162
|
font-weight: 400;
|
|
151
|
-
line-height:
|
|
163
|
+
line-height: var(--text-regular-line, 20px);
|
|
152
164
|
margin-top: 2px;
|
|
153
165
|
color: var(--label-secondary, #626A90);
|
|
154
166
|
}
|
|
155
167
|
|
|
156
168
|
&__error-text {
|
|
157
|
-
font-family: var(--font-family-sans, 'Geist', sans-serif)
|
|
169
|
+
font-family: var(--font-family-sans, 'Geist', sans-serif);
|
|
158
170
|
font-size: 11px;
|
|
159
171
|
font-style: normal;
|
|
160
172
|
font-weight: 400;
|
|
@@ -387,7 +387,7 @@
|
|
|
387
387
|
/* Borders */
|
|
388
388
|
--border-primary: var(--tone-light);
|
|
389
389
|
--border-secondary: var(--tone-regular);
|
|
390
|
-
--border-selected: var(--
|
|
390
|
+
--border-selected: var(--neutral-600);
|
|
391
391
|
--border-action: var(--actions-regular);
|
|
392
392
|
--border-status-error: var(--errors-lighter);
|
|
393
393
|
--border-status-success: var(--success-lighter);
|