Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

feat(slide): doc and slide demo done

DR-Univer7d9259f11f6f
diff --git a/packages/base-docs/package.json b/packages/base-docs/package.json
index fac8f4128e..154125126f 100644
--- a/packages/base-docs/package.json
+++ b/packages/base-docs/package.json
@@ -53,6 +53,7 @@
"@univer/base-render": "workspace:^0.0.1",
"@univer/base-sheets": "workspace:^0.0.1",
"@univer/core": "workspace:^0.0.1",
+ "@univer/common-plugin-data": "workspace:^0.0.1",
"@univer/sheets-plugin-filter": "workspace:^0.0.1",
"@univer/style-universheet": "workspace:^0.0.1",
"css-vars-ponyfill": "^2.4.6",
diff --git a/packages/base-docs/src/View/Render/Views/DrawingsView.ts b/packages/base-docs/src/View/Render/Views/DrawingsView.ts
index 56fbbd7af2..43fe211a7a 100644
--- a/packages/base-docs/src/View/Render/Views/DrawingsView.ts
+++ b/packages/base-docs/src/View/Render/Views/DrawingsView.ts
@@ -1,4 +1,4 @@
-import { getColor, Rect, Documents, DocumentSkeleton, CustomObject, IPageRenderConfig, Transform, ptToPx, BaseObject } from '@univer/base-render';
+import { getColor, Rect, Documents, DocumentSkeleton, CustomObject, IPageRenderConfig, Transform, ptToPx, BaseObject, Picture, Liquid } from '@univer/base-render';
import { BaseView, CanvasViewRegistry } from '../BaseView';
import { DOCS_VIEW_KEY } from './DocsView';
@@ -9,6 +9,8 @@ export class DrawingsView extends BaseView {
viewKey = DRAWINGS_VIEW_BACKGROUND;
+ private _liquid = new Liquid();
+
protected _initialize() {
const scene = this.getScene();
const context = this.getContext();
@@ -28,31 +30,42 @@ export class DrawingsView extends BaseView {
const { pages } = skeletonData;
const objectList: BaseObject[] = [];
const pageMarginCache = new Map<string, { marginLeft: number; marginTop: number }>();
- for (let page of pages) {
- const { skeDrawings, marginLeft, marginTop } = page;
+
+ let cumPageLeft = 0;
+ let cumPageTop = 0;
+
+ for (let i = 0, len = pages.length; i < len; i++) {
+ const page = pages[i];
+ const { skeDrawings, marginLeft, marginTop, pageWidth, pageHeight } = page;
+
+ // cumPageLeft + = pageWidth + documents.pageMarginLeft;
+
+ this._liquid.translatePagePadding(page);
skeDrawings.forEach((drawing) => {
- const { aLeft, aTop, height, width } = drawing;
+ const { aLeft, aTop, height, width, drawingOrigin } = drawing;
+
+ const { objectProperties } = drawingOrigin;
- const rect = new Rect(drawing.objectId, {
- left: aLeft + docsLeft + marginLeft,
- top: aTop + docsTop + marginTop,
+ const rect = new Picture(drawing.objectId, {
+ url: objectProperties.imageProperties?.contentUrl || '',
+ left: aLeft + docsLeft + this._liquid.x,
+ top: aTop + docsTop + this._liquid.y,
width: width,
height: height,
- fill: 'rgba(102,111,99, 0.8)',
zIndex: 11,
isTransformer: true,
});
pageMarginCache.set(drawing.objectId, {
- marginLeft,
- marginTop,
+ marginLeft: this._liquid.x,
+ marginTop: this._liquid.y,
});
- console.log('pageMarginCache', aTop, docsTop, marginTop, aTop + docsTop + marginTop, rect);
-
objectList.push(rect);
});
+
+ this._liquid.translatePage(page, documents.pageLayoutType, documents.pageMarginLeft, documents.pageMarginTop);
}
scene.openTransformer();
scene.addObjects(objectList);
@@ -65,7 +78,7 @@ export class DrawingsView extends BaseView {
const marginLeft = cache?.marginLeft || 0;
const marginTop = cache?.marginTop || 0;
- console.log('onChangingObservable', top, docsTop, marginTop, top - docsTop - marginTop);
+ // console.log('onChangingObservable', top, docsTop, marginTop, top - docsTop - marginTop);
docsSkeleton?.updateDrawing(oKey, {
left: left - docsLeft - marginLeft,
diff --git a/packages/base-docs/src/main.tsx b/packages/base-docs/src/main.tsx
index 8d21e8dade..03e9d65195 100644
--- a/packages/base-docs/src/main.tsx
+++ b/packages/base-docs/src/main.tsx
@@ -2,9 +2,9 @@ import { UniverDoc } from '@univer/core';
import { RenderEngine } from '@univer/base-render';
import { UniverComponentSheet } from '@univer/style-universheet';
import { DocPlugin } from './DocPlugin';
-import { DOCS_DEMO_DATA } from './Basic/DemoData';
+import { DEFAULT_DOCUMENT_DATA_EN } from '@univer/common-plugin-data';
-const univerDocUp = UniverDoc.newInstance(DOCS_DEMO_DATA);
+const univerDocUp = UniverDoc.newInstance(DEFAULT_DOCUMENT_DATA_EN);
univerDocUp.installPlugin(new RenderEngine());
univerDocUp.installPlugin(new UniverComponentSheet());
diff --git a/packages/base-render/src/Component/Docs/Block/Paragraph/Layout.Ruler.ts b/packages/base-render/src/Component/Docs/Block/Paragraph/Layout.Ruler.ts
index a9f1b281a9..05dd13454e 100644
--- a/packages/base-render/src/Component/Docs/Block/Paragraph/Layout.Ruler.ts
+++ b/packages/base-render/src/Component/Docs/Block/Paragraph/Layout.Ruler.ts
@@ -18,7 +18,7 @@ import {
isColumnFull,
} from '../../Common/Tools';
import { createSkeletonPage } from '../../Common/Page';
-import { calculateLineTopByDrawings, createAndUpdateBlockAnchor, createSkeletonLine, isParagraphStart, setDivideFullState } from '../../Common/Line';
+import { addSpanToDivide, calculateLineTopByDrawings, createAndUpdateBlockAnchor, createSkeletonLine, isParagraphStart, setDivideFullState } from '../../Common/Line';
import { createSkeletonBulletSpan, setSpanGroupLeft } from '../../Common/Span';
import { setColumnFullState } from '../../Common/Section';
import {
@@ -95,7 +95,8 @@ function _divideOperator(
if (width > pageContentWidth) {
// 一个字符超页内容宽
if (isBlankPage(lastPage)) {
- divide.spanGroup.push(...spanGroup);
+ addSpanToDivide(divide, spanGroup);
+ // divide.spanGroup.push(...spanGroup);
__makeColumnsFull(column?.parent?.columns);
} else {
_pageOperator(spanGroup, pages, sectionBreakConfig, paragraphConfig, elementIndex, isFirstSpan, defaultSpanLineHeight);
@@ -105,7 +106,8 @@ function _divideOperator(
setColumnFullState(column, true);
if (isBlankColumn(column)) {
console.log(spanGroup);
- divide.spanGroup.push(...spanGroup);
+ addSpanToDivide(divide, spanGroup);
+ // divide.spanGroup.push(...spanGroup);
} else {
_columnOperator(spanGroup, pages, sectionBreakConfig, paragraphConfig, elementIndex, isFirstSpan, defaultSpanLineHeight);
}
@@ -153,7 +155,8 @@ function _divideOperator(
span.parent = divide;
}
// console.log('spanGroup', spanGroup, spanGroup.length, spanGroup[0].content);
- divide.spanGroup.push(...spanGroup);
+ addSpanToDivide(divide, spanGroup);
+ // divide.spanGroup.push(...spanGroup);
}
} else {
_lineOperator(spanGroup, pages, sectionBreakConfig, paragraphConfig, elementIndex, isFirstSpan, defaultSpanLineHeight);
@@ -250,7 +253,7 @@ function _lineOperator(
if (lineHeight + newLineTop > section.height && column.lines.length > 0 && lastPage.sections.length > 0) {
// 行高超过Col高度,且列中已存在一行以上,且section大于一个;
- console.log('_lineOperator', { spanGroup, pages, lineHeight, newLineTop, sectionHeight: section.height, lastPage });
+ // console.log('_lineOperator', { spanGroup, pages, lineHeight, newLineTop, sectionHeight: section.height, lastPage });
setColumnFullState(column, true);
_columnOperator(spanGroup, pages, sectionBreakConfig, paragraphConfig, elementIndex, isFirstSpan, defaultSpanLineHeight);
return;
diff --git a/packages/base-render/src/Component/Docs/Block/Paragraph/Paragraph.ts b/packages/base-render/src/Component/Docs/Block/Paragraph/Paragraph.ts
index cda9917d03..0f56949e29 100644
--- a/packages/base-render/src/Component/Docs/Block/Paragraph/Paragraph.ts
+++ b/packages/base-render/src/Component/Docs/Block/Paragraph/Paragraph.ts
@@ -99,6 +99,19 @@ export function dealWidthParagraph(
_updateListLevelAncestors(bullet, bulletSkeleton, skeListLevel); // 更新最新的level缓存列表
paragraphConfig.bulletSkeleton = bulletSkeleton;
+ elementOrder.forEach((elementOrderItem: IElementsOrder, elementIndex: number) => {
+ const { elementId, paragraphElementType } = elementOrderItem;
+ let currentPages: IDocumentSkeletonPage[] = [];
+ if (paragraphElementType === ParagraphElementType.DRAWING) {
+ const drawingOrigin = drawings[elementId];
+ if (drawingOrigin.layoutType === PositionedObjectLayoutType.INLINE) {
+ currentPages = dealWidthInlineDrawing(drawingOrigin, elementIndex, sectionBreakConfig, lastPage, paragraphConfig, fontLocale);
+ } else {
+ paragraphAffectSkeDrawings.set(elementId, _getDrawingSkeletonFormat(drawingOrigin));
+ }
+ }
+ });
+
// let currentLine = createSkeletonLine({ ...paragraphConfig, bulletSkeleton, affectSkeDrawings: affectAllSkeDrawings });
// 处理1列的情况
// 如果下一节是连续的,则按照1列进行计算,计算结果返回后,用来预估列高度,然后在接来下的流程进行二次计算
@@ -112,13 +125,6 @@ export function dealWidthParagraph(
return false;
}
currentPages = dealWidthTextRun(textRun, elementIndex, sectionBreakConfig, lastPage, { ...paragraphConfig, paragraphAffectSkeDrawings }, fontLocale);
- } else if (paragraphElementType === ParagraphElementType.DRAWING) {
- const drawingOrigin = drawings[elementId];
- if (drawingOrigin.layoutType === PositionedObjectLayoutType.INLINE) {
- currentPages = dealWidthInlineDrawing(drawingOrigin, elementIndex, sectionBreakConfig, lastPage, paragraphConfig, fontLocale);
- } else {
- paragraphAffectSkeDrawings.set(elementId, _getDrawingSkeletonFormat(drawingOrigin));
- }
} else if (paragraphElementType === ParagraphElementType.PAGE_BREAK) {
// 换页标识,换页后还在同一个节内
currentPages = [createSkeletonPage(sectionBreakConfig, skeletonResourceReference, _getNextPageNumber(lastPage), BreakType.PAGE)];
diff --git a/packages/base-render/src/Component/Docs/Common/Line.ts b/packages/base-render/src/Component/Docs/Common/Line.ts
index 0de2d530f6..704a557f32 100644
--- a/packages/base-render/src/Component/Docs/Common/Line.ts
+++ b/packages/base-render/src/Component/Docs/Common/Line.ts
@@ -1,5 +1,15 @@
import { IDrawing, Nullable, PositionedObjectLayoutType, WrapTextType } from '@univer/core';
-import { IDocumentSkeletonBlockAnchor, IDocumentSkeletonDivide, IDocumentSkeletonDrawing, IDocumentSkeletonLine, LineType, Path2, Transform, Vector2 } from '../../..';
+import {
+ IDocumentSkeletonBlockAnchor,
+ IDocumentSkeletonDivide,
+ IDocumentSkeletonDrawing,
+ IDocumentSkeletonLine,
+ IDocumentSkeletonSpan,
+ LineType,
+ Path2,
+ Transform,
+ Vector2,
+} from '../../..';
interface IDrawingsSplit {
left: number;
@@ -427,3 +437,25 @@ export function createAndUpdateBlockAnchor(blockId: string, line: IDocumentSkele
});
}
}
+
+export function addSpanToDivide(divide: IDocumentSkeletonDivide, spanGroup: IDocumentSkeletonSpan[]) {
+ const line = divide.parent;
+ if (line != null) {
+ const isFirstLine = line.divides[0].spanGroup[0] == null;
+ const firstSpan = spanGroup[0];
+ const firstSpanContent = firstSpan.content || ' ';
+ if (isFirstLine && firstSpanContent === ' ') {
+ const width = firstSpan.width;
+ firstSpan.width = 0;
+ for (let span of spanGroup) {
+ if (span === firstSpan) {
+ continue;
+ }
+
+ span.left -= width;
+ }
+ }
+ }
+
+ divide.spanGroup.push(...spanGroup);
+}
diff --git a/packages/base-render/src/Component/Docs/Common/Liquid.ts b/packages/base-render/src/Component/Docs/Common/Liquid.ts
index d132e0bedd..72d480eb9f 100644
--- a/packages/base-render/src/Component/Docs/Common/Liquid.ts
+++ b/packages/base-render/src/Component/Docs/Common/Liquid.ts
@@ -118,9 +118,9 @@ export class Liquid {
};
}
- translateLine(line: IDocumentSkeletonLine) {
+ translateLine(line: IDocumentSkeletonLine, isDraw = false) {
const { top: lineTop, marginBottom: lineMarginBottom = 0, marginTop: lineMarginTop = 0, paddingTop: linePaddingTop = 0, paddingBottom: linePaddingBottom = 0 } = line;
- const lineOffset = lineTop + lineMarginTop + linePaddingTop;
+ const lineOffset = lineTop + (isDraw === true ? lineMarginTop : 0) + linePaddingTop;
this.translate(0, lineOffset);
return {
x: 0,
diff --git a/packages/base-render/src/Component/Docs/Common/TextSelection.ts b/packages/base-render/src/Component/Docs/Common/TextSelection.ts
index ec2fdf0e79..cc8e3f5754 100644
--- a/packages/base-render/src/Component/Docs/Common/TextSelection.ts
+++ b/packages/base-render/src/Component/Docs/Common/TextSelection.ts
@@ -14,7 +14,6 @@ import { IPoint } from '../../../Basics/Vector2';
import { Scene } from '../../../Scene';
import { Rect } from '../../../Shape/Rect';
import { RegularPolygon } from '../../../Shape/RegularPolygon';
-import { DocumentSkeleton } from '../DocSkeleton';
import { Documents } from '../Document';
import { Liquid } from './Liquid';
@@ -382,7 +381,7 @@ export class TextSelection {
this._scene.addObject(anchor, 2);
}
- private _getRangePointData(startOrigin: INodePosition, endOrigin: INodePosition, skeleton: DocumentSkeleton) {
+ private _getRangePointData(startOrigin: INodePosition, endOrigin: INodePosition, documents: Documents) {
const pointGroup: IPoint[][] = [];
const cursorList: ISelectionCursor[] = [];
@@ -400,7 +399,7 @@ export class TextSelection {
const isEndBack = end.isBack;
- this._selectionIterator(start!, end!, skeleton, (start_sp, end_sp, divide, line) => {
+ this._selectionIterator(start!, end!, documents, (start_sp, end_sp, divide, line) => {
const { lineHeight } = line;
const { spanGroup, st } = divide;
@@ -493,7 +492,7 @@ export class TextSelection {
private _selectionIterator(
startPosition: INodePosition,
endPosition: INodePosition,
- skeleton: DocumentSkeleton,
+ documents: Documents,
func: (
startSpanIndex: number,
endSpanIndex: number,
@@ -504,6 +503,7 @@ export class TextSelection {
page: IDocumentSkeletonPage
) => void
) {
+ const skeleton = documents.getSkeleton();
if (!skeleton) {
return [];
}
@@ -520,6 +520,11 @@ export class TextSelection {
this._resetCurrentNodePositionState();
+ for (let p = 0; p <= page - 1; p++) {
+ const page = pages[p];
+ this._Liquid.translatePage(page, documents.pageLayoutType, documents.pageMarginLeft, documents.pageMarginTop);
+ }
+
for (let p = page; p <= endPage; p++) {
const page = pages[p];
const sections = page.sections;
@@ -661,12 +666,6 @@ export class TextSelection {
}
refresh(documents: Documents) {
- const skeleton = documents.getSkeleton();
-
- if (!skeleton) {
- return;
- }
-
const start = this.startNodePosition;
const end = this.endNodePosition;
@@ -679,14 +678,14 @@ export class TextSelection {
}
if (this.isCollapsed()) {
- const data = this._getRangePointData(start!, start!, skeleton);
+ const data = this._getRangePointData(start!, start!, documents);
const { pointGroup, cursorList } = data;
this._setCursor(cursorList);
pointGroup.length > 0 && this._createAndUpdateAnchor(pointGroup, documents.left, documents.top);
return;
}
- const data = this._getRangePointData(start!, end!, skeleton);
+ const data = this._getRangePointData(start!, end!, documents);
const { pointGroup, cursorList } = data;
this._setCursor(cursorList);
pointGroup.length > 0 && this._createAndUpdateRange(pointGroup, documents.left, documents.top);
diff --git a/packages/base-render/src/Component/Docs/DocSkeleton.ts b/packages/base-render/src/Component/Docs/DocSkeleton.ts
index 370b2bb108..1ffe90ce08 100644
--- a/packages/base-render/src/Component/Docs/DocSkeleton.ts
+++ b/packages/base-render/src/Component/Docs/DocSkeleton.ts
@@ -319,8 +319,11 @@ export class DocumentSkeleton extends Skeleton {
};
let curSkeletonPage: IDocumentSkeletonPage = getLastPage(allSkeletonPages);
+ let isContinuous = false;
if (sectionType === SectionType.CONTINUOUS) {
+ updateBlockIndex(allSkeletonPages);
this.__addNewSectionByContinuous(curSkeletonPage, columnProperties, columnSeparatorType);
+ isContinuous = true;
} else {
curSkeletonPage = createSkeletonPage(sectionBreakConfig, skeletonResourceReference, curSkeletonPage?.pageNumber);
}
@@ -339,6 +342,10 @@ export class DocumentSkeleton extends Skeleton {
// this._renderedBlockIdMap.set(blockId, value);
// });
+ if (isContinuous) {
+ pages.splice(0, 1);
+ }
+
allSkeletonPages.push(...pages);
}
@@ -352,11 +359,11 @@ export class DocumentSkeleton extends Skeleton {
private __addNewSectionByContinuous(curSkeletonPage: IDocumentSkeletonPage, columnProperties: ISectionColumnProperties[], columnSeparatorType: ColumnSeparatorType) {
const sections = curSkeletonPage.sections;
const lastSection = sections[sections.length - 1];
- const { width, height, marginTop: curPageMT, marginBottom: curPageMB, marginLeft: curPageML, marginRight: curPageMR } = curSkeletonPage;
- const pageContentWidth = width - curPageML - curPageMR;
- const pageContentHeight = height - curPageMT - curPageMB;
+ const { pageWidth, pageHeight, marginTop: curPageMT, marginBottom: curPageMB, marginLeft: curPageML, marginRight: curPageMR } = curSkeletonPage;
+ const pageContentWidth = pageWidth - curPageML - curPageMR;
+ const pageContentHeight = pageHeight - curPageMT - curPageMB;
const lastSectionBottom = (lastSection?.top || 0) + (lastSection?.height || 0);
- const newSection = createSkeletonSection(columnProperties, columnSeparatorType, lastSectionBottom, pageContentWidth, pageContentHeight - lastSectionBottom);
+ const newSection = createSkeletonSection(columnProperties, columnSeparatorType, lastSectionBottom, 0, pageContentWidth, pageContentHeight - lastSectionBottom);
newSection.parent = curSkeletonPage;
sections.push(newSection);
}
diff --git a/packages/base-render/src/Component/Docs/Document.ts b/packages/base-render/src/Component/Docs/Document.ts
index b1571211cd..851ee14773 100644
--- a/packages/base-render/src/Component/Docs/Document.ts
+++ b/packages/base-render/src/Component/Docs/Document.ts
@@ -12,6 +12,7 @@ import { DocsEditor } from './Document.Editor';
import { Liquid } from './Common';
import { Scene } from '../../Scene';
import { TextSelection } from './Common/TextSelection';
+import { Engine } from '../..';
export interface IDocumentsConfig {
pageMarginLeft?: number;
@@ -189,9 +190,12 @@ export class Documents extends DocComponent {
};
}
- calculatePagePosition() {
+ calculatePagePosition(engine: Nullable<Engine>) {
const scene = this.getScene() as Scene;
- const engine = scene?.getEngine();
+
+ if (engine == null) {
+ engine = scene?.getEngine();
+ }
const { width: docsWidth, height: docsHeight, pageMarginLeft, pageMarginTop } = this;
if (engine == null) {
return;
@@ -427,7 +431,7 @@ export class Documents extends DocComponent {
} else {
this._drawLiquid.translateSave();
- this._drawLiquid.translateLine(line);
+ this._drawLiquid.translateLine(line, true);
rotateTranslateXListApply && this._drawLiquid.translate(rotateTranslateXListApply[i]); // x axis offset
const divideLength = divides.length;
@@ -489,8 +493,8 @@ export class Documents extends DocComponent {
this._resetRotation(ctx, finalAngle);
const { x, y } = this._drawLiquid.translatePage(page, this.pageLayoutType, this.pageMarginLeft, this.pageMarginTop);
- pageLeft = x;
- pageTop = y;
+ pageLeft += x;
+ pageTop += y;
}
}
@@ -628,6 +632,7 @@ export class Documents extends DocComponent {
const { startX, startY, endX, endY } = this._getPageBoundingBox(page);
if (!(x >= startX && x <= endX && y >= startY && y <= endY)) {
+ this._translatePage(page);
continue;
}
@@ -723,12 +728,16 @@ export class Documents extends DocComponent {
}
}
this._findLiquid.restorePagePadding(page);
- this._findLiquid.translatePage(page, this.pageLayoutType, this.pageMarginLeft, this.pageMarginTop);
+ this._translatePage(page);
}
return false;
}
+ private _translatePage(page: IDocumentSkeletonPage) {
+ this._findLiquid.translatePage(page, this.pageLayoutType, this.pageMarginLeft, this.pageMarginTop);
+ }
+
static create(oKey: string, documentSkeleton?: DocumentSkeleton, config?: IDocumentsConfig) {
return new Documents(oKey, documentSkeleton, config);
}
diff --git a/packages/base-render/src/Component/Sheets/Extensions/BorderAuxiliary.ts b/packages/base-render/src/Component/Sheets/Extensions/BorderAuxiliary.ts
index c514a05b40..3137ef0e73 100644
--- a/packages/base-render/src/Component/Sheets/Extensions/BorderAuxiliary.ts
+++ b/packages/base-render/src/Component/Sheets/Extensions/BorderAuxiliary.ts
@@ -1,8 +1,7 @@
-import { IRangeData, ObjectMatrix } from '@univer/core';
+import { BooleanNumber, IRangeData, IScale, ObjectMatrix } from '@univer/core';
import { fixLineWidthByScale, getColor } from '../../../Basics/Tools';
import { SpreadsheetSkeleton } from '../SheetSkeleton';
import { SheetExtension } from './SheetExtension';
-import { IScale } from '../../../Basics/Interfaces';
import { SpreadsheetExtensionRegistry } from '../../Extension';
const UNIQUE_KEY = 'DefaultBorderAuxiliaryExtension';
@@ -13,10 +12,10 @@ export class BorderAuxiliary extends SheetExtension {
zIndex = 10;
draw(ctx: CanvasRenderingContext2D, parentScale: IScale, spreadsheetSkeleton: SpreadsheetSkeleton) {
- const { rowColumnSegment, rowTitleWidth = 0, columnTitleHeight = 0, dataMergeCache, overflowCache, stylesCache } = spreadsheetSkeleton;
+ const { rowColumnSegment, rowTitleWidth = 0, columnTitleHeight = 0, dataMergeCache, overflowCache, stylesCache, showGridlines } = spreadsheetSkeleton;
const { startRow, endRow, startColumn, endColumn } = rowColumnSegment;
- if (!spreadsheetSkeleton) {
+ if (!spreadsheetSkeleton || showGridlines === BooleanNumber.FALSE) {
return;
}
diff --git a/packages/base-render/src/Component/Sheets/SheetSkeleton.ts b/packages/base-render/src/Component/Sheets/SheetSkeleton.ts
index cf0b48ba29..5355be7c2f 100644
--- a/packages/base-render/src/Component/Sheets/SheetSkeleton.ts
+++ b/packages/base-render/src/Component/Sheets/SheetSkeleton.ts
@@ -102,6 +102,8 @@ export class SpreadsheetSkeleton extends Skeleton {
private _stylesCache: IStylesCache;
+ private _showGridlines: BooleanNumber;
+
constructor(private _config: IWorksheetConfig, private _cellData: ObjectMatrix<ICellData>, private _styles: Styles, context: SheetContext) {
super(context);
this.updateLayout();
@@ -160,6 +162,10 @@ export class SpreadsheetSkeleton extends Skeleton {
return this._overflowCache;
}
+ get showGridlines() {
+ return this._showGridlines;
+ }
+
setOverflowCache(value: ObjectMatrix<IRangeData>) {
this._overflowCache = value;
}
@@ -188,7 +194,7 @@ export class SpreadsheetSkeleton extends Skeleton {
if (!this.dirty) {
return;
}
- const { rowData, columnData, defaultRowHeight, defaultColumnWidth, rowCount, columnCount, rowTitle, columnTitle } = this._config;
+ const { rowData, columnData, defaultRowHeight, defaultColumnWidth, rowCount, columnCount, rowTitle, columnTitle, showGridlines } = this._config;
const { rowTotalHeight, rowHeightAccumulation } = this._generateRowMatrixCache(rowCount, rowData, defaultRowHeight);
const { columnTotalWidth, columnWidthAccumulation } = this._generateColumnMatrixCache(columnCount, columnData, defaultColumnWidth);
@@ -199,6 +205,7 @@ export class SpreadsheetSkeleton extends Skeleton {
this._rowHeightAccumulation = rowHeightAccumulation;
this._columnTotalWidth = columnTotalWidth;
this._columnWidthAccumulation = columnWidthAccumulation;
+ this._showGridlines = showGridlines;
this.makeDirty(true);
diff --git a/packages/base-render/src/Scene.ts b/packages/base-render/src/Scene.ts
index 7e0c2cd45a..da6993c1b1 100644
--- a/packages/base-render/src/Scene.ts
+++ b/packages/base-render/src/Scene.ts
@@ -673,7 +673,7 @@ export class Scene {
isPickedObject = o;
}
break;
- } else if (o.classType === RENDER_CLASS_TYPE.SCENE_VIEWER) {
+ } else if (o.classType === RENDER_CLASS_TYPE.SCENE_VIEWER && (o as SceneViewer).allowSelectedClipElement()) {
const pickedObject = (o as SceneViewer).pick(svCoord);
if (pickedObject) {
isPickedObject = pickedObject;
diff --git a/packages/base-render/src/SceneViewer.ts b/packages/base-render/src/SceneViewer.ts
index 7310c8db20..5fbf05cf0d 100644
--- a/packages/base-render/src/SceneViewer.ts
+++ b/packages/base-render/src/SceneViewer.ts
@@ -11,6 +11,8 @@ export class SceneViewer extends BaseObject {
private _activeSubScene: Nullable<Scene>;
+ private _allowSelectedClipElement = false;
+
constructor(key?: string, props?: IObjectFullState) {
super(key);
this._initialProps(props);
@@ -87,6 +89,18 @@ export class SceneViewer extends BaseObject {
}
}
+ enableSelectedClipElement() {
+ this._allowSelectedClipElement = true;
+ }
+
+ disableSelectedClipElement() {
+ this._allowSelectedClipElement = false;
+ }
+
+ allowSelectedClipElement() {
+ return this._allowSelectedClipElement;
+ }
+
// 判断被选中的唯一对象
pick(coord: Vector2) {
if (this._activeSubScene === undefined) {
diff --git a/packages/base-slides/src/Controller/SlideBarController.ts b/packages/base-slides/src/Controller/SlideBarController.ts
index 1635796389..9f264be4da 100644
--- a/packages/base-slides/src/Controller/SlideBarController.ts
+++ b/packages/base-slides/src/Controller/SlideBarController.ts
@@ -30,6 +30,16 @@ export class SlideBarController {
const canvasView = this._getCanvasView();
canvasView.createSlidePages(this._slideBar, this._pages);
+
+ canvasView.getSlide().onSlideChangePageByNavigationObservable.add((pageId) => {
+ if (this._slideBar.state.activePageId === pageId || pageId == null) {
+ return;
+ }
+ this._slideBar.setState({
+ activePageId: pageId,
+ });
+ canvasView.activePage(pageId);
+ });
});
this._plugin.getObserver('onSlideBarMousedownObservable')?.add((pageId) => {
diff --git a/packages/base-slides/src/View/Render/Adaptors/DocsAdaptor.ts b/packages/base-slides/src/View/Render/Adaptors/DocsAdaptor.ts
new file mode 100644
index 0000000000..a0d3c7d978
--- /dev/null
+++ b/packages/base-slides/src/View/Render/Adaptors/DocsAdaptor.ts
@@ -0,0 +1,199 @@
+import {
+ BaseObject,
+ Documents,
+ DocumentSkeleton,
+ EVENT_TYPE,
+ IPageRenderConfig,
+ IWheelEvent,
+ Liquid,
+ Picture,
+ Rect,
+ Scene,
+ SceneViewer,
+ ScrollBar,
+ Viewport,
+} from '@univer/base-render';
+import { ContextBase, DocContext, EventState, IPageElement, PageElementType } from '@univer/core';
+import { ObjectAdaptor, CanvasObjectProviderRegistry } from '../Adaptor';
+
+export enum DOCS_VIEW_KEY {
+ MAIN = '__DocsRender__',
+ SCENE_VIEWER = '__DocsViewer__',
+ SCENE = '__DocsScene__',
+ VIEWPORT = '__DocsViewPort_',
+}
+
+export class DocsAdaptor extends ObjectAdaptor {
+ zIndex = 5;
+ viewKey = PageElementType.DOCUMENT;
+
+ private _liquid = new Liquid();
+
+ check(type: PageElementType) {
+ if (type !== this.viewKey) {
+ return;
+ }
+ return this;
+ }
+
+ convert(pageElement: IPageElement, mainScene: Scene, context?: ContextBase) {
+ const { id, zIndex, left = 0, top = 0, width, height, angle, scaleX, scaleY, skewX, skewY, flipX, flipY, title, description, document: documentData } = pageElement;
+ if (documentData == null) {
+ return;
+ }
+
+ const documentSkeleton = DocumentSkeleton.create(documentData, context as DocContext);
+
+ const documents = new Documents(DOCS_VIEW_KEY.MAIN, documentSkeleton);
+
+ documentSkeleton.calculate();
+
+ const sv = new SceneViewer(DOCS_VIEW_KEY.SCENE_VIEWER + id, {
+ top,
+ left,
+ width,
+ height,
+ zIndex,
+ angle,
+ scaleX,
+ scaleY,
+ skewX,
+ skewY,
+ flipX,
+ flipY,
+ isTransformer: true,
+ });
+ const scene = new Scene(DOCS_VIEW_KEY.SCENE + id, sv);
+
+ const viewMain = new Viewport(DOCS_VIEW_KEY.VIEWPORT + id, scene, {
+ left: 0,
+ top: 0,
+ bottom: 0,
+ right: 0,
+ isWheelPreventDefaultX: true,
+ });
+
+ scene.addViewport(viewMain).attachControl();
+
+ scene.on(EVENT_TYPE.wheel, (evt: unknown, state: EventState) => {
+ const e = evt as IWheelEvent;
+ if (e.ctrlKey) {
+ const deltaFactor = Math.abs(e.deltaX);
+ let scrollNum = deltaFactor < 40 ? 0.2 : deltaFactor < 80 ? 0.4 : 0.2;
+ scrollNum *= e.deltaY > 0 ? -1 : 1;
+ if (scene.scaleX < 1) {
+ scrollNum /= 2;
+ }
+
+ if (scene.scaleX + scrollNum > 4) {
+ scene.scale(4, 4);
+ } else if (scene.scaleX + scrollNum < 0.1) {
+ scene.scale(0.1, 0.1);
+ } else {
+ const value = e.deltaY > 0 ? 0.1 : -0.1;
+ // scene.scaleBy(scrollNum, scrollNum);
+ e.preventDefault();
+ }
+ } else {
+ viewMain.onMouseWheel(e, state);
+ }
+ });
+
+ const scrollbar = new ScrollBar(viewMain, {
+ mainScene,
+ });
+
+ scene.addObject(documents);
+
+ documents.calculatePagePosition(mainScene.getEngine());
+
+ const pageSize = documents.getSkeleton()?.getPageSize();
+
+ documents.onPageRenderObservable.add((config: IPageRenderConfig) => {
+ const { page, pageLeft, pageTop, ctx } = config;
+ const { width, height, marginBottom, marginLeft, marginRight, marginTop } = page;
+ ctx.save();
+ ctx.translate(pageLeft - 0.5, pageTop - 0.5);
+ Rect.drawWith(ctx, {
+ width: pageSize?.width || width,
+ height: pageSize?.height || height,
+ strokeWidth: 1,
+ stroke: 'rgba(198,198,198, 1)',
+ fill: 'rgba(255,255,255, 1)',
+ zIndex: 3,
+ });
+ ctx.restore();
+ });
+
+ const { left: docsLeft, top: docsTop } = documents;
+
+ const { pages } = documentSkeleton.getSkeletonData();
+ const objectList: BaseObject[] = [];
+ const pageMarginCache = new Map<string, { marginLeft: number; marginTop: number }>();
+
+ let cumPageLeft = 0;
+ let cumPageTop = 0;
+
+ for (let i = 0, len = pages.length; i < len; i++) {
+ const page = pages[i];
+ const { skeDrawings, marginLeft, marginTop, pageWidth, pageHeight } = page;
+
+ // cumPageLeft + = pageWidth + documents.pageMarginLeft;
+
+ this._liquid.translatePagePadding(page);
+
+ skeDrawings.forEach((drawing) => {
+ const { aLeft, aTop, height, width, drawingOrigin } = drawing;
+
+ const { objectProperties } = drawingOrigin;
+
+ const rect = new Picture(drawing.objectId, {
+ url: objectProperties.imageProperties?.contentUrl || '',
+ left: aLeft + docsLeft + this._liquid.x,
+ top: aTop + docsTop + this._liquid.y,
+ width: width,
+ height: height,
+ zIndex: 11,
+ isTransformer: true,
+ });
+
+ pageMarginCache.set(drawing.objectId, {
+ marginLeft: this._liquid.x,
+ marginTop: this._liquid.y,
+ });
+
+ objectList.push(rect);
+ });
+
+ this._liquid.translatePage(page, documents.pageLayoutType, documents.pageMarginLeft, documents.pageMarginTop);
+ }
+ scene.openTransformer();
+ scene.addObjects(objectList);
+ scene.getTransformer()?.onChangingObservable.add((state) => {
+ const { objects } = state;
+
+ objects.forEach((object) => {
+ const { oKey, left, top, height, width } = object;
+ const cache = pageMarginCache.get(oKey);
+ const marginLeft = cache?.marginLeft || 0;
+ const marginTop = cache?.marginTop || 0;
+
+ // console.log('onChangingObservable', top, docsTop, marginTop, top - docsTop - marginTop);
+
+ documentSkeleton?.updateDrawing(oKey, {
+ left: left - docsLeft - marginLeft,
+ top: top - docsTop - marginTop,
+ height,
+ width,
+ });
+ });
+
+ documentSkeleton?.calculate();
+ });
+ scene.closeTransformer();
+
+ return sv;
+ }
+}
+
+CanvasObjectProviderRegistry.add(new DocsAdaptor());
diff --git a/packages/base-slides/src/View/Render/Adaptors/Index.ts b/packages/base-slides/src/View/Render/Adaptors/Index.ts
index 7fa5e19a8f..1197fb1eeb 100644
--- a/packages/base-slides/src/View/Render/Adaptors/Index.ts
+++ b/packages/base-slides/src/View/Render/Adaptors/Index.ts
@@ -2,3 +2,4 @@ export * from './ImageAdaptor';
export * from './RichTextAdaptor';
export * from './ShapeAdaptor';
export * from './SpreadsheetAdaptor';
+export * from './DocsAdaptor';
diff --git a/packages/base-slides/src/View/Render/Adaptors/SpreadsheetAdaptor.ts b/packages/base-slides/src/View/Render/Adaptors/SpreadsheetAdaptor.ts
index 634713aa44..f10aedb54f 100644
--- a/packages/base-slides/src/View/Render/Adaptors/SpreadsheetAdaptor.ts
+++ b/packages/base-slides/src/View/Render/Adaptors/SpreadsheetAdaptor.ts
@@ -57,6 +57,10 @@ export class SpreadsheetAdaptor extends ObjectAdaptor {
const { rowTotalHeight, columnTotalWidth, rowTitleWidth, columnTitleHeight } = spreadsheetSkeleton;
+ const allWidth = columnTotalWidth + worksheet.rowTitle.width || 0;
+
+ const allHeight = rowTotalHeight + worksheet.columnTitle.height || 0;
+
const sv = new SceneViewer(SHEET_VIEW_KEY.SCENE_VIEWER + id, {
top,
left,
@@ -74,8 +78,8 @@ export class SpreadsheetAdaptor extends ObjectAdaptor {
forceRender: true,
});
const scene = new Scene(SHEET_VIEW_KEY.SCENE + id, sv, {
- width: 800,
- height: 800,
+ width: allWidth,
+ height: allHeight,
});
this._updateViewport(id, rowTitleWidth, columnTitleHeight, scene, mainScene);
diff --git a/packages/base-slides/src/View/Render/CanvasView.ts b/packages/base-slides/src/View/Render/CanvasView.ts
index c3a4049845..c15385a695 100644
--- a/packages/base-slides/src/View/Render/CanvasView.ts
+++ b/packages/base-slides/src/View/Render/CanvasView.ts
@@ -25,6 +25,10 @@ export class CanvasView {
this._initialize();
}
+ getSlide() {
+ return this._slide;
+ }
+
createSlidePages(slideBar: SlideBar, pages: ISlidePage[]) {
const slideBarRef = slideBar.slideBarRef;
const thumbList = slideBarRef.current?.childNodes[0].childNodes;
@@ -170,6 +174,8 @@ export class CanvasView {
slideComponent.enableNav();
+ slideComponent.enableSelectedClipElement();
+
this._slide = slideComponent;
mainScene.addObject(slideComponent);
diff --git a/packages/common-plugin-data/src/Docs/DEFAULT_DOCUMENT_DATA_EN.ts b/packages/common-plugin-data/src/Docs/DEFAULT_DOCUMENT_DATA_EN.ts
new file mode 100644
index 0000000000..6392845e25
--- /dev/null
+++ b/packages/common-plugin-data/src/Docs/DEFAULT_DOCUMENT_DATA_EN.ts
@@ -0,0 +1,723 @@
+import {
+ BlockType,
+ BooleanNumber,
+ ColumnSeparatorType,
+ IDocumentData,
+ ObjectRelativeFromH,
+ ObjectRelativeFromV,
+ ParagraphElementType,
+ PositionedObjectLayoutType,
+ SectionType,
+ WrapTextType,
+} from '@univer/core';
+import { DEFAULT_LIST_TEST } from './DEFAULT_LIST';
+
+export const DEFAULT_DOCUMENT_DATA_EN: IDocumentData = {
+ id: 'd',
+ drawings: {
+ shapeTest1: {
+ objectId: 'shapeTest1',
+ objectProperties: {
+ title: 'test shape',
+ description: 'test shape',
+ size: {
+ width: 1484 * 0.15,
+ height: 864 * 0.15,
+ },
+ positionH: {
+ relativeFrom: ObjectRelativeFromH.COLUMN,
+ posOffset: 130,
+ },
+ positionV: {
+ relativeFrom: ObjectRelativeFromV.PAGE,
+ posOffset: 510,
+ },
+ angle: 0,
+ imageProperties: {
+ contentUrl: 'https://minio.cnbabylon.com/univer/slide/gartner-tech-2022.png',
+ },
+ },
+ layoutType: PositionedObjectLayoutType.WRAP_SQUARE,
+ behindDoc: BooleanNumber.FALSE,
+ wrapText: WrapTextType.BOTH_SIDES,
+ },
+ shapeTest2: {
+ objectId: 'shapeTest2',
+ objectProperties: {
+ title: 'test shape',
+ description: 'test shape',
+ size: {
+ width: 2548 * 0.1,
+ height: 2343 * 0.1,
+ },
+ positionH: {
+ relativeFrom: ObjectRelativeFromH.COLUMN,
+ posOffset: 130,
+ },
+ positionV: {
+ relativeFrom: ObjectRelativeFromV.PAGE,
+ posOffset: 200,
+ },
+ angle: 0,
+ imageProperties: {
+ contentUrl: 'https://minio.cnbabylon.com/univer/slide/hype-cycle-for-emerging-tech-2022.png',
+ },
+ },
+ layoutType: PositionedObjectLayoutType.WRAP_SQUARE,
+ behindDoc: BooleanNumber.FALSE,
+ wrapText: WrapTextType.BOTH_SIDES,
+ },
+ },
+ lists: DEFAULT_LIST_TEST,
+ body: {
+ blockElements: {
+ p1: {
+ blockId: 'p1',
+ st: 0,
+ ed: 66,
+ blockType: BlockType.PARAGRAPH,
+ paragraph: {
+ elements: {
+ e1: {
+ eId: 'e1',
+ st: 0,
+ ed: 66,
+ et: ParagraphElementType.TEXT_RUN,
+ tr: {
+ ct: 'What’s New in the 2022 Gartner Hype Cycle for Emerging Technologies',
+ ts: {
+ bl: BooleanNumber.TRUE,
+ fs: 24,
+ cl: {
+ rgb: 'rgb(0,40,86)',
+ },
+ },
+ },
+ },
+ },
+ elementOrder: [
+ {
+ elementId: 'e1',
+ paragraphElementType: ParagraphElementType.TEXT_RUN,
+ },
+ ],
+ },
+ },
+ p2: {
+ blockId: 'p2',
+ st: 67,
+ ed: 251,
+ blockType: BlockType.PARAGRAPH,
+ paragraph: {
+ paragraphStyle: {
+ spaceAbove: 20,
+ indentFirstLine: 20,
+ },
+ elements: {
+ e1: {
+ eId: 'e1',
+ st: 67,
+ ed: 251,
+ et: ParagraphElementType.TEXT_RUN,
+ tr: {
+ ct: 'Emerging technologies for 2022 fit into three main themes: evolving/expanding immersive experiences, accelerated artificial intelligence automation, and optimized technologist delivery.',
+ ts: {
+ fs: 18,
+ cl: {
+ rgb: 'rgb(0,40,86)',
+ },
+ },
+ },
+ },
+ },
+ elementOrder: [
+ {
+ elementId: 'e1',
+ paragraphElementType: ParagraphElementType.TEXT_RUN,
+ },
+ ],
+ },
+ },
+ p3: {
+ blockId: 'p3',
+ st: 252,
+ ed: 401,
+ blockType: BlockType.PARAGRAPH,
+ paragraph: {
+ paragraphStyle: {
+ spaceAbove: 20,
+ indentFirstLine: 20,
+ },
+ elements: {
+ e1: {
+ eId: 'e1',
+ st: 252,
+ ed: 401,
+ et: ParagraphElementType.TEXT_RUN,
+ tr: {
+ ct: 'The 2022 Gartner Hype Cycle identifies 25 must-know emerging technologies designed to help enterprise architecture and technology innovation leaders: ',
+ ts: {
+ fs: 16,
+ },
+ },
+ },
+ },
+ elementOrder: [
+ {
+ elementId: 'e1',
+ paragraphElementType: ParagraphElementType.TEXT_RUN,
+ },
+ ],
+ },
+ },
+ p4: {
+ blockId: 'p4',
+ st: 402,
+ ed: 429,
+ blockType: BlockType.PARAGRAPH,
+ paragraph: {
+ bullet: {
+ listId: 'testBullet',
+ nestingLevel: 0,
+ textStyle: {
+ fs: 20,
+ },
+ },
+ paragraphStyle: {
+ lineSpacing: 1.5,
+ },
+ elements: {
+ e1: {
+ eId: 'e1',
+ st: 402,
+ ed: 429,
+ et: ParagraphElementType.TEXT_RUN,
+ tr: {
+ ct: 'Expand immersive experiences',
+ ts: {
+ fs: 16,
+ },
+ },
+ },
+ },
+ elementOrder: [
+ {
+ elementId: 'e1',
+ paragraphElementType: ParagraphElementType.TEXT_RUN,
+ },
+ ],
+ },
+ },
+ p5: {
+ blockId: 'p5',
+ st: 430,
+ ed: 479,
+ blockType: BlockType.PARAGRAPH,
+ paragraph: {
+ bullet: {
+ listId: 'testBullet',
+ nestingLevel: 0,
+ textStyle: {
+ fs: 20,
+ },
+ },
+ paragraphStyle: {
+ lineSpacing: 1.5,
+ },
+ elements: {
+ e1: {
+ eId: 'e1',
+ st: 430,
+ ed: 479,
+ et: ParagraphElementType.TEXT_RUN,
+ tr: {
+ ct: 'Accelerate artificial intelligence (AI) automation',
+ ts: {
+ fs: 16,
+ },
+ },
+ },
+ },
+ elementOrder: [
+ {
+ elementId: 'e1',
+ paragraphElementType: ParagraphElementType.TEXT_RUN,
+ },
+ ],
+ },
+ },
+ p6: {
+ blockId: 'p6',
+ st: 480,
+ ed: 510,
+ blockType: BlockType.PARAGRAPH,
+ paragraph: {
+ bullet: {
+ listId: 'testBullet',
+ nestingLevel: 0,
+ textStyle: {
+ fs: 20,
+ },
+ },
+ paragraphStyle: {
+ lineSpacing: 1.5,
+ },
+ elements: {
+ e1: {
+ eId: 'e1',
+ st: 480,
+ ed: 510,
+ et: ParagraphElementType.TEXT_RUN,
+ tr: {
+ ct: 'Optimize technologist delivery ',
+ ts: {
+ fs: 16,
+ },
+ },
+ },
+ },
+ elementOrder: [
+ {
+ elementId: 'e1',
+ paragraphElementType: ParagraphElementType.TEXT_RUN,
+ },
+ ],
+ },
+ },
+ p7: {
+ blockId: 'p7',
+ st: 511,
+ ed: 705,
+ blockType: BlockType.PARAGRAPH,
+ paragraph: {
+ paragraphStyle: {
+ indentFirstLine: 20,
+ },
+ elements: {
+ e1: {
+ eId: 'e1',
+ st: 511,
+ ed: 672,
+ et: ParagraphElementType.TEXT_RUN,
+ tr: {
+ ct: 'These technologies are expected to greatly impact business and society over the next two to 10 years, but will especially enable CIOs and IT leaders to deliver on',
+ ts: {
+ fs: 16,
+ },
+ },
+ },
+ e2: {
+ eId: 'e2',
+ st: 673,
+ ed: 705,
+ et: ParagraphElementType.TEXT_RUN,
+ tr: {
+ ct: 'digital business transformation. ',
+ ts: {
+ fs: 16,
+ cl: {
+ rgb: 'rgb(0, 0, 211)',
+ },
+ bl: BooleanNumber.TRUE,
+ },
+ },
+ },
+ },
+ elementOrder: [
+ {
+ elementId: 'e1',
+ paragraphElementType: ParagraphElementType.TEXT_RUN,
+ },
+ {
+ elementId: 'e2',
+ paragraphElementType: ParagraphElementType.TEXT_RUN,
+ },
+ ],
+ },
+ },
+ p8: {
+ blockId: 'p8',
+ st: 706,
+ ed: 762,
+ blockType: BlockType.PARAGRAPH,
+ paragraph: {
+ paragraphStyle: {
+ spaceAbove: 20,
+ },
+ elements: {
+ e1: {
+ eId: 'e1',
+ st: 706,
+ ed: 762,
+ et: ParagraphElementType.TEXT_RUN,
+ tr: {
+ ct: 'Three Hype Cycle themes to think about in 2022 and beyond',
+ ts: {
+ fs: 24,
+ cl: {
+ rgb: 'rgb(255,255,255)',
+ },
+ bg: {
+ rgb: 'rgb(0,40,86)',
+ },
+ },
+ },
+ },
+ },
+ elementOrder: [
+ {
+ elementId: 'e1',
+ paragraphElementType: ParagraphElementType.TEXT_RUN,
+ },
+ ],
+ },
+ },
+ p9: {
+ blockId: 'p9',
+ st: 763,
+ ed: 1233,
+ blockType: BlockType.PARAGRAPH,
+ paragraph: {
+ paragraphStyle: {
+ spaceAbove: 20,
+ indentFirstLine: 20,
+ },
+ elements: {
+ e1: {
+ eId: 'e1',
+ st: 763,
+ ed: 1233,
+ et: ParagraphElementType.TEXT_RUN,
+ tr: {
+ ct: 'The 2022 Gartner Hype Cycle features emerging technologies and distills insights from more than 2,000 technologies into a succinct high-potential set. Most technologies have multiple use cases but enterprise architecture and technology innovation leaders should prioritize those with the greatest potential benefit for their organization. (They will also need to launch a proof-of-concept project to demonstrate the feasibility of a technology for their target use case.)',
+ ts: {
+ fs: 16,
+ },
+ },
+ },
+ },
+ elementOrder: [
+ {
+ elementId: 'e1',
+ paragraphElementType: ParagraphElementType.TEXT_RUN,
+ },
+ {
+ elementId: 'shapeTest1',
+ paragraphElementType: ParagraphElementType.DRAWING,
+ },
+ ],
+ },
+ },
+ oneSectionBreak: {
+ blockId: 'oneSectionBreak',
+ st: 0,
+ ed: 0,
+ blockType: BlockType.SECTION_BREAK,
+ sectionBreak: {
+ columnProperties: [],
+ columnSeparatorType: ColumnSeparatorType.NONE,
+ sectionType: SectionType.SECTION_TYPE_UNSPECIFIED,
+ // textDirection: textDirectionDocument,
+ // contentDirection: textDirection!,
+ },
+ },
+ p10: {
+ blockId: 'p10',
+ st: 1206 + 28,
+ ed: 1548 + 28,
+ blockType: BlockType.PARAGRAPH,
+ paragraph: {
+ paragraphStyle: {
+ indentFirstLine: 20,
+ },
+ elements: {
+ e1: {
+ eId: 'e1',
+ st: 1206 + 28,
+ ed: 1548 + 28,
+ et: ParagraphElementType.TEXT_RUN,
+ tr: {
+ ct: 'The benefit of these technologies is that they provide individuals with more control over their identities and data, and expand their range of experiences into virtual venues and ecosystems that can be integrated with digital currencies. These technologies also provide new ways to reach customers to strengthen or open up new revenue streams.',
+ ts: {
+ fs: 16,
+ },
+ },
+ },
+ },
+ elementOrder: [
+ {
+ elementId: 'e1',
+ paragraphElementType: ParagraphElementType.TEXT_RUN,
+ },
+ ],
+ },
+ },
+ p11: {
+ blockId: 'p11',
+ st: 1549 + 28,
+ ed: 1944 + 28,
+ blockType: BlockType.PARAGRAPH,
+ paragraph: {
+ paragraphStyle: {
+ indentFirstLine: 20,
+ },
+ elements: {
+ e1: {
+ eId: 'e1',
+ st: 1549 + 28,
+ ed: 1944 + 28,
+ et: ParagraphElementType.TEXT_RUN,
+ tr: {
+ ct: 'Digital twin of the customer (DToC) is a dynamic virtual representation of a customer that simulates and learns to emulate and anticipate behavior. It can be used to modify and enhance the customer experience (CX) and support new digitalization efforts, products, services and opportunities. DToC will take five to 10 years until mainstream adoption but will be transformational to organizations.',
+ ts: {
+ fs: 16,
+ },
+ },
+ },
+ },
+ elementOrder: [
+ {
+ elementId: 'e1',
+ paragraphElementType: ParagraphElementType.TEXT_RUN,
+ },
+ ],
+ },
+ },
+ p12: {
+ blockId: 'p12',
+ st: 1945 + 28,
+ ed: 2019 + 28,
+ blockType: BlockType.PARAGRAPH,
+ paragraph: {
+ paragraphStyle: {
+ indentFirstLine: 20,
+ },
+ elements: {
+ e1: {
+ eId: 'e1',
+ st: 1945 + 28,
+ ed: 2019 + 28,
+ et: ParagraphElementType.TEXT_RUN,
+ tr: {
+ ct: 'Other critical technologies in immersive experiences include the following:',
+ ts: {
+ fs: 16,
+ },
+ },
+ },
+ },
+ elementOrder: [
+ {
+ elementId: 'e1',
+ paragraphElementType: ParagraphElementType.TEXT_RUN,
+ },
+ ],
+ },
+ },
+ p13: {
+ blockId: 'p13',
+ st: 2020 + 28,
+ ed: 2250 + 28,
+ blockType: BlockType.PARAGRAPH,
+ paragraph: {
+ paragraphStyle: {
+ indentFirstLine: 20,
+ },
+ bullet: {
+ listId: 'unorderedTest',
+ nestingLevel: 0,
+ textStyle: {
+ fs: 20,
+ },
+ },
+ elements: {
+ e1: {
+ eId: 'e1',
+ st: 2020 + 28,
+ ed: 2042 + 28,
+ et: ParagraphElementType.TEXT_RUN,
+ tr: {
+ ct: 'Decentralized identity ',
+ ts: {
+ fs: 16,
+ cl: {
+ rgb: 'rgb(0, 0, 211)',
+ },
+ bl: BooleanNumber.TRUE,
+ },
+ },
+ },
+ e2: {
+ eId: 'e2',
+ st: 2043 + 28,
+ ed: 2250 + 28,
+ et: ParagraphElementType.TEXT_RUN,
+ tr: {
+ ct: '(DCI) allows an entity (typically a human user) to control their own digital identity by leveraging technologies such as blockchain or other distributed ledger technologies (DLTs), along with digital wallets.',
+ ts: {
+ fs: 16,
+ },
+ },
+ },
+ },
+ elementOrder: [
+ {
+ elementId: 'e1',
+ paragraphElementType: ParagraphElementType.TEXT_RUN,
+ },
+
+ {
+ elementId: 'e2',
+ paragraphElementType: ParagraphElementType.TEXT_RUN,
+ },
+ ],
+ },
+ },
+ p14: {
+ blockId: 'p14',
+ st: 2251 + 28,
+ ed: 2393 + 28,
+ blockType: BlockType.PARAGRAPH,
+ paragraph: {
+ paragraphStyle: {
+ indentFirstLine: 20,
+ },
+ bullet: {
+ listId: 'unorderedTest',
+ nestingLevel: 0,
+ textStyle: {
+ fs: 20,
+ },
+ },
+ elements: {
+ e1: {
+ eId: 'e1',
+ st: 2251 + 28,
+ ed: 2265 + 28,
+ et: ParagraphElementType.TEXT_RUN,
+ tr: {
+ ct: 'Digital humans ',
+ ts: {
+ fs: 16,
+ cl: {
+ rgb: 'rgb(0, 0, 211)',
+ },
+ bl: BooleanNumber.TRUE,
+ },
+ },
+ },
+ e2: {
+ eId: 'e2',
+ st: 2266 + 28,
+ ed: 2393 + 28,
+ et: ParagraphElementType.TEXT_RUN,
+ tr: {
+ ct: 'are interactive, AI-driven representations that have some of the characteristics, personality, knowledge and mindset of a human.',
+ ts: {
+ fs: 16,
+ },
+ },
+ },
+ },
+ elementOrder: [
+ {
+ elementId: 'e1',
+ paragraphElementType: ParagraphElementType.TEXT_RUN,
+ },
+ {
+ elementId: 'e2',
+ paragraphElementType: ParagraphElementType.TEXT_RUN,
+ },
+ ],
+ },
+ },
+ p15: {
+ blockId: 'p15',
+ st: 2394 + 28,
+ ed: 2582 + 28,
+ blockType: BlockType.PARAGRAPH,
+ paragraph: {
+ paragraphStyle: {
+ indentFirstLine: 20,
+ },
+ bullet: {
+ listId: 'unorderedTest',
+ nestingLevel: 0,
+ textStyle: {
+ fs: 20,
+ },
+ },
+ elements: {
+ e1: {
+ eId: 'e1',
+ st: 2394 + 28,
+ ed: 2422 + 28,
+ et: ParagraphElementType.TEXT_RUN,
+ tr: {
+ ct: 'Internal talent marketplaces ',
+ ts: {
+ fs: 16,
+ cl: {
+ rgb: 'rgb(0, 0, 0)',
+ },
+ bl: BooleanNumber.TRUE,
+ },
+ },
+ },
+ e2: {
+ eId: 'e2',
+ st: 2423 + 28,
+ ed: 2582 + 28,
+ et: ParagraphElementType.TEXT_RUN,
+ tr: {
+ ct: 'match internal employees and, in some cases, a pool of contingent workers, to time-boxed projects and various work opportunities, with no recruiter involvement.',
+ ts: {
+ fs: 16,
+ },
+ },
+ },
+ },
+ elementOrder: [
+ {
+ elementId: 'e1',
+ paragraphElementType: ParagraphElementType.TEXT_RUN,
+ },
+ {
+ elementId: 'e2',
+ paragraphElementType: ParagraphElementType.TEXT_RUN,
+ },
+ ],
+ },
+ },
+ twoSectionBreak: {
+ blockId: 'twoSectionBreak',
+ st: 0,
+ ed: 0,
+ blockType: BlockType.SECTION_BREAK,
+ sectionBreak: {
+ columnProperties: [
+ {
+ width: 200,
+ paddingEnd: 5,
+ },
+ ],
+ columnSeparatorType: ColumnSeparatorType.NONE,
+ sectionType: SectionType.SECTION_TYPE_UNSPECIFIED,
+ // textDirection: textDirectionDocument,
+ // contentDirection: textDirection!,
+ },
+ },
+ },
+ blockElementOrder: ['p1', 'p2', 'p3', 'p4', 'p5', 'p6', 'p7', 'p8', 'p9', 'oneSectionBreak', 'p10', 'p11', 'p12', 'p13', 'p14', 'p15', 'twoSectionBreak'],
+ },
+ documentStyle: {
+ pageSize: {
+ width: 594.3,
+ height: 840.51,
+ },
+ marginTop: 72,
+ marginBottom: 72,
+ marginRight: 90,
+ marginLeft: 90,
+ },
+};
diff --git a/packages/common-plugin-data/src/Docs/index.ts b/packages/common-plugin-data/src/Docs/index.ts
index 7ee2e3dfb6..5ec184cfe4 100644
--- a/packages/common-plugin-data/src/Docs/index.ts
+++ b/packages/common-plugin-data/src/Docs/index.ts
@@ -1,3 +1,4 @@
// @index('./*.ts', f => `export * from '${f.path}'`)
export * from './DEFAULT_DOCUMENT_DATA';
+export * from './DEFAULT_DOCUMENT_DATA_EN';
// @endindex
diff --git a/packages/common-plugin-data/src/Sheets/Demo/DEFAULT_WORKBOOK_DATA_DEMO.ts b/packages/common-plugin-data/src/Sheets/Demo/DEFAULT_WORKBOOK_DATA_DEMO.ts
index 7d3488465e..431717dfb3 100644
--- a/packages/common-plugin-data/src/Sheets/Demo/DEFAULT_WORKBOOK_DATA_DEMO.ts
+++ b/packages/common-plugin-data/src/Sheets/Demo/DEFAULT_WORKBOOK_DATA_DEMO.ts
@@ -1,7 +1,7 @@
import { BlockType, BooleanNumber, BorderStyleTypes, IDocumentData, IWorkbookConfig, LocaleType, ParagraphElementType, SheetTypes } from '@univer/core';
const richTextDemo: IDocumentData = {
- documentId: 'd',
+ id: 'd',
body: {
blockElements: {
oneParagraph: {
@@ -142,7 +142,7 @@ const richTextDemo: IDocumentData = {
};
const richTextDemo1: IDocumentData = {
- documentId: 'd',
+ id: 'd',
body: {
blockElements: {
oneParagraph: {
diff --git a/packages/common-plugin-data/src/Sheets/Demo/DEFAULT_WORKBOOK_DATA_DEMO3.ts b/packages/common-plugin-data/src/Sheets/Demo/DEFAULT_WORKBOOK_DATA_DEMO3.ts
index 2b58d67196..4ca9699629 100644
--- a/packages/common-plugin-data/src/Sheets/Demo/DEFAULT_WORKBOOK_DATA_DEMO3.ts
+++ b/packages/common-plugin-data/src/Sheets/Demo/DEFAULT_WORKBOOK_DATA_DEMO3.ts
@@ -1,7 +1,7 @@
import { BlockType, BooleanNumber, BorderStyleTypes, IDocumentData, IWorkbookConfig, LocaleType, ParagraphElementType, SheetTypes } from '@univer/core';
const richTextDemo: IDocumentData = {
- documentId: 'd',
+ id: 'd',
body: {
blockElements: {
oneParagraph: {
diff --git a/packages/common-plugin-data/src/Sheets/Demo/DEFAULT_WORKBOOK_DATA_DEMO4.ts b/packages/common-plugin-data/src/Sheets/Demo/DEFAULT_WORKBOOK_DATA_DEMO4.ts
index ab8d3cb916..d6316b2e78 100644
--- a/packages/common-plugin-data/src/Sheets/Demo/DEFAULT_WORKBOOK_DATA_DEMO4.ts
+++ b/packages/common-plugin-data/src/Sheets/Demo/DEFAULT_WORKBOOK_DATA_DEMO4.ts
@@ -1,7 +1,7 @@
import { BlockType, BooleanNumber, BorderStyleTypes, IDocumentData, IWorkbookConfig, LocaleType, ParagraphElementType, SheetTypes } from '@univer/core';
const richTextDemo1: IDocumentData = {
- documentId: 'd',
+ id: 'd',
body: {
blockElements: {
oneParagraph: {
diff --git a/packages/common-plugin-data/src/Sheets/SLIDE_WORKBOOK_DATA.ts b/packages/common-plugin-data/src/Sheets/SLIDE_WORKBOOK_DATA.ts
new file mode 100644
index 0000000000..36b843870c
--- /dev/null
+++ b/packages/common-plugin-data/src/Sheets/SLIDE_WORKBOOK_DATA.ts
@@ -0,0 +1,566 @@
+import { BooleanNumber, BorderStyleTypes, IWorkbookConfig, LocaleType, SheetTypes } from '@univer/core';
+
+export const SLIDE_WORKBOOK_DATA: IWorkbookConfig = {
+ id: 'workbook-01',
+ theme: 'default',
+ locale: LocaleType.EN,
+ creator: 'univer',
+ name: 'universheet',
+ skin: 'default',
+ socketUrl: '',
+ socketEnable: BooleanNumber.FALSE,
+ extensions: [],
+ sheetOrder: ['sheet-0001'],
+ pluginMeta: {},
+ styles: {
+ '1': {
+ vt: 2,
+ ht: 2,
+ bl: 1,
+ fs: 14,
+ bg: {
+ rgb: 'rgb(105,126,146)',
+ },
+ cl: {
+ rgb: 'rgb(255,255,255)',
+ },
+ },
+ '2': {
+ vt: 2,
+ ht: 2,
+ bl: 1,
+ fs: 20,
+ bg: {
+ rgb: 'rgb(244,79,86)',
+ },
+ cl: {
+ rgb: 'rgb(255,255,255)',
+ },
+ bd: {
+ t: {
+ s: BorderStyleTypes.THIN,
+ cl: {
+ rgb: 'rgb(217,217,217)',
+ },
+ },
+ l: {
+ s: BorderStyleTypes.THIN,
+ cl: {
+ rgb: 'rgb(217,217,217)',
+ },
+ },
+ r: {
+ s: BorderStyleTypes.THIN,
+ cl: {
+ rgb: 'rgb(217,217,217)',
+ },
+ },
+ b: {
+ s: BorderStyleTypes.THIN,
+ cl: {
+ rgb: 'rgb(217,217,217)',
+ },
+ },
+ },
+ },
+ '3': {
+ vt: 2,
+ bg: {
+ rgb: 'rgb(105,126,146)',
+ },
+ cl: {
+ rgb: 'rgb(255,255,255)',
+ },
+ fs: 14,
+ ht: 2,
+ bd: {
+ t: {
+ s: BorderStyleTypes.THIN,
+ cl: {
+ rgb: 'rgb(217,217,217)',
+ },
+ },
+ l: {
+ s: BorderStyleTypes.THIN,
+ cl: {
+ rgb: 'rgb(217,217,217)',
+ },
+ },
+ r: {
+ s: BorderStyleTypes.THIN,
+ cl: {
+ rgb: 'rgb(217,217,217)',
+ },
+ },
+ b: {
+ s: BorderStyleTypes.THIN,
+ cl: {
+ rgb: 'rgb(217,217,217)',
+ },
+ },
+ },
+ },
+ '4': {
+ fs: 12,
+ vt: 2,
+ pd: {
+ l: 5,
+ },
+ ht: 2,
+ bd: {
+ t: {
+ s: BorderStyleTypes.THIN,
+ cl: {
+ rgb: 'rgb(217,217,217)',
+ },
+ },
+ l: {
+ s: BorderStyleTypes.THIN,
+ cl: {
+ rgb: 'rgb(217,217,217)',
+ },
+ },
+ r: {
+ s: BorderStyleTypes.THIN,
+ cl: {
+ rgb: 'rgb(217,217,217)',
+ },
+ },
+ b: {
+ s: BorderStyleTypes.THIN,
+ cl: {
+ rgb: 'rgb(217,217,217)',
+ },
+ },
+ },
+ },
+ '5': {
+ ht: 2,
+ vt: 2,
+ bd: {
+ t: {
+ s: BorderStyleTypes.THIN,
+ cl: {
+ rgb: 'rgb(217,217,217)',
+ },
+ },
+ l: {
+ s: BorderStyleTypes.THIN,
+ cl: {
+ rgb: 'rgb(217,217,217)',
+ },
+ },
+ r: {
+ s: BorderStyleTypes.THIN,
+ cl: {
+ rgb: 'rgb(217,217,217)',
+ },
+ },
+ b: {
+ s: BorderStyleTypes.THIN,
+ cl: {
+ rgb: 'rgb(217,217,217)',
+ },
+ },
+ },
+ },
+ },
+ timeZone: 'GMT+8',
+ createdTime: '2021-11-28 12:10:10',
+ modifiedTime: '2021-11-29 12:10:10',
+ appVersion: '3.0.0-alpha',
+ lastModifiedBy: 'univer',
+ sheets: {
+ 'sheet-0001': {
+ type: SheetTypes.GRID,
+ id: 'sheet-0001',
+ name: 'sheet-0001',
+ tabColor: 'blue',
+ hidden: BooleanNumber.FALSE,
+ freezeColumn: 1,
+ rowCount: 12,
+ columnCount: 11,
+ freezeRow: 1,
+ zoomRatio: 1,
+ scrollTop: 200,
+ scrollLeft: 100,
+ defaultColumnWidth: 93,
+ defaultRowHeight: 40,
+ cellData: {
+ '1': {
+ '1': {
+ v: 'Variants',
+ s: '2',
+ },
+ '2': {
+ v: 'Platform',
+ s: '2',
+ },
+ '3': {
+ v: 'UGC Buzz volume',
+ s: '2',
+ },
+ },
+ '2': {
+ '3': {
+ v: "Jul'21",
+ s: '1',
+ },
+ '4': {
+ v: "Aug'21",
+ s: '1',
+ },
+ '5': {
+ v: "Sep'21",
+ s: '1',
+ },
+ '6': {
+ v: "Oct'21",
+ s: '1',
+ },
+ '7': {
+ v: "Nov'21",
+ s: '1',
+ },
+ '8': {
+ v: "Dec'21",
+ s: '1',
+ },
+ },
+ '3': {
+ '1': {
+ v: 'Eleva',
+ s: '3',
+ },
+ '2': {
+ v: 'Amazon',
+ s: '4',
+ },
+ '3': {
+ v: '4',
+ s: '5',
+ },
+ '4': {
+ v: '145',
+ s: '5',
+ },
+ '5': {
+ v: '44',
+ s: '5',
+ },
+ '6': {
+ v: '20',
+ s: '5',
+ },
+ '7': {
+ v: '7',
+ s: '5',
+ },
+ '8': {
+ v: '12',
+ s: '5',
+ },
+ },
+ '4': {
+ '2': {
+ v: 'Google',
+ s: '4',
+ },
+ '3': {
+ v: '2',
+ s: '5',
+ },
+ '4': {
+ v: '6',
+ s: '5',
+ },
+ '5': {
+ v: '5',
+ s: '5',
+ },
+ '6': {
+ v: '6',
+ s: '5',
+ },
+ '7': {
+ v: '12',
+ s: '5',
+ },
+ '8': {
+ v: '3113',
+ s: '5',
+ },
+ },
+ '5': {
+ '2': {
+ v: 'Amazon',
+ s: '4',
+ },
+ '3': {
+ v: '14',
+ s: '5',
+ },
+ '4': {
+ v: '13',
+ s: '5',
+ },
+ '5': {
+ v: '6',
+ s: '5',
+ },
+ '6': {
+ v: '6',
+ s: '5',
+ },
+ '7': {
+ v: '11',
+ s: '5',
+ },
+ '8': {
+ v: '2',
+ s: '5',
+ },
+ },
+ '6': {
+ '1': {
+ v: 'Similac',
+ s: '3',
+ },
+ '2': {
+ v: 'SaleForce',
+ s: '4',
+ },
+ '3': {
+ v: '451',
+ s: '5',
+ },
+ '4': {
+ v: '255',
+ s: '5',
+ },
+ '5': {
+ v: '72',
+ s: '5',
+ },
+ '6': {
+ v: '23',
+ s: '5',
+ },
+ '7': {
+ v: '163',
+ s: '5',
+ },
+ '8': {
+ v: '22',
+ s: '5',
+ },
+ },
+ '7': {
+ '2': {
+ v: 'Oracle',
+ s: '4',
+ },
+ '3': {
+ v: '0',
+ s: '5',
+ },
+ '4': {
+ v: '1',
+ s: '5',
+ },
+ '5': {
+ v: '1136',
+ s: '5',
+ },
+ '6': {
+ v: '11',
+ s: '5',
+ },
+ '7': {
+ v: '2',
+ s: '5',
+ },
+ '8': {
+ v: '1',
+ s: '5',
+ },
+ },
+ '8': {
+ '2': {
+ v: 'Apple',
+ s: '4',
+ },
+ '3': {
+ v: '7',
+ s: '5',
+ },
+ '4': {
+ v: '2',
+ s: '5',
+ },
+ '5': {
+ v: '10',
+ s: '5',
+ },
+ '6': {
+ v: '5',
+ s: '5',
+ },
+ '7': {
+ v: '6',
+ s: '5',
+ },
+ '8': {
+ v: '3',
+ s: '5',
+ },
+ },
+ '9': {
+ '1': {
+ v: 'TC',
+ s: '3',
+ },
+ '2': {
+ v: 'IBM',
+ s: '4',
+ },
+ '3': {
+ v: '1',
+ s: '5',
+ },
+ '4': {
+ v: '12',
+ s: '5',
+ },
+ '5': {
+ v: '2',
+ s: '5',
+ },
+ '6': {
+ v: '1',
+ s: '5',
+ },
+ '7': {
+ v: '1',
+ s: '5',
+ },
+ '8': {
+ v: '1',
+ s: '5',
+ },
+ },
+ '10': {
+ '2': {
+ v: 'Google',
+ s: '4',
+ },
+ '3': {
+ v: '26',
+ s: '5',
+ },
+ '4': {
+ v: '33',
+ s: '5',
+ },
+ '5': {
+ v: '33',
+ s: '5',
+ },
+ '6': {
+ v: '6',
+ s: '5',
+ },
+ '7': {
+ v: '22',
+ s: '5',
+ },
+ '8': {
+ v: '8',
+ s: '5',
+ },
+ },
+ },
+ mergeData: [
+ {
+ startRow: 1,
+ endRow: 2,
+ startColumn: 1,
+ endColumn: 1,
+ },
+ {
+ startRow: 1,
+ endRow: 2,
+ startColumn: 2,
+ endColumn: 2,
+ },
+ {
+ startRow: 1,
+ endRow: 1,
+ startColumn: 3,
+ endColumn: 8,
+ },
+ {
+ startRow: 3,
+ endRow: 5,
+ startColumn: 1,
+ endColumn: 1,
+ },
+ {
+ startRow: 6,
+ endRow: 8,
+ startColumn: 1,
+ endColumn: 1,
+ },
+ {
+ startRow: 9,
+ endRow: 10,
+ startColumn: 1,
+ endColumn: 1,
+ },
+ ],
+ rowData: {
+ '0': {
+ h: 20,
+ },
+ },
+ columnData: {
+ '0': {
+ w: 20,
+ },
+ '2': {
+ w: 120,
+ },
+ },
+ status: 1,
+ showGridlines: 0,
+ hideRow: [],
+ hideColumn: [],
+ rowTitle: {
+ width: 46,
+ hidden: BooleanNumber.FALSE,
+ },
+ columnTitle: {
+ height: 20,
+ hidden: BooleanNumber.FALSE,
+ },
+ selections: ['A2'],
+ rightToLeft: BooleanNumber.FALSE,
+ pluginMeta: {},
+ },
+ },
+ namedRanges: [
+ {
+ namedRangeId: 'named-rang',
+ name: 'namedRange',
+ range: {
+ sheetId: 'sheet-0001',
+ rangeData: {
+ startRow: 0,
+ startColumn: 0,
+ endRow: 1,
+ endColumn: 1,
+ },
+ },
+ },
+ ],
+};
diff --git a/packages/common-plugin-data/src/Sheets/index.ts b/packages/common-plugin-data/src/Sheets/index.ts
index d3c4a39312..33da6e146a 100644
--- a/packages/common-plugin-data/src/Sheets/index.ts
+++ b/packages/common-plugin-data/src/Sheets/index.ts
@@ -1,9 +1,5 @@
// @index('./*.ts', f => `export * from '${f.path}'`)
export * from './DEFAULT_WORKBOOK_DATA';
export * from './Demo';
-export * from './Demo/DEFAULT_WORKBOOK_DATA_DEMO';
-export * from './Demo/DEFAULT_WORKBOOK_DATA_DEMO1';
-export * from './Demo/DEFAULT_WORKBOOK_DATA_DEMO2';
-export * from './Demo/DEFAULT_WORKBOOK_DATA_DEMO3';
-export * from './Demo/DEFAULT_WORKBOOK_DATA_DEMO4';
+export * from './SLIDE_WORKBOOK_DATA';
// @endindex
diff --git a/packages/common-plugin-data/src/Slides/DEFAULT_SLIDE_DATA.ts b/packages/common-plugin-data/src/Slides/DEFAULT_SLIDE_DATA.ts
index ba294a48f9..e00f31f237 100644
--- a/packages/common-plugin-data/src/Slides/DEFAULT_SLIDE_DATA.ts
+++ b/packages/common-plugin-data/src/Slides/DEFAULT_SLIDE_DATA.ts
@@ -3,7 +3,8 @@ import { DEFAULT_FIRST_PAGE } from './DefaultPages/Page1';
import { DEFAULT_SECOND_PAGE } from './DefaultPages/Page2';
import { DEFAULT_THIRD_PAGE } from './DefaultPages/Page3';
import { DEFAULT_FORTH_PAGE } from './DefaultPages/Page4';
-import { DEFAULT_Fifth_PAGE } from './DefaultPages/Page5';
+import { DEFAULT_FIFTH_PAGE } from './DefaultPages/Page5';
+import { DEFAULT_SIXTH_PAGE } from './DefaultPages/Page6';
export const DEFAULT_SLIDE_DATA: ISlideData = {
id: 'slide_test',
@@ -17,9 +18,10 @@ export const DEFAULT_SLIDE_DATA: ISlideData = {
cover_1: DEFAULT_FIRST_PAGE,
catalog_1: DEFAULT_SECOND_PAGE,
strategic_1: DEFAULT_THIRD_PAGE,
+ technology_1: DEFAULT_FIFTH_PAGE,
+ richText_1: DEFAULT_SIXTH_PAGE,
business_1: DEFAULT_FORTH_PAGE,
- technology_1: DEFAULT_Fifth_PAGE,
},
- pageOrder: ['cover_1', 'catalog_1', 'strategic_1', 'business_1', 'technology_1'],
+ pageOrder: ['cover_1', 'catalog_1', 'strategic_1', 'technology_1', 'richText_1', 'business_1'],
},
};
diff --git a/packages/common-plugin-data/src/Slides/DefaultPages/Page4.ts b/packages/common-plugin-data/src/Slides/DefaultPages/Page4.ts
index 6ebe9b272b..e1e286d73e 100644
--- a/packages/common-plugin-data/src/Slides/DefaultPages/Page4.ts
+++ b/packages/common-plugin-data/src/Slides/DefaultPages/Page4.ts
@@ -1,8 +1,8 @@
import { IWorksheetConfig, PageElementType, PageType, ShapeType } from '@univer/core';
-import { DEFAULT_WORKBOOK_DATA } from '../../Sheets/DEFAULT_WORKBOOK_DATA';
+import { SLIDE_WORKBOOK_DATA } from '../../Sheets/SLIDE_WORKBOOK_DATA';
-const worksheetConfig = DEFAULT_WORKBOOK_DATA.sheets[DEFAULT_WORKBOOK_DATA.sheetOrder[0]] as IWorksheetConfig;
-const spreadStyles = DEFAULT_WORKBOOK_DATA.styles;
+const worksheetConfig = SLIDE_WORKBOOK_DATA.sheets[SLIDE_WORKBOOK_DATA.sheetOrder[0]] as IWorksheetConfig;
+const spreadStyles = SLIDE_WORKBOOK_DATA.styles;
export const DEFAULT_FORTH_PAGE = {
id: 'business_1',
@@ -95,10 +95,10 @@ export const DEFAULT_FORTH_PAGE = {
spreadSheet1: {
id: 'table1',
zIndex: 3,
- left: 54,
- top: 149,
- width: 854,
- height: 333,
+ left: 30,
+ top: 125,
+ width: 900,
+ height: 400,
title: 'table1',
description: '',
type: PageElementType.SPREADSHEET,
diff --git a/packages/common-plugin-data/src/Slides/DefaultPages/Page5.ts b/packages/common-plugin-data/src/Slides/DefaultPages/Page5.ts
index e2a3160bea..24f6c0e6d8 100644
--- a/packages/common-plugin-data/src/Slides/DefaultPages/Page5.ts
+++ b/packages/common-plugin-data/src/Slides/DefaultPages/Page5.ts
@@ -1,6 +1,6 @@
import { PageElementType, PageType, ShapeType } from '@univer/core';
-export const DEFAULT_Fifth_PAGE = {
+export const DEFAULT_FIFTH_PAGE = {
id: 'technology_1',
pageType: PageType.SLIDE,
zIndex: 2,
diff --git a/packages/common-plugin-data/src/Slides/DefaultPages/Page6.ts b/packages/common-plugin-data/src/Slides/DefaultPages/Page6.ts
new file mode 100644
index 0000000000..fb03d9670c
--- /dev/null
+++ b/packages/common-plugin-data/src/Slides/DefaultPages/Page6.ts
@@ -0,0 +1,105 @@
+import { PageElementType, PageType, ShapeType } from '@univer/core';
+import { DEFAULT_DOCUMENT_DATA_EN } from '../../Docs/DEFAULT_DOCUMENT_DATA_EN';
+
+export const DEFAULT_SIXTH_PAGE = {
+ id: 'richText_1',
+ pageType: PageType.SLIDE,
+ zIndex: 2,
+ title: 'business',
+ description: 'this is fix page, rich text',
+ pageBackgroundFill: {
+ rgb: 'rgb(255,255,255)',
+ },
+ pageElements: {
+ background1: {
+ id: 'background1',
+ zIndex: 1,
+ left: 0,
+ top: 0,
+ width: 960,
+ height: 540,
+ title: 'mask',
+ description: '',
+ type: PageElementType.SHAPE,
+ shape: {
+ shapeType: ShapeType.RECTANGLE,
+ text: '',
+ shapeProperties: {
+ shapeBackgroundFill: {
+ rgb: 'rgba(237,237,237,1)',
+ },
+ outline: {
+ outlineFill: {
+ rgb: 'rgba(198,198,198,1)',
+ },
+ weight: 1,
+ },
+ },
+ },
+ },
+ titleIcon1: {
+ id: 'titleIcon1',
+ zIndex: 2,
+ left: 48,
+ top: 52,
+ width: 117 * 0.3,
+ height: 16 * 0.3,
+ title: 'title Icon',
+ description: '',
+ type: PageElementType.IMAGE,
+ image: {
+ imageProperties: {
+ contentUrl: 'https://minio.cnbabylon.com/univer/slide/title.png',
+ },
+ },
+ },
+ title1: {
+ id: 'title1',
+ zIndex: 2,
+ left: 44,
+ top: 56,
+ width: 454,
+ height: 50,
+ title: 'mask',
+ description: '',
+ type: PageElementType.TEXT,
+ richText: {
+ text: 'The Work-like Editor',
+ fs: 32,
+ cl: {
+ rgb: 'rgb(244,79,86)',
+ },
+ },
+ },
+ subTitle1: {
+ id: 'subTitle1',
+ zIndex: 2,
+ left: 44,
+ top: 93,
+ width: 889,
+ height: 46,
+ title: 'subTitle',
+ description: '',
+ type: PageElementType.TEXT,
+ richText: {
+ text: 'Open source WYSIWYG editor built for the modern web',
+ fs: 18,
+ cl: {
+ rgb: 'rgb(127,127,127)',
+ },
+ },
+ },
+ document: {
+ id: 'table1',
+ zIndex: 3,
+ left: 30,
+ top: 125,
+ width: 900,
+ height: 400,
+ title: 'table1',
+ description: '',
+ type: PageElementType.DOCUMENT,
+ document: DEFAULT_DOCUMENT_DATA_EN,
+ },
+ },
+};
diff --git a/packages/core/src/Interfaces/ISlideData.ts b/packages/core/src/Interfaces/ISlideData.ts
index 655c503c2f..f26b00703b 100644
--- a/packages/core/src/Interfaces/ISlideData.ts
+++ b/packages/core/src/Interfaces/ISlideData.ts
@@ -126,6 +126,7 @@ export interface IPageElement {
worksheet: IWorksheetConfig;
styles: IKeyType<Nullable<IStyleData>>;
};
+ document?: IDocumentData;
// video: IVideo;
// line: ILine;
// table: ITable;
@@ -146,6 +147,7 @@ export enum PageElementType {
IMAGE,
TEXT,
SPREADSHEET,
+ DOCUMENT,
}
/**