Skip to content

Commit

Permalink
feat(sheets-drawing-ui): support sheet cell image (#4036)
Browse files Browse the repository at this point in the history
Co-authored-by: DR-Univer <wbfsa@qq.com>
Co-authored-by: Dushusir <1414556676@qq.com>
Co-authored-by: jocs <ransixi@gmail.com>
Co-authored-by: lumixraku <lumixraku@gmail.com>
  • Loading branch information
5 people authored Nov 30, 2024
1 parent 59b95fa commit 244511d
Show file tree
Hide file tree
Showing 78 changed files with 1,413 additions and 36,434 deletions.
2 changes: 2 additions & 0 deletions examples/src/sheets/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { FUniver, LocaleType, LogLevel, Univer, UniverInstanceType, UserManagerS
import { UniverDebuggerPlugin } from '@univerjs/debugger';
import { defaultTheme } from '@univerjs/design';
import { UniverDocsPlugin } from '@univerjs/docs';
import { UniverDocsDrawingUIPlugin } from '@univerjs/docs-drawing-ui';
import { UniverDocsMentionUIPlugin } from '@univerjs/docs-mention-ui';
import { UniverDocsUIPlugin } from '@univerjs/docs-ui';
import { UniverFormulaEnginePlugin } from '@univerjs/engine-formula';
Expand Down Expand Up @@ -95,6 +96,7 @@ univer.registerPlugin(UniverDocsPlugin);
univer.registerPlugin(UniverRenderEnginePlugin);
univer.registerPlugin(UniverUIPlugin, { container: 'app' });
univer.registerPlugin(UniverDocsUIPlugin);
univer.registerPlugin(UniverDocsDrawingUIPlugin);
univer.registerPlugin(UniverDocsMentionUIPlugin);

univer.registerPlugin(UniverSheetsPlugin, { notExecuteFormula: true });
Expand Down
96 changes: 94 additions & 2 deletions mockdata/src/sheets/demo/default-workbook-data-demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14146,6 +14146,98 @@ export const DEFAULT_WORKBOOK_DATA_DEMO: IWorkbookData = {
v: 345,
t: 2,
},
7: {
p: {
id: 'd',
documentStyle: {
pageSize: {
width: 58,
height: undefined,
},
marginTop: 0,
marginBottom: 2,
marginRight: 2,
marginLeft: 2,
renderConfig: {
horizontalAlign: 0,
verticalAlign: 0,
centerAngle: 0,
vertexAngle: 0,
wrapStrategy: 0,
zeroWidthParagraphBreak: 1,
},
},
body: {
dataStream: '\b\r\n',
textRuns: [],
paragraphs: [
{
startIndex: 1,
paragraphStyle: {
horizontalAlign: 0,
},
},
],
sectionBreaks: [
{
startIndex: 2,
},
],
customBlocks: [
{
startIndex: 0,
blockId: 'BYxg4d',
},
],
customRanges: [],
customDecorations: [],
},
drawings: {
BYxg4d: {
unitId: 'd',
subUnitId: 'd',
drawingId: 'BYxg4d',
drawingType: 0,
// @ts-ignore
imageSourceType: 'BASE64',
source: 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxMSEhUTExAVFRIWEBUWExUVFxcVEBIVFRgYGhgYGBgYHSgiGholHRgZITEtJSkrLi4uFyAzODMtNzQtLisBCgoKDg0OGxAQGi0lICYvMC4vLi8tLS0vKzAtLy0tLS0vNS0tLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rLf/AABEIAOEA4QMBIgACEQEDEQH/xAAbAAEAAgMBAQAAAAAAAAAAAAAABAYCAwUHAf/EADsQAAEDAgMFBgUCBQMFAAAAAAEAAhEDIQQxQQUSUWFxBiKBkaHwEzKxwdFC4RQVUoLxByNiM1Nyc5L/xAAaAQEAAgMBAAAAAAAAAAAAAAAAAQQCAwUG/8QALBEBAAICAQMCBAUFAAAAAAAAAAECAxEEEiExQVEFE2GBIjIzQqEjccHR8P/aAAwDAQACEQMRAD8A9xREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAWL3gCSQBzXF2t2iZS7rIc/UaN6qobQ2tVqmXGJBFuVx9VWy8mtO0d5WMfHtbvPaF0xPaCk35ZeeVvqoFTtI45Ma2eJn1CrFMgidJvwzGvvJSIJBItaS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gIiICxcFkiDQ5ih4mcguk4LV8JBwH7PnMLRU2Q0/pCsppLA0VDLap1NgsP6QotXs6z+kK5uorU+gp0bUWr2faNFGfsIcFfH4bko1TB8lGk9UqMdhDgvv8oA0VzOC5LF2B5IbUqphi3RcPHYO5IsTwy8l6LX2dOi5mJ2LOiwvSLR3bceTpebuxDmWOggG/mpNDaQBiRpfnOfJWHaHZlzslwcT2OqSYJVW3G2sxnh06G2CP1Tmc7j8qfT22IubG9xJvxI6qqHsliNHOWbex2KdPedePTJVb/Da29GFvlW81Wr+fN1cPCbnyQbXDjAueAvkSPr9VwsN2AxLiCXu9x+Fbez/YutSIkz1z01z0WMfCqeu2qaYfb+U/ZOzHVDNQ7reAz08v2V12fhmU27rGwMzzPFRMBszdF8102UoXQ4/ExYfyR39/Votr0bERFaYiIiAiIgIiICIiAiIgL5C+og+FqxLFmiDSaSxNBSEQRf4dP4ZSkQRDhAsTgQpqIbQP5a3gvn8sZwXQRE7Qm7NZ/SFtZg2j9IUhENsBSA0WW6vqIgREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQf/9k=',
transform: {
left: 0,
top: 0,
width: 54,
height: 54,
},
docTransform: {
size: {
width: 54,
height: 54,
},
positionH: {
relativeFrom: 0,
posOffset: 0,
},
positionV: {
relativeFrom: 1,
posOffset: 0,
},
angle: 0,
},
behindDoc: 0,
title: '',
description: '',
layoutType: 0,
wrapText: 0,
distB: 0,
distL: 0,
distR: 0,
distT: 0,
},
},
drawingsOrder: [
'BYxg4d',
],
},
},
8: {
p: {
id: '__INTERNAL_EDITOR__DOCS_NORMAL',
Expand Down Expand Up @@ -14244,11 +14336,11 @@ export const DEFAULT_WORKBOOK_DATA_DEMO: IWorkbookData = {
},
},
body: {
dataStream: '\u001Fhttps://univer.ai/\u001E\r\n',
dataStream: 'https://univer.ai/\r\n',
customRanges: [
{
startIndex: 0,
endIndex: 19,
endIndex: 17,
rangeId: 'QY6zbQrxGw8IaLGXDgVVj',
rangeType: 0,
properties: {
Expand Down
Loading

0 comments on commit 244511d

Please sign in to comment.