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.

fix(slide): fit doc update

DR-Univer3053518f2ccf
diff --git a/packages/base-slides/src/View/Render/Adaptors/DocsAdaptor.ts b/packages/base-slides/src/View/Render/Adaptors/DocsAdaptor.ts
index 8f6da6203d..b936809e5e 100644
--- a/packages/base-slides/src/View/Render/Adaptors/DocsAdaptor.ts
+++ b/packages/base-slides/src/View/Render/Adaptors/DocsAdaptor.ts
@@ -13,7 +13,7 @@ import {
ScrollBar,
Viewport,
} from '@univerjs/base-render';
-import { ContextBase, DocContext, EventState, IPageElement, PageElementType } from '@univerjs/core';
+import { ContextBase, DocContext, DocumentModel, EventState, IPageElement, PageElementType } from '@univerjs/core';
import { ObjectAdaptor, CanvasObjectProviderRegistry } from '../Adaptor';
export enum DOCS_VIEW_KEY {
@@ -43,7 +43,7 @@ export class DocsAdaptor extends ObjectAdaptor {
return;
}
- const documentSkeleton = DocumentSkeleton.create(documentData, context as DocContext);
+ const documentSkeleton = DocumentSkeleton.create(new DocumentModel(documentData, context as DocContext), context as DocContext);
const documents = new Documents(DOCS_VIEW_KEY.MAIN, documentSkeleton);
@@ -183,7 +183,7 @@ export class DocsAdaptor extends ObjectAdaptor {
// console.log('onChangingObservable', top, docsTop, marginTop, top - docsTop - marginTop);
- documentSkeleton?.updateDrawing(oKey, {
+ documentSkeleton?.getModel().updateDrawing(oKey, {
left: left - docsLeft - marginLeft,
top: top - docsTop - marginTop,
height,
diff --git a/packages/common-plugin-data/src/Slides/RichText/PAGE3_RICHTEXT_1.ts b/packages/common-plugin-data/src/Slides/RichText/PAGE3_RICHTEXT_1.ts
index 15f5845b4c..66463121dd 100644
--- a/packages/common-plugin-data/src/Slides/RichText/PAGE3_RICHTEXT_1.ts
+++ b/packages/common-plugin-data/src/Slides/RichText/PAGE3_RICHTEXT_1.ts
@@ -1,4 +1,4 @@
-import { BlockType, PageElementType, ParagraphElementType } from '@univerjs/core';
+import { PageElementType } from '@univerjs/core';
import { DEFAULT_LIST_TEST } from '../../Docs/DEFAULT_LIST';
export const PAGE3_RICHTEXT_1 = {
@@ -16,66 +16,45 @@ export const PAGE3_RICHTEXT_1 = {
id: 'd',
lists: DEFAULT_LIST_TEST,
body: {
- blockElements: [
+ dataStream: `Digital Immune System\rApplied Observability\r\n`,
+ textRuns: [
{
- blockId: 'oneParagraph',
st: 0,
- ed: 59,
- blockType: BlockType.PARAGRAPH,
- paragraph: {
- bullet: {
- listId: 'testBullet',
- nestingLevel: 0,
- textStyle: {
- fs: 20,
- },
- },
- paragraphStyle: {
- spaceBelow: 15,
+ ed: 20,
+ ts: {
+ fs: 12,
+ },
+ },
+ {
+ st: 22,
+ ed: 42,
+ ts: {
+ fs: 12,
+ },
+ },
+ ],
+ paragraphs: [
+ {
+ startIndex: 21,
+ bullet: {
+ listId: 'testBullet',
+ nestingLevel: 0,
+ textStyle: {
+ fs: 20,
},
- elements: [
- {
- eId: 'oneElement',
- st: 0,
- ed: 15,
- et: ParagraphElementType.TEXT_RUN,
- tr: {
- ct: 'Digital Immune System',
- ts: {
- fs: 12,
- },
- },
- },
- ],
+ },
+ paragraphStyle: {
+ spaceBelow: 15,
},
},
{
- blockId: 'twoParagraph',
- st: 0,
- ed: 59,
- blockType: BlockType.PARAGRAPH,
- paragraph: {
- bullet: {
- listId: 'testBullet',
- nestingLevel: 0,
- textStyle: {
- fs: 20,
- },
+ startIndex: 43,
+ bullet: {
+ listId: 'testBullet',
+ nestingLevel: 0,
+ textStyle: {
+ fs: 20,
},
- elements: [
- {
- eId: 'oneElement',
- st: 0,
- ed: 15,
- et: ParagraphElementType.TEXT_RUN,
- tr: {
- ct: 'Applied Observability',
- ts: {
- fs: 12,
- },
- },
- },
- ],
},
},
],
diff --git a/packages/common-plugin-data/src/Slides/RichText/PAGE3_RICHTEXT_2.ts b/packages/common-plugin-data/src/Slides/RichText/PAGE3_RICHTEXT_2.ts
index 7e64b6585e..fef82bae28 100644
--- a/packages/common-plugin-data/src/Slides/RichText/PAGE3_RICHTEXT_2.ts
+++ b/packages/common-plugin-data/src/Slides/RichText/PAGE3_RICHTEXT_2.ts
@@ -1,4 +1,4 @@
-import { BlockType, PageElementType, ParagraphElementType } from '@univerjs/core';
+import { PageElementType } from '@univerjs/core';
import { DEFAULT_LIST_TEST } from '../../Docs/DEFAULT_LIST';
export const PAGE3_RICHTEXT_2 = {
@@ -16,66 +16,45 @@ export const PAGE3_RICHTEXT_2 = {
id: 'd',
lists: DEFAULT_LIST_TEST,
body: {
- blockElements: [
+ dataStream: `combine SaaS, PaaS and IaaS with tailored\rprovides a curated set of tools, capabilities and processes that are packaged for easy consumption by developers and end users\r\n`,
+ textRuns: [
{
- blockId: 'oneParagraph',
st: 0,
- ed: 59,
- blockType: BlockType.PARAGRAPH,
- paragraph: {
- bullet: {
- listId: 'testBullet',
- nestingLevel: 0,
- textStyle: {
- fs: 20,
- },
- },
- paragraphStyle: {
- spaceBelow: 15,
+ ed: 40,
+ ts: {
+ fs: 12,
+ },
+ },
+ {
+ st: 42,
+ ed: 167,
+ ts: {
+ fs: 12,
+ },
+ },
+ ],
+ paragraphs: [
+ {
+ startIndex: 41,
+ bullet: {
+ listId: 'testBullet',
+ nestingLevel: 0,
+ textStyle: {
+ fs: 20,
},
- elements: [
- {
- eId: 'oneElement',
- st: 0,
- ed: 15,
- et: ParagraphElementType.TEXT_RUN,
- tr: {
- ct: 'combine SaaS, PaaS and IaaS with tailored',
- ts: {
- fs: 12,
- },
- },
- },
- ],
+ },
+ paragraphStyle: {
+ spaceBelow: 15,
},
},
{
- blockId: 'twoParagraph',
- st: 0,
- ed: 59,
- blockType: BlockType.PARAGRAPH,
- paragraph: {
- bullet: {
- listId: 'testBullet',
- nestingLevel: 0,
- textStyle: {
- fs: 20,
- },
+ startIndex: 168,
+ bullet: {
+ listId: 'testBullet',
+ nestingLevel: 0,
+ textStyle: {
+ fs: 20,
},
- elements: [
- {
- eId: 'oneElement',
- st: 0,
- ed: 15,
- et: ParagraphElementType.TEXT_RUN,
- tr: {
- ct: 'provides a curated set of tools, capabilities and processes that are packaged for easy consumption by developers and end users',
- ts: {
- fs: 12,
- },
- },
- },
- ],
},
},
],
diff --git a/packages/common-plugin-data/src/Slides/RichText/PAGE3_RICHTEXT_3.ts b/packages/common-plugin-data/src/Slides/RichText/PAGE3_RICHTEXT_3.ts
index e93ee77d21..3243f9d565 100644
--- a/packages/common-plugin-data/src/Slides/RichText/PAGE3_RICHTEXT_3.ts
+++ b/packages/common-plugin-data/src/Slides/RichText/PAGE3_RICHTEXT_3.ts
@@ -1,4 +1,4 @@
-import { BlockType, PageElementType, ParagraphElementType } from '@univerjs/core';
+import { PageElementType } from '@univerjs/core';
import { DEFAULT_LIST_TEST } from '../../Docs/DEFAULT_LIST';
export const PAGE3_RICHTEXT_3 = {
@@ -16,66 +16,45 @@ export const PAGE3_RICHTEXT_3 = {
id: 'd',
lists: DEFAULT_LIST_TEST,
body: {
- blockElements: [
+ dataStream: `SuperApps are more than composite applications that aggregate services.\rAdaptive AI allows for model behavior change post-deployment by using real-time feedback\r\n`,
+ textRuns: [
{
- blockId: 'oneParagraph',
st: 0,
- ed: 59,
- blockType: BlockType.PARAGRAPH,
- paragraph: {
- bullet: {
- listId: 'testBullet',
- nestingLevel: 0,
- textStyle: {
- fs: 20,
- },
- },
- paragraphStyle: {
- spaceBelow: 15,
+ ed: 70,
+ ts: {
+ fs: 12,
+ },
+ },
+ {
+ st: 72,
+ ed: 159,
+ ts: {
+ fs: 12,
+ },
+ },
+ ],
+ paragraphs: [
+ {
+ startIndex: 71,
+ bullet: {
+ listId: 'testBullet',
+ nestingLevel: 0,
+ textStyle: {
+ fs: 20,
},
- elements: [
- {
- eId: 'oneElement',
- st: 0,
- ed: 15,
- et: ParagraphElementType.TEXT_RUN,
- tr: {
- ct: 'SuperApps are more than composite applications that aggregate services.',
- ts: {
- fs: 12,
- },
- },
- },
- ],
+ },
+ paragraphStyle: {
+ spaceBelow: 15,
},
},
{
- blockId: 'twoParagraph',
- st: 0,
- ed: 59,
- blockType: BlockType.PARAGRAPH,
- paragraph: {
- bullet: {
- listId: 'testBullet',
- nestingLevel: 0,
- textStyle: {
- fs: 20,
- },
+ startIndex: 160,
+ bullet: {
+ listId: 'testBullet',
+ nestingLevel: 0,
+ textStyle: {
+ fs: 20,
},
- elements: [
- {
- eId: 'oneElement',
- st: 0,
- ed: 15,
- et: ParagraphElementType.TEXT_RUN,
- tr: {
- ct: 'Adaptive AI allows for model behavior change post-deployment by using real-time feedback',
- ts: {
- fs: 12,
- },
- },
- },
- ],
},
},
],
diff --git a/packages/common-plugin-data/src/Slides/RichText/PAGE5_RICHTEXT_1.ts b/packages/common-plugin-data/src/Slides/RichText/PAGE5_RICHTEXT_1.ts
index bfc69b49d9..79097b830d 100644
--- a/packages/common-plugin-data/src/Slides/RichText/PAGE5_RICHTEXT_1.ts
+++ b/packages/common-plugin-data/src/Slides/RichText/PAGE5_RICHTEXT_1.ts
@@ -1,311 +1,129 @@
-import { BlockType, BooleanNumber, IDocumentData, ParagraphElementType } from '@univerjs/core';
+import { BooleanNumber, ColumnSeparatorType, IDocumentData, SectionType } from '@univerjs/core';
import { DEFAULT_LIST_TEST } from '../../Docs/DEFAULT_LIST';
export const PAGE5_RICHTEXT_1: IDocumentData = {
id: 'd',
lists: DEFAULT_LIST_TEST,
body: {
- blockElements: [
+ dataStream:
+ 'What’s New in the 2022 Gartner Hype Cycle for Emerging Technologies\rEmerging technologies for 2022 fit into three main themes: evolving/expanding immersive experiences, accelerated artificial intelligence automation, and optimized technologist delivery.\rThe 2022 Gartner Hype Cycle identifies 25 must-know emerging technologies designed to help enterprise architecture and technology innovation leaders: \rExpand immersive experiences\rAccelerate artificial intelligence (AI) automation\rOptimize technologist delivery \r\n',
+ textRuns: [
{
- blockId: 'p1',
st: 0,
ed: 66,
- blockType: BlockType.PARAGRAPH,
- paragraph: {
- elements: [
- {
- 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: 16,
- cl: {
- rgb: 'rgb(255,255,255)',
- },
- },
- },
- },
- ],
+ ts: {
+ bl: BooleanNumber.TRUE,
+ fs: 24,
+ cl: {
+ rgb: 'rgb(0,40,86)',
+ },
},
},
{
- blockId: 'p2',
- st: 67,
- ed: 251,
- blockType: BlockType.PARAGRAPH,
- paragraph: {
- paragraphStyle: {
- spaceAbove: 20,
- indentFirstLine: 20,
+ st: 68,
+ ed: 252,
+ ts: {
+ fs: 18,
+ cl: {
+ rgb: 'rgb(0,40,86)',
},
- elements: [
- {
- 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: 12,
- cl: {
- rgb: 'rgb(0,40,86)',
- },
- },
- },
- },
- ],
},
},
{
- blockId: 'p3',
- st: 252,
- ed: 401,
- blockType: BlockType.PARAGRAPH,
- paragraph: {
- paragraphStyle: {
- spaceAbove: 20,
- indentFirstLine: 20,
- },
- elements: [
- {
- 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: 12,
- cl: {
- rgb: 'rgb(249,249,249)',
- },
- },
- },
- },
- ],
+ st: 254,
+ ed: 403,
+ ts: {
+ fs: 16,
},
},
{
- blockId: 'p4',
- st: 402,
- ed: 429,
- blockType: BlockType.PARAGRAPH,
- paragraph: {
- bullet: {
- listId: 'testBullet',
- nestingLevel: 0,
- textStyle: {
- fs: 20,
- cl: {
- rgb: 'rgb(249,249,249)',
- },
- },
- },
- paragraphStyle: {
- lineSpacing: 1.5,
- },
- elements: [
- {
- eId: 'e1',
- st: 402,
- ed: 429,
- et: ParagraphElementType.TEXT_RUN,
- tr: {
- ct: 'Expand immersive experiences',
- ts: {
- fs: 12,
- cl: {
- rgb: 'rgb(249,249,249)',
- },
- },
- },
- },
- ],
+ st: 405,
+ ed: 432,
+ ts: {
+ fs: 16,
},
},
{
- blockId: 'p13',
- st: 2020 + 28,
- ed: 2250 + 28,
- blockType: BlockType.PARAGRAPH,
- paragraph: {
- paragraphStyle: {
- indentFirstLine: 20,
- },
- bullet: {
- listId: 'testBullet',
- nestingLevel: 1,
- textStyle: {
- fs: 20,
- },
- },
- elements: [
- {
- eId: 'e1',
- st: 2020 + 28,
- ed: 2042 + 28,
- et: ParagraphElementType.TEXT_RUN,
- tr: {
- ct: 'Decentralized identity ',
- ts: {
- fs: 12,
- bl: BooleanNumber.TRUE,
- },
- },
- },
- ],
+ st: 434,
+ ed: 483,
+ ts: {
+ fs: 16,
},
},
{
- blockId: 'p14',
- st: 2251 + 28,
- ed: 2393 + 28,
- blockType: BlockType.PARAGRAPH,
- paragraph: {
- paragraphStyle: {
- indentFirstLine: 20,
- },
- bullet: {
- listId: 'testBullet',
- nestingLevel: 1,
- textStyle: {
- fs: 20,
- },
- },
- elements: [
- {
- eId: 'e1',
- st: 2251 + 28,
- ed: 2265 + 28,
- et: ParagraphElementType.TEXT_RUN,
- tr: {
- ct: 'Digital humans ',
- ts: {
- fs: 12,
-
- bl: BooleanNumber.TRUE,
- },
- },
- },
- ],
+ st: 485,
+ ed: 515,
+ ts: {
+ fs: 16,
},
},
+ ],
+ paragraphs: [
{
- blockId: 'p5',
- st: 430,
- ed: 479,
- blockType: BlockType.PARAGRAPH,
- paragraph: {
- bullet: {
- listId: 'testBullet',
- nestingLevel: 0,
- textStyle: {
- fs: 20,
- cl: {
- rgb: 'rgb(249,249,249)',
- },
- },
- },
- paragraphStyle: {
- lineSpacing: 1.5,
- },
- elements: [
- {
- eId: 'e1',
- st: 430,
- ed: 479,
- et: ParagraphElementType.TEXT_RUN,
- tr: {
- ct: 'Accelerate artificial intelligence (AI) automation',
- ts: {
- fs: 12,
- cl: {
- rgb: 'rgb(249,249,249)',
- },
- },
- },
- },
- ],
+ startIndex: 67,
+ },
+ {
+ startIndex: 253,
+ paragraphStyle: {
+ spaceAbove: 20,
+ indentFirstLine: 20,
},
},
{
- blockId: 'p15',
- st: 2394 + 28,
- ed: 2582 + 28,
- blockType: BlockType.PARAGRAPH,
- paragraph: {
- paragraphStyle: {
- indentFirstLine: 20,
- },
- bullet: {
- listId: 'testBullet',
- nestingLevel: 1,
- textStyle: {
- fs: 20,
- },
+ startIndex: 404,
+ paragraphStyle: {
+ spaceAbove: 20,
+ indentFirstLine: 20,
+ },
+ },
+ {
+ startIndex: 433,
+ bullet: {
+ listId: 'testBullet',
+ nestingLevel: 0,
+ textStyle: {
+ fs: 20,
},
- elements: [
- {
- eId: 'e1',
- st: 2394 + 28,
- ed: 2422 + 28,
- et: ParagraphElementType.TEXT_RUN,
- tr: {
- ct: 'Internal talent marketplaces ',
- ts: {
- fs: 12,
- cl: {
- rgb: 'rgb(0, 0, 0)',
- },
- bl: BooleanNumber.TRUE,
- },
- },
- },
- ],
+ },
+ paragraphStyle: {
+ lineSpacing: 1.5,
},
},
{
- blockId: 'p6',
- st: 480,
- ed: 510,
- blockType: BlockType.PARAGRAPH,
- paragraph: {
- bullet: {
- listId: 'testBullet',
- nestingLevel: 0,
- textStyle: {
- fs: 20,
- cl: {
- rgb: 'rgb(249,249,249)',
- },
- },
+ startIndex: 484,
+ bullet: {
+ listId: 'testBullet',
+ nestingLevel: 0,
+ textStyle: {
+ fs: 20,
},
- paragraphStyle: {
- lineSpacing: 1.5,
+ },
+ paragraphStyle: {
+ lineSpacing: 1.5,
+ },
+ },
+ {
+ startIndex: 516,
+ bullet: {
+ listId: 'testBullet',
+ nestingLevel: 0,
+ textStyle: {
+ fs: 20,
},
- elements: [
- {
- eId: 'e1',
- st: 480,
- ed: 510,
- et: ParagraphElementType.TEXT_RUN,
- tr: {
- ct: 'Optimize technologist delivery ',
- ts: {
- fs: 12,
- cl: {
- rgb: 'rgb(249,249,249)',
- },
- },
- },
- },
- ],
},
+ paragraphStyle: {
+ lineSpacing: 1.5,
+ },
+ },
+ ],
+ sectionBreaks: [
+ {
+ startIndex: 517,
+ columnProperties: [],
+ columnSeparatorType: ColumnSeparatorType.NONE,
+ sectionType: SectionType.SECTION_TYPE_UNSPECIFIED,
+ // textDirection: textDirectionDocument,
+ // contentDirection: textDirection!,
},
],
},