@flexiui/svelte-rich-text 0.0.50 → 0.0.51
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/RichText.svelte +801 -41
- package/dist/extensions/Audio.d.ts +2 -0
- package/dist/extensions/Audio.js +5 -0
- package/dist/extensions/AudioPlayer.svelte +30 -13
- package/dist/extensions/AudioPlayer.svelte.d.ts +1 -0
- package/dist/extensions/AudioPlayerWrapper.svelte +1 -0
- package/dist/extensions/NodeLineHeight.d.ts +1 -1
- package/dist/extensions/NodeLineHeight.js +14 -11
- package/dist/extensions/audioStore.d.ts +1 -0
- package/dist/extensions/audioStore.js +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/renderRichText.js +2 -1
- package/dist/styles.css +300 -207
- package/package.json +1 -1
package/dist/styles.css
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
:root {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
2
|
+
--purple-light: #d2bcff29;
|
|
3
|
+
--purple: #535bf2;
|
|
4
|
+
--black: #000;
|
|
5
|
+
--white: #fff;
|
|
6
|
+
--gray-1: #f0f0f0;
|
|
7
|
+
--gray-2: #e0e0e0;
|
|
8
|
+
--gray-3: #c0c0c0;
|
|
9
|
+
|
|
10
|
+
--fl-editor-radius: 12px;
|
|
11
|
+
--fl-editor-bg: #242424;
|
|
12
|
+
--fl-toolbar-sticky-position: 0;
|
|
13
|
+
--fl-toolbar-z-index: 10;
|
|
14
|
+
--fl-toolbar-padding: 6px;
|
|
15
|
+
--fl-toolbar-gap: 5px;
|
|
16
|
+
--fl-toolbar-bg: #242424;
|
|
17
|
+
|
|
18
|
+
--fl-doc-max-width: 1024px;
|
|
19
|
+
--fl-doc-padding: 2rem;
|
|
20
|
+
--fl-doc-bg: transparent;
|
|
21
|
+
--fl-doc-margin-inline: auto;
|
|
22
|
+
--fl-doc-margin-block: 2rem;
|
|
23
|
+
--fl-doc-radius: 0;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
/* Basic editor styles */
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
box-sizing: border-box;
|
|
60
60
|
|
|
61
61
|
&.fl-toolbar-dropdown-panel--table {
|
|
62
|
-
min-width: 160px
|
|
62
|
+
min-width: 160px;
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
|
|
@@ -75,249 +75,343 @@
|
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
+
.flex-auto {
|
|
79
|
+
flex: auto;
|
|
80
|
+
}
|
|
78
81
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
gap: var(--fl-toolbar-gap);
|
|
101
|
-
padding: var(--fl-toolbar-padding);
|
|
102
|
-
position: sticky;
|
|
103
|
-
top: var(--fl-toolbar-sticky-position, 0);
|
|
104
|
-
z-index: var(--fl-toolbar-z-index, 10);
|
|
105
|
-
background: var(--fl-toolbar-bg, #242424);
|
|
106
|
-
border-radius: var(--fl-editor-radius);
|
|
82
|
+
.fl-rich-text {
|
|
83
|
+
display: flex;
|
|
84
|
+
flex-direction: column;
|
|
85
|
+
width: 100%;
|
|
86
|
+
height: 100%;
|
|
87
|
+
min-height: 56px;
|
|
88
|
+
background-color: var(--fl-editor-bg, #242424);
|
|
89
|
+
color: var(--text-color);
|
|
90
|
+
box-sizing: border-box;
|
|
91
|
+
border-radius: var(--fl-editor-radius);
|
|
92
|
+
|
|
93
|
+
.fl-editor-image-url-input {
|
|
94
|
+
white-space: nowrap;
|
|
95
|
+
text-overflow: ellipsis;
|
|
96
|
+
max-width: 158px;
|
|
97
|
+
outline: none;
|
|
98
|
+
min-height: 24px;
|
|
99
|
+
padding: 0 3px;
|
|
100
|
+
border: none;
|
|
101
|
+
background: transparent;
|
|
102
|
+
line-height: 1.6;
|
|
107
103
|
}
|
|
108
104
|
|
|
109
|
-
.fl-
|
|
105
|
+
.fl-bubble-menu {
|
|
106
|
+
padding: 6px;
|
|
107
|
+
background: #242424b0;
|
|
108
|
+
border: 1px solid #ffffff12;
|
|
109
|
+
backdrop-filter: blur(16px);
|
|
110
|
+
border-radius: 14px;
|
|
110
111
|
display: flex;
|
|
111
|
-
|
|
112
|
-
|
|
112
|
+
gap: 6px;
|
|
113
|
+
position: relative;
|
|
114
|
+
z-index: 9;
|
|
113
115
|
|
|
114
116
|
button {
|
|
115
|
-
|
|
116
|
-
flex: auto;
|
|
117
|
+
border-radius: 9px;
|
|
117
118
|
border: none;
|
|
118
|
-
background: rgba(255, 255, 255, 0.1);
|
|
119
|
-
border-radius: 8px;
|
|
120
|
-
color: var(--text-color);
|
|
121
|
-
font-size: 14px;
|
|
122
119
|
display: flex;
|
|
123
120
|
align-items: center;
|
|
124
121
|
justify-content: center;
|
|
125
|
-
|
|
126
|
-
|
|
122
|
+
padding: 6px 11px;
|
|
123
|
+
min-width: 30px;
|
|
124
|
+
min-height: 30px;
|
|
125
|
+
background: rgba(255, 255, 255, 0.1);
|
|
126
|
+
transition: background 0.3s ease;
|
|
127
127
|
cursor: pointer;
|
|
128
|
-
line-height: 1;
|
|
129
|
-
min-height: 32px;
|
|
130
128
|
|
|
131
|
-
&.fl-
|
|
132
|
-
|
|
133
|
-
}
|
|
129
|
+
&.fl-bubble-menu-mark-button {
|
|
130
|
+
padding-inline: 6px;
|
|
134
131
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
132
|
+
svg {
|
|
133
|
+
width: 16px;
|
|
134
|
+
height: 16px;
|
|
138
135
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
136
|
+
&.toogle-dropdown-button-icon {
|
|
137
|
+
width: 8px;
|
|
138
|
+
margin: 0 2px 0 6px;
|
|
139
|
+
}
|
|
143
140
|
}
|
|
144
141
|
}
|
|
145
142
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
143
|
+
&.is-active {
|
|
144
|
+
background: var(--fl-editor-accent-color);
|
|
145
|
+
color: white;
|
|
146
|
+
|
|
147
|
+
&.accent-soft {
|
|
148
|
+
background: transparent;
|
|
149
|
+
color: var(--fl-editor-accent-color);
|
|
150
|
+
position: relative;
|
|
151
|
+
|
|
152
|
+
&::after {
|
|
153
|
+
content: "";
|
|
154
|
+
position: absolute;
|
|
155
|
+
width: 100%;
|
|
156
|
+
height: 100%;
|
|
157
|
+
left: 0;
|
|
158
|
+
top: 0;
|
|
159
|
+
background: var(--fl-editor-accent-color);
|
|
160
|
+
opacity: 0.15;
|
|
161
|
+
border-radius: inherit;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
149
164
|
}
|
|
150
165
|
}
|
|
151
166
|
}
|
|
167
|
+
}
|
|
152
168
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
169
|
+
.fl-rich-text-toolbar {
|
|
170
|
+
display: flex;
|
|
171
|
+
flex-wrap: nowrap;
|
|
172
|
+
overflow: auto;
|
|
173
|
+
align-items: center;
|
|
174
|
+
gap: var(--fl-toolbar-gap);
|
|
175
|
+
padding: var(--fl-toolbar-padding);
|
|
176
|
+
position: sticky;
|
|
177
|
+
top: var(--fl-toolbar-sticky-position, 0);
|
|
178
|
+
z-index: var(--fl-toolbar-z-index, 10);
|
|
179
|
+
background: var(--fl-toolbar-bg, #242424);
|
|
180
|
+
border-radius: var(--fl-editor-radius);
|
|
181
|
+
}
|
|
157
182
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
align-items: center;
|
|
163
|
-
justify-content: center;
|
|
164
|
-
font-weight: 500;
|
|
165
|
-
border: none;
|
|
166
|
-
padding: 0px;
|
|
167
|
-
font-size: 11px;
|
|
168
|
-
border-radius: 3px;
|
|
169
|
-
outline: 1px dashed #818181;
|
|
170
|
-
scale: 1.1;
|
|
171
|
-
}
|
|
183
|
+
.fl-rich-text-toolbar-group {
|
|
184
|
+
display: flex;
|
|
185
|
+
flex-wrap: nowrap;
|
|
186
|
+
gap: var(--fl-toolbar-gap);
|
|
172
187
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
border:
|
|
179
|
-
|
|
188
|
+
button {
|
|
189
|
+
padding: 8px 8px;
|
|
190
|
+
flex: auto;
|
|
191
|
+
border: none;
|
|
192
|
+
background: rgba(255, 255, 255, 0.1);
|
|
193
|
+
border-radius: 8px;
|
|
194
|
+
color: var(--text-color);
|
|
195
|
+
font-size: 14px;
|
|
180
196
|
display: flex;
|
|
181
197
|
align-items: center;
|
|
182
198
|
justify-content: center;
|
|
183
|
-
|
|
199
|
+
white-space: nowrap;
|
|
200
|
+
gap: 2px;
|
|
201
|
+
cursor: pointer;
|
|
202
|
+
line-height: 1;
|
|
203
|
+
min-height: 32px;
|
|
184
204
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
grid-template-columns: repeat(7, 1fr);
|
|
189
|
-
gap: 6px;
|
|
190
|
-
align-items: center;
|
|
205
|
+
&.fl-font-size-button {
|
|
206
|
+
font-size: 14px;
|
|
207
|
+
}
|
|
191
208
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
border-radius: 100%;
|
|
196
|
-
align-items: center;
|
|
197
|
-
justify-content: center;
|
|
198
|
-
outline: 1px solid #83828238;
|
|
199
|
-
position: relative;
|
|
200
|
-
aspect-ratio: 1;
|
|
201
|
-
border: none;
|
|
202
|
-
padding: 0;
|
|
203
|
-
cursor: pointer;
|
|
209
|
+
& svg {
|
|
210
|
+
width: 16px;
|
|
211
|
+
height: 16px;
|
|
204
212
|
|
|
205
|
-
&.
|
|
206
|
-
|
|
213
|
+
&.toogle-dropdown-button-icon {
|
|
214
|
+
width: 7px;
|
|
215
|
+
height: 7px;
|
|
216
|
+
margin-left: 4px;
|
|
207
217
|
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
&:disabled {
|
|
221
|
+
cursor: not-allowed;
|
|
222
|
+
opacity: 0.5;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
208
226
|
|
|
209
|
-
|
|
227
|
+
|
|
228
|
+
button {
|
|
229
|
+
&.is-active {
|
|
230
|
+
background: var(--fl-editor-accent-color);
|
|
231
|
+
color: white;
|
|
232
|
+
|
|
233
|
+
&.accent-soft {
|
|
234
|
+
background: transparent;
|
|
235
|
+
color: var(--fl-editor-accent-color);
|
|
236
|
+
position: relative;
|
|
237
|
+
|
|
238
|
+
&::after {
|
|
210
239
|
content: "";
|
|
211
|
-
width: 2px;
|
|
212
|
-
height: 100%;
|
|
213
|
-
background: red;
|
|
214
240
|
position: absolute;
|
|
215
|
-
|
|
241
|
+
width: 100%;
|
|
242
|
+
height: 100%;
|
|
243
|
+
left: 0;
|
|
244
|
+
top: 0;
|
|
245
|
+
background: var(--fl-editor-accent-color);
|
|
246
|
+
opacity: 0.15;
|
|
247
|
+
border-radius: inherit;
|
|
216
248
|
}
|
|
217
249
|
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
218
252
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
253
|
+
.special-box-icon {
|
|
254
|
+
width: 16px;
|
|
255
|
+
height: 16px;
|
|
256
|
+
display: flex;
|
|
257
|
+
align-items: center;
|
|
258
|
+
justify-content: center;
|
|
259
|
+
font-weight: 500;
|
|
260
|
+
border: none;
|
|
261
|
+
padding: 0px;
|
|
262
|
+
font-size: 11px;
|
|
263
|
+
border-radius: 3px;
|
|
264
|
+
outline: 1px dashed currentColor;
|
|
265
|
+
scale: 1.1;
|
|
266
|
+
}
|
|
231
267
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
268
|
+
.fl-button-color-text-popover {
|
|
269
|
+
color: inherit;
|
|
270
|
+
width: 16px;
|
|
271
|
+
height: 16px;
|
|
272
|
+
border-radius: 100%;
|
|
273
|
+
border: 1px solid #d7d7d78a;
|
|
274
|
+
box-sizing: border-box;
|
|
275
|
+
display: flex;
|
|
276
|
+
align-items: center;
|
|
277
|
+
justify-content: center;
|
|
278
|
+
}
|
|
235
279
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
280
|
+
.fl-editor-color-palette {
|
|
281
|
+
width: 100%;
|
|
282
|
+
display: grid;
|
|
283
|
+
grid-template-columns: repeat(7, 1fr);
|
|
284
|
+
gap: 6px;
|
|
285
|
+
align-items: center;
|
|
240
286
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
287
|
+
.fl-color-swatch {
|
|
288
|
+
display: flex;
|
|
289
|
+
min-width: 17px;
|
|
290
|
+
border-radius: 100%;
|
|
291
|
+
align-items: center;
|
|
292
|
+
justify-content: center;
|
|
293
|
+
outline: 1px solid #83828238;
|
|
294
|
+
position: relative;
|
|
295
|
+
aspect-ratio: 1;
|
|
296
|
+
border: none;
|
|
297
|
+
padding: 0;
|
|
298
|
+
cursor: pointer;
|
|
246
299
|
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
background: conic-gradient(in hsl longer hue, red 0 100%);
|
|
300
|
+
&.active {
|
|
301
|
+
box-shadow: 0 0 0 2px #ffffff30;
|
|
302
|
+
}
|
|
251
303
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
304
|
+
&.unset-color::after {
|
|
305
|
+
content: "";
|
|
306
|
+
width: 2px;
|
|
307
|
+
height: 100%;
|
|
308
|
+
background: red;
|
|
309
|
+
position: absolute;
|
|
310
|
+
transform: rotate(30deg) scaleY(1.2);
|
|
255
311
|
}
|
|
256
312
|
}
|
|
257
313
|
|
|
258
|
-
|
|
259
|
-
display: flex;
|
|
260
|
-
align
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
314
|
+
input[type="color"] {
|
|
315
|
+
display: inline-flex;
|
|
316
|
+
vertical-align: bottom;
|
|
317
|
+
border: none;
|
|
318
|
+
border-radius: var(--radius);
|
|
319
|
+
padding: 0;
|
|
320
|
+
min-width: 17px;
|
|
321
|
+
max-height: 17px;
|
|
322
|
+
aspect-ratio: 1;
|
|
323
|
+
background: transparent;
|
|
324
|
+
width: auto;
|
|
325
|
+
border-radius: 100%;
|
|
266
326
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
align-items: center;
|
|
271
|
-
justify-content: center;
|
|
272
|
-
padding: 2px;
|
|
273
|
-
backdrop-filter: blur(5px);
|
|
274
|
-
cursor: pointer;
|
|
275
|
-
min-height: 18px;
|
|
276
|
-
min-width: 18px;
|
|
277
|
-
border-radius: 100%;
|
|
278
|
-
background: #8989891f;
|
|
327
|
+
&::-webkit-color-swatch-wrapper {
|
|
328
|
+
padding: 0;
|
|
329
|
+
}
|
|
279
330
|
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
331
|
+
&::-webkit-color-swatch {
|
|
332
|
+
border: 0;
|
|
333
|
+
border-radius: var(--radius);
|
|
334
|
+
}
|
|
283
335
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
}
|
|
336
|
+
&::-moz-color-swatch {
|
|
337
|
+
border: 0;
|
|
338
|
+
border-radius: var(--radius);
|
|
288
339
|
}
|
|
340
|
+
}
|
|
289
341
|
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
padding: 0;
|
|
298
|
-
outline: none;
|
|
342
|
+
.fl-color-picker-btn {
|
|
343
|
+
cursor: pointer;
|
|
344
|
+
position: relative;
|
|
345
|
+
background: conic-gradient(in hsl longer hue, red 0 100%);
|
|
346
|
+
|
|
347
|
+
& input {
|
|
348
|
+
opacity: 0;
|
|
299
349
|
}
|
|
300
350
|
}
|
|
351
|
+
}
|
|
301
352
|
|
|
302
|
-
|
|
353
|
+
.fl-font-size-editor {
|
|
354
|
+
display: flex;
|
|
355
|
+
align-items: center;
|
|
356
|
+
gap: 4px;
|
|
357
|
+
padding: 0 6px;
|
|
358
|
+
border-radius: 8px;
|
|
359
|
+
background: rgba(255, 255, 255, 0.1);
|
|
360
|
+
min-height: 32px;
|
|
361
|
+
|
|
362
|
+
& button {
|
|
363
|
+
border: none;
|
|
303
364
|
display: flex;
|
|
304
365
|
align-items: center;
|
|
305
|
-
|
|
306
|
-
|
|
366
|
+
justify-content: center;
|
|
367
|
+
padding: 2px;
|
|
368
|
+
backdrop-filter: blur(5px);
|
|
369
|
+
cursor: pointer;
|
|
370
|
+
min-height: 18px;
|
|
371
|
+
min-width: 18px;
|
|
372
|
+
border-radius: 100%;
|
|
373
|
+
background: #8989891f;
|
|
374
|
+
|
|
375
|
+
&:hover {
|
|
376
|
+
background: #89898966;
|
|
377
|
+
}
|
|
307
378
|
|
|
308
|
-
|
|
309
|
-
|
|
379
|
+
& svg {
|
|
380
|
+
width: 12px;
|
|
381
|
+
height: 12px;
|
|
382
|
+
}
|
|
310
383
|
}
|
|
311
384
|
|
|
312
|
-
|
|
313
|
-
|
|
385
|
+
input {
|
|
386
|
+
width: 28px;
|
|
387
|
+
text-align: center;
|
|
388
|
+
border: none;
|
|
389
|
+
background: transparent;
|
|
390
|
+
color: var(--text-color);
|
|
314
391
|
font-size: 14px;
|
|
392
|
+
padding: 0;
|
|
393
|
+
outline: none;
|
|
394
|
+
}
|
|
315
395
|
}
|
|
316
396
|
|
|
317
|
-
.
|
|
318
|
-
|
|
397
|
+
.fl-range-element {
|
|
398
|
+
display: flex;
|
|
399
|
+
align-items: center;
|
|
400
|
+
gap: 8px;
|
|
319
401
|
}
|
|
320
402
|
|
|
403
|
+
.fl-range-element input {
|
|
404
|
+
accent-color: #ffffff;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
.fl-range-element-value {
|
|
408
|
+
padding: 0 6px;
|
|
409
|
+
font-size: 14px;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
.ProseMirror-selectednode {
|
|
413
|
+
outline: 2px solid #535bf2;
|
|
414
|
+
}
|
|
321
415
|
|
|
322
416
|
.media-grid-view-content {
|
|
323
417
|
--fl-grid-cols: 2;
|
|
@@ -398,9 +492,8 @@
|
|
|
398
492
|
}
|
|
399
493
|
}
|
|
400
494
|
|
|
401
|
-
|
|
402
495
|
.node-MediaGridComponent {
|
|
403
|
-
|
|
496
|
+
margin: 1.75rem 0;
|
|
404
497
|
}
|
|
405
498
|
|
|
406
499
|
.fl-media-grid {
|
|
@@ -426,4 +519,4 @@
|
|
|
426
519
|
width: 100%;
|
|
427
520
|
}
|
|
428
521
|
}
|
|
429
|
-
}
|
|
522
|
+
}
|