@univerjs/core 0.4.0-alpha.0 → 0.4.0-alpha.1
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 +3 -3
- package/lib/es/index.js +7 -8
- package/lib/types/docs/data-model/text-x/build-utils/custom-range.d.ts +4 -2
- package/lib/types/docs/data-model/text-x/transform-utils.d.ts +2 -1
- package/lib/types/services/__tests__/index.d.ts +3 -2
- package/lib/types/services/resource-manager/type.d.ts +1 -1
- package/lib/umd/index.js +3 -3
- package/package.json +3 -4
package/lib/es/index.js
CHANGED
|
@@ -4,7 +4,6 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
|
|
|
4
4
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key != "symbol" ? key + "" : key, value);
|
|
5
5
|
import { BehaviorSubject, Subject, Observable, filter, merge as merge$1, timer, map, distinctUntilChanged, skip, of, combineLatest } from "rxjs";
|
|
6
6
|
import { filter as filter$1, debounceTime, first, map as map$1 } from "rxjs/operators";
|
|
7
|
-
import { Tools as Tools$1, normalizeTextRuns as normalizeTextRuns$1, generateRandomId as generateRandomId$1, DataStreamTreeTokenType as DataStreamTreeTokenType$1 } from "@univerjs/core";
|
|
8
7
|
import * as React from "react";
|
|
9
8
|
import React__default, { useState, useEffect, useRef, useMemo, createContext, useCallback, useContext } from "react";
|
|
10
9
|
function _mergeNamespaces(n, m) {
|
|
@@ -9785,7 +9784,7 @@ __name(textXApply, "textXApply");
|
|
|
9785
9784
|
function transformTextRuns(originTextRuns, targetTextRuns, transformType) {
|
|
9786
9785
|
if (originTextRuns.length === 0)
|
|
9787
9786
|
return targetTextRuns;
|
|
9788
|
-
targetTextRuns = Tools
|
|
9787
|
+
targetTextRuns = Tools.deepClone(targetTextRuns), originTextRuns = Tools.deepClone(originTextRuns);
|
|
9789
9788
|
const newUpdateTextRuns = [], updateLength = targetTextRuns.length, removeLength = originTextRuns.length;
|
|
9790
9789
|
let updateIndex = 0, removeIndex = 0, pending = null;
|
|
9791
9790
|
function pushPendingAndReturnStatus() {
|
|
@@ -9829,7 +9828,7 @@ function transformTextRuns(originTextRuns, targetTextRuns, transformType) {
|
|
|
9829
9828
|
}
|
|
9830
9829
|
pushPendingAndReturnStatus();
|
|
9831
9830
|
const tempTopTextRun = newUpdateTextRuns[newUpdateTextRuns.length - 1], updateLastTextRun = targetTextRuns[updateLength - 1], removeLastTextRun = originTextRuns[removeLength - 1];
|
|
9832
|
-
return tempTopTextRun.ed !== Math.max(updateLastTextRun.ed, removeLastTextRun.ed) && (updateLastTextRun.ed > removeLastTextRun.ed ? newUpdateTextRuns.push(updateLastTextRun) : newUpdateTextRuns.push(removeLastTextRun)), normalizeTextRuns
|
|
9831
|
+
return tempTopTextRun.ed !== Math.max(updateLastTextRun.ed, removeLastTextRun.ed) && (updateLastTextRun.ed > removeLastTextRun.ed ? newUpdateTextRuns.push(updateLastTextRun) : newUpdateTextRuns.push(removeLastTextRun)), normalizeTextRuns(newUpdateTextRuns);
|
|
9833
9832
|
}
|
|
9834
9833
|
__name(transformTextRuns, "transformTextRuns");
|
|
9835
9834
|
function transformParagraph(originParagraph, targetParagraph, transformType) {
|
|
@@ -9892,7 +9891,7 @@ function transformBody(thisAction, otherAction, priority = !1) {
|
|
|
9892
9891
|
0
|
|
9893
9892
|
/* COVER */
|
|
9894
9893
|
), paragraphs.push(paragraph), thisIndex++, otherIndex++;
|
|
9895
|
-
} else thisStart < otherStart ? thisIndex++ : (paragraphs.push(Tools
|
|
9894
|
+
} else thisStart < otherStart ? thisIndex++ : (paragraphs.push(Tools.deepClone(otherParagraph)), otherIndex++);
|
|
9896
9895
|
}
|
|
9897
9896
|
return otherIndex < otherParagraphs.length && paragraphs.push(...otherParagraphs.slice(otherIndex)), paragraphs.length && (retBody.paragraphs = paragraphs), retBody;
|
|
9898
9897
|
}
|
|
@@ -10364,7 +10363,7 @@ const _DocumentDataModel = class _DocumentDataModel extends DocumentDataModelSim
|
|
|
10364
10363
|
__name(_DocumentDataModel, "DocumentDataModel");
|
|
10365
10364
|
let DocumentDataModel = _DocumentDataModel;
|
|
10366
10365
|
function isCustomRangeSplitSymbol(text) {
|
|
10367
|
-
return text === DataStreamTreeTokenType
|
|
10366
|
+
return text === DataStreamTreeTokenType.CUSTOM_RANGE_END || text === DataStreamTreeTokenType.CUSTOM_RANGE_START;
|
|
10368
10367
|
}
|
|
10369
10368
|
__name(isCustomRangeSplitSymbol, "isCustomRangeSplitSymbol");
|
|
10370
10369
|
function isIntersecting(line1Start, line1End, line2Start, line2End) {
|
|
@@ -10397,8 +10396,8 @@ function getCustomRangesInterestsWithRange(range, customRanges) {
|
|
|
10397
10396
|
__name(getCustomRangesInterestsWithRange, "getCustomRangesInterestsWithRange");
|
|
10398
10397
|
function copyCustomRange(range) {
|
|
10399
10398
|
return {
|
|
10400
|
-
...Tools
|
|
10401
|
-
rangeId: generateRandomId
|
|
10399
|
+
...Tools.deepClone(range),
|
|
10400
|
+
rangeId: generateRandomId()
|
|
10402
10401
|
};
|
|
10403
10402
|
}
|
|
10404
10403
|
__name(copyCustomRange, "copyCustomRange");
|
|
@@ -11168,7 +11167,7 @@ const FOCUSING_UNIT = "FOCUSING_UNIT", FOCUSING_SHEET = "FOCUSING_SHEET", FOCUSI
|
|
|
11168
11167
|
};
|
|
11169
11168
|
__name(_ErrorService, "ErrorService");
|
|
11170
11169
|
let ErrorService = _ErrorService;
|
|
11171
|
-
const version = "0.4.0-alpha.
|
|
11170
|
+
const version = "0.4.0-alpha.1";
|
|
11172
11171
|
function getEmptySnapshot(unitID = "", locale = LocaleType.ZH_CN, name = "") {
|
|
11173
11172
|
return {
|
|
11174
11173
|
id: unitID,
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ITextRange } from '../../../../sheets/typedef';
|
|
2
|
+
import { ICustomRange } from '../../../../types/interfaces';
|
|
3
|
+
import { DataStreamTreeTokenType } from '../../types';
|
|
2
4
|
export declare function isCustomRangeSplitSymbol(text: string): text is DataStreamTreeTokenType.CUSTOM_RANGE_START | DataStreamTreeTokenType.CUSTOM_RANGE_END;
|
|
3
5
|
export declare function isIntersecting(line1Start: number, line1End: number, line2Start: number, line2End: number): boolean;
|
|
4
6
|
export declare function shouldDeleteCustomRange(deleteStart: number, deleteLen: number, customRange: ICustomRange, dataStream: string): boolean;
|
|
@@ -7,7 +9,7 @@ export declare function copyCustomRange(range: ICustomRange): {
|
|
|
7
9
|
rangeId: string;
|
|
8
10
|
startIndex: number;
|
|
9
11
|
endIndex: number;
|
|
10
|
-
rangeType: import('
|
|
12
|
+
rangeType: import('../../../..').CustomRangeType | number;
|
|
11
13
|
wholeEntity?: boolean;
|
|
12
14
|
properties?: Record<string, any> | undefined;
|
|
13
15
|
};
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import { IDocumentBody
|
|
1
|
+
import { IDocumentBody } from '../../../types/interfaces';
|
|
2
|
+
import { IRetainAction } from './action-types';
|
|
2
3
|
export declare function transformBody(thisAction: IRetainAction, otherAction: IRetainAction, priority?: boolean): IDocumentBody;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { ICommandService, Univer } from '@univerjs/core';
|
|
2
1
|
import { Dependency } from '../../common/di';
|
|
2
|
+
import { Univer } from '../../univer';
|
|
3
|
+
import { ICommandService } from '../command/command.service';
|
|
3
4
|
export declare const createTestBed: (dependencies?: Dependency[]) => {
|
|
4
5
|
univer: Univer;
|
|
5
6
|
get: {
|
|
@@ -10,7 +11,7 @@ export declare const createTestBed: (dependencies?: Dependency[]) => {
|
|
|
10
11
|
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity?: import('@wendellhu/redi').Quantity, lookUp?: import('@wendellhu/redi').LookUp): T[] | T | null;
|
|
11
12
|
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantityOrLookup?: import('@wendellhu/redi').Quantity | import('@wendellhu/redi').LookUp, lookUp?: import('@wendellhu/redi').LookUp): T[] | T | null;
|
|
12
13
|
};
|
|
13
|
-
workbook: import('
|
|
14
|
+
workbook: import('../..').UnitModel<object, number>;
|
|
14
15
|
unitId: string;
|
|
15
16
|
subUnitId: string;
|
|
16
17
|
commandService: ICommandService;
|