@univerjs/engine-render 0.4.1-experimental.20241023-bbb123f → 0.4.1-experimental.20241024-0ebc6ee
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/lib/cjs/index.js +1 -1
- package/lib/es/index.js +44 -29
- package/lib/types/components/sheets/sheet-component.d.ts +1 -1
- package/lib/types/components/sheets/sheet-skeleton.d.ts +7 -2
- package/lib/types/components/sheets/spreadsheet.d.ts +0 -3
- package/lib/types/context.d.ts +2 -27
- package/lib/types/index.d.ts +2 -1
- package/lib/types/services/render-config.d.ts +18 -0
- package/lib/types/services/render-config.service.d.ts +26 -0
- package/lib/types/viewport.d.ts +2 -0
- package/lib/umd/index.js +1 -1
- package/package.json +2 -2
- package/lib/types/{render-engine.d.ts → plugin.d.ts} +1 -1
package/lib/es/index.js
CHANGED
|
@@ -2,8 +2,8 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value;
|
|
3
3
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
|
|
4
4
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key != "symbol" ? key + "" : key, value);
|
|
5
|
-
import { Tools, DEFAULT_STYLES, FontStyleType, BaselineOffset, getCellInfoInMergeData, Rectangle, ColorKit, Disposable, EventSubject, checkParagraphHasIndentByStyle, DataStreamTreeTokenType, BorderStyleTypes, BooleanNumber, DisposableCollection, toDisposable, sortRules, Registry, Range, numberToABC, Inject, LocaleService, insertTextToContent, horizontalLineSegmentsSubtraction, deleteContent, DataStreamTreeNodeType, DocumentDataModel, GridType, BulletAlignment, PositionedObjectLayoutType, WrapTextType, ColumnSeparatorType, TableAlignmentType, ObjectRelativeFromV, TableTextWrapType, SpacingRule, CustomDecorationType, CustomRangeType, ObjectMatrix, SectionType, NumberUnitType, DocumentFlavor, PageOrientType, HorizontalAlign, VerticalAlign, WrapStrategy, AlignTypeH, ObjectRelativeFromH, AlignTypeV, mergeWith, GlyphType as GlyphType$1, numberToListABC, PRESET_LIST_TYPE, searchArray, extractPureTextFromCell, CellValueType, isCellCoverable, isNullCell, getColorStyle, isWhiteColor, IContextService, BuildTextUtils, TextX, DEFAULT_EMPTY_DOCUMENT_VALUE, TextDecoration, COLORS, requestImmediateMacroTask, MOVE_BUFFER_VALUE, sortRulesByDesc, Injector, isClassDependencyItem, createIdentifier, remove, UniverInstanceType, IUniverInstanceService, Plugin,
|
|
6
|
-
import { BehaviorSubject, Subject, startWith, distinctUntilChanged, Subscription, Observable, shareReplay } from "rxjs";
|
|
5
|
+
import { Tools, DEFAULT_STYLES, FontStyleType, BaselineOffset, getCellInfoInMergeData, Rectangle, ColorKit, Disposable, EventSubject, checkParagraphHasIndentByStyle, DataStreamTreeTokenType, BorderStyleTypes, BooleanNumber, DisposableCollection, toDisposable, sortRules, Registry, Range, numberToABC, Inject, LocaleService, insertTextToContent, horizontalLineSegmentsSubtraction, deleteContent, DataStreamTreeNodeType, DocumentDataModel, GridType, BulletAlignment, PositionedObjectLayoutType, WrapTextType, ColumnSeparatorType, TableAlignmentType, ObjectRelativeFromV, TableTextWrapType, SpacingRule, CustomDecorationType, CustomRangeType, ObjectMatrix, SectionType, NumberUnitType, DocumentFlavor, PageOrientType, HorizontalAlign, VerticalAlign, WrapStrategy, AlignTypeH, ObjectRelativeFromH, AlignTypeV, mergeWith, GlyphType as GlyphType$1, numberToListABC, PRESET_LIST_TYPE, IS_ROW_STYLE_PRECEDE_COLUMN_STYLE, searchArray, extractPureTextFromCell, CellValueType, isCellCoverable, isNullCell, composeStyles, getColorStyle, isWhiteColor, IContextService, IConfigService, BuildTextUtils, TextX, DEFAULT_EMPTY_DOCUMENT_VALUE, TextDecoration, COLORS, requestImmediateMacroTask, MOVE_BUFFER_VALUE, sortRulesByDesc, Injector, isClassDependencyItem, createIdentifier, remove, UniverInstanceType, IUniverInstanceService, Plugin, registerDependencies } from "@univerjs/core";
|
|
6
|
+
import { BehaviorSubject, Subject, startWith, distinctUntilChanged, Subscription, debounceTime, Observable, shareReplay } from "rxjs";
|
|
7
7
|
var SHAPE_TYPE = /* @__PURE__ */ ((SHAPE_TYPE2) => (SHAPE_TYPE2.RECT = "rect", SHAPE_TYPE2.CIRCLE = "circle", SHAPE_TYPE2.PATH = "path", SHAPE_TYPE2))(SHAPE_TYPE || {}), LINK_VIEW_PORT_TYPE = /* @__PURE__ */ ((LINK_VIEW_PORT_TYPE2) => (LINK_VIEW_PORT_TYPE2[LINK_VIEW_PORT_TYPE2.XY = 0] = "XY", LINK_VIEW_PORT_TYPE2[LINK_VIEW_PORT_TYPE2.X = 1] = "X", LINK_VIEW_PORT_TYPE2[LINK_VIEW_PORT_TYPE2.Y = 2] = "Y", LINK_VIEW_PORT_TYPE2))(LINK_VIEW_PORT_TYPE || {});
|
|
8
8
|
const MIDDLE_CELL_POS_MAGIC_NUMBER = 1, DEFAULT_FONTFACE_PLANE = '"Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif', DEFAULT_SKELETON_HEADER_FOOTER = {
|
|
9
9
|
lines: [],
|
|
@@ -3625,13 +3625,12 @@ __name(getOffsetRectForDom, "getOffsetRectForDom");
|
|
|
3625
3625
|
const _UniverRenderingContext2D = class _UniverRenderingContext2D {
|
|
3626
3626
|
constructor(context) {
|
|
3627
3627
|
__publicField(this, "__mode", "rendering");
|
|
3628
|
-
__publicField(this, "_system");
|
|
3629
|
-
__publicField(this, "_browser");
|
|
3630
3628
|
__publicField(this, "_transformCache");
|
|
3631
3629
|
__publicField(this, "canvas");
|
|
3632
3630
|
__publicField(this, "_context");
|
|
3633
3631
|
__publicField(this, "_systemType");
|
|
3634
3632
|
__publicField(this, "_browserType");
|
|
3633
|
+
__publicField(this, "renderConfig", {});
|
|
3635
3634
|
__publicField(this, "_id");
|
|
3636
3635
|
this.canvas = context.canvas, this._context = context;
|
|
3637
3636
|
}
|
|
@@ -4232,14 +4231,6 @@ const _UniverRenderingContext2D = class _UniverRenderingContext2D {
|
|
|
4232
4231
|
};
|
|
4233
4232
|
__name(_UniverRenderingContext2D, "UniverRenderingContext2D");
|
|
4234
4233
|
let UniverRenderingContext2D = _UniverRenderingContext2D;
|
|
4235
|
-
const _UniverRenderingContextWebGL = class _UniverRenderingContextWebGL {
|
|
4236
|
-
};
|
|
4237
|
-
__name(_UniverRenderingContextWebGL, "UniverRenderingContextWebGL");
|
|
4238
|
-
let UniverRenderingContextWebGL = _UniverRenderingContextWebGL;
|
|
4239
|
-
const _UniverRenderingContextWebGPU = class _UniverRenderingContextWebGPU {
|
|
4240
|
-
};
|
|
4241
|
-
__name(_UniverRenderingContextWebGPU, "UniverRenderingContextWebGPU");
|
|
4242
|
-
let UniverRenderingContextWebGPU = _UniverRenderingContextWebGPU;
|
|
4243
4234
|
const _UniverRenderingContext = class _UniverRenderingContext extends UniverRenderingContext2D {
|
|
4244
4235
|
};
|
|
4245
4236
|
__name(_UniverRenderingContext, "UniverRenderingContext");
|
|
@@ -24703,7 +24694,8 @@ const DEFAULT_CELL_DOCUMENT_MODEL_OPTION = {
|
|
|
24703
24694
|
}, RENDER_RAW_FORMULA_KEY = "RENDER_RAW_FORMULA";
|
|
24704
24695
|
var _a6;
|
|
24705
24696
|
let SpreadsheetSkeleton = (_a6 = class extends Skeleton {
|
|
24706
|
-
constructor(worksheet, _worksheetData, _cellData, _styles, _localeService, _contextService) {
|
|
24697
|
+
constructor(worksheet, _worksheetData, _cellData, _styles, _localeService, _contextService, _configService) {
|
|
24698
|
+
var _a10;
|
|
24707
24699
|
super(_localeService);
|
|
24708
24700
|
__publicField(this, "_rowHeightAccumulation", []);
|
|
24709
24701
|
__publicField(this, "_columnWidthAccumulation", []);
|
|
@@ -24736,8 +24728,12 @@ let SpreadsheetSkeleton = (_a6 = class extends Skeleton {
|
|
|
24736
24728
|
__publicField(this, "_showGridlines", BooleanNumber.TRUE);
|
|
24737
24729
|
__publicField(this, "_marginTop", 0);
|
|
24738
24730
|
__publicField(this, "_marginLeft", 0);
|
|
24731
|
+
/**
|
|
24732
|
+
* Whether the row style precedes the column style.
|
|
24733
|
+
*/
|
|
24734
|
+
__publicField(this, "_isRowStylePrecedeColumnStyle", !1);
|
|
24739
24735
|
__publicField(this, "_renderRawFormula", !1);
|
|
24740
|
-
this.worksheet = worksheet, this._worksheetData = _worksheetData, this._cellData = _cellData, this._styles = _styles, this._contextService = _contextService, this._updateLayout(), this._initContextListener();
|
|
24736
|
+
this.worksheet = worksheet, this._worksheetData = _worksheetData, this._cellData = _cellData, this._styles = _styles, this._contextService = _contextService, this._configService = _configService, this._updateLayout(), this._initContextListener(), this._isRowStylePrecedeColumnStyle = (_a10 = this._configService.getConfig(IS_ROW_STYLE_PRECEDE_COLUMN_STYLE)) != null ? _a10 : !1;
|
|
24741
24737
|
}
|
|
24742
24738
|
get rowHeightAccumulation() {
|
|
24743
24739
|
return this._rowHeightAccumulation;
|
|
@@ -25602,7 +25598,7 @@ let SpreadsheetSkeleton = (_a6 = class extends Skeleton {
|
|
|
25602
25598
|
if (!isMergedMainCell)
|
|
25603
25599
|
return;
|
|
25604
25600
|
}
|
|
25605
|
-
const cell = this.worksheet.getCell(row, col) || this.worksheet.getCellRaw(row, col),
|
|
25601
|
+
const cell = this.worksheet.getCell(row, col) || this.worksheet.getCellRaw(row, col), cellStyle = this._styles.getStyleByCell(cell), columnStyle = this.worksheet.getColumnStyle(col), rowStyle = this.worksheet.getRowStyle(row), defaultStyle = this.worksheet.getDefaultCellStyleInternal(), style = this._isRowStylePrecedeColumnStyle ? composeStyles(defaultStyle, columnStyle, rowStyle, cellStyle) : composeStyles(defaultStyle, rowStyle, columnStyle, cellStyle);
|
|
25606
25602
|
this._setBgStylesCache(row, col, style, options), this._setBorderStylesCache(row, col, style, options), this._setFontStylesCache(row, col, cell);
|
|
25607
25603
|
}
|
|
25608
25604
|
_updateConfigAndGetDocumentModel(documentData, horizontalAlign, paddingData, renderConfig) {
|
|
@@ -25810,7 +25806,8 @@ let SpreadsheetSkeleton = (_a6 = class extends Skeleton {
|
|
|
25810
25806
|
}, __name(_a6, "SpreadsheetSkeleton"), _a6);
|
|
25811
25807
|
SpreadsheetSkeleton = __decorateClass$3([
|
|
25812
25808
|
__decorateParam$3(4, Inject(LocaleService)),
|
|
25813
|
-
__decorateParam$3(5, IContextService)
|
|
25809
|
+
__decorateParam$3(5, IContextService),
|
|
25810
|
+
__decorateParam$3(6, IConfigService)
|
|
25814
25811
|
], SpreadsheetSkeleton);
|
|
25815
25812
|
const UNIQUE_KEY$6 = "DefaultFontExtension", _Font = class _Font extends SheetExtension {
|
|
25816
25813
|
constructor() {
|
|
@@ -28607,9 +28604,6 @@ const OBJECT_KEY = "__SHEET_EXTENSION_FONT_DOCUMENT_INSTANCE__", _Spreadsheet =
|
|
|
28607
28604
|
get forceDisableGridlines() {
|
|
28608
28605
|
return this._forceDisableGridlines;
|
|
28609
28606
|
}
|
|
28610
|
-
/**
|
|
28611
|
-
* TODO: DR-Univer, fix as unknown as
|
|
28612
|
-
*/
|
|
28613
28607
|
dispose() {
|
|
28614
28608
|
var _a10;
|
|
28615
28609
|
super.dispose(), (_a10 = this._documents) == null || _a10.dispose(), this._documents = null, this._backgroundExtension = null, this._borderExtension = null, this._fontExtension = null;
|
|
@@ -28844,6 +28838,7 @@ const OBJECT_KEY = "__SHEET_EXTENSION_FONT_DOCUMENT_INSTANCE__", _Spreadsheet =
|
|
|
28844
28838
|
*/
|
|
28845
28839
|
// eslint-disable-next-line max-lines-per-function
|
|
28846
28840
|
_drawAuxiliary(ctx) {
|
|
28841
|
+
var _a10;
|
|
28847
28842
|
const spreadsheetSkeleton = this.getSkeleton();
|
|
28848
28843
|
if (spreadsheetSkeleton == null)
|
|
28849
28844
|
return;
|
|
@@ -28853,7 +28848,7 @@ const OBJECT_KEY = "__SHEET_EXTENSION_FONT_DOCUMENT_INSTANCE__", _Spreadsheet =
|
|
|
28853
28848
|
const { rowHeightAccumulation, columnTotalWidth, columnWidthAccumulation, rowTotalHeight } = spreadsheetSkeleton;
|
|
28854
28849
|
if (!rowHeightAccumulation || !columnWidthAccumulation || columnTotalWidth === void 0 || rowTotalHeight === void 0)
|
|
28855
28850
|
return;
|
|
28856
|
-
ctx.save(), ctx.setLineWidthByPrecision(1), ctx.strokeStyle = getColor([214, 216, 219]);
|
|
28851
|
+
ctx.save(), ctx.setLineWidthByPrecision(1), ctx.strokeStyle = (_a10 = ctx.renderConfig.gridlineColor) != null ? _a10 : getColor([214, 216, 219]);
|
|
28857
28852
|
const columnWidthAccumulationLength = columnWidthAccumulation.length, rowHeightAccumulationLength = rowHeightAccumulation.length, EXTRA_BOUND = 0.4, rowCount = endRow - startRow + 1, columnCount = endColumn - startColumn + 1, extraRowCount = Math.ceil(rowCount * EXTRA_BOUND), extraColumnCount = Math.ceil(columnCount * EXTRA_BOUND), rowStart = Math.max(Math.floor(startRow - extraRowCount), 0), rowEnd = Math.min(Math.ceil(endRow + extraRowCount), rowHeightAccumulationLength - 1), columnEnd = Math.min(Math.ceil(endColumn + extraColumnCount), columnWidthAccumulationLength - 1), columnStart = Math.max(Math.floor(startColumn - extraColumnCount), 0), startX = columnWidthAccumulation[columnStart - 1] || 0, startY = rowHeightAccumulation[rowStart - 1] || 0, endX = columnWidthAccumulation[columnEnd], endY = rowHeightAccumulation[rowEnd];
|
|
28858
28853
|
ctx.translateWithPrecisionRatio(FIX_ONE_PIXEL_BLUR_OFFSET, FIX_ONE_PIXEL_BLUR_OFFSET), ctx.beginPath(), ctx.moveToByPrecision(startX, startY), ctx.lineToByPrecision(endX, startY), ctx.moveToByPrecision(startX, startY), ctx.lineToByPrecision(startX, endY), ctx.closePathByEnv(), ctx.stroke();
|
|
28859
28854
|
for (let r = rowStart; r <= rowEnd; r++) {
|
|
@@ -29151,6 +29146,27 @@ const arrowPath = "M512 1024C229.248 1024 0 794.752 0 512S229.248 0 512 0s512 22
|
|
|
29151
29146
|
};
|
|
29152
29147
|
__name(_Slide, "Slide");
|
|
29153
29148
|
let Slide = _Slide;
|
|
29149
|
+
const _UniverRenderConfigService = class _UniverRenderConfigService {
|
|
29150
|
+
constructor() {
|
|
29151
|
+
__publicField(this, "_renderConfig", {
|
|
29152
|
+
ok: "111"
|
|
29153
|
+
});
|
|
29154
|
+
__publicField(this, "_updateSignal$", new Subject());
|
|
29155
|
+
__publicField(this, "updateSignal$", this._updateSignal$.pipe(debounceTime(4)));
|
|
29156
|
+
}
|
|
29157
|
+
setRenderConfig(key, value) {
|
|
29158
|
+
if (value == null) {
|
|
29159
|
+
delete this._renderConfig[key];
|
|
29160
|
+
return;
|
|
29161
|
+
}
|
|
29162
|
+
this._renderConfig[key] = value;
|
|
29163
|
+
}
|
|
29164
|
+
getRenderConfig() {
|
|
29165
|
+
return this._renderConfig;
|
|
29166
|
+
}
|
|
29167
|
+
};
|
|
29168
|
+
__name(_UniverRenderConfigService, "UniverRenderConfigService");
|
|
29169
|
+
let UniverRenderConfigService = _UniverRenderConfigService;
|
|
29154
29170
|
const PAGE_STROKE_COLOR = "rgba(198, 198, 198, 1)", PAGE_FILL_COLOR = "rgba(255, 255, 255, 1)", MARGIN_STROKE_COLOR = "rgba(158, 158, 158, 1)", _DocBackground = class _DocBackground extends DocComponent {
|
|
29155
29171
|
constructor(oKey, documentSkeleton, config) {
|
|
29156
29172
|
super(oKey, documentSkeleton, config);
|
|
@@ -30205,7 +30221,7 @@ const _Layer = class _Layer extends Disposable {
|
|
|
30205
30221
|
};
|
|
30206
30222
|
__name(_Layer, "Layer");
|
|
30207
30223
|
let Layer = _Layer;
|
|
30208
|
-
const _InputManager = class _InputManager extends Disposable {
|
|
30224
|
+
const PLUGIN_CONFIG_KEY = "engine-render.config", defaultPluginConfig = {}, _InputManager = class _InputManager extends Disposable {
|
|
30209
30225
|
constructor(scene) {
|
|
30210
30226
|
super();
|
|
30211
30227
|
__publicField(this, "_scene");
|
|
@@ -32498,7 +32514,6 @@ function isDisposable(thing) {
|
|
|
32498
32514
|
return !!thing && typeof thing.dispose == "function";
|
|
32499
32515
|
}
|
|
32500
32516
|
__name(isDisposable, "isDisposable");
|
|
32501
|
-
const PLUGIN_CONFIG_KEY = "engine-render.config", defaultPluginConfig = {};
|
|
32502
32517
|
var __defProp2 = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __decorateClass = /* @__PURE__ */ __name((decorators, target, key, kind) => {
|
|
32503
32518
|
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
|
|
32504
32519
|
(decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
|
|
@@ -32510,11 +32525,9 @@ let UniverRenderEnginePlugin = (_a9 = class extends Plugin {
|
|
|
32510
32525
|
constructor(_config = defaultPluginConfig, _injector, _configService) {
|
|
32511
32526
|
super(), this._config = _config, this._injector = _injector, this._configService = _configService;
|
|
32512
32527
|
const { ...rest } = this._config;
|
|
32513
|
-
this._configService.setConfig(PLUGIN_CONFIG_KEY, rest), this._injector
|
|
32514
|
-
|
|
32515
|
-
{
|
|
32516
|
-
useClass: RenderManagerService
|
|
32517
|
-
}
|
|
32528
|
+
this._configService.setConfig(PLUGIN_CONFIG_KEY, rest), registerDependencies(this._injector, [
|
|
32529
|
+
[IRenderingEngine, { useFactory: /* @__PURE__ */ __name(() => new Engine(), "useFactory") }],
|
|
32530
|
+
[IRenderManagerService, { useClass: RenderManagerService }]
|
|
32518
32531
|
]);
|
|
32519
32532
|
}
|
|
32520
32533
|
}, __name(_a9, "UniverRenderEnginePlugin"), __publicField(_a9, "pluginName", PLUGIN_NAME), _a9);
|
|
@@ -32789,6 +32802,9 @@ const MOUSE_WHEEL_SPEED_SMOOTHING_FACTOR = 3, _Viewport = class _Viewport {
|
|
|
32789
32802
|
get _deltaViewportScrollY() {
|
|
32790
32803
|
return this.viewportScrollY - this._preViewportScrollY;
|
|
32791
32804
|
}
|
|
32805
|
+
get canvas() {
|
|
32806
|
+
return this._cacheCanvas;
|
|
32807
|
+
}
|
|
32792
32808
|
enable() {
|
|
32793
32809
|
this._active = !0;
|
|
32794
32810
|
}
|
|
@@ -33506,11 +33522,10 @@ export {
|
|
|
33506
33522
|
ThinScene,
|
|
33507
33523
|
Transform,
|
|
33508
33524
|
UniverPrintingContext,
|
|
33525
|
+
UniverRenderConfigService,
|
|
33509
33526
|
UniverRenderEnginePlugin,
|
|
33510
33527
|
UniverRenderingContext,
|
|
33511
33528
|
UniverRenderingContext2D,
|
|
33512
|
-
UniverRenderingContextWebGL,
|
|
33513
|
-
UniverRenderingContextWebGPU,
|
|
33514
33529
|
VERTICAL_ROTATE_ANGLE,
|
|
33515
33530
|
Vector2,
|
|
33516
33531
|
Viewport,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { IRange, Nullable } from '@univerjs/core';
|
|
2
2
|
import { IViewportInfo, Vector2 } from '../../basics/vector2';
|
|
3
3
|
import { UniverRenderingContext } from '../../context';
|
|
4
|
-
import { RenderComponent } from '../component';
|
|
5
4
|
import { SHEET_EXTENSION_TYPE } from './extensions/sheet-extension';
|
|
6
5
|
import { SpreadsheetSkeleton } from './sheet-skeleton';
|
|
6
|
+
import { RenderComponent } from '../component';
|
|
7
7
|
export declare abstract class SheetComponent extends RenderComponent<SpreadsheetSkeleton, SHEET_EXTENSION_TYPE, IRange[]> {
|
|
8
8
|
private _skeleton?;
|
|
9
9
|
constructor(oKey: string, _skeleton?: SpreadsheetSkeleton | undefined);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ICellData, IColumnRange, IPaddingData, IPosition, IRange, IRowAutoHeightInfo, IRowRange, ISelectionCellWithMergeInfo, ISize, IStyleData, ITextRotation, IWorksheetData, Nullable, Styles, Worksheet, BooleanNumber, DocumentDataModel, HorizontalAlign, IContextService, LocaleService, ObjectMatrix, VerticalAlign, WrapStrategy } from '@univerjs/core';
|
|
1
|
+
import { ICellData, IColumnRange, IPaddingData, IPosition, IRange, IRowAutoHeightInfo, IRowRange, ISelectionCellWithMergeInfo, ISize, IStyleData, ITextRotation, IWorksheetData, Nullable, Styles, Worksheet, BooleanNumber, DocumentDataModel, HorizontalAlign, IConfigService, IContextService, LocaleService, ObjectMatrix, VerticalAlign, WrapStrategy } from '@univerjs/core';
|
|
2
2
|
import { IBoundRectNoAngle, IViewportInfo } from '../../basics/vector2';
|
|
3
3
|
import { IFontCacheItem, IStylesCache } from './interfaces';
|
|
4
4
|
import { DocumentSkeleton } from '../docs/layout/doc-skeleton';
|
|
@@ -42,6 +42,7 @@ export declare class SpreadsheetSkeleton extends Skeleton {
|
|
|
42
42
|
private _cellData;
|
|
43
43
|
private _styles;
|
|
44
44
|
private readonly _contextService;
|
|
45
|
+
private readonly _configService;
|
|
45
46
|
private _rowHeightAccumulation;
|
|
46
47
|
private _columnWidthAccumulation;
|
|
47
48
|
private _rowTotalHeight;
|
|
@@ -61,13 +62,17 @@ export declare class SpreadsheetSkeleton extends Skeleton {
|
|
|
61
62
|
private _showGridlines;
|
|
62
63
|
private _marginTop;
|
|
63
64
|
private _marginLeft;
|
|
65
|
+
/**
|
|
66
|
+
* Whether the row style precedes the column style.
|
|
67
|
+
*/
|
|
68
|
+
private _isRowStylePrecedeColumnStyle;
|
|
64
69
|
private _renderRawFormula;
|
|
65
70
|
constructor(worksheet: Worksheet,
|
|
66
71
|
/**
|
|
67
72
|
* @deprecated avoid use `IWorksheetData` directly, use API provided by `Worksheet`, otherwise
|
|
68
73
|
* `ViewModel` will be not working.
|
|
69
74
|
*/
|
|
70
|
-
_worksheetData: IWorksheetData, _cellData: ObjectMatrix<Nullable<ICellData>>, _styles: Styles, _localeService: LocaleService, _contextService: IContextService);
|
|
75
|
+
_worksheetData: IWorksheetData, _cellData: ObjectMatrix<Nullable<ICellData>>, _styles: Styles, _localeService: LocaleService, _contextService: IContextService, _configService: IConfigService);
|
|
71
76
|
get rowHeightAccumulation(): number[];
|
|
72
77
|
get rowTotalHeight(): number;
|
|
73
78
|
get columnWidthAccumulation(): number[];
|
|
@@ -27,9 +27,6 @@ export declare class Spreadsheet extends SheetComponent {
|
|
|
27
27
|
getDocuments(): Documents;
|
|
28
28
|
get allowCache(): boolean;
|
|
29
29
|
get forceDisableGridlines(): boolean;
|
|
30
|
-
/**
|
|
31
|
-
* TODO: DR-Univer, fix as unknown as
|
|
32
|
-
*/
|
|
33
30
|
dispose(): void;
|
|
34
31
|
/**
|
|
35
32
|
* draw by viewport
|
package/lib/types/context.d.ts
CHANGED
|
@@ -1,27 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
* Copyright 2023-present DreamNum Inc.
|
|
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
|
-
*/
|
|
1
|
+
import { IRenderConfig } from './services/render-config';
|
|
16
2
|
export declare class UniverRenderingContext2D implements CanvasRenderingContext2D {
|
|
17
3
|
__mode: string;
|
|
18
|
-
private _system;
|
|
19
|
-
private _browser;
|
|
20
4
|
private _transformCache;
|
|
21
5
|
readonly canvas: HTMLCanvasElement;
|
|
22
6
|
_context: CanvasRenderingContext2D;
|
|
23
7
|
private _systemType;
|
|
24
8
|
private _browserType;
|
|
9
|
+
renderConfig: Readonly<IRenderConfig>;
|
|
25
10
|
constructor(context: CanvasRenderingContext2D);
|
|
26
11
|
private _id;
|
|
27
12
|
getId(): string;
|
|
@@ -363,16 +348,6 @@ export declare class UniverRenderingContext2D implements CanvasRenderingContext2
|
|
|
363
348
|
clearRectForTexture(x: number, y: number, width: number, height: number): void;
|
|
364
349
|
setGlobalCompositeOperation(val: GlobalCompositeOperation): void;
|
|
365
350
|
}
|
|
366
|
-
/**
|
|
367
|
-
* TODO
|
|
368
|
-
*/
|
|
369
|
-
export declare class UniverRenderingContextWebGL {
|
|
370
|
-
}
|
|
371
|
-
/**
|
|
372
|
-
* TODO
|
|
373
|
-
*/
|
|
374
|
-
export declare class UniverRenderingContextWebGPU {
|
|
375
|
-
}
|
|
376
351
|
export declare class UniverRenderingContext extends UniverRenderingContext2D {
|
|
377
352
|
}
|
|
378
353
|
export declare class UniverPrintingContext extends UniverRenderingContext2D {
|
package/lib/types/index.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export * from './basics';
|
|
|
18
18
|
export { getOffsetRectForDom } from './basics/position';
|
|
19
19
|
export * from './canvas';
|
|
20
20
|
export * from './components';
|
|
21
|
+
export { UniverRenderConfigService } from './services/render-config.service';
|
|
21
22
|
export { DocBackground } from './components/docs/doc-background';
|
|
22
23
|
export { Documents } from './components/docs/document';
|
|
23
24
|
export type { IPageRenderConfig } from './components/docs/document';
|
|
@@ -37,7 +38,7 @@ export * from './custom';
|
|
|
37
38
|
export * from './engine';
|
|
38
39
|
export * from './group';
|
|
39
40
|
export * from './layer';
|
|
40
|
-
export { IRenderingEngine, UniverRenderEnginePlugin } from './
|
|
41
|
+
export { IRenderingEngine, UniverRenderEnginePlugin } from './plugin';
|
|
41
42
|
export { IRenderManagerService, type RenderComponentType, RenderManagerService } from './render-manager/render-manager.service';
|
|
42
43
|
export { type IRender, type IRenderContext, type IRenderModule, RenderUnit } from './render-manager/render-unit';
|
|
43
44
|
export * from './scene';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
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 interface IRenderConfig {
|
|
17
|
+
[key: string]: any;
|
|
18
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
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
|
+
/**
|
|
17
|
+
* This service carries managers render config that would be passed
|
|
18
|
+
* to every widget, so some rendering could be optimized.
|
|
19
|
+
*/
|
|
20
|
+
export declare class UniverRenderConfigService {
|
|
21
|
+
private readonly _renderConfig;
|
|
22
|
+
private readonly _updateSignal$;
|
|
23
|
+
readonly updateSignal$: import('rxjs').Observable<void>;
|
|
24
|
+
setRenderConfig(key: string, value: any): void;
|
|
25
|
+
getRenderConfig(): Readonly<Record<string, any>>;
|
|
26
|
+
}
|
package/lib/types/viewport.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { UniverRenderingContext } from './context';
|
|
|
6
6
|
import { BaseScrollBar } from './shape/base-scroll-bar';
|
|
7
7
|
import { ThinScene } from './thin-scene';
|
|
8
8
|
import { Transform } from './basics/transform';
|
|
9
|
+
import { Canvas as UniverCanvas } from './canvas';
|
|
9
10
|
interface IViewPosition {
|
|
10
11
|
top?: number;
|
|
11
12
|
left?: number;
|
|
@@ -204,6 +205,7 @@ export declare class Viewport {
|
|
|
204
205
|
get _deltaScrollY(): number;
|
|
205
206
|
get _deltaViewportScrollX(): number;
|
|
206
207
|
get _deltaViewportScrollY(): number;
|
|
208
|
+
get canvas(): UniverCanvas | null;
|
|
207
209
|
enable(): void;
|
|
208
210
|
disable(): void;
|
|
209
211
|
resetCanvasSizeAndUpdateScroll(): void;
|