Skip to content

Commit 04393cf

Browse files
committed
replace Divider by native one
1 parent a0ef8e5 commit 04393cf

File tree

8 files changed

+23
-18
lines changed

8 files changed

+23
-18
lines changed

src/frontend/apps/impress/src/features/docs/doc-editor/components/BlockNoteEditor.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import { BlockNoteToolbar } from './BlockNoteToolBar/BlockNoteToolbar';
3737
import {
3838
AccessibleImageBlock,
3939
CalloutBlock,
40-
//DividerBlock,
40+
DividerBlock,
4141
PdfBlock,
4242
UploadLoaderBlock,
4343
} from './custom-blocks';
@@ -56,7 +56,7 @@ const baseBlockNoteSchema = withPageBreak(
5656
...defaultBlockSpecs,
5757
callout: CalloutBlock(),
5858
codeBlock: createCodeBlockSpec(codeBlockOptions),
59-
//divider: DividerBlock,
59+
divider2: DividerBlock(),
6060
image: AccessibleImageBlock(),
6161
pdf: PdfBlock(),
6262
uploadLoader: UploadLoaderBlock(),

src/frontend/apps/impress/src/features/docs/doc-editor/components/BlockNoteSuggestionMenu.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {
1717

1818
import {
1919
getCalloutReactSlashMenuItems,
20-
//getDividerReactSlashMenuItems,
20+
getDividerReactSlashMenuItems,
2121
getPdfReactSlashMenuItems,
2222
} from './custom-blocks';
2323
import { useGetInterlinkingMenuItems } from './custom-inline-content';
@@ -59,7 +59,7 @@ export const BlockNoteSuggestionMenu = () => {
5959
getCalloutReactSlashMenuItems(editor, t, basicBlocksName),
6060
getMultiColumnSlashMenuItems?.(editor) || [],
6161
getPageBreakReactSlashMenuItems(editor),
62-
//getDividerReactSlashMenuItems(editor, t, basicBlocksName),
62+
getDividerReactSlashMenuItems(editor, t, basicBlocksName),
6363
getPdfReactSlashMenuItems(editor, t, fileBlocksName),
6464
),
6565
query,

src/frontend/apps/impress/src/features/docs/doc-editor/components/custom-blocks/DividerBlock.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { DocsBlockNoteEditor } from '../../types';
99

1010
export const DividerBlock = createReactBlockSpec(
1111
{
12-
type: 'divider',
12+
type: 'divider2',
1313
propSchema: {},
1414
content: 'none',
1515
},
@@ -40,7 +40,7 @@ export const getDividerReactSlashMenuItems = (
4040
title: t('Divider'),
4141
onItemClick: () => {
4242
insertOrUpdateBlock(editor, {
43-
type: 'divider',
43+
type: 'divider2',
4444
});
4545
},
4646
aliases: ['divider', 'hr', 'horizontal rule', 'line', 'separator'],

src/frontend/apps/impress/src/features/docs/doc-editor/styles.tsx

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,13 @@ export const cssEditor = (readonly: boolean) => css`
2929
position: relative;
3030
}
3131
32-
.bn-side-menu .mantine-UnstyledButton-root svg {
33-
color: #767676 !important;
34-
}
35-
3632
img.bn-visual-media[src*='-unsafe'] {
3733
pointer-events: none;
3834
}
3935
36+
/**
37+
* Collaboration cursor styles
38+
*/
4039
.collaboration-cursor-custom__base {
4140
position: relative;
4241
}
@@ -87,28 +86,27 @@ export const cssEditor = (readonly: boolean) => css`
8786
.bn-side-menu[data-block-type='divider'] {
8887
height: 38px;
8988
}
89+
.bn-side-menu .mantine-UnstyledButton-root svg {
90+
color: #767676 !important;
91+
}
9092
9193
/**
9294
* Callout, Paragraph and Heading blocks
9395
*/
9496
.bn-block {
9597
border-radius: var(--c--theme--spacings--3xs);
9698
}
97-
9899
.bn-block-outer {
99100
border-radius: var(--c--theme--spacings--3xs);
100101
}
101-
102102
.bn-block[data-background-color] > .bn-block-content {
103103
padding: var(--c--theme--spacings--3xs) var(--c--theme--spacings--3xs);
104104
border-radius: var(--c--theme--spacings--3xs);
105105
}
106-
107106
.bn-block-content[data-content-type='checkListItem'][data-checked='true']
108107
.bn-inline-content {
109108
text-decoration: none;
110109
}
111-
112110
h1 {
113111
font-size: 1.875rem;
114112
}
@@ -139,6 +137,13 @@ export const cssEditor = (readonly: boolean) => css`
139137
border-left: 4px solid var(--c--theme--colors--greyscale-300);
140138
font-style: italic;
141139
}
140+
141+
[data-content-type='divider'] hr {
142+
background: #d3d2cf;
143+
margin: 1rem 0;
144+
width: 100%;
145+
border: 1px solid #d3d2cf;
146+
}
142147
}
143148
144149
& .bn-block-outer:not(:first-child) {

src/frontend/apps/impress/src/features/docs/doc-export/blocks-mapping/dividerDocx.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { useCunninghamTheme } from '@/cunningham';
44

55
import { DocsExporterDocx } from '../types';
66

7-
export const blockMappingDividerDocx: DocsExporterDocx['mappings']['blockMapping']['divider'] =
7+
export const blockMappingDividerDocx: DocsExporterDocx['mappings']['blockMapping']['divider2'] =
88
() => {
99
const { colorsTokens } = useCunninghamTheme.getState();
1010

src/frontend/apps/impress/src/features/docs/doc-export/blocks-mapping/dividerPDF.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { useCunninghamTheme } from '@/cunningham';
44

55
import { DocsExporterPDF } from '../types';
66

7-
export const blockMappingDividerPDF: DocsExporterPDF['mappings']['blockMapping']['divider'] =
7+
export const blockMappingDividerPDF: DocsExporterPDF['mappings']['blockMapping']['divider2'] =
88
() => {
99
const { colorsTokens } = useCunninghamTheme.getState();
1010

src/frontend/apps/impress/src/features/docs/doc-export/mappingDocx.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const docxDocsSchemaMappings: DocsExporterDocx['mappings'] = {
1616
blockMapping: {
1717
...docxDefaultSchemaMappings.blockMapping,
1818
callout: blockMappingCalloutDocx,
19-
divider: blockMappingDividerDocx,
19+
divider2: blockMappingDividerDocx,
2020
// We're using the file block mapping for PDF blocks
2121
// The types don't match exactly but the implementation is compatible
2222
// eslint-disable-next-line @typescript-eslint/no-explicit-any

src/frontend/apps/impress/src/features/docs/doc-export/mappingPDF.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const pdfDocsSchemaMappings: DocsExporterPDF['mappings'] = {
2121
heading: blockMappingHeadingPDF,
2222
image: blockMappingImagePDF,
2323
paragraph: blockMappingParagraphPDF,
24-
divider: blockMappingDividerPDF,
24+
divider2: blockMappingDividerPDF,
2525
quote: blockMappingQuotePDF,
2626
table: blockMappingTablePDF,
2727
// We're using the file block mapping for PDF blocks

0 commit comments

Comments
 (0)