@univerjs/core 0.23.0 → 0.24.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/lib/cjs/index.js +26 -15
- package/lib/es/index.js +29 -13
- package/lib/index.js +29 -13
- package/lib/types/common/function.d.ts +5 -0
- package/lib/types/index.d.ts +6 -7
- package/lib/types/services/instance/instance.service.d.ts +0 -3
- package/lib/types/shared/timer.d.ts +14 -0
- package/lib/umd/index.js +9 -9
- package/package.json +4 -4
- package/lib/types/shared/text-diff.d.ts +0 -16
package/lib/cjs/index.js
CHANGED
|
@@ -405,6 +405,11 @@ var CanceledError = class extends CustomCommandExecutionError {
|
|
|
405
405
|
* See the License for the specific language governing permissions and
|
|
406
406
|
* limitations under the License.
|
|
407
407
|
*/
|
|
408
|
+
/**
|
|
409
|
+
* A no-op (no operation) function that does nothing.
|
|
410
|
+
* Use this as a default placeholder for callbacks or optional handlers.
|
|
411
|
+
*/
|
|
412
|
+
function noop() {}
|
|
408
413
|
function throttle(fn, wait = 16) {
|
|
409
414
|
let lastTime = 0;
|
|
410
415
|
let timer = null;
|
|
@@ -14785,7 +14790,7 @@ const IURLImageService = (0, _wendellhu_redi.createIdentifier)("core.url-image.s
|
|
|
14785
14790
|
//#endregion
|
|
14786
14791
|
//#region package.json
|
|
14787
14792
|
var name = "@univerjs/core";
|
|
14788
|
-
var version = "0.
|
|
14793
|
+
var version = "0.24.0";
|
|
14789
14794
|
|
|
14790
14795
|
//#endregion
|
|
14791
14796
|
//#region src/sheets/empty-snapshot.ts
|
|
@@ -17364,11 +17369,8 @@ let UniverInstanceService = class UniverInstanceService extends Disposable {
|
|
|
17364
17369
|
return (_units$get = units.get(type)) !== null && _units$get !== void 0 ? _units$get : null;
|
|
17365
17370
|
}), (0, rxjs.distinctUntilChanged)());
|
|
17366
17371
|
}
|
|
17367
|
-
getCurrentUnitForType(type) {
|
|
17368
|
-
return this._currentUnits.get(type);
|
|
17369
|
-
}
|
|
17370
17372
|
getCurrentUnitOfType(type) {
|
|
17371
|
-
return this.
|
|
17373
|
+
return this._currentUnits.get(type);
|
|
17372
17374
|
}
|
|
17373
17375
|
setCurrentUnitForType(unitId) {
|
|
17374
17376
|
const result = this._getUnitById(unitId);
|
|
@@ -17411,7 +17413,7 @@ let UniverInstanceService = class UniverInstanceService extends Disposable {
|
|
|
17411
17413
|
return unit;
|
|
17412
17414
|
}
|
|
17413
17415
|
getCurrentUniverDocInstance() {
|
|
17414
|
-
return this.
|
|
17416
|
+
return this.getCurrentUnitOfType(_univerjs_protocol.UniverType.UNIVER_DOC);
|
|
17415
17417
|
}
|
|
17416
17418
|
getUniverDocInstance(unitId) {
|
|
17417
17419
|
return this.getUnit(unitId, _univerjs_protocol.UniverType.UNIVER_DOC);
|
|
@@ -17492,7 +17494,7 @@ let UniverInstanceService = class UniverInstanceService extends Disposable {
|
|
|
17492
17494
|
return true;
|
|
17493
17495
|
}
|
|
17494
17496
|
_tryResetCurrentOnRemoval(unitId, type) {
|
|
17495
|
-
const current = this.
|
|
17497
|
+
const current = this.getCurrentUnitOfType(type);
|
|
17496
17498
|
if ((current === null || current === void 0 ? void 0 : current.getUnitId()) === unitId) {
|
|
17497
17499
|
this._currentUnits.set(type, null);
|
|
17498
17500
|
this._currentUnits$.next(this._currentUnits);
|
|
@@ -18773,9 +18775,23 @@ var RTree = class {
|
|
|
18773
18775
|
* See the License for the specific language governing permissions and
|
|
18774
18776
|
* limitations under the License.
|
|
18775
18777
|
*/
|
|
18778
|
+
/**
|
|
18779
|
+
* Returns a Promise that resolves after the specified number of milliseconds.
|
|
18780
|
+
* Use this to pause execution for a given duration.
|
|
18781
|
+
*
|
|
18782
|
+
* @param ms The number of milliseconds to wait before resolving.
|
|
18783
|
+
* @returns A Promise that resolves after `ms` milliseconds.
|
|
18784
|
+
*/
|
|
18776
18785
|
function awaitTime(ms) {
|
|
18777
18786
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
18778
18787
|
}
|
|
18788
|
+
/**
|
|
18789
|
+
* Returns a Promise that resolves after the specified number of animation frames.
|
|
18790
|
+
* Use this to wait for the browser to complete one or more rendering cycles.
|
|
18791
|
+
*
|
|
18792
|
+
* @param frames The number of animation frames to wait before resolving. Defaults to `1`.
|
|
18793
|
+
* @returns A Promise that resolves after `frames` animation frames.
|
|
18794
|
+
*/
|
|
18779
18795
|
function delayAnimationFrame(frames = 1) {
|
|
18780
18796
|
return new Promise((resolve) => {
|
|
18781
18797
|
let count = 0;
|
|
@@ -18993,8 +19009,8 @@ let SheetSkeleton = class SheetSkeleton extends Skeleton {
|
|
|
18993
19009
|
const { r, g, b } = new ColorKit(this._injector.get(ThemeService).getColorFromTheme("primary.500")).toRgb();
|
|
18994
19010
|
return {
|
|
18995
19011
|
...config,
|
|
18996
|
-
defaultBackgroundColor: (_config$defaultBackgr = config.defaultBackgroundColor) !== null && _config$defaultBackgr !== void 0 ? _config$defaultBackgr : `rgba(${r}, ${g}, ${b}, 0.
|
|
18997
|
-
defaultStripeColor: (_config$defaultStripe = config.defaultStripeColor) !== null && _config$defaultStripe !== void 0 ? _config$defaultStripe : `rgba(${r}, ${g}, ${b}, 0.
|
|
19012
|
+
defaultBackgroundColor: (_config$defaultBackgr = config.defaultBackgroundColor) !== null && _config$defaultBackgr !== void 0 ? _config$defaultBackgr : `rgba(${r}, ${g}, ${b}, 0.025)`,
|
|
19013
|
+
defaultStripeColor: (_config$defaultStripe = config.defaultStripeColor) !== null && _config$defaultStripe !== void 0 ? _config$defaultStripe : `rgba(${r}, ${g}, ${b}, 0.08)`
|
|
18998
19014
|
};
|
|
18999
19015
|
}
|
|
19000
19016
|
/**
|
|
@@ -20635,6 +20651,7 @@ exports.mixinClass = mixinClass;
|
|
|
20635
20651
|
exports.moveMatrixArray = moveMatrixArray;
|
|
20636
20652
|
exports.moveRangeByOffset = moveRangeByOffset;
|
|
20637
20653
|
exports.nameCharacterCheck = nameCharacterCheck;
|
|
20654
|
+
exports.noop = noop;
|
|
20638
20655
|
exports.normalizeBody = normalizeBody;
|
|
20639
20656
|
exports.normalizeTextRuns = normalizeTextRuns;
|
|
20640
20657
|
exports.numberToABC = numberToABC;
|
|
@@ -20681,12 +20698,6 @@ exports.sortRulesFactory = sortRulesFactory;
|
|
|
20681
20698
|
exports.spliceArray = spliceArray;
|
|
20682
20699
|
exports.splitIntoGrid = splitIntoGrid;
|
|
20683
20700
|
exports.takeAfter = takeAfter;
|
|
20684
|
-
Object.defineProperty(exports, 'textDiff', {
|
|
20685
|
-
enumerable: true,
|
|
20686
|
-
get: function () {
|
|
20687
|
-
return fast_diff.default;
|
|
20688
|
-
}
|
|
20689
|
-
});
|
|
20690
20701
|
exports.throttle = throttle;
|
|
20691
20702
|
exports.toDisposable = toDisposable;
|
|
20692
20703
|
exports.touchDependencies = touchDependencies;
|
package/lib/es/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import * as json1 from "ot-json1";
|
|
|
8
8
|
import { debounceTime as debounceTime$1, filter as filter$1, first, map as map$1 } from "rxjs/operators";
|
|
9
9
|
import * as numfmt from "numfmt";
|
|
10
10
|
import RBush, { default as RBush$1 } from "rbush";
|
|
11
|
-
import
|
|
11
|
+
import fastDiff from "fast-diff";
|
|
12
12
|
import { defaultTheme } from "@univerjs/themes";
|
|
13
13
|
import KDBush from "kdbush";
|
|
14
14
|
|
|
@@ -371,6 +371,11 @@ var CanceledError = class extends CustomCommandExecutionError {
|
|
|
371
371
|
* See the License for the specific language governing permissions and
|
|
372
372
|
* limitations under the License.
|
|
373
373
|
*/
|
|
374
|
+
/**
|
|
375
|
+
* A no-op (no operation) function that does nothing.
|
|
376
|
+
* Use this as a default placeholder for callbacks or optional handlers.
|
|
377
|
+
*/
|
|
378
|
+
function noop() {}
|
|
374
379
|
function throttle(fn, wait = 16) {
|
|
375
380
|
let lastTime = 0;
|
|
376
381
|
let timer = null;
|
|
@@ -11717,7 +11722,7 @@ const replaceSelectionTextX = (params) => {
|
|
|
11717
11722
|
const body = (_doc$getSelfOrHeaderF = doc.getSelfOrHeaderFooterModel(segmentId)) === null || _doc$getSelfOrHeaderF === void 0 ? void 0 : _doc$getSelfOrHeaderF.getBody();
|
|
11718
11723
|
if (!body) return false;
|
|
11719
11724
|
const oldBody = selection.collapsed ? null : getBodySlice(body, selection.startOffset, selection.endOffset);
|
|
11720
|
-
const diffs =
|
|
11725
|
+
const diffs = fastDiff(oldBody ? oldBody.dataStream : "", insertBody.dataStream);
|
|
11721
11726
|
let cursor = 0;
|
|
11722
11727
|
const actions = diffs.map(([type, text]) => {
|
|
11723
11728
|
switch (type) {
|
|
@@ -11767,7 +11772,7 @@ const replaceSelectionTextRuns = (params) => {
|
|
|
11767
11772
|
const body = (_doc$getSelfOrHeaderF2 = doc.getSelfOrHeaderFooterModel(segmentId)) === null || _doc$getSelfOrHeaderF2 === void 0 ? void 0 : _doc$getSelfOrHeaderF2.getBody();
|
|
11768
11773
|
if (!body) return false;
|
|
11769
11774
|
const oldBody = selection.collapsed ? null : getBodySlice(body, selection.startOffset, selection.endOffset);
|
|
11770
|
-
const diffs =
|
|
11775
|
+
const diffs = fastDiff(oldBody ? oldBody.dataStream : "", insertBody.dataStream);
|
|
11771
11776
|
let cursor = 0;
|
|
11772
11777
|
const actions = diffs.map(([type, text]) => {
|
|
11773
11778
|
switch (type) {
|
|
@@ -14751,7 +14756,7 @@ const IURLImageService = createIdentifier("core.url-image.service");
|
|
|
14751
14756
|
//#endregion
|
|
14752
14757
|
//#region package.json
|
|
14753
14758
|
var name = "@univerjs/core";
|
|
14754
|
-
var version = "0.
|
|
14759
|
+
var version = "0.24.0";
|
|
14755
14760
|
|
|
14756
14761
|
//#endregion
|
|
14757
14762
|
//#region src/sheets/empty-snapshot.ts
|
|
@@ -17330,11 +17335,8 @@ let UniverInstanceService = class UniverInstanceService extends Disposable {
|
|
|
17330
17335
|
return (_units$get = units.get(type)) !== null && _units$get !== void 0 ? _units$get : null;
|
|
17331
17336
|
}), distinctUntilChanged());
|
|
17332
17337
|
}
|
|
17333
|
-
getCurrentUnitForType(type) {
|
|
17334
|
-
return this._currentUnits.get(type);
|
|
17335
|
-
}
|
|
17336
17338
|
getCurrentUnitOfType(type) {
|
|
17337
|
-
return this.
|
|
17339
|
+
return this._currentUnits.get(type);
|
|
17338
17340
|
}
|
|
17339
17341
|
setCurrentUnitForType(unitId) {
|
|
17340
17342
|
const result = this._getUnitById(unitId);
|
|
@@ -17377,7 +17379,7 @@ let UniverInstanceService = class UniverInstanceService extends Disposable {
|
|
|
17377
17379
|
return unit;
|
|
17378
17380
|
}
|
|
17379
17381
|
getCurrentUniverDocInstance() {
|
|
17380
|
-
return this.
|
|
17382
|
+
return this.getCurrentUnitOfType(UniverInstanceType.UNIVER_DOC);
|
|
17381
17383
|
}
|
|
17382
17384
|
getUniverDocInstance(unitId) {
|
|
17383
17385
|
return this.getUnit(unitId, UniverInstanceType.UNIVER_DOC);
|
|
@@ -17458,7 +17460,7 @@ let UniverInstanceService = class UniverInstanceService extends Disposable {
|
|
|
17458
17460
|
return true;
|
|
17459
17461
|
}
|
|
17460
17462
|
_tryResetCurrentOnRemoval(unitId, type) {
|
|
17461
|
-
const current = this.
|
|
17463
|
+
const current = this.getCurrentUnitOfType(type);
|
|
17462
17464
|
if ((current === null || current === void 0 ? void 0 : current.getUnitId()) === unitId) {
|
|
17463
17465
|
this._currentUnits.set(type, null);
|
|
17464
17466
|
this._currentUnits$.next(this._currentUnits);
|
|
@@ -18739,9 +18741,23 @@ var RTree = class {
|
|
|
18739
18741
|
* See the License for the specific language governing permissions and
|
|
18740
18742
|
* limitations under the License.
|
|
18741
18743
|
*/
|
|
18744
|
+
/**
|
|
18745
|
+
* Returns a Promise that resolves after the specified number of milliseconds.
|
|
18746
|
+
* Use this to pause execution for a given duration.
|
|
18747
|
+
*
|
|
18748
|
+
* @param ms The number of milliseconds to wait before resolving.
|
|
18749
|
+
* @returns A Promise that resolves after `ms` milliseconds.
|
|
18750
|
+
*/
|
|
18742
18751
|
function awaitTime(ms) {
|
|
18743
18752
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
18744
18753
|
}
|
|
18754
|
+
/**
|
|
18755
|
+
* Returns a Promise that resolves after the specified number of animation frames.
|
|
18756
|
+
* Use this to wait for the browser to complete one or more rendering cycles.
|
|
18757
|
+
*
|
|
18758
|
+
* @param frames The number of animation frames to wait before resolving. Defaults to `1`.
|
|
18759
|
+
* @returns A Promise that resolves after `frames` animation frames.
|
|
18760
|
+
*/
|
|
18745
18761
|
function delayAnimationFrame(frames = 1) {
|
|
18746
18762
|
return new Promise((resolve) => {
|
|
18747
18763
|
let count = 0;
|
|
@@ -18959,8 +18975,8 @@ let SheetSkeleton = class SheetSkeleton extends Skeleton {
|
|
|
18959
18975
|
const { r, g, b } = new ColorKit(this._injector.get(ThemeService).getColorFromTheme("primary.500")).toRgb();
|
|
18960
18976
|
return {
|
|
18961
18977
|
...config,
|
|
18962
|
-
defaultBackgroundColor: (_config$defaultBackgr = config.defaultBackgroundColor) !== null && _config$defaultBackgr !== void 0 ? _config$defaultBackgr : `rgba(${r}, ${g}, ${b}, 0.
|
|
18963
|
-
defaultStripeColor: (_config$defaultStripe = config.defaultStripeColor) !== null && _config$defaultStripe !== void 0 ? _config$defaultStripe : `rgba(${r}, ${g}, ${b}, 0.
|
|
18978
|
+
defaultBackgroundColor: (_config$defaultBackgr = config.defaultBackgroundColor) !== null && _config$defaultBackgr !== void 0 ? _config$defaultBackgr : `rgba(${r}, ${g}, ${b}, 0.025)`,
|
|
18979
|
+
defaultStripeColor: (_config$defaultStripe = config.defaultStripeColor) !== null && _config$defaultStripe !== void 0 ? _config$defaultStripe : `rgba(${r}, ${g}, ${b}, 0.08)`
|
|
18964
18980
|
};
|
|
18965
18981
|
}
|
|
18966
18982
|
/**
|
|
@@ -20029,4 +20045,4 @@ function createUniverInjector(parentInjector, override) {
|
|
|
20029
20045
|
installShims();
|
|
20030
20046
|
|
|
20031
20047
|
//#endregion
|
|
20032
|
-
export { ABCToNumber, AUTO_HEIGHT_FOR_MERGED_CELLS, AbsoluteRefType, ActionIterator, AlignTypeH, AlignTypeV, ArrangeTypeEnum, AsyncInterceptorManager, AsyncLock, AuthzIoLocalService, AutoFillSeries, BORDER_KEYS, BORDER_STYLE_KEYS, BaselineOffset, BlockType, BooleanNumber, BorderStyleTypes, BorderType, BuildTextUtils, BulletAlignment, COLORS, COLOR_STYLE_KEYS, COMMAND_LOG_EXECUTION_CONFIG_KEY, CanceledError, CellModeEnum, CellValueType, ColorKit, ColorType, ColumnSeparatorType, CommandService, CommandType, CommonHideTypes, ConfigService, ContextService, CopyPasteType, CustomCommandExecutionError, CustomDecorationType, CustomRangeType, DEFAULT_CELL, DEFAULT_DOC, DEFAULT_DOCUMENT_SUB_COMPONENT_ID, DEFAULT_EMPTY_DOCUMENT_VALUE, DEFAULT_NUMBER_FORMAT, DEFAULT_RANGE, DEFAULT_RANGE_ARRAY, DEFAULT_SELECTION, DEFAULT_STYLES, DEFAULT_TEXT_FORMAT, DEFAULT_TEXT_FORMAT_EXCEL, DEFAULT_WORKSHEET_COLUMN_COUNT, DEFAULT_WORKSHEET_COLUMN_COUNT_KEY, DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT, DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT_KEY, DEFAULT_WORKSHEET_COLUMN_WIDTH, DEFAULT_WORKSHEET_COLUMN_WIDTH_KEY, DEFAULT_WORKSHEET_ROW_COUNT, DEFAULT_WORKSHEET_ROW_COUNT_KEY, DEFAULT_WORKSHEET_ROW_HEIGHT, DEFAULT_WORKSHEET_ROW_HEIGHT_KEY, DEFAULT_WORKSHEET_ROW_TITLE_WIDTH, DEFAULT_WORKSHEET_ROW_TITLE_WIDTH_KEY, DOCS_COMMENT_EDITOR_UNIT_ID_KEY, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY, DOCS_NORMAL_EDITOR_UNIT_ID_KEY, DOCS_ZEN_EDITOR_UNIT_ID_KEY, DOC_DRAWING_PRINTING_COMPONENT_KEY, DOC_RANGE_TYPE, DashStyleType, DataStreamTreeNodeType, DataStreamTreeTokenType, DataValidationErrorStyle, DataValidationImeMode, DataValidationOperator, DataValidationRenderMode, DataValidationStatus, DataValidationType, DeleteDirection, DependentOn, DesktopLogService, DeveloperMetadataVisibility, Dimension, Direction, Disposable, DisposableCollection, DocStyleType, DocumentDataModel, DocumentFlavor, DrawingTypeEnum, EDITOR_ACTIVATED, EXTENSION_NAMES, ErrorService, EventState, EventSubject, FOCUSING_COMMENT_EDITOR, FOCUSING_COMMON_DRAWINGS, FOCUSING_DOC, FOCUSING_EDITOR_BUT_HIDDEN, FOCUSING_EDITOR_INPUT_FORMULA, FOCUSING_EDITOR_STANDALONE, FOCUSING_FX_BAR_EDITOR, FOCUSING_PANEL_EDITOR, FOCUSING_SHAPE_TEXT_EDITOR, FOCUSING_SHEET, FOCUSING_SLIDE, FOCUSING_UNIT, FOCUSING_UNIVER_EDITOR, FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE, FORMULA_EDITOR_ACTIVATED, FollowNumberWithType, FontItalic, FontStyleType, FontWeight, GridType, HorizontalAlign, IAuthzIoService, ICommandService, IConfigService, IConfirmService, IContextService, IImageIoService, ILocalStorageService, ILogService, IMentionIOService, IPermissionService, IResourceLoaderService, IResourceManagerService, IS_ROW_STYLE_PRECEDE_COLUMN_STYLE, IURLImageService, IUndoRedoService, IUniverInstanceService, ImageCacheMap, ImageSourceType, ImageUploadStatusType, Inject, InjectSelf, Injector, InterceptorEffectEnum, InterceptorManager, InterpolationPointType, json1 as JSON1, JSONX, LRUHelper, LRUMap, LifecycleService, LifecycleStages, LifecycleUnreachableError, ListGlyphType, LocalUndoRedoService, LocaleService, LocaleType, LogLevel, LookUp, MAX_COLUMN_COUNT, MAX_ROW_COUNT, MOVE_BUFFER_VALUE, Many, MemoryCursor, MentionIOLocalService, MentionType, NAMED_STYLE_MAP, NAMED_STYLE_SPACE_MAP, NamedStyleType, NilCommand, NumberUnitType, ObjectMatrix, ObjectRelativeFromH, ObjectRelativeFromV, Optional, PADDING_KEYS, PAGE_SIZE, PAPER_TYPES, PRESET_LIST_TYPE, PRINT_CHART_COMPONENT_KEY, PageOrientType, PaperType, ParagraphElementType, ParagraphStyleBuilder, ParagraphStyleValue, PermissionService, PermissionStatus, Plugin, PluginService, PositionedObjectLayoutType, PresetListType, ProtectionType, Quantity, QuickListType, QuickListTypeMap, RANGE_DIRECTION, RANGE_TYPE, RBush, RCDisposable, RGBA_PAREN, RGB_PAREN, ROTATE_BUFFER_VALUE, RTree, Range, Rectangle, RediError, RedoCommand, RedoCommandId, RefAlias, Registry, RegistryAsMap, RelativeDate, ResourceManagerService, RichTextBuilder, RichTextValue, RxDisposable, SHEET_EDITOR_UNITS, STYLE_KEYS, SectionType, Self, SheetSkeleton, SheetTypes, SheetViewModel, Skeleton, SkipSelf, SliceBodyType, SpacingRule, Styles, TEXT_DECORATION_KEYS, TEXT_ROTATION_KEYS, THEME_COLORS, TabStopAlignment, TableAlignmentType, TableLayoutType, TableRowHeightRule, TableSizeType, TableTextWrapType, TestConfirmService, TextDecoration, TextDecorationBuilder, TextDirection, TextDirectionType, TextStyleBuilder, TextStyleValue, TextX, TextXActionType, ThemeColorType, ThemeColors, ThemeService, Tools, UndoCommand, UndoCommandId, UnitModel, Univer, UniverInstanceService, UniverInstanceType, UpdateDocsAttributeType, UserManagerService, VerticalAlign, VerticalAlignmentType, WithNew, Workbook, Worksheet, WrapStrategy, WrapTextType, addLinkToDocumentModel, afterInitApply, afterTime, awaitTime, binSearchFirstGreaterThanTarget, binarySearchArray, bufferDebounceTime, cellToRange, characterSpacingControlType, checkForSubstrings, checkIfMove, checkParagraphHasBullet, checkParagraphHasIndent, checkParagraphHasIndentByStyle, cloneCellData, cloneCellDataMatrix, cloneCellDataWithSpanAndDisplay, cloneValue, cloneWorksheetData, codeToBlob, columnLabelToNumber, composeBody, composeInterceptors, composeStyles, concatMatrixArray, convertCellToRange, convertObservableToBehaviorSubject, covertCellValue, covertCellValues, createAsyncInterceptorKey, createDefaultUser, createDocumentModelWithStyle, createIdentifier, createInterceptorKey, createInternalEditorID, createREGEXFromWildChar, createRowColIter, createSheetGapTestConfig, customNameCharacterCheck, dateKit, debounce, dedupe, dedupeBy, deepCompare, delayAnimationFrame, deleteContent, extractPureTextFromCell, forwardRef, fromCallback, fromEventSubject, generateIntervalsByPoints, generateRandomId, get, getArrayLength, getBodySlice, getBorderStyleType, getCellCoordByIndexSimple, getCellInfoInMergeData, getCellValueType, getCellWithCoordByIndexCore, getColorStyle, getCustomBlockSlice, getCustomDecorationSlice, getCustomRangeSlice, getDisplayValueFromCell, getDocsUpdateBody, getEmptyCell, getIntersectRange, getNumfmtParseValueFilter, getOriginCellValue, getParagraphsSlice, getPlainText, getReverseDirection, getSectionBreakSlice, getTableSlice, getTextRunSlice, getTransformOffsetX, getTransformOffsetY, getWorksheetUID, groupBy, handleStyleToString, hashAlgorithm, horizontalLineSegmentsSubtraction, insertMatrixArray, insertTextToContent, invertColorByHSL, invertColorByMatrix, isAsyncDependencyItem, isAsyncHook, isBlackColor, isBooleanString, isCellCoverable, isCellV, isClassDependencyItem, isCommentEditorID, isCtor, isDefaultFormat, isDisposable, isEmptyCell, isFactoryDependencyItem, isFormulaId, isFormulaString, isICellData, isInternalEditorID, isNodeEnv, isNotNullOrUndefined, isNullCell, isNumeric, isPatternEqualWithoutDecimal, isRangesEqual, isRealNum, isSafeNumeric, isSameStyleTextRun, isTextFormat, isUnitRangesEqual, isValidRange, isValueDependencyItem, isWhiteColor, makeArray, makeCellRangeToRangeData, makeCellToSelection, makeCustomRangeStream, mapObjectMatrix, merge, mergeIntervals, mergeLocales, mergeOverrideWithDependencies, mergeSets, mergeWith, mergeWorksheetSnapshotWithDefault, mixinClass, moveMatrixArray, moveRangeByOffset, nameCharacterCheck, normalizeBody, normalizeTextRuns, numberToABC, numberToListABC, numfmt, queryObjectMatrix, registerDependencies, remove, repeatStringNumTimes, replaceInDocumentBody, requestImmediateMacroTask, resolveWithBasePath, rotate, searchArray, searchInOrderedArray, selectionToArray, sequence, sequenceAsync, sequenceExecute, sequenceExecuteAsync, set, setDependencies, shallowEqual, skipParseTagNames, sliceMatrixArray, sortRules, sortRulesByDesc, sortRulesFactory, spliceArray, splitIntoGrid, takeAfter,
|
|
20048
|
+
export { ABCToNumber, AUTO_HEIGHT_FOR_MERGED_CELLS, AbsoluteRefType, ActionIterator, AlignTypeH, AlignTypeV, ArrangeTypeEnum, AsyncInterceptorManager, AsyncLock, AuthzIoLocalService, AutoFillSeries, BORDER_KEYS, BORDER_STYLE_KEYS, BaselineOffset, BlockType, BooleanNumber, BorderStyleTypes, BorderType, BuildTextUtils, BulletAlignment, COLORS, COLOR_STYLE_KEYS, COMMAND_LOG_EXECUTION_CONFIG_KEY, CanceledError, CellModeEnum, CellValueType, ColorKit, ColorType, ColumnSeparatorType, CommandService, CommandType, CommonHideTypes, ConfigService, ContextService, CopyPasteType, CustomCommandExecutionError, CustomDecorationType, CustomRangeType, DEFAULT_CELL, DEFAULT_DOC, DEFAULT_DOCUMENT_SUB_COMPONENT_ID, DEFAULT_EMPTY_DOCUMENT_VALUE, DEFAULT_NUMBER_FORMAT, DEFAULT_RANGE, DEFAULT_RANGE_ARRAY, DEFAULT_SELECTION, DEFAULT_STYLES, DEFAULT_TEXT_FORMAT, DEFAULT_TEXT_FORMAT_EXCEL, DEFAULT_WORKSHEET_COLUMN_COUNT, DEFAULT_WORKSHEET_COLUMN_COUNT_KEY, DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT, DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT_KEY, DEFAULT_WORKSHEET_COLUMN_WIDTH, DEFAULT_WORKSHEET_COLUMN_WIDTH_KEY, DEFAULT_WORKSHEET_ROW_COUNT, DEFAULT_WORKSHEET_ROW_COUNT_KEY, DEFAULT_WORKSHEET_ROW_HEIGHT, DEFAULT_WORKSHEET_ROW_HEIGHT_KEY, DEFAULT_WORKSHEET_ROW_TITLE_WIDTH, DEFAULT_WORKSHEET_ROW_TITLE_WIDTH_KEY, DOCS_COMMENT_EDITOR_UNIT_ID_KEY, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY, DOCS_NORMAL_EDITOR_UNIT_ID_KEY, DOCS_ZEN_EDITOR_UNIT_ID_KEY, DOC_DRAWING_PRINTING_COMPONENT_KEY, DOC_RANGE_TYPE, DashStyleType, DataStreamTreeNodeType, DataStreamTreeTokenType, DataValidationErrorStyle, DataValidationImeMode, DataValidationOperator, DataValidationRenderMode, DataValidationStatus, DataValidationType, DeleteDirection, DependentOn, DesktopLogService, DeveloperMetadataVisibility, Dimension, Direction, Disposable, DisposableCollection, DocStyleType, DocumentDataModel, DocumentFlavor, DrawingTypeEnum, EDITOR_ACTIVATED, EXTENSION_NAMES, ErrorService, EventState, EventSubject, FOCUSING_COMMENT_EDITOR, FOCUSING_COMMON_DRAWINGS, FOCUSING_DOC, FOCUSING_EDITOR_BUT_HIDDEN, FOCUSING_EDITOR_INPUT_FORMULA, FOCUSING_EDITOR_STANDALONE, FOCUSING_FX_BAR_EDITOR, FOCUSING_PANEL_EDITOR, FOCUSING_SHAPE_TEXT_EDITOR, FOCUSING_SHEET, FOCUSING_SLIDE, FOCUSING_UNIT, FOCUSING_UNIVER_EDITOR, FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE, FORMULA_EDITOR_ACTIVATED, FollowNumberWithType, FontItalic, FontStyleType, FontWeight, GridType, HorizontalAlign, IAuthzIoService, ICommandService, IConfigService, IConfirmService, IContextService, IImageIoService, ILocalStorageService, ILogService, IMentionIOService, IPermissionService, IResourceLoaderService, IResourceManagerService, IS_ROW_STYLE_PRECEDE_COLUMN_STYLE, IURLImageService, IUndoRedoService, IUniverInstanceService, ImageCacheMap, ImageSourceType, ImageUploadStatusType, Inject, InjectSelf, Injector, InterceptorEffectEnum, InterceptorManager, InterpolationPointType, json1 as JSON1, JSONX, LRUHelper, LRUMap, LifecycleService, LifecycleStages, LifecycleUnreachableError, ListGlyphType, LocalUndoRedoService, LocaleService, LocaleType, LogLevel, LookUp, MAX_COLUMN_COUNT, MAX_ROW_COUNT, MOVE_BUFFER_VALUE, Many, MemoryCursor, MentionIOLocalService, MentionType, NAMED_STYLE_MAP, NAMED_STYLE_SPACE_MAP, NamedStyleType, NilCommand, NumberUnitType, ObjectMatrix, ObjectRelativeFromH, ObjectRelativeFromV, Optional, PADDING_KEYS, PAGE_SIZE, PAPER_TYPES, PRESET_LIST_TYPE, PRINT_CHART_COMPONENT_KEY, PageOrientType, PaperType, ParagraphElementType, ParagraphStyleBuilder, ParagraphStyleValue, PermissionService, PermissionStatus, Plugin, PluginService, PositionedObjectLayoutType, PresetListType, ProtectionType, Quantity, QuickListType, QuickListTypeMap, RANGE_DIRECTION, RANGE_TYPE, RBush, RCDisposable, RGBA_PAREN, RGB_PAREN, ROTATE_BUFFER_VALUE, RTree, Range, Rectangle, RediError, RedoCommand, RedoCommandId, RefAlias, Registry, RegistryAsMap, RelativeDate, ResourceManagerService, RichTextBuilder, RichTextValue, RxDisposable, SHEET_EDITOR_UNITS, STYLE_KEYS, SectionType, Self, SheetSkeleton, SheetTypes, SheetViewModel, Skeleton, SkipSelf, SliceBodyType, SpacingRule, Styles, TEXT_DECORATION_KEYS, TEXT_ROTATION_KEYS, THEME_COLORS, TabStopAlignment, TableAlignmentType, TableLayoutType, TableRowHeightRule, TableSizeType, TableTextWrapType, TestConfirmService, TextDecoration, TextDecorationBuilder, TextDirection, TextDirectionType, TextStyleBuilder, TextStyleValue, TextX, TextXActionType, ThemeColorType, ThemeColors, ThemeService, Tools, UndoCommand, UndoCommandId, UnitModel, Univer, UniverInstanceService, UniverInstanceType, UpdateDocsAttributeType, UserManagerService, VerticalAlign, VerticalAlignmentType, WithNew, Workbook, Worksheet, WrapStrategy, WrapTextType, addLinkToDocumentModel, afterInitApply, afterTime, awaitTime, binSearchFirstGreaterThanTarget, binarySearchArray, bufferDebounceTime, cellToRange, characterSpacingControlType, checkForSubstrings, checkIfMove, checkParagraphHasBullet, checkParagraphHasIndent, checkParagraphHasIndentByStyle, cloneCellData, cloneCellDataMatrix, cloneCellDataWithSpanAndDisplay, cloneValue, cloneWorksheetData, codeToBlob, columnLabelToNumber, composeBody, composeInterceptors, composeStyles, concatMatrixArray, convertCellToRange, convertObservableToBehaviorSubject, covertCellValue, covertCellValues, createAsyncInterceptorKey, createDefaultUser, createDocumentModelWithStyle, createIdentifier, createInterceptorKey, createInternalEditorID, createREGEXFromWildChar, createRowColIter, createSheetGapTestConfig, customNameCharacterCheck, dateKit, debounce, dedupe, dedupeBy, deepCompare, delayAnimationFrame, deleteContent, extractPureTextFromCell, forwardRef, fromCallback, fromEventSubject, generateIntervalsByPoints, generateRandomId, get, getArrayLength, getBodySlice, getBorderStyleType, getCellCoordByIndexSimple, getCellInfoInMergeData, getCellValueType, getCellWithCoordByIndexCore, getColorStyle, getCustomBlockSlice, getCustomDecorationSlice, getCustomRangeSlice, getDisplayValueFromCell, getDocsUpdateBody, getEmptyCell, getIntersectRange, getNumfmtParseValueFilter, getOriginCellValue, getParagraphsSlice, getPlainText, getReverseDirection, getSectionBreakSlice, getTableSlice, getTextRunSlice, getTransformOffsetX, getTransformOffsetY, getWorksheetUID, groupBy, handleStyleToString, hashAlgorithm, horizontalLineSegmentsSubtraction, insertMatrixArray, insertTextToContent, invertColorByHSL, invertColorByMatrix, isAsyncDependencyItem, isAsyncHook, isBlackColor, isBooleanString, isCellCoverable, isCellV, isClassDependencyItem, isCommentEditorID, isCtor, isDefaultFormat, isDisposable, isEmptyCell, isFactoryDependencyItem, isFormulaId, isFormulaString, isICellData, isInternalEditorID, isNodeEnv, isNotNullOrUndefined, isNullCell, isNumeric, isPatternEqualWithoutDecimal, isRangesEqual, isRealNum, isSafeNumeric, isSameStyleTextRun, isTextFormat, isUnitRangesEqual, isValidRange, isValueDependencyItem, isWhiteColor, makeArray, makeCellRangeToRangeData, makeCellToSelection, makeCustomRangeStream, mapObjectMatrix, merge, mergeIntervals, mergeLocales, mergeOverrideWithDependencies, mergeSets, mergeWith, mergeWorksheetSnapshotWithDefault, mixinClass, moveMatrixArray, moveRangeByOffset, nameCharacterCheck, noop, normalizeBody, normalizeTextRuns, numberToABC, numberToListABC, numfmt, queryObjectMatrix, registerDependencies, remove, repeatStringNumTimes, replaceInDocumentBody, requestImmediateMacroTask, resolveWithBasePath, rotate, searchArray, searchInOrderedArray, selectionToArray, sequence, sequenceAsync, sequenceExecute, sequenceExecuteAsync, set, setDependencies, shallowEqual, skipParseTagNames, sliceMatrixArray, sortRules, sortRulesByDesc, sortRulesFactory, spliceArray, splitIntoGrid, takeAfter, throttle, toDisposable, touchDependencies, updateAttributeByDelete, updateAttributeByInsert, willLoseNumericPrecision };
|
package/lib/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import * as json1 from "ot-json1";
|
|
|
8
8
|
import { debounceTime as debounceTime$1, filter as filter$1, first, map as map$1 } from "rxjs/operators";
|
|
9
9
|
import * as numfmt from "numfmt";
|
|
10
10
|
import RBush, { default as RBush$1 } from "rbush";
|
|
11
|
-
import
|
|
11
|
+
import fastDiff from "fast-diff";
|
|
12
12
|
import { defaultTheme } from "@univerjs/themes";
|
|
13
13
|
import KDBush from "kdbush";
|
|
14
14
|
|
|
@@ -371,6 +371,11 @@ var CanceledError = class extends CustomCommandExecutionError {
|
|
|
371
371
|
* See the License for the specific language governing permissions and
|
|
372
372
|
* limitations under the License.
|
|
373
373
|
*/
|
|
374
|
+
/**
|
|
375
|
+
* A no-op (no operation) function that does nothing.
|
|
376
|
+
* Use this as a default placeholder for callbacks or optional handlers.
|
|
377
|
+
*/
|
|
378
|
+
function noop() {}
|
|
374
379
|
function throttle(fn, wait = 16) {
|
|
375
380
|
let lastTime = 0;
|
|
376
381
|
let timer = null;
|
|
@@ -11717,7 +11722,7 @@ const replaceSelectionTextX = (params) => {
|
|
|
11717
11722
|
const body = (_doc$getSelfOrHeaderF = doc.getSelfOrHeaderFooterModel(segmentId)) === null || _doc$getSelfOrHeaderF === void 0 ? void 0 : _doc$getSelfOrHeaderF.getBody();
|
|
11718
11723
|
if (!body) return false;
|
|
11719
11724
|
const oldBody = selection.collapsed ? null : getBodySlice(body, selection.startOffset, selection.endOffset);
|
|
11720
|
-
const diffs =
|
|
11725
|
+
const diffs = fastDiff(oldBody ? oldBody.dataStream : "", insertBody.dataStream);
|
|
11721
11726
|
let cursor = 0;
|
|
11722
11727
|
const actions = diffs.map(([type, text]) => {
|
|
11723
11728
|
switch (type) {
|
|
@@ -11767,7 +11772,7 @@ const replaceSelectionTextRuns = (params) => {
|
|
|
11767
11772
|
const body = (_doc$getSelfOrHeaderF2 = doc.getSelfOrHeaderFooterModel(segmentId)) === null || _doc$getSelfOrHeaderF2 === void 0 ? void 0 : _doc$getSelfOrHeaderF2.getBody();
|
|
11768
11773
|
if (!body) return false;
|
|
11769
11774
|
const oldBody = selection.collapsed ? null : getBodySlice(body, selection.startOffset, selection.endOffset);
|
|
11770
|
-
const diffs =
|
|
11775
|
+
const diffs = fastDiff(oldBody ? oldBody.dataStream : "", insertBody.dataStream);
|
|
11771
11776
|
let cursor = 0;
|
|
11772
11777
|
const actions = diffs.map(([type, text]) => {
|
|
11773
11778
|
switch (type) {
|
|
@@ -14751,7 +14756,7 @@ const IURLImageService = createIdentifier("core.url-image.service");
|
|
|
14751
14756
|
//#endregion
|
|
14752
14757
|
//#region package.json
|
|
14753
14758
|
var name = "@univerjs/core";
|
|
14754
|
-
var version = "0.
|
|
14759
|
+
var version = "0.24.0";
|
|
14755
14760
|
|
|
14756
14761
|
//#endregion
|
|
14757
14762
|
//#region src/sheets/empty-snapshot.ts
|
|
@@ -17330,11 +17335,8 @@ let UniverInstanceService = class UniverInstanceService extends Disposable {
|
|
|
17330
17335
|
return (_units$get = units.get(type)) !== null && _units$get !== void 0 ? _units$get : null;
|
|
17331
17336
|
}), distinctUntilChanged());
|
|
17332
17337
|
}
|
|
17333
|
-
getCurrentUnitForType(type) {
|
|
17334
|
-
return this._currentUnits.get(type);
|
|
17335
|
-
}
|
|
17336
17338
|
getCurrentUnitOfType(type) {
|
|
17337
|
-
return this.
|
|
17339
|
+
return this._currentUnits.get(type);
|
|
17338
17340
|
}
|
|
17339
17341
|
setCurrentUnitForType(unitId) {
|
|
17340
17342
|
const result = this._getUnitById(unitId);
|
|
@@ -17377,7 +17379,7 @@ let UniverInstanceService = class UniverInstanceService extends Disposable {
|
|
|
17377
17379
|
return unit;
|
|
17378
17380
|
}
|
|
17379
17381
|
getCurrentUniverDocInstance() {
|
|
17380
|
-
return this.
|
|
17382
|
+
return this.getCurrentUnitOfType(UniverInstanceType.UNIVER_DOC);
|
|
17381
17383
|
}
|
|
17382
17384
|
getUniverDocInstance(unitId) {
|
|
17383
17385
|
return this.getUnit(unitId, UniverInstanceType.UNIVER_DOC);
|
|
@@ -17458,7 +17460,7 @@ let UniverInstanceService = class UniverInstanceService extends Disposable {
|
|
|
17458
17460
|
return true;
|
|
17459
17461
|
}
|
|
17460
17462
|
_tryResetCurrentOnRemoval(unitId, type) {
|
|
17461
|
-
const current = this.
|
|
17463
|
+
const current = this.getCurrentUnitOfType(type);
|
|
17462
17464
|
if ((current === null || current === void 0 ? void 0 : current.getUnitId()) === unitId) {
|
|
17463
17465
|
this._currentUnits.set(type, null);
|
|
17464
17466
|
this._currentUnits$.next(this._currentUnits);
|
|
@@ -18739,9 +18741,23 @@ var RTree = class {
|
|
|
18739
18741
|
* See the License for the specific language governing permissions and
|
|
18740
18742
|
* limitations under the License.
|
|
18741
18743
|
*/
|
|
18744
|
+
/**
|
|
18745
|
+
* Returns a Promise that resolves after the specified number of milliseconds.
|
|
18746
|
+
* Use this to pause execution for a given duration.
|
|
18747
|
+
*
|
|
18748
|
+
* @param ms The number of milliseconds to wait before resolving.
|
|
18749
|
+
* @returns A Promise that resolves after `ms` milliseconds.
|
|
18750
|
+
*/
|
|
18742
18751
|
function awaitTime(ms) {
|
|
18743
18752
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
18744
18753
|
}
|
|
18754
|
+
/**
|
|
18755
|
+
* Returns a Promise that resolves after the specified number of animation frames.
|
|
18756
|
+
* Use this to wait for the browser to complete one or more rendering cycles.
|
|
18757
|
+
*
|
|
18758
|
+
* @param frames The number of animation frames to wait before resolving. Defaults to `1`.
|
|
18759
|
+
* @returns A Promise that resolves after `frames` animation frames.
|
|
18760
|
+
*/
|
|
18745
18761
|
function delayAnimationFrame(frames = 1) {
|
|
18746
18762
|
return new Promise((resolve) => {
|
|
18747
18763
|
let count = 0;
|
|
@@ -18959,8 +18975,8 @@ let SheetSkeleton = class SheetSkeleton extends Skeleton {
|
|
|
18959
18975
|
const { r, g, b } = new ColorKit(this._injector.get(ThemeService).getColorFromTheme("primary.500")).toRgb();
|
|
18960
18976
|
return {
|
|
18961
18977
|
...config,
|
|
18962
|
-
defaultBackgroundColor: (_config$defaultBackgr = config.defaultBackgroundColor) !== null && _config$defaultBackgr !== void 0 ? _config$defaultBackgr : `rgba(${r}, ${g}, ${b}, 0.
|
|
18963
|
-
defaultStripeColor: (_config$defaultStripe = config.defaultStripeColor) !== null && _config$defaultStripe !== void 0 ? _config$defaultStripe : `rgba(${r}, ${g}, ${b}, 0.
|
|
18978
|
+
defaultBackgroundColor: (_config$defaultBackgr = config.defaultBackgroundColor) !== null && _config$defaultBackgr !== void 0 ? _config$defaultBackgr : `rgba(${r}, ${g}, ${b}, 0.025)`,
|
|
18979
|
+
defaultStripeColor: (_config$defaultStripe = config.defaultStripeColor) !== null && _config$defaultStripe !== void 0 ? _config$defaultStripe : `rgba(${r}, ${g}, ${b}, 0.08)`
|
|
18964
18980
|
};
|
|
18965
18981
|
}
|
|
18966
18982
|
/**
|
|
@@ -20029,4 +20045,4 @@ function createUniverInjector(parentInjector, override) {
|
|
|
20029
20045
|
installShims();
|
|
20030
20046
|
|
|
20031
20047
|
//#endregion
|
|
20032
|
-
export { ABCToNumber, AUTO_HEIGHT_FOR_MERGED_CELLS, AbsoluteRefType, ActionIterator, AlignTypeH, AlignTypeV, ArrangeTypeEnum, AsyncInterceptorManager, AsyncLock, AuthzIoLocalService, AutoFillSeries, BORDER_KEYS, BORDER_STYLE_KEYS, BaselineOffset, BlockType, BooleanNumber, BorderStyleTypes, BorderType, BuildTextUtils, BulletAlignment, COLORS, COLOR_STYLE_KEYS, COMMAND_LOG_EXECUTION_CONFIG_KEY, CanceledError, CellModeEnum, CellValueType, ColorKit, ColorType, ColumnSeparatorType, CommandService, CommandType, CommonHideTypes, ConfigService, ContextService, CopyPasteType, CustomCommandExecutionError, CustomDecorationType, CustomRangeType, DEFAULT_CELL, DEFAULT_DOC, DEFAULT_DOCUMENT_SUB_COMPONENT_ID, DEFAULT_EMPTY_DOCUMENT_VALUE, DEFAULT_NUMBER_FORMAT, DEFAULT_RANGE, DEFAULT_RANGE_ARRAY, DEFAULT_SELECTION, DEFAULT_STYLES, DEFAULT_TEXT_FORMAT, DEFAULT_TEXT_FORMAT_EXCEL, DEFAULT_WORKSHEET_COLUMN_COUNT, DEFAULT_WORKSHEET_COLUMN_COUNT_KEY, DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT, DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT_KEY, DEFAULT_WORKSHEET_COLUMN_WIDTH, DEFAULT_WORKSHEET_COLUMN_WIDTH_KEY, DEFAULT_WORKSHEET_ROW_COUNT, DEFAULT_WORKSHEET_ROW_COUNT_KEY, DEFAULT_WORKSHEET_ROW_HEIGHT, DEFAULT_WORKSHEET_ROW_HEIGHT_KEY, DEFAULT_WORKSHEET_ROW_TITLE_WIDTH, DEFAULT_WORKSHEET_ROW_TITLE_WIDTH_KEY, DOCS_COMMENT_EDITOR_UNIT_ID_KEY, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY, DOCS_NORMAL_EDITOR_UNIT_ID_KEY, DOCS_ZEN_EDITOR_UNIT_ID_KEY, DOC_DRAWING_PRINTING_COMPONENT_KEY, DOC_RANGE_TYPE, DashStyleType, DataStreamTreeNodeType, DataStreamTreeTokenType, DataValidationErrorStyle, DataValidationImeMode, DataValidationOperator, DataValidationRenderMode, DataValidationStatus, DataValidationType, DeleteDirection, DependentOn, DesktopLogService, DeveloperMetadataVisibility, Dimension, Direction, Disposable, DisposableCollection, DocStyleType, DocumentDataModel, DocumentFlavor, DrawingTypeEnum, EDITOR_ACTIVATED, EXTENSION_NAMES, ErrorService, EventState, EventSubject, FOCUSING_COMMENT_EDITOR, FOCUSING_COMMON_DRAWINGS, FOCUSING_DOC, FOCUSING_EDITOR_BUT_HIDDEN, FOCUSING_EDITOR_INPUT_FORMULA, FOCUSING_EDITOR_STANDALONE, FOCUSING_FX_BAR_EDITOR, FOCUSING_PANEL_EDITOR, FOCUSING_SHAPE_TEXT_EDITOR, FOCUSING_SHEET, FOCUSING_SLIDE, FOCUSING_UNIT, FOCUSING_UNIVER_EDITOR, FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE, FORMULA_EDITOR_ACTIVATED, FollowNumberWithType, FontItalic, FontStyleType, FontWeight, GridType, HorizontalAlign, IAuthzIoService, ICommandService, IConfigService, IConfirmService, IContextService, IImageIoService, ILocalStorageService, ILogService, IMentionIOService, IPermissionService, IResourceLoaderService, IResourceManagerService, IS_ROW_STYLE_PRECEDE_COLUMN_STYLE, IURLImageService, IUndoRedoService, IUniverInstanceService, ImageCacheMap, ImageSourceType, ImageUploadStatusType, Inject, InjectSelf, Injector, InterceptorEffectEnum, InterceptorManager, InterpolationPointType, json1 as JSON1, JSONX, LRUHelper, LRUMap, LifecycleService, LifecycleStages, LifecycleUnreachableError, ListGlyphType, LocalUndoRedoService, LocaleService, LocaleType, LogLevel, LookUp, MAX_COLUMN_COUNT, MAX_ROW_COUNT, MOVE_BUFFER_VALUE, Many, MemoryCursor, MentionIOLocalService, MentionType, NAMED_STYLE_MAP, NAMED_STYLE_SPACE_MAP, NamedStyleType, NilCommand, NumberUnitType, ObjectMatrix, ObjectRelativeFromH, ObjectRelativeFromV, Optional, PADDING_KEYS, PAGE_SIZE, PAPER_TYPES, PRESET_LIST_TYPE, PRINT_CHART_COMPONENT_KEY, PageOrientType, PaperType, ParagraphElementType, ParagraphStyleBuilder, ParagraphStyleValue, PermissionService, PermissionStatus, Plugin, PluginService, PositionedObjectLayoutType, PresetListType, ProtectionType, Quantity, QuickListType, QuickListTypeMap, RANGE_DIRECTION, RANGE_TYPE, RBush, RCDisposable, RGBA_PAREN, RGB_PAREN, ROTATE_BUFFER_VALUE, RTree, Range, Rectangle, RediError, RedoCommand, RedoCommandId, RefAlias, Registry, RegistryAsMap, RelativeDate, ResourceManagerService, RichTextBuilder, RichTextValue, RxDisposable, SHEET_EDITOR_UNITS, STYLE_KEYS, SectionType, Self, SheetSkeleton, SheetTypes, SheetViewModel, Skeleton, SkipSelf, SliceBodyType, SpacingRule, Styles, TEXT_DECORATION_KEYS, TEXT_ROTATION_KEYS, THEME_COLORS, TabStopAlignment, TableAlignmentType, TableLayoutType, TableRowHeightRule, TableSizeType, TableTextWrapType, TestConfirmService, TextDecoration, TextDecorationBuilder, TextDirection, TextDirectionType, TextStyleBuilder, TextStyleValue, TextX, TextXActionType, ThemeColorType, ThemeColors, ThemeService, Tools, UndoCommand, UndoCommandId, UnitModel, Univer, UniverInstanceService, UniverInstanceType, UpdateDocsAttributeType, UserManagerService, VerticalAlign, VerticalAlignmentType, WithNew, Workbook, Worksheet, WrapStrategy, WrapTextType, addLinkToDocumentModel, afterInitApply, afterTime, awaitTime, binSearchFirstGreaterThanTarget, binarySearchArray, bufferDebounceTime, cellToRange, characterSpacingControlType, checkForSubstrings, checkIfMove, checkParagraphHasBullet, checkParagraphHasIndent, checkParagraphHasIndentByStyle, cloneCellData, cloneCellDataMatrix, cloneCellDataWithSpanAndDisplay, cloneValue, cloneWorksheetData, codeToBlob, columnLabelToNumber, composeBody, composeInterceptors, composeStyles, concatMatrixArray, convertCellToRange, convertObservableToBehaviorSubject, covertCellValue, covertCellValues, createAsyncInterceptorKey, createDefaultUser, createDocumentModelWithStyle, createIdentifier, createInterceptorKey, createInternalEditorID, createREGEXFromWildChar, createRowColIter, createSheetGapTestConfig, customNameCharacterCheck, dateKit, debounce, dedupe, dedupeBy, deepCompare, delayAnimationFrame, deleteContent, extractPureTextFromCell, forwardRef, fromCallback, fromEventSubject, generateIntervalsByPoints, generateRandomId, get, getArrayLength, getBodySlice, getBorderStyleType, getCellCoordByIndexSimple, getCellInfoInMergeData, getCellValueType, getCellWithCoordByIndexCore, getColorStyle, getCustomBlockSlice, getCustomDecorationSlice, getCustomRangeSlice, getDisplayValueFromCell, getDocsUpdateBody, getEmptyCell, getIntersectRange, getNumfmtParseValueFilter, getOriginCellValue, getParagraphsSlice, getPlainText, getReverseDirection, getSectionBreakSlice, getTableSlice, getTextRunSlice, getTransformOffsetX, getTransformOffsetY, getWorksheetUID, groupBy, handleStyleToString, hashAlgorithm, horizontalLineSegmentsSubtraction, insertMatrixArray, insertTextToContent, invertColorByHSL, invertColorByMatrix, isAsyncDependencyItem, isAsyncHook, isBlackColor, isBooleanString, isCellCoverable, isCellV, isClassDependencyItem, isCommentEditorID, isCtor, isDefaultFormat, isDisposable, isEmptyCell, isFactoryDependencyItem, isFormulaId, isFormulaString, isICellData, isInternalEditorID, isNodeEnv, isNotNullOrUndefined, isNullCell, isNumeric, isPatternEqualWithoutDecimal, isRangesEqual, isRealNum, isSafeNumeric, isSameStyleTextRun, isTextFormat, isUnitRangesEqual, isValidRange, isValueDependencyItem, isWhiteColor, makeArray, makeCellRangeToRangeData, makeCellToSelection, makeCustomRangeStream, mapObjectMatrix, merge, mergeIntervals, mergeLocales, mergeOverrideWithDependencies, mergeSets, mergeWith, mergeWorksheetSnapshotWithDefault, mixinClass, moveMatrixArray, moveRangeByOffset, nameCharacterCheck, normalizeBody, normalizeTextRuns, numberToABC, numberToListABC, numfmt, queryObjectMatrix, registerDependencies, remove, repeatStringNumTimes, replaceInDocumentBody, requestImmediateMacroTask, resolveWithBasePath, rotate, searchArray, searchInOrderedArray, selectionToArray, sequence, sequenceAsync, sequenceExecute, sequenceExecuteAsync, set, setDependencies, shallowEqual, skipParseTagNames, sliceMatrixArray, sortRules, sortRulesByDesc, sortRulesFactory, spliceArray, splitIntoGrid, takeAfter,
|
|
20048
|
+
export { ABCToNumber, AUTO_HEIGHT_FOR_MERGED_CELLS, AbsoluteRefType, ActionIterator, AlignTypeH, AlignTypeV, ArrangeTypeEnum, AsyncInterceptorManager, AsyncLock, AuthzIoLocalService, AutoFillSeries, BORDER_KEYS, BORDER_STYLE_KEYS, BaselineOffset, BlockType, BooleanNumber, BorderStyleTypes, BorderType, BuildTextUtils, BulletAlignment, COLORS, COLOR_STYLE_KEYS, COMMAND_LOG_EXECUTION_CONFIG_KEY, CanceledError, CellModeEnum, CellValueType, ColorKit, ColorType, ColumnSeparatorType, CommandService, CommandType, CommonHideTypes, ConfigService, ContextService, CopyPasteType, CustomCommandExecutionError, CustomDecorationType, CustomRangeType, DEFAULT_CELL, DEFAULT_DOC, DEFAULT_DOCUMENT_SUB_COMPONENT_ID, DEFAULT_EMPTY_DOCUMENT_VALUE, DEFAULT_NUMBER_FORMAT, DEFAULT_RANGE, DEFAULT_RANGE_ARRAY, DEFAULT_SELECTION, DEFAULT_STYLES, DEFAULT_TEXT_FORMAT, DEFAULT_TEXT_FORMAT_EXCEL, DEFAULT_WORKSHEET_COLUMN_COUNT, DEFAULT_WORKSHEET_COLUMN_COUNT_KEY, DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT, DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT_KEY, DEFAULT_WORKSHEET_COLUMN_WIDTH, DEFAULT_WORKSHEET_COLUMN_WIDTH_KEY, DEFAULT_WORKSHEET_ROW_COUNT, DEFAULT_WORKSHEET_ROW_COUNT_KEY, DEFAULT_WORKSHEET_ROW_HEIGHT, DEFAULT_WORKSHEET_ROW_HEIGHT_KEY, DEFAULT_WORKSHEET_ROW_TITLE_WIDTH, DEFAULT_WORKSHEET_ROW_TITLE_WIDTH_KEY, DOCS_COMMENT_EDITOR_UNIT_ID_KEY, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY, DOCS_NORMAL_EDITOR_UNIT_ID_KEY, DOCS_ZEN_EDITOR_UNIT_ID_KEY, DOC_DRAWING_PRINTING_COMPONENT_KEY, DOC_RANGE_TYPE, DashStyleType, DataStreamTreeNodeType, DataStreamTreeTokenType, DataValidationErrorStyle, DataValidationImeMode, DataValidationOperator, DataValidationRenderMode, DataValidationStatus, DataValidationType, DeleteDirection, DependentOn, DesktopLogService, DeveloperMetadataVisibility, Dimension, Direction, Disposable, DisposableCollection, DocStyleType, DocumentDataModel, DocumentFlavor, DrawingTypeEnum, EDITOR_ACTIVATED, EXTENSION_NAMES, ErrorService, EventState, EventSubject, FOCUSING_COMMENT_EDITOR, FOCUSING_COMMON_DRAWINGS, FOCUSING_DOC, FOCUSING_EDITOR_BUT_HIDDEN, FOCUSING_EDITOR_INPUT_FORMULA, FOCUSING_EDITOR_STANDALONE, FOCUSING_FX_BAR_EDITOR, FOCUSING_PANEL_EDITOR, FOCUSING_SHAPE_TEXT_EDITOR, FOCUSING_SHEET, FOCUSING_SLIDE, FOCUSING_UNIT, FOCUSING_UNIVER_EDITOR, FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE, FORMULA_EDITOR_ACTIVATED, FollowNumberWithType, FontItalic, FontStyleType, FontWeight, GridType, HorizontalAlign, IAuthzIoService, ICommandService, IConfigService, IConfirmService, IContextService, IImageIoService, ILocalStorageService, ILogService, IMentionIOService, IPermissionService, IResourceLoaderService, IResourceManagerService, IS_ROW_STYLE_PRECEDE_COLUMN_STYLE, IURLImageService, IUndoRedoService, IUniverInstanceService, ImageCacheMap, ImageSourceType, ImageUploadStatusType, Inject, InjectSelf, Injector, InterceptorEffectEnum, InterceptorManager, InterpolationPointType, json1 as JSON1, JSONX, LRUHelper, LRUMap, LifecycleService, LifecycleStages, LifecycleUnreachableError, ListGlyphType, LocalUndoRedoService, LocaleService, LocaleType, LogLevel, LookUp, MAX_COLUMN_COUNT, MAX_ROW_COUNT, MOVE_BUFFER_VALUE, Many, MemoryCursor, MentionIOLocalService, MentionType, NAMED_STYLE_MAP, NAMED_STYLE_SPACE_MAP, NamedStyleType, NilCommand, NumberUnitType, ObjectMatrix, ObjectRelativeFromH, ObjectRelativeFromV, Optional, PADDING_KEYS, PAGE_SIZE, PAPER_TYPES, PRESET_LIST_TYPE, PRINT_CHART_COMPONENT_KEY, PageOrientType, PaperType, ParagraphElementType, ParagraphStyleBuilder, ParagraphStyleValue, PermissionService, PermissionStatus, Plugin, PluginService, PositionedObjectLayoutType, PresetListType, ProtectionType, Quantity, QuickListType, QuickListTypeMap, RANGE_DIRECTION, RANGE_TYPE, RBush, RCDisposable, RGBA_PAREN, RGB_PAREN, ROTATE_BUFFER_VALUE, RTree, Range, Rectangle, RediError, RedoCommand, RedoCommandId, RefAlias, Registry, RegistryAsMap, RelativeDate, ResourceManagerService, RichTextBuilder, RichTextValue, RxDisposable, SHEET_EDITOR_UNITS, STYLE_KEYS, SectionType, Self, SheetSkeleton, SheetTypes, SheetViewModel, Skeleton, SkipSelf, SliceBodyType, SpacingRule, Styles, TEXT_DECORATION_KEYS, TEXT_ROTATION_KEYS, THEME_COLORS, TabStopAlignment, TableAlignmentType, TableLayoutType, TableRowHeightRule, TableSizeType, TableTextWrapType, TestConfirmService, TextDecoration, TextDecorationBuilder, TextDirection, TextDirectionType, TextStyleBuilder, TextStyleValue, TextX, TextXActionType, ThemeColorType, ThemeColors, ThemeService, Tools, UndoCommand, UndoCommandId, UnitModel, Univer, UniverInstanceService, UniverInstanceType, UpdateDocsAttributeType, UserManagerService, VerticalAlign, VerticalAlignmentType, WithNew, Workbook, Worksheet, WrapStrategy, WrapTextType, addLinkToDocumentModel, afterInitApply, afterTime, awaitTime, binSearchFirstGreaterThanTarget, binarySearchArray, bufferDebounceTime, cellToRange, characterSpacingControlType, checkForSubstrings, checkIfMove, checkParagraphHasBullet, checkParagraphHasIndent, checkParagraphHasIndentByStyle, cloneCellData, cloneCellDataMatrix, cloneCellDataWithSpanAndDisplay, cloneValue, cloneWorksheetData, codeToBlob, columnLabelToNumber, composeBody, composeInterceptors, composeStyles, concatMatrixArray, convertCellToRange, convertObservableToBehaviorSubject, covertCellValue, covertCellValues, createAsyncInterceptorKey, createDefaultUser, createDocumentModelWithStyle, createIdentifier, createInterceptorKey, createInternalEditorID, createREGEXFromWildChar, createRowColIter, createSheetGapTestConfig, customNameCharacterCheck, dateKit, debounce, dedupe, dedupeBy, deepCompare, delayAnimationFrame, deleteContent, extractPureTextFromCell, forwardRef, fromCallback, fromEventSubject, generateIntervalsByPoints, generateRandomId, get, getArrayLength, getBodySlice, getBorderStyleType, getCellCoordByIndexSimple, getCellInfoInMergeData, getCellValueType, getCellWithCoordByIndexCore, getColorStyle, getCustomBlockSlice, getCustomDecorationSlice, getCustomRangeSlice, getDisplayValueFromCell, getDocsUpdateBody, getEmptyCell, getIntersectRange, getNumfmtParseValueFilter, getOriginCellValue, getParagraphsSlice, getPlainText, getReverseDirection, getSectionBreakSlice, getTableSlice, getTextRunSlice, getTransformOffsetX, getTransformOffsetY, getWorksheetUID, groupBy, handleStyleToString, hashAlgorithm, horizontalLineSegmentsSubtraction, insertMatrixArray, insertTextToContent, invertColorByHSL, invertColorByMatrix, isAsyncDependencyItem, isAsyncHook, isBlackColor, isBooleanString, isCellCoverable, isCellV, isClassDependencyItem, isCommentEditorID, isCtor, isDefaultFormat, isDisposable, isEmptyCell, isFactoryDependencyItem, isFormulaId, isFormulaString, isICellData, isInternalEditorID, isNodeEnv, isNotNullOrUndefined, isNullCell, isNumeric, isPatternEqualWithoutDecimal, isRangesEqual, isRealNum, isSafeNumeric, isSameStyleTextRun, isTextFormat, isUnitRangesEqual, isValidRange, isValueDependencyItem, isWhiteColor, makeArray, makeCellRangeToRangeData, makeCellToSelection, makeCustomRangeStream, mapObjectMatrix, merge, mergeIntervals, mergeLocales, mergeOverrideWithDependencies, mergeSets, mergeWith, mergeWorksheetSnapshotWithDefault, mixinClass, moveMatrixArray, moveRangeByOffset, nameCharacterCheck, noop, normalizeBody, normalizeTextRuns, numberToABC, numberToListABC, numfmt, queryObjectMatrix, registerDependencies, remove, repeatStringNumTimes, replaceInDocumentBody, requestImmediateMacroTask, resolveWithBasePath, rotate, searchArray, searchInOrderedArray, selectionToArray, sequence, sequenceAsync, sequenceExecute, sequenceExecuteAsync, set, setDependencies, shallowEqual, skipParseTagNames, sliceMatrixArray, sortRules, sortRulesByDesc, sortRulesFactory, spliceArray, splitIntoGrid, takeAfter, throttle, toDisposable, touchDependencies, updateAttributeByDelete, updateAttributeByInsert, willLoseNumericPrecision };
|
|
@@ -13,4 +13,9 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
/**
|
|
17
|
+
* A no-op (no operation) function that does nothing.
|
|
18
|
+
* Use this as a default placeholder for callbacks or optional handlers.
|
|
19
|
+
*/
|
|
20
|
+
export declare function noop(): void;
|
|
16
21
|
export declare function throttle<T extends (...args: any[]) => any>(fn: T, wait?: number): T;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -20,9 +20,9 @@ export * from './common/const';
|
|
|
20
20
|
export * from './common/di';
|
|
21
21
|
export { shallowEqual } from './common/equal';
|
|
22
22
|
export { CanceledError, CustomCommandExecutionError } from './common/error';
|
|
23
|
-
export { throttle } from './common/function';
|
|
24
|
-
export type { IAsyncInterceptor, ICellInterceptor, IComposeInterceptors, IInterceptor, InterceptorHandler } from './common/interceptor';
|
|
25
|
-
export { AsyncInterceptorManager, composeInterceptors, createAsyncInterceptorKey, createInterceptorKey, InterceptorEffectEnum, InterceptorManager } from './common/interceptor';
|
|
23
|
+
export { noop, throttle } from './common/function';
|
|
24
|
+
export type { IAsyncInterceptor, ICellInterceptor, IComposeInterceptors, IInterceptor, InterceptorHandler, } from './common/interceptor';
|
|
25
|
+
export { AsyncInterceptorManager, composeInterceptors, createAsyncInterceptorKey, createInterceptorKey, InterceptorEffectEnum, InterceptorManager, } from './common/interceptor';
|
|
26
26
|
export { invertColorByHSL } from './common/invert-color/invert-hsl';
|
|
27
27
|
export { invertColorByMatrix } from './common/invert-color/invert-rgb';
|
|
28
28
|
export type { RGBColorType } from './common/invert-color/utils';
|
|
@@ -41,7 +41,7 @@ export * from './docs/data-model';
|
|
|
41
41
|
export { JSON1, JSONX } from './docs/data-model/json-x/json-x';
|
|
42
42
|
export type { JSONXActions, JSONXPath } from './docs/data-model/json-x/json-x';
|
|
43
43
|
export { replaceInDocumentBody } from './docs/data-model/replacement';
|
|
44
|
-
export { ParagraphStyleBuilder, ParagraphStyleValue, RichTextBuilder, RichTextValue, TextDecorationBuilder, TextStyleBuilder, TextStyleValue } from './docs/data-model/rich-text-builder';
|
|
44
|
+
export { ParagraphStyleBuilder, ParagraphStyleValue, RichTextBuilder, RichTextValue, TextDecorationBuilder, TextStyleBuilder, TextStyleValue, } from './docs/data-model/rich-text-builder';
|
|
45
45
|
export { DEFAULT_DOCUMENT_SUB_COMPONENT_ID } from './docs/data-model/subdocument';
|
|
46
46
|
export { ActionIterator } from './docs/data-model/text-x/action-iterator';
|
|
47
47
|
export { type IDeleteAction, type IInsertAction, type IRetainAction, type TextXAction, TextXActionType, } from './docs/data-model/text-x/action-types';
|
|
@@ -77,7 +77,7 @@ export { PermissionService } from './services/permission/permission.service';
|
|
|
77
77
|
export { IPermissionService, PermissionStatus } from './services/permission/type';
|
|
78
78
|
export type { IPermissionParam } from './services/permission/type';
|
|
79
79
|
export type { IPermissionPoint } from './services/permission/type';
|
|
80
|
-
export type { IPermissionTypes, RangePermissionPointConstructor, WorkbookPermissionPointConstructor, WorkSheetPermissionPointConstructor } from './services/permission/type';
|
|
80
|
+
export type { IPermissionTypes, RangePermissionPointConstructor, WorkbookPermissionPointConstructor, WorkSheetPermissionPointConstructor, } from './services/permission/type';
|
|
81
81
|
export { type DependencyOverride, mergeOverrideWithDependencies } from './services/plugin/plugin-override';
|
|
82
82
|
export type { PluginCtor } from './services/plugin/plugin.service';
|
|
83
83
|
export { DependentOn, Plugin, PluginService } from './services/plugin/plugin.service';
|
|
@@ -97,7 +97,6 @@ export { customNameCharacterCheck, nameCharacterCheck } from './shared/name';
|
|
|
97
97
|
export { type BBox, type IRTreeItem, RBush, RTree } from './shared/r-tree';
|
|
98
98
|
export { getIntersectRange } from './shared/range';
|
|
99
99
|
export { afterTime, bufferDebounceTime, convertObservableToBehaviorSubject, fromCallback, takeAfter } from './shared/rxjs';
|
|
100
|
-
export { textDiff } from './shared/text-diff';
|
|
101
100
|
export { awaitTime, delayAnimationFrame } from './shared/timer';
|
|
102
101
|
export { isNodeEnv } from './shared/tools';
|
|
103
102
|
export * from './sheets/clone';
|
|
@@ -126,5 +125,5 @@ export { DataValidationStatus } from './types/enum/data-validation-status';
|
|
|
126
125
|
export { DataValidationType } from './types/enum/data-validation-type';
|
|
127
126
|
export * from './types/interfaces';
|
|
128
127
|
export type { ICellCustomRender, ICellRenderContext } from './types/interfaces/i-cell-custom-render';
|
|
129
|
-
export type { IDataValidationRule, IDataValidationRuleBase, IDataValidationRuleInfo, IDataValidationRuleOptions, ISheetDataValidationRule } from './types/interfaces/i-data-validation';
|
|
128
|
+
export type { IDataValidationRule, IDataValidationRuleBase, IDataValidationRuleInfo, IDataValidationRuleOptions, ISheetDataValidationRule, } from './types/interfaces/i-data-validation';
|
|
130
129
|
export { type IUniverConfig, Univer } from './univer';
|
|
@@ -66,8 +66,6 @@ export interface IUniverInstanceService {
|
|
|
66
66
|
focusUnit(unitId: string | null): void;
|
|
67
67
|
/** Get the currently focused unit. */
|
|
68
68
|
getFocusedUnit(): Nullable<UnitModel>;
|
|
69
|
-
/** @deprecated Use `getCurrentUnitOfType` instead. */
|
|
70
|
-
getCurrentUnitForType<T extends UnitModel>(type: UniverInstanceType): Nullable<T>;
|
|
71
69
|
getCurrentUnitOfType<T extends UnitModel>(type: UniverInstanceType): Nullable<T>;
|
|
72
70
|
setCurrentUnitForType(unitId: string): void;
|
|
73
71
|
getCurrentTypeOfUnit$<T extends UnitModel>(type: UniverInstanceType): Observable<Nullable<T>>;
|
|
@@ -106,7 +104,6 @@ export declare class UniverInstanceService extends Disposable implements IUniver
|
|
|
106
104
|
private readonly _currentUnits$;
|
|
107
105
|
readonly currentUnits$: Observable<Map<UniverInstanceType, Nullable<UnitModel<object, UniverInstanceType>>>>;
|
|
108
106
|
getCurrentTypeOfUnit$<T>(type: number): Observable<Nullable<T>>;
|
|
109
|
-
getCurrentUnitForType<T extends UnitModel>(type: UniverInstanceType): Nullable<T>;
|
|
110
107
|
getCurrentUnitOfType<T extends UnitModel>(type: UniverInstanceType): Nullable<T>;
|
|
111
108
|
setCurrentUnitForType(unitId: string): void;
|
|
112
109
|
private readonly _unitAdded$;
|
|
@@ -13,5 +13,19 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
/**
|
|
17
|
+
* Returns a Promise that resolves after the specified number of milliseconds.
|
|
18
|
+
* Use this to pause execution for a given duration.
|
|
19
|
+
*
|
|
20
|
+
* @param ms The number of milliseconds to wait before resolving.
|
|
21
|
+
* @returns A Promise that resolves after `ms` milliseconds.
|
|
22
|
+
*/
|
|
16
23
|
export declare function awaitTime(ms: number): Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* Returns a Promise that resolves after the specified number of animation frames.
|
|
26
|
+
* Use this to wait for the browser to complete one or more rendering cycles.
|
|
27
|
+
*
|
|
28
|
+
* @param frames The number of animation frames to wait before resolving. Defaults to `1`.
|
|
29
|
+
* @returns A Promise that resolves after `frames` animation frames.
|
|
30
|
+
*/
|
|
17
31
|
export declare function delayAnimationFrame(frames?: number): Promise<void>;
|