File tree Expand file tree Collapse file tree 3 files changed +43
-1
lines changed
src/frontend/apps/impress/src/features/docs/doc-export Expand file tree Collapse file tree 3 files changed +43
-1
lines changed Original file line number Diff line number Diff line change @@ -23,8 +23,9 @@ export const blockMappingParagraphPDF: DocsExporterPDF['mappings']['blockMapping
2323 } ) ;
2424 }
2525 }
26+
2627 return (
27- < Text key = { block . id } >
28+ < Text key = { 'paragraph' + block . id } >
2829 { exporter . transformInlineContent ( block . content ) }
2930 </ Text >
3031 ) ;
Original file line number Diff line number Diff line change @@ -39,5 +39,26 @@ export const docxDocsSchemaMappings: DocsExporterDocx['mappings'] = {
3939 shading : { fill : 'DCDCDC' } ,
4040 }
4141 : { } ,
42+ // If the color is not defined, we fall back to default colors
43+ backgroundColor : ( val , exporter ) => {
44+ if ( ! val ) {
45+ return { } ;
46+ }
47+ return {
48+ shading : {
49+ fill :
50+ exporter . options . colors ?. [ val ] ?. background ?. slice ( 1 ) || '#ffffff' ,
51+ } ,
52+ } ;
53+ } ,
54+ // If the color is not defined, we fall back to default colors
55+ textColor : ( val , exporter ) => {
56+ if ( ! val ) {
57+ return { } ;
58+ }
59+ return {
60+ color : exporter . options . colors ?. [ val ] ?. text ?. slice ( 1 ) || '#3c3b38' ,
61+ } ;
62+ } ,
4263 } ,
4364} ;
Original file line number Diff line number Diff line change @@ -39,5 +39,25 @@ export const pdfDocsSchemaMappings: DocsExporterPDF['mappings'] = {
3939 // that is not available in italics
4040 code : ( enabled ?: boolean ) =>
4141 enabled ? { fontFamily : 'Courier' , backgroundColor : '#dcdcdc' } : { } ,
42+ // If the color is not defined, we fall back to default colors
43+ textColor : ( val , exporter ) => {
44+ if ( ! val ) {
45+ return { } ;
46+ }
47+
48+ return {
49+ color : exporter . options . colors ?. [ val ] ?. text || '#3c3b38' ,
50+ } ;
51+ } ,
52+ // If the color is not defined, we fall back to default colors
53+ backgroundColor : ( val , exporter ) => {
54+ if ( ! val ) {
55+ return { } ;
56+ }
57+ return {
58+ backgroundColor :
59+ exporter . options . colors ?. [ val ] ?. background || '#ffffff' ,
60+ } ;
61+ } ,
4262 } ,
4363} ;
You can’t perform that action at this time.
0 commit comments