@crystallize/design-system 1.12.0 → 1.13.2
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/CHANGELOG.md +19 -0
- package/dist/draggable-block-menu-KKHDNKJA.svg +1 -0
- package/dist/index.css +565 -1025
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3295 -3431
- package/dist/index.mjs +3199 -3335
- package/package.json +6 -7
- package/src/button/Button.stories.tsx +1 -0
- package/src/card/card.stories.tsx +1 -0
- package/src/checkbox/checkbox.stories.tsx +1 -1
- package/src/checkbox/checkbox.tsx +1 -1
- package/src/colors/Colors.stories.tsx +3 -3
- package/src/dialog/config.tsx +1 -1
- package/src/dialog/index.tsx +1 -1
- package/src/dropdown-menu/dropdown-menu-item.tsx +2 -2
- package/src/dropdown-menu/dropdown-menu-label.tsx +1 -1
- package/src/icon-button/IconButton.stories.tsx +1 -0
- package/src/iconography/Icon.stories.tsx +1 -0
- package/src/inline-radio/inline-radio.stories.tsx +3 -3
- package/src/inline-radio/inline-radio.tsx +2 -2
- package/src/input/input.tsx +1 -1
- package/src/input-with-label/input-with-label.tsx +1 -1
- package/src/label/label.stories.tsx +1 -0
- package/src/progress/Progress.stories.tsx +2 -1
- package/src/progress/progress.tsx +1 -1
- package/src/radio/radio.stories.tsx +1 -1
- package/src/radio/radio.tsx +1 -1
- package/src/rich-text-editor/i18n/translations/en.ts +2 -2
- package/src/rich-text-editor/plugins/ActionsPlugin/index.css +3 -0
- package/src/rich-text-editor/plugins/ActionsPlugin/index.tsx +1 -2
- package/src/rich-text-editor/plugins/AutoLinkPlugin/index.tsx +1 -1
- package/src/rich-text-editor/plugins/CodeActionMenuPlugin/components/CopyButton/index.tsx +6 -2
- package/src/rich-text-editor/plugins/CodeActionMenuPlugin/components/PrettierButton/index.tsx +10 -6
- package/src/rich-text-editor/plugins/CodeActionMenuPlugin/index.css +32 -17
- package/src/rich-text-editor/plugins/CodeActionMenuPlugin/index.tsx +3 -4
- package/src/rich-text-editor/plugins/DimensionsDetectorPlugin/index.tsx +49 -0
- package/src/rich-text-editor/plugins/DraggableBlockPlugin/index.css +14 -14
- package/src/rich-text-editor/plugins/DraggableBlockPlugin/index.tsx +4 -4
- package/src/rich-text-editor/plugins/FloatingLinkEditorPlugin/index.css +87 -21
- package/src/rich-text-editor/plugins/FloatingLinkEditorPlugin/index.tsx +11 -17
- package/src/rich-text-editor/plugins/FloatingTextFormatToolbarPlugin/index.css +10 -2
- package/src/rich-text-editor/plugins/FloatingTextFormatToolbarPlugin/index.tsx +17 -17
- package/src/rich-text-editor/plugins/LinkPlugin/index.tsx +1 -1
- package/src/rich-text-editor/plugins/ListMaxIndentLevelPlugin/index.ts +10 -21
- package/src/rich-text-editor/plugins/TableActionMenuPlugin/index.css +6 -0
- package/src/rich-text-editor/plugins/TableActionMenuPlugin/index.tsx +2 -2
- package/src/rich-text-editor/plugins/ToolbarPlugin/index.css +115 -0
- package/src/rich-text-editor/plugins/ToolbarPlugin/index.tsx +57 -78
- package/src/rich-text-editor/plugins/ToolbarPlugin/insert-table.tsx +5 -5
- package/src/rich-text-editor/rich-text-editor-icons.css +213 -0
- package/src/rich-text-editor/rich-text-editor.css +33 -913
- package/src/rich-text-editor/rich-text-editor.stories.tsx +11 -0
- package/src/rich-text-editor/rich-text-editor.tsx +13 -27
- package/src/rich-text-editor/themes/CrystallizeRTEditorTheme.ts +1 -1
- package/src/rich-text-editor/ui/LinkPreview.tsx +7 -8
- package/src/rich-text-editor/utils/getSelectedNode.ts +4 -5
- package/src/rich-text-editor/utils/point.ts +4 -7
- package/src/rich-text-editor/utils/rect.ts +18 -41
- package/src/rich-text-editor/utils/url.ts +1 -2
- package/src/select/select-root.tsx +1 -1
- package/src/select/select.stories.tsx +1 -1
- package/src/select/select.ts +0 -1
- package/src/slider/Slider.stories.tsx +2 -1
- package/src/slider/slider.tsx +2 -2
- package/src/spinner/Spinner.stories.tsx +1 -0
- package/src/spinner/index.tsx +1 -1
- package/src/tag/Tag.stories.tsx +1 -0
- package/dist/camera-CR7D2PNH.svg +0 -1
- package/dist/clipboard-OSEFDF25.svg +0 -1
- package/dist/gear-ICMT4NTP.svg +0 -1
- package/dist/journal-code-XUT44HDV.svg +0 -1
- package/dist/lock-WCYOZOHW.svg +0 -1
- package/dist/lock-fill-JZSKOSHK.svg +0 -1
- package/dist/pencil-fill-STFSC26F.svg +0 -1
- package/dist/plug-HGGGEVS3.svg +0 -1
- package/dist/plug-fill-OTG3U4TN.svg +0 -1
- package/src/rich-text-editor/hooks/useReport.ts +0 -64
- package/src/rich-text-editor/plugins/CodeActionMenuPlugin/components/PrettierButton/index.css +0 -14
- package/src/rich-text-editor/ui/LinkPreview.css +0 -57
- package/src/rich-text-editor/utils/isMobileWidth.ts +0 -7
- package/src/rich-text-editor/utils/joinClasses.ts +0 -13
- package/src/rich-text-editor/utils/swipe.ts +0 -127
|
@@ -200,65 +200,63 @@ function BlockFormatDropDown({
|
|
|
200
200
|
<>
|
|
201
201
|
<DropdownMenu.Item onClick={formatParagraph}>
|
|
202
202
|
<i
|
|
203
|
-
className={`
|
|
204
|
-
blockType === 'paragraph' ? '
|
|
203
|
+
className={`c-rte-icon-paragraph c-rte-toolbar__block-format__icon ${
|
|
204
|
+
blockType === 'paragraph' ? 'selected' : ''
|
|
205
205
|
}`}
|
|
206
206
|
/>
|
|
207
|
-
|
|
208
|
-
<i className="icon paragraph" />
|
|
209
|
-
<span className={`${blockType === 'paragraph' ? 'font-bold' : 'font-normal'} text-sm px-3 min-w-[150px]`}>
|
|
207
|
+
<span className={`c-rte-toolbar__block-format__text ${blockType === 'paragraph' ? 'selected' : ''}`}>
|
|
210
208
|
Normal
|
|
211
209
|
</span>
|
|
212
210
|
</DropdownMenu.Item>
|
|
213
211
|
{headings.map(headingSize => (
|
|
214
212
|
<DropdownMenu.Item key={headingSize} onClick={() => formatHeading(headingSize)}>
|
|
215
213
|
<i
|
|
216
|
-
className={`icon
|
|
217
|
-
blockType === headingSize ? '
|
|
214
|
+
className={`c-rte-icon-${headingSize} c-rte-toolbar__block-format__icon ${
|
|
215
|
+
blockType === headingSize ? 'selected' : ''
|
|
218
216
|
}`}
|
|
219
217
|
/>
|
|
220
|
-
<span className={
|
|
218
|
+
<span className={`c-rte-toolbar__block-format__text ${blockType === headingSize ? 'selected' : ''}`}>
|
|
221
219
|
{headingTypeToBlockName[headingSize]}
|
|
222
220
|
</span>
|
|
223
221
|
</DropdownMenu.Item>
|
|
224
222
|
))}
|
|
225
223
|
<DropdownMenu.Item onClick={formatBulletList}>
|
|
226
224
|
<i
|
|
227
|
-
className={`icon
|
|
228
|
-
blockType === 'bullet' ? '
|
|
225
|
+
className={`c-rte-icon-bullet-list c-rte-toolbar__block-format__icon ${
|
|
226
|
+
blockType === 'bullet' ? 'selected' : ''
|
|
229
227
|
}`}
|
|
230
228
|
/>
|
|
231
|
-
<span className={
|
|
229
|
+
<span className={`c-rte-toolbar__block-format__text ${blockType === 'bullet' ? 'selected' : ''}`}>
|
|
232
230
|
Bullet List
|
|
233
231
|
</span>
|
|
234
232
|
</DropdownMenu.Item>
|
|
235
233
|
<DropdownMenu.Item onClick={formatNumberedList}>
|
|
236
234
|
<i
|
|
237
|
-
className={`icon
|
|
238
|
-
blockType === 'number' ? '
|
|
235
|
+
className={`c-rte-icon-numbered-list c-rte-toolbar__block-format__icon ${
|
|
236
|
+
blockType === 'number' ? 'selected' : ''
|
|
239
237
|
}`}
|
|
240
238
|
/>
|
|
241
|
-
<span className={
|
|
239
|
+
<span className={`c-rte-toolbar__block-format__text ${blockType === 'number' ? 'selected' : ''}`}>
|
|
242
240
|
Numbered List
|
|
243
241
|
</span>
|
|
244
242
|
</DropdownMenu.Item>
|
|
245
243
|
<DropdownMenu.Item onClick={formatQuote} data-testid="toggle-block-format-quote">
|
|
246
244
|
<i
|
|
247
|
-
className={`
|
|
248
|
-
blockType === 'quote' ? '
|
|
245
|
+
className={`c-rte-icon-quote c-rte-toolbar__block-format__icon ${
|
|
246
|
+
blockType === 'quote' ? 'selected' : ''
|
|
249
247
|
}`}
|
|
250
248
|
/>
|
|
251
|
-
<span className={
|
|
249
|
+
<span className={`c-rte-toolbar__block-format__text ${blockType === 'quote' ? 'selected' : ''}`}>
|
|
252
250
|
Quote
|
|
253
251
|
</span>
|
|
254
252
|
</DropdownMenu.Item>
|
|
255
253
|
<DropdownMenu.Item onClick={formatCode} data-testid="toggle-block-format-code">
|
|
256
254
|
<i
|
|
257
|
-
className={`icon code border w-6 h-6 rounded-md bg-no-repeat bg-center bg-[length:18px_18px] ${
|
|
258
|
-
blockType === 'code' ? '
|
|
255
|
+
className={`icon c-rte-icon-code border w-6 h-6 rounded-md bg-no-repeat bg-center bg-[length:18px_18px] ${
|
|
256
|
+
blockType === 'code' ? 'selected' : ''
|
|
259
257
|
}`}
|
|
260
258
|
/>
|
|
261
|
-
<span className={
|
|
259
|
+
<span className={`c-rte-toolbar__block-format__text ${blockType === 'code' ? 'selected' : ''}`}>
|
|
262
260
|
Code block
|
|
263
261
|
</span>
|
|
264
262
|
</DropdownMenu.Item>
|
|
@@ -270,7 +268,7 @@ function BlockFormatDropDown({
|
|
|
270
268
|
aria-label="Formatting options for text style"
|
|
271
269
|
data-testid="toggle-block-format"
|
|
272
270
|
>
|
|
273
|
-
<i className={`
|
|
271
|
+
<i className={`c-rte-toolbar__toggle-icon c-rte-icon-${blockType}`} />
|
|
274
272
|
<Icon.Arrow />
|
|
275
273
|
</Button>
|
|
276
274
|
</DropdownMenu.Root>
|
|
@@ -278,7 +276,7 @@ function BlockFormatDropDown({
|
|
|
278
276
|
}
|
|
279
277
|
|
|
280
278
|
function Divider(): JSX.Element {
|
|
281
|
-
return <div className="
|
|
279
|
+
return <div className="c-rte-toolbar__divider" />;
|
|
282
280
|
}
|
|
283
281
|
|
|
284
282
|
export default function ToolbarPlugin({
|
|
@@ -448,8 +446,8 @@ export default function ToolbarPlugin({
|
|
|
448
446
|
);
|
|
449
447
|
|
|
450
448
|
return (
|
|
451
|
-
<div className="toolbar">
|
|
452
|
-
<div className="
|
|
449
|
+
<div className="c-rte-toolbar">
|
|
450
|
+
<div className="c-rte-toolbar__inner">
|
|
453
451
|
<IconButton
|
|
454
452
|
disabled={!canUndo || !isEditable}
|
|
455
453
|
onClick={() => {
|
|
@@ -460,9 +458,7 @@ export default function ToolbarPlugin({
|
|
|
460
458
|
aria-label={tr('actionUndoLabel')}
|
|
461
459
|
>
|
|
462
460
|
<i
|
|
463
|
-
className={`
|
|
464
|
-
canUndo ? 'opacity-100' : 'opacity-30'
|
|
465
|
-
}
|
|
461
|
+
className={`c-rte-icon-undo c-rte-toolbar__icon ${!canUndo ? 'disabled' : ''}
|
|
466
462
|
`}
|
|
467
463
|
/>
|
|
468
464
|
</IconButton>
|
|
@@ -475,11 +471,7 @@ export default function ToolbarPlugin({
|
|
|
475
471
|
title={tr(IS_APPLE ? 'actionRedoTitleApple' : 'actionRedoTitle')}
|
|
476
472
|
aria-label={tr('actionRedoLabel')}
|
|
477
473
|
>
|
|
478
|
-
<i
|
|
479
|
-
className={`format icon redo border w-4 h-6 bg-no-repeat bg-center bg-[length:17px_17px] ${
|
|
480
|
-
canRedo ? 'opacity-100' : 'opacity-30'
|
|
481
|
-
}`}
|
|
482
|
-
/>
|
|
474
|
+
<i className={`c-rte-icon-redo c-rte-toolbar__icon ${!canRedo ? 'disabled' : ''}`} />
|
|
483
475
|
</IconButton>
|
|
484
476
|
<Divider />
|
|
485
477
|
{blockType in blockTypeToBlockName && activeEditor === editor && (
|
|
@@ -503,10 +495,8 @@ export default function ToolbarPlugin({
|
|
|
503
495
|
key={value}
|
|
504
496
|
>
|
|
505
497
|
<span
|
|
506
|
-
className={`
|
|
507
|
-
dropDownActiveClass(value === codeLanguage)
|
|
508
|
-
? 'font-bold opacity-100'
|
|
509
|
-
: 'font-normal opacity-80'
|
|
498
|
+
className={`c-rte-toolbar__code-lang__sel-item ${
|
|
499
|
+
dropDownActiveClass(value === codeLanguage) ? 'selected' : ''
|
|
510
500
|
}`}
|
|
511
501
|
>
|
|
512
502
|
{name}
|
|
@@ -518,16 +508,16 @@ export default function ToolbarPlugin({
|
|
|
518
508
|
}
|
|
519
509
|
>
|
|
520
510
|
<Button aria-label={tr('codeSelectLanguage')} append={<Icon.Arrow />}>
|
|
521
|
-
<span className="
|
|
511
|
+
<span className="c-rte-toolbar__code-lang__button-text">{getLanguageFriendlyName(codeLanguage)}</span>
|
|
522
512
|
</Button>
|
|
523
513
|
</DropdownMenu.Root>
|
|
524
514
|
</>
|
|
525
515
|
) : (
|
|
526
516
|
<Dialog>
|
|
527
|
-
<div className="
|
|
517
|
+
<div className="c-rte-toolbar__actions-rest">
|
|
528
518
|
<IconButton
|
|
529
519
|
disabled={!isEditable}
|
|
530
|
-
className={
|
|
520
|
+
className={`c-rte-toolbar__icon-btn ${isBold ? 'selected' : ''}`}
|
|
531
521
|
type="button"
|
|
532
522
|
title={tr(IS_APPLE ? 'actionFormatAsStrongTitleApple' : 'actionFormatAsStrongTitle')}
|
|
533
523
|
aria-label={tr('actionFormatAsStrongLabel')}
|
|
@@ -536,10 +526,10 @@ export default function ToolbarPlugin({
|
|
|
536
526
|
activeEditor.dispatchCommand(FORMAT_TEXT_COMMAND, 'bold');
|
|
537
527
|
}}
|
|
538
528
|
>
|
|
539
|
-
<i className={`
|
|
529
|
+
<i className={`c-rte-toolbar__icon-btn__icon c-rte-icon-bold`} />
|
|
540
530
|
</IconButton>
|
|
541
531
|
<IconButton
|
|
542
|
-
className={
|
|
532
|
+
className={`c-rte-toolbar__icon-btn ${isItalic ? 'selected' : ''}`}
|
|
543
533
|
disabled={!isEditable}
|
|
544
534
|
onClick={() => {
|
|
545
535
|
activeEditor.dispatchCommand(FORMAT_TEXT_COMMAND, 'italic');
|
|
@@ -549,11 +539,10 @@ export default function ToolbarPlugin({
|
|
|
549
539
|
aria-label={tr('actionFormatAsEmphasizedLabel')}
|
|
550
540
|
data-testid="toggle-format-emphasized"
|
|
551
541
|
>
|
|
552
|
-
<i className={`
|
|
542
|
+
<i className={`c-rte-toolbar__icon-btn__icon c-rte-icon-italic`} />
|
|
553
543
|
</IconButton>
|
|
554
|
-
|
|
555
544
|
<IconButton
|
|
556
|
-
className={
|
|
545
|
+
className={`c-rte-toolbar__icon-btn ${isUnderline ? 'selected' : ''}`}
|
|
557
546
|
disabled={!isEditable}
|
|
558
547
|
onClick={() => {
|
|
559
548
|
activeEditor.dispatchCommand(FORMAT_TEXT_COMMAND, 'underline');
|
|
@@ -563,13 +552,10 @@ export default function ToolbarPlugin({
|
|
|
563
552
|
aria-label={tr('actionFormatAsUnderlinedLabel')}
|
|
564
553
|
data-testid="toggle-format-underlined"
|
|
565
554
|
>
|
|
566
|
-
<i
|
|
567
|
-
className={`format icon underline border w-full h-full bg-no-repeat bg-center bg-[length:18px_18px]`}
|
|
568
|
-
/>
|
|
555
|
+
<i className={`c-rte-toolbar__icon-btn__icon c-rte-icon-underline`} />
|
|
569
556
|
</IconButton>
|
|
570
|
-
|
|
571
557
|
<IconButton
|
|
572
|
-
className={
|
|
558
|
+
className={`c-rte-toolbar__icon-btn ${isCode ? 'selected' : ''}`}
|
|
573
559
|
disabled={!isEditable}
|
|
574
560
|
onClick={() => {
|
|
575
561
|
activeEditor.dispatchCommand(FORMAT_TEXT_COMMAND, 'code');
|
|
@@ -578,20 +564,18 @@ export default function ToolbarPlugin({
|
|
|
578
564
|
title={tr('actionInsertCodeBlock')}
|
|
579
565
|
aria-label={tr('actionInsertCodeBlock')}
|
|
580
566
|
>
|
|
581
|
-
<i className={`
|
|
567
|
+
<i className={`c-rte-toolbar__icon-btn__icon c-rte-icon-code`} />
|
|
582
568
|
</IconButton>
|
|
583
|
-
|
|
584
569
|
<IconButton
|
|
585
|
-
className={
|
|
570
|
+
className={`c-rte-toolbar__icon-btn ${isLink ? 'selected' : ''}`}
|
|
586
571
|
disabled={!isEditable}
|
|
587
572
|
onClick={insertLink}
|
|
588
573
|
type="button"
|
|
589
574
|
aria-label={tr('actionInsertlink')}
|
|
590
575
|
title={tr('actionInsertlink')}
|
|
591
576
|
>
|
|
592
|
-
<i className={`
|
|
577
|
+
<i className={`c-rte-toolbar__icon-btn__icon c-rte-icon-link`} />
|
|
593
578
|
</IconButton>
|
|
594
|
-
|
|
595
579
|
<DropdownMenu.Root
|
|
596
580
|
disabled={!isEditable}
|
|
597
581
|
style={{ zIndex: 1 }}
|
|
@@ -605,11 +589,11 @@ export default function ToolbarPlugin({
|
|
|
605
589
|
aria-label={tr('actionFormatWithStrikethroughLabel')}
|
|
606
590
|
>
|
|
607
591
|
<i
|
|
608
|
-
className={`icon
|
|
609
|
-
isStrikethrough ? '
|
|
592
|
+
className={`c-rte-icon-strikethrough c-rte-toolbar__dd-item__icon ${
|
|
593
|
+
isStrikethrough ? 'selected' : ''
|
|
610
594
|
}`}
|
|
611
595
|
/>
|
|
612
|
-
<span className={`
|
|
596
|
+
<span className={`c-rte-toolbar__dd-item__text ${isStrikethrough ? 'selected' : ''}`}>
|
|
613
597
|
{tr('actionFormatAsStrongTitle')}
|
|
614
598
|
</span>
|
|
615
599
|
</DropdownMenu.Item>
|
|
@@ -621,11 +605,9 @@ export default function ToolbarPlugin({
|
|
|
621
605
|
aria-label={tr('actionFormatWithSubscriptLabel')}
|
|
622
606
|
>
|
|
623
607
|
<i
|
|
624
|
-
className={`icon
|
|
625
|
-
isSubscript ? 'opacity-100 !bg-purple-50-900' : 'opacity-60'
|
|
626
|
-
}`}
|
|
608
|
+
className={`c-rte-icon-subscript c-rte-toolbar__dd-item__icon ${isSubscript ? 'selected' : ''}`}
|
|
627
609
|
/>
|
|
628
|
-
<span className={`
|
|
610
|
+
<span className={`c-rte-toolbar__dd-item__text ${isSubscript ? 'selected' : ''}`}>
|
|
629
611
|
{tr('actionFormatWithSubscriptTitle')}
|
|
630
612
|
</span>
|
|
631
613
|
</DropdownMenu.Item>
|
|
@@ -637,11 +619,11 @@ export default function ToolbarPlugin({
|
|
|
637
619
|
aria-label={tr('actionFormatWithSuperscriptLabel')}
|
|
638
620
|
>
|
|
639
621
|
<i
|
|
640
|
-
className={`icon
|
|
641
|
-
isSuperscript ? '
|
|
622
|
+
className={`c-rte-icon-superscript c-rte-toolbar__dd-item__icon ${
|
|
623
|
+
isSuperscript ? 'selected' : ''
|
|
642
624
|
}`}
|
|
643
625
|
/>
|
|
644
|
-
<span className={`
|
|
626
|
+
<span className={`c-rte-toolbar__dd-item__text ${isSuperscript ? 'selected' : ''}`}>
|
|
645
627
|
{tr('actionFormatWithSuperscriptTitle')}
|
|
646
628
|
</span>
|
|
647
629
|
</DropdownMenu.Item>
|
|
@@ -651,8 +633,8 @@ export default function ToolbarPlugin({
|
|
|
651
633
|
title={tr('actionClearTextFormatting')}
|
|
652
634
|
aria-label={tr('actionClearTextFormatting')}
|
|
653
635
|
>
|
|
654
|
-
<i className="icon
|
|
655
|
-
<span className="
|
|
636
|
+
<i className="c-rte-icon-clear c-rte-toolbar__dd-item__icon" />
|
|
637
|
+
<span className="c-rte-toolbar__dd-item__text--clear">Clear Formatting</span>
|
|
656
638
|
</DropdownMenu.Item>
|
|
657
639
|
</>
|
|
658
640
|
}
|
|
@@ -661,7 +643,7 @@ export default function ToolbarPlugin({
|
|
|
661
643
|
style={{ backgroundColor: 'transparent', padding: '0 8px' }}
|
|
662
644
|
aria-label={tr('actionTextFormattingOptions')}
|
|
663
645
|
>
|
|
664
|
-
<i className={`icon
|
|
646
|
+
<i className={`c-rte-icon-dropdown-more c-rte-toolbar__toggle-icon`} />
|
|
665
647
|
<Icon.Arrow />
|
|
666
648
|
</Button>
|
|
667
649
|
</DropdownMenu.Root>
|
|
@@ -676,16 +658,14 @@ export default function ToolbarPlugin({
|
|
|
676
658
|
activeEditor.dispatchCommand(INSERT_HORIZONTAL_RULE_COMMAND, undefined);
|
|
677
659
|
}}
|
|
678
660
|
>
|
|
679
|
-
<
|
|
680
|
-
|
|
681
|
-
<span className="px-3 text-sm">{tr('horizontalRule')}</span>
|
|
682
|
-
</div>
|
|
661
|
+
<i className="c-rte-toolbar__dd-item__icon c-rte-icon-horizontal-rule" />
|
|
662
|
+
<span className="c-rte-toolbar__dd-item__text">{tr('horizontalRule')}</span>
|
|
683
663
|
</DropdownMenu.Item>
|
|
684
664
|
<DropdownMenu.Item>
|
|
685
665
|
<Dialog.Trigger asChild>
|
|
686
|
-
<div className="
|
|
687
|
-
<i className="
|
|
688
|
-
<span className="
|
|
666
|
+
<div className="c-rte-toolbar__dd-item--table">
|
|
667
|
+
<i className="c-rte-toolbar__dd-item__icon c-rte-icon-table" />
|
|
668
|
+
<span className="c-rte-toolbar__dd-item__text">{tr('table')}</span>
|
|
689
669
|
</div>
|
|
690
670
|
</Dialog.Trigger>
|
|
691
671
|
</DropdownMenu.Item>
|
|
@@ -693,15 +673,14 @@ export default function ToolbarPlugin({
|
|
|
693
673
|
}
|
|
694
674
|
>
|
|
695
675
|
<IconButton>
|
|
696
|
-
<i className="
|
|
676
|
+
<i className="c-rte-icon-plus c-rte-toolbar__plus" />
|
|
697
677
|
</IconButton>
|
|
698
678
|
</DropdownMenu.Root>
|
|
699
679
|
<Dialog.Content>
|
|
700
680
|
<Dialog.Title>{tr('insertTableTitle')}</Dialog.Title>
|
|
701
681
|
<Dialog.Description>{tr('insertTableDescription')}</Dialog.Description>
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
</div>
|
|
682
|
+
|
|
683
|
+
<InsertTableDialog activeEditor={activeEditor} />
|
|
705
684
|
</Dialog.Content>
|
|
706
685
|
</div>
|
|
707
686
|
</Dialog>
|
|
@@ -27,8 +27,8 @@ export function InsertTableDialog({ activeEditor }: { activeEditor: LexicalEdito
|
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
return (
|
|
30
|
-
|
|
31
|
-
<div className="
|
|
30
|
+
<div className="c-rte-insert-table">
|
|
31
|
+
<div className="c-rte-insert-table__dimensions">
|
|
32
32
|
<InputWithLabel
|
|
33
33
|
label={tr('insertTableRows')}
|
|
34
34
|
value={rows}
|
|
@@ -37,7 +37,7 @@ export function InsertTableDialog({ activeEditor }: { activeEditor: LexicalEdito
|
|
|
37
37
|
inputMode="numeric"
|
|
38
38
|
onChange={e => setRows(e.target.value)}
|
|
39
39
|
/>
|
|
40
|
-
<span className="
|
|
40
|
+
<span className="c-rte-insert-table__dimensions__separator" />
|
|
41
41
|
<InputWithLabel
|
|
42
42
|
type="text"
|
|
43
43
|
label={tr('insertTableColumns')}
|
|
@@ -47,11 +47,11 @@ export function InsertTableDialog({ activeEditor }: { activeEditor: LexicalEdito
|
|
|
47
47
|
onChange={e => setColumns(e.target.value)}
|
|
48
48
|
/>
|
|
49
49
|
</div>
|
|
50
|
-
<div className="
|
|
50
|
+
<div className="c-rte-insert-table__actions">
|
|
51
51
|
<Button as={Dialog.Close} size="sm" intent="action" aria-label={tr('insertTableCommit')} onClick={onClick}>
|
|
52
52
|
{tr('insertTableCommit')}
|
|
53
53
|
</Button>
|
|
54
54
|
</div>
|
|
55
|
-
|
|
55
|
+
</div>
|
|
56
56
|
);
|
|
57
57
|
}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
.c-rte-icon {
|
|
2
|
+
&-plus {
|
|
3
|
+
@apply bg-[url('images/icons/plus.svg')];
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
&-h1 {
|
|
7
|
+
@apply bg-[url('images/icons/type-h1.svg')];
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
&-h2 {
|
|
11
|
+
@apply bg-[url('images/icons/type-h2.svg')];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&-h3 {
|
|
15
|
+
@apply bg-[url('images/icons/type-h3.svg')];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&-h4 {
|
|
19
|
+
@apply bg-[url('images/icons/type-h4.svg')];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&-h5 {
|
|
23
|
+
@apply bg-[url('images/icons/type-h5.svg')];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&-h6 {
|
|
27
|
+
@apply bg-[url('images/icons/type-h6.svg')];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&-paragraph {
|
|
31
|
+
@apply bg-[url('images/icons/text-paragraph.svg')];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&-bullet-list,
|
|
35
|
+
&-bullet {
|
|
36
|
+
@apply bg-[url('images/icons/list-ul.svg')];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&-check-list,
|
|
40
|
+
&-check {
|
|
41
|
+
@apply bg-[url('images/icons/square-check.svg')];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&-numbered-list,
|
|
45
|
+
&-number {
|
|
46
|
+
@apply bg-[url('images/icons/list-ol.svg')];
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&-quote {
|
|
50
|
+
@apply bg-[url('images/icons/chat-square-quote.svg')];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&-code {
|
|
54
|
+
@apply bg-[url('images/icons/code.svg')];
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&-palette {
|
|
58
|
+
@apply bg-[url('images/icons/palette.svg')];
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&-bucket {
|
|
62
|
+
@apply bg-[url('images/icons/paint-bucket.svg')];
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&-bold {
|
|
66
|
+
@apply bg-[url('images/icons/type-bold.svg')];
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&-italic {
|
|
70
|
+
@apply bg-[url('images/icons/type-italic.svg')];
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&-clear {
|
|
74
|
+
@apply bg-[url('images/icons/trash.svg')];
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&-code {
|
|
78
|
+
@apply bg-[url('images/icons/code.svg')];
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&-underline {
|
|
82
|
+
@apply bg-[url('images/icons/type-underline.svg')];
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&-strikethrough {
|
|
86
|
+
@apply bg-[url('images/icons/type-strikethrough.svg')];
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
&-subscript {
|
|
90
|
+
@apply bg-[url('images/icons/type-subscript.svg')];
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
&-superscript {
|
|
94
|
+
@apply bg-[url('images/icons/type-superscript.svg')];
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&-link {
|
|
98
|
+
@apply bg-[url('images/icons/link.svg')];
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
&-horizontal-rule {
|
|
102
|
+
@apply bg-[url('images/icons/horizontal-rule.svg')];
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&-caret-right {
|
|
106
|
+
@apply bg-[url('images/icons/caret-right-fill.svg')];
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
&-dropdown-more {
|
|
110
|
+
@apply bg-[url('images/icons/dropdown-more.svg')];
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
&-font-color {
|
|
114
|
+
@apply bg-[url('images/icons/font-color.svg')];
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
&-font-family {
|
|
118
|
+
@apply bg-[url('images/icons/font-family.svg')];
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
&-bg-color {
|
|
122
|
+
@apply bg-[url('images/icons/bg-color.svg')];
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
&-image {
|
|
126
|
+
@apply bg-[url('images/icons/file-image.svg')];
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
&-table {
|
|
130
|
+
@apply bg-[url('images/icons/table.svg')];
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
&-close {
|
|
134
|
+
@apply bg-[url('images/icons/close.svg')];
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
&-left-align,
|
|
138
|
+
&-left-align {
|
|
139
|
+
@apply bg-[url('images/icons/text-left.svg')];
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
&-center-align {
|
|
143
|
+
@apply bg-[url('images/icons/text-center.svg')];
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
&-right-align {
|
|
147
|
+
@apply bg-[url('images/icons/text-right.svg')];
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
&-justify-align {
|
|
151
|
+
@apply bg-[url('images/icons/justify.svg')];
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
&-indent {
|
|
155
|
+
@apply bg-[url('images/icons/indent.svg')];
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
&-outdent {
|
|
159
|
+
@apply bg-[url('images/icons/outdent.svg')];
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
&-undo {
|
|
163
|
+
@apply bg-[url('images/icons/arrow-counterclockwise.svg')];
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
&-redo {
|
|
167
|
+
@apply bg-[url('images/icons/arrow-clockwise.svg')];
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
&-mic {
|
|
171
|
+
@apply bg-[url('images/icons/mic.svg')];
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
&-import {
|
|
175
|
+
@apply bg-[url('images/icons/upload.svg')];
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
&-export {
|
|
179
|
+
@apply bg-[url('images/icons/download.svg')];
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
&-diagram-2 {
|
|
183
|
+
@apply bg-[url('images/icons/diagram-2.svg')];
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
&-user {
|
|
187
|
+
@apply bg-[url('images/icons/user.svg')];
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
&-equation {
|
|
191
|
+
@apply bg-[url('images/icons/plus-slash-minus.svg')];
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
&-gif {
|
|
195
|
+
@apply bg-[url('images/icons/filetype-gif.svg')];
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
&-copy {
|
|
199
|
+
@apply bg-[url('images/icons/copy.svg')];
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
&-success {
|
|
203
|
+
@apply bg-[url('images/icons/success.svg')];
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
&-prettier {
|
|
207
|
+
@apply bg-[url('images/icons/prettier.svg')];
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
&-prettier-error {
|
|
211
|
+
@apply bg-[url('images/icons/prettier-error.svg')];
|
|
212
|
+
}
|
|
213
|
+
}
|