@univerjs/core 0.20.1 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@univerjs/core",
3
- "version": "0.20.1",
3
+ "version": "0.21.0",
4
4
  "private": false,
5
5
  "description": "Core library for Univer.",
6
6
  "author": "DreamNum <developer@univer.ai>",
@@ -58,17 +58,17 @@
58
58
  "rxjs": ">=7.0.0"
59
59
  },
60
60
  "dependencies": {
61
- "@univerjs/protocol": "0.1.48",
62
61
  "@wendellhu/redi": "1.1.1",
63
62
  "async-lock": "^1.4.1",
64
63
  "fast-diff": "1.3.0",
65
64
  "kdbush": "^4.0.2",
66
65
  "lodash-es": "^4.18.1",
67
- "nanoid": "5.1.7",
68
- "numfmt": "^3.2.3",
66
+ "nanoid": "5.1.9",
67
+ "numfmt": "3.2.6",
69
68
  "ot-json1": "^1.0.2",
70
69
  "rbush": "^4.0.1",
71
- "@univerjs/themes": "0.20.1"
70
+ "@univerjs/themes": "0.21.0",
71
+ "@univerjs/protocol": "0.21.0"
72
72
  },
73
73
  "devDependencies": {
74
74
  "@types/async-lock": "^1.4.2",
@@ -76,8 +76,8 @@
76
76
  "@types/rbush": "^4.0.0",
77
77
  "rxjs": "^7.8.2",
78
78
  "typescript": "^6.0.2",
79
- "vitest": "^4.1.1",
80
- "@univerjs-infra/shared": "0.20.1"
79
+ "vitest": "^4.1.4",
80
+ "@univerjs-infra/shared": "0.21.0"
81
81
  },
82
82
  "scripts": {
83
83
  "test": "vitest run",
@@ -1,62 +0,0 @@
1
- /**
2
- * Copyright 2023-present DreamNum Co., Ltd.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- import type { Observable } from 'rxjs';
17
- import type { Nullable } from '../shared';
18
- import type { ISlideData, ISlidePage } from '../types/interfaces';
19
- import { UnitModel, UniverInstanceType } from '../common/unit';
20
- import { PageType } from '../types/interfaces';
21
- export declare class SlideDataModel extends UnitModel<ISlideData, UniverInstanceType.UNIVER_SLIDE> {
22
- type: UniverInstanceType.UNIVER_SLIDE;
23
- private readonly _activePage$;
24
- private get _activePage();
25
- readonly activePage$: Observable<Nullable<ISlidePage>>;
26
- private readonly _name$;
27
- name$: Observable<string>;
28
- private _snapshot;
29
- private _unitId;
30
- constructor(snapshot: Partial<ISlideData>);
31
- setName(name: string): void;
32
- getRev(): number;
33
- incrementRev(): void;
34
- setRev(_rev: number): void;
35
- getSnapshot(): ISlideData;
36
- getUnitId(): string;
37
- getPages(): {
38
- [id: string]: ISlidePage;
39
- } | undefined;
40
- getPageOrder(): string[] | undefined;
41
- getPage(pageId: string): ISlidePage | undefined;
42
- getElementsByPage(pageId: string): {
43
- [elementId: string]: import("..").IPageElement;
44
- } | undefined;
45
- getElement(pageId: string, elementId: string): import("..").IPageElement | undefined;
46
- getPageSize(): import("..").ISize;
47
- getBlankPage(): {
48
- id: string;
49
- pageType: PageType;
50
- zIndex: number;
51
- title: string;
52
- description: string;
53
- pageBackgroundFill: {
54
- rgb: string;
55
- };
56
- pageElements: {};
57
- };
58
- setActivePage(page: Nullable<ISlidePage>): void;
59
- getActivePage(): Nullable<ISlidePage>;
60
- updatePage(pageId: string, page: ISlidePage): void;
61
- appendPage(page: ISlidePage): void;
62
- }
@@ -1,118 +0,0 @@
1
- /**
2
- * Copyright 2023-present DreamNum Co., Ltd.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- export declare enum BasicShapes {
17
- Line = "line",
18
- LineInv = "lineInv",
19
- Triangle = "triangle",
20
- RtTriangle = "rtTriangle",
21
- Rect = "rect",
22
- Diamond = "diamond",
23
- Parallelogram = "parallelogram",
24
- Trapezoid = "trapezoid",
25
- NonIsocelesTrapezoid = "nonIsocelesTrapezoid",
26
- Pentagon = "pentagon",
27
- Hexagon = "hexagon",
28
- Heptagon = "heptagon",
29
- Octagon = "octagon",
30
- Decagon = "decagon",
31
- Dodecagon = "dodecagon",
32
- Star4 = "star4",
33
- Star5 = "star5",
34
- Star6 = "star6",
35
- Star7 = "star7",
36
- Star8 = "star8",
37
- Star10 = "star10",
38
- Star12 = "star12",
39
- Star16 = "star16",
40
- Star24 = "star24",
41
- Star32 = "star32",
42
- RoundRect = "roundRect",
43
- Round1Rect = "round1Rect",
44
- Round2SameRect = "round2SameRect",
45
- Round2DiagRect = "round2DiagRect",
46
- Ellipse = "ellipse"
47
- }
48
- export declare enum ArrowsAndMarkersShapes {
49
- RightArrow = "rightArrow",
50
- LeftArrow = "leftArrow",
51
- UpArrow = "upArrow",
52
- DownArrow = "downArrow",
53
- LeftRightArrow = "leftRightArrow",
54
- UpDownArrow = "upDownArrow",
55
- QuadArrow = "quadArrow",
56
- LeftRightUpArrow = "leftRightUpArrow",
57
- BentArrow = "bentArrow",
58
- UturnArrow = "uturnArrow",
59
- CircularArrow = "circularArrow",
60
- NotchedRightArrow = "notchedRightArrow",
61
- HomePlate = "homePlate",
62
- Chevron = "chevron",
63
- LeftCircularArrow = "leftCircularArrow",
64
- LeftRightCircularArrow = "leftRightCircularArrow"
65
- }
66
- export declare enum OtherShapes {
67
- Plaque = "plaque",
68
- Can = "can",
69
- Cube = "cube",
70
- Bevel = "bevel",
71
- Donut = "donut",
72
- NoSmoking = "noSmoking",
73
- BlockArc = "blockArc",
74
- FoldedCorner = "foldedCorner"
75
- }
76
- export declare enum SpecialShapes {
77
- SmileyFace = "smileyFace",
78
- Heart = "heart",
79
- LightningBolt = "lightningBolt",
80
- Sun = "sun",
81
- Moon = "moon",
82
- Cloud = "cloud",
83
- Arc = "arc",
84
- Backpack = "backpack",
85
- Frame = "frame",
86
- HalfFrame = "halfFrame",
87
- Corner = "corner",
88
- Chord = "chord",
89
- Pie = "pie",
90
- Teardrop = "teardrop",
91
- WedgeRectCallout = "wedgeRectCallout",
92
- WedgeRRectCallout = "wedgeRRectCallout",
93
- WedgeEllipseCallout = "wedgeEllipseCallout",
94
- CloudCallout = "cloudCallout",
95
- BorderCallout1 = "borderCallout1",
96
- BorderCallout2 = "borderCallout2",
97
- BorderCallout3 = "borderCallout3",
98
- AccentCallout1 = "accentCallout1",
99
- AccentCallout2 = "accentCallout2",
100
- AccentCallout3 = "accentCallout3",
101
- Callout1 = "callout1",
102
- Callout2 = "callout2",
103
- Callout3 = "callout3",
104
- ActionButtonBackPrevious = "actionButtonBackPrevious",
105
- ActionButtonEnd = "actionButtonEnd",
106
- ActionButtonForwardNext = "actionButtonForwardNext",
107
- ActionButtonHelp = "actionButtonHelp",
108
- ActionButtonHome = "actionButtonHome",
109
- ActionButtonInformation = "actionButtonInformation",
110
- ActionButtonMovie = "actionButtonMovie",
111
- ActionButtonReturn = "actionButtonReturn",
112
- ActionButtonSound = "actionButtonSound"
113
- }
114
- /**
115
- * 20.1.9.18 prstGeom (Preset geometry)
116
- */
117
- export type ShapeType = BasicShapes | ArrowsAndMarkersShapes | OtherShapes | SpecialShapes;
118
- export type PresetGeometryType = ShapeType | 'custom';
@@ -1,167 +0,0 @@
1
- /**
2
- * Copyright 2023-present DreamNum Co., Ltd.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- import type { ISize } from '../../shared/shape';
17
- import type { Nullable } from '../../shared/types';
18
- import type { IWorksheetData } from '../../sheets/typedef';
19
- import type { LocaleType, ThemeColorType } from '../enum';
20
- import type { ShapeType } from '../enum/prst-geom-type';
21
- import type { ICustomBlock, IDocumentData, ILists } from './i-document-data';
22
- import type { ITransformState } from './i-drawing';
23
- import type { IImageProperties } from './i-image-properties';
24
- import type { IPlaceholder } from './i-placeholder';
25
- import type { IShapeProperties } from './i-shape-properties';
26
- import type { IColorStyle, IStyleBase, IStyleData } from './i-style-data';
27
- export interface ISlideData extends IReferenceSource {
28
- id: string;
29
- locale?: LocaleType;
30
- title: string;
31
- pageSize: ISize;
32
- body?: ISlidePageBody;
33
- }
34
- interface IReferenceSource {
35
- master?: {
36
- [id: string]: ISlidePage;
37
- };
38
- handoutMaster?: {
39
- [id: string]: ISlidePage;
40
- };
41
- notesMaster?: {
42
- [id: string]: ISlidePage;
43
- };
44
- layouts?: {
45
- [id: string]: ISlidePage;
46
- };
47
- lists?: ILists;
48
- }
49
- interface ISlidePageBody {
50
- pages: {
51
- [id: string]: ISlidePage;
52
- };
53
- pageOrder: string[];
54
- }
55
- export interface ISlidePage {
56
- id: string;
57
- pageType: PageType;
58
- zIndex: number;
59
- title: string;
60
- description: string;
61
- pageBackgroundFill: IColorStyle;
62
- colorScheme?: ThemeColorType;
63
- pageElements: {
64
- [elementId: string]: IPageElement;
65
- };
66
- slideProperties?: ISlideProperties;
67
- layoutProperties?: ILayoutProperties;
68
- notesProperties?: INotesProperties;
69
- handoutProperties?: IHandoutProperties;
70
- masterProperties?: IMasterProperties;
71
- }
72
- interface ISlideProperties {
73
- layoutObjectId: string;
74
- masterObjectId: string;
75
- isSkipped: boolean;
76
- }
77
- interface ILayoutProperties {
78
- masterObjectId: string;
79
- name: string;
80
- }
81
- interface INotesProperties {
82
- name: string;
83
- }
84
- interface IHandoutProperties {
85
- name: string;
86
- }
87
- interface IMasterProperties {
88
- name: string;
89
- }
90
- export interface ISlideRichTextProps extends ITransformState, IStyleBase {
91
- text?: string;
92
- rich?: IDocumentData;
93
- }
94
- export interface IPageElement {
95
- id: string;
96
- zIndex: number;
97
- left?: number;
98
- top?: number;
99
- width?: number;
100
- height?: number;
101
- angle?: number;
102
- scaleX?: number;
103
- scaleY?: number;
104
- skewX?: number;
105
- skewY?: number;
106
- flipX?: boolean;
107
- flipY?: boolean;
108
- title: string;
109
- description: string;
110
- type: PageElementType;
111
- shape?: IShape;
112
- image?: IImage;
113
- richText?: ISlideRichTextProps;
114
- /** @deprecated */
115
- spreadsheet?: {
116
- worksheet: IWorksheetData;
117
- styles: Record<string, Nullable<IStyleData>>;
118
- };
119
- /** @deprecated */
120
- document?: IDocumentData;
121
- /** @deprecated */
122
- slide?: ISlideData;
123
- customBlock?: ICustomBlock;
124
- }
125
- export declare enum PageType {
126
- SLIDE = 0,// A slide page.
127
- MASTER = 1,// A master slide page.
128
- LAYOUT = 2,// A layout page.
129
- HANDOUT_MASTER = 3,// A handout master page.
130
- NOTES_MASTER = 4
131
- }
132
- export declare enum PageElementType {
133
- SHAPE = 0,
134
- IMAGE = 1,
135
- TEXT = 2,
136
- SPREADSHEET = 3,
137
- DOCUMENT = 4,
138
- SLIDE = 5
139
- }
140
- /**
141
- * IShape
142
- */
143
- export interface IShape {
144
- shapeType: ShapeType;
145
- text: string;
146
- shapeProperties: IShapeProperties;
147
- placeholder?: IPlaceholder;
148
- link?: ILink;
149
- }
150
- export interface IImage {
151
- imageProperties?: IImageProperties;
152
- placeholder?: IPlaceholder;
153
- link?: ILink;
154
- }
155
- interface ILink {
156
- relativeLink: RelativeSlideLink;
157
- pageId?: string;
158
- slideIndex?: number;
159
- }
160
- export declare enum RelativeSlideLink {
161
- RELATIVE_SLIDE_LINK_UNSPECIFIED = 0,// An unspecified relative slide link.
162
- NEXT_SLIDE = 1,// A link to the next slide.
163
- PREVIOUS_SLIDE = 2,// A link to the previous slide.
164
- FIRST_SLIDE = 3,// A link to the first slide in the presentation.
165
- LAST_SLIDE = 4
166
- }
167
- export {};